@dk-address/web 0.1.2 → 0.1.3
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/README.md +1 -1
- package/dist/dk-address.js +3 -3
- package/dist/dk-address.js.map +50 -49
- package/dist/elements.d.ts +11 -0
- package/dist/elements.js +66 -13
- package/dist/index.d.ts +1 -1
- package/package.json +5 -5
package/dist/dk-address.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Bu=Object.defineProperty;var _u=(e)=>e;function zu(e,t){this[e]=_u.bind(null,t)}var Yu=(e,t)=>{for(var n in t)Bu(e,n,{get:t[n],enumerable:!0,configurable:!0,set:zu.bind(t,n)})};var ue=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};function gt(){return be&&(/iP(hone|ad|od)/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function sn(e){return!!e&&be&&getComputedStyle(e).direction==="rtl"}var be;var Ie=ue(()=>{be=typeof window<"u"&&typeof document<"u"});function jd(e,t){let n=Vs.get(e);if(!n)Vs.set(e,n={});let r=n[t];if(r?.isConnected)return r;let o=e.createElement("div");return o.setAttribute("role",t==="assertive"?"alert":"status"),o.setAttribute("aria-live",t),o.setAttribute("aria-atomic","true"),o.setAttribute("data-ui-sdk-announcer",t==="assertive"?"assertive":""),o.style.cssText="position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap",e.body.append(o),n[t]=o,o}function Ks(e,{priority:t="polite",doc:n=typeof document>"u"?void 0:document}={}){if(!e)return;if(qs)return qs(e,t);if(!n?.body)return;let r=jd(n,t);r.textContent="",clearTimeout(Hs[t]),Hs[t]=setTimeout(()=>{r.textContent=e},100)}var Vs,qs,Hs;var Bs=ue(()=>{Vs=new WeakMap,Hs={}});function Ke(e,t,n){let r=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);e.style.setProperty(t,n);let s=e.style.getPropertyValue(t);return()=>{if(e.style.getPropertyValue(t)!==s)return;if(r)e.style.setProperty(t,r,o);else e.style.removeProperty(t)}}function Xr(e){if(typeof CSS>"u"||!CSS.registerProperty)return;for(let t of e){if(ia.has(t))continue;ia.add(t);try{CSS.registerProperty({name:t,syntax:"*",inherits:!1})}catch{}}}function aa(e){if(Yr.has(e))return Yr.get(e);let t;for(let r=e;r&&!t;r=r.defaultView?.frameElement?.ownerDocument)t=r.head?.querySelector('meta[property="csp-nonce"]');let n=t?t.nonce||t.getAttribute("nonce")||"":null;return Yr.set(e,n),n}function xe(e,t,n){if(!e.head)return;let r=e.defaultView;if(aa(e)===""&&r&&"adoptedStyleSheets"in e)Ud(e,r,t,n);else Yd(e,t,n)}function Yd(e,t,n){let r=e.getElementById(t);if(r){if(Ur.get(r)===n)return;if(r.textContent!==n)r.textContent=n;Ur.set(r,n);return}let o=e.createElement("style");o.id=t;let s=aa(e);if(s)o.nonce=s;o.textContent=n,Ur.set(o,n);let a=e.head.querySelectorAll(':scope > style[id^="ui-sdk-"]');if(a.length)a[a.length-1].after(o);else e.head.prepend(o)}function Ud(e,t,n,r){let o=sa().get(e);if(!o)sa().set(e,o=new Map);let s=o.get(n);if(!s)o.set(n,s={sheet:new t.CSSStyleSheet,css:""});if(s.css!==r)s.sheet.replaceSync(r),s.css=r;if(!e.adoptedStyleSheets.includes(s.sheet))e.adoptedStyleSheets=[...e.adoptedStyleSheets,s.sheet]}function Gr(e){xe(e,"ui-sdk-hidden",'@layer ui-sdk { :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important } }')}function Nt(e){if(typeof window>"u")return;if(!performance.getEntriesByType("paint").length)e();else if($t)$t.push(e);else $t=[e],(window.requestIdleCallback??setTimeout)(()=>{let t=$t;$t=void 0,t.forEach((n)=>n())})}function la(e){let t,n=requestAnimationFrame(()=>{t=setTimeout(e)});return()=>{cancelAnimationFrame(n),clearTimeout(t)}}var ia,sa=()=>globalThis[Symbol.for("ui-sdk.styles@1")]??=new WeakMap,Yr,Ur,$t;var Oe=ue(()=>{ia=new Set;Yr=new WeakMap;Ur=new WeakMap});function J(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Mn(e){let t="nativeEvent"in e?e.nativeEvent:e;return t.isComposing===!0||t.keyCode===229}var Se=()=>{};function Wn(e){if(!e.towardMore)return e.scrollAtStart?"sheet":"scroll";return!e.atLargest&&e.expandOnScroll?"sheet":"scroll"}var yo=()=>{};function Bf(e,t){return e*t/(1-t)}function vo(e){let{extent:t,velocity:n,candidates:r}=e;if(Math.abs(n)<e.minFlingVelocity)return $e(r,t);let o=t+Bf(n,e.rate),s=_f(r,t,Math.sign(n)),a=$e(r,o);if((n>0?r[a]<=t+0.5:r[a]>=t-0.5)&&s!==-1)a=s;if(!e.skipSnapPoints&&s!==-1)a=n>0?Math.min(a,s):Math.max(a,s);return a}function $e(e,t){let n=0;for(let r=1;r<e.length;r++)if(Math.abs(e[r]-t)<Math.abs(e[n]-t))n=r;return n}function _f(e,t,n){if(n>0)return e.findIndex((r)=>r>t+0.5);for(let r=e.length-1;r>=0;r--)if(e[r]<t-0.5)return r;return-1}var jn=()=>{};function xo(e,t,n=wo){if(e<=0)return 0;return(1-1/(e*n/t+1))*t}function Vn(e,t,n=wo){if(e<=0)return 0;return(1/(1-Math.min(e/t,0.999999))-1)*t/n}function yl(e,t,n=wo){if(e<=0)return 1;let r=e*n/t+1;return n/(r*r)}var wo=0.55;var vl=()=>{};function kt(e,t,n,r){let o=2*Math.PI/(e*1000),s=t;if(Math.abs(s-1)<0.000001)return Yf(o,n,r);if(s<1)return zf(o,s,n,r);return Uf(o,s,n,r)}function zf(e,t,n,r){let o=t*e,s=e*Math.sqrt(1-t*t),a=(r+o*n)/s;return{position:(i)=>Math.exp(-o*i)*(n*Math.cos(s*i)+a*Math.sin(s*i)),velocity:(i)=>{let l=Math.cos(s*i),c=Math.sin(s*i);return Math.exp(-o*i)*((a*s-o*n)*l-(n*s+o*a)*c)}}}function Yf(e,t,n){let r=n+e*t;return{position:(o)=>Math.exp(-e*o)*(t+r*o),velocity:(o)=>Math.exp(-e*o)*(r-e*(t+r*o))}}function Uf(e,t,n,r){let o=Math.sqrt(t*t-1),s=-e*(t+o),a=-e*(t-o),i=(r-s*n)/(a-s),l=n-i;return{position:(c)=>i*Math.exp(a*c)+l*Math.exp(s*c),velocity:(c)=>i*a*Math.exp(a*c)+l*s*Math.exp(s*c)}}function qn(e,{positionTolerance:t=0.5,velocityTolerance:n=0.02,step:r=1,limit:o=1e4}={}){for(let s=0;s<=o;s+=r)if(Math.abs(e.position(s))<=t&&Math.abs(e.velocity(s))<=n)return s;return o}function Hn(e,t,n,r,o=8.333333333333334){let s=n-t;if(Math.abs(s)<0.000001)return"linear";let a=[];for(let i=0;i<r;i+=o)a.push(Xf(1+e.position(i)/s));return a.push("1"),`linear(${a.join(", ")})`}function Xf(e){return String(Math.round(e*1e4)/1e4)}var Kn=()=>{};function he(e,t){return{phase:"idle",extent:e,restingIndex:t}}function Bn(e,t,n){switch(t.type){case"down":return Qf(e,t,n);case"move":return Jf(e,t,n);case"up":return tp(e,t,n);case"settled":return np(e);case"rest":return rp(e,t,n);case"snap-to":return op(e,t,n);case"nudge":return ip(e,t,n);case"close":return st(e,n,{targetIndex:-1,motion:So(e,t.time),time:t.time,reason:"imperative",outcome:{type:"dismiss",reason:"imperative"}})}}function So(e,t){if(e.phase!=="settling")return{extent:e.extent,velocity:0};let n=kt(e.response,e.dampingRatio,e.from-e.to,e.velocity),r=Math.max(0,t-e.startTime);return{extent:e.to+n.position(r),velocity:n.velocity(r)}}function Qf(e,t,n){let r=t.pointer==="mouse"?n.physics.mouseSlop:n.physics.touchSlop;if(e.phase==="idle"&&e.restingIndex>=0)return{state:{...e,phase:"pending",originX:t.x,originY:t.y,slop:r},effects:Ae};if(e.phase!=="settling")return{state:e,effects:Ae};let{extent:o}=So(e,t.time);return{state:{phase:"dragging",extent:o,restingIndex:e.restingIndex,anchorY:t.y,anchorExtent:sp(o,n),lastY:t.y,isScrollingContent:!1},effects:[{type:"move",extent:o}]}}function Jf(e,t,n){if(e.phase==="pending")return Zf(e,t,n);if(e.phase==="scrolling"&&n.contentScroll)return n.contentScroll.move(e,t);if(e.phase==="dragging")return ep(e,t,n);return{state:e,effects:Ae}}function Zf(e,t,n){let r=t.x-e.originX,o=t.y-e.originY;if(Math.max(Math.abs(r),Math.abs(o))<e.slop)return{state:e,effects:Ae};if(Math.abs(r)>Math.abs(o))return{state:he(e.extent,e.restingIndex),effects:Ae};let s=n.contentScroll?.claim(e,t,o<0,n);if(s)return{state:s,effects:Ae};let a={...ko(e,e.originY+Math.sign(o)*e.slop),lastY:t.y},i=wl(a.anchorExtent+(a.anchorY-t.y),n);return{state:{...a,extent:i},effects:[{type:"move",extent:i}]}}function ko(e,t){return{phase:"dragging",extent:e.extent,restingIndex:e.restingIndex,anchorY:t,anchorExtent:e.extent,lastY:t,isScrollingContent:!1}}function ep(e,t,n){let r=e.lastY-t.y,o=e.isScrollingContent?{anchorY:e.lastY,anchorExtent:e.extent}:e,s=o.anchorExtent+(o.anchorY-t.y),a=n.contentScroll?.drag(e,t,r,s,n);if(a)return a;let i=wl(s,n);return{state:{...e,anchorY:o.anchorY,anchorExtent:o.anchorExtent,extent:i,lastY:t.y,isScrollingContent:!1},effects:[{type:"move",extent:i}]}}function tp(e,t,n){if(e.phase==="pending"||e.phase==="scrolling")return{state:he(e.extent,e.restingIndex),effects:Ae};if(e.phase!=="dragging")return{state:e,effects:Ae};let r=n.contentScroll?.release(e,t,n);if(r)return r;let o=-t.velocity*ap(e.extent,n),s=[0,...xl(n)],a=n.physics,i={candidates:s,rate:a.projectionRate,minFlingVelocity:a.minFlingVelocity,skipSnapPoints:a.skipSnapPoints},l=vo({...i,extent:e.extent,velocity:o}),c={motion:{extent:e.extent,velocity:o},time:t.time,reason:"swipe"};if(n.dismissible){if(l>0)return st(e,n,{...c,targetIndex:l-1});return st(e,n,{...c,targetIndex:-1,outcome:{type:"dismiss",reason:"swipe"}})}let d=e.anchorExtent+(e.anchorY-e.lastY),h=vo({...i,extent:d,velocity:-t.velocity})===0,u=Math.max(0,l-1);if(!h)return st(e,n,{...c,targetIndex:u});return st(e,n,{...c,targetIndex:0,outcome:{type:"attempt-dismiss",reason:"swipe"}})}function np(e){if(e.phase!=="settling")return{state:e,effects:Ae};return{state:he(e.to,e.targetIndex),effects:Ae}}function rp(e,t,n){if(t.extent<1&&n.dismissible)return{state:he(0,-1),effects:[{type:"dismiss",reason:"swipe"}]};let r=$e(xl(n),t.extent),o=r===e.restingIndex?[]:[{type:"snap",id:n.snapPoints[r].id,reason:"swipe"}];return{state:he(t.extent,r),effects:o}}function op(e,t,n){let r=n.snapPoints.findIndex((o)=>o.id===t.id);if(r===-1||e.phase==="dragging")return{state:e,effects:Ae};return st(e,n,{targetIndex:r,motion:So(e,t.time),time:t.time,reason:t.reason})}function ip(e,t,n){if(e.phase!=="idle"||e.restingIndex<0)return{state:e,effects:Ae};return st(e,n,{targetIndex:e.restingIndex,motion:{extent:e.extent,velocity:-Gf},time:t.time,reason:"imperative"})}function st(e,t,n){let{targetIndex:r,motion:o,time:s,reason:a}=n,i=t.physics,l=r<0?0:t.snapPoints[r].extent,d=Math.abs(o.velocity)>=i.minFlingVelocity?i.momentumDampingRatio:i.dampingRatio,h={phase:"settling",extent:o.extent,restingIndex:e.restingIndex,targetIndex:r,from:o.extent,to:l,velocity:o.velocity,response:i.response,dampingRatio:d,startTime:s},u=[{type:"settle",from:o.extent,to:l,velocity:o.velocity,response:i.response,dampingRatio:d}];if(r>=0&&r!==e.restingIndex)u.push({type:"snap",id:t.snapPoints[r].id,reason:a});if(n.outcome)u.push(n.outcome);return{state:h,effects:u}}function wl(e,t){let n=At(t),{coefficient:r,dimension:o}=Ao(t);if(e>n)return n+xo(e-n,o,r);if(t.dismissible)return Math.max(0,e);let s=t.snapPoints[0].extent;if(e<s)return s-xo(s-e,o,r);return e}function sp(e,t){let n=At(t),{coefficient:r,dimension:o}=Ao(t);if(e>n)return n+Vn(e-n,o,r);let s=t.snapPoints[0].extent;if(!t.dismissible&&e<s)return s-Vn(s-e,o,r);return e}function Ao(e){return{coefficient:e.physics.rubberBand,dimension:e.physics.rubberBandDimension??e.dimension}}function ap(e,t){let{coefficient:n,dimension:r}=Ao(t),o=At(t),s=t.snapPoints[0].extent,a=e>o?e-o:!t.dismissible&&e<s?s-e:0;if(a<=0)return 1;return yl(Vn(a,r,n),r,n)}function At(e){return e.snapPoints[e.snapPoints.length-1].extent}function xl(e){return e.snapPoints.map((t)=>t.extent)}var Ae,Gf=1;var _n=ue(()=>{jn();vl();Kn();Ae=[]});var Sl,kl;var Al=ue(()=>{yo();_n();Sl=[],kl={claim(e,t,n,r){if(!t.scroll)return;if(Wn({towardMore:n,scrollAtStart:t.scroll.atStart,atLargest:e.extent>=At(r)-0.5,expandOnScroll:r.expandOnScroll})!=="scroll")return;return{phase:"scrolling",extent:e.extent,restingIndex:e.restingIndex,lastY:t.y}},move(e,t){if(t.y>e.lastY&&t.scroll?.atStart)return{state:ko(e,t.y),effects:Sl};return{state:{...e,lastY:t.y},effects:Sl}},drag(e,t,n,r,o){let s=t.scroll;if(!s)return;if(e.isScrollingContent&&(n>0?!s.atEnd:!s.atStart)){let c=[{type:"scroll",delta:n}];return{state:{...e,lastY:t.y},effects:c}}let a=At(o);if(!(n>0&&r>a&&e.extent<=a&&!s.atEnd))return;let i=[{type:"scroll",delta:r-a}];if(e.extent!==a)i.unshift({type:"move",extent:a});return{state:{...e,extent:a,anchorY:t.y,anchorExtent:a,lastY:t.y,isScrollingContent:!0},effects:i}},release(e,t,n){if(!e.isScrollingContent)return;let r=n.snapPoints.length-1,o=[{type:"fling-scroll",velocity:-t.velocity}];if(e.restingIndex!==r)o.push({type:"snap",id:n.snapPoints[r].id,reason:"swipe"});return{state:he(e.extent,r),effects:o}}}});var zn;var El=ue(()=>{zn={ios:{response:0.34,dampingRatio:1,momentumDampingRatio:0.88,projectionRate:0.99,minFlingVelocity:0.5,skipSnapPoints:!0,rubberBand:1.9,rubberBandDimension:24,touchSlop:8,mouseSlop:4,dim:0.2,velocityHorizon:70}}});function lp(e){return String(e)}function cp(e,t){if(typeof e==="number")return e<=1?e*t.container:e;if(e==="content")return t.content;let n=parseFloat(e);if(e.endsWith("rem"))return n*t.rootFontSize;if(e.endsWith("%"))return n/100*t.container;if(e.endsWith("px"))return n;return NaN}function Cl(e,t){let n=e.map((o,s)=>({value:o,index:s,extent:Math.min(cp(o,t),t.content)})).filter((o)=>o.extent>0).sort((o,s)=>o.extent-s.extent||o.index-s.index),r=[];for(let o of n){let s=lp(o.value),a=r[r.length-1];if(a&&o.extent-a.extent<1){if(a.ids.push(s),o.index>a.index)Object.assign(a,{id:s,value:o.value,index:o.index});a.extent=Math.max(a.extent,o.extent);continue}r.push({id:s,value:o.value,extent:Math.round(o.extent*100)/100,ids:[s],index:o.index})}return r.map(({index:o,...s})=>s)}function at(e,t){if(t===null||t===void 0)return-1;let n=String(t);return e.findIndex((r)=>r.ids.includes(n))}function Ml(e,t,n){let r=at(e,n),o=at(e,t);return r>=0&&o>=0&&o<=r}var Pl=()=>{};function up(e,t,n){let r=Math.max(0,t.layoutHeight-t.offsetTop-t.height);if(Math.abs(t.height-t.layoutHeight)<=1)Ol.set(e,t.scale);if(n>0)return Math.round(Math.min(n,r));return t.scale>(Ol.get(e)??1)+0.01?0:Math.round(r)}function Tl(e,t){let n=e.ownerDocument.defaultView,r=n?.visualViewport;if(!n||!r)return()=>{};let o=null,s=(l)=>{let c=up(n,l,0),d=o!==null&&c!==o;if(o=c,d)t?.before();if(e.style.setProperty("--keyboard-inset",`${c}px`),e.style.setProperty("--visual-viewport-height",`${Math.round(l.height)}px`),c>0)e.setAttribute("data-keyboard","");else e.removeAttribute("data-keyboard");if(d)t?.after()},a=pp.get(n);s(a&&a.layoutHeight-a.offsetTop-a.height<=1?a:Dl(n,r));let i=fp(n,r,s);return()=>{i(),e.style.removeProperty("--keyboard-inset"),e.style.removeProperty("--visual-viewport-height"),e.removeAttribute("data-keyboard")}}function Dl(e,t){return{width:t.width,layoutHeight:e.innerHeight,height:t.height,offsetTop:t.offsetTop,scale:t.scale}}function dp(e,t){let n=new Set,r=(a)=>{let i=Dl(e,t);for(let l of n)l(i,a)};t.addEventListener("resize",r),t.addEventListener("scroll",r);let s={followers:n,stop:()=>{t.removeEventListener("resize",r),t.removeEventListener("scroll",r),Eo.delete(t)}};return Eo.set(t,s),s}function fp(e,t,n){let{followers:r,stop:o}=Eo.get(t)??dp(e,t);return r.add(n),()=>{if(r.delete(n)&&!r.size)o()}}var Ol,Eo,pp;var Ll=ue(()=>{Ol=new WeakMap;Eo=new WeakMap;pp=new WeakMap});function Ht(e,t=!1){if(e==="start")return t?"right":"left";if(e==="end")return t?"left":"right";return e}var Yn;var Un=ue(()=>{Yn={top:"bottom",bottom:"top",left:"right",right:"left"}});function Co(e,t){return Ht(e,e==="start"||e==="end"?sn(t):!1)}function lt(e,t,n,r){let o=Ne(e);return r.y=(o?n:t)*Il(e),r.x=o?t:n,r}function Kt(e,t){let n=`${Math.round(t*Il(e)*100)/100}px`;return Ne(e)?`0 ${n}`:`${n} 0`}function Fl(e,t){return Ne(t)?e.offsetHeight:e.offsetWidth}function Rl(e,t,n){let r=Mo(e,t,n);if(!r)return null;let{start:o,end:s}=hp(r,n);return{atStart:o,atEnd:s,area:r}}function Mo(e,t,n){let r=t.ownerDocument.defaultView;if(!r||!(e instanceof Element)||!t.contains(e))return null;let o=Ne(n);for(let s=e;s&&s!==t.parentElement;s=s.parentElement){if(!(o?s.scrollHeight>s.clientHeight+1:s.scrollWidth>s.clientWidth+1)||!(s instanceof HTMLElement))continue;let i=o?r.getComputedStyle(s).overflowY:r.getComputedStyle(s).overflowX;if(/auto|scroll/.test(i))return s}return null}function mp(e,t){if(Ne(t)){let s=e.scrollHeight-e.clientHeight;return{position:t==="bottom"?e.scrollTop:s-e.scrollTop,max:s}}let n=e.scrollWidth-e.clientWidth,r=Math.abs(e.scrollLeft),o=sn(e)?n-r:r;return{position:t==="right"?o:n-o,max:n}}function hp(e,t){let{position:n,max:r}=mp(e,t);return{start:n<=0.5,end:n>=r-1}}function Po(e,t,n){if(Ne(t))e.scrollTop+=t==="bottom"?n:-n;else{let r=t==="right"?n:-n;e.scrollLeft+=sn(e)?-r:r}}var Ne=(e)=>e==="bottom"||e==="top",Il=(e)=>e==="bottom"||e==="right"?1:-1;var Oo=ue(()=>{Ie();Un()});function Gn(e,t){e.requestAnimationFrame(()=>e.requestAnimationFrame(t))}function Qn(e){return e==="bottom"?-We:-32}function Jn(e,t){let n=[];for(let r=0;r<e.duration;r+=16.666666666666668)n.push(t(e.extentAt(r)));return n.push(t(e.extentAt(e.duration))),n}function ct(e,t){let n=Object.entries(t).map(([r,o])=>Ke(e,r,o));return()=>n.forEach((r)=>r())}var Xn=1000,We=120,$l=200,Nl=150;var Zn=ue(()=>{Oe()});function Wl(e,t,n=-1){let r=n<0?0:t[n],o=n<0?t[0]:t[n+1];if(o===void 0||o<=r)return e>r?1:0;return To((e-r)/(o-r))}function jl(e,t){let n=t[t.length-1],r=t.length>1?t[t.length-2]:0;if(n<=r)return e>=n?1:0;return To((e-r)/(n-r))}function Vl(e,t){let n=t[t.length-1];return n>0?To(e/n):0}var To=(e)=>Math.max(0,Math.min(1,e));var ql=()=>{};function zl(e){let t=e.defaultView?.CSS;if(Lo.has(e)||!t?.registerProperty)return;Lo.add(e);for(let n of Do)try{t.registerProperty({name:n,syntax:"<number>",inherits:!1,initialValue:"0"})}catch{}}function Yl(){if(typeof document<"u"&&!Lo.has(document))Nt(()=>zl(document))}function Ul(e){zl(e.sheet.ownerDocument);let t=[1],n=-1,r=[],o=new Map,s={dim:0,progress:0,expand:0},a;function i(L){t=L.snapExtents.length?L.snapExtents:[1],n=L.undimmedIndex}function l(L,R=s){return R.dim=er(Wl(L,t,n)),R.progress=er(Vl(L,t)),R.expand=er(jl(L,t)),R}let c=!1;function d(L,{rest:R=!1}={}){if(c)return;N(),l(L),h(s.dim),x(e.sheet,s),v(s.progress);for(let V of e.outlets())if(x(V.el,s),V.keyframes)w(V,s.expand,R);if(R)e.themeColor?.(s.dim)}function h(L){let R=e.backdrop();if(R)R.style.opacity=String(L);let V=u();if(V)V.currentTime=L*1000}function u(){if(!e.dimmed||a)return a;return a=e.dimmed.animate({opacity:[0,1]},{...Kl,duration:1000,fill:"both"}),a.pause(),a.currentTime=0,a}function v(L){let R=e.ancestors();for(let V=0;V<R.length;V++)R[V].style.setProperty("--drawer-stack",String(V+L))}function x(L,{dim:R,progress:V,expand:z}){L.style.setProperty("--drawer-progress",String(V)),L.style.setProperty("--drawer-dim",String(R)),L.style.setProperty("--drawer-expand",String(z))}function w(L,R,V){let z=o.get(L.el);if(!z)z=L.el.animate(Bl(L.keyframes),{duration:1000,fill:"both"}),z.pause(),o.set(L.el,z);if(z.currentTime=R*1000,!V)return;z.commitStyles?.(),z.cancel(),o.delete(L.el)}function k(L){if(c)return;if(N(),q(),!Bt())return d(L.type==="settle"?L.extentAt(L.duration):0,{rest:!0});let R=M(L);u();let V=L.type==="settle"?{duration:Math.max(1,L.duration),fill:"both"}:{timeline:L.timeline,fill:"both"},z=(ee,E,p,b)=>{let C=ee.animate(E,{...V,...b,easing:gp(p)});if(L.type==="settle")C.startTime=L.startTime;r.push(C)},Z=e.backdrop();if(Z)z(Z,{opacity:[0,1]},R.dim);if(e.dimmed)z(e.dimmed,{opacity:[0,1]},R.dim,Kl);A(e.sheet,R,z),e.ancestors().forEach((ee,E)=>z(ee,{"--drawer-stack":[E,E+1]},R.progress));for(let ee of e.outlets())if(A(ee.el,R,z),ee.keyframes)z(ee.el,Bl(ee.keyframes),R.expand);if(L.type!=="settle")return;let ne=L.extentAt(L.duration);W(ne);let re=r;if(re[0])re[0].onfinish=()=>r===re&&N()}function A(L,R,V){V(L,{"--drawer-progress":[0,1]},R.progress),V(L,{"--drawer-dim":[0,1]},R.dim),V(L,{"--drawer-expand":[0,1]},R.expand)}function W(L){let R=l(L,{dim:0,progress:0,expand:0});h(R.dim),x(e.sheet,R),v(R.progress);for(let V of e.outlets()){if(x(V.el,R),!V.keyframes)continue;for(let[z,Z]of Object.entries(V.keyframes)){let ne=Z[R.expand>=0.5?Z.length-1:0];V.el.style.setProperty(_l(z),String(ne))}}e.themeColor?.(R.dim)}function M(L){let R={dim:[],progress:[],expand:[]},V={dim:0,progress:0,expand:0},z=L.type==="settle"?Math.max(2,Math.ceil(L.duration/Hl)+1):61;for(let Z=0;Z<z;Z++){let ne=Z/(z-1),re=L.type==="settle"?L.extentAt(Math.min(L.duration,Z*Hl)):L.extentAt(ne);l(re,V),R.dim.push(V.dim),R.progress.push(V.progress),R.expand.push(V.expand)}return R}function I(L){for(let R of r)R.startTime=L}function N(){if(!r.length)return;for(let L of r)L.cancel();r=[]}function q(){for(let L of o.values())L.cancel();o.clear()}function Q(){c=!0,N(),q(),e.backdrop()?.style.removeProperty("opacity"),a?.cancel();for(let L of Do.slice(0,3))e.sheet.style.removeProperty(L);for(let L of e.outlets()){for(let R of Do.slice(0,3))L.el.style.removeProperty(R);for(let R of Object.keys(L.keyframes??{}))L.el.style.removeProperty(_l(R))}}return{configure:i,compute:l,apply:d,play:k,sync:I,follow:k,stop:N,destroy:Q}}function gp(e){return`linear(${e.map(er).join(", ")})`}function _l(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var Hl=16.666666666666668,Do,Lo,Bt=()=>typeof CSS<"u"&&CSS.supports("animation-timing-function","linear(0, 1)"),er=(e)=>Math.round(e*1e4)/1e4,Kl,Bl=(e)=>e;var _t=ue(()=>{ql();Oe();Do=["--drawer-progress","--drawer-dim","--drawer-expand","--drawer-stack"],Lo=new WeakSet;Kl={pseudoElement:"::backdrop"}});function yp(e,t,n=0,r=e.length){let o=r-n;if(o<2)return 0;let s=e[r-1];if(o<4)return Xl(e,t,n,r);let a=0,i=0,l=0,c=0,d=0,h=0,u=0,v=0;for(let k=n;k<r;k++){let A=e[k]-s,W=t[k],M=A*A;a+=1,i+=A,l+=M,c+=M*A,d+=M*M,h+=W,u+=W*A,v+=W*M}let x=a*(l*d-c*c)-i*(i*d-c*l)+l*(i*c-l*l);if(Math.abs(x)<0.000000001)return Xl(e,t,n,r);return(a*(u*d-c*v)-h*(i*d-c*l)+l*(i*v-u*l))/x}function Xl(e,t,n,r){let o=0,s=0,a=r-n;for(let c=n;c<r;c++)o+=e[c]/a,s+=t[c]/a;let i=0,l=0;for(let c=n;c<r;c++){let d=e[c]-o;i+=d*(t[c]-s),l+=d*d}return l>0?i/l:0}function Gl(e={}){let{horizon:t,staleAfter:n,maxSpeed:r,capacity:o}={...bp,...e},s=new Float64Array(o),a=new Float64Array(o),i=new Float64Array(o),l=new Float64Array(o),c=0,d=-1;function h(x,w){if(c>0&&x<=s[d])return;d=(d+1)%o,s[d]=x,a[d]=w,c=Math.min(c+1,o)}function u(x){if(c<2)return 0;let w=s[d];if(x-w>n)return 0;let k=0;for(let W=c-1;W>=0;W--){let M=(d-W+o)%o;if(w-s[M]>t)continue;i[k]=s[M],l[k]=a[M],k++}let A=yp(i,l,0,k);return Math.max(-r,Math.min(r,A))}function v(){c=0,d=-1}return{add:h,velocity:u,reset:v}}var bp;var Ql=ue(()=>{bp={horizon:70,staleAfter:40,maxSpeed:8,capacity:20}});function Jl(e,t=!1,n){let r=e.defaultView??window,o=(c)=>n===void 0||!("pointerId"in c)||c.pointerId===n,s=(c)=>{if(!o(c))return;c.preventDefault(),c.stopPropagation(),e.removeEventListener("click",s,!0)},a=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointerdown",i,!0),e.removeEventListener("pointerup",l,!0),e.removeEventListener("pointercancel",l,!0)},i=(c)=>o(c)&&a(),l=(c)=>o(c)&&r.setTimeout(a);if(e.addEventListener("click",s,!0),e.addEventListener("pointerdown",i,!0),!t)return r.setTimeout(a);e.addEventListener("pointerup",l,!0),e.addEventListener("pointercancel",l,!0)}var vp,tr=(e)=>vp.has(e);var Zl=ue(()=>{vp=new WeakSet});function ec(e){let{sheet:t}=e,n=t.ownerDocument,r=n.defaultView??window,o=he(0,-1),s=0,a=null,i=0,l=0,c=null,d=null,h=null,u=null,v=null,x=null,w=null,k=!1,A=!1,W=null,M=null,I=null,N={x:0,y:0},q=Gl({horizon:e.config().physics.velocityHorizon}),Q=[J(n,"touchstart",U,{capture:!0,passive:!0}),J(n,"touchmove",oe,{capture:!0,passive:!1}),J(n,"touchend",ae,{capture:!0,passive:!0}),J(n,"touchcancel",ae,{capture:!0,passive:!0}),J(t,"pointerdown",f)],L=!1;function R(g){if(L)return;t.style.translate=Kt(e.side(),e.size()-g),s=g}function V(g,O){if(L)return;let D=Bn(o,g,e.config());o=D.state;let H="time"in g?g.time:performance.now();for(let j of D.effects)z(j,H,O);let B=o.phase==="dragging";if(B===k)return;k=B,e.onDragChange(k)}function z(g,O,D){switch(g.type){case"move":if(c)ee(),R(g.extent),e.onFrame(g.extent);else a=g.extent,p();return;case"settle":return Z(g,O);case"scroll":return i+=g.delta,p();case"fling-scroll":if(v)u={velocity:g.velocity,startTime:O,startScroll:0,area:v};return p();case"snap":return M=g.id,e.onSnap(g.id,g.reason,D);case"dismiss":if(g.reason!=="swipe")return;return h="swipe",e.onDismiss(D);case"attempt-dismiss":return e.onDismissAttempt(D)}}function Z(g,O){ee(),a=null;let D=e.closedExtent(),H=g.from<=0?D:g.from,B=g.to<=0?D:g.to,j=e.reducedMotion()&&(H===D||B===D),Y=e.reducedMotion()?re(H,B,j):ne(H,B,g);if(R(j?Math.max(B,0):B),Math.abs(B-H)<0.5&&g.velocity===0||Y.duration===0)return E();let X=e.size(),ie=e.side();if(c=j?t.animate({opacity:H===D?[0,1]:[1,0]},{duration:Y.duration,fill:"both"}):Math.abs(B-H)<1||!Bt()?t.animate({translate:Jn(Y,(G)=>Kt(ie,X-G))},{duration:Y.duration,fill:"backwards"}):t.animate({translate:[Kt(ie,X-H),Kt(ie,X-B)]},{duration:Y.duration,easing:Y.easing,fill:"backwards"}),j)d=c;let le=c;c.onfinish=()=>{if(c===le)E()},c.startTime=O,e.onMotion({type:"settle",extentAt:Y.extentAt,startTime:O,duration:Y.duration})}function ne(g,O,D){let H=kt(D.response,D.dampingRatio,g-O,D.velocity),B=qn(H);return{duration:B,easing:Hn(H,g,O,B),extentAt:(j)=>O+H.position(j)}}function re(g,O,D){let H=D?Nl:$l,B=(j)=>1-(1-j)**3;return{duration:H,easing:"cubic-bezier(0.33, 1, 0.68, 1)",extentAt:(j)=>g+(O-g)*B(Math.min(1,j/H))}}function ee(){if(c?.cancel(),c=null,d)d.cancel(),d=null}function E(){if(ee(),V({type:"settled"}),o.phase!=="idle")return;if(o.restingIndex<0)return h=null,M=null,e.onRest(null);M=e.config().snapPoints[o.restingIndex].id,e.onRest(M)}function p(){l||=r.requestAnimationFrame(b)}function b(g){if(l=0,i&&v)Po(v,e.side(),i),i=0;if(u)C(g);if(a===null)return;R(a),a=null,e.onFrame(s)}function C(g){if(!u)return;let O=Math.max(0,g-u.startTime),D=u.velocity*(Io**O-1)/Math.log(Io);if(Po(u.area,e.side(),D-u.startScroll),u.startScroll=D,Math.abs(u.velocity*Io**O)<0.01)u=null;else p()}function K(g){return g instanceof Element&&g.closest(wp)!==null}function _(g){let O=Rl(g,t,e.side());return v=O?.area??null,O&&{atStart:O.atStart,atEnd:O.atEnd}}function U(g){let O=W!==null&&tr(W);if(W=null,x||g.touches.length>1||h||O)return;if(!e.owns(g.target)||K(g.target))return;let D=g.changedTouches[0];x={id:D.identifier,originX:D.clientX,originY:D.clientY},u=null,q.reset(),lt(e.side(),D.clientX,D.clientY,N),q.add(g.timeStamp,N.y),V({type:"down",time:g.timeStamp,x:N.x,y:N.y,pointer:"touch"},g)}function oe(g){let O=P(g.changedTouches);if(!O)return;lt(e.side(),O.clientX,O.clientY,N),q.add(g.timeStamp,N.y);let D=o.phase==="dragging",H=_(g.target);if(V({type:"move",time:g.timeStamp,x:N.x,y:N.y,scroll:H},g),o.phase==="pending")return ce(g,O,H);if(o.phase!=="dragging")return;if(g.cancelable)g.preventDefault();else if(!D&&v)v.style.overscrollBehavior="none"}function ce(g,O,D){if(!g.cancelable||!x)return;let H=lt(e.side(),x.originX,x.originY,{x:0,y:0});if(Math.abs(N.y-H.y)<Math.abs(N.x-H.x))return;let B=e.config().snapPoints.at(-1)?.extent??0;if((D?Wn({towardMore:N.y<H.y,scrollAtStart:D.atStart,atLargest:s>=B-0.5,expandOnScroll:e.config().expandOnScroll}):"sheet")==="sheet")g.preventDefault()}function ae(g){if(!P(g.changedTouches))return;if(x=null,v)v.style.removeProperty("overscroll-behavior");let O=g.type==="touchcancel"?0:q.velocity(g.timeStamp);V({type:"up",time:g.timeStamp,velocity:O},g)}function P(g){if(!x)return null;for(let O=0;O<g.length;O++)if(g[O].identifier===x.id)return g[O];return null}function f(g){if(W=g,g.pointerType==="touch"||g.button!==0||w!==null||h)return;let O=g.target;if(!e.owns(O)||K(O)||!(O instanceof Element)||!e.canMouseDrag(O))return;w=g.pointerId,A=!1,I=o.phase==="settling"&&o.targetIndex>=0?M:null,u=null,q.reset(),lt(e.side(),g.clientX,g.clientY,N),q.add(g.timeStamp,N.y),m=[J(n,"pointermove",y,{capture:!0}),J(n,"pointerup",S,{capture:!0}),J(n,"pointercancel",S,{capture:!0})];let D=g.pointerType==="pen"?"pen":"mouse";V({type:"down",time:g.timeStamp,x:N.x,y:N.y,pointer:D},g)}let m=[];function y(g){if(g.pointerId!==w)return;if(W&&tr(W))return T(g,0,I);let O=g.getCoalescedEvents?.();for(let D of O?.length?O:[g])q.add(D.timeStamp,lt(e.side(),D.clientX,D.clientY,N).y);if(lt(e.side(),g.clientX,g.clientY,N),V({type:"move",time:g.timeStamp,x:N.x,y:N.y,scroll:_(g.target)},g),o.phase!=="dragging"||A)return;A=!0,n.getSelection()?.removeAllRanges(),t.style.userSelect="none";try{t.setPointerCapture(g.pointerId)}catch{}}function S(g){if(g.pointerId!==w)return;if(W&&tr(W))return T(g,0,I);T(g,g.type==="pointercancel"?0:q.velocity(g.timeStamp))}function T(g,O,D=null){w=null,W=null,m.forEach((j)=>j()),m=[],t.style.removeProperty("user-select");let H=g.timeStamp,B=e.config().snapPoints.findIndex((j)=>j.id===D);if(D!==null&&B>=0)o=he(o.extent,B),V({type:"snap-to",time:H,id:D,reason:"imperative"});else V({type:"up",time:H,velocity:O},g);if(A)Jl(n)}return{open(g,O){h=null,M=g,ee();let D=e.config().snapPoints.findIndex((B)=>B.id===g);if(!O&&D>=0)return o=he(e.config().snapPoints[D].extent,D),R(o.extent),e.onRest(g);o=he(0,-1),R(e.closedExtent()),V({type:"snap-to",time:performance.now()+Xn,id:g,reason:"imperative"});let H=c;if(!H)return;Gn(r,(B)=>{if(c!==H||o.phase!=="settling")return;H.startTime=B,o={...o,startTime:B},e.onMotionStart(B)})},close(){let g=h;if(h="close",!g)V({type:"close",time:performance.now()})},snapTo(g,O){if(h==="close")return;h=null,V({type:"snap-to",time:performance.now(),id:g,reason:O})},nudge(){if(!h&&!e.reducedMotion())V({type:"nudge",time:performance.now()})},relayout(g,O){let D=e.config().snapPoints;if(h||M===null||o.phase==="dragging"||o.phase==="pending")return R(s);let H=D.findIndex((ie)=>ie.id===M),B=D.findIndex((ie)=>ie.id===O),j=H>=0?H:B>=0?B:$e(D.map((ie)=>ie.extent),s),{id:Y,extent:X}=D[j];if(o.phase==="idle"){if(o=he(s,H),g||Math.abs(X-s)<0.5){if(o=he(X,j),R(X),!g)return;if(Y!==M)z({type:"snap",id:Y,reason:"content-resize"},performance.now());return e.onRest(Y)}}V({type:"snap-to",time:performance.now(),id:Y,reason:"content-resize"})},target:()=>h?null:M,isMoving:()=>o.phase!=="idle",destroy(){if(L=!0,ee(),l)r.cancelAnimationFrame(l);if(Q.forEach((g)=>g()),m.forEach((g)=>g()),k)e.onDragChange(!1);for(let g of["translate","user-select","opacity"])t.style.removeProperty(g)}}}var Io=0.998,wp='input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-drawer-no-drag]';var tc=ue(()=>{yo();_n();jn();Kn();Ql();Se();Zl();Oo();Zn();_t()});function rc(e){let{sheet:t,host:n}=e,r=t.ownerDocument,o=r.defaultView??window,s=he(0,-1),a=0,i=[],l=null,c=!1,d=!1,h=!1,u=null,v=0,x=0,w=null,k=new Map,A=null,W=ct(n,{inset:`0 0 calc(var(--keyboard-inset, 0px) - ${We}px) 0`,display:"block","overflow-y":"scroll","overflow-x":"hidden","scroll-snap-type":"y mandatory","scrollbar-width":"none","overscroll-behavior":"contain","pointer-events":"auto"}),M=ct(t,{position:"absolute",left:"0",right:"0"}),I="onscrollend"in n,N=o.ScrollTimeline,q=[J(n,"scroll",ee,{passive:!0}),...I?[J(n,"scrollend",C)]:[],J(n,"touchstart",()=>{if(c=!0,d=!1,l&&!u)_()},{passive:!0}),J(n,"touchend",p,{passive:!0}),J(n,"touchcancel",p,{passive:!0})],Q=gt()?1:We+1,L=new IntersectionObserver(K,{root:n,rootMargin:`0px 0px -${Q}px 0px`,threshold:0});L.observe(t);let R=()=>e.config().dimension,V=()=>e.config().snapPoints.at(-1)?.extent??0,z=()=>V()+xp-a,Z=()=>Math.min(n.scrollTop+a,V());function ne(){let m=e.config();a=m.dismissible?-We:m.snapPoints[0].extent,t.style.top=`${R()-a}px`;for(let T of i)T.remove();let y=m.snapPoints.map((T)=>T.extent);i=(m.dismissible?[a,...y]:y).map((T)=>re(T-a,"start")),i.push(re(z()+n.clientHeight-1,"none")),n.append(...i);for(let T of k.keys())if(!t.contains(T))k.delete(T);for(let T of Sp(t))if(!k.has(T))k.set(T,[T.style.getPropertyValue("overflow-y"),T.style.getPropertyPriority("overflow-y")])}function re(m,y){let S=r.createElement("div");return S.setAttribute("aria-hidden","true"),S.style.cssText=`position:absolute;left:0;width:1px;height:1px;top:${m}px;scroll-snap-align:${y};pointer-events:none`,S}function ee(){if(l||u)return;if(A&&c&&Math.abs(n.scrollTop-A.offsetTop)>1)U();if(c&&!h)b(!0);if(!N)x||=o.requestAnimationFrame(E);if(o.clearTimeout(v),!I&&!c)v=o.setTimeout(C,nc)}function E(){x=0,e.onFrame(Z())}function p(){if(c=!1,b(!1),A){U();let m=e.config().snapPoints,y=$e(m.map((S)=>S.extent),Z());return f(m[y].id,"swipe")}if(!e.config().dismissible&&n.scrollTop<-2)e.onDismissAttempt();if(d||!I)v=o.setTimeout(C,nc);d=!1}function b(m){if(h===m)return;h=m,e.onDragChange(m)}function C(){if(c){d=!0;return}if(l||u)return;let m=e.config(),y=Bn(s,{type:"rest",extent:Z()},m);s=y.state;for(let S of y.effects)if(S.type==="snap")w=S.id,e.onSnap(S.id,S.reason);if(s.restingIndex>=0)ae(m.snapPoints[s.restingIndex].id)}function K(m){if(m[m.length-1].isIntersecting||l||u||w===null||!e.config().dismissible)return;u="swipe",w=null,e.onDismiss()}function _(){if(!l)return;let m=Math.max(0,l.extentAt(performance.now()-l.startTime)-a);ce(),A=re(m,"start"),n.append(A),n.scrollTop=m,E(),P()}function U(){A?.remove(),A=null}function oe(m,y,S,T){ce();let g=e.config().physics,O=kt(g.response,g.dampingRatio,y-m,0),D=Math.max(1,qn(O)),H=Math.max(a,m);n.scrollTop=H-a;let B=(ie)=>m+O.position(Math.max(0,ie)),j=Math.abs(m-y)<0.5,Y=!j&&!Bt(),X=t.animate({translate:Y?Jn({duration:D,extentAt:B},(ie)=>`0 ${H-ie}px`):[`0 ${H-y}px`,`0 ${H-m}px`]},{duration:D,easing:j||Y?"linear":Hn(O,y,m,D),fill:"both"});X.startTime=S,l={animation:X,to:m,extentAt:B,startTime:S},e.onMotion({type:"settle",extentAt:B,startTime:S,duration:D}),X.onfinish=()=>{if(l?.animation!==X)return;l=null,T(),X.cancel()}}function ce(){l?.animation.cancel(),l=null}function ae(m){let y=e.config(),S=y.snapPoints.findIndex((g)=>g.id===m);s=he(y.snapPoints[S].extent,S),w=m,n.style.pointerEvents=e.isInteractive(m)?"none":"auto";let T=S===y.snapPoints.length-1;for(let[g,[O,D]]of k)if(T)g.style.setProperty("overflow-y",O,D);else g.style.overflowY="hidden";e.onRest(m),P()}function P(){if(!N)return;let m=z(),y=new N({source:n,axis:"block"});e.onMotion({type:"timeline",timeline:y,extentAt:(S)=>Math.min(V(),S*m+a)})}function f(m,y){let S=e.config().snapPoints.find((g)=>g.id===m);if(!S||u==="close")return;if(u=null,m!==w)w=m,e.onSnap(m,y);let T=l?l.extentAt(performance.now()-l.startTime):Z();oe(S.extent,T,performance.now(),()=>ae(m))}return{open(m,y){u=null,w=m,ne();let S=e.config().snapPoints.find((g)=>g.id===m);if(!S)return;if(!y)return n.scrollTop=S.extent-a,ae(m);oe(S.extent,-We,performance.now()+Xn,()=>ae(m));let T=l;Gn(o,(g)=>{if(!T||l!==T)return;T.animation.startTime=g,T.startTime=g,e.onMotionStart(g)})},close(){let m=u;if(u="close",m)return;w=null;let y=l?l.extentAt(performance.now()-l.startTime):Z();oe(-We,y,performance.now(),()=>e.onRest(null))},snapTo:f,nudge(){if(u||e.reducedMotion()||w===null)return;let m=e.config().snapPoints.find((y)=>y.id===w);if(m)oe(m.extent,m.extent-20,performance.now(),()=>ae(m.id))},relayout(m,y){if(u||c)return;let S=e.config().snapPoints,T=S.findIndex((B)=>B.id===w),g=S.findIndex((B)=>B.id===y),O=T>=0?T:g>=0?g:$e(S.map((B)=>B.extent),Z()),D=a;ne();let H=S[O];if(H.id!==w)w=H.id,e.onSnap(H.id,"content-resize");if(l){let B=l,j=performance.now();if(B.to!==H.extent||a!==D)oe(H.extent,B.extentAt(j-B.startTime),Math.max(j,B.startTime),()=>ae(H.id)),l=Object.assign(B,l);return}n.scrollTop=H.extent-a,ae(H.id)},target:()=>u?null:w,isMoving:()=>!!l||h,destroy(){if(ce(),U(),o.clearTimeout(v),x)o.cancelAnimationFrame(x);L.disconnect(),q.forEach((m)=>m());for(let m of i)m.remove();for(let[m,[y,S]]of k)m.style.setProperty("overflow-y",y,S);if(h)e.onDragChange(!1);t.style.removeProperty("top"),M(),W()}}}function Sp(e){let t=e.ownerDocument.defaultView??window;return Array.from(e.querySelectorAll("*")).filter((n)=>/auto|scroll/.test(t.getComputedStyle(n).overflowY))}var nc=120,xp=24;var oc=ue(()=>{_n();jn();Kn();Se();Ie();Zn();_t()});function kp(e){let t=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e);return t?[t[1],t[2],t[3]].map(Number):null}function ic(e,t){let n=Array.from(e.querySelectorAll('meta[name="theme-color"]')),r=n.map((l)=>l.content),o=r.map((l)=>kp(Ap(e,l))),s=-1;function a(l){let c=Math.round(l*t*100)/100;if(c===s)return;s=c,n.forEach((d,h)=>{let u=o[h];if(!u)return;d.content=c?`rgb(${u.map((v)=>Math.round(v*(1-c))).join(" ")})`:r[h]})}function i(){n.forEach((l,c)=>l.content=r[c]),s=-1}return{write:a,restore:i}}function Ap(e,t){let n=e.createElement("span");n.style.color=t,n.style.display="none",e.body.append(n);let r=e.defaultView?.getComputedStyle(n).color??t;return n.remove(),r}var sc=()=>{};function Mp(e){return{side:()=>"bottom",snapPoints:()=>["content"],snapPoint:()=>null,dismissible:()=>!0,modalAbove:()=>{return},driver:()=>"auto",expandOnScroll:()=>!0,physics:()=>{return},backdrop:()=>{return},hostBackdrop:!1,outlets:()=>[],parent:()=>{return},themeColor:()=>!1,preventEdgeSwipe:()=>!1,canMouseDrag:Cp,onSnap:zt,onRest:zt,onDismissAttempt:zt,onDragChange:zt,onLayout:zt,...Pp(e)}}function Pp(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function cc(e){for(let t=e.parent;t;t=t.parent){let n=nr.get(t);if(n)return n}}function Op(e){for(let t=e instanceof Element?e:null;t;){if(Fo.has(t))return t;let n=t.getRootNode();t=t.parentElement??(n instanceof ShadowRoot?n.host:null)}return null}function Tp(e,t){let n=e.closest("[popover]");return!!n&&n!==t&&t.contains(n)}function Dp(e,t){let n=t.driver();if(n!=="auto")return n==="scroll-snap";return t.modalAbove()===void 0&&t.expandOnScroll()&&!!e.matchMedia?.("(hover: none) and (pointer: coarse)").matches}function uc(e,t){let n=Mp(t),{host:r}=n,o=e.ownerDocument,s=o.defaultView??window,a=s.matchMedia?.("(prefers-reduced-motion: reduce)"),i=Co(n.side(),e),l=[],c=0,d,h=zn.ios,u,v,x={snapPoints:[],dimension:0,dismissible:!0,expandOnScroll:!0,physics:h,contentScroll:kl},w=i==="bottom"&&Dp(s,n);Fo.add(e);let k=[lc(r,i,e),Ip(e)],A=[],W=Ul({sheet:e,backdrop:n.backdrop,dimmed:n.hostBackdrop?r:void 0,outlets:n.outlets,ancestors:()=>A,themeColor:(f)=>u?.write(f)});function M(){let f=n.physics();if(f!==d)d=f,h=f?{...zn.ios,...f}:zn.ios;return x.physics=h,x.dismissible=n.dismissible(),x.expandOnScroll=n.expandOnScroll(),x}let I=!1;function N(){I=!0;let f=Co(n.side(),e);if(f!==i)i=f,k[0](),k[0]=lc(r,i,e);let m=(Ne(i)?r.clientHeight:r.clientWidth)-(w?We:0);re??=s.visualViewport?.height,c=Fl(e,i);let y=parseFloat(s.getComputedStyle(o.documentElement).fontSize)||16,S=Cl(n.snapPoints(),{container:m,content:c,rootFontSize:y});if(!S.length)S.push({id:"content",value:"content",extent:c,ids:["content"]});let T=m!==x.dimension||S.length!==l.length||S.some((g,O)=>g.id!==l[O].id||Math.abs(g.extent-l[O].extent)>=0.5);if(l=S,x.dimension=m,x.snapPoints=l.map(({id:g,extent:O})=>({id:g,extent:O})),W.configure({snapExtents:x.snapPoints.map((g)=>g.extent),undimmedIndex:at(l,n.modalAbove())}),T)V();return T}let q=!1,Q=(f)=>f===null?null:l.find((m)=>m.id===f)?.value??null,L={sheet:e,host:r,side:()=>i,config:M,size:()=>c,closedExtent:()=>Qn(i),reducedMotion:()=>!!a?.matches,owns:(f)=>Op(f)===e,canMouseDrag:n.canMouseDrag,onSnap:(f,m,y)=>{let S=Q(f);if(S!==null)n.onSnap(S,m,y)},onRest(f){if(q)return;let m=l.find((y)=>y.id===f);if(W.apply(m?.extent??Qn(i),{rest:!0}),n.onRest(Q(f)),_&&f!==null)oe();_=!1},onDismiss:n.onDismiss,onDismissAttempt:n.onDismissAttempt,onDragChange:n.onDragChange,isInteractive:(f)=>P.isInteractiveAt(Q(f)),onFrame:(f)=>q||W.apply(f),onMotion:(f)=>q||W.play(f),onMotionStart:(f)=>q||W.sync(f)},R=!0;function V(){if(!R)return n.onLayout({side:i,snapPoints:l});queueMicrotask(()=>q||n.onLayout({side:i,snapPoints:l}))}M();let z=w?rc(L):ec(L);e.setAttribute("data-driver",w?"scroll-snap":"pointer"),R=!1;let Z=new ResizeObserver(()=>{ce(!1)});Z.observe(e),Z.observe(r);let ne=0,re,ee=null,p=[Tl(r,{before:()=>ne=e.getBoundingClientRect().top,after:b}),...n.preventEdgeSwipe()?[J(o,"touchstart",C,{capture:!0,passive:!1})]:[],...gt()?[J(o,"touchend",K,{capture:!0,passive:!1})]:[],J(e,"focusin",U)];function b(){ce(!0),oe();let f=s.visualViewport?.height;if(f===re)return;re=f,ee?.cancel(),ee=null;let m=ne-e.getBoundingClientRect().top;if(Math.abs(m)<1||a?.matches)return;ee=r.animate({translate:[`0 ${m}px`,"0 0"]},Lp)}function C(f){if(!f.cancelable)return;let m=f.touches[0];if(!m||m.clientX>ac&&m.clientX<s.innerWidth-ac)return;let y=f.target;if(y&&(r.contains(y)||n.backdrop()?.contains(y)))f.preventDefault()}function K(f){let m=f.target;if(!(m instanceof HTMLInputElement||m instanceof HTMLTextAreaElement))return;if(!e.contains(m)||m===o.activeElement||z.isMoving()||!f.cancelable)return;f.preventDefault(),m.focus({preventScroll:!0})}let _=!1;function U(){if(z.isMoving())_=!0;else oe()}function oe(){let f=o.activeElement;if(!(f instanceof HTMLElement)||!e.contains(f)||f===e||Tp(f,e))return;let m=Mo(f,e,"bottom");if(!m)return;let y=s.visualViewport,S=Math.min(m.getBoundingClientRect().bottom,y?y.offsetTop+y.height:s.innerHeight),{top:T,bottom:g}=f.getBoundingClientRect(),O=16,D=m.getBoundingClientRect().top,H=g+O>S?g+O-S:T-O<D?T-O-D:0;if(H)m.scrollBy({top:H,behavior:a?.matches?"instant":"smooth"})}function ce(f){let m=!I;if(N()&&!m)z.relayout(f,l[at(l,n.snapPoint())]?.id)}function ae(f){let m=at(l,f);return l[m>=0?m:0]?.id}let P={element:e,parent:n.parent,open(f){if(q)return;A=[];for(let y=n.parent();y;y=y.parent())A.push(y.element);if(N(),M(),n.themeColor())u??=ic(o,h.dim);if(f)W.apply(Qn(i));v?.();let m=n.backdrop();v=m&&ct(m,{"will-change":"opacity"}),z.open(ae(n.snapPoint()),f)},close:()=>q||z.close(),snapTo(f,m){let y=at(l,f);if(y>=0&&l[y].id!==z.target())z.snapTo(l[y].id,m)},nudge:()=>z.nudge(),snapPoints:()=>l,target:()=>Q(z.target()),isInteractiveAt:(f)=>Ml(l,f,n.modalAbove()),refresh(){ce(!1)},destroy(){q=!0,Z.disconnect(),ee?.cancel(),p.forEach((f)=>f()),z.destroy(),W.destroy(),v?.(),u?.restore(),k.forEach((f)=>f()),e.removeAttribute("data-driver"),Fo.delete(e)}};return P}function lc(e,t,n){let r=Ne(t),o=r?t==="bottom":t==="right"!==(n.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl");return ct(e,{position:"fixed",inset:"0 0 var(--keyboard-inset, 0px) 0",width:"auto",height:"auto","max-width":"none","max-height":"none",margin:"0",padding:"0",border:"0",background:"transparent",color:"inherit",overflow:"visible",display:"flex","flex-direction":r?"column":"row","justify-content":o?"flex-end":"flex-start","pointer-events":"none"})}function Ip(e){return ct(e,{"pointer-events":"auto","overscroll-behavior":"contain","will-change":"translate"})}var Ep='a[href], button, label, summary, [role="button"], [role="link"], [role="slider"], [tabindex]:not([tabindex="-1"])',Cp=(e)=>!e.closest(Ep),zt=()=>{},Fo,nr,ac=24,Lp;var dc=ue(()=>{Al();El();Pl();Se();Ll();Ie();Oo();Zn();_t();tc();oc();sc();Fo=new WeakSet,nr=new WeakMap;Lp={duration:250,easing:"cubic-bezier(0.38, 0.7, 0.125, 1)"}});var fc={};Yu(fc,{prepareVariables:()=>Yl,presentSheet:()=>Np});function Fp(e){let t=e.getAttribute("data-slot");if(!t)return;xe(e.ownerDocument,`ui-sdk-sheet-${t}`,`@layer ui-sdk { :where([data-slot="${t}"])::backdrop { background: var(--sheet-backdrop, rgb(0 0 0 / 0.2)); pointer-events: auto } }`)}function Rp(e,t){let n=[],r=(o)=>{for(let s of Array.from(o.children)){if(t.includes(s))continue;if(t.some((a)=>a&&s.contains(a)))r(s);else if(s instanceof HTMLElement)n.push(Ke(s,"display","none"))}};return r(e),()=>n.forEach((o)=>o())}function $p(e,t,n){let r,o=t.bind(e,{...n,position:void 0,inline:!0,onShow(){let[s,a]=n.drillIn();if(s)r=Rp(s,[e,a]);return()=>r?.()},onClose(){r?.(),r=Ke(e,"display","none")}});return()=>{o(),r?.()}}function Np(e,t,n){if(n.drillIn)return $p(e,t,n);let r=e.parentElement;if(!r)return;Fp(r);let o;return t.bind(e,{...n,position:void 0,host:()=>r,onShow(s){let a=Wp(e,r,t,n,s);return o=a.sheet,()=>{a.hide(),o=void 0}},onClose:()=>o?.close()})}function Wp(e,t,n,r,o){let s=null,a=cc(o),i=!r.backdrop?.(),l=uc(e,{host:t,snapPoints:()=>r.snapPoints??["content"],snapPoint:()=>s,backdrop:r.backdrop,hostBackdrop:i,dismissible:r.dismissible,onDismissAttempt:r.onDismissAttempt,parent:()=>a?.(),onSnap:(h)=>s=h,onDismiss(h){n.requestClose("swipe",h),requestAnimationFrame(()=>{let u=s??l.snapPoints()[0]?.value;if(o.active()&&u!==void 0)l.snapTo(u,"imperative")})}});nr.set(o,()=>l),r.onSheet?.(l);let c=J(e,"focusin",(h)=>{let u=l.snapPoints().at(-1);if(u&&l.snapPoints().length>1&&h.target.matches("input, textarea"))l.snapTo(u.value,"imperative")}),d=i?getComputedStyle(e).getPropertyValue("--sheet-backdrop"):"transparent";if(d)t.style.setProperty("--sheet-backdrop",d);if(o.active())l.open(n.opener()!=="initial");return{sheet:l,hide(){c(),nr.delete(o),l.destroy(),r.onSheet?.(void 0),t.style.removeProperty("--sheet-backdrop")}}}var pc=ue(()=>{Se();Oe();dc();_t()});class mt extends Error{name="AdressevaelgerError";status;url;constructor(e,t){super(e);this.status=t.status,this.url=Uu(t.url)}}function Uu(e){return e.replace(/([?&]token=)[^&]*/i,"$1***")}function Ot(e){return e instanceof Error&&e.name==="AbortError"}function fr(e){let t=e.vejnavn??e.vejNavn??"",n=e.husnummer??e.husNummer??"";switch(e.type){case"vejnavn":return{type:"streetName",label:e.titel,streetName:t||e.titel};case"vejnavnhusnummer":return{type:"streetNameNumber",label:e.titel,streetName:t,houseNumber:n};case"navngivenvejpostnummer":if(!e.id)return null;return{type:"street",id:e.id,label:e.titel,streetName:t,postalCode:e.postnr??"",postalDistrict:e.postdistrikt??"",accessAddressCount:e.antal_husnumre??0};case"husnummer":if(!e.id)return null;return{type:"accessAddress",id:e.id,label:e.titel,streetName:t,houseNumber:n};case"adresse":if(!e.id)return null;return{type:"address",id:e.id,label:e.titel,accessAddressId:e.husnummerId??""};default:return null}}function mi(e){return{validFrom:e.virkningfra,validTo:e.virkningtil,registeredFrom:e.registreringfra,registeredTo:e.registreringtil}}function ht(e){let t=e.adgangspunkt?.koordinater??null;return{type:"accessAddress",id:e.id_lokalid,label:e.adgangsadressebetegnelse,houseNumber:e.husnummertekst,streetName:e.vejnavn,statusCode:e.status,position:t?{x:t.x,y:t.y,crs:"EPSG:25832"}:null,postalCode:{id:e.postnummer.id_lokalid,code:e.postnummer.postnr,name:e.postnummer.navn},municipalityCode:e.navngivenvejkommunedel?.kommune??null,roadCode:e.navngivenvejkommunedel?.vejkode??null,streetId:e.navngivenvejpostnummer?.id_lokalid??null,namedRoadId:e.navngivenvej?.id_lokalid??null,supplementaryTownName:e.supplerendebynavn?.navn??null,...mi(e),raw:e}}function Tt(e){return{type:"address",id:e.id_lokalid,label:e.adressebetegnelse,floor:e.etagebetegnelse,door:e.doerbetegnelse,statusCode:e.status,accessAddress:ht(e.husnummer),...mi(e),raw:e}}function pr(e){return{type:"street",id:e.id,label:e.titel,streetName:e.vejnavn,postalCode:e.postnr,postalDistrict:e.postdistrikt,postalCodeId:e.postnummer,accessAddressCount:e.antal_husnumre,geometry:e.geometri?{type:"MultiLineString",coordinates:e.geometri.coordinates,crs:"EPSG:25832"}:null,raw:e}}function Dt(e){return"id"in e?`${e.type}:${e.id}`:`${e.type}:${e.label}`}var Xu=/[^\p{L}\p{N}\s.,'-]/gu;function Je(e){return e.replace(Xu," ").replace(/\s+/g," ").trim().slice(0,73).trimEnd()}function mr(e){let t=String(e).trim();if(!/^\d{1,4}$/.test(t))throw RangeError(`Municipality code must be 1 to 4 digits, got "${t}"`);return t.padStart(4,"0")}var hi="adressevaelger123",gi="https://adressevaelger.dk",hr=200;function tn(e={}){let t=e.token??hi,n=(e.baseUrl??gi).replace(/\/+$/,""),r=e.fetch??((a,i)=>globalThis.fetch(a,i));async function o(a,i,l){let d=[...i,["token",t]].map(([k,A])=>`${k}=${encodeURIComponent(A)}`).join("&"),h=`${n}/${a}?${d}`,u=await r(h,{signal:l,headers:{accept:"application/json"}});if(u.status===404)return null;let v=await u.text();if(!u.ok)throw new mt(v.trim()||u.statusText||`HTTP ${u.status}`,{status:u.status,url:h});let x;try{x=JSON.parse(v)}catch{throw new mt(`Expected JSON from KDS, got: ${v.slice(0,200)}`,{status:u.status,url:h})}if(x.status==="fejl"){let k=x.beskrivelse;throw new mt(typeof k==="string"?k:"KDS returned an error",{status:u.status,url:h})}return x}function s(a,i){let l=new Map(a.map((c)=>[c.id,c]));return i.flatMap((c)=>l.get(c)??[])}return{async search(a,i={}){let l=Je(a);if(!l)return[];let c=[["tekst",l]];if(i.limit!==void 0){let{limit:u}=i;if(!Number.isInteger(u)||u<1||u>hr)throw RangeError(`limit must be an integer from 1 to ${hr}, got ${u}`);c.push(["maksimum",String(u)])}if(i.municipalityCodes?.length)c.push(["kommunekode",i.municipalityCodes.map(mr).join(",")]);if(i.includeProvisional)c.push(["medtagforeloebige","true"]);let d=(i.kind??"address")==="address"?"adresser":"husnumre";return((await o(`${d}/soeg`,c,i.signal))?.fund??[]).flatMap((u)=>fr(u)??[])},async getAddress(a,i={}){let l=await o(`adresser/${encodeURIComponent(a)}`,[],i.signal);return l?Tt(l.adresse):null},async getAddresses(a,i={}){if(a.length===0)return[];let l=await o("adresser",[["id_lokalids",a.join(",")]],i.signal);return s((l?.adresser??[]).map(Tt),a)},async getAccessAddress(a,i={}){let l=await o(`husnumre/${encodeURIComponent(a)}`,[],i.signal);return l?ht(l.husnummer):null},async getAccessAddresses(a,i={}){if(a.length===0)return[];let l=await o("husnumre",[["id_lokalids",a.join(",")]],i.signal);return s((l?.husnumre??[]).map(ht),a)},async getAccessAddressUnits(a,i={}){return((await o(`husnumre/${encodeURIComponent(a)}/adresser`,[],i.signal))?.adresser??[]).map(Tt)},async getStreet(a,i={}){let l=await o(`navngivenvejpostnumre/${encodeURIComponent(a)}`,[],i.signal);return l?pr(l.navngivenvejpostnummer):null},async getStreetAccessAddresses(a,i={}){return((await o(`navngivenvejpostnumre/${encodeURIComponent(a)}/husnumre`,[],i.signal))?.husnumre??[]).map(ht)}}}var Gu=new Intl.Collator("da",{numeric:!0,sensitivity:"base"});function bi(e,t){let n=t.trim().toLowerCase();if(!n)return[];return e.filter((r)=>r.houseNumber.toLowerCase().startsWith(n)).toSorted((r,o)=>Gu.compare(r.houseNumber,o.houseNumber)).map((r)=>({type:"accessAddress",id:r.id,label:r.label,streetName:r.streetName,houseNumber:r.houseNumber}))}function yi(e,t,n){let r=new Set;for(let s of e){if("id"in s)r.add(s.id);if(s.type==="address")r.add(s.accessAddressId)}let o=t.filter((s)=>!("id"in s)||!r.has(s.id));return[...e,...o].slice(0,n)}function vi(e,t,n,r){return{action:"refine",value:e+t,caret:e.length,template:r?{before:e,after:t,kind:n,streetId:r}:{before:e,after:t,kind:n}}}function gr(e){return{action:"refine",value:e,caret:e.length,template:null}}function wi(e){return{action:"complete",value:e,caret:e.length}}function xi(e,t){switch(e.type){case"streetName":return gr(`${e.streetName} `);case"streetNameNumber":return gr(e.label);case"street":return vi(`${e.streetName} `,`, ${e.postalCode} ${e.postalDistrict}`,"houseNumber",e.id);case"accessAddress":{if(t==="accessAddress")return wi(e.label);let n=`${e.streetName} ${e.houseNumber}, `;if(!e.label.startsWith(n))return gr(e.label);return vi(n,`, ${e.label.slice(n.length)}`,"unit")}case"address":return wi(e.label)}}function br(e,t){let{before:n,after:r}=t;if(e.length<n.length+r.length)return null;if(!e.startsWith(n)||!e.endsWith(r))return null;let o=n.length,s=e.length-r.length;return{start:o,end:s,kind:t.kind,text:e.slice(o,s)}}var Qu=100,Si={value:"",caret:null,slot:null,suggestions:[],status:"idle",error:null,open:!1,selection:null,fields:{},expanded:!1};function yr(e,t={}){return Object.fromEntries((e?.fields??[]).map(({name:n})=>[n,t[n]??""]))}function Ju(e){return(e.type==="address"?e.accessAddress:e).postalCode.code}function vr(e={}){let t=e,n,r=()=>t.client??(n??=tn()),o=()=>t.kind??"address",s=()=>t.fields,a=()=>t.fields?t.searchField:void 0,i={...Si,fields:yr(t.fields)},l=null,c=new Set,d=null,h=[],u=null,v,x,w,k=0,A=0,W=new Map;function M(E){i={...i,...E};let p=a();if(p!==void 0&&i.fields[p]!==i.value)i={...i,fields:{...i.fields,[p]:i.value}};for(let b of c)b()}function I(E){let p=a();if(l&&p!==void 0)return l.fields[p]===E;return i.selection?.suggestion.label===E}function N(E,p){let b=p.format(E);l={fields:b,postalCode:Ju(E)};let C=a(),K=C===void 0?void 0:b[C];return K===void 0?{fields:b,expanded:!0}:{fields:b,expanded:!0,value:K,caret:Q(K.length)}}function q(E){let p=a();if(!l||p===void 0||/\b\d{4}\b/.test(E))return E;let b=s()?.fields.find((C)=>C.parts.includes("postalCode"));if(!b||b.name===p)return E;if(i.fields[b.name]!==l.fields[b.name])return E;return`${E}, ${l.postalCode}`}function Q(E){return A+=1,{position:E,revision:A}}function L(E){if(t.houseNumberPrefix===!1||E?.kind!=="houseNumber"||!d?.streetId)return[];let p=W.get(d.streetId);return Array.isArray(p)?bi(p,E.text):[]}function R(){let E=u===i.value?h:[];return yi(E,L(i.slot),t.limit??Qu)}function V(E){if(W.has(E))return;W.set(E,"loading"),r().getStreetAccessAddresses(E).then((p)=>{if(W.set(E,p),d?.streetId===E&&i.slot?.kind==="houseNumber")M({suggestions:R()})},()=>{W.delete(E)})}function z(){clearTimeout(v),v=void 0,x?.abort(),x=void 0,k+=1}function Z(E){clearTimeout(v),v=void 0;let p=i.value;if(!Je(p)){z(),h=[],u=p,M({suggestions:[],status:"idle",error:null,open:!1});return}let b=t.debounceMs??100;if(E||b<=0)ne(p);else v=setTimeout(()=>void ne(p),b)}async function ne(E){v=void 0,x?.abort();let p=new AbortController;x=p,k+=1;let b=k;M({status:"loading",error:null});try{let C=await r().search(q(E),{kind:o(),limit:t.limit,municipalityCodes:t.municipalityCodes,includeProvisional:t.includeProvisional,signal:p.signal});if(b!==k||E!==i.value)return;h=C,u=E,M({status:"success",suggestions:R()})}catch(C){if(b!==k||Ot(C)||E!==i.value)return;h=[],u=E,M({status:"error",error:C,suggestions:R(),expanded:i.expanded||s()!==void 0})}finally{if(x===p)x=void 0}}async function re(E){w?.abort();let p=new AbortController;w=p;let b=()=>!p.signal.aborted&&i.selection?.suggestion===E;try{let C=E.type==="address"?await r().getAddress(E.id,{signal:p.signal}):await r().getAccessAddress(E.id,{signal:p.signal});if(!b())return;if(!C){M({selection:{suggestion:E,status:"error",details:null,error:Error(`KDS has no ${E.type} with id ${E.id}`)},expanded:i.expanded||s()!==void 0});return}let K={suggestion:E,status:"success",details:C,error:null},_=s();M({selection:K,..._&&N(C,_)}),t.onSelect?.(K)}catch(C){if(!b()||Ot(C))return;M({selection:{suggestion:E,status:"error",details:null,error:C},expanded:i.expanded||s()!==void 0})}}let ee={getState:()=>i,subscribe(E){return c.add(E),()=>c.delete(E)},setInput(E){if(E===i.value)return;let p=null;if(d){if(p=br(E,d),!p)d=null}let b=I(E)?i.selection:null;if(!b)w?.abort();if(M({value:E,caret:null,slot:p,selection:b,open:Je(E)!==""}),L(p).length>0)M({suggestions:R()});Z(!1)},async select(E){let p=xi(E,o());if(p.action==="refine"){if(d=p.template,d?.streetId&&t.houseNumberPrefix!==!1)V(d.streetId);w?.abort(),M({value:p.value,caret:Q(p.caret),slot:d?br(p.value,d):null,selection:null,open:!0}),Z(!0);return}if(E.type!=="address"&&E.type!=="accessAddress")return;z(),d=null,l=null;let b=t.fetchDetails!==!1,C={suggestion:E,status:b?"loading":"success",details:null,error:null};if(M({value:p.value,caret:Q(p.caret),slot:null,open:!1,selection:C}),b)await re(E);else{if(s())M({expanded:!0});t.onSelect?.(C)}},async selectById(E){z(),d=null,w?.abort();let p=new AbortController;w=p;let b=p.signal;try{let C=o()==="address"?await r().getAddress(E,{signal:b}):await r().getAccessAddress(E,{signal:b});if(b.aborted||!C)return null;let _={suggestion:C.type==="address"?{type:"address",id:C.id,label:C.label,accessAddressId:C.accessAddress.id}:{type:"accessAddress",id:C.id,label:C.label,streetName:C.streetName,houseNumber:C.houseNumber},status:"success",details:C,error:null};h=[],u=null,l=null;let U=s();return M({value:C.label,caret:Q(C.label.length),slot:null,suggestions:[],status:"idle",error:null,open:!1,selection:_,...U&&N(C,U)}),t.onSelect?.(_),_}catch(C){if(b.aborted||Ot(C))return null;return M({status:"error",error:C}),null}},setOpen(E){if(E!==i.open)M({open:E})},setOptions(E){let p=t;t={...t,...E};let b=(p.kind??"address")!==o(),C=b||p.limit!==t.limit||p.includeProvisional!==t.includeProvisional||String(p.municipalityCodes??"")!==String(t.municipalityCodes??"");if(b)d=null,w?.abort(),M({slot:null,selection:null});if(JSON.stringify(p.fields?.fields)!==JSON.stringify(t.fields?.fields)){let K=t.fields,_=i.selection?.details;if(K&&_)M(N(_,K));else l=null,M({fields:yr(K,i.fields),expanded:K?i.expanded:!1})}if(C&&Je(i.value))u=null,M({open:!0}),Z(!0)},setField(E,p){if(E===a()){ee.setInput(p);return}if(!(E in i.fields)||i.fields[E]===p)return;let b=i.selection&&l?.fields[E]===p?i.selection:null;if(!b)w?.abort();M({fields:{...i.fields,[E]:p},selection:b})},expand(){if(!i.expanded)M({expanded:!0})},clear(){z(),w?.abort(),d=null,l=null,h=[],u=null,M({...Si,fields:yr(s()),caret:Q(0)})},destroy(){z(),w?.abort()}};return ee}var se=!1;function Le(e){}function me(e,t,n){}function ki(e,t){return e}function Ai(e,t){}function Ei(e,t,n,r,o,s){}function Ci(e,t,n,r){}function Mi(e,t,n){}function Pi(e){}function Oi(e,t){}function Ti(e){e()}var Di=()=>!1;function Li(e,t,n){}function Ii(e,t,n,r){}function wr(e,t,n){}var Fi=new Set;function Ve(e){Fi.add(e),queueMicrotask(()=>{if(Fi.delete(e))e()})}var Zu='input, textarea, select, [contenteditable]:not([contenteditable="false"])';function Ri(e,{el:t}){let n=e.target.closest(Zu);if(n&&!n.contains(t??null))return;e.preventDefault()}var Ze={pointerdown:Ri,mousedown:Ri};var $i;function Ni(e){let t=$i?.get(e);return $i?.delete(e),t}var ed=4,Ce=(e,t)=>!!(e.compareDocumentPosition(t)&ed),xr=(e,t)=>Ce(e,t)?-1:1,td=16,nd=32;function et(e){let t=e.length<td?null:e[0].el.parentNode;while(t&&!e.every(({el:n})=>t.contains(n)))t=t.parentNode;if(t){let n=new Map(e.map((a)=>[a.el,a])),r=[],o=e[0].el.ownerDocument.createTreeWalker(t,1),s=e.length*nd;for(let a=t;a&&s--;a=o.nextNode()){let i=n.get(a);if(i&&r.push(i)===e.length)return r}}return e.sort((n,r)=>xr(n.el,r.el))}function Wi(){let e=new Map,t,n=[],r=!1,o,s=new Set,a=(d)=>e.get(d.key)===d;function i(d,h){o??=new MutationObserver(()=>t=void 0);let u=h[h.length-1]?.el;for(let{el:v}of d)for(let x=v.parentNode;x&&!s.has(x);x=x.parentNode)if(s.add(x),o.observe(x,{childList:!0}),x.contains(u))break}function l(){let d=[...e.values()],h=et(d.filter((u)=>u.el.isConnected));if(h.length<d.length)return h;if(typeof MutationObserver<"u")o?.disconnect(),s.clear(),i(h,h);return t=h}function c(d){let h=n.filter(a);if(h.some((v)=>!v.el.isConnected))return;let u=d.filter(a);if(h.length*Math.log2(u.length+2)>u.length)return;for(let v of h){let x=0,w=u.length;while(x<w){let k=x+w>>1;if(Ce(u[k].el,v.el))x=k+1;else w=k}u.splice(x,0,v)}if(o)i(h,u);return u}return{list(){if(o?.takeRecords().length)t=void 0;if(t&&(n.length||r))t=c(t);return n=[],r=!1,t??l()},add(d){if(t&&e.has(d.key))r=!0;if(e.set(d.key,d),t)n.push(d);return()=>{if(!a(d))return;if(e.delete(d.key),r=!0,!e.size)o?.disconnect(),s.clear(),t=void 0}},get:(d)=>e.get(d),size:()=>e.size}}var nn=(e)=>e.isTrusted;function ji(e,t){setTimeout(()=>{if(!e.defaultPrevented)t()})}var Sr=new Set;function kr(e,t){if(Sr.has(e))return t();Sr.add(e);try{t()}finally{Sr.delete(e)}}function Vi(e,t){return e!==void 0&&t===void 0}var rd=new WeakMap,rn=new WeakMap;function qi(e,t){return rn.set(e,t),()=>{if(rn.get(e)===t)rn.delete(e)}}function od(e){let t=rn.get(e);if(t)t();else e.focus()}var Ar=new WeakSet;function Hi(e,t){let n=t??e.ownerDocument;if(Ar.has(n))return;Ar.add(n),setTimeout(()=>Ar.delete(n)),od(e)}function Cr(e,t,n){rd.set(e,{internals:t,bind:n})}var id=new Set;function Lt(e){id.forEach((t)=>t(e))}var sd=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]),ad=new WeakSet;var ld=(e)=>Array.from(e.getRootNode().querySelectorAll("button, input[type=submit], input[type=image]")).find((t)=>t.form===e&&(t.type==="submit"||t.type==="image")),cd=(e)=>e.filter((t)=>t instanceof HTMLInputElement&&sd.has(t.type));function Ki(e){if(!e)return;let t=ld(e);if(t){if(!t.disabled)t.click();return}if(cd(Array.from(e.elements)).filter((n)=>!ad.has(n)).length<=1)e.requestSubmit()}function ud(e){for(let t=e.parentElement;t;t=t.parentElement){if(!(t instanceof HTMLFieldSetElement)||!t.disabled)continue;if(!t.querySelector(":scope > legend")?.contains(e))return!0}return!1}var Er=new WeakMap;function Bi(e,t){let n,r,o=!0,s=()=>{if(r){r.disconnect();for(let l=e.parentElement;l?.closest("fieldset");l=l.parentElement)r.observe(l,{childList:!0,attributeFilter:["disabled"]})}let i=ud(e);if(i!==n)t(n=i)},a=()=>{if(!o)return;if(typeof MutationObserver<"u")r=new MutationObserver(s);s(),Er.set(e,s)};if(e.isConnected)a();else queueMicrotask(a);return()=>{o=!1,r?.disconnect(),Er.delete(e)}}var Mr=(e)=>Er.get(e)?.(),Me=(e)=>e.disabled||e.formDisabled;var dd=globalThis[Symbol.for("ui-sdk.label-ids@1")]??={count:0};function on(e){let t=[],n=e.closest("label");if(n?.control===e)t.push(n);if(e.id)e.getRootNode().querySelectorAll(`label[for="${CSS.escape(e.id)}"]`).forEach((o)=>{if(o!==n&&o.control===e)t.push(o)});return t.sort(xr)}function _i(e,t,n=e){let r,o=()=>{let s=e.getAttribute("aria-labelledby");if(e.hasAttribute("aria-label")||s!==null&&s!==r)return;let a=t();for(let l of a)if(!l.id)l.id=`ui-sdk-label-${++dd.count}`;let i=a.map((l)=>l.id).join(" ");if(!i){if(r!==void 0)e.removeAttribute("aria-labelledby");r=void 0;return}if(r=i,s!==i)e.setAttribute("aria-labelledby",i)};return queueMicrotask(o),n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)}function zi(e,t,n){let r=()=>e.value!==e.defaultValue&&!t().includes(e.value),o=Ni(e);if(r()){n();return}if(o===void 0)return;queueMicrotask(()=>{if(e.isConnected&&!r()){if(e.value=o,r())n()}})}Ie();function an(){return be&&typeof HTMLElement.prototype.showPopover==="function"}function Pr(e){if(e)return e;if(be&&!an())return document.body;return null}function fe(e=document){let t=e.activeElement;while(t?.shadowRoot?.activeElement)t=t.shadowRoot.activeElement;return t}function ln(e){let t=[e],n=e;while(n){let r=n.assignedSlot??n.parentNode??n.host;if(r&&r!==n.parentNode)t.push(r);n=r}return t}function ye(e,t){return ln(t).some((n)=>e.contains(n))}var Yi;var fd;function It(){if(Yi)return Yi==="apple";return fd??=be&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function pd(e){try{return Intl.getCanonicalLocales(e?e.split(/[.@]/)[0].replaceAll("_","-"):[])[0]}catch{}}function Ui(){if(typeof navigator>"u")return;return pd(navigator.languages?.[0]??navigator.language)}var md="abcdefghijklmnopqrstuvwxyz",hd=/\p{Diacritic}/gu,gd=/\p{Script=Latin}/u,bd=/^[\u0000-\u007f]*$/,yd=/^(tr|az|lt)\b/i;function vd(e){let t=new Intl.Collator(e,{sensitivity:"base",usage:"search"}),n=yd.test(e??"")?(i)=>i.toLocaleLowerCase(e):(i)=>i.toLowerCase(),r=new Map,o=new Map;function s(i){let l=r.get(i);if(l!==void 0)return l;let c=n(i);if(i<"")return r.set(i,c),c;let d=n(i.normalize("NFD").replace(hd,""));if(d.length===i.length&&d!==c&&t.compare(i,d)===0)l=d;else if(gd.test(i))l=[...md].find((h)=>t.compare(i,h)===0);return l??=c.length===i.length?c:i,r.set(i,l),l}function a(i){let l=o.get(i);if(l!==void 0)return l;if(bd.test(i))l=n(i);else{l="";for(let c of i)l+=s(c)}if(o.size>50000)o.clear();return o.set(i,l),l}return{locale:e,fold:a}}var cn,Xi=!1;function wd(){if(cn)return cn;if(!Xi&&typeof window<"u")Xi=!0,window.addEventListener("languagechange",()=>cn=void 0);return cn=vd(Ui())}var tt=(e)=>wd().fold(e);function Or(e){let t=0;while(t<e.length&&e.charCodeAt(t)<=32)t++;return t}var xd=new Set([" ","-","_","/",".",":",",","(",")","[","]","@","#"]),un=(e,t)=>t===0||xd.has(e[t-1]);function Gi(e,t,n){let r=tt(t.trim());if(!r)return[];let o=tt(e),s=o.indexOf(r);if(n==="startsWith"){let a=Or(o);return o.startsWith(r,a)?[{start:a,end:a+r.length}]:[]}if(s!==-1){let a=n==="fuzzy"?Sd(o,r,s):s;return[{start:a,end:a+r.length}]}return n==="fuzzy"?kd(o,r):[]}function Sd(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(un(e,r))return r;return n}function kd(e,t){let n=[],r=0;for(let o of t){if(o===" ")continue;let s=e.indexOf(o,r);if(s===-1)return[];let a=n.at(-1);if(a&&a.end===s)a.end=s+1;else n.push({start:s,end:s+1});r=s+1}return n}function Qi(e,t){if(!t.length)return[{text:e,match:!1}];let n=[],r=0;for(let{start:o,end:s}of t){if(o>r)n.push({text:e.slice(r,o),match:!1});n.push({text:e.slice(o,s),match:!0}),r=s}if(r<e.length)n.push({text:e.slice(r),match:!1});return n}var Pe=(e)=>tt(e).trim();function Zi(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Ad(e){let t="",n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);while(n.nextNode()){let r=n.currentNode,o=r.parentElement?.closest('[aria-hidden="true"], [hidden]');if(o&&e.contains(o)&&(o!==e||o.getAttribute("aria-hidden")==="true"))continue;t+=r.textContent}return t}function es(e){return Ad(e).replace(/\s+/g," ").trim()||(e.getAttribute("aria-label")??"")}function Ji(e,t){return t.length===1?e+1:Math.max(e,0)}function ts(e=500){let t="",n="",r=!1,o;function s(){t="",n="",r=!1,clearTimeout(o)}function a(l,c,d){let h=l.length;for(let u=0;u<h;u++){let v=((d+u)%h+h)%h;if(Pe(l[v]).startsWith(c))return v}return-1}function i(l,c,d){if(l.length!==1||l===" "&&!t)return-1;clearTimeout(o),o=setTimeout(s,e);let h=Pe(l)||l;if(r=h===n&&(r||t.length===1),n=h,t+=h,r){let u=a(c,t,Math.max(d,0));return u!==-1?u:a(c,h,Ji(d,h))}return a(c,t,Ji(d,t))}return Object.assign(i,{reset:s,active:()=>t.length>0})}var ns=(e,t)=>0.09*e.length/t.length;function Ed(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(un(e,r))return r;return-1}function Cd(e,t){let n=0,r=-2,o=0,s=0;for(let a of t){if(a===" ")continue;let i=e.indexOf(a,n);if(i===-1)return 0;if(s++,un(e,i))o+=1;if(i===r+1)o+=1;r=i,n=i+1}if(!s)return 0;return 0.1+0.4*o/(2*s)}function rs(e,t){let n=Pe(t);if(!n)return 1;let r=Pe(e);if(r===n)return 1;let o=r.indexOf(n);if(o===0)return 0.9+ns(n,r);if(o>0)return(Ed(r,n,o)!==-1?0.75:0.6)+ns(n,r);return Cd(r,n)}function os(e,t){let n=rs(e.label,t);for(let r of e.keywords??[])n=Math.max(n,rs(r,t)*0.95);return n}function Tr(e,t,n,r){if(t==="first")return 0;if(t==="last")return n-1;let o=e+t;if(r)return(o%n+n)%n;return Math.max(0,Math.min(n-1,o))}function is(e,t,n,r,o=0,s=0){if(n-o<e)return Math.max(0,n-o);if(n+r+s>e+t)return Math.max(0,n+r+s-t);return e}function qe(e){return typeof e==="string"?{value:e,label:e}:e}var dn=(e)=>typeof e==="object"&&("type"in e)&&e.type==="group",fn=(e)=>typeof e==="object"&&("type"in e)&&e.type==="separator";function Dr(e,t){let n=[];return e.forEach((r,o)=>{if(fn(r))return;if(dn(r)){for(let s of r.items)n.push(ss(qe(s),t,`group-${o}`));return}n.push(ss(qe(r),t))}),n}function ss(e,t,n){return{key:t(e.value),value:e.value,label:e.label,keywords:e.keywords,disabled:!!e.disabled,group:n}}function as(e,t){for(let n=e.parentElement;n;n=n.parentElement){let r=getComputedStyle(n);if(/(auto|scroll)/.test(r.overflowY)&&n.scrollHeight>n.clientHeight){let o=e.getBoundingClientRect().top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,s=parseFloat(r.scrollPaddingTop)||0,a=parseFloat(r.scrollPaddingBottom)||0,i=is(n.scrollTop,n.clientHeight,o,e.offsetHeight,s,a),l=Math.min(i,n.scrollHeight-n.clientHeight);if(l!==n.scrollTop)n.scrollTop=l;return}if(n===t)return}}function ls(e,t){let{store:n}=e,r=typeof e.focus==="function"?e.focus:()=>e.focus,o=Wi(),s=new Map,a=ts(),i=new Set,l,c,d,h,u=0,v=0,x=(f,m)=>{if(m?.data===f)return m;let y=Dr(f,e.toKey);return{data:f,flat:y,byKey:new Map(y.map((S)=>[S.key,S]))}};function w(){let f=e.items();if(!f)return;return l=x(f,l)}function k(){let f=e.emptyItems?.();return f&&(c=x(f,c))}function A(){if(!e.items()||!(e.showEmpty?.()??!e.query().trim()))return;return k()}function W(f){return w()?.byKey.get(f)??k()?.byKey.get(f)}function M(){let f=A()??w();if(!f)return;let m=e.query(),y=e.filter(),S=e.rank?.()??!1;if(d?.data!==f.data||d.query!==m||d.filter!==y||d.rank!==S){let T=t.data(f.data,m,y,{rank:S});d={data:f.data,query:m,filter:y,rank:S,list:T,flat:Dr(T,e.toKey)}}return d}function I(f,m){let y=o.get(f)?.el;if(!y||y===m||!y.isConnected)return;let S=m.getAttribute("data-slot")??"";me(`Two items have the value "${f}". Give each item its own value, or arrow keys skip one and choosing it picks the other.`,{component:S.replace(/-item$/,"")||"listbox"})}function N(f,m){let y=m.meta(),S=y.label??es(m.el);if(y.pinned)return S;let T=s.get(f);if(T?.label!==S)s.set(f,{...T,label:S,value:y.value}),u++;return S}function q(f,m){let y=m.meta();return{key:f,value:y.value,label:N(f,m),keywords:y.keywords,get disabled(){return!!m.meta().disabled},group:y.group,pinned:y.pinned}}let Q=new Map,L=(f,m)=>!!w()||V(f,m);function R(f,m){return Q.set(f,m),L(f,m)}function V(f,m){let y=o.get(f),S=m.label??(y?N(f,y):s.get(f)?.label)??(typeof m.value==="string"?m.value:"");return t.matches({value:m.value,label:S,keywords:m.keywords},e.query(),e.filter())}function z(f){if(!i.size)return f;let m=f.length?o.get(f[0].key)?.el:void 0,y=[],S=[];for(let T of i){let g=o.get(T);if(!g?.el.isConnected)continue;(!!m?.isConnected&&Ce(g.el,m)?y:S).push(q(T,g))}return y.length||S.length?[...y,...f,...S]:f}function Z(){let f=o.list(),m=e.query(),y=e.filter();if(h?.order===f&&h.query===m&&h.filter===y&&h.version===u)return h.list;let S=f.map((T)=>q(T.key,T)).filter((T,g)=>f[g].meta().pinned||V(T.key,T));return h={order:f,query:m,filter:y,version:u,list:S},S}function ne(){let f=M();if(f)return z(f.flat);return Z()}let re=(f)=>f.disabled||!!e.blocked?.(f);function ee(f){if(f===null)return;let m=W(f);if(m)return m;let y=o.get(f);if(y)return q(f,y);let S=s.get(f);if(S)return{key:f,value:S.value,label:S.label,disabled:!1}}function E(f,m){if(r()==="real"&&m&&e.active())f.focus({preventScroll:!0});if(e.keepInView?.()!==!1)as(f,(e.scrollRoot??e.container)?.())}function p(f,{focus:m=!0,event:y}={}){n.set({highlighted:f});let S=ne(),T=f===null?-1:S.findIndex((D)=>D.key===f);e.onHighlight?.(f,T,y);let g=S.length-1;if(e.skipDisabled)while(g>0&&S[g].disabled)g--;if(T!==-1&&T===g)e.onLastReached?.();if(f===null)return;let O=o.get(f)?.el;if(O?.isConnected)E(O,m)}function b(f,{loop:m=e.loop()&&Math.abs(Number(f))===1}={}){let y=ne(),S=e.skipDisabled?y.filter((D)=>!D.disabled):y;if(!S.length)return;let T=n.get().highlighted,g=S.findIndex((D)=>D.key===T);if(g!==-1||typeof f!=="number")return S[Tr(g,f,S.length,m)].key;let O=y.findIndex((D)=>D.key===T);if(O!==-1){let D=y.slice(0,O).filter((H)=>!H.disabled).length;return S[Tr(f>0?D-1:D,f,S.length,m)].key}return S[f>0?0:S.length-1].key}function C(f,m){let y=b(f);if(y!==void 0)p(y,{event:m})}function K(f,m){let y=ne().filter((T)=>!T.pinned),S=a(f,y.map((T)=>re(T)?"":T.label),y.findIndex((T)=>T.key===m));return S===-1?void 0:y[S]}function _(f){let m=f.ownerDocument;return!m.activeElement||m.activeElement===m.body}let U=typeof MutationObserver>"u"?void 0:new MutationObserver(oe);function oe(){let f=n.get().highlighted,m=f===null?void 0:o.get(f)?.el;if(m?.isConnected&&_(m))E(m,!0)}function ce(f,m){let y=()=>n.get().highlighted===f&&e.active();if(r()!=="real"||!y()||m.ownerDocument.activeElement===m)return;queueMicrotask(()=>{if(y()&&m.isConnected)E(m,!0)})}function ae(f,m,y){if(v++,se)I(f,m);let S={key:f,el:m,meta:y},T=o.add(S),g=y();if(g.pinned)i.add(f);else{let O=s.get(f);if(g.label!==void 0&&O?.label!==g.label)u++;s.set(f,{...O,label:g.label??O?.label??"",value:g.value,keywords:g.keywords,group:g.group})}return queueMicrotask(()=>{if(o.get(f)!==S||!S.el.isConnected)return;if(N(f,S),S.el.parentNode)U?.observe(S.el.parentNode,{childList:!0})}),e.onRegister?.(f),ce(f,m),()=>{if(o.get(f)!==S)return;if(T(),v++,i.delete(f),!o.size())U?.disconnect();e.onRegister?.(f),queueMicrotask(()=>P(f,m))}}function P(f,m){if(o.get(f)||W(f)||n.get().highlighted!==f)return;if(n.set({highlighted:null}),e.onHighlight?.(null,-1),r()==="real"&&e.active()&&_(m))e.container?.()?.focus({preventScroll:!0})}return{entries:ne,visibleData:M,dataItems:()=>w()?.flat,find:ee,disabled:re,isItemDisabled:(f)=>!!ee(f)?.disabled,highlight:p,move:C,stepKey:b,firstEnabled:()=>ne().find((f)=>!f.pinned&&!re(f))?.key,search:K,register:ae,typing:()=>a.active(),resetTyping:()=>a.reset(),labelOf(f){let m=W(f);if(m)return m.label;let y=o.get(f);if(y)return N(f,y);return s.get(f)?.label},valueOf(f){let m=W(f);if(m)return m.value;return o.get(f)?.meta().value??s.get(f)?.value},matches:R,listing(f){let m={},y,T=!w()&&!!e.query().trim()?new Set(Z().map((O)=>O.key)):void 0,g=(O,D,H)=>{if(typeof m[O]==="string")return;let B=o.get(O),j=H?D:B?.meta()??D,X=!T||T.has(O)||!B?.el.isConnected&&V(O,j)?"":"-";if(j.index!==void 0)X+=y??=ne().length;if(f)X+=f(O,j.value);m[O]=X};for(let[O,D]of Q)g(O,D,!0);for(let[O,D]of s)g(O,D,!1);for(let O of w()?.flat??[])g(O.key,O,!1);for(let O of k()?.flat??[])g(O.key,O,!1);return m},listingInputs:()=>[e.items()?i.size:v,e.items()?0:u,e.query(),e.filter(),e.items(),e.emptyItems?.(),e.showEmpty?.(),e.rank?.()],selectable(f){let m=[];for(let y of ne()){if(y.pinned||y.disabled)continue;if(f!==void 0&&(o.get(y.key)?.meta().group??y.group)!==f)continue;m.push(y.key)}return m},count(){let f=0;for(let m of ne())if(!m.pinned)f++;return f},groupMatches(f){if(w()||!e.query().trim())return!0;return o.list().some((m)=>m.meta().group===f&&V(m.key,m.meta()))},element:(f)=>o.get(f)?.el,labelsVersion:()=>u,remember(f,m,y,S){let T=s.get(f),g=T?.keywords,O=T?.label===m&&(!S||g?.length===S.length&&S.every((D,H)=>D===g[H]));if(T&&O){if(T.value!==y)s.set(f,{...T,value:y});return}s.set(f,{...T,label:m,value:y,...S&&{keywords:S}}),u++}}}var cs=(e,t)=>e.entries().find((n)=>n.key===t&&!n.pinned&&!e.disabled(n));function Lr(e,t,n){if(t===n||t!==null&&!cs(e,t))return!1;return e.highlight(t),!0}function Ir(e,t){let n=e.find(t);return n&&!n.pinned?n.value??null:null}function Md(e,t,n){let r=tt(t.trim());if(!r)return!0;let o=tt(e);return n==="startsWith"?o.startsWith(r,Or(o)):o.includes(r)}function Fr(e,t,n){if(n===!1||n===void 0||!t.trim())return 1;if(typeof n==="function"){let r=n(e,t);return typeof r==="number"?Math.max(0,r):r?1:0}return[e.label,...e.keywords??[]].some((r)=>Md(r,t,n))?1:0}function Rr(e,t,n){return Fr(e,t,n)>0}function Pd(e,t,n,{rank:r=!1}={}){if(n===!1||n===void 0||!t.trim())return e;if(r)return Od(e,t,n);let o=[],s,a=(i)=>{if(s&&o.length)o.push(s);s=void 0,o.push(i)};for(let i of e){if(fn(i)){s=i;continue}if(dn(i)){let l=i.items.filter((c)=>Rr(qe(c),t,n));if(l.length)a({...i,items:l});continue}if(Rr(qe(i),t,n))a(i)}return o}var us=(e,t)=>t.score-e.score;function Od(e,t,n){let r=[],o,s=(i,l)=>{r.push({entry:i,score:l,separator:r.length?o:void 0}),o=void 0};for(let i of e){if(fn(i)){o=i;continue}if(dn(i)){let c=[];for(let d of i.items){let h=Fr(qe(d),t,n);if(h>0)c.push({entry:d,score:h})}if(!c.length)continue;c.sort(us),s({...i,items:c.map((d)=>d.entry)},c[0].score);continue}let l=Fr(qe(i),t,n);if(l>0)s(i,l)}let a=[...r].sort(us);if(a.some((i,l)=>i!==r[l]))return a.map((i)=>i.entry);return r.flatMap((i)=>i.separator?[i.separator,i.entry]:[i.entry])}var Td={data:Pd,matches:Rr};function ds(e){return ls(e,Td)}function fs(e,t){return(n)=>{if(n===null)return;if(n==="false")return!1;return e.includes(n)?n:t}}var ps=10;function $r(e,{apple:t}){let{key:n}=e;if(n==="ArrowDown")return e.metaKey?"last":1;if(n==="ArrowUp")return e.metaKey?"first":-1;if(n==="PageDown")return ps;if(n==="PageUp")return-ps;let r=t&&e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey;if(r&&n==="n")return 1;if(r&&n==="p")return-1}function ms(e,{listbox:t,highlighted:n,choose:r,focusInput:o}){let s=e.key==="Home"?"first":e.key==="End"?"last":$r(e,{apple:It()});if(s!==void 0)return e.preventDefault(),t.move(s,e);if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),n===null)return;let a=t.element(n);if(e.key==="Enter"&&a?.matches("a[href]"))return a.click();return r(n,e)}if(Zi(e))o()}var Nr=new WeakMap;function hs(e,t){let n=Nr.get(e);if(!n)Nr.set(e,n=[]);n.push(t)}function nt(e,t,n){hs(e.store,{from:"options",keys:t,derive:n})}function gs(e,t,n,{live:r=!0}={}){let{store:o}=e;hs(o,{from:"state",keys:t,derive:n}),o.subscribe((s)=>{if(s&&!r)return;let a=n(o.get());if(a)o.set(a)})}function bs(e,t,n,r){let o=Nr.get(e);if(!o)return n;let s=n??{};for(let a of o){if(!n&&a.from==="state")continue;let i={...r,...s},l=a.from==="state"?e.view(i,()=>a.derive(i)):a.derive(s,r,t);s={...s};for(let c of a.keys)if(l&&c in l)s[c]=l[c];else if(a.from==="state")s[c]=i[c]}return n||Object.keys(s).length?s:void 0}var ys=new WeakSet;function we(e,t){if(Object.is(e,t))return!0;if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;if(ys.has(e)||ys.has(t))return!1;return e.every((n,r)=>Object.is(n,t[r]))}function vs(e,t){let n=e,r=0,o=0,s,a,i=!1,l,c=new Set,d=new Map,h,u={get(){return l??v()},set(w,k=!1){if(s&&!k&&!i){let I=v();if(I!==n){let N={...I};for(let q in w)delete N[q];u.set(N,!0)}}let A=[];for(let I in w)if(!we(n[I],w[I]))A.push(I);if(!A.length)return;let W=n;n={...n,...w};let M=A.every((I)=>t.includes(I));x(A,W,M,k)},subscribe(w){return c.add(w),()=>{c.delete(w)}},setFanout(w){h=w},follow(w){s=w},view(w,k){let A=l;l=w;try{return k()}finally{l=A}}};function v(){if(!s||i)return n;i=!0;let w;try{w=s(n)}finally{i=!1}if(!w)return n;if(a?.state===n&&a.over===w)return a.result;let k=n;for(let A in w)if(!we(n[A],w[A])){k={...n,...w};break}return a={state:n,over:w,result:k},k}function x(w,k,A,W){if(!A)r++;if(!W)o++;let M=(I)=>I(A,W,w);c.forEach(M);for(let[I,N]of d)if(!w.length||w.some((q)=>!Object.hasOwn(I,q)))N.forEach(M);h?.(w,k,M)}return rt.set(u,{state:()=>n,renders:()=>r,writes:()=>o,touch:()=>x([],n,!1,!1),skipping:d}),u}var rt=new WeakMap;function pn(e,t,n){return mn(rt.get(e).skipping,t,n)}function mn(e,t,n){let r=e.get(t);if(!r)e.set(t,r=new Set);return r.add(n),()=>{if(r.delete(n),!r.size&&e.get(t)===r)e.delete(t)}}var Ft=(e)=>rt.get(e).state();var hn=(e)=>rt.get(e).renders(),ws=(e,t)=>{rt.set(e,rt.get(t))},xs=(e)=>rt.get(e).touch();var Ss={};function ks(e,t,n){let r;gs({store:e},["listing"],(o)=>{let s=[...t.listingInputs(),...n?.inputs()??[]];if(!r||!we(s,r.inputs)){let a=t.listing(n?.entry);r={inputs:s,listing:Dd(o.listing,a)?o.listing:a}}return{listing:r.listing}},{live:!1})}function Dd(e,t){for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(typeof e[n]!=="string")return!1;return!0}var Wr=new WeakMap;function gn(e,t){let n=Wr.get(e);if(n)return void n.push(t);let r=[t];Wr.set(e,r),Ve(()=>{Wr.delete(e);let o={};for(let s of r)s(o);e.set(o)})}function As(e,t,n){let r=(a)=>gn(e,(i)=>{i[t]=a(i[t]??e.get()[t])}),o=!0,s=!1;return r((a)=>{if(!o)return a;return s=!0,[...a,n]}),()=>{o=!1,r((a)=>{if(!s)return a;let i=a.indexOf(n);return i===-1?a:a.filter((l,c)=>c!==i)})}}function bn(e,t,{now:n=!1}={}){let r=(o)=>n?e.set({[t]:o}):gn(e,(s)=>s[t]=o);return r(!0),()=>r(!1)}function Ld(e,t){let n=e.getAttribute("aria-labelledby");if(n&&n!==`${t}-label`)return{labelledBy:n};let r=[...e.labels??[]].map((s)=>s.id).filter(Boolean);if(r.length)return{labelledBy:r.join(" ")};let o=e.getAttribute("aria-label");return o?{label:o}:null}function Es(e,t,n){gn(t,(r)=>{let o=Ld(e,n);if(JSON.stringify(o)!==JSON.stringify(t.get().fieldName))r.fieldName=o})}function jr(e,t){let n=e.labeled?null:e.fieldName;return{"aria-labelledby":e.labeled?`${t}-label`:n&&("label"in n)?void 0:n?.labelledBy??`${t}-input`,"aria-label":n&&"label"in n?n.label:void 0}}Ie();var yn=new WeakMap;function vn(e,t){yn.get(e)?.();let n=e.getAnimations?.({subtree:!0}).filter(Cs),r=n?.every((i)=>Vr(i)!==e);if(e.setAttribute("data-starting-style",""),n&&r){for(let i of e.getAnimations({subtree:!0}))if(Cs(i)&&!n.some((l)=>Id(i,l)))i.finish()}let o,s,a=requestAnimationFrame(()=>s=setTimeout(()=>{if(e.removeAttribute("data-starting-style"),t)o=Os(e,t)}));return()=>{cancelAnimationFrame(a),clearTimeout(s),o?.(),e.removeAttribute("data-starting-style")}}var Cs=(e)=>("transitionProperty"in e),Vr=(e)=>e.effect?.target,Id=(e,t)=>Vr(e)===Vr(t)&&e.transitionProperty===t.transitionProperty;function Ms(e){return e.split(",").map((t)=>{let n=parseFloat(t)||0;return t.trim().endsWith("ms")?n/1000:n})}function Fd(e){return Math.max(Ps(getComputedStyle(e)),Ps(getComputedStyle(e,"::backdrop")))}function Ps(e){let t=(n,r,o="1")=>{let s=Ms(n),a=Ms(r),i=o.split(",").map((l)=>l.trim()==="infinite"?1:parseFloat(l)||1);return s.map((l,c)=>(l*(i[c%i.length]??1)+(a[c%a.length]??0))*1000)};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function Rd(e){let t=0;for(let n of e){let r=n.effect?.getComputedTiming(),o=Number(r?.endTime);if(!r||!Number.isFinite(o))continue;t=Math.max(t,o-(Number(r.localTime)||0))}return t}var $d=(e)=>!e.timeline||!("source"in e.timeline);function Os(e,t){let n=!1,r=e.getAnimations({subtree:!0}).filter($d),o=()=>{if(n)return;n=!0,clearTimeout(s),t()},s=r.length?setTimeout(o,Math.max(Fd(e),Rd(r))+50):void 0;if(!r.length)Ti(o);else Promise.allSettled(r.map((a)=>a.finished)).then(o);return()=>{n=!0,clearTimeout(s)}}function qr(e,t){e.toggleAttribute("data-open",t),e.toggleAttribute("data-closed",!t)}function Ts(e,t){yn.get(e)?.(),e.removeAttribute("data-starting-style"),e.setAttribute("data-ending-style","");let n=e.hasAttribute("inert");e.setAttribute("inert","");let r=e.ownerDocument?.defaultView?.MutationObserver,o=!1,s=r&&new r(()=>o=!0);s?.observe(e,{attributeFilter:["inert"]});let a=0,i=()=>{if(cancelAnimationFrame(a),yn.delete(e),e.removeAttribute("data-ending-style"),o||=!!s?.takeRecords().length,s?.disconnect(),!o)e.toggleAttribute("inert",n)},l=!1,c=Os(e,()=>{if(!l)return i(),t();yn.set(e,i),a=requestAnimationFrame(()=>{a=requestAnimationFrame(i)}),t()});return l=!0,()=>{c(),i()}}function ot(e){return{"data-open":e?"":void 0,"data-closed":e?void 0:""}}function bt(e){return e.replace(/[\s%]/g,encodeURIComponent)}var wn=["ArrowDown","ArrowUp","PageDown","PageUp","ctrl+n","ctrl+p"],xn=(e)=>Me(e)||e.readOnly,Sn=(e)=>({"data-disabled":Me(e)?"":void 0,"data-readonly":e.readOnly?"":void 0,"data-required":e.required?"":void 0});function Nd(e,t,n){let r=e.ownerDocument.createDocumentFragment(),o=()=>{if(t()&&r.childNodes.length)e.append(r);else if(!t()&&e.childNodes.length)r.append(...Array.from(e.childNodes))};o();let s=n(o);return()=>{if(s(),r.childNodes.length)e.append(r)}}function Ds(e,t,n,r=()=>!1){if(!be)return;setTimeout(()=>{if(!e.isConnected||r()||e.getAttribute("aria-labelledby")||e.getAttribute("aria-label")||on(e).length)return;me(t,n)},300)}function Ls(e,t){if(e===void 0)return{};return{"aria-posinset":String(e+1),"aria-setsize":String(t.entries().length)}}function Is(e,{api:t,key:n,props:r}){return t.internal.listbox.register(n,e,()=>{let o=t.internal.itemProps(n)??r;return{value:o.value,label:o.label,keywords:o.keywords,disabled:o.disabled,group:o.group,index:o.index}})}function Fs(){return{props:{id:"id"},role:"group",attrs:(e,{id:t,key:n,api:r})=>({"aria-labelledby":Wd(e,t,n),hidden:r.internal.listbox.groupMatches(n)?void 0:""})}}var Wd=(e,t,n)=>e.groupLabels.includes(n)?`${t}-group-${bt(n)}`:void 0;function Rs(){return{role:"none",attrs:(e,{api:t})=>({"aria-hidden":"true",hidden:t.internal.filterQuery()&&!e.items?"":void 0})}}function $s(){let e=(t,n)=>n.internal.isEmpty(t);return{props:{stash:"boolean"},state:(t,{api:n})=>({loading:t.status==="loading",empty:e(t,n),query:t.query}),role:"status",attrs:(t,{api:n})=>({"aria-live":"polite","aria-atomic":"true","data-empty":e(t,n)?"":void 0,"data-loading":t.status==="loading"?"":void 0}),bind(t,{api:n,store:r,props:o}){if(o.stash)return Nd(t,()=>e(r.get(),n),r.subscribe)}}}function Ns(){return{state:(e,{api:t})=>({status:e.status,loading:e.status==="loading",count:t.internal.itemCount()}),role:"status",attrs:(e)=>({"aria-live":"polite","aria-atomic":"true","data-loading":e.status==="loading"?"":void 0})}}function Ws(){return{props:{id:{kind:"string",from:"group.id",required:!0},group:{kind:"string",from:"group.id",required:!0}},attrs:(e,{id:t,props:n})=>({id:`${t}-group-${bt(n.group)}`}),bind:(e,{store:t,props:n})=>As(t,"groupLabels",n.group)}}function js(){return{state:(e)=>({open:e.open}),attrs:(e)=>({"aria-hidden":"true",...ot(e.open)}),bind(e,{api:t}){t.internal.popup.checkPlacement()}}}Bs();var Br="pointer",Hr=!1,_s=!1,zs=!1,Ys=!1,_r=!1,Rt="mouse",Kr=!1,Vd=()=>Kr=!1,kn=null,qd=()=>kn=null;function Gs(e){if(e.key!=="Enter"&&e.key!==" ")return;kn=e.target,setTimeout(qd)}function Hd(e){Gs(e),_r=!1;let t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);if(e.key==="Tab"||!t)Br="keyboard"}function Us(e){if(Br="pointer",_r=!1,!("pointerType"in e)){if(!Kr)Rt="touch";return}Kr=!0,setTimeout(Vd);let t=e.pointerType;Rt=Qs(e)?"virtual":t==="touch"||t==="pen"?t:"mouse"}function An(){if(Hr||typeof document>"u")return;Hr=!0,document.addEventListener("keydown",Hd,!0),document.addEventListener("keyup",Gs,!0),document.addEventListener("pointerdown",Us,!0),document.addEventListener("touchstart",Us,{capture:!0,passive:!0}),window.addEventListener("blur",(e)=>{if(e.target===window)_r=!0})}function En(){if(Hr||_s)return;_s=!0,queueMicrotask(An)}function Qs(e){if(e.type==="pointermove")return!1;if(e.width===0&&e.height===0&&e.pressure===0)return!0;return e.pointerType==="mouse"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}function Kd(e){if(e.detail>0)return Rt;return!!kn&&kn.contains(e.target)?"keyboard":"virtual"}var Xs=()=>Br==="keyboard"?"keyboard":Rt;function He(e){if(An(),!e)return Xs();if(!nn(e))return"programmatic";if(e.type.startsWith("key"))return"keyboard";if(e.type.startsWith("touch"))return"touch";if(e.type==="click")return Kd(e);let t=e.pointerType;if(t==="mouse"||t==="touch"||t==="pen")return Qs(e)?"virtual":t;if("button"in e)return Rt;return Xs()}function Cn(e){An(),zs=!0;try{e.focus({preventScroll:!0})}finally{zs=!1}}function zr(e){An(),Ys=!0;try{e.focus({preventScroll:!0})}finally{Ys=!1}}var Js=(e)=>e==="pointer"||e==="touch"?"pointer":"keyboard";function Zs(e,t,n=()=>[]){let r=t,o,s=(d)=>{if(r=d,e.getAttribute("data-modality")!==d)e.setAttribute("data-modality",d)};s(t);let a=(d)=>{if(d.metaKey||d.ctrlKey||/^(Meta|Control|Alt|Shift)$/.test(d.key))return;s("keyboard")},i=()=>s("pointer"),l=(d)=>{let h={x:d.clientX,y:d.clientY},u=o&&Math.hypot(h.x-o.x,h.y-o.y)>2;if(o=h,u&&r!=="pointer")s("pointer")},c=[e,...n().filter((d)=>!!d)];for(let d of c)d.addEventListener("keydown",a,!0);return e.addEventListener("pointerdown",i,!0),e.addEventListener("pointermove",l,!0),()=>{for(let d of c)d.removeEventListener("keydown",a,!0);e.removeEventListener("pointerdown",i,!0),e.removeEventListener("pointermove",l,!0),e.removeAttribute("data-modality")}}function Bd(e){if(e.type==="removed")return`${e.label} removed`;if(e.loading)return"Loading";if(!e.count)return"No results";return e.count===1?"1 result":`${e.count} results`}function ea(e){return e==="contains"||e==="startsWith"||e==="fuzzy"?e:void 0}var _d=(e)=>({segments:[{text:e,match:!1}],matched:!1});function ta(){let e=new WeakMap,t=(n,r,o)=>{let{matchQuery:s,matchMode:a}=n.internal,i=a()?s():"",l=e.get(n);if(!l)e.set(n,l=new Map);let c=l.get(r);if(c&&c.text===o&&c.query===i)return c.state;let d=i.trim()?Gi(o,i,a()):[],h=d.length?{segments:Qi(o,d),matched:!0}:c&&!c.state.matched&&c.text===o?c.state:_d(o);return l.set(r,{text:o,query:i,state:h}),h};return{props:{text:"string",write:"boolean",id:"id"},state:(n,{api:r,key:o,props:s})=>t(r,o,s.text),attrs:(n,{api:r,key:o,props:s})=>({"data-matched":t(r,o,s.text).matched?"":void 0}),bind(n,{api:r,key:o,props:s,store:a}){if(!s.write)return;let i,l=()=>{let d=t(r,o,s.text);if(d===i)return;i=d,n.replaceChildren(...d.segments.map(({text:h,match:u})=>{if(!u)return h;let v=n.ownerDocument.createElement("mark");return v.textContent=h,v}))};l();let c=a.subscribe(l);return()=>{c(),n.textContent=s.text}}}}var na=(e)=>!!e&&nn(e)&&He(e)==="virtual",zd=500;function ra({store:e,query:t,count:n,loading:r,shown:o,silent:s,announcement:a}){let i,l=t(),c=r(),d=!1,h=()=>{if(i=void 0,!o()||s()||!t().trim())return;let u={type:"results",count:n(),query:t(),loading:r()},v=(a()??Bd)(u);if(v)Ks(v);d=u.loading};e.subscribe(()=>{let u=t(),v=r(),x=u!==l,w=c&&!v&&d;if(l=u,c=v,!x&&!w)return;clearTimeout(i),i=setTimeout(h,zd)})}function oa({count:e,status:t,onLoadMore:n}){let r=-1;function o(){let a=n(),i=t();if(!a||i==="loading")return;if(e()===r&&i!=="error")return;r=e(),a()}function s(a){let i=(l)=>{let c=l.target;if(!(c instanceof HTMLElement))return;if(c.scrollTop+c.clientHeight>=c.scrollHeight-40)o()};return a.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>a.removeEventListener("scroll",i,{capture:!0})}return{reached:o,bind:s}}Oe();Se();var Pn=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),ca=new WeakMap;function da(e){let t=ca.get(e);if(t)return t;let n={selectors:new Map,selecting:new Map};return ca.set(e,n),e.setFanout((r,o,s)=>{let a=e.get();for(let i of r){let l=n.selecting.get(i);if(!l)continue;let c=(h)=>n.selectors.get(`${String(i)}:${h}`)?.forEach(s),d=o[i];for(let[h,u]of l)if(h(d,a[i],c)===!0)u.forEach(s)}}),n}function fa(e){let t=Object.entries(e).filter(([,o])=>Pn(o)||typeof o==="function"||o.length>0),n=(o,s)=>Pn(o)?o.values(s):typeof o==="function"?o(s):o,r=(o,s)=>{let a=Fe(o,s);return t.map(([i,l])=>[i,n(l,a)])};return{reading(o,s){let a=Fe(o,s);return new Map(Object.entries(e).flatMap(([i,l])=>Pn(l)?[]:[[i,n(l,a)]]))},selection(o,s){let a=r(o,s);return a.length?JSON.stringify(a):""},subscribe(o,s,a){let i=[pn(o.store,e,s)];for(let[l,c]of r(o,a)){let d=e[l],h=Pn(d)?d.moved:Qr;if(i.push(...c.map((u)=>Xd(o.store,l,u,s,h))),h!==Qr)i.push(pa(o.store,l,h,s))}return()=>i.forEach((l)=>l())}}}function Xd(e,t,n,r,o=Qr){let s=pa(e,t,o,()=>{}),a=mn(da(e).selectors,`${String(t)}:${n}`,r);return()=>{a(),s()}}function pa(e,t,n,r){let{selecting:o}=da(e),s=o.get(t);if(!s)o.set(t,s=new Map);let a=mn(s,n,r);return()=>{if(a(),!s.size&&o.get(t)===s)o.delete(t)}}function Qr(e,t,n){if(e==null)e=ua(t,e);else if(t==null)t=ua(e,t);if(Jr(e)&&Jr(t)){for(let s in e)if(!Object.hasOwn(t,s)||!Object.is(e[s],t[s]))n(s);for(let s in t)if(!Object.hasOwn(e,s))n(s);return}if(!Array.isArray(e)||!Array.isArray(t))return[e,t].forEach(n);let r=0,o=0;while(r<e.length&&e[r]===t[r])r++;while(o<e.length-r&&o<t.length-r&&e[e.length-1-o]===t[t.length-1-o])o++;for(let s of[e,t])for(let a=r;a<s.length-o;a++)n(s[a])}var Jr=(e)=>!!e&&Object.getPrototypeOf(e)===Object.prototype,Gd=[],Qd={},ua=(e,t)=>Array.isArray(e)?Gd:Jr(e)?Qd:t;var it=(e)=>e.owner,ke=(e)=>it(e).slots[e.slot],Fe=(e,t)=>({id:e.id,key:e.key,props:t,api:e.api}),ma=(e,t=e.props)=>({el:e.el,id:e.id,key:e.key,props:t,store:e.store,api:e.api});function ga(e){let{parts:t}=e.owner,n=`${e.slot}:${e.key}`;if(!t.has(n))t.set(n,e);e.leases++;let r=!0;return()=>{if(!r)return;if(r=!1,--e.leases)return;let{owner:o}=e;if(!o.released.length)queueMicrotask(()=>ya(o));o.released.push(e)}}function ba(e){let{owner:t}=e;if(!t.released.length)queueMicrotask(()=>ya(t));t.released.push(e)}function ya(e){for(let t of e.released){let n=`${t.slot}:${t.key}`;if(!t.leases&&e.parts.get(n)===t)e.parts.delete(n)}e.released=[]}function Be(e,t=e.props,n=e.store.get()){let r=ke(e),o=Fe(e,t),s=r.attrs?.(n,o),a=r.role,i=typeof a==="function"?a(n,o):a;if(se)Ei(r,e.slot,s,i,{component:it(e).label,id:e.id},r.live?.read(n,o));let{name:l}=it(e),c={"data-slot":e.slot==="root"?l:`${l}-${e.slot}`,...a===void 0?void 0:{role:i},...s};if(a!==void 0)c.role=i;return Aa(e,c)}var eo=new Set(["aria-label","aria-labelledby","aria-description","title","autocomplete","autocapitalize","autocorrect","spellcheck","inputmode","enterkeyhint"]);var to=(e)=>typeof e==="string"&&e.split(/\s+/).every((t)=>t.startsWith("ui-sdk-"));function Tn(e,t=e.props,n=e.store.get()){return ke(e).present?.(n,Fe(e,t))??!0}function no(e){return ke(e).present!==void 0}function va(e,t=e.props){return Aa(e,ke(e).live?.read(e.store.get(),Fe(e,t))??{})}var Dn=(e,t=e.props)=>ke(e).selects?.selection(e,t)??"";var Jd={};function yt(e,t,n=e.props){let r=ke(e).selects,o=[ga(e),r?r.subscribe(e,t,n):pn(e.store,Jd,t)];return()=>o.forEach((s)=>s())}function wa(e){let{on:t,press:n}=ke(e),r={};for(let o in t){let s=t[o];r[o]=(a)=>{if(a.defaultPrevented||af(a))return;it(e).sleeping?.wake(),s(a,ma(e))}}if(typeof n==="function"&&!r.click)r.click=(o)=>{if(!o.defaultPrevented)it(e).sleeping?.wake(),n(ma(e),o)};return r}function xa(e){e.propsListeners?.forEach((t)=>t())}function Sa(e,t){let n=e.propsListeners??=new Set;return n.add(t),()=>{n.delete(t)}}var ha=new WeakMap;function Zd(e){let t=ke(e),n=ha.get(t);if(n===void 0)n=!!t.attrs&&"hidden"in t.attrs(e.store.get(),Fe(e,e.props)),ha.set(t,n);return n}function ro(e,t,n={by:"core"}){let r=e,{parts:o}=r.owner,s=`${e.slot}:${e.key}`;if(!e.el&&(o.get(s)??r)===r)o.delete(s),o.set(s,r);if(se){ef(e,e.el,t);let{focus:u}=ke(e);Ci(typeof u==="function"?u(e.store.get(),Fe(e,e.props)):u,e.slot,t,{component:it(e).label,id:e.id})}let a={};e.el=t,r.binding=a;let i=[ga(r)];if(Zd(e))Gr(t.ownerDocument);for(let[u,v]of Object.entries(wa(e)))if(n.by==="core"||n.attaches!=="all"&&!n.attaches.includes(u))i.push(J(t,u,v));let l=ke(e);if(l.live)i.push(l.live.attach(e,t));if(n.by==="framework"&&l.direct)i.push(l.direct.attach(e,t));let c=l.asleep?.(t,e);if(c)i.push(c);let d=()=>{let u=l.bind?.(t,e);if(u)i.push(u)},{sleeping:h}=r.owner;if(h&&l.bind)h.binds.add(d),i.push(()=>h.binds.delete(d));else d();if(l.attrs&&typeof MutationObserver<"u")i.push(nf(r,t));return()=>{if(i.forEach((u)=>u()),r.binding!==a)return;if(e.el=r.binding=void 0,r.own!==void 0)Zr(r)}}function ef(e,t,n){if(!e.key||!t||t===n)return;queueMicrotask(()=>{if(e.el!==n||!t.isConnected||!n.isConnected)return;let{parts:r,label:o}=it(e);for(let s of r.values())if(s.el===t)return;me(`two "${e.slot}" parts share the key "${e.key}". Give each an id or a unique value.`,{component:o,id:e.id})})}var oo=(e,t)=>ke(e).connect?.(t)??(()=>{}),On=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns","for","headers"],ka=(e)=>ke(e).attrs?.(e.store.get(),Fe(e,{...e.props,id:void 0})).id;function Aa(e,t){let{owner:n}=e;if(!n.named?.size||!On.some((s)=>t[s]))return t;let r=tf(n,e.store);if(!r.size)return t;let o={...t};for(let s of On){let a=o[s];if(a)o[s]=a.split(" ").map((i)=>r.get(i)??i).join(" ")}return o}function tf(e,t){let n=hn(t);if(e.aliases?.version===n)return e.aliases.map;let r=new Map;for(let o of e.named){let s=ka(o);if(s!==void 0&&s!==o.own)r.set(s,o.own)}return e.aliases={version:n,map:r},r}function nf(e,t){if(t.hasAttribute("id")||e.own!==void 0)Zr(e);let n=new MutationObserver(()=>Zr(e));return n.observe(t,{attributeFilter:["id"]}),()=>n.disconnect()}function Zr(e){let{owner:t}=e;if(!t.unread)t.unread=new Set,Ve(()=>rf(t,e.store));t.unread.add(e)}function rf(e,t){let n=e.unread;e.unread=void 0;let r=e.renamed===!0;e.renamed=void 0;for(let o of n)r=sf(o,o.el&&of(o.el))||r;if(r)xs(t)}var of=(e)=>e.localName==="form"?e.getAttribute("id"):e.id;function sf(e,t){let n=ka(e),r=t&&t!==n?t:void 0;if(r===e.own)return!1;let{owner:o}=e;if(e.own=r,o.named??=new Set,r===void 0)o.named.delete(e);else o.named.add(e);return o.aliases=void 0,n!==void 0}function af(e){return(e.type==="keydown"||e.type==="keyup")&&(typeof e.key!=="string"||Mn(e))}function so(e){return{read:e,attach(t,n){let r=`live:${t.id}`,o=()=>Wt(n,va(t),r);o();let s=yt(t,o);return()=>{s(),Wt(n,{},r)}}}}function Ca(e){let t=new WeakMap;return{names:e,attach:(n,r)=>{let o=Be(n),s=t.get(r)??new Map;t.set(r,s);for(let[i,l]of s)if(o[i]===void 0&&r.getAttribute(i)===l)r.removeAttribute(i);s.clear();let a=()=>{let i=Be(n);for(let l of e){let c=i[l];if(c===void 0){if(o[l]!==void 0&&r.getAttribute(l)===o[l])r.removeAttribute(l);continue}let d=r.getAttribute(l);if(d===c)continue;if(eo.has(l)&&d!==null&&d!==o[l])continue;r.setAttribute(l,c),s.set(l,c)}o=i};return a(),yt(n,a)}}}var io=new WeakMap,vt=new WeakMap,Ln;function Wt(e,t,n="render"){Ma(e,t,n,!1)}function ao(e,t){Ma(e,{},t,!0)}function jt(e,t){if(e===Ln)return;for(let n of Object.values(io.get(e)??{}))n.delete(t);for(let n of Object.values(vt.get(e)??{}))n.delete(t)}function Ma(e,t,n,r){let o=Ln;Ln=e;try{lf(e,t,n,r)}finally{Ln=o}}function lf(e,t,n,r){let o=io.get(e)??{},s=o[n]??new Map,a=new Map,i=t.style===void 0?[]:ff(t.style);for(let[u,v]of i)a.set(`style:${u}`,v);for(let[u,v]of Object.entries(t))if(v!==void 0&&u!=="style")a.set(u,v);let l=a.has("id")||s.has("id")?e.getAttribute("id"):null,c=uf(l,o,n);if(c)a.delete("id");let d=new Set,h=new Map;for(let u of new Set([...a.keys(),...s.keys()])){if(!eo.has(u))continue;let v=e.getAttribute(u);if(h.set(u,v),v===null||v===a.get(u)||u==="aria-labelledby"&&to(v))continue;if(!Object.values(o).some((x)=>x.get(u)===v))d.add(u)}for(let u of d)a.delete(u);for(let u of s.keys()){if(a.has(u)||d.has(u)||u==="id"&&c)continue;if(u.startsWith("style:")){e.style.removeProperty(u.slice(6));continue}if(!r){e.removeAttribute(u),Ea(e,n,u,null);continue}let v=e.getAttribute(u);if(v!==s.get(u))continue;let x=vt.get(e)?.[n]?.get(u);if(x===void 0)e.removeAttribute(u);else if(v!==x)e.setAttribute(u,x)}for(let[u,v]of i)if(e.style.getPropertyValue(u)!==v)e.style.setProperty(u,v);for(let[u,v]of Object.entries(t)){if(v===void 0||!a.has(u))continue;let x=u==="id"?l:h.has(u)?h.get(u):e.getAttribute(u);if(x!==(s.get(u)??null))Ea(e,n,u,x);if(x===v)continue;if(u==="value"&&df(e)&&e.value!==v)e.value=v;e.setAttribute(u,v)}if(o[n]=a,io.set(e,o),r)delete vt.get(e)?.[n]}function Ea(e,t,n,r){let o=r==null||n==="id"?void 0:On.includes(n)?cf(r):r;if(o===void 0)return void vt.get(e)?.[t]?.delete(n);let s=vt.get(e);if(!s)vt.set(e,s={});(s[t]??=new Map).set(n,o)}var cf=(e)=>e.split(/\s+/).filter((t)=>t&&!t.startsWith("ui-sdk-")).join(" ")||void 0;function uf(e,t,n){if(e===null||e===t[n]?.get("id"))return!1;return!e.startsWith("ui-sdk-")||Object.values(t).some((r)=>r.get("id")===e)}var df=(e)=>e.localName==="textarea"||e.localName==="input"&&e.type!=="file";function ff(e){let t=[];for(let n of e.split(";")){let r=n.indexOf(":");if(r>0)t.push([n.slice(0,r).trim(),n.slice(r+1).trim()])}return t}function _e(e,t){let n=[...e.parts()].filter((r)=>r.slot===t&&!!r.el?.isConnected);return et(n).map(({el:r,key:o,props:s})=>({el:r,key:o,props:s}))}var pf=(e)=>e==="fuzzy"?os:e;function Pa(e,t){let{id:n,store:r,options:o}=e,s=!1,a=null,i,l=()=>i??t.query(),c,d=oa({count:()=>h.count(),status:()=>r.get().status,onLoadMore:()=>o().onLoadMore}),h=ds({store:r,focus:()=>r.get().focusInList?"real":"virtual",items:t.items,emptyItems:t.emptyItems,toKey:(M)=>String(M??""),filter:()=>pf(t.filter()),rank:()=>t.filter()==="fuzzy"||typeof t.filter()==="function",query:l,loop:()=>o().loop??!0,skipDisabled:!0,active:()=>r.get().open,onHighlight:t.onHighlight,onLastReached:d.reached,container:t.container,scrollRoot:t.scrollRoot,onRegister(){if(s)return;s=!0,Ve(()=>{s=!1,r.set({mounts:r.get().mounts+1})})}});ks(r,h);let u=(M)=>e.props("item",M);function v(M){let{highlighted:I,settled:N}=r.get();if(!t.items()&&!N)return I;let q=t.autoHighlight(),Q=q==="always"||q==="typing"&&l()!=="",L=I!==null&&h.entries().some((V)=>V.key===I),R=Q?t.preferred?.(h)??h.firstEnabled()??null:null;return M&&Q?R:L?I:R}function x(M,I){let N=v(M);if(N!==r.get().highlighted)t.highlight(N,I)}function w(M){let I=$r(M,{apple:It()});if(I===void 0||M.altKey&&M.key==="ArrowUp")return!1;if(!r.get().open){if(!t.open||I!==1&&I!==-1)return!1;return M.preventDefault(),t.open(M,I===-1?"last":"first"),!0}M.preventDefault();let N=h.stepKey(I);if(N!==void 0)t.highlight(N,{reason:"list-navigation",event:M});return!0}let k=t.query(),A=r.get();r.subscribe(()=>{let M=r.get(),I=A;A=M;let N=t.query();if(N!==k){k=N;let q=a??{reason:"imperative"};a=null,x(!0,q)}else if(M.mounts!==I.mounts&&!t.settlesMount?.()||M.items!==I.items||M.settled!==I.settled){let q=I.highlighted===null?null:{reason:"item-removed"};if(M.highlighted!==I.highlighted)t.highlight(M.highlighted,q);else x(!1,q)}}),e.onOptions(()=>{if(c===void 0)return;let M=c,I=a;c=void 0,queueMicrotask(()=>{if(t.query()===M)x(!0,I)})});let W=t.autoHighlight();return e.onOptions(()=>{let M=t.autoHighlight();if(M===W)return;W=M,queueMicrotask(()=>x(!1,{reason:"imperative"}))}),ra({store:r,query:t.query,count:()=>h.count(),loading:()=>r.get().status==="loading",shown:()=>r.get().open,silent:()=>_e(e,"status").length>0,announcement:()=>o().announcement}),{listbox:h,itemProps:u,settledHighlight:v,settle:x,navigate:w,loadMore:d,matchQuery:t.query,matchMode:()=>ea(t.filter()),cause(M,I){a={reason:M,event:I}},settleFor(M){c=t.query(),i=M;try{x(!0,a)}finally{i=void 0}},hover(M,I){if(I.pointerType==="touch"||!r.get().open||u(M)?.disabled)return;if(r.get().highlighted!==M)t.highlight(M,{reason:"item-hover",event:I})},isEmpty:(M)=>(!!t.items()||M.settled)&&h.count()===0,itemCount:()=>h.count(),filterQuery:t.query,activeDescendant(M){let{highlighted:I}=M;if(!M.open||M.focusInList||I===null)return;if(!h.element(I)?.isConnected)return;return`${n}-option-${bt(I)}`}}}function Oa(){let e=(t,n)=>t.internal.text(n);return{role:"combobox",focus:"native",keys:wn,attrs:(t,{id:n,api:r})=>({id:`${n}-input`,value:e(r,t),autocomplete:"off",autocapitalize:"none",spellcheck:"false","aria-expanded":String(t.open)}),live:so((t,{api:n})=>({"aria-activedescendant":n.internal.activeDescendant(t)})),on:{input:(t,{api:n,el:r})=>n.internal.typed(r,t),keydown:(t,{api:n})=>n.internal.onInputKeyDown(t)},bind(t,{api:n,id:r,store:o}){Es(t,o,r);let s=t,a,i=()=>{let l=e(n,o.get());if(l===a)return;if(a=l,s.value!==l)s.value=l};return zi(s,()=>[e(n,o.get())],()=>n.internal.typed(s)),i(),o.subscribe(i)}}}function Ta(){return{props:{value:"string",label:"string",keywords:"list",disabled:"boolean",index:"number",group:{kind:"string",from:"group.id"}},role:"option",focus:"active-descendant",attrs:(e,{id:t,key:n,props:r,api:o})=>({id:`${t}-option-${bt(n)}`,tabindex:e.focusInList?"-1":void 0,"aria-disabled":r.disabled?"true":void 0,"aria-selected":void 0,...Ls(r.index,o.internal.listbox),hidden:o.internal.listbox.matches(n,r)?void 0:"","data-disabled":r.disabled?"":void 0}),direct:Ca(["hidden"]),live:so((e,{key:t})=>({"aria-selected":e.highlighted===t?"true":"false","data-highlighted":e.highlighted===t?"":void 0})),on:{...Ze,pointermove:(e,{api:t,key:n})=>t.internal.hover(n,e)},press:({api:e,key:t},n)=>e.internal.press(t,n),bind(e,{api:t,key:n,props:r}){let o=Is(e,{api:t,key:n,props:r});return()=>{o(),e.removeAttribute("data-highlighted"),e.setAttribute("aria-selected","false")}}}}var Vt=new WeakMap,ze,mf=!1,Da=0;function Ia(e){Da++;try{e()}finally{Da--}}function Fa(e){let t=ze,n={starts:[]};ze=n;let r;try{r=e()}finally{ze=t}if(Vt.set(r,n),t)t.starts.push(()=>(La(r),()=>$a(r)));else if(!mf&&typeof document<"u")La(r);return r}function wt(e){if(ze)ze.starts.push(e);else if(se)me("`whenKept` runs only while an instance is made, so this work never starts.")}function Ra(e,t){let n=ze,r={starts:[]};ze=r;try{t()}finally{ze=n}let o=Vt.get(e);if(!o)return;o.starts.push(...r.starts);for(let s of o.stops?r.starts:[]){let a=s();if(a)o.stops.push(a)}}function La(e){let t=Vt.get(e);if(!t||t.stops)return;let n=t.stops=[];for(let r of t.starts){let o=r();if(o)n.push(o)}}function $a(e){let t=Vt.get(e),n=t?.stops;if(!n)return;t.stops=void 0,n.forEach((r)=>r())}function Na(e){$a(e),Vt.delete(e)}var hf=Symbol.for("ui-sdk.controller.attach"),gf=Symbol.for("ui-sdk.controller.detach");function Wa(e,t){e?.[hf]?.(t)}function ja(e,t){e?.[gf]?.(t)}function Va(e,t){let n=e.options().controller,r=!1;wt(()=>(r=!0,Wa(n,t),()=>{r=!1,ja(n,t)})),e.onOptions(({controller:o})=>{if(o===n)return;if(ja(n,t),n=o,r)Wa(o,t)})}Se();Se();function bf(e,t){let{x:n,y:r}=e,{borders:o}=t,s=n>=o.left&&n<t.width-o.right&&r>=o.top&&r<t.height-o.bottom,a=n>=t.clientLeft&&n<t.clientLeft+t.clientWidth&&r>=t.clientTop&&r<t.clientTop+t.clientHeight;return s&&!a}function qa(e,t){if(!(t instanceof Element))return!1;let n=t.ownerDocument;if(t===n.documentElement)return e.clientX>=t.clientWidth||e.clientY>=t.clientHeight;if(t.clientWidth===0&&t.clientHeight===0)return!1;let r=t.getBoundingClientRect(),o=getComputedStyle(t);return bf({x:e.clientX-r.left,y:e.clientY-r.top},{width:r.width,height:r.height,clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,borders:{top:parseFloat(o.borderTopWidth)||0,right:parseFloat(o.borderRightWidth)||0,bottom:parseFloat(o.borderBottomWidth)||0,left:parseFloat(o.borderLeftWidth)||0}})}var de=globalThis[Symbol.for("ui-sdk.layers@2")]??={stack:[],listening:new Map};function Ka(){return de.persistent??=new Set}function yf(e){for(let t of Ka())if(ye(t,e))return!0;return!1}function Ba(){return[...Ka()].filter((e)=>e.isConnected)}function _a(){return de.pushed??0}function lo(e){return xt().some((t)=>(t.order??0)>e)}function xt(){return de.stack.filter((e)=>e.active())}function Fn(){return xt()}function za(){return de.escapeAt??-1/0}function In(e,t,n){return Ya(e,ln(t),n)}function Ya(e,t,n){if(t.some((r)=>e.contains(r,n)))return!0;return xt().some((r)=>r.parent===e&&Ya(r,t,n))}function vf(e,t){let n=!1,r,o;function s(u,v,x){let w=[],k=!1;if(yf(v))return{dismissed:w,consume:k};for(let A of[...de.stack].reverse())if(A.active()){if(In(A,v,u))break;if(A.modal!==!1)k=!0;if(w.push(A),A.shield)break}else if(A.exiting?.()){if(In(A,v,u))break;if(A.modal===!1)continue;if(A.overBackdrop?.(x.x,x.y))k=!0;break}return{dismissed:w,consume:k}}function a(u,v,x){let{dismissed:w,consume:k}=s(u,v,x);for(let A of w)A.onOutsidePress?.(u);return k}let i=J(t,"pointerdown",(u)=>{n=!1;let v=u.composedPath()[0];if(u.pointerType==="touch"){r={x:u.clientX,y:u.clientY,target:v};return}if(r=void 0,o=void 0,qa(u,v))return;let x={x:u.clientX,y:u.clientY},{dismissed:w,consume:k}=s(u,v,x);if(w[0]?.outsidePress==="click"){if(u.button!==0)return;if(o={layer:w[0],target:v,point:x},k)u.preventDefault(),n=!0;return}if(k)u.preventDefault(),n=!0;for(let A of w)A.onOutsidePress?.(u)},{capture:!0}),l=J(t,"pointerup",(u)=>{let v=o;if(o=void 0,!v||!v.layer.active())return;if(In(v.layer,u.composedPath()[0],u))return;a(u,v.target,v.point)},{capture:!0}),c=J(t,"click",(u)=>{if(n&&u.detail){n=!1,u.preventDefault(),u.stopPropagation();return}if(n=!1,!r)return;let v=r;if(r=void 0,Math.hypot(u.clientX-v.x,u.clientY-v.y)>10)return;if(a(u,v.target,{x:v.x,y:v.y}))u.preventDefault(),u.stopPropagation()},{capture:!0}),d=J(e,"keydown",(u)=>Xa(e,u)),h=J(t,"blur",(u)=>{for(let v of xt().reverse())v.onBlur?.(u)});return()=>{if(i(),l(),d(),h(),!n)return c();let u=()=>(c(),v(),x()),v=J(t,"pointerdown",u,{capture:!0}),x=J(t,"click",u,{capture:!0})}}function Rn(e,t){return In(e,t)}function qt(e){let t=ln(e);return xt().reverse().find((n)=>t.some((r)=>n.contains(r)))}function Ua(e){de.closed=e,setTimeout(()=>{if(de.closed===e)de.closed=void 0})}function co(){return de.closed}function Ha(){if(!se)return;Le({type:"layers",stack:de.stack.map((e)=>({component:e.component??"popup",id:e.id??"",modal:e.modal,blocking:!!e.blocking,el:e.el}))})}function wf(e){let t=e.defaultView;if(!t)return()=>{};let n=de.listening.get(e);if(!n)de.listening.set(e,n={layers:0,stop:vf(e,t)});let r=n;return r.layers++,()=>{if(--r.layers>0)return;de.listening.delete(e),r.stop()}}function uo(e){return e.el?.ownerDocument??document}function Xa(e,t,n){if(t.key!=="Escape"||t.defaultPrevented||Mn(t))return;let r=xt().filter((o)=>uo(o)===e).at(-1);if(!r?.onEscape||n&&r!==n)return;de.escapeAt=performance.now(),r.onEscape(t)}function Ga(e,t){Xa(uo(e),t,e)}function Qa(e){de.pushed=(de.pushed??0)+1,e.order=de.pushed,de.stack.push(e);let t=wf(uo(e));Ha();let n=!1;return()=>{if(n)return;n=!0;let r=de.stack.indexOf(e);if(r!==-1)de.stack.splice(r,1);t(),Ha()}}Se();Ie();Oe();var Te=globalThis[Symbol.for("ui-sdk.modal@2")]??={holders:new WeakMap,thaw:new WeakMap,inert:new WeakMap};function el(e=document,t){let n={},r=Te.holders.get(e);if(!r)Te.holders.set(e,r=new Set);if(!r.size)Te.thaw.set(e,Sf(e));r.add(n);let o=t&>()?Df(t):void 0;return()=>{if(!r.delete(n))return;if(o?.(),r.size)return;Te.thaw.get(e)?.(),Te.thaw.delete(e)}}function xf({scrollbar:e,gutter:t,padding:n}){let r={overflow:"hidden","scroll-behavior":"auto"};if(e>0)if(t)r["scrollbar-gutter"]="stable";else r["padding-right"]=`${n+e}px`;return r}function Sf(e){let{scroller:t,gutter:n,padding:r}=kf.get(e)??Af(e),o=xf({scrollbar:n,gutter:typeof CSS<"u"&&CSS.supports("scrollbar-gutter","stable"),padding:r}),s=Object.entries(o).map(([a,i])=>Ke(t,a,i));if(n>0)s.push(Ke(e.documentElement,"--scrollbar-width",`${n}px`));return()=>s.forEach((a)=>a())}var kf=new WeakMap;function Af(e){let t=e.defaultView??window,n=Ef(e,t),r=t.getComputedStyle(n);return{scroller:n,gutter:Cf(n,e,t,r),padding:parseFloat(r.paddingRight)||0}}function Ef(e,t){let{body:n,documentElement:r}=e;if(!n||t.getComputedStyle(r).overflowY==="visible")return r;return/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:r}function Cf(e,t,n,r){if(e===t.documentElement)return n.innerWidth-e.clientWidth;let o=(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-o}function Mf(e,t){let n=t.getComputedStyle(e),r=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,o=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return r||o}function Pf(e,t){let{body:n,documentElement:r}=e.ownerDocument;for(let o=e;o&&o!==n&&o!==r;o=o.parentElement)if(Mf(o,t))return!0;return!1}function Of(e){if(e.fingers>1||e.zoomed)return"browser";if(e.scroller||e.slider||e.selecting)return"element";return"page"}var Tf="@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }";function Df(e){let t=e.ownerDocument,n=t.defaultView??window;xe(t,"ui-sdk-scroll-guard",Tf);let r=!e.hasAttribute("data-scroll-guard");if(r)e.setAttribute("data-scroll-guard","");let o="browser",s=J(t,"touchstart",(i)=>{let l=i.target instanceof Element?i.target:null;o=Of({fingers:i.touches.length,zoomed:(n.visualViewport?.scale??1)!==1,scroller:!!l&&Pf(l,n),slider:!!l?.closest('input[type="range"]'),selecting:t.getSelection()?.type==="Range"})},{capture:!0,passive:!0}),a=J(t,"touchmove",(i)=>{if(o==="page"&&i.cancelable)i.preventDefault()},{passive:!1});return()=>{if(s(),a(),r)e.removeAttribute("data-scroll-guard")}}var Lf='[aria-live]:not([aria-live="off"]):not([data-slot="carousel-content"]),[role="status"],[role="alert"],[role="log"],output';function Ja(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function Za(e){let t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll(Lf)),...Ba()],r=n.filter((a)=>!n.some((i)=>i!==a&&i.contains(a))),o=new Set;for(let a of r)for(let i=a;i;i=Ja(i))o.add(i);let s=[];for(let a of r)for(let i=a;i&&i!==t.body;i=Ja(i))for(let l of Array.from(i.parentNode?.children??[])){if(o.has(l)||!(l instanceof HTMLElement))continue;let c=Te.inert.get(l)??(l.inert?1/0:0);if(c===0)l.inert=!0;if(c!==1/0)Te.inert.set(l,c+1);s.push(l)}return()=>{for(let a of s){let i=Te.inert.get(a);if(i===void 0)continue;if(i<=1)a.inert=!1,Te.inert.delete(a);else Te.inert.set(a,i-1)}}}function tl(e){let t=e,n=Za(t),r=!1,o=(s)=>{let a=n;t=s,n=Za(s),a()};return Object.assign(()=>{if(r)return;r=!0,n()},{keep(s){if(r)return()=>{};return o([...t,s]),()=>{if(!r)o(t.filter((a)=>a!==s))}}})}Ie();Oe();var Re={tab:"close",blur:"always",outsidePress:"pointerdown",shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},nl=(e)=>e.trapFocus?"trap":"flow",If={menu:Re,select:Re,combobox:{...Re,tab:"native"},popover:{...Re,tab:nl,blur:"iframe"},dialog:{...Re,tab:nl,blur:"never",outsidePress:"click",shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:(e)=>e.inertAndLock},tooltip:{...Re,tab:"native",movesFocus:!1},hoverCard:{...Re,tab:"flow"},navigationMenu:{...Re,tab:"flow",blur:"never"}};function rl(e,t){let n={...If[e]};for(let r of Object.keys(Re)){let o=t[r];if(o!==void 0)Object.assign(n,{[r]:o})}return n}var Ff=()=>globalThis[Symbol.for("ui-sdk.popup-elements@1")]??=new WeakMap;function St(e){let t=Ff();t.set(e,(t.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(t.get(e)??1)-1;if(r>0)t.set(e,r);else t.delete(e)}}Se();var ol=["a[href]","area[href]","button","input:not([type='hidden'])","select","textarea","iframe","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(",");function fo(e){if(!(e instanceof HTMLElement)||e.tabIndex<0)return!1;if(e.matches(":disabled")||e.closest("[inert]"))return!1;if((e.checked?[]:po(e)).some((n)=>n.checked&&fo(n)))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility({visibilityProperty:!0});return e.getClientRects().length>0&&getComputedStyle(e).visibility!=="hidden"}function po(e){if(!(e instanceof HTMLInputElement)||e.type!=="radio"||!e.name)return[];return(e.form?Array.from(e.form.elements):Array.from(e.getRootNode().querySelectorAll(`input[name="${CSS.escape(e.name)}"]`))).filter((n)=>n instanceof HTMLInputElement&&n.type==="radio"&&n.name===e.name&&n.form===e.form)}function Ye(e){return Array.from(e.querySelectorAll(ol)).filter(fo)}function mo(e){let t=(o)=>[...o.filter((s)=>s.index>0).sort((s,a)=>s.index-a.index),...o.filter((s)=>s.index<=0)].flatMap((s)=>s.stops),n=(o,s)=>{for(let a of o){let i=a.hasAttribute("tabindex")?a.tabIndex:0;if(a.hasAttribute("inert")||a.shadowRoot&&i<0)continue;let l=a.matches(ol)&&!a.shadowRoot?.delegatesFocus&&fo(a)?[a]:[],c=a instanceof HTMLSlotElement?a.assignedElements():[];if(a.shadowRoot||c.length){let d=[];n(a.shadowRoot?.children??c,d),s.push({index:i,stops:[...l,...t(d)]})}else s.push({index:i,stops:l}),n(a.children,s)}},r=[];return n(e.children,r),r.flatMap((o)=>o.stops)}function il(e,t){let n=(r)=>{for(let o=r;o&&o!==t;o=o.parentElement)if(o.assignedSlot)return!0;return!1};return e.filter((r)=>r.tabIndex>0&&!n(r)).sort((r,o)=>r.tabIndex-o.tabIndex)}function sl(e,t){let n=e.ownerDocument??document;return Ye(n.body).find((r)=>!r.contains(e)&&!t?.contains(r)&&Ce(e,r))}var Rf="position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;outline:none";function al(e,t){let n=e.ownerDocument,r,o=[],s=()=>{o.forEach((u)=>u.remove()),o=[],r=void 0},a=()=>{let u=n.createElement("span");return u.tabIndex=0,u.setAttribute("aria-hidden","true"),u.style.cssText=Rf,u},i=()=>{let u=n.activeElement;if(o.length||!t()||!(u instanceof HTMLIFrameElement)||!e.contains(u))return;r=u,o=[a(),a()],u.before(o[0]),u.after(o[1])},l=()=>{i(),setTimeout(i)},c=J(n.defaultView??window,"blur",l),d=J(n,"focusout",l),h=J(n,"focusin",(u)=>{let v=o.indexOf(u.target),x=r;if(s(),v<0||!x)return;let w=Ye(e),k=v===0?-1:1;(w.at((w.indexOf(x)+k)%w.length)??e).focus({preventScroll:!0})});return()=>{c(),d(),h(),s()}}function ml(e){return{consumeOutsidePress:e===!0||e==="pointer",trapFocus:e===!0||e==="trap-focus",inertAndLock:e===!0}}var $f={mouse:"pointer",pen:"pointer",touch:"touch",keyboard:"keyboard",virtual:"keyboard",programmatic:"imperative",agent:"imperative"},hl=(e)=>e?$f[He(e)]:"imperative";function Nf(e){if(e==="initial"||e==="hover")return"none";if(e==="touch")return"popup";return"auto"}function Wf(e){if(e.focusable&&!e.consumed)return!1;return e.type==="pointerdown"?"later":!0}var jf=new Set(["text","search","url","tel","email","password"]);function Vf(e){if(e.localName==="input"&&jf.has(e.type)&&e.value&&e.getAttribute("aria-expanded")!=="true")e.select()}function ll(e,t){for(let n of e){let r=n();if(r&&t(r))return r}}function bo(e,t,n){nt(e,t,(r,o)=>("open"in r)&&r.open!==o.open?n(!!r.open,o):void 0)}function gl(e,t){return{id:`${t}-content`,tabindex:"-1",hidden:e.mounted?void 0:"",...ot(e.open)}}var qf="a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]";function Hf(e,t){if(typeof e==="function")return e()??void 0;if(typeof e==="string")return t.querySelector(e)??void 0;return e}function $n(e){return e.isConnected&&!e.closest("[inert]")}function cl(e){let t=e.getRangeAt(0).cloneRange(),n=!t.collapsed&&e.anchorNode===t.endContainer&&e.anchorOffset===t.endOffset;return{range:t,backward:n}}function ho(){let e=fe();return!e||e===e.ownerDocument.body||!$n(e)||e.checkVisibility?.()===!1}function go(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function ul(e){return e.getRootNode().activeElement}function Kf(e){let t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener("close",(r)=>{if(performance.now()-za()<100)return;e(r)}),()=>n?.destroy()}var dl=new WeakMap,Nn=new WeakSet,fl=new WeakMap;function pl(e,t){for(let n=e;n;n=n.parent)if(n===t||Nn.has(n)&&(n.order??0)>(t.order??0))return!0;return!1}function bl(e){let t=rl(e.preset,e),n=()=>typeof t.tab==="function"?t.tab(e.modal()):t.tab,{store:r}=e,o,s,a,i,l,c,d=r.get().open?"initial":"imperative",h=t.focusOnMount&&r.get().open,u=!1,v=!1,x=!1,w=!0,k,A,W=r.get().open,M=()=>{return},I=[],N=e.returnTrigger??e.trigger,q,Q,L,R,V=(P,f)=>e.onOpenChangeComplete?.(P,f),z=(P)=>P||!!s?.el&&be;bo({store:r},["mounted"],(P)=>z(P)===P?{mounted:P}:void 0);function Z(P){k=P;let f=P?.isContentEditable?P.ownerDocument.getSelection():null;A=f?.rangeCount&&P.contains(f.anchorNode)?cl(f):void 0;let m=k&&qt(k),y=m?void 0:co();M=m?.returnTarget??(()=>y)}let ne=r.get().open;r.subscribe(()=>{let{open:P}=r.get();if(P===ne)return;if(ne=P,P){if(R?.(!0),e.onOpenChange?.(!0),i?.(),i=void 0,s){for(let F of[s.el,s.backdrop])if(F)qr(F,!0)}h=!0,u=!0,w=!0;let G=be?fe():null;Z(G&&G!==G.ownerDocument.body?G:void 0);let ve=N();W=d==="imperative"||x&&!!k&&!qt(k)&&!co()&&!(ve&&ye(ve,k));let De=!!s;if(r.set({mounted:!0}),o){if(De)ce();_()}else if(!be)u=!1,V(!0);return}let f=t.movesFocus&&w;w=!0,h=!1,u=!1,d="imperative",x=!1;let m=R?.(!1),y=s?.el;if(a)Ua(E());let S=M,T=A;if(A=void 0,!y||!be){e.onOpenChange?.(!1,m),r.set({mounted:!1}),V(!1,m);return}let g=fe(),O=e.trigger(),D=!g||g===y.ownerDocument.body||ye(y,g)||!!a&&Rn(a,g)&&!(O&&ye(O,g));e.onOpenChange?.(!1,m),o?.config.onClose?.();let H=_a(),B=[y,...s?.backdrop?[s.backdrop]:[]],j=B.length,Y=B.map((G)=>(qr(G,!1),Ts(G,()=>{if(--j>0)return;i=void 0,r.set({mounted:!1}),ce(),V(!1,m)})));if(j>0)i=()=>Y.forEach((G)=>G());if(l?.(),l=void 0,c?.(),c=void 0,!f||!D)return;if(f===!0){b(y,S,!1,T);let G=fe();setTimeout(()=>{if(G&&!G.isConnected&&ho()&&!lo(H))b(y,S)});return}if(f==="unless-moved"){queueMicrotask(()=>{let G=fe();if(!(!!G&&G!==y.ownerDocument.body&&!ye(y,G))&&!lo(H))b(y,S,!1,T)});return}let X=()=>{ie(),clearTimeout(le),setTimeout(()=>{let G=fe();if(!G||G===y.ownerDocument.body)b(y,S,!1,T)})},ie=J(window,"pointerup",X,{capture:!0}),le=setTimeout(X,1000)});function re(P,f,m=M,y=!1){let S=()=>m(f,y),T=()=>p(P,y);return W?[()=>k,S,N,T,e.trigger]:[N,()=>k,S,T,e.trigger]}let ee=!1;function E(P=$n,f=!1){if(ee)return;ee=!0;try{return ll(re(s?.el,P,M,f),P)}finally{ee=!1}}function p(P,f=!1){let m=I[0]?.node;if(m?.isConnected&&!P?.contains(m)){for(let Y of[...I.slice(1).map((X)=>X.node),m.ownerDocument.body]){let X=Ye(Y).filter((le)=>!P?.contains(le)),ie=X.find((le)=>Ce(m,le)&&!m.contains(le))??X.filter((le)=>Ce(le,m)).pop();if(ie)return ie}return}let y=I.findIndex((Y,X)=>!Y.node.isConnected&&I[X+1]?.node.isConnected);if(y===-1)return;let S=I[y],T=S.next?.deref(),g=S.previous?.deref(),O=I[y+1].node,D=(Y)=>!!Y?.isConnected&&Y.parentNode===O,H=D(T)?T.previousElementSibling===(S.previous?g:null):!S.next&&(S.previous?D(g)&&!g.nextElementSibling:!O.firstElementChild);if(f&&!H)return;let B=(Y,X)=>Y.contains(X)||Ce(Y,X),j=D(T)?(Y)=>B(T,Y):D(g)?(Y)=>Ce(g,Y)&&!g.contains(Y):(Y)=>B(O,Y);for(let{node:Y}of I.slice(y+1)){let X=Ye(Y).filter((G)=>!P?.contains(G)),ie=D(g)?X.filter((G)=>!B(g,G)||g.contains(G)).pop():void 0,le=X.find(j)??ie??X[0];if(le)return le}}function b(P,f,m=!1,y,S=e.finalFocus?.()??"trigger"){if(S==="none")return;let T=(O)=>{if(!$n(O)||P.contains(O))return!1;let D=O.ownerDocument.getSelection(),H=y&&O===k?D?.rangeCount&&O.contains(D.anchorNode)?cl(D):y:void 0;if(Cn(O),fe()!==O)return!1;if(H&&O.contains(H.range.startContainer)){let{startContainer:B,startOffset:j,endContainer:Y,endOffset:X}=H.range;if(H.backward)D?.setBaseAndExtent(Y,X,B,j);else D?.setBaseAndExtent(B,j,Y,X)}return!0},g=re(P,T,f,m);if(S!=="trigger")g.unshift(()=>Hf(S,P.ownerDocument));ll(g,T)}function C(P){if(!h||!s||!r.get().open||!t.movesFocus)return;h=!1;let f=d==="initial"&&t.focusOnMount?"auto":Nf(d);if(f==="none")return;let m=()=>{if(!s||!r.get().open)return;let y=f==="popup"?s.el:P?.();if(!y)return;if(zr(y),!s||!r.get().open)return;let S=fe();if(!S||!ye(y,S)&&!ye(s.el,S)){zr(s.el);return}Vf(y)};if(v)requestAnimationFrame(()=>{let y=fe();if(!s||!y||!ye(s.el,y))m()});else m()}function K(P,f){let m=[],y=e.trigger(),S=f.host?.()??P;if(d==="initial"&&!k){let F=fe();Z(F&&F!==F.ownerDocument.body&&!ye(P,F)?F:void 0)}P.removeAttribute("hidden"),S.removeAttribute("hidden");let T=s?.backdrop;if(T){let F=U(T,f.inline);m.push(()=>{F(),oe(T)})}if(!f.inline){S.setAttribute("popover","manual");try{S.showPopover()}catch{}}if(f.position&&e.position){let F=e.position(()=>f.anchor?.()??e.trigger(),P,f.position);if(q=F.place,Q=F.follow,m.push(F,()=>q=Q=void 0),f.rendered)m.push(f.rendered(F.follow))}if(!f.inline&&!an()&&!S.style.zIndex)S.style.zIndex="2147483000";m.push(vn(P,u?()=>{u=!1,V(!0)}:void 0)),En();let g=e.modal(),O=t.blur,D=e.persistent?.()??[],H=(F,te)=>F===P&&!!te&&("clientX"in te)&&go({x:te.clientX,y:te.clientY},P.getBoundingClientRect()),B=N()??(!y&&k?.isConnected?k:void 0);if(B||!y)I=[];for(let F=B??null;F&&F!==P.ownerDocument.body;F=F.parentElement){let{nextElementSibling:te,previousElementSibling:ge}=F;I.push({node:F,next:te&&new WeakRef(te),previous:ge&&new WeakRef(ge)})}let j={parent:e.parent?.()??(y&&qt(y)),active:()=>r.get().open,exiting:()=>!r.get().open&&r.get().mounted,modal:g.consumeOutsidePress,blocking:typeof t.blocking==="function"?t.blocking(g):t.blocking,outsidePress:t.outsidePress,shield:t.shield,component:e.owner?.component,id:e.owner?.id,el:P,contains:(F,te)=>P.contains(F)&&!H(F,te)||D.some((ge)=>ge.contains(F))||(e.contains?e.contains(F,te):!!e.trigger()?.contains(F)),overBackdrop:(F,te)=>!!s?.backdrop&&!go({x:F,y:te},s.backdrop.getBoundingClientRect())&&go({x:F,y:te},P.getBoundingClientRect()),returnTarget:E,onOutsidePress:(F)=>{let te=F.composedPath()[0];e.close("outside-press",{event:F,focus:Wf({type:F.type,focusable:!!te?.closest?.(qf),consumed:g.consumeOutsidePress})})},onEscape:(F)=>{if(F.preventDefault(),e.onEscape)e.onEscape(F);else e.close("escape-key",{event:F,focus:!0})},onBlur:O==="never"?void 0:O==="always"?(F)=>e.close("window-blur",{event:F,focus:!1}):(F)=>setTimeout(()=>{let te=ul(P)??P.ownerDocument.activeElement;if(te?.tagName==="IFRAME"&&!P.contains(te))e.close("focus-out",{event:F,focus:!1})})};if(a=j,dl.set(j,[P,...T?[T]:[]]),m.push(Qa(j)),fl.set(j,{inside:(F)=>F.contains(P)||!!y&&F.contains(y),again:()=>{let F=fe();ce();for(let te of[S,T])try{te?.hidePopover()}catch{}if(_(),F&&F!==fe())F.focus({preventScroll:!0})}}),g.inertAndLock)Nn.add(j);for(let F of[e.onShow,f.onShow]){let te=F?.(j);if(te)m.push(te)}let Y,X,ie,le=()=>{let F=[P,...s?.backdrop?[s.backdrop]:[],...D];if(y&&t.keepTrigger)F.push(y);for(let ge of Fn())if(ge!==j&&pl(ge,j))F.push(...dl.get(ge)??[]);Y=el(P.ownerDocument,P);let te=tl(F);j.keep=te.keep,l=X=te},G=()=>{if(ie?.(),X?.(),Y?.(),l===X)l=void 0;X=Y=j.keep=void 0};if(g.inertAndLock)ie=la(()=>{if(ie=void 0,!r.get().open)return;let F=fe();if(le(),n()==="trap"&&F&&!$n(F))h=!0,C(f.initialFocus)});L=()=>{let F=e.modal();if(j.modal=F.consumeOutsidePress,j.blocking=typeof t.blocking==="function"?t.blocking(F):t.blocking,F.inertAndLock)Nn.add(j);else Nn.delete(j);if(F.inertAndLock&&!g.inertAndLock&&r.get().open)le();else if(!F.inertAndLock&&g.inertAndLock)G();g=F},m.push(G,()=>L=void 0);let ve=new Set(Fn());for(let F=j.parent;F;F=F.parent)ve.add(F);ve.delete(j);for(let F of ve)if(F.keep&&pl(j,F))for(let te of[P,...T?[T]:[]])m.push(F.keep(te));if(n()==="flow"&&t.dismissOnFocusLoss){let F;m.push(J(P.ownerDocument,"mousedown",(te)=>{F=te,setTimeout(()=>{if(F===te)F=void 0})},{capture:!0}),J(P.ownerDocument,"focusin",(te)=>{let ge=ul(P)??te.target;if(!r.get().open||Rn(j,ge))return;if(F&&j.contains(ge,F))return;e.close("focus-out",{event:te,focus:!1})}))}if(m.push(al(P,()=>n()==="trap")),t.closeWatcher){let F=Kf((te)=>e.close("back",{event:te,focus:!0}));if(F)c=F,m.push(()=>{if(F(),c===F)c=void 0})}let De=(F)=>{let{target:te,submitter:ge}=F;if((ge?.getAttribute("formmethod")??te.getAttribute("method"))?.toLowerCase()!=="dialog"||qt(te)!==j)return;F.preventDefault(),e.close("close-press",{event:F,focus:!0,returnValue:ge?.value||void 0})};if(P.addEventListener("submit",De),m.push(()=>P.removeEventListener("submit",De)),r.get().open&&!h&&n()==="trap"&&ho())h=!0;for(let F of Fn()){let te=fl.get(F);if(F!==j&&te?.inside(P))te.again()}return queueMicrotask(()=>C(f.initialFocus)),()=>{if(m.forEach((F)=>F()),a===j)a=void 0;if(!r.get().mounted&&!f.inline)try{S.hidePopover()}catch{}}}function _(){if(!o||s)return;let{el:P,config:f}=o;s={el:P,cleanup:()=>{},backdrop:f.backdrop?.()},s.cleanup=K(P,f)}function U(P,f=!1){if(P.removeAttribute("hidden"),f)return vn(P);P.setAttribute("popover","manual");try{P.showPopover()}catch{}if(!an()&&!P.style.zIndex)P.style.zIndex="2147483000";return vn(P)}function oe(P){if(!r.get().mounted)try{P.hidePopover()}catch{}}function ce(){if(!s)return;let{cleanup:P}=s;s=void 0,P()}function ae(P){if(P.key==="Escape"&&a)return Ga(a,P);let f=s?.el;if(P.key!=="Tab"||!f)return;let m=n();if(m==="native")return;if(m==="close")return e.close("focus-out",{event:P,focus:!1});let y=Ye(f),S=mo(f),T=S[0],g=S.at(-1),O=fe(),D=!T||O===T||O===f,H=!g||O===g,B=m==="trap"?il(y,f):[];if(B.length){let Y=[...B,...y.filter((De)=>!B.includes(De))],X=Y.indexOf(O),ie=O===f?Y.at(P.shiftKey?-1:0):Y.at((X+(P.shiftKey?-1:1))%Y.length),le=B.includes(O)||!!ie&&B.includes(ie),G=O?.shadowRoot,ve=!P.shiftKey&&!!G&&Ye(G).length>0;if(O!==f&&(X<0||!le||ve))return;P.preventDefault(),ie?.focus({preventScroll:!0});return}if(m==="trap"){if(P.shiftKey?D:H){P.preventDefault(),((P.shiftKey?g:T)??f).focus({preventScroll:!0});return}let Y=y.indexOf(O),X=Y<0?void 0:y[Y+(P.shiftKey?-1:1)],ie=X&&!X.checked?po(X):[];if(ie.some((le)=>le.checked)&&!ie.includes(O)){P.preventDefault(),X?.focus({preventScroll:!0});return}setTimeout(()=>{let le=fe(f.ownerDocument);if(s?.el===f&&!(le&&(ye(f,le)||!!a&&Rn(a,le))))((P.shiftKey?g:T)??f).focus({preventScroll:!0})});return}let j=e.trigger()??(k?.isConnected?k:void 0);if(!j)return;if(P.shiftKey&&D)P.preventDefault(),j.focus({preventScroll:!0});else if(!P.shiftKey&&H){let Y=sl(j,f);if(!Y)return;P.preventDefault(),Y.focus()}}return{bind(P,f={}){let m=!1,y=St(P),S=()=>{if(o={el:P,config:f},r.get().mounted){if(s&&s.el!==P)ce();_()}};if(P.isConnected)S();else queueMicrotask(()=>{if(!m&&P.isConnected)S()});return()=>{m=!0;let T=e.finalFocus?.()??"trigger";if(y(),o?.el!==P)return;if(o=void 0,s?.el===P){let g=fe(),O=r.get().open&&t.movesFocus&&(!g||g===P.ownerDocument.body||ye(P,g)),D=M;if(ce(),O){let H=A;A=void 0,queueMicrotask(()=>{if(!o&&!P.isConnected&&ho())b(P,D,!0,H,T)})}}}},keydown:ae,triggerKeydown(P){let f=s?.el;if(P.key!=="Tab"||P.shiftKey||!f||!r.get().open)return;if(n()!=="flow")return;P.preventDefault(),(mo(f)[0]??f).focus({preventScroll:!0})},opening(P,f){d=P,v=f?.type==="pointerdown",x=f?.type==="keydown"},opener:()=>d,observe(P){R=P},requestClose:(P,f)=>e.close(P,{event:f,focus:!0}),returnFocus(P){w=P},initialFocus:C,place:()=>q?.(),checkPlacement:()=>Q?.(),updateModal:()=>L?.(),layer:()=>a,element:()=>s?.el,mountedAs:z,backdrop(P){if(!s||s.backdrop===P)return()=>{};let{el:f}=s,m=o?.config.host?.()??f,y=!!o?.config.inline;s.backdrop=P;let S=U(P,y),T=fe();if(!y)try{m.hidePopover(),m.showPopover()}catch{}if(T&&T!==fe())T.focus({preventScroll:!0});let g=a?.keep?.(P);return()=>{if(g?.(),S(),s?.backdrop===P)s.backdrop=void 0;oe(P)}}}}Se();Ie();var gc,mc=()=>gc??=Promise.resolve().then(() => (pc(),fc)),hc=(e)=>be&&matchMedia(e).matches;function bc(e,t,n,r,o){let s=()=>{let l=n(),c=l==="auto"&&hc("(max-width: 640px) and (pointer: coarse)");return l==="sheet"||c?"sheet":r},a=()=>e.set({presentation:s()}),i=n();if(i==="sheet")a();if(be&&!gc&&(i==="sheet"||i==="auto"&&hc("(pointer: coarse)")))(window.requestIdleCallback??setTimeout)(()=>mc().then((l)=>l.prepareVariables()));return{open:a,resolve:s,bind(l,c){let d=t();if(n()==="auto"&&d.opener()==="initial"&&e.get().open)queueMicrotask(a);if(e.get().presentation!=="sheet")return d.bind(l,c);let h,u=!1,v=()=>l.hidden||(l.hidden=!0),x=new MutationObserver(v),w=(A)=>{if(x.disconnect(),!u)h=A()};mc().then(({presentSheet:A})=>w(()=>A(l,d,{...o?.sheet,...c})),()=>w(()=>d.bind(l,c))),v(),x.observe(l,{attributeFilter:["hidden"]});let k=St(l);return()=>{u=!0,x.disconnect(),k(),h?.()}}}}var yc=[0.5,1];function vc(e,t){let{store:n}=t;if(Yt.get(n)&&n.get().presentation==="sheet"&&He()!=="touch")queueMicrotask(()=>e.isConnected&&e.focus({preventScroll:!0}));Yt.delete(n);let r=[J(e,"touchend",(o)=>{if(n.get().open||!o.cancelable||t.presentation.resolve()!=="sheet")return;o.preventDefault(),t.open(o)},{passive:!1}),J(e,"focus",()=>Yt.set(n,!0)),J(e,"blur",(o)=>o.relatedTarget&&Yt.set(n,!1))];return()=>{if(r.forEach((o)=>o()),e.ownerDocument.activeElement===e)Yt.set(n,!0)}}var Yt=new WeakMap;Un();var wc;function jp(){return wc??=typeof CSS<"u"&&typeof CSS.supports==="function"&&["position-anchor: --a","position-try-fallbacks: flip-y","position-visibility: always"].every((e)=>CSS.supports(e)),wc}var $o=(e)=>{let t=document.documentElement;return!e.x&&!e.y&&Math.abs(e.width-t.clientWidth)<1&&Math.abs(e.height-t.clientHeight)<1};function xc(e,t,n,r,o){if(!jp()||e.getRootNode()!==n.getRootNode()||!(t.width||t.height)||!$o(o))return!1;let s=(a)=>a.split(",").some((i)=>parseFloat(i)>0);return!s(r.transitionDuration)&&(r.animationName==="none"||!s(r.animationDuration))}function Sc(e,t,n,r,o){let{sideOffset:s,alignOffset:a,collisionPadding:i}=r,l=t==="top"||t==="bottom",[c,d]=l?["left","right"]:["top","bottom"],h=l?o.width:o.height,u=n==="start"?`anchor(${c}) + ${a}px`:n==="end"?`anchor(${d}) - ${h+a}px`:`anchor(center) - ${h/2-a}px`,v=Yn[t];return{[v]:`round(anchor(${t}), 1px)`,[t]:"auto",[`margin-${v}`]:`${s}px`,[`margin-${t}`]:`${i}px`,[c]:`round(min(max(${u}, min(${i}px, anchor(${d}))), max(100% - ${h+i}px, anchor(${c}) - ${h}px)), 1px)`,"position-anchor":e,"position-try-fallbacks":l?"flip-y":"flip-x","position-visibility":"always"}}var Ro=new WeakMap,Vp=globalThis[Symbol.for("ui-sdk.anchor-names@1")]??={count:0};function No(e){let t=Ro.get(e);if(!t)t=`--ui-anchor-${++Vp.count}`,Ro.set(e,t);if(!e.style.getPropertyValue("anchor-name").split(",").some((r)=>r.trim()===t)){let r=getComputedStyle(e).getPropertyValue("anchor-name");e.style.setProperty("anchor-name",r&&r!=="none"?`${r}, ${t}`:t)}return t}function kc(e){let t=Ro.get(e),n=e.style.getPropertyValue("anchor-name").split(",").map((r)=>r.trim()).filter((r)=>r&&r!==t);if(n.length)e.style.setProperty("anchor-name",n.join(", "));else e.style.removeProperty("anchor-name");if(!e.getAttribute("style"))e.removeAttribute("style")}var Et=new Map,Ac=()=>{},Wo=Ac,Ec=(e)=>Et.forEach((t,n)=>e.target instanceof Node&&t?.contains(e.target)||n()),Cc=(e)=>Et.forEach((t,n)=>e.some((r)=>r.attributeName!="aria-activedescendant"&&!t?.contains(r.target))&&n());function qp(){let e=new AbortController,t={capture:!0,passive:!0,signal:e.signal},n=[[document,["scroll","load","input","pointermove","focusin","transitionstart","animationstart"]],[window,["resize"]],[window.visualViewport,["resize","scroll"]],[document.fonts,["loadingdone"]]];for(let[o,s]of n)for(let a of s)o?.addEventListener(a,Ec,t);let r=new MutationObserver(Cc);return r.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{e.abort(),r.disconnect()}}var rr=new Map;function Hp(e){let t=new AbortController,n={capture:!0,passive:!0,signal:t.signal};for(let o of["scroll","load","transitionstart","animationstart"])e.addEventListener(o,Ec,n);let r=new MutationObserver(Cc);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{t.abort(),r.disconnect()}}function Mc(e){let t=[];for(let n=e;n;)if(n.nodeType===11&&"host"in n)t.push(n),n=n.host;else n=n.assignedSlot??n.parentNode;return t}function Pc(e){let t=[...e];for(let n of t){let r=rr.get(n)??{count:0,stop:Hp(n)};r.count++,rr.set(n,r)}return()=>{for(let n of t.splice(0)){let r=rr.get(n);if(--r.count)continue;r.stop(),rr.delete(n)}}}function Oc(e,t){if(!Et.size)Wo=qp();let n=typeof ResizeObserver=="function"?new ResizeObserver(e):void 0;if(t)n?.observe(t);return Et.set(e,n&&t),()=>{if(n?.disconnect(),Et.delete(e),Et.size)return;Wo(),Wo=Ac}}Un();Oe();function Kp(e){let t=e;if(!e.getClientRects().length){if(getComputedStyle(e).display!=="contents")return;if(t=e.ownerDocument.createRange(),t.selectNodeContents(e),!t.getClientRects().length)return}let{x:n,y:r,width:o,height:s}=t.getBoundingClientRect();return{x:n,y:r,width:o,height:s}}function Bp(e){let t="getBoundingClientRect"in e?e.getBoundingClientRect():{width:0,height:0,...e};return{x:t.x,y:t.y,width:t.width,height:t.height,left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height}}var Ct=(e)=>e==="top"||e==="bottom";function Tc(e,t,n,r,o){let{sideOffset:s,alignOffset:a}=o,i=n==="top"||n==="bottom",l=0,c=0;if(n==="bottom")c=e.y+e.height+s;if(n==="top")c=e.y-t.height-s;if(n==="right")l=e.x+e.width+s;if(n==="left")l=e.x-t.width-s;if(i){if(r==="start")l=e.x+a;if(r==="center")l=e.x+e.width/2-t.width/2+a;if(r==="end")l=e.x+e.width-t.width-a}else{if(r==="start")c=e.y+a;if(r==="center")c=e.y+e.height/2-t.height/2+a;if(r==="end")c=e.y+e.height-t.height-a}return{x:l,y:c}}function jo(e,t,n,r,o){if(e==="bottom")return t.y+n.height-(r.y+r.height-o);if(e==="top")return r.y+o-t.y;if(e==="right")return t.x+n.width-(r.x+r.width-o);return r.x+o-t.x}function _p(e,t,n,r){let{sideOffset:o,collisionPadding:s}=r,a=e==="bottom"?n.y+n.height-s-(t.y+t.height+o):e==="top"?t.y-o-s-n.y:n.height-s*2,i=e==="right"?n.x+n.width-s-(t.x+t.width+o):e==="left"?t.x-o-s-n.x:n.width-s*2;return{width:Math.max(0,i),height:Math.max(0,a)}}var Rc=(e,t,n=!1)=>n&&Ct(e)&&t!=="center"?t==="start"?"end":"start":t,Ue=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));function Dc(e,t,n,r){let o={x:0,y:0,...n},s={...r,side:Ht(r.side,r.rtl)},a=Rc(s.side,s.align,s.rtl),i=s.side,l=Tc(e,t,i,a,s),c=jo(i,l,t,o,s.collisionPadding);if(c>0){let v=Yn[i],x=Tc(e,t,v,a,s);if(jo(v,x,t,o,s.collisionPadding)<c)i=v,l=x}let d=s.collisionPadding,h=_p(i,e,o,s),u=!1;if(jo(i,l,t,o,d)>0){if((i==="top"||i==="bottom")&&t.height&&(e.height>=t.height||s.inside))u=!0,l.y=Ue(Ue(l.y,o.y+d,o.y+o.height-t.height-d),e.y,e.y+e.height-t.height),h.height=Math.max(0,o.height-d*2);else if((i==="left"||i==="right")&&t.width&&(e.width>=t.width||s.inside))u=!0,l.x=Ue(Ue(l.x,o.x+d,o.x+o.width-t.width-d),e.x,e.x+e.width-t.width),h.width=Math.max(0,o.width-d*2)}if(i==="top"||i==="bottom"){let v=Ue(l.x,o.x+d,o.x+o.width-t.width-d);l.x=v===l.x?v:Ue(v,e.x-t.width,e.x+e.width)}else{let v=Ue(l.y,o.y+d,o.y+o.height-t.height-d);l.y=v===l.y?v:Ue(v,e.y-t.height,e.y+e.height)}return{...l,side:i,align:s.align,available:h,inside:u}}var zp=3,Yp=500,$c=["--available-height","--available-width"],Lc=!1;function Nc(){if(Lc)return;Lc=!0,Nt(()=>Xr($c))}function Ic(e){let t=new Map,n=(r,o)=>{if(t.get(r)===o)return!1;return t.set(r,o),!0};return{style(r,o){if(n(`style:${r}`,o))e.style.setProperty(r,o)},attribute(r,o){if(!n(r,o))return;if(o===null)e.removeAttribute(r);else e.setAttribute(r,o)},reset:()=>t.clear()}}function Up(){let e=window.visualViewport;return{x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.width??document.documentElement.clientWidth,height:e?.height??document.documentElement.clientHeight}}function Wc(e,t,n={}){let r=()=>typeof n==="function"?n():n,o=()=>typeof e==="function"?e():e,s=(b)=>({side:b.side??"bottom",align:b.align??"start",sideOffset:Number(b.sideOffset??4),alignOffset:Number(b.alignOffset??0),collisionPadding:Number(b.collisionPadding??8)});Xr($c),Object.assign(t.style,{position:"fixed",inset:"auto",margin:"0",left:"0",top:"0"});let a=Ic(t),i=getComputedStyle(t),l,c="",d="",h=!1,u=!1,v=!1,x=[],w=()=>{},k=!1,A,W={left:"0",top:"0"},M,I=new Set;function N(b={left:"0",top:"0"}){if(A)kc(A.anchor);A=void 0;for(let C of I)a.style(C,"");I.clear(),c="",a.style("inset","auto"),a.style("margin","0"),a.style("left",b.left),a.style("top",b.top)}function q(){if(v)return!1;let b=r(),C=s(b),K=Number(b.arrowPadding??6),_=o();if(!_)return!1;let U="nodeType"in _?_:void 0,oe=U&&Kp(U);if(U&&h&&(!U.isConnected||!oe)){if(A)N(W);return!1}let ce=U?Mc(U):[];if(ce.length!==x.length||ce.some((pe,Ee)=>pe!==x[Ee]))w(),x=ce,w=Pc(ce);u=!U&&"getBoundingClientRect"in _;let ae=Up();if(A&&(U!==A.anchor||!$o(ae)))N();if(!k){if(k=!0,U&&oe&&xc(U,oe,t,i,ae))A={anchor:U,name:No(U)};else for(let pe of Xp)if(t.style.getPropertyValue(pe))t.style.removeProperty(pe)}else if(A)No(A.anchor);let P=!h,f=t.style.transition;if(P)t.style.transition="none";let m=Bp(oe??_),y={width:t.offsetWidth,height:t.offsetHeight},S=Vo(b),T=S?{width:S.offsetWidth,height:S.offsetHeight}:void 0,g=[m.x,m.y,m.width,m.height,y.width,y.height,ae.x,ae.y,ae.width,ae.height,T?.width,T?.height,...Object.values(C),K].join();if(g===c&&(!S||S===l?.el))return!1;c=g;let O={left:t.clientLeft,top:t.clientTop,width:t.clientWidth,height:t.clientHeight},D=i.direction==="rtl",H=Gp(i,y);if(A){let pe=Ht(C.side,D),Ee=Sc(A.name,pe,Rc(pe,C.align,D),C,H);for(let[je,ft]of Object.entries(Ee))I.add(je),a.style(je,ft)}let B=Jp(t.getBoundingClientRect(),H,i),{scale:j}=B,Y={width:H.width*j.x,height:H.height*j.y},X=[m.x,m.y,m.width,m.height,ae.x,ae.y,ae.width,ae.height,...Object.values(C)].join(),ie={...C,inside:d===X,sideOffset:C.sideOffset*(Ct(C.side)?j.y:j.x),alignOffset:C.alignOffset*(Ct(C.side)?j.x:j.y),rtl:D},le={x:m.x,y:m.y,width:m.width,height:m.height},G=Dc(le,Y,ae,ie);d=G.inside?X:"";let ve=M;M=le;let De=(pe)=>Math.abs(B.x-pe.x)<=1&&Math.abs(B.y-pe.y)<=1;if(A){let pe=De(G),Ee=!pe&&!!ve&&De(Dc(ve,Y,ae,ie));if(!pe&&!Ee)return N(),t.style.transition=f,q();if(Ee)c="";W={left:`${parseFloat(i.left)+parseFloat(i.marginLeft)}px`,top:`${parseFloat(i.top)+parseFloat(i.marginTop)}px`}}else{let pe={x:B.x-(parseFloat(i.left)||0)*j.x,y:B.y-(parseFloat(i.top)||0)*j.y},Ee=t.ownerDocument.defaultView?.devicePixelRatio||1,je=(ft)=>Math.round(ft*Ee)/Ee;a.style("left",`${je((G.x-pe.x)/j.x)}px`),a.style("top",`${je((G.y-pe.y)/j.y)}px`)}let F=Ct(G.side)?j.x:j.y;if(P)h=!0,i.left,t.style.transition=f;a.attribute("data-side",G.side),a.attribute("data-align",G.align),a.style("--available-height",`${G.available.height/j.y}px`),a.style("--available-width",`${G.available.width/j.x}px`),a.style("--anchor-width",`${m.width/j.x}px`),a.style("--anchor-height",`${m.height/j.y}px`);let[te,ge]=tm(G.side,G.align,D,m,Y,G);a.style("--transform-origin",`${Math.round(te/j.x)}px ${Math.round(ge/j.y)}px`);let dr={x:G.x+O.left*j.x,y:G.y+O.top*j.y,width:O.width*j.x,height:O.height*j.y},Ku=em(m,dr,G.side,K*F);if(a.style("--arrow-offset",`${Math.round(Ku/F)}px`),S&&T){let pe={...dr,...Y},Ee={width:T.width*j.x,height:T.height*j.y},je=Zp(m,pe,Ee,G.side,K*F),ft=Math.round(je.offset/F);if(l?.el!==S)l={el:S,write:Ic(S)};let{write:pt}=l;pt.style("position","absolute"),pt.style("left",Ct(G.side)?`${ft}px`:""),pt.style("top",Ct(G.side)?"":`${ft}px`),pt.attribute("data-side",G.side),pt.attribute("data-align",G.align),pt.attribute("data-arrow-clamped",je.clamped?"":null)}return!0}let Q=0,L=0;function R(){if(Q=0,L=q()?0:L+1,L<zp||u)Q=requestAnimationFrame(R)}function V(){L=0,Q||=requestAnimationFrame(R)}let z=Oc(V,t),Z=setInterval(()=>Q||q()&&V(),Yp);q(),V();let ne=()=>{cancelAnimationFrame(Q),clearInterval(Z),z(),w(),x=[],v=!0},re=r(),ee=Fc(re),E=Vo(re);function p(){let b=r(),C=Fc(b),K=Vo(b);if(C===ee&&K===E)return;ee=C,E=K,V()}return Object.assign(ne,{follow:p,place(){h=!1,c="",a.reset(),l?.write.reset(),q()}})}var Xp=["position-anchor","position-try-fallbacks","position-visibility"],Vo=(e)=>typeof e.arrow==="function"?e.arrow():e.arrow,Fc=(e)=>[e.side,e.align,e.sideOffset,e.alignOffset,e.collisionPadding,e.arrowPadding].join();function Gp(e,t){let n=(i)=>parseFloat(e.getPropertyValue(i))||0,r=(i,l)=>e.boxSizing==="border-box"?0:n(`padding-${i}`)+n(`padding-${l}`)+n(`border-${i}-width`)+n(`border-${l}-width`),o=parseFloat(e.width)+r("left","right"),s=parseFloat(e.height)+r("top","bottom"),a={width:Math.abs(o-t.width)<1,height:Math.abs(s-t.height)<1};return{width:a.width?o:t.width,height:a.height?s:t.height,exact:a}}var Qp=(e)=>{let t=parseFloat(e)||0;if(e.endsWith("turn"))return t*2*Math.PI;if(e.endsWith("grad"))return t*Math.PI/200;if(e.endsWith("rad"))return t;return t*Math.PI/180};function Jp(e,t,n){let[r=0,o=0]=n.transformOrigin.split(" ").map((f)=>parseFloat(f)||0),s=(f,m)=>!f?0:f.endsWith("%")?parseFloat(f)/100*m:parseFloat(f)||0,a=n.translate&&n.translate!=="none"?n.translate.split(" "):[],i=s(a[0],t.width),l=s(a[1],t.height),c=n.rotate&&n.rotate!=="none"?n.rotate.split(" "):[],d={x:[1,0,0],y:[0,1,0],z:[0,0,1]}[c[0]],[h,u,v]=d??(c.length===4?c.slice(0,3).map(parseFloat):[0,0,1]),x=Math.hypot(h,u,v)||1,[w,k,A]=[h/x,u/x,v/x],W=c.length?Qp(c[c.length-1]):0,[M,I]=[Math.cos(W),Math.sin(W)],N=[M+(1-M)*w*w,(1-M)*w*k-I*A,(1-M)*w*k+I*A,M+(1-M)*k*k],[q=1,Q=q]=n.scale&&n.scale!=="none"?n.scale.split(" ").map(parseFloat):[],L=/^matrix(3d)?\((.*)\)$/.exec(n.transform??""),R=L?.[2].split(",").map(parseFloat)??[],[V,z,Z,ne,re,ee,E,p,b]=!L?[1,0,0,1,0,0,0,0,1]:L[1]?[R[0],R[1],R[4],R[5],R[12],R[13],R[3],R[7],R[15]]:[...R,0,0,1],C=(f,m)=>{let[y,S]=[f-r,m-o],T=E*y+p*S+b||1,g=q*(V*y+Z*S+re)/T,O=Q*(z*y+ne*S+ee)/T;return[r+i+N[0]*g+N[1]*O,o+l+N[2]*g+N[3]*O]},K=[C(0,0),C(t.width,0),C(0,t.height),C(t.width,t.height)],_=K.map(([f])=>f),U=K.map(([,f])=>f),oe=Math.min(..._),ce=Math.min(...U),ae=(f,m,y=!1)=>m>0.01&&Math.abs(f-m)>=(y?0.05:1)?f/m:1,P={x:ae(e.width,Math.max(..._)-oe,t.exact?.width),y:ae(e.height,Math.max(...U)-ce,t.exact?.height)};return{x:e.x-P.x*oe,y:e.y-P.y*ce,scale:P}}function Zp(e,t,n,r,o){let s=r==="top"||r==="bottom",a=s?n.width:n.height,l=(s?e.x+e.width/2-t.x:e.y+e.height/2-t.y)-a/2,c=(s?t.width:t.height)-a-o,d=Math.max(o,Math.min(l,c));return{offset:Math.round(d),clamped:Math.abs(d-l)>0.5}}function em(e,t,n,r){let o=n==="top"||n==="bottom",s=o?e.x+e.width/2-t.x:e.y+e.height/2-t.y,a=o?t.width:t.height;return Math.round(Math.min(Math.max(s,r),Math.max(r,a-r)))}function tm(e,t,n,r,o,s){if(e==="top"||e==="bottom"){let i=n?r.right-s.x:r.left-s.x,l=n?r.left-s.x:r.right-s.x;return[t==="center"?r.left+r.width/2-s.x:t==="start"?i:l,e==="bottom"?0:o.height]}let a=t==="center"?r.top+r.height/2-s.y:t==="start"?r.top-s.y:r.bottom-s.y;return[e==="right"?0:o.width,a]}function qo(e,t,n){if(typeof t!=="string")return t??n();let r=e.getRootNode();return(r===e.ownerDocument?null:r.querySelector(t))??e.ownerDocument.querySelector(t)}function Ho(e,t,n){return{side:e.side??t.side??"bottom",align:e.align??t.align,sideOffset:e.sideOffset??t.sideOffset??4,alignOffset:e.alignOffset??t.alignOffset??0,collisionPadding:e.collisionPadding,arrow:n,arrowPadding:e.arrowPadding}}var jc={position:Wc,prepare:()=>wt(Nc),anchor:qo,options:Ho};var Ko=(e)=>({open:e.open,disabled:Me(e),readOnly:e.readOnly,required:e.required}),Bo=(e,t)=>`${t}-${e.listed?"list":"content"}`,nm={"aria-labelledby":void 0,"aria-label":void 0};function Vc(){return{props:{side:"string",align:"string",sideOffset:"number",alignOffset:"number",collisionPadding:"number",arrowPadding:"number",container:"value",anchor:"string",keepMounted:"boolean"},connect:St,present:(e,{props:t})=>e.mounted||!!t.keepMounted||!!e.prepared,role:(e)=>e.listed?"presentation":"listbox",roles:["presentation","listbox"],keys:[...wn,"Home","End","Enter"," ","typeahead"],attrs:(e,{id:t})=>({...gl(e,t),"aria-multiselectable":!e.listed&&e.multiple?"true":void 0,...e.listed?nm:jr(e,t),"aria-busy":!e.listed&&e.status==="loading"?"true":void 0,"data-presentation":e.presentation}),on:{...Ze,keydown:(e,{api:t})=>t.internal.onListKeyDown(e)},bind:(e,t)=>rm(e,t.key,t.store,t.api.internal,{part:t,anchor:t.api.internal.anchorElement,snapPoints:yc})}}function rm(e,t,n,r,o){let{aligned:s}=o,a=!0;Ve(()=>a&&n.set({settled:!0}));let i=r.loadMore.bind(e),l=r.presentation.bind(e,{snapPoints:o.snapPoints,anchor:()=>qo(e,r.contentProps(t).anchor,()=>s?.()||o.anchor()),position:()=>{let c=r.contentProps(t),d=s?.()?{...c,side:"bottom",align:"start",sideOffset:0}:c;return Ho(d,{align:"start"},r.arrowElement())},rendered:(c)=>Sa(o.part,c),initialFocus:r.initialFocus});return()=>{a=!1,i(),l(),n.set({settled:!1})}}function qc(){return{role:"listbox",keys:{none:"The field's input handles them, or the content around the list once focus is in it."},attrs:(e,{id:t})=>({id:`${t}-list`,"aria-multiselectable":e.multiple?"true":void 0,...jr(e,t),"aria-busy":e.status==="loading"?"true":void 0}),bind:(e,{store:t})=>bn(t,"listed")}}function Hc(e,t,n){}Oe();var Kc=new WeakMap;function Bc(e,t){let n=Kc.get(e);if(!n)Kc.set(e,n={});if(n[t]=(n[t]??0)+1,n[t]===1)e.setAttribute(t,"");return()=>{if(n[t]--,n[t]===0)e.removeAttribute(t)}}function om(e){xe(e,"ui-sdk-mirror","@layer ui-sdk{:where([data-mirror][aria-hidden]){display:inline-block}:where([data-mirror][aria-hidden]:dir(rtl)){scale:-1 1}}")}function im(e,t,n,r){let o,s,a,i=!0,l=()=>{let d=e.parentElement?.closest(t.item);if(!d)return!1;if(!o)o=Bc(d,"data-has-icon"),r(d);if(!t.list)return!0;let h=d.parentElement?.closest(t.list);if(h)s=Bc(h,"data-has-icons");return!!h},c=()=>{if(!l())return;a?.(),a=void 0};if(!l())queueMicrotask(()=>{if(i&&!l())a=n(c)});return()=>{i=!1,a?.(),o?.(),s?.()}}function _c(e){return{props:{mirror:"boolean",id:"id",item:{kind:"string",from:"item.value"}},state:(t,{props:n})=>({mirror:!!n.mirror}),attrs:(t,{props:n})=>({"aria-hidden":"true","data-mirror":n.mirror?"":void 0}),bind(t,{api:n,props:r,id:o,store:s}){om(t.ownerDocument);let a=(c)=>se&&queueMicrotask(()=>{if(c.isConnected)Hc(c,"An item with only an icon",{component:e.component,id:o})}),i=im(t,e,s.subscribe,a),l=e.register?.(t,{api:n,props:r});return()=>{i(),l?.()}}}}var zc={item:'[role="option"]',list:'[role="listbox"]'};var sm=[];function Yc(e,{api:t}){return{open:e.open,presentation:e.presentation,status:e.status,items:t.internal.listbox.visibleData()?.list??sm}}var Ut=Oa(),am={open:[],mounted:[],value:[],query:[],initial:[],items:[],status:[],listed:[],labeled:[],inline:[],disabled:[],formDisabled:[],readOnly:[],required:[],name:[],form:[],mounts:[],settled:[],groupLabels:[],fieldName:[],presentation:[],trigger:[],payload:[],titled:[],described:[],modal:[]},Uc=(e)=>({label:e({attrs:(t,{id:n})=>({id:`${n}-label`,for:`${n}-input`,...Sn(t)}),press({api:t,el:n}){if(n instanceof HTMLLabelElement&&n.control)return;t.focus()},bind:(t,{store:n})=>bn(n,"labeled")}),input:e({...Ut,keys:(t)=>[...Ut.keys,"Enter","Escape","Tab",...t.inline?["ArrowRight","End"]:[]],state:Ko,attrs:(t,n)=>({...Ut.attrs(t,n),name:t.name,form:t.form,"aria-autocomplete":t.inline?"both":"list","aria-controls":t.mounted?Bo(t,n.id):void 0,"aria-labelledby":t.labeled?`${n.id}-label`:void 0,required:t.required?"":void 0,readonly:t.readOnly?"":void 0,disabled:t.disabled?"":void 0,...ot(t.open),...Sn(t)}),on:{...Ut.on,focusin(t,{api:n,store:r}){if(n.internal.options().openOnFocus&&!r.get().open)n.internal.show({event:t,by:"keyboard",reason:"trigger-focus"})},focusout(t,{api:n,store:r}){let o=t.relatedTarget;if(!r.get().open)return;if(!o&&r.get().presentation==="sheet")return;if(o&&(n.internal.ownsElement(o)||n.internal.contentElement()?.contains(o)))return;if(!o&&!document.hasFocus())return;n.internal.hide({reason:"focus-out",event:t})}},press({api:t,store:n},r){if(n.get().open||!t.internal.options().openOnFocus)return;t.internal.show({event:r,by:hl(r),reason:"trigger-press"})},bind(t,n){let{api:r,id:o}=n,s=t;if(se)Ds(t,"The field has no accessible name. Add an AutocompleteLabel, a Field label or an aria-label.",{component:"autocomplete",id:o});let a=[Ut.bind(t,n),r.internal.bindReset(s),Bi(s,r.internal.setFormDisabled),vc(t,{store:n.store,presentation:r.internal.presentation,open:(i)=>r.internal.show({event:i,by:"touch",reason:"trigger-press"})})];return()=>a.forEach((i)=>i())}}),trigger:e({state:Ko,attrs:(t,{id:n})=>({type:"button",tabindex:"-1","aria-expanded":String(t.open),"aria-controls":t.mounted?Bo(t,n):void 0,disabled:Me(t)?"":void 0,...ot(t.open),...Sn(t)}),on:Ze,press({api:t,store:n},r){if(t.internal.inputElement()?.focus({preventScroll:!0}),n.get().open)t.internal.hide({reason:"trigger-press",event:r});else t.internal.show({event:r,by:"pointer",reason:"trigger-press"})}}),clear:e({props:{keepMounted:"boolean"},present:(t,{props:n})=>!!n.keepMounted||t.value!==""&&!xn(t),state:(t)=>({disabled:xn(t)}),attrs:(t)=>({type:"button",tabindex:"-1",disabled:Me(t)?"":void 0,"data-disabled":xn(t)?"":void 0}),on:Ze,press({api:t}){t.clear({reason:"clear-press"}),t.internal.inputElement()?.focus({preventScroll:!0})}}),content:e({...Vc(),state:Yc}),viewport:e({present:(t)=>t.presentation==="sheet"}),header:e({present:(t)=>t.presentation==="sheet"&&t.open}),list:e({...qc(),state:Yc}),item:e({...Ta(),selects:fa({highlighted:({key:t})=>[t],listing:({key:t})=>[t],...am}),state:(t,{key:n,props:r})=>({highlighted:t.highlighted===n,disabled:!!r.disabled})}),"item-text":e(ta()),"item-icon":e(_c({component:"autocomplete",...zc})),group:e(Fs()),"group-label":e(Ws()),separator:e(Rs()),empty:e($s()),status:e(Ns()),arrow:e(js())});var lm=["escape-key","outside-press","focus-out","window-blur","back","swipe"];function Xc(e){return lm.includes(e)}var cm=new Set(["image-load","image-error","imperative","item-removed","unmount","reset","restore","timeout","resize","page-hide"]),Xe;function _o(e,t){if(Xe==="agent")return Xe;if(cm.has(e))return"programmatic";if(t){let n=t();return n==="programmatic"&&Xe?Xe:n}return Xe??"programmatic"}function Xt(e,t){let n=Xe;Xe=e;try{return t()}finally{Xe=n}}function zo(e,t,n=!0){if(!n)return{...e,source:t};let r=!1;return{...e,source:t,cancel:()=>{r=!0},get canceled(){return r}}}var um=(e)=>`${e[0].toUpperCase()}${e.slice(1)}`,Gc=(e,t)=>`on${um(e)}${t}`;var Qt={},Gt=new Set,dm=new WeakMap;function Qc(e,t,n){let r,o,s=()=>{if(r?.(),r=void 0,o)Gt.delete(o);o=void 0};wt(()=>{if(Qt.add)r=Qt.add(e,t,n);else if(typeof document<"u"){if(Gt.add(o=new WeakRef(e)),dm.set(e,()=>r=Qt.add?.(e,t,n)),Gt.size%1000===0){for(let a of Gt)if(!a.deref())Gt.delete(a)}}return s})}function fm(e,t,n,r,o){if(se&&e.options().debug)console.debug(`[ui-sdk] ${e.label}#${e.id} ${t}: ${String(n)} (${r}, ${o})`)}function Jc(e,t){let{store:n,options:r}=e,o=new Map,s=new Map,a=new Map;if(e.onOptions((i,l)=>{if(se)Oi(o,i);if(!l)return;let c;for(let[d,h]of o){if(!(d in l))continue;if(we(l[d],h.value))c=h.source;o.delete(d)}return c}),se)e.onDestroy(()=>Pi(o));return(i,l,c)=>{if(a.has(i)&&we(a.get(i),l))return!1;let d=(s.get(i)??0)+1;s.set(i,d);let h=n.get()[i];if(we(h,l))return!1;let{reason:u,event:v}=c,x=zo(c,c.source??t(u,v));if(se)Li(u,v,{component:e.label,id:e.id});fm(e,i,l,u,x.source);let w=r(),k=w[i]!==void 0,A=a.has(i),W=a.get(i);a.set(i,l);try{Xt(x.source,()=>{let M=Gc(i,"Change"),I=w[M];if(typeof I==="function"){let q=se&&!!v?.defaultPrevented;if(I(l,x),se)Ii(M,q,x,{component:e.label,id:e.id})}let N=s.get(i)!==d;if(!x.canceled&&!k&&!N)n.set({[i]:l})})}finally{if(A)a.set(i,W);else a.delete(i)}if(se)Le({type:"change",component:e.label,id:e.id,key:i,value:l,reason:u,source:x.source,canceled:x.canceled,controlled:k});if(x.canceled)return!1;if(Qt.change?.(e.id,i,l,x,h),k){if(o.set(i,{value:l,source:x.source}),se)Mi(o,{component:e.label,id:e.id,key:i,value:l,reason:u,source:x.source},()=>r()[i])}return!0}}var or=(e,t)=>_o(e,t&&(()=>He(t)));function pm(){return En(),or}function ir(e,t=pm()){return Jc(e,t)}var mm=new WeakSet,Yo=(e)=>(mm.add(e),e);function Zc(e,t){return Yo(Promise.resolve({reason:e,source:or(e,t)}))}function eu(e){let{popup:t,store:n,rules:r={}}=e,o="imperative",s="trigger-press",a,i,l;t.observe((w)=>{let k=w?void 0:i??{reason:"imperative",source:"programmatic"};if(i=void 0,!k)return;return a?.resolve(k),a=void 0,k}),e.onDestroy(()=>{a?.resolve({reason:"unmount",source:"programmatic"}),a=void 0});function c(w){if(!a){let k;a={promise:Yo(new Promise((W)=>k=W)),resolve:k}}if(w&&!w.aborted){let k=()=>t.requestClose("imperative");w.addEventListener("abort",k,{once:!0}),a.promise.then(()=>w.removeEventListener("abort",k))}return a.promise}function d(w={},k){return h(w,k).result}function h(w,k){let{event:A,signal:W}=w;if(W?.aborted)return{opened:!1,result:Zc("imperative")};let M=w.reason??(A?"trigger-press":"imperative"),I=k??M,N={...w,reason:I,payloadReason:M},q=!1,Q=(L=w.by??"imperative")=>{l=w.anchor;let R=e.payload?.opening(w.trigger,w.payload,{reason:M,event:A});if(t.opening(L,A),q=e.change(!0,{reason:I,event:A}),!q)R?.();return q};if(n.get().open){if(t.opener()==="hover"&&w.by!=="hover")t.opening(w.by??"imperative",A);if(w.trigger===void 0&&e.payload?.reopening(w,{reason:M})&&w.anchor)l=w.anchor;return r.reopen?.(N,Q),{opened:q,result:c(W)}}if(r.open)r.open(N,Q);else Q();return{opened:q,result:q?c(W):Zc(I,A)}}function u(w={}){if(!n.get().open)return!1;let{event:k,returnValue:A}=w,W=w.reason??"imperative";if(e.dismissal&&!e.dismissal.allows(W,k))return!1;let M=!1,I=()=>{i={reason:W,source:or(W,k),returnValue:A},t.returnFocus(w.focus??e.returnFocus??!0);let N=e.change(!1,{reason:W,event:k,...A!==void 0&&{returnValue:A}});if(!N)t.returnFocus(!0),i=void 0;return M=N,N};if(r.close)r.close({...w,reason:W},I);else I();return M}function v({trigger:w,payload:k,anchor:A,reason:W,event:M}){l=A,e.payload?.handOver(w,k,{reason:W,event:M})}let x=(w,k)=>h({reason:"imperative",event:k},w).opened;return{api:{isOpen:()=>n.get().open,setOpen:(w,{reason:k,event:A}={})=>w?x(k,A):u({reason:k,event:A}),open:(w={})=>d({...w,reason:w.reason??"imperative"}),close:({reason:w,event:k,returnValue:A}={})=>u({reason:w,event:k,returnValue:A}),toggle:({reason:w,event:k}={})=>n.get().open?u({reason:w,event:k}):x(w,k)},show:d,attempt:h,hide:u,takeOver:v,result:c,anchor:()=>l}}function tu(e,t){let n=e,{store:r,element:o,options:s}=n,{preset:a}=t,i=t.slot??"content",l=t.trigger??"trigger",c=ir(n),d=(p)=>p!==void 0&&n.props(i,p)||_e(n,i)[0]?.props||n.props(i)||{},h=()=>{if(A?.trigger)return A.trigger();let p=r.get().trigger;return p!==null&&o(l,p)||o(l)},u=null,v,x=()=>{let p=r.get().trigger;if(A?.trigger||p===null||p===u)return h();let b=v??_e(n,l).length<=1;return o(l,p)??(b?o(l):void 0)},w=r.get().open;r.subscribe(()=>{let{open:p,trigger:b}=r.get();if(p===w)return;if(w=p,!p)return;u=b!==null&&!o(l,b)?b:null,v=_e(n,l).length<=1});let k={label:n.label,role:t.role??a.role,store:r,options:s,onOptions:n.onOptions,onDestroy:n.onDestroy,element:o,parts:n.parts,preset:a,get popup(){return Z},get control(){return ne},triggerElement:h,triggerSlot:l,triggerDisabled:(p)=>!!n.props(l,p)?.disabled,contentProps:d},A=k.rules=t.rules?.(k),W=a.dismissal?.(s,A),M=a.presentation?.(k,W),I=a.press?.(k),N=a.group?.(k),q=a.hover?.(k,N),Q=a.focus?.(k),L=a.triggerName?.(k);a.resetStyles?.prepare(n.label,i),a.placement?.prepare();function R(p,b){if(a.modal===void 0)return;return{modal:p.modal??(b.presentation==="sheet"?!0:a.modal)}}function V(){let p=R(s(),r.get());if(p)r.set(p)}function z(p,b){if(A?.dismiss)A.dismiss(p,b);else ne.hide({reason:p,...b})}let Z=bl({...t.behavior,preset:a.behavior,position:a.placement?.position,owner:{component:n.label,id:n.id},store:r,trigger:h,returnTrigger:x,contains:(p,b)=>A?.contains?A.contains(p,b):!!h()?.contains(p)||!!I?.contains(p,b),close:z,modal:()=>A?.modal?.()??ml(r.get().modal),parent:()=>A?.parent?.(),persistent:()=>A?.persistent?.()??[],finalFocus:()=>d().finalFocus,onEscape:(p)=>A?.onEscape?A.onEscape(p):z("escape-key",{event:p,focus:!0}),onShow:(p)=>A?.onShow?.(p),onOpenChange(p,b){if(A?.onOpenChange?.(p,b),N?.change(p),p){M?.open(),V();return}q?.clear(),Q?.clear()},onOpenChangeComplete(p,b){A?.onOpenChangeComplete?.(p,b),s().onOpenChangeComplete?.(p)}}),ne=eu({dismissal:W,popup:Z,store:r,payload:a.payload?.(r,(p,b)=>c("payload",p,b)),change:(p,b)=>c("open",p,{...b,...A?.details?.()}),onDestroy:n.onDestroy,get returnFocus(){return A?.returnFocus},rules:{open(p,b){if(q?.clear(),N?.opening(p.event),A?.open)A.open(p,b);else b()},reopen(p){if(q?.clear(),A?.reopen)return A.reopen(p);let{trigger:b,payload:C,payloadReason:K,event:_}=p;if(b!==void 0&&b!==r.get().trigger)ne.takeOver({trigger:b,payload:C,reason:K,event:_})},close:(p,b)=>A?.close?A.close(p,b):b()}});V(),nt(n,["modal"],(p,b,C)=>R(C,{...b,...p}));let re=r.get().modal;r.subscribe(()=>{let{modal:p}=r.get();if(p===re)return;re=p,Z.updateModal()});let ee={dismissal:W,presentation:M,press:I,group:N,hover:q,focus:Q,triggerName:L,rules:A};return{...{...ne.api,getPayload:()=>r.get().payload,focus:()=>h()?.focus()},internal:Object.assign(k,ee)}}function nu(e){let t=e.open??e.defaultOpen??!1;return{open:t,mounted:t,trigger:null,payload:void 0,titled:null,described:!1,modal:!1,presentation:"popover"}}function ru(e,t={}){let n=()=>e().dismissible!==!1,r=(o,s)=>e().onDismissAttempt?.({reason:o,event:s});return{allows(o,s){let a=t.refusal?.(o)??(Xc(o)&&!n()?"attempt":void 0);if(!a)return!0;if(a==="attempt"&&o!=="focus-out"&&o!=="window-blur")r(o,s),t.refused?.(o);return!1},sheet:{dismissible:n,onDismissAttempt:(o)=>r("swipe",o)}}}function hm(e,t){let n=e.preset.behavior==="dialog";if(n)e.store.set({presentation:"dialog"});return bc(e.store,()=>e.popup,()=>e.rules?.presentation?e.rules.presentation():e.options().presentation,n?"dialog":"popover",t)}var ou={behavior:"combobox",modal:!1,dismissal:ru,placement:jc,presentation:hm};Se();var gm=["input","trigger","clear","label"];function iu(e){let t=e.value??e.defaultValue??"";return{...nu(e),value:t,query:t,initial:e.defaultValue??"",highlighted:null,items:e.items,status:e.status??"idle",listed:!1,labeled:!1,fieldName:null,inline:!!e.inlineComplete,disabled:!!e.disabled,formDisabled:!1,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,mounts:0,settled:!1,focusInList:!1,groupLabels:[],presentation:"popover",listing:Ss}}function su(e){return{items:e.items,status:e.status??"idle",inline:!!e.inlineComplete,disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,...e.defaultValue===void 0?{}:{initial:e.defaultValue},...e.open===void 0?{}:{open:e.open},...e.value===void 0?{}:{value:e.value}}}function bm(e){let{id:t,store:n,options:r,element:o}=e;bo(e,["highlighted","focusInList"],(p)=>p?void 0:{highlighted:null,focusInList:!1});let s=ir(e),a=n.get().value,i="imperative",l=null,c=()=>o("input"),d=()=>W.element()??o("content"),h=()=>{let p=n.get();return!Me(p)&&!p.readOnly},u=()=>!!r().inlineComplete;function v(p,b){let C=Pe(p);if(!C)return;return b.entries().find((K)=>!b.disabled(K)&&Pe(K.label).startsWith(C))}let x=Pa(e,{query:()=>n.get().query,items:()=>n.get().items,emptyItems:()=>r().emptyItems,filter:()=>r().filter??"contains",autoHighlight:()=>r().autoHighlight||u()?"typing":!1,preferred:(p)=>u()?v(n.get().query,p)?.key:void 0,highlight(p,b){if(x.listbox.highlight(p,{event:b?.event}),p!==null&&u()&&b?.reason==="list-navigation")L(p,b.event)},open(p,b){if(!p.altKey)l=b;I({event:p,by:"keyboard"})},onHighlight:(p,b,C)=>r().onHighlight?.(p,{index:b,event:C}),container:()=>o("list")??d(),scrollRoot:d});nt(e,["highlighted"],(p,b)=>{if(p.items===b.items)return;return{highlighted:n.view({...b,...p},()=>x.settledHighlight(!1))}});let w=(p)=>gm.some((b)=>_e(e,b).some(({el:C})=>C.contains(p))),k=tu(e,{preset:ou,rules:()=>({trigger:c,returnFocus:!1,dismiss:(p,{event:b})=>N({reason:p,event:b}),contains:w,onOpenChange(p){if(p)return;l=null,n.set({highlighted:null,focusInList:!1})},onShow(){let p=o("content");if(p)return Zs(p,Js(i),()=>[c()])},open({event:p,by:b},C){if(!h())return;i=b==="touch"&&M.resolve()!=="sheet"?"pointer":b??"imperative",n.set({focusInList:na(p)&&p?.target!==c()}),C(i)},close(p,b){let C=n.get().focusInList&&!!d()?.contains(document.activeElement);b();let K=c();if(C&&K&&!n.get().open)Cn(K)}})}),{control:A,popup:W}=k.internal,M=k.internal.presentation,{show:I,hide:N}=A;function q(p,b,{event:C,query:K=p,item:_}={}){let U=n.get();if((Me(U)||U.readOnly)&&b!=="reset")return!1;if(a=p,x.cause(b,C),p===U.value||s("value",p,{reason:b,event:C,..._&&{item:_}})){if(a===p)n.set({query:K});return!0}let oe=c();if(oe&&oe.value!==U.value)oe.value=U.value;return!1}function Q(p,b){if(!h())return;let C=p.value,K=b,U=u()&&!K?.isComposing&&!!K?.inputType?.startsWith("insert")&&K.inputType!=="insertReplacementText"&&p.selectionEnd===C.length?v(C,x.listbox):void 0,oe=U?C+U.label.slice(C.length):C;if(!q(oe,"input-change",{event:b,query:C}))return;if(U&&oe!==C)p.value=oe,p.setSelectionRange(C.length,oe.length);if(!n.get().open&&(b||p.matches(":focus"))){if(C)l="first";I({event:b,by:"keyboard",reason:"input-change"})}}function L(p,b){let C=x.listbox.find(p)?.label,K=c(),{query:_}=n.get();if(C===void 0||!q(C,"list-navigation",{event:b,query:_}))return;if(!K)return;K.value=C;let U=Pe(C).startsWith(Pe(_))?_.length:C.length;K.setSelectionRange(U,C.length)}function R(p){return r().onSubmit?.(n.get().value,{event:p}),!p?.defaultPrevented}function V(p,b){let C=x.listbox.find(p);if(!C||x.listbox.disabled(C)||!h())return!1;q(C.label,"item-press",{event:b,item:{value:C.key,label:C.label}});let K=c();if(K&&K.value!==n.get().value)K.value=n.get().value;return N({reason:"item-press",event:b}),!0}function z(p,b){if(!V(p,b)||!r().submitOnSelect)return;if(R(b))Ki(c()?.form)}function Z(p){let{open:b,highlighted:C}=n.get();if(b&&C!==null){let K=x.listbox.element(C);if(K?.matches("a[href]"))return p.preventDefault(),K.click();if(!V(C,p))return p.preventDefault();if(!r().submitOnSelect||!R(p))p.preventDefault();return}if(b)N({reason:"input-commit",event:p});if(!R(p))p.preventDefault()}function ne(p){if(x.navigate(p))return;let{open:b,value:C,query:K}=n.get();switch(p.key){case"ArrowUp":if(p.altKey&&b)p.preventDefault(),N({reason:"escape-key",event:p});return;case"ArrowDown":if(p.altKey&&!b)p.preventDefault(),I({event:p,by:"keyboard"});return;case"Enter":return Z(p);case"ArrowRight":case"End":if(u()&&C!==K&&!p.shiftKey)x.cause("input-change",p),n.set({query:C});return;case"Escape":if(b&&C!==K&&q(K,"escape-key",{event:p})){let _=c();if(_)_.value=K}return;case"Tab":if(b)N({reason:"focus-out",event:p})}}function re(p){return J(p.ownerDocument,"reset",(b)=>{if(b.target!==p.form||Vi(r().value,r().defaultValue))return;ji(b,()=>{let{initial:C}=n.get();if(q(C,"reset"),p.value!==n.get().value)p.value=n.get().value})},{capture:!0})}let ee={id:t,isOpen:k.isOpen,setOpen:k.setOpen,open:k.open,close:k.close,toggle:k.toggle,getValue:()=>n.get().value,setValue:(p,{reason:b="imperative",event:C}={})=>p!==n.get().value&&q(p,b,{event:C}),clear:({reason:p="imperative",event:b}={})=>n.get().value!==""&&q("",p,{event:b}),getHighlighted:()=>Ir(x.listbox,n.get().highlighted),highlight:(p)=>n.get().open&&Lr(x.listbox,p===null?null:String(p),n.get().highlighted),focus:()=>c()?.focus(),internal:{...x,options:r,popup:W,presentation:M,show:I,hide:N,press:z,typed:Q,onInputKeyDown:ne,ownsElement:w,bindReset:re,inputElement:c,anchorElement:c,contentElement:d,arrowElement:()=>o("arrow"),text:(p)=>p.value,itemProps:(p)=>e.props("item",p),setFormDisabled:(p)=>n.set({formDisabled:p}),initialFocus(){let p=l;if(l=null,n.get().focusInList){let b=x.listbox.firstEnabled();if(b===void 0)return d();return x.listbox.highlight(b,{focus:!1}),x.listbox.element(b)??d()}if(p==="first"&&n.get().query)x.settle(!0,null);else if(p)x.listbox.highlight(x.listbox.stepKey(p)??null);return n.get().presentation==="sheet"?c():void 0},onListKeyDown(p){if(!n.get().focusInList||p.target===c())return;ms(p,{listbox:x.listbox,highlighted:n.get().highlighted,choose:z,focusInput(){n.set({focusInList:!1}),c()?.focus({preventScroll:!0})}})},contentProps:(p)=>k.internal.contentProps(p)}};nt(e,["query"],(p,b)=>("value"in p)&&p.value!==b.value&&p.value!==a?{query:p.value}:void 0);let E=n.get().value;return n.subscribe(()=>{let{value:p}=n.get();if(p===E)return;if(E=p,p===a)return;a=p,n.set({query:p})}),ee}var au=bm;function lu(e){if(e===null)return;if(e==="false")return!1;if(e==="pointer")return"pointer";return!0}function uu(e){let t=e.slots((a)=>a),n=e.name,r=e.label??n;if(se)Ai(t,{component:r});let o=(a)=>{let i=a,l=a.id,c=vs({...e.state(i),...e.sync?.(i)},e.live??[]),d=[],h=[],u={component:r,id:l},v=se?(e.controlled??["open","value","checked"]).filter((E)=>(E in c.get())):[];if(se)wr(u,v,i);let x=Object.create(se?ki(t,u):t),w=new Set;function k(E){if(w.has(E))return;w.add(E),Object.assign(x,E.slots),V(),E.extend?.(L)}let A={name:n,label:r,slots:x,parts:new Map,released:[]},{parts:W}=A;function M(E={}){return E.id??(E.value==null?"":String(E.value))}let I;function N(E,p={},b=!1){let C=M(p),K=`${E}:${C}`,_=W.get(K);if(!_){if(W.set(K,_={slot:E,key:C,id:l,get api(){return L},store:c,props:p,el:void 0,owner:A,leases:0}),b)ba(_)}else if(b)return _;return _.props=p,xa(_),_}function q(E,p){if(p===void 0){for(let C of W.values())if(C.slot===E&&C.el?.isConnected)return C.el;return}let b=W.get(`${E}:${p}`)?.el;return b?.isConnected?b:void 0}let Q={id:l,label:r,store:c,options:()=>i,onOptions:(E)=>h.push(E),onDestroy:(E)=>d.push(E),parts:()=>W.values(),element:q,props:(E,p="")=>{let b=I?.[E];return b&&M(b)===p?b:W.get(`${E}:${p}`)?.props}},L=void 0;function R(){if(L=e.api(Q),Va(Q,L),se){for(let E of e.agent?.actions??[])if(typeof L[E]!=="function")me(`lists \`${E}\` in \`agent.actions\`, but its api has no such method.`,u)}}function V(){let{sleeping:E}=A;if(!E)return;A.sleeping=void 0,Ra(ee,R);for(let p of[...E.binds])p()}if(e.asleep?.(i))A.sleeping={wake:V,binds:new Set};else R();let z=!1,Z=!1,ne=!1,re=(E,p)=>bs(c,E,e.sync?.(E),p),ee={types:void 0,name:n,id:l,get:c.get,subscribe:c.subscribe,get api(){return V(),L},part:N,use:k,preview(E){let p=re({...E,id:l},c.get()),b=c.get();for(let C in p)if(!we(b[C],p[C]))return{...b,...p}},view(E,p,b){let C=I;I=b;try{return c.view(E,p)}finally{I=C}},setOptions(E){let p=Ft(c),b=E.id===l?E:{...E,id:l},C=se&&Z?re(b,p):void 0;if(i=b,se)wr(u,v,i);if(A.sleeping&&!e.asleep(i))V();let K=re(i,p);if(se&&C){let U=ym(C,K);if(U.length)Le({type:"relay",...u,keys:U})}let _;z=!0;try{for(let oe of h)_=oe(i,K)??_;let U=Ft(c)===p?K:re(i,Ft(c));if(U)Xt(_,()=>c.set(U,!0))}finally{z=!1}},startState:(E)=>e.state({...E,id:l}),follow(E){Z=!0;let p,b,C=(K=Ft(c),_)=>{if(_)return re({..._,id:l},K);if(ne)return b;let U=E();if(p?.options!==U||p.state!==K)p={options:U,state:K},b=re({...U,id:l},K);return b};if(c.follow(C),se)c.subscribe((K,_,U)=>{if(z&&!_&&!Di())Le({type:"relay",...u,keys:[...U]})});return C},destroy(){if(ne)return;if(ne=!0,Na(ee),Ia(()=>d.forEach((E)=>E())),se)Le({type:"instance",action:"destroy",...u,controlled:v})}};if(ws(ee,c),Qc(ee,W,e),se)Le({type:"instance",action:"create",...u,controlled:v});return ee},s=(a)=>Fa(()=>o(a));return Object.defineProperty(s,"name",{value:n}),Object.assign(s,{options:e.options,slots:t})}function ym(e,t){let n=e,r=t??{};return[...new Set([...Object.keys(n),...Object.keys(r)])].filter((s)=>!we(n[s],r[s]))}var cu=new WeakMap;function Uo(e){let t=cu.get(e);if(!t){let{options:n,slots:r={}}=e;t={options:{debug:"boolean",...n},slots:Object.fromEntries(Object.entries(r).map(([o,s])=>[o,s.props??{}]))},cu.set(e,t)}return t}var Jt=(e)=>hn(e);var vm=uu({name:"autocomplete",options:{container:"value",value:"string",defaultValue:"string",onValueChange:"callback",open:"boolean",defaultOpen:"boolean",onOpenChange:"callback",onOpenChangeComplete:"callback",onSubmit:"callback",items:"value",emptyItems:"value",filter:fs(["contains","startsWith","fuzzy"],"contains"),inlineComplete:"boolean",autoHighlight:"boolean",openOnFocus:"boolean",submitOnSelect:"boolean",status:"string",onHighlight:"callback",onLoadMore:"callback",announcement:"value",loop:"boolean",modal:lu,presentation:"string",disabled:"boolean",readOnly:"boolean",required:"boolean",name:"string",form:"string",controller:"value",dismissible:"boolean",onDismissAttempt:"callback"},state:iu,live:["highlighted"],controlled:["open","value"],sync:su,api:au,slots:(e)=>Uc(e),agent:{actions:["setOpen","setValue","clear"]}}),du=vm;var Xo=new WeakMap,fu=new WeakMap;function Mt(e,t,...n){if(t==="customValidity")fu.set(e,n[0]);let r=Xo.get(e)?.[t];return r?.(...n),!!r}function Go(e,t,n){let r="",o=()=>{let c=n.value();if(c instanceof FormData)t.setFormValue(c,n.state());else if(Array.isArray(c)){let v=new FormData,x=n.name?.();if(x)for(let w of c)v.append(x,w);t.setFormValue(v,n.state())}else t.setFormValue(c,n.state());let d=n.valueMissing(),h=fu.get(e),u=n.invalid?.();if(h)t.setValidity({customError:!0},h,n.anchor?.()??e);else if(u)t.setValidity(u.flags,u.message,u.anchor??n.anchor?.()??e);else if(d)t.setValidity({valueMissing:!0},n.message(),n.anchor?.()??e);else t.setValidity({});if((u?.message??"")===r)return;r=u?.message??"",Lt(e)};o();let s=n.subscribe(o),a=n.focus?qi(e,n.focus):()=>{};if(e.matches(":disabled"))n.disabled(!0);Xo.set(e,{reset:()=>{n.reset(),o()},disabled:(c)=>n.disabled(c),restore:(c)=>{if(typeof c==="string")n.restore(c)},customValidity:o});let i=_i(e,()=>on(e)),l=()=>{if(n.focus)Hi(e,t.form)};return e.addEventListener("invalid",l),()=>{e.removeEventListener("invalid",l),s(),i(),Xo.delete(e),a()}}Oe();function pu(){let e=[],t=!0;return{waitUntil:(o)=>{if(!t)throw new DOMException("waitUntil() can only be called while the event dispatches.","InvalidStateError");e.push(o)},done:()=>(t=!1,e)}}var Qo=new WeakMap,xu=0,mu=new Set;function Su(e){if(typeof customElements>"u"||mu.has(e))return!1;if(customElements.get(e))return me(`<${e}> is already defined by another library or another copy of ui-sdk. This one is skipped.`),!1;return mu.add(e),!0}function ti(e){if(!Qo.has(e))Qo.set(e,`auto-${++xu}`);return Qo.get(e)}function li(e){return e.querySelector(":scope > button, :scope > a, :scope > ui-button > button, :scope > ui-button > a")??e.firstElementChild}var ci=(e)=>(t)=>t.querySelector(`:scope > ${e}`)??t.firstElementChild;function ut(e,t){if(t)return t(e);return e.hasAttribute("as-child")?e.firstElementChild:e}var ku=(e,t)=>e.id!==t.id||e.value!==t.value,ur=(e)=>e.replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`),lr=["role","aria-disabled"];function Au(e,t){if(t===null)return;if(typeof e==="function")return e(t);if(e==="boolean")return t!=="false";if(e==="number"){let n=Number(t);return t.trim()===""||Number.isNaN(n)?void 0:n}if(e==="list")return t.split(",").map((n)=>n.trim()).filter(Boolean);return t}var wm=new Set(["disabled","required"]);function ui(e,t,n){let r=e.getAttribute(ur(t));if(n==="boolean"&&wm.has(t))return r===null?void 0:!0;return Au(n,r)}function Eu(e,t){let n={};for(let[r,o]of Object.entries(t)){let s=ui(e,r,o);if(s!==void 0)n[r]=s}return n}var hu=(e,t)=>typeof t==="function"?t(e):t;function Cu(e,t,n={}){for(let[r,o]of Object.entries(t)){if(r in e)continue;let s=ur(r);Object.defineProperty(e,r,{configurable:!0,get(){return ui(this,r,o)??hu(this,n[r])??(o==="boolean"?!1:void 0)},set(a){let i=a===!1&&o==="boolean"&&!hu(this,n[r]);if(a==null||i)this.removeAttribute(s);else this.setAttribute(s,a===!0?"":Array.isArray(a)?a.join(","):String(a))}})}}function Mu(e,t){for(let n of t){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n];delete e[n],e[n]=r}}var Ge=new Set;function Pu(e,t,n){Ge.add(e);try{return Mt(e,"restore",t,n)}finally{Ge.delete(e)}}var dt=new Map;function ni(e){for(let t of dt.keys())if(t.contains(e))dt.delete(t)}function Ou(e,t,n){let r={};dt.set(e,r),queueMicrotask(()=>{if(dt.get(e)!==r)return;dt.delete(e),Pu(e,t,n)})}function xm(e){let t=Pt.get(e);if(Ge.has(e)||!!t&&Ge.has(t))return!0;for(let n of Ge)if(e.contains(n))return!0;return!1}function Sm(e,t){return t===void 0&&!!e&&typeof e==="object"&&"reason"in e&&!(typeof Event<"u"&&e instanceof Event)}function ri(e,t,n=[],r=[],o={}){return new Proxy(t,{get(s,a){if(a in s||typeof a!=="string"||!/^on[A-Z]/.test(a))return s[a];if(n.includes(a))return;return(i,l)=>{if(xm(e))return;let c=Sm(i,l),{cancel:d,canceled:h,...u}=(c?i:l)??{},v=c?u:{...u,value:i},x=r.includes(a)?pu():void 0;if(x)v.waitUntil=x.waitUntil;let w=new CustomEvent(o[a]??a.slice(2).toLowerCase(),{detail:v,bubbles:!1,cancelable:typeof d==="function"||typeof i?.preventDefault==="function",composed:!0}),k=e.dispatchEvent(w),A=x?.done()??[];if(!k){if(typeof d==="function")d();else if(i&&typeof i.preventDefault==="function")i.preventDefault()}return A.length>1?Promise.all(A).then((W)=>W.at(-1)):A[0]}}})}var ar=new WeakMap;function km(e){return e?ar.get(e):void 0}var Am=/^(?:get|is|can)[A-Z]|^focus$/;function Em(e,t,n){let r={};for(let o of n){let s=t[o];if(typeof s==="function")r[o]=(...a)=>{if(!Am.test(o))ni(e);return s.apply(t,a)}}return Object.freeze(r)}var Tu=new Map,Du=new Set,Jo;function Lu(){if(Jo)return Jo;let e=globalThis,t=Symbol.for("ui-sdk.web-styles@1");return e[t]=(e[t]??0)+1,Jo=`ui-sdk-web-${e[t]}`}var cr="",oi=0,gu=new WeakMap;function Iu(e,t,n=!1){if(n)Du.add(e);if(!t&&!n)return;if(t)Tu.set(e,t);cr=Fu(),xe(document,Lu(),cr),oi++}function Fu(){return["@layer ui-sdk {",' :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important }',...[...Tu].map(([e,t])=>` :where(${e}:not([hidden]), ${e}[hidden="until-found"]) { display: ${t} }`),...[...Du].map((e)=>` :where(${e}[align]) { text-align: inherit }`)," :where([as-child]) { display: contents }","}"].join(`
|
|
2
|
-
`)}function ii(e){let t=e.getRootNode();if(!Cm(t))return Pm(e.ownerDocument);let n=Mm(t.ownerDocument);if(!n||t.adoptedStyleSheets.includes(n))return;t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}var Cm=(e)=>e.nodeType===11&&("host"in e);function Mm(e){let t=e.defaultView;if(!t)return;let n=gu.get(e);if(!n)gu.set(e,n={sheet:new t.CSSStyleSheet,version:-1});if(n.version!==oi)n.sheet.replaceSync(Fu()),n.version=oi;return n.sheet}function Pm(e){if(cr)xe(e,Lu(),cr)}var si=new Set;function bu(e){for(let t of si)if(t!==e&&e.contains(t))t.reconfigure()}var ai=new WeakMap;var Pt=new WeakMap,Zt=new WeakMap;function Om(e,t){for(let n=e.el;n&&n!==t;n=n.parentElement){let r=Zt.get(n);if(r===e)return;if(r?.el===e.el&&en.has(r))return r}}function Tm(e){e.dataSlot=void 0;let t=[];for(let n=e.el;n;n=n.parentElement){let r=Zt.get(n);if(r&&r!==e&&r.el===e.el&&en.has(r))t.push(r)}if(!t.length)return;e.el.removeAttribute("data-slot"),jt(e.el,"data-slot");for(let n of t)n.sync?.()}var en=new WeakSet,Ru=new WeakMap,$u=(e)=>e.value!==void 0&&typeof e.value!=="string";function Dm(e,t,n){for(let r=e.parentElement;r;r=r.parentElement){let o=Zt.get(r);if(o?.slot!==t||Pt.get(r)!==n)continue;return o.keyed&&$u(o.props)?{...o.props,value:o.props.id}:o.props}}function sr(e,t){let n=e.getAttribute("for");if(n){let r=e.getRootNode(),o="getElementById"in r?r.getElementById(n):null;if(o?.matches(t))return o}for(let r=e.parentElement;r;r=r.parentElement){if(r.matches(t))return r;let o=Pt.get(r);if(o?.matches(t))return o}}function Nu(e,t){queueMicrotask(()=>{if(!e.isConnected)t()})}var Wu=new WeakMap,Lm=(e,t,n)=>(Wu.set(e,n.state),Go(e,t,n));function ju(e){return class extends e{static formAssociated=!0;#t;constructor(){super();this.#t=this.attachInternals(),Cr(this,this.#t,Lm)}get form(){return this.#t.form}get labels(){return this.#t.labels}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get validity(){return this.#t.validity}get validationMessage(){return this.#t.validationMessage}get willValidate(){return this.#t.willValidate}checkValidity(){return this.#t.checkValidity()}reportValidity(){return this.#t.reportValidity()}setCustomValidity(t){if(!Mt(this,"customValidity",t))this.#t.setValidity(t?{customError:!0}:{},t)}formResetCallback(){dt.delete(this),Mt(this,"reset")}formDisabledCallback(t){Mt(this,"disabled",t)}formStateRestoreCallback(t,n){if(dt.delete(this),!Pu(this,t,n))Ou(this,t,n)}}}var Zo=(e)=>`default${e[0].toUpperCase()}${e.slice(1)}`;function Im(e,t,n){if(!Su(e))return;Iu(e,n.display);let r={debug:"boolean",...n.attributes},o=n.state??{},s=(a,i,l)=>{let c=Eu(a,r);for(let d of l)delete c[d];for(let[d,h]of Object.entries(i))if(h!==void 0)c[d]=h;for(let d of Object.keys(o)){if(!(d in c))continue;let h=Zo(d);if(!(h in c))c[h]=c[d];delete c[d]}return{...c,...n.options?.(a)}};customElements.define(e,class a extends(n.formAssociated?ju(HTMLElement):HTMLElement){static observedAttributes=[...Object.keys(r).map(ur),...lr];#t;get#e(){return ar.get(this)}get api(){if(!this.#e)return;return this.#t??=Em(this,this.#e.api,n.api??[])}#r=new Set;#n=new Set;#o=!1;#a=!1;#l=new Set;#b=new Set;#w=new Set;#u=!1;#d={};#f={};#y;static{for(let[i,{get:l,set:c}]of Object.entries(o))Object.defineProperty(a.prototype,i,{get(){if(i in this.#f)return this.#f[i];return this.#e?l(this.#e.api):void 0},set(d){if(ni(this),this.#e&&!this.#u)this.#x(()=>c(this.#e.api,d));else this.#f[i]=d}});for(let i of n.properties??[])Object.defineProperty(a.prototype,i,{get(){return this.#d[i]},set(l){if(Object.is(this.#d[i],l))return;if(this.#d[i]=l,!this.#o)return;this.#i(),this.#S()}});Cu(a.prototype,r,n.defaults)}#i(i){this.#e?.setOptions(ri(this,{...s(this,this.#d,this.#l),...i,id:this.#e.id},n.silent,n.actions,n.events))}attributeChangedCallback(i,l,c){if(jt(this,i),lr.includes(i))return;let d=i.replace(/-(\w)/g,(v,x)=>x.toUpperCase());if(d in o&&c!==l&&!this.#a)ni(this);if(!this.#a||c===null)this.#l.delete(d);else if(l===null)this.#l.add(d);if(!this.#o)return;if(this.#i(),bu(this),!(d in o)||c===l)return;let h=r[d],u=h==="boolean"?!1:h==="list"?[]:null;this.#x(()=>o[d].set(this.#e.api,c===null?u:Au(h,c)))}#x(i){let l=Ge.has(this);Ge.add(this);try{kr(this,i)}finally{if(!l)Ge.delete(this),Lt(this)}}connectedCallback(){if(ii(this),this.#o){for(let h of this.#r)Mr(h.el);if(n.options)this.#i();return}Mu(this,[...Object.keys(o),...n.properties??[],...Object.keys(r)]);for(let[h,u]of Object.entries(n.host??{}))if(!this.hasAttribute(h))this.setAttribute(h,u);let i=this.#u&&!Object.keys(this.#f).length?this.#y:void 0,l={};if(this.#u&&i===void 0)for(let[h,{get:u}]of Object.entries(o))l[h]=u(this.#e.api);Object.assign(l,this.#f),this.#f={};let c=Object.fromEntries(Object.entries(l).map(([h,u])=>[Zo(h),u]));if(this.#u)ar.delete(this),this.#t=void 0,this.#u=!1,this.#y=void 0;let d=this.#e;if(d)this.#i();else d=t(ri(this,{...s(this,this.#d,this.#l),...c,id:this.id||`ui-sdk-${e.replace(/^ui-/,"")}-${++xu}`},n.silent,n.actions,n.events)),ar.set(this,d);if(n.formAssociated&&Object.keys(l).length){let h=d.startState(s(this,this.#d,this.#l));this.#i(Object.fromEntries(Object.keys(l).map((u)=>[Zo(u),h[u]])))}if(this.#o=!0,n.options)si.add(this);if(n.self){let h=ut(this,n.target);if(h)this.#k(h);else me(`<${e}> needs an element inside it.`)}for(let[h,u]of Object.entries(n.children??{})){let v=u(this);if(v)this.#A(h,v);else if(!n.optionalChildren?.includes(h))me(`<${e}> needs its native element inside it for "${h}".`)}if(n.children||n.target)this.#g=new MutationObserver(()=>{this.#T(),this.#O()}),this.#g.observe(this,{childList:!0});if(this.#S(),this.id){let h=this.getRootNode();for(let u of h.querySelectorAll(`[for="${CSS.escape(this.id)}"]`))Ru.get(u)?.()}if(i!==void 0)Ou(this,i,"restore")}#m;#S(){this.#m?.(),this.#m=n.render?.(this,this.#e)||void 0}reconfigure(){if(this.#o)this.#i()}#h=new Map;#g;#c;#k(i){this.#c={slot:n.self,el:i,props:{}},this.register(this.#c)}#O(){if(!n.self||!n.target)return;let i=ut(this,n.target);if(i===this.#c?.el)return;if(this.#c)this.unregister(this.#c);if(this.#c=void 0,this.#i(),i)this.#k(i)}#A(i,l){let c={slot:i,el:l,props:n.childProps?.read?.(l)??{}};if(n.childProps)c.observer=new MutationObserver(()=>{c.props=n.childProps.read?.(l)??{},this.#i(),this.update(c,!1)}),c.observer.observe(l,{attributeFilter:n.childProps.attributes});this.#h.set(i,c),this.register(c)}#T(){for(let[i,l]of Object.entries(n.children??{})){let c=l(this),d=this.#h.get(i);if(d?.el===c)continue;if(d)this.unregister(d),this.#h.delete(i);if(c)this.#A(i,c)}}disconnectedCallback(){Nu(this,()=>{this.#y=Wu.get(this)?.(),this.#m?.(),this.#m=void 0,this.#g?.disconnect(),this.#g=void 0,this.#h.clear(),this.#c=void 0,this.#o=!1,si.delete(this);for(let i of this.#r)this.unregister(i);this.#e?.destroy(),this.#u=!0})}register(i){if(this.#r.add(i),en.add(i),i.sync=()=>this.#n.has(i)||this.#s(i),!this.#n.size)queueMicrotask(()=>this.#D());this.#n.add(i)}#D(){let i=et([...this.#n]);this.#n.clear();for(let l of i){if(!this.#r.has(l))continue;if(l.reread)l.props=l.reread();if(l.feature)this.#e.use(l.feature);this.#E(l),this.#s(l)}}#E(i){let l=this.#e;i.unwatch?.();let c=l.part(i.slot,i.props);i.record=c,i.selected=Dn(c),i.version=Jt(l),i.unwatch=yt(c,(d)=>{if(Tn(c)!==i.shown)return i.version=Jt(l),this.#s(i);if(d)return;let h=Jt(l);if(h===i.version)return;i.version=h,this.#s(i)})}unregister(i){i.unwatch?.(),i.unwatch=void 0,i.observer?.disconnect(),i.observer=void 0,this.#p(i),ao(i.el,this.#P),i.disconnect?.(),i.disconnect=void 0,this.#v(i),this.#r.delete(i),en.delete(i),this.#n.delete(i),Tm(i)}rebind(){let i=et([...this.#r].filter((l)=>!this.#n.has(l)));for(let l of i)this.#p(l);for(let l of i)this.#s(l)}update(i,l){if(this.#n.has(i))return;this.#C(i,l),this.#s(i);for(let c of this.#r){if(c===i||this.#n.has(c))continue;if(c.reread){let d=c.props;c.props=c.reread(),this.#C(c,ku(d,c.props))}this.#s(c)}bu(i.el)}#C(i,l){if(l)this.#p(i);let c=this.#e.part(i.slot,i.props);if(c!==i.record||Dn(c)!==i.selected)this.#E(i)}#s(i){if(this.#b.has(i))return void this.#w.add(i);ii(i.el);let c=this.#e.part(i.slot,i.props);if(i.disconnect??=oo(c,i.el),i.shown=Tn(c),i.shown){let d=this.#I(i);if(d!==void 0&&this.#F(i,d))this.#p(i),this.#R(i,d);let h=Be(c);if(h.hidden===void 0&&(no(c)||("hidden"in h)))i.el.removeAttribute("hidden");if(this.#M(i,h),!i.unbind)this.#L(i,c)}else{if(i.unbind)this.#M(i,Be(c)),this.#p(i);if(!i.el.hasAttribute("hidden"))i.el.setAttribute("hidden","");let d=Be(c)["data-slot"];if(d&&!i.el.hasAttribute("data-slot"))i.el.setAttribute("data-slot",d);this.#v(i)}}#L(i,l){let c,d=!1;if(i.unbind=()=>{d=!0,c?.()},c=ro(l,i.el),d)c()}#p(i){let l=i.unbind;i.unbind=void 0,l?.()}#I(i){if(!n.portal?.slots.includes(i.slot))return;return Pr(n.portal.container(this,i))}#F(i,l){return l?i.el.parentNode!==l:!!i.placeholder}#R(i,l){if(this.#v(i),!l)return;i.placeholder=document.createComment(`${e} ${i.slot}`),i.el.replaceWith(i.placeholder),l.appendChild(i.el),ai.set(i.el,l)}#M(i,l){let c=Om(i,this);if(c?.dataSlot)l={...l,"data-slot":c.dataSlot};i.dataSlot=l["data-slot"];let d=this.#a;this.#a=i.el===this,this.#b.add(i);try{Wt(i.el,l,this.#P)}finally{this.#a=d,this.#b.delete(i)}if(this.#w.delete(i))this.#s(i)}get#P(){return`render:${ti(this)}`}#v(i){if(!i.placeholder)return;i.placeholder.replaceWith(i.el),i.placeholder=void 0,ai.delete(i.el)}})}function Fm(e,t){if(!Su(e))return;let n=t.props??{};Iu(e,t.display,"align"in n),customElements.define(e,class r extends(t.formAssociated?ju(HTMLElement):HTMLElement){static observedAttributes=[...Object.keys(n).map(ur),"for",...lr];#t;#e;#r={};constructor(){super();Ru.set(this,()=>{if(this.isConnected)this.connectedCallback()})}static{for(let o of t.properties??[])Object.defineProperty(r.prototype,o,{get(){return this.#r[o]??(n[o]&&ui(this,o,n[o]))},set(s){this.#r[o]=s,this.attributeChangedCallback("")}});Cu(r.prototype,n,t.defaults)}#n(){let o={...t.context?.(this),...Eu(this,n)};for(let s of t.properties??[])if(this.#r[s]!==void 0)o[s]=this.#r[s];for(let[s,{slot:a,prop:i}]of Object.entries(t.from??{}))o[s]??=Dm(this,a,this.#t)?.[i];for(let s of t.ids??[])o[s]??=ti(this);if(o.value===void 0&&o.id===void 0)o.id=ti(this);if(t.keyed&&$u(o))o.id??=km(this.#t)?.api.internal.keyOf(o.value);return ri(this,o,[],t.actions)}#o;connectedCallback(){if(Mu(this,[...t.properties??[],...Object.keys(n)]),ii(this),(t.target||this.hasAttribute("as-child"))&&!this.#o)this.#o=new MutationObserver(()=>this.#l()),this.#o.observe(this,{childList:!0});let o=sr(this,t.owner)??this.#t;if(!o)return queueMicrotask(()=>this.#a());if(!("register"in o)){customElements.whenDefined(o.localName).then(()=>this.isConnected&&this.connectedCallback());return}if(o===this.#t&&this.#e&&en.has(this.#e))return;if(this.#t&&this.#e)this.#t.unregister(this.#e);let s=ut(this,t.target);if(!s)return queueMicrotask(()=>{if(this.isConnected&&!this.#e&&!ut(this,t.target))me(`<${e}> needs an element inside it.`)});if(!this.#e){if(t.render?.(this),this.#e)return}this.#t=o,this.#e={slot:t.slot,feature:t.feature,el:s,props:this.#n(),reread:(t.context||t.from)&&(()=>this.#n()),keyed:t.keyed},Pt.set(this,o),Zt.set(this,this.#e),o.register(this.#e)}#a(){if(!this.isConnected||this.#t)return;if(sr(this,t.owner))this.connectedCallback();else if(t.alone)t.alone(ut(this,t.target)??this,this);else if(!this.hasAttribute("for"))me(`<${e}> must be inside ${t.owner}.`)}#l(){let o=this.#e?.el;if(!this.isConnected||o&&ai.has(o))return;let s=ut(this,t.target);if(s===(o??null))return;if(this.#t&&this.#e)this.#t.unregister(this.#e);if(this.#t=void 0,this.#e=void 0,s)this.connectedCallback()}disconnectedCallback(){Nu(this,()=>{if(this.#o?.disconnect(),this.#o=void 0,this.#t&&this.#e)this.#t.unregister(this.#e);Pt.delete(this),Zt.delete(this),this.#t=void 0,this.#e=void 0})}attributeChangedCallback(o){if(jt(this,o),lr.includes(o))return;if(o==="for"){if(!this.isConnected)return;if(!sr(this,t.owner)&&this.#t&&this.#e)this.#t.unregister(this.#e),this.#t=void 0,Pt.delete(this);this.connectedCallback();return}if(!this.#t||!this.#e){if(t.alone&&this.isConnected&&!sr(this,t.owner))t.alone(ut(this,t.target)??this,this);return}let s=this.#e.props;this.#e.props=this.#n();let a=this.#e.props,i=ku(s,a)||!!t.rebind?.some((l)=>s[l]!==a[l]);this.#t.update(this.#e,i),t.changed?.(this)}})}var ei=new WeakMap;function yu(e,t,n={}){let r={},o=[],s=[],a=[],i=!1,l={};for(let[c,d]of Object.entries({...e,...n})){if(!d)continue;if(typeof d==="object"){let[u,v=c]=d.from.split(".");if(u in t.slots)l[c]={slot:u,prop:v};if(!(c in n))continue}let h=typeof d==="object"?d.kind:d;if(h==="value")o.push(c);else if(h==="action")a.push(c);else if(h==="id")s.push(c);else if(h==="key")i=!0;if(h==="value"||h==="action"||h==="callback")continue;if(c!=="id"||c in n)r[c]=h==="id"||h==="key"?"string":h}return{attributes:r,properties:o,ids:s,actions:a,keyed:i,from:Object.keys(l).length?l:void 0}}var vu=(e)=>typeof e==="string"?{tag:e}:e;function wu(e,t,n,r){let o=Uo(e);if(t==="root"){let{tag:k,self:A,kinds:W,properties:M=[],...I}=vu(n);ei.set(e,[...new Set([...ei.get(e)??[],k])]);let{debug:N,...q}=o.options,Q=yu(q,o,W),L={...I,self:A??("root"in o.slots&&!I.children?.root?"root":void 0),attributes:Q.attributes,properties:[...new Set([...Q.properties,...M])].filter((R)=>!I.state?.[R]),actions:Q.actions};return{kind:"owner",key:t,tagName:k,config:L}}let{tag:s,slot:a=t,owners:i=[],kinds:l,properties:c=[],...d}=vu(n),h=ei.get(e);if(!h)throw Error(`<${s}> is a part of ${e.name}: define its root first.`);let u=o.slots[a]??(d.feature?.slots[a]&&(d.feature.slots[a].props??{}));if(!u)throw Error(`<${s}>: ${e.name} has no ${a} slot.`);let{attributes:v,...x}=yu(u,o,l),w={...d,slot:a,owner:[...new Set([...r?[r]:[],...h,...i])].join(", "),props:v,...x,properties:[...new Set([...x.properties,...c])]};return{kind:"part",key:t,tagName:s,config:w}}function Rm(e,t){let{root:n,...r}=t,o=wu(e,"root",n);return[o,...Object.entries(r).flatMap(([s,a])=>a?[wu(e,s,a,o.tagName)]:[])]}function $m(e,t){if(t.kind==="owner")Im(t.tagName,e,t.config);else Fm(t.tagName,t.config)}var Nm=(e)=>e.replace(/(^|-)(\w)/g,(t,n,r)=>r.toUpperCase());function di(e,t){let n={};for(let r of Rm(e,t))$m(e,r),n[Nm(r.key)]=typeof customElements>"u"?void 0:customElements.get(r.tagName);return n}var Qe=new WeakMap,Wm={kind:"string",municipalityCodes:"list",limit:"number",debounceMs:"number",includeProvisional:"boolean",houseNumberPrefix:"boolean",fetchDetails:"boolean",defaultAddressId:"string",idName:"string",defaultValue:null,defaultOpen:null,filter:null,items:null,emptyItems:null,inlineComplete:null,openOnFocus:null,submitOnSelect:null,controller:null},jm=["kind","municipality-codes","limit","debounce-ms","include-provisional","house-number-prefix","fetch-details"];function Vm(e){return e.open&&e.status!=="idle"}function pi(e){return{client:e.client,kind:e.kind==="accessAddress"?"accessAddress":"address",municipalityCodes:e.municipalityCodes?.length?e.municipalityCodes:void 0,limit:e.limit??void 0,debounceMs:e.debounceMs??void 0,includeProvisional:e.includeProvisional,houseNumberPrefix:e.houseNumberPrefix,fetchDetails:e.fetchDetails}}function qm(e,t){let n=new Map;for(let o of e.children)if(o.localName==="dk-address-item")n.set(o.getAttribute("value")??"",o);let r=t.map((o)=>{let s=Dt(o),a=n.get(s);if(n.delete(s),!a)a=document.createElement("dk-address-item"),a.setAttribute("value",s),a.setAttribute("label",o.label),a.dataset.type=o.type,a.textContent=o.label;return a});for(let o of n.values())o.remove();r.forEach((o,s)=>{if(e.children[s]!==o)e.insertBefore(o,e.children[s]??null)})}var fi=new WeakMap;function Hm(e,t){let n=fi.get(e);if(t&&n)e.append(n),fi.delete(e);else if(!t&&!n){let r=document.createDocumentFragment();r.append(...e.childNodes),fi.set(e,r)}}var Vu=new WeakSet,Km=0;function Bm(e,t){for(let n of e.querySelectorAll("dk-address-popup")){if(n.hasAttribute("anchor")&&!Vu.has(n))continue;if(!t.id)t.id=`dk-address-control-${++Km}`;let r=`#${CSS.escape(t.id)}`;if(n.getAttribute("anchor")!==r)n.setAttribute("anchor",r);Vu.add(n)}}function _m(e,t){let n=e.querySelector(":scope > input[type=hidden][data-dk-address-id]");if(!e.idName){n?.remove();return}if(!n)n=document.createElement("input"),n.type="hidden",n.dataset.dkAddressId="",e.append(n);n.name=e.idName;let r=e.getAttribute("form");if(r)n.setAttribute("form",r);else n.removeAttribute("form");n.value=t?.suggestion.id??""}function qu(e,t){let{state:n}=t,r=Vm(n),o=e;if(o.value!==n.value)o.value=n.value;let s=n.status==="success"?"idle":n.status;if(o.status!==s)o.status=s;let a=r?"true":"false";if(e.getAttribute("open")!==a)e.setAttribute("open",a);for(let c of e.querySelectorAll("dk-address-list"))qm(c,n.suggestions);let i=n.status==="success"&&n.suggestions.length===0;for(let c of e.querySelectorAll("dk-address-empty"))Hm(c,i);let l=e.querySelector("dk-address-control");if(l?.toggleAttribute("data-open",r),l?.toggleAttribute("data-loading",n.status==="loading"),l)Bm(e,l);_m(e,n.selection),zm(e,t)}function zm(e,t){let{caret:n,value:r}=t.state;if(!n||n.revision===t.caretRevision)return;t.caretRevision=n.revision;let o=e.querySelector("dk-address-input input"),s=()=>{if(!o||o.ownerDocument.activeElement!==o||o.value!==r)return;o.setSelectionRange(n.position,n.position)};s(),requestAnimationFrame(s)}function Ym(e){let t=vr({...pi(e),onSelect:(l)=>{e.dispatchEvent(new CustomEvent("addressselect",{detail:l,bubbles:!0}))}}),n=new AbortController,{signal:r}=n,o={store:t,state:t.getState(),byKey:new Map,highlighted:null,pickHandled:!1,caretRevision:null,stop:()=>{}},s=(l)=>{let c=l?o.byKey.get(l):void 0;if(c)t.select(c)},a=t.subscribe(()=>{let l=t.getState();if(l.suggestions!==o.state.suggestions)o.byKey=new Map(l.suggestions.map((c)=>[Dt(c),c]));o.state=l,qu(e,o),e.dispatchEvent(new CustomEvent("statechange",{detail:l}))});e.addEventListener("valuechange",(l)=>{let{detail:c}=l;switch(c.reason){case"imperative":return;case"item-press":l.preventDefault(),o.pickHandled=!0,s(c.item?.value);return;case"clear-press":t.clear();return;case"escape-key":l.preventDefault();return;default:t.setInput(c.value)}},{signal:r}),e.addEventListener("openchange",(l)=>{let{detail:c}=l;if(c.reason==="imperative")return;if(c.reason==="item-press"){let d=o.highlighted;queueMicrotask(()=>{if(!o.pickHandled)s(d);o.pickHandled=!1}),l.preventDefault();return}t.setOpen(c.value)},{signal:r}),e.addEventListener("highlight",(l)=>{let{value:c}=l.detail;o.highlighted=typeof c==="string"?c:null},{signal:r}),e.ownerDocument.addEventListener("reset",(l)=>{let c=e.querySelector("dk-address-input input")?.form;if(!c||l.target!==c)return;setTimeout(()=>{if(t.clear(),e.defaultAddressId)t.selectById(e.defaultAddressId)})},{signal:r});let i=new MutationObserver(()=>t.setOptions(pi(e)));if(i.observe(e,{attributeFilter:jm}),o.stop=()=>{a(),n.abort(),i.disconnect(),t.destroy()},qu(e,o),e.defaultAddressId)t.selectById(e.defaultAddressId);return o}var Um=di(du,{root:{tag:"dk-address",display:"block",kinds:Wm,defaults:{houseNumberPrefix:!0,fetchDetails:!0},properties:["client"],options:()=>({filter:!1}),render:(e)=>{let t=e,n=Qe.get(t);if(n)n.store.setOptions(pi(t));else Qe.set(t,Ym(t));return()=>{queueMicrotask(()=>{if(t.isConnected)return;Qe.get(t)?.stop(),Qe.delete(t)})}}},label:"dk-address-label",input:{tag:"dk-address-input",target:ci("input"),display:"contents"},clear:{tag:"dk-address-clear",target:li,display:"contents"},content:{tag:"dk-address-popup",display:"block"},status:{tag:"dk-address-status",display:"block"},empty:{tag:"dk-address-empty",display:"block"},list:{tag:"dk-address-list",display:"block"},item:{tag:"dk-address-item",display:"block"}});if(typeof customElements<"u"&&!customElements.get("dk-address-control")){customElements.define("dk-address-control",class extends HTMLElement{});let e=document.createElement("style");e.textContent=":where(dk-address-control) { display: block; }",document.head.append(e)}var Hu=Um.Root;if(Hu)Object.defineProperties(Hu.prototype,{state:{get(){return Qe.get(this)?.state??null}},selection:{get(){return Qe.get(this)?.state.selection??null}},selectById:{value(e){let t=Qe.get(this);return t?t.store.selectById(e):Promise.resolve(null)}},clear:{value(){Qe.get(this)?.store.clear()}}});export{tn as createClient,Dt as suggestionKey};
|
|
1
|
+
var Wd=Object.defineProperty;var Vd=(e)=>e;function qd(e,t){this[e]=Vd.bind(null,t)}var Hd=(e,t)=>{for(var n in t)Wd(e,n,{get:t[n],enumerable:!0,configurable:!0,set:qd.bind(t,n)})};var be=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};function at(){return Ee&&(/iP(hone|ad|od)/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function ws(){return Ee&&/Android/i.test(navigator.userAgent)}function Mn(e){return!!e&&Ee&&getComputedStyle(e).direction==="rtl"}var Ee;var Ve=be(()=>{Ee=typeof window<"u"&&typeof document<"u"});function Ne(e,t,n){let r=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);e.style.setProperty(t,n);let i=e.style.getPropertyValue(t);return()=>{if(e.style.getPropertyValue(t)!==i)return;if(r)e.style.setProperty(t,r,o);else e.style.removeProperty(t)}}function po(e){if(typeof CSS>"u"||!CSS.registerProperty)return;for(let t of e){if(ia.has(t))continue;ia.add(t);try{CSS.registerProperty({name:t,syntax:"*",inherits:!1})}catch{}}}function aa(e){if(uo.has(e))return uo.get(e);let t;for(let r=e;r&&!t;r=r.defaultView?.frameElement?.ownerDocument)t=r.head?.querySelector('meta[property="csp-nonce"]');let n=t?t.nonce||t.getAttribute("nonce")||"":null;return uo.set(e,n),n}function Te(e,t,n){if(!e.head)return;let r=e.defaultView;if(aa(e)===""&&r&&"adoptedStyleSheets"in e)Df(e,r,t,n);else Tf(e,t,n)}function Tf(e,t,n){let r=e.getElementById(t);if(r){if(fo.get(r)===n)return;if(r.textContent!==n)r.textContent=n;fo.set(r,n);return}let o=e.createElement("style");o.id=t;let i=aa(e);if(i)o.nonce=i;o.textContent=n,fo.set(o,n);let s=e.head.querySelectorAll(':scope > style[id^="ui-sdk-"]');if(s.length)s[s.length-1].after(o);else e.head.prepend(o)}function Df(e,t,n,r){let o=sa().get(e);if(!o)sa().set(e,o=new Map);let i=o.get(n);if(!i)o.set(n,i={sheet:new t.CSSStyleSheet,css:""});if(i.css!==r)i.sheet.replaceSync(r),i.css=r;if(!e.adoptedStyleSheets.includes(i.sheet))e.adoptedStyleSheets=[...e.adoptedStyleSheets,i.sheet]}function mo(e){Te(e,"ui-sdk-hidden",'@layer ui-sdk { :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important } }')}function Gt(e){if(typeof window>"u")return;if(!performance.getEntriesByType("paint").length)e();else if(Xt)Xt.push(e);else Xt=[e],(window.requestIdleCallback??setTimeout)(()=>{let t=Xt;Xt=void 0,t.forEach((n)=>n())})}function la(e){let t,n=requestAnimationFrame(()=>{t=setTimeout(e)});return()=>{cancelAnimationFrame(n),clearTimeout(t)}}var ia,sa=()=>globalThis[Symbol.for("ui-sdk.styles@1")]??=new WeakMap,uo,fo,Xt,At;var De=be(()=>{ia=new Set;uo=new WeakMap;fo=new WeakMap;At=new WeakSet});function qf(e,t){let n=ka.get(e);if(!n)ka.set(e,n={});let r=n[t];if(r?.isConnected)return r;let o=e.createElement("div");return o.setAttribute("role",t==="assertive"?"alert":"status"),o.setAttribute("aria-live",t),o.setAttribute("aria-atomic","true"),o.setAttribute("data-ui-sdk-announcer",t==="assertive"?"assertive":""),o.style.cssText="position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap",e.body.append(o),n[t]=o,o}function Ca(e,{priority:t="polite",doc:n=typeof document>"u"?void 0:document}={}){if(!e)return;if(Aa)return Aa(e,t);if(!n?.body)return;let r=qf(n,t);r.textContent="",clearTimeout(Ea[t]),Ea[t]=setTimeout(()=>{r.textContent=e},100)}var ka,Aa,Ea;var Ma=be(()=>{ka=new WeakMap,Ea={}});function se(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ct(e){let t="nativeEvent"in e?e.nativeEvent:e;return t.isComposing===!0||t.keyCode===229}var Pe=()=>{};function cr(e){if(!e.towardMore)return e.scrollAtStart?"sheet":"scroll";return!e.atLargest&&e.expandOnScroll?"sheet":"scroll"}var Ko=()=>{};function Jp(e,t){return e*t/(1-t)}function Bo(e){let{extent:t,velocity:n,candidates:r}=e;if(Math.abs(n)<e.minFlingVelocity)return Ye(r,t);let o=t+Jp(n,e.rate),i=Zp(r,t,Math.sign(n)),s=Ye(r,o);if((n>0?r[s]<=t+0.5:r[s]>=t-0.5)&&i!==-1)s=i;if(!e.skipSnapPoints&&i!==-1)s=n>0?Math.min(s,i):Math.max(s,i);return s}function Ye(e,t){let n=0;for(let r=1;r<e.length;r++)if(Math.abs(e[r]-t)<Math.abs(e[n]-t))n=r;return n}function Zp(e,t,n){if(n>0)return e.findIndex((r)=>r>t+0.5);for(let r=e.length-1;r>=0;r--)if(e[r]<t-0.5)return r;return-1}var ur=()=>{};function _o(e,t,n=zo){if(e<=0)return 0;return(1-1/(e*n/t+1))*t}function dr(e,t,n=zo){if(e<=0)return 0;return(1/(1-Math.min(e/t,0.999999))-1)*t/n}function nc(e,t,n=zo){if(e<=0)return 1;let r=e*n/t+1;return n/(r*r)}var zo=0.55;var rc=()=>{};function It(e,t,n,r){let o=2*Math.PI/(e*1000),i=t;if(Math.abs(i-1)<0.000001)return tm(o,n,r);if(i<1)return em(o,i,n,r);return nm(o,i,n,r)}function em(e,t,n,r){let o=t*e,i=e*Math.sqrt(1-t*t),s=(r+o*n)/i;return{position:(a)=>Math.exp(-o*a)*(n*Math.cos(i*a)+s*Math.sin(i*a)),velocity:(a)=>{let l=Math.cos(i*a),c=Math.sin(i*a);return Math.exp(-o*a)*((s*i-o*n)*l-(n*i+o*s)*c)}}}function tm(e,t,n){let r=n+e*t;return{position:(o)=>Math.exp(-e*o)*(t+r*o),velocity:(o)=>Math.exp(-e*o)*(r-e*(t+r*o))}}function nm(e,t,n,r){let o=Math.sqrt(t*t-1),i=-e*(t+o),s=-e*(t-o),a=(r-i*n)/(s-i),l=n-a;return{position:(c)=>a*Math.exp(s*c)+l*Math.exp(i*c),velocity:(c)=>a*s*Math.exp(s*c)+l*i*Math.exp(i*c)}}function fr(e,{positionTolerance:t=0.5,velocityTolerance:n=0.02,step:r=1,limit:o=1e4}={}){for(let i=0;i<=o;i+=r)if(Math.abs(e.position(i))<=t&&Math.abs(e.velocity(i))<=n)return i;return o}function pr(e,t,n,r,o=8.333333333333334){let i=n-t;if(Math.abs(i)<0.000001)return"linear";let s=[];for(let a=0;a<r;a+=o)s.push(rm(1+e.position(a)/i));return s.push("1"),`linear(${s.join(", ")})`}function rm(e){return String(Math.round(e*1e4)/1e4)}var mr=()=>{};function Ce(e,t){return{phase:"idle",extent:e,restingIndex:t}}function hr(e,t,n){switch(t.type){case"down":return im(e,t,n);case"move":return sm(e,t,n);case"up":return cm(e,t,n);case"settled":return um(e);case"rest":return dm(e,t,n);case"snap-to":return fm(e,t,n);case"nudge":return pm(e,t,n);case"close":return ht(e,n,{targetIndex:-1,motion:Uo(e,t.time),time:t.time,reason:"imperative",outcome:{type:"dismiss",reason:"imperative"}})}}function Uo(e,t){if(e.phase!=="settling")return{extent:e.extent,velocity:0};let n=It(e.response,e.dampingRatio,e.from-e.to,e.velocity),r=Math.max(0,t-e.startTime);return{extent:e.to+n.position(r),velocity:n.velocity(r)}}function im(e,t,n){let r=t.pointer==="mouse"?n.physics.mouseSlop:n.physics.touchSlop;if(e.phase==="idle"&&e.restingIndex>=0)return{state:{...e,phase:"pending",originX:t.x,originY:t.y,slop:r},effects:Ie};if(e.phase!=="settling")return{state:e,effects:Ie};let{extent:o}=Uo(e,t.time);return{state:{phase:"dragging",extent:o,restingIndex:e.restingIndex,anchorY:t.y,anchorExtent:mm(o,n),lastY:t.y,isScrollingContent:!1},effects:[{type:"move",extent:o}]}}function sm(e,t,n){if(e.phase==="pending")return am(e,t,n);if(e.phase==="scrolling"&&n.contentScroll)return n.contentScroll.move(e,t);if(e.phase==="dragging")return lm(e,t,n);return{state:e,effects:Ie}}function am(e,t,n){let r=t.x-e.originX,o=t.y-e.originY;if(Math.max(Math.abs(r),Math.abs(o))<e.slop)return{state:e,effects:Ie};if(Math.abs(r)>Math.abs(o))return{state:Ce(e.extent,e.restingIndex),effects:Ie};let i=n.contentScroll?.claim(e,t,o<0,n);if(i)return{state:i,effects:Ie};let s={...Yo(e,e.originY+Math.sign(o)*e.slop),lastY:t.y},a=oc(s.anchorExtent+(s.anchorY-t.y),n);return{state:{...s,extent:a},effects:[{type:"move",extent:a}]}}function Yo(e,t){return{phase:"dragging",extent:e.extent,restingIndex:e.restingIndex,anchorY:t,anchorExtent:e.extent,lastY:t,isScrollingContent:!1}}function lm(e,t,n){let r=e.lastY-t.y,o=e.isScrollingContent?{anchorY:e.lastY,anchorExtent:e.extent}:e,i=o.anchorExtent+(o.anchorY-t.y),s=n.contentScroll?.drag(e,t,r,i,n);if(s)return s;let a=oc(i,n);return{state:{...e,anchorY:o.anchorY,anchorExtent:o.anchorExtent,extent:a,lastY:t.y,isScrollingContent:!1},effects:[{type:"move",extent:a}]}}function cm(e,t,n){if(e.phase==="pending"||e.phase==="scrolling")return{state:Ce(e.extent,e.restingIndex),effects:Ie};if(e.phase!=="dragging")return{state:e,effects:Ie};let r=n.contentScroll?.release(e,t,n);if(r)return r;let o=-t.velocity*hm(e.extent,n),i=[0,...ic(n)],s=n.physics,a={candidates:i,rate:s.projectionRate,minFlingVelocity:s.minFlingVelocity,skipSnapPoints:s.skipSnapPoints},l=Bo({...a,extent:e.extent,velocity:o}),c={motion:{extent:e.extent,velocity:o},time:t.time,reason:"swipe"};if(n.dismissible){if(l>0)return ht(e,n,{...c,targetIndex:l-1});return ht(e,n,{...c,targetIndex:-1,outcome:{type:"dismiss",reason:"swipe"}})}let f=e.anchorExtent+(e.anchorY-e.lastY),p=Bo({...a,extent:f,velocity:-t.velocity})===0,u=Math.max(0,l-1);if(!p)return ht(e,n,{...c,targetIndex:u});return ht(e,n,{...c,targetIndex:0,outcome:{type:"attempt-dismiss",reason:"swipe"}})}function um(e){if(e.phase!=="settling")return{state:e,effects:Ie};return{state:Ce(e.to,e.targetIndex),effects:Ie}}function dm(e,t,n){if(t.extent<1&&n.dismissible)return{state:Ce(0,-1),effects:[{type:"dismiss",reason:"swipe"}]};let r=Ye(ic(n),t.extent),o=r===e.restingIndex?[]:[{type:"snap",id:n.snapPoints[r].id,reason:"swipe"}];return{state:Ce(t.extent,r),effects:o}}function fm(e,t,n){let r=n.snapPoints.findIndex((o)=>o.id===t.id);if(r===-1||e.phase==="dragging")return{state:e,effects:Ie};return ht(e,n,{targetIndex:r,motion:Uo(e,t.time),time:t.time,reason:t.reason})}function pm(e,t,n){if(e.phase!=="idle"||e.restingIndex<0)return{state:e,effects:Ie};return ht(e,n,{targetIndex:e.restingIndex,motion:{extent:e.extent,velocity:-om},time:t.time,reason:"imperative"})}function ht(e,t,n){let{targetIndex:r,motion:o,time:i,reason:s}=n,a=t.physics,l=r<0?0:t.snapPoints[r].extent,f=Math.abs(o.velocity)>=a.minFlingVelocity?a.momentumDampingRatio:a.dampingRatio,p={phase:"settling",extent:o.extent,restingIndex:e.restingIndex,targetIndex:r,from:o.extent,to:l,velocity:o.velocity,response:a.response,dampingRatio:f,startTime:i},u=[{type:"settle",from:o.extent,to:l,velocity:o.velocity,response:a.response,dampingRatio:f}];if(r>=0&&r!==e.restingIndex)u.push({type:"snap",id:t.snapPoints[r].id,reason:s});if(n.outcome)u.push(n.outcome);return{state:p,effects:u}}function oc(e,t){let n=Lt(t),{coefficient:r,dimension:o}=Xo(t);if(e>n)return n+_o(e-n,o,r);if(t.dismissible)return Math.max(0,e);let i=t.snapPoints[0].extent;if(e<i)return i-_o(i-e,o,r);return e}function mm(e,t){let n=Lt(t),{coefficient:r,dimension:o}=Xo(t);if(e>n)return n+dr(e-n,o,r);let i=t.snapPoints[0].extent;if(!t.dismissible&&e<i)return i-dr(i-e,o,r);return e}function Xo(e){return{coefficient:e.physics.rubberBand,dimension:e.physics.rubberBandDimension??e.dimension}}function hm(e,t){let{coefficient:n,dimension:r}=Xo(t),o=Lt(t),i=t.snapPoints[0].extent,s=e>o?e-o:!t.dismissible&&e<i?i-e:0;if(s<=0)return 1;return nc(dr(s,r,n),r,n)}function Lt(e){return e.snapPoints[e.snapPoints.length-1].extent}function ic(e){return e.snapPoints.map((t)=>t.extent)}var Ie,om=1;var gr=be(()=>{ur();rc();mr();Ie=[]});var sc,ac;var lc=be(()=>{Ko();gr();sc=[],ac={claim(e,t,n,r){if(!t.scroll)return;if(cr({towardMore:n,scrollAtStart:t.scroll.atStart,atLargest:e.extent>=Lt(r)-0.5,expandOnScroll:r.expandOnScroll})!=="scroll")return;return{phase:"scrolling",extent:e.extent,restingIndex:e.restingIndex,lastY:t.y}},move(e,t){if(t.y>e.lastY&&t.scroll?.atStart)return{state:Yo(e,t.y),effects:sc};return{state:{...e,lastY:t.y},effects:sc}},drag(e,t,n,r,o){let i=t.scroll;if(!i)return;if(e.isScrollingContent&&(n>0?!i.atEnd:!i.atStart)){let c=[{type:"scroll",delta:n}];return{state:{...e,lastY:t.y},effects:c}}let s=Lt(o);if(!(n>0&&r>s&&e.extent<=s&&!i.atEnd))return;let a=[{type:"scroll",delta:r-s}];if(e.extent!==s)a.unshift({type:"move",extent:s});return{state:{...e,extent:s,anchorY:t.y,anchorExtent:s,lastY:t.y,isScrollingContent:!0},effects:a}},release(e,t,n){if(!e.isScrollingContent)return;let r=n.snapPoints.length-1,o=[{type:"fling-scroll",velocity:-t.velocity}];if(e.restingIndex!==r)o.push({type:"snap",id:n.snapPoints[r].id,reason:"swipe"});return{state:Ce(e.extent,r),effects:o}}}});var yr;var cc=be(()=>{yr={ios:{response:0.34,dampingRatio:1,momentumDampingRatio:0.88,projectionRate:0.99,minFlingVelocity:0.5,skipSnapPoints:!0,rubberBand:1.9,rubberBandDimension:24,touchSlop:8,mouseSlop:4,dim:0.2,velocityHorizon:70}}});function gm(e){return String(e)}function ym(e,t){if(typeof e==="number")return e<=1?e*t.container:e;if(e==="content")return t.content;let n=parseFloat(e);if(e.endsWith("rem"))return n*t.rootFontSize;if(e.endsWith("%"))return n/100*t.container;if(e.endsWith("px"))return n;return NaN}function uc(e,t){let n=e.map((o,i)=>({value:o,index:i,extent:Math.min(ym(o,t),t.content)})).filter((o)=>o.extent>0).sort((o,i)=>o.extent-i.extent||o.index-i.index),r=[];for(let o of n){let i=gm(o.value),s=r[r.length-1];if(s&&o.extent-s.extent<1){if(s.ids.push(i),o.index>s.index)Object.assign(s,{id:i,value:o.value,index:o.index});s.extent=Math.max(s.extent,o.extent);continue}r.push({id:i,value:o.value,extent:Math.round(o.extent*100)/100,ids:[i],index:o.index})}return r.map(({index:o,...i})=>i)}function gt(e,t){if(t===null||t===void 0)return-1;let n=String(t);return e.findIndex((r)=>r.ids.includes(n))}function dc(e,t,n){let r=gt(e,n),o=gt(e,t);return r>=0&&o>=0&&o<=r}var fc=()=>{};function bm(e,t,n){let r=Math.max(0,t.layoutHeight-t.offsetTop-t.height);if(Math.abs(t.height-t.layoutHeight)<=1)pc.set(e,t.scale);if(n>0)return Math.round(Math.min(n,r));return t.scale>(pc.get(e)??1)+0.01?0:Math.round(r)}function mc(e,t){let n=e.ownerDocument.defaultView,r=n?.visualViewport;if(!n||!r)return()=>{};let o=null,i=(l)=>{let c=bm(n,l,0),f=o!==null&&c!==o;if(o=c,f)t?.before();if(e.style.setProperty("--keyboard-inset",`${c}px`),e.style.setProperty("--visual-viewport-height",`${Math.round(l.height)}px`),c>0)e.setAttribute("data-keyboard","");else e.removeAttribute("data-keyboard");if(f)t?.after()},s=xm.get(n);i(s&&s.layoutHeight-s.offsetTop-s.height<=1?s:hc(n,r));let a=wm(n,r,i);return()=>{a(),e.style.removeProperty("--keyboard-inset"),e.style.removeProperty("--visual-viewport-height"),e.removeAttribute("data-keyboard")}}function hc(e,t){return{width:t.width,layoutHeight:e.innerHeight,height:t.height,offsetTop:t.offsetTop,scale:t.scale}}function vm(e,t){let n=new Set,r=(s)=>{let a=hc(e,t);for(let l of n)l(a,s)};t.addEventListener("resize",r),t.addEventListener("scroll",r);let i={followers:n,stop:()=>{t.removeEventListener("resize",r),t.removeEventListener("scroll",r),Go.delete(t)}};return Go.set(t,i),i}function wm(e,t,n){let{followers:r,stop:o}=Go.get(t)??vm(e,t);return r.add(n),()=>{if(r.delete(n)&&!r.size)o()}}var pc,Go,xm;var gc=be(()=>{pc=new WeakMap;Go=new WeakMap;xm=new WeakMap});function an(e,t=!1){if(e==="start")return t?"right":"left";if(e==="end")return t?"left":"right";return e}var br;var vr=be(()=>{br={top:"bottom",bottom:"top",left:"right",right:"left"}});function Qo(e,t){return an(e,e==="start"||e==="end"?Mn(t):!1)}function yt(e,t,n,r){let o=Ke(e);return r.y=(o?n:t)*yc(e),r.x=o?t:n,r}function ln(e,t){let n=`${Math.round(t*yc(e)*100)/100}px`;return Ke(e)?`0 ${n}`:`${n} 0`}function bc(e,t){return Ke(t)?e.offsetHeight:e.offsetWidth}function vc(e,t,n){let r=Jo(e,t,n);if(!r)return null;let{start:o,end:i}=km(r,n);return{atStart:o,atEnd:i,area:r}}function Jo(e,t,n){let r=t.ownerDocument.defaultView;if(!r||!(e instanceof Element)||!t.contains(e))return null;let o=Ke(n);for(let i=e;i&&i!==t.parentElement;i=i.parentElement){if(!(o?i.scrollHeight>i.clientHeight+1:i.scrollWidth>i.clientWidth+1)||!(i instanceof HTMLElement))continue;let a=o?r.getComputedStyle(i).overflowY:r.getComputedStyle(i).overflowX;if(/auto|scroll/.test(a))return i}return null}function Sm(e,t){if(Ke(t)){let i=e.scrollHeight-e.clientHeight;return{position:t==="bottom"?e.scrollTop:i-e.scrollTop,max:i}}let n=e.scrollWidth-e.clientWidth,r=Math.abs(e.scrollLeft),o=Mn(e)?n-r:r;return{position:t==="right"?o:n-o,max:n}}function km(e,t){let{position:n,max:r}=Sm(e,t);return{start:n<=0.5,end:n>=r-1}}function Zo(e,t,n){if(Ke(t))e.scrollTop+=t==="bottom"?n:-n;else{let r=t==="right"?n:-n;e.scrollLeft+=Mn(e)?-r:r}}var Ke=(e)=>e==="bottom"||e==="top",yc=(e)=>e==="bottom"||e==="right"?1:-1;var ei=be(()=>{Ve();vr()});function xr(e,t){e.requestAnimationFrame(()=>e.requestAnimationFrame(t))}function Sr(e){return e==="bottom"?-Be:-32}function kr(e,t){let n=[];for(let r=0;r<e.duration;r+=16.666666666666668)n.push(t(e.extentAt(r)));return n.push(t(e.extentAt(e.duration))),n}function bt(e,t){let n=Object.entries(t).map(([r,o])=>Ne(e,r,o));return()=>n.forEach((r)=>r())}var wr=1000,Be=120,wc=200,xc=150;var Ar=be(()=>{De()});function Sc(e,t,n=-1){let r=n<0?0:t[n],o=n<0?t[0]:t[n+1];if(o===void 0||o<=r)return e>r?1:0;return ti((e-r)/(o-r))}function kc(e,t){let n=t[t.length-1],r=t.length>1?t[t.length-2]:0;if(n<=r)return e>=n?1:0;return ti((e-r)/(n-r))}function Ac(e,t){let n=t[t.length-1];return n>0?ti(e/n):0}var ti=(e)=>Math.max(0,Math.min(1,e));var Ec=()=>{};function Tc(e){let t=e.defaultView?.CSS;if(ri.has(e)||!t?.registerProperty)return;ri.add(e);for(let n of ni)try{t.registerProperty({name:n,syntax:"<number>",inherits:!1,initialValue:"0"})}catch{}}function Dc(){if(typeof document<"u"&&!ri.has(document))Gt(()=>Tc(document))}function Ic(e){Tc(e.sheet.ownerDocument);let t=[1],n=-1,r=[],o=new Map,i={dim:0,progress:0,expand:0},s;function a(F){t=F.snapExtents.length?F.snapExtents:[1],n=F.undimmedIndex}function l(F,H=i){return H.dim=Er(Sc(F,t,n)),H.progress=Er(Ac(F,t)),H.expand=Er(kc(F,t)),H}let c=!1;function f(F,{rest:H=!1}={}){if(c)return;T(),l(F),p(i.dim),g(e.sheet,i),m(i.progress);for(let U of e.outlets())if(g(U.el,i),U.keyframes)A(U,i.expand,H);if(H)e.themeColor?.(i.dim)}function p(F){let H=e.backdrop();if(H)H.style.opacity=String(F);let U=u();if(U)U.currentTime=F*1000}function u(){if(!e.dimmed||s)return s;return s=e.dimmed.animate({opacity:[0,1]},{...Mc,duration:1000,fill:"both"}),s.pause(),s.currentTime=0,s}function m(F){let H=e.ancestors();for(let U=0;U<H.length;U++)H[U].style.setProperty("--drawer-stack",String(U+F))}function g(F,{dim:H,progress:U,expand:te}){F.style.setProperty("--drawer-progress",String(U)),F.style.setProperty("--drawer-dim",String(H)),F.style.setProperty("--drawer-expand",String(te))}function A(F,H,U){let te=o.get(F.el);if(!te)te=F.el.animate(Pc(F.keyframes),{duration:1000,fill:"both"}),te.pause(),o.set(F.el,te);if(te.currentTime=H*1000,!U)return;te.commitStyles?.(),te.cancel(),o.delete(F.el)}function d(F){if(c)return;if(T(),B(),!cn())return f(F.type==="settle"?F.extentAt(F.duration):0,{rest:!0});let H=y(F);u();let U=F.type==="settle"?{duration:Math.max(1,F.duration),fill:"both"}:{timeline:F.timeline,fill:"both"},te=(ae,q,x,S)=>{let M=ae.animate(q,{...U,...S,easing:Am(x)});if(F.type==="settle")M.startTime=F.startTime;r.push(M)},Z=e.backdrop();if(Z)te(Z,{opacity:[0,1]},H.dim);if(e.dimmed)te(e.dimmed,{opacity:[0,1]},H.dim,Mc);b(e.sheet,H,te),e.ancestors().forEach((ae,q)=>te(ae,{"--drawer-stack":[q,q+1]},H.progress));for(let ae of e.outlets())if(b(ae.el,H,te),ae.keyframes)te(ae.el,Pc(ae.keyframes),H.expand);if(F.type!=="settle")return;let re=F.extentAt(F.duration);v(re);let ce=r;if(ce[0])ce[0].onfinish=()=>r===ce&&T()}function b(F,H,U){U(F,{"--drawer-progress":[0,1]},H.progress),U(F,{"--drawer-dim":[0,1]},H.dim),U(F,{"--drawer-expand":[0,1]},H.expand)}function v(F){let H=l(F,{dim:0,progress:0,expand:0});p(H.dim),g(e.sheet,H),m(H.progress);for(let U of e.outlets()){if(g(U.el,H),!U.keyframes)continue;for(let[te,Z]of Object.entries(U.keyframes)){let re=Z[H.expand>=0.5?Z.length-1:0];U.el.style.setProperty(Oc(te),String(re))}}e.themeColor?.(H.dim)}function y(F){let H={dim:[],progress:[],expand:[]},U={dim:0,progress:0,expand:0},te=F.type==="settle"?Math.max(2,Math.ceil(F.duration/Cc)+1):61;for(let Z=0;Z<te;Z++){let re=Z/(te-1),ce=F.type==="settle"?F.extentAt(Math.min(F.duration,Z*Cc)):F.extentAt(re);l(ce,U),H.dim.push(U.dim),H.progress.push(U.progress),H.expand.push(U.expand)}return H}function I(F){for(let H of r)H.startTime=F}function T(){if(!r.length)return;for(let F of r)F.cancel();r=[]}function B(){for(let F of o.values())F.cancel();o.clear()}function X(){c=!0,T(),B(),e.backdrop()?.style.removeProperty("opacity"),s?.cancel();for(let F of ni.slice(0,3))e.sheet.style.removeProperty(F);for(let F of e.outlets()){for(let H of ni.slice(0,3))F.el.style.removeProperty(H);for(let H of Object.keys(F.keyframes??{}))F.el.style.removeProperty(Oc(H))}}return{configure:a,compute:l,apply:f,play:d,sync:I,follow:d,stop:T,destroy:X}}function Am(e){return`linear(${e.map(Er).join(", ")})`}function Oc(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var Cc=16.666666666666668,ni,ri,cn=()=>typeof CSS<"u"&&CSS.supports("animation-timing-function","linear(0, 1)"),Er=(e)=>Math.round(e*1e4)/1e4,Mc,Pc=(e)=>e;var un=be(()=>{Ec();De();ni=["--drawer-progress","--drawer-dim","--drawer-expand","--drawer-stack"],ri=new WeakSet;Mc={pseudoElement:"::backdrop"}});function Cm(e,t,n=0,r=e.length){let o=r-n;if(o<2)return 0;let i=e[r-1];if(o<4)return Lc(e,t,n,r);let s=0,a=0,l=0,c=0,f=0,p=0,u=0,m=0;for(let d=n;d<r;d++){let b=e[d]-i,v=t[d],y=b*b;s+=1,a+=b,l+=y,c+=y*b,f+=y*y,p+=v,u+=v*b,m+=v*y}let g=s*(l*f-c*c)-a*(a*f-c*l)+l*(a*c-l*l);if(Math.abs(g)<0.000000001)return Lc(e,t,n,r);return(s*(u*f-c*m)-p*(a*f-c*l)+l*(a*m-u*l))/g}function Lc(e,t,n,r){let o=0,i=0,s=r-n;for(let c=n;c<r;c++)o+=e[c]/s,i+=t[c]/s;let a=0,l=0;for(let c=n;c<r;c++){let f=e[c]-o;a+=f*(t[c]-i),l+=f*f}return l>0?a/l:0}function Fc(e={}){let{horizon:t,staleAfter:n,maxSpeed:r,capacity:o}={...Em,...e},i=new Float64Array(o),s=new Float64Array(o),a=new Float64Array(o),l=new Float64Array(o),c=0,f=-1;function p(g,A){if(c>0&&g<=i[f])return;f=(f+1)%o,i[f]=g,s[f]=A,c=Math.min(c+1,o)}function u(g){if(c<2)return 0;let A=i[f];if(g-A>n)return 0;let d=0;for(let v=c-1;v>=0;v--){let y=(f-v+o)%o;if(A-i[y]>t)continue;a[d]=i[y],l[d]=s[y],d++}let b=Cm(a,l,0,d);return Math.max(-r,Math.min(r,b))}function m(){c=0,f=-1}return{add:p,velocity:u,reset:m}}var Em;var Rc=be(()=>{Em={horizon:70,staleAfter:40,maxSpeed:8,capacity:20}});function $c(e,t=!1,n){let r=e.defaultView??window,o=(c)=>n===void 0||!("pointerId"in c)||c.pointerId===n,i=(c)=>{if(!o(c))return;c.preventDefault(),c.stopPropagation(),e.removeEventListener("click",i,!0)},s=()=>{e.removeEventListener("click",i,!0),e.removeEventListener("pointerdown",a,!0),e.removeEventListener("pointerup",l,!0),e.removeEventListener("pointercancel",l,!0)},a=(c)=>o(c)&&s(),l=(c)=>o(c)&&r.setTimeout(s);if(e.addEventListener("click",i,!0),e.addEventListener("pointerdown",a,!0),!t)return r.setTimeout(s);e.addEventListener("pointerup",l,!0),e.addEventListener("pointercancel",l,!0)}var Mm,Cr=(e)=>Mm.has(e);var Nc=be(()=>{Mm=new WeakSet});function Wc(e){let{sheet:t}=e,n=t.ownerDocument,r=n.defaultView??window,o=Ce(0,-1),i=0,s=null,a=0,l=0,c=null,f=null,p=null,u=null,m=null,g=null,A=null,d=!1,b=!1,v=null,y=null,I=null,T={x:0,y:0},B=Fc({horizon:e.config().physics.velocityHorizon}),X=[se(n,"touchstart",Q,{capture:!0,passive:!0}),se(n,"touchmove",ne,{capture:!0,passive:!1}),se(n,"touchend",fe,{capture:!0,passive:!0}),se(n,"touchcancel",fe,{capture:!0,passive:!0}),se(t,"pointerdown",le)],F=!1;function H(w){if(F)return;t.style.translate=ln(e.side(),e.size()-w),i=w}function U(w,O){if(F)return;let P=hr(o,w,e.config());o=P.state;let R="time"in w?w.time:performance.now();for(let J of P.effects)te(J,R,O);let K=o.phase==="dragging";if(K===d)return;d=K,e.onDragChange(d)}function te(w,O,P){switch(w.type){case"move":if(c)ae(),H(w.extent),e.onFrame(w.extent);else s=w.extent,x();return;case"settle":return Z(w,O);case"scroll":return a+=w.delta,x();case"fling-scroll":if(m)u={velocity:w.velocity,startTime:O,startScroll:0,area:m};return x();case"snap":return y=w.id,e.onSnap(w.id,w.reason,P);case"dismiss":if(w.reason!=="swipe")return;return p="swipe",e.onDismiss(P);case"attempt-dismiss":return e.onDismissAttempt(P)}}function Z(w,O){ae(),s=null;let P=e.closedExtent(),R=w.from<=0?P:w.from,K=w.to<=0?P:w.to,J=e.reducedMotion()&&(R===P||K===P),oe=e.reducedMotion()?ce(R,K,J):re(R,K,w);if(H(J?Math.max(K,0):K),Math.abs(K-R)<0.5&&w.velocity===0||oe.duration===0)return q();let ie=e.size(),de=e.side();if(c=J?t.animate({opacity:R===P?[0,1]:[1,0]},{duration:oe.duration,fill:"both"}):Math.abs(K-R)<1||!cn()?t.animate({translate:kr(oe,(E)=>ln(de,ie-E))},{duration:oe.duration,fill:"backwards"}):t.animate({translate:[ln(de,ie-R),ln(de,ie-K)]},{duration:oe.duration,easing:oe.easing,fill:"backwards"}),J)f=c;let h=c;c.onfinish=()=>{if(c===h)q()},c.startTime=O,e.onMotion({type:"settle",extentAt:oe.extentAt,startTime:O,duration:oe.duration})}function re(w,O,P){let R=It(P.response,P.dampingRatio,w-O,P.velocity),K=fr(R);return{duration:K,easing:pr(R,w,O,K),extentAt:(J)=>O+R.position(J)}}function ce(w,O,P){let R=P?xc:wc,K=(J)=>1-(1-J)**3;return{duration:R,easing:"cubic-bezier(0.33, 1, 0.68, 1)",extentAt:(J)=>w+(O-w)*K(Math.min(1,J/R))}}function ae(){if(c?.cancel(),c=null,f)f.cancel(),f=null}function q(){if(ae(),U({type:"settled"}),o.phase!=="idle")return;if(o.restingIndex<0)return p=null,y=null,e.onRest(null);y=e.config().snapPoints[o.restingIndex].id,e.onRest(y)}function x(){l||=r.requestAnimationFrame(S)}function S(w){if(l=0,a&&m)Zo(m,e.side(),a),a=0;if(u)M(w);if(s===null)return;H(s),s=null,e.onFrame(i)}function M(w){if(!u)return;let O=Math.max(0,w-u.startTime),P=u.velocity*(oi**O-1)/Math.log(oi);if(Zo(u.area,e.side(),P-u.startScroll),u.startScroll=P,Math.abs(u.velocity*oi**O)<0.01)u=null;else x()}function _(w){return w instanceof Element&&w.closest(Pm)!==null}function N(w){let O=vc(w,t,e.side());return m=O?.area??null,O&&{atStart:O.atStart,atEnd:O.atEnd}}function Q(w){let O=v!==null&&Cr(v);if(v=null,g||w.touches.length>1||p||O)return;if(!e.owns(w.target)||_(w.target))return;let P=w.changedTouches[0];g={id:P.identifier,originX:P.clientX,originY:P.clientY},u=null,B.reset(),yt(e.side(),P.clientX,P.clientY,T),B.add(w.timeStamp,T.y),U({type:"down",time:w.timeStamp,x:T.x,y:T.y,pointer:"touch"},w)}function ne(w){let O=ue(w.changedTouches);if(!O)return;yt(e.side(),O.clientX,O.clientY,T),B.add(w.timeStamp,T.y);let P=o.phase==="dragging",R=N(w.target);if(U({type:"move",time:w.timeStamp,x:T.x,y:T.y,scroll:R},w),o.phase==="pending")return ee(w,O,R);if(o.phase!=="dragging")return;if(w.cancelable)w.preventDefault();else if(!P&&m)m.style.overscrollBehavior="none"}function ee(w,O,P){if(!w.cancelable||!g)return;let R=yt(e.side(),g.originX,g.originY,{x:0,y:0});if(Math.abs(T.y-R.y)<Math.abs(T.x-R.x))return;let K=e.config().snapPoints.at(-1)?.extent??0;if((P?cr({towardMore:T.y<R.y,scrollAtStart:P.atStart,atLargest:i>=K-0.5,expandOnScroll:e.config().expandOnScroll}):"sheet")==="sheet")w.preventDefault()}function fe(w){if(!ue(w.changedTouches))return;if(g=null,m)m.style.removeProperty("overscroll-behavior");let O=w.type==="touchcancel"?0:B.velocity(w.timeStamp);U({type:"up",time:w.timeStamp,velocity:O},w)}function ue(w){if(!g)return null;for(let O=0;O<w.length;O++)if(w[O].identifier===g.id)return w[O];return null}function le(w){if(v=w,w.pointerType==="touch"||w.button!==0||A!==null||p)return;let O=w.target;if(!e.owns(O)||_(O)||!(O instanceof Element)||!e.canMouseDrag(O))return;A=w.pointerId,b=!1,I=o.phase==="settling"&&o.targetIndex>=0?y:null,u=null,B.reset(),yt(e.side(),w.clientX,w.clientY,T),B.add(w.timeStamp,T.y),z=[se(n,"pointermove",k,{capture:!0}),se(n,"pointerup",L,{capture:!0}),se(n,"pointercancel",L,{capture:!0})];let P=w.pointerType==="pen"?"pen":"mouse";U({type:"down",time:w.timeStamp,x:T.x,y:T.y,pointer:P},w)}let z=[];function k(w){if(w.pointerId!==A)return;if(v&&Cr(v))return D(w,0,I);let O=w.getCoalescedEvents?.();for(let P of O?.length?O:[w])B.add(P.timeStamp,yt(e.side(),P.clientX,P.clientY,T).y);if(yt(e.side(),w.clientX,w.clientY,T),U({type:"move",time:w.timeStamp,x:T.x,y:T.y,scroll:N(w.target)},w),o.phase!=="dragging"||b)return;b=!0,n.getSelection()?.removeAllRanges(),t.style.userSelect="none";try{t.setPointerCapture(w.pointerId)}catch{}}function L(w){if(w.pointerId!==A)return;if(v&&Cr(v))return D(w,0,I);D(w,w.type==="pointercancel"?0:B.velocity(w.timeStamp))}function D(w,O,P=null){A=null,v=null,z.forEach((J)=>J()),z=[],t.style.removeProperty("user-select");let R=w.timeStamp,K=e.config().snapPoints.findIndex((J)=>J.id===P);if(P!==null&&K>=0)o=Ce(o.extent,K),U({type:"snap-to",time:R,id:P,reason:"imperative"});else U({type:"up",time:R,velocity:O},w);if(b)$c(n)}return{open(w,O){p=null,y=w,ae();let P=e.config().snapPoints.findIndex((K)=>K.id===w);if(!O&&P>=0)return o=Ce(e.config().snapPoints[P].extent,P),H(o.extent),e.onRest(w);o=Ce(0,-1),H(e.closedExtent()),U({type:"snap-to",time:performance.now()+wr,id:w,reason:"imperative"});let R=c;if(!R)return;xr(r,(K)=>{if(c!==R||o.phase!=="settling")return;R.startTime=K,o={...o,startTime:K},e.onMotionStart(K)})},close(){let w=p;if(p="close",!w)U({type:"close",time:performance.now()})},snapTo(w,O){if(p==="close")return;if(p=null,U({type:"snap-to",time:performance.now(),id:w,reason:O}),o.phase==="settling")y=e.config().snapPoints[o.targetIndex]?.id??y},nudge(){if(!p&&!e.reducedMotion())U({type:"nudge",time:performance.now()})},relayout(w,O){let P=e.config().snapPoints;if(p||y===null||o.phase==="dragging"||o.phase==="pending")return H(i);let R=P.findIndex((de)=>de.id===y),K=P.findIndex((de)=>de.id===O),J=R>=0?R:K>=0?K:Ye(P.map((de)=>de.extent),i),{id:oe,extent:ie}=P[J];if(o.phase==="idle"){let de=Math.min(i,e.size());if(o=Ce(de,R),w||Math.abs(ie-de)<0.5){if(o=Ce(ie,J),H(ie),!w&&oe===y){e.onFrame(ie);return}if(oe!==y)te({type:"snap",id:oe,reason:"content-resize"},performance.now());return e.onRest(oe)}}U({type:"snap-to",time:performance.now(),id:oe,reason:"content-resize"})},target:()=>p?null:y,isMoving:()=>o.phase!=="idle",destroy(){if(F=!0,ae(),l)r.cancelAnimationFrame(l);if(X.forEach((w)=>w()),z.forEach((w)=>w()),d)e.onDragChange(!1);for(let w of["translate","user-select","opacity"])t.style.removeProperty(w)}}}var oi=0.998,Pm='input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-drawer-no-drag]';var Vc=be(()=>{Ko();gr();ur();mr();Rc();Pe();Nc();ei();Ar();un()});function Hc(e){let{sheet:t,host:n}=e,r=t.ownerDocument,o=r.defaultView??window,i=Ce(0,-1),s=0,a=[],l=null,c=!1,f=!1,p=!1,u=null,m,g=0,A=0,d=null,b=new Map,v=new Map,y=null,I=bt(n,{inset:`0 0 calc(var(--keyboard-inset, 0px) - ${Be}px) 0`,display:"block","overflow-y":"scroll","overflow-x":"hidden","scroll-snap-type":"y mandatory","scrollbar-width":"none","overscroll-behavior":"contain","pointer-events":"auto"}),T=bt(t,{position:"absolute",left:"0",right:"0"}),B="onscrollend"in n,X=o.ScrollTimeline,F=[se(n,"scroll",x,{passive:!0}),...B?[se(n,"scrollend",N)]:[],se(n,"touchstart",()=>{if(c=!0,f=!1,l&&!u)ee()},{passive:!0}),se(n,"touchend",M,{passive:!0}),se(n,"touchcancel",M,{passive:!0})],H=at()?1:Be+1,U=new IntersectionObserver(Q,{root:n,rootMargin:`0px 0px -${H}px 0px`,threshold:0});U.observe(t);let te=()=>e.config().dimension,Z=()=>e.config().snapPoints.at(-1)?.extent??0,re=()=>Z()+Om-s,ce=()=>Math.min(n.scrollTop+s,Z());function ae(){let D=e.config();s=D.dismissible?-Be:D.snapPoints[0].extent,t.style.top=`${te()-s}px`;for(let P of a)P.remove();let w=D.snapPoints.map((P)=>P.extent);a=(D.dismissible?[s,...w]:w).map((P)=>q(P-s,"start")),a.push(q(re()+n.clientHeight-1,"none")),n.append(...a);for(let P of b.keys())if(!t.contains(P))b.delete(P),v.delete(P);for(let P of Im(t)){if(!b.has(P))b.set(P,[P.style.getPropertyValue("overflow-y"),P.style.getPropertyPriority("overflow-y")]);if(!v.has(P)&&!Dm(P,t))v.set(P,Ne(P,"overscroll-behavior","auto"))}}function q(D,w){let O=r.createElement("div");return O.setAttribute("aria-hidden","true"),O.style.cssText=`position:absolute;left:0;width:1px;height:1px;top:${D}px;scroll-snap-align:${w};pointer-events:none`,O}function x(){if(l||u)return;if(y&&c&&Math.abs(n.scrollTop-y.offsetTop)>1)fe();if(c&&!p)_(!0);if(!X)A||=o.requestAnimationFrame(S);if(o.clearTimeout(g),!B&&!c)g=o.setTimeout(N,qc)}function S(){A=0,e.onFrame(ce())}function M(){if(c=!1,_(!1),y){fe();let D=e.config().snapPoints,w=Ye(D.map((O)=>O.extent),ce());return L(D[w].id,"swipe")}if(!e.config().dismissible&&n.scrollTop<-2)e.onDismissAttempt();if(f||!B)g=o.setTimeout(N,qc);f=!1}function _(D){if(p===D)return;p=D,e.onDragChange(D)}function N(){if(c){f=!0;return}if(l||u)return;let D=e.config();if(D.dismissible&&d!==null&&n.scrollTop+s<=Tm-Be)return ne();let w=hr(i,{type:"rest",extent:ce()},D);i=w.state;for(let O of w.effects)if(O.type==="snap")d=O.id,e.onSnap(O.id,O.reason);if(i.restingIndex>=0)z(D.snapPoints[i.restingIndex].id)}function Q(D){if(D[D.length-1].isIntersecting||l||u||d===null||!e.config().dismissible)return;ne()}function ne(){u="swipe",d=null,e.onDismiss()}function ee(){if(!l)return;let D=Math.max(0,l.extentAt(performance.now()-l.startTime)-s);le(),y=q(D,"start"),n.append(y),n.scrollTop=D,S(),k()}function fe(){y?.remove(),y=null}function ue(D,w,O,P){le();let R=e.config().physics,K=It(R.response,R.dampingRatio,w-D,0),J=Math.max(1,fr(K)),oe=Math.max(s,D);n.scrollTop=oe-s;let ie=(C)=>D+K.position(Math.max(0,C)),de=Math.abs(D-w)<0.5,h=!de&&!cn(),E=t.animate({translate:h?kr({duration:J,extentAt:ie},(C)=>`0 ${oe-C}px`):[`0 ${oe-w}px`,`0 ${oe-D}px`]},{duration:J,easing:de||h?"linear":pr(K,w,D,J),fill:"both"});E.startTime=O,l={animation:E,to:D,extentAt:ie,startTime:O},e.onMotion({type:"settle",extentAt:ie,startTime:O,duration:J}),E.onfinish=()=>{if(l?.animation!==E)return;if(l=null,P(),E.cancel(),at()){let{minHeight:C}=t.style;t.style.minHeight=`${t.offsetHeight+1}px`,n.scrollHeight,t.style.minHeight=C}}}function le(){l?.animation.cancel(),l=null}function z(D){let w=e.config(),O=w.snapPoints.findIndex((R)=>R.id===D);i=Ce(w.snapPoints[O].extent,O),d=D,n.style.pointerEvents=e.isInteractive(D)?"none":"auto";let P=O===w.snapPoints.length-1;for(let[R,[K,J]]of b)if(P)R.style.setProperty("overflow-y",K,J);else R.style.overflowY="hidden";e.onRest(D),k()}function k(){if(!X)return;let D=re(),w=new X({source:n,axis:"block"});e.onMotion({type:"timeline",timeline:w,extentAt:(O)=>Math.min(Z(),O*D+s)})}function L(D,w){let O=e.config().snapPoints.find((R)=>R.id===D);if(!O||u==="close")return;if(u=null,D!==d)d=D,e.onSnap(D,w);let P=l?l.extentAt(performance.now()-l.startTime):ce();ue(O.extent,P,performance.now(),()=>z(D))}return{open(D,w){u=null,m?.(),d=D,ae();let O=e.config().snapPoints.find((R)=>R.id===D);if(!O)return;if(!w)return n.scrollTop=O.extent-s,z(D);ue(O.extent,-Be,performance.now()+wr,()=>z(D));let P=l;xr(o,(R)=>{if(!P||l!==P)return;P.animation.startTime=R,P.startTime=R,e.onMotionStart(R)})},close(){let D=u;if(u="close",D)return;d=null,m=Ne(n,"overflow-y","hidden");let w=l?l.extentAt(performance.now()-l.startTime):ce();ue(-Be,w,performance.now(),()=>e.onRest(null))},snapTo:L,nudge(){if(u||e.reducedMotion()||d===null)return;let D=e.config().snapPoints.find((w)=>w.id===d);if(D)ue(D.extent,D.extent-20,performance.now(),()=>z(D.id))},relayout(D,w){if(u||c)return;let O=e.config().snapPoints,P=O.findIndex((ie)=>ie.id===d),R=O.findIndex((ie)=>ie.id===w),K=P>=0?P:R>=0?R:Ye(O.map((ie)=>ie.extent),ce()),J=s;ae();let oe=O[K];if(oe.id!==d)d=oe.id,e.onSnap(oe.id,"content-resize");if(l){let ie=l,de=performance.now();if(ie.to!==oe.extent||s!==J)ue(oe.extent,ie.extentAt(de-ie.startTime),Math.max(de,ie.startTime),()=>z(oe.id)),l=Object.assign(ie,l);return}n.scrollTop=oe.extent-s,z(oe.id)},target:()=>u?null:d,isMoving:()=>!!l||p,destroy(){if(le(),fe(),o.clearTimeout(g),A)o.cancelAnimationFrame(A);U.disconnect(),F.forEach((D)=>D());for(let D of a)D.remove();for(let[D,[w,O]]of b)D.style.setProperty("overflow-y",w,O);if(v.forEach((D)=>D()),p)e.onDragChange(!1);t.style.removeProperty("top"),m?.(),T(),I()}}}function Dm(e,t){let n=e.closest("[popover]");return!!n&&n!==t&&t.contains(n)}function Im(e){let t=e.ownerDocument.defaultView??window;return Array.from(e.querySelectorAll("*")).filter((n)=>/auto|scroll/.test(t.getComputedStyle(n).overflowY))}var qc=120,Om=24,Tm=2;var jc=be(()=>{gr();ur();mr();Pe();Ve();De();Ar();un()});function Lm(e){let t=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e);return t?[t[1],t[2],t[3]].map(Number):null}function Kc(e,t){let n=Array.from(e.querySelectorAll('meta[name="theme-color"]')),r=n.map((l)=>l.content),o=r.map((l)=>Lm(Fm(e,l))),i=-1;function s(l){let c=Math.round(l*t*100)/100;if(c===i)return;i=c,n.forEach((f,p)=>{let u=o[p];if(!u)return;f.content=c?`rgb(${u.map((m)=>Math.round(m*(1-c))).join(" ")})`:r[p]})}function a(){n.forEach((l,c)=>l.content=r[c]),i=-1}return{write:s,restore:a}}function Fm(e,t){let n=e.createElement("span");n.style.color=t,n.style.display="none",e.body.append(n);let r=e.defaultView?.getComputedStyle(n).color??t;return n.remove(),r}var Bc=()=>{};function Nm(e){return{side:()=>"bottom",snapPoints:()=>["content"],snapPoint:()=>null,dismissible:()=>!0,modalAbove:()=>{return},driver:()=>"auto",expandOnScroll:()=>!0,physics:()=>{return},backdrop:()=>{return},hostBackdrop:!1,outlets:()=>[],parent:()=>{return},themeColor:()=>!1,preventEdgeSwipe:()=>!1,canMouseDrag:$m,onSnap:dn,onRest:dn,onDismissAttempt:dn,onDragChange:dn,onLayout:dn,...Wm(e)}}function Wm(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function Yc(e){for(let t=e.parent;t;t=t.parent){let n=Mr.get(t);if(n)return n}}function Vm(e){for(let t=e instanceof Element?e:null;t;){if(ii.has(t))return t;let n=t.getRootNode();t=t.parentElement??(n instanceof ShadowRoot?n.host:null)}return null}function qm(e,t){let n=e.closest("[popover]");return!!n&&n!==t&&t.contains(n)}function Hm(e,t){let n=t.driver();if(n!=="auto")return n==="scroll-snap";return t.modalAbove()===void 0&&t.expandOnScroll()&&!!e.matchMedia?.("(hover: none) and (pointer: coarse)").matches}function Xc(e,t){let n=Nm(t),{host:r}=n,o=e.ownerDocument,i=o.defaultView??window,s=i.matchMedia?.("(prefers-reduced-motion: reduce)"),a=Qo(n.side(),e),l=[],c=0,f,p=yr.ios,u,m,g={snapPoints:[],dimension:0,dismissible:!0,expandOnScroll:!0,physics:p,contentScroll:ac},A=a==="bottom"&&Hm(i,n);ii.add(e);let d=_c(r,a,e),b=[Uc(r,a,d),Km(e,A)],v=[],y=Ic({sheet:e,backdrop:n.backdrop,dimmed:n.hostBackdrop?r:void 0,outlets:n.outlets,ancestors:()=>v,themeColor:(z)=>u?.write(z)});function I(){let z=n.physics();if(z!==f)f=z,p=z?{...yr.ios,...z}:yr.ios;return g.physics=p,g.dismissible=n.dismissible(),g.expandOnScroll=n.expandOnScroll(),g}let T=!1;function B(){T=!0;let z=Qo(n.side(),e),k=_c(r,z,e);if(z!==a||k!==d)a=z,d=k,b[0](),b[0]=Uc(r,a,d);let L=r.clientHeight-(A?Be:0),D=r.clientWidth,w=Ke(a)?L:D;e.style.setProperty("--available-height",`${L}px`),e.style.setProperty("--available-width",`${D}px`),ae??=i.visualViewport?.height,c=bc(e,a);let O=parseFloat(i.getComputedStyle(o.documentElement).fontSize)||16,P=uc(n.snapPoints(),{container:w,content:c,rootFontSize:O});if(!P.length)P.push({id:"content",value:"content",extent:c,ids:["content"]});let R=w!==g.dimension||P.length!==l.length||P.some((K,J)=>K.id!==l[J].id||Math.abs(K.extent-l[J].extent)>=0.5);if(l=P,g.dimension=w,g.snapPoints=l.map(({id:K,extent:J})=>({id:K,extent:J})),y.configure({snapExtents:g.snapPoints.map((K)=>K.extent),undimmedIndex:gt(l,n.modalAbove())}),R)te();return R}let X=!1,F=(z)=>z===null?null:l.find((k)=>k.id===z)?.value??null,H={sheet:e,host:r,side:()=>a,config:I,size:()=>c,closedExtent:()=>Sr(a),reducedMotion:()=>!!s?.matches,owns:(z)=>Vm(z)===e,canMouseDrag:n.canMouseDrag,onSnap:(z,k,L)=>{let D=F(z);if(D!==null)n.onSnap(D,k,L)},onRest(z){if(X)return;let k=l.find((L)=>L.id===z);if(y.apply(k?.extent??Sr(a),{rest:!0}),n.onRest(F(z)),Q&&z!==null)ee();Q=!1},onDismiss:n.onDismiss,onDismissAttempt:n.onDismissAttempt,onDragChange:n.onDragChange,isInteractive:(z)=>le.isInteractiveAt(F(z)),onFrame:(z)=>X||y.apply(z),onMotion:(z)=>X||y.play(z),onMotionStart:(z)=>X||y.sync(z)},U=!0;function te(){if(!U)return n.onLayout({side:a,snapPoints:l});queueMicrotask(()=>X||n.onLayout({side:a,snapPoints:l}))}I();let Z=A?Hc(H):Wc(H);e.setAttribute("data-driver",A?"scroll-snap":"pointer"),U=!1;let re=new ResizeObserver(()=>{fe(!1)});re.observe(e),re.observe(r);let ce=0,ae,q=null,S=[mc(r,{before:()=>ce=e.getBoundingClientRect().top,after:M}),...n.preventEdgeSwipe()?[se(o,"touchstart",_,{capture:!0,passive:!1})]:[],...at()?[se(o,"touchend",N,{capture:!0,passive:!1})]:[],se(e,"focusin",ne)];function M(){fe(!0),ee();let z=i.visualViewport?.height;if(z===ae)return;ae=z,q?.cancel(),q=null;let k=ce-e.getBoundingClientRect().top;if(Math.abs(k)<1||s?.matches)return;q=r.animate({translate:[`0 ${k}px`,"0 0"]},jm)}function _(z){if(!z.cancelable)return;let k=z.touches[0];if(!k||k.clientX>zc&&k.clientX<i.innerWidth-zc)return;let L=z.target;if(L&&(r.contains(L)||n.backdrop()?.contains(L)))z.preventDefault()}function N(z){let k=z.target;if(!(k instanceof HTMLInputElement||k instanceof HTMLTextAreaElement))return;if(!e.contains(k)||k===o.activeElement||Z.isMoving()||!z.cancelable)return;z.preventDefault(),k.focus({preventScroll:!0})}let Q=!1;function ne(){if(Z.isMoving())Q=!0;else ee()}function ee(){let z=o.activeElement;if(!(z instanceof HTMLElement)||!e.contains(z)||z===e||qm(z,e))return;let k=Jo(z,e,"bottom");if(!k)return;let L=i.visualViewport,D=Math.min(k.getBoundingClientRect().bottom,L?L.offsetTop+L.height:i.innerHeight),{top:w,bottom:O}=z.getBoundingClientRect(),P=16,R=k.getBoundingClientRect().top,K=O+P>D?O+P-D:w-P<R?w-P-R:0;if(K)k.scrollBy({top:K,behavior:s?.matches?"instant":"smooth"})}function fe(z){let k=!T;if(B()&&!k)Z.relayout(z,l[gt(l,n.snapPoint())]?.id)}function ue(z){let k=gt(l,z);return l[k>=0?k:0]?.id}let le={element:e,parent:n.parent,open(z){if(X)return;v=[];for(let L=n.parent();L;L=L.parent())v.push(L.element);if(B(),I(),n.themeColor())u??=Kc(o,p.dim);if(z)y.apply(Sr(a));m?.();let k=n.backdrop();m=k&&bt(k,{"will-change":"opacity"}),Z.open(ue(n.snapPoint()),z)},close:()=>X||Z.close(),snapTo(z,k){let L=gt(l,z);if(L>=0&&l[L].id!==Z.target())Z.snapTo(l[L].id,k)},nudge:()=>Z.nudge(),snapPoints:()=>l,target:()=>F(Z.target()),isInteractiveAt:(z)=>dc(l,z,n.modalAbove()),refresh(){fe(!1)},destroy(){X=!0,re.disconnect(),q?.cancel(),S.forEach((z)=>z()),Z.destroy(),y.destroy(),m?.(),u?.restore(),b.forEach((z)=>z()),e.style.removeProperty("--available-height"),e.style.removeProperty("--available-width"),e.removeAttribute("data-driver"),ii.delete(e)}};return le}function Uc(e,t,n){let r=Ke(t);return bt(e,{position:"fixed",inset:"0 0 var(--keyboard-inset, 0px) 0",width:"auto",height:"auto","max-width":"none","max-height":"none",margin:"0",padding:"0",border:"0",background:"transparent",color:"inherit",overflow:"visible",display:"flex","flex-direction":r?"column":"row","justify-content":n?"flex-end":"flex-start","pointer-events":"none"})}function Km(e,t){return bt(e,{"pointer-events":"auto","overscroll-behavior":t?"auto":"contain","will-change":"translate"})}var Rm='a[href], button, label, summary, [role="button"], [role="link"], [role="slider"], [tabindex]:not([tabindex="-1"])',$m=(e)=>!e.closest(Rm),dn=()=>{},ii,Mr,zc=24,jm,_c=(e,t,n)=>Ke(t)?t==="bottom":t==="right"!==(n.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl");var Gc=be(()=>{lc();cc();fc();Pe();gc();Ve();ei();Ar();un();Vc();jc();Bc();ii=new WeakSet,Mr=new WeakMap;jm={duration:250,easing:"cubic-bezier(0.38, 0.7, 0.125, 1)"}});var Qc={};Hd(Qc,{prepareVariables:()=>Dc,presentSheet:()=>Um});function Bm(e){let t=e.getAttribute("data-slot");if(!t)return;Te(e.ownerDocument,`ui-sdk-sheet-${t}`,`@layer ui-sdk { :where([data-slot="${t}"])::backdrop { background: var(--sheet-backdrop, rgb(0 0 0 / 0.2)); pointer-events: auto } }`)}function zm(e,t){let n=[],r=(o)=>{for(let i of Array.from(o.children)){if(t.includes(i))continue;if(t.some((s)=>s&&i.contains(s)))r(i);else if(i instanceof HTMLElement)n.push(Ne(i,"display","none"))}};return r(e),()=>n.forEach((o)=>o())}function _m(e,t,n){let r,o=t.bind(e,{...n,position:void 0,inline:!0,onShow(){let[i,s]=n.drillIn();if(i)r=zm(i,[e,s]);return()=>r?.()},onClose(){r?.(),r=Ne(e,"display","none")}});return()=>{o(),r?.()}}function Um(e,t,n){if(n.drillIn)return _m(e,t,n);let r=e.parentElement;if(!r)return;Bm(r);let o;return t.bind(e,{...n,position:void 0,host:()=>r,onShow(i){let s=Ym(e,r,t,n,i);return o=s.sheet,()=>{s.hide(),o=void 0}},onClose:()=>o?.close()})}function Ym(e,t,n,r,o){let i=null,s=Yc(o),a=!r.backdrop?.(),l=Xc(e,{host:t,snapPoints:()=>r.snapPoints??["content"],snapPoint:()=>i,backdrop:r.backdrop,hostBackdrop:a,dismissible:r.dismissible,onDismissAttempt:r.onDismissAttempt,parent:()=>s?.(),onSnap:(p)=>i=p,onDismiss(p){n.requestClose("swipe",p),requestAnimationFrame(()=>{let u=i??l.snapPoints()[0]?.value;if(o.active()&&u!==void 0)l.snapTo(u,"imperative")})}});Mr.set(o,()=>l),r.onSheet?.(l);let c=se(e,"focusin",(p)=>{let u=l.snapPoints().at(-1);if(u&&l.snapPoints().length>1&&p.target.matches("input, textarea"))l.snapTo(u.value,"imperative")}),f=a?getComputedStyle(e).getPropertyValue("--sheet-backdrop"):"transparent";if(f)t.style.setProperty("--sheet-backdrop",f);if(o.active())l.open(n.opener()!=="initial");return{sheet:l,hide(){c(),Mr.delete(o),l.destroy(),r.onSheet?.(void 0),t.style.removeProperty("--sheet-backdrop")}}}var Jc=be(()=>{Pe();De();Gc();un()});class xt extends Error{name="AdressevaelgerError";status;url;constructor(e,t){super(e);this.status=t.status,this.url=jd(t.url)}}function jd(e){return e.replace(/([?&]token=)[^&]*/i,"$1***")}function Ht(e){return e instanceof Error&&e.name==="AbortError"}function Vr(e){let t=e.vejnavn??e.vejNavn??"",n=e.husnummer??e.husNummer??"";switch(e.type){case"vejnavn":return{type:"streetName",label:e.titel,streetName:t||e.titel};case"vejnavnhusnummer":return{type:"streetNameNumber",label:e.titel,streetName:t,houseNumber:n};case"navngivenvejpostnummer":if(!e.id)return null;return{type:"street",id:e.id,label:e.titel,streetName:t,postalCode:e.postnr??"",postalDistrict:e.postdistrikt??"",accessAddressCount:e.antal_husnumre??0};case"husnummer":if(!e.id)return null;return{type:"accessAddress",id:e.id,label:e.titel,streetName:t,houseNumber:n};case"adresse":if(!e.id)return null;return{type:"address",id:e.id,label:e.titel,accessAddressId:e.husnummerId??""};default:return null}}function Vi(e){return{validFrom:e.virkningfra,validTo:e.virkningtil,registeredFrom:e.registreringfra,registeredTo:e.registreringtil}}function St(e){let t=e.adgangspunkt?.koordinater??null;return{type:"accessAddress",id:e.id_lokalid,label:e.adgangsadressebetegnelse,houseNumber:e.husnummertekst,streetName:e.vejnavn,statusCode:e.status,position:t?{x:t.x,y:t.y,crs:"EPSG:25832"}:null,postalCode:{id:e.postnummer.id_lokalid,code:e.postnummer.postnr,name:e.postnummer.navn},municipalityCode:e.navngivenvejkommunedel?.kommune??null,roadCode:e.navngivenvejkommunedel?.vejkode??null,streetId:e.navngivenvejpostnummer?.id_lokalid??null,namedRoadId:e.navngivenvej?.id_lokalid??null,supplementaryTownName:e.supplerendebynavn?.navn??null,...Vi(e),raw:e}}function jt(e){return{type:"address",id:e.id_lokalid,label:e.adressebetegnelse,floor:e.etagebetegnelse,door:e.doerbetegnelse,statusCode:e.status,accessAddress:St(e.husnummer),...Vi(e),raw:e}}function qr(e){return{type:"street",id:e.id,label:e.titel,streetName:e.vejnavn,postalCode:e.postnr,postalDistrict:e.postdistrikt,postalCodeId:e.postnummer,accessAddressCount:e.antal_husnumre,geometry:e.geometri?{type:"MultiLineString",coordinates:e.geometri.coordinates,crs:"EPSG:25832"}:null,raw:e}}function Kt(e){return"id"in e?`${e.type}:${e.id}`:`${e.type}:${e.label}`}var Kd=/[^\p{L}\p{N}\s.,'-]/gu;function ot(e){return e.replace(Kd," ").replace(/\s+/g," ").trim().slice(0,73).trimEnd()}function Hr(e){let t=String(e).trim();if(!/^\d{1,4}$/.test(t))throw RangeError(`Municipality code must be 1 to 4 digits, got "${t}"`);return t.padStart(4,"0")}var qi="adressevaelger123",Hi="https://adressevaelger.dk",jr=200;function Sn(e={}){let t=e.token??qi,n=(e.baseUrl??Hi).replace(/\/+$/,""),r=e.fetch??((s,a)=>globalThis.fetch(s,a));async function o(s,a,l){let f=[...a,["token",t]].map(([d,b])=>`${d}=${encodeURIComponent(b)}`).join("&"),p=`${n}/${s}?${f}`,u=await r(p,{signal:l,headers:{accept:"application/json"}});if(u.status===404)return null;let m=await u.text();if(!u.ok)throw new xt(m.trim()||u.statusText||`HTTP ${u.status}`,{status:u.status,url:p});let g;try{g=JSON.parse(m)}catch{throw new xt(`Expected JSON from KDS, got: ${m.slice(0,200)}`,{status:u.status,url:p})}if(g.status==="fejl"){let d=g.beskrivelse;throw new xt(typeof d==="string"?d:"KDS returned an error",{status:u.status,url:p})}return g}function i(s,a){let l=new Map(s.map((c)=>[c.id,c]));return a.flatMap((c)=>l.get(c)??[])}return{async search(s,a={}){let l=ot(s);if(!l)return[];let c=[["tekst",l]];if(a.limit!==void 0){let{limit:u}=a;if(!Number.isInteger(u)||u<1||u>jr)throw RangeError(`limit must be an integer from 1 to ${jr}, got ${u}`);c.push(["maksimum",String(u)])}if(a.municipalityCodes?.length)c.push(["kommunekode",a.municipalityCodes.map(Hr).join(",")]);if(a.includeProvisional)c.push(["medtagforeloebige","true"]);let f=(a.kind??"address")==="address"?"adresser":"husnumre";return((await o(`${f}/soeg`,c,a.signal))?.fund??[]).flatMap((u)=>Vr(u)??[])},async getAddress(s,a={}){let l=await o(`adresser/${encodeURIComponent(s)}`,[],a.signal);return l?jt(l.adresse):null},async getAddresses(s,a={}){if(s.length===0)return[];let l=await o("adresser",[["id_lokalids",s.join(",")]],a.signal);return i((l?.adresser??[]).map(jt),s)},async getAccessAddress(s,a={}){let l=await o(`husnumre/${encodeURIComponent(s)}`,[],a.signal);return l?St(l.husnummer):null},async getAccessAddresses(s,a={}){if(s.length===0)return[];let l=await o("husnumre",[["id_lokalids",s.join(",")]],a.signal);return i((l?.husnumre??[]).map(St),s)},async getAccessAddressUnits(s,a={}){return((await o(`husnumre/${encodeURIComponent(s)}/adresser`,[],a.signal))?.adresser??[]).map(jt)},async getStreet(s,a={}){let l=await o(`navngivenvejpostnumre/${encodeURIComponent(s)}`,[],a.signal);return l?qr(l.navngivenvejpostnummer):null},async getStreetAccessAddresses(s,a={}){return((await o(`navngivenvejpostnumre/${encodeURIComponent(s)}/husnumre`,[],a.signal))?.husnumre??[]).map(St)}}}var Bd=new Intl.Collator("da",{numeric:!0,sensitivity:"base"});function ji(e,t){let n=t.trim().toLowerCase();if(!n)return[];return e.filter((r)=>r.houseNumber.toLowerCase().startsWith(n)).toSorted((r,o)=>Bd.compare(r.houseNumber,o.houseNumber)).map((r)=>({type:"accessAddress",id:r.id,label:r.label,streetName:r.streetName,houseNumber:r.houseNumber}))}function Ki(e,t,n){let r=new Set;for(let i of e){if("id"in i)r.add(i.id);if(i.type==="address")r.add(i.accessAddressId)}let o=t.filter((i)=>!("id"in i)||!r.has(i.id));return[...e,...o].slice(0,n)}function Bi(e,t,n,r){return{action:"refine",value:e+t,caret:e.length,template:r?{before:e,after:t,kind:n,streetId:r}:{before:e,after:t,kind:n}}}function Kr(e){return{action:"refine",value:e,caret:e.length,template:null}}function zi(e){return{action:"complete",value:e,caret:e.length}}function _i(e,t){switch(e.type){case"streetName":return Kr(`${e.streetName} `);case"streetNameNumber":return Kr(e.label);case"street":return Bi(`${e.streetName} `,`, ${e.postalCode} ${e.postalDistrict}`,"houseNumber",e.id);case"accessAddress":{if(t==="accessAddress")return zi(e.label);let n=`${e.streetName} ${e.houseNumber}, `;if(!e.label.startsWith(n))return Kr(e.label);return Bi(n,`, ${e.label.slice(n.length)}`,"unit")}case"address":return zi(e.label)}}function Br(e,t){let{before:n,after:r}=t;if(e.length<n.length+r.length)return null;if(!e.startsWith(n)||!e.endsWith(r))return null;let o=n.length,i=e.length-r.length;return{start:o,end:i,kind:t.kind,text:e.slice(o,i)}}var zd=100,Ui={value:"",caret:null,slot:null,suggestions:[],status:"idle",error:null,open:!1,selection:null,fields:{},expanded:!1};function zr(e,t={}){return Object.fromEntries((e?.fields??[]).map(({name:n})=>[n,t[n]??""]))}function _d(e){return(e.type==="address"?e.accessAddress:e).postalCode.code}function _r(e={}){let t=e,n,r=()=>t.client??(n??=Sn()),o=()=>t.kind??"address",i=()=>t.fields,s=()=>t.fields?t.searchField:void 0,a={...Ui,fields:zr(t.fields)},l=null,c=new Set,f=null,p=[],u=null,m,g,A,d=0,b=0,v=new Map;function y(q){a={...a,...q};let x=s();if(x!==void 0&&a.fields[x]!==a.value)a={...a,fields:{...a.fields,[x]:a.value}};for(let S of c)S()}function I(q){let x=s();if(l&&x!==void 0)return l.fields[x]===q;return a.selection?.suggestion.label===q}function T(q,x){let S=x.format(q);l={fields:S,postalCode:_d(q)};let M=s(),_=M===void 0?void 0:S[M];return _===void 0?{fields:S,expanded:!0}:{fields:S,expanded:!0,value:_,caret:X(_.length)}}function B(q){let x=s();if(!l||x===void 0||/\b\d{4}\b/.test(q))return q;let S=i()?.fields.find((M)=>M.parts.includes("postalCode"));if(!S||S.name===x)return q;if(a.fields[S.name]!==l.fields[S.name])return q;return`${q}, ${l.postalCode}`}function X(q){return b+=1,{position:q,revision:b}}function F(q){if(t.houseNumberPrefix===!1||q?.kind!=="houseNumber"||!f?.streetId)return[];let x=v.get(f.streetId);return Array.isArray(x)?ji(x,q.text):[]}function H(){let q=u===a.value?p:[];return Ki(q,F(a.slot),t.limit??zd)}function U(q){if(v.has(q))return;v.set(q,"loading"),r().getStreetAccessAddresses(q).then((x)=>{if(v.set(q,x),f?.streetId===q&&a.slot?.kind==="houseNumber")y({suggestions:H()})},()=>{v.delete(q)})}function te(){clearTimeout(m),m=void 0,g?.abort(),g=void 0,d+=1}function Z(q){clearTimeout(m),m=void 0;let x=a.value;if(!ot(x)){te(),p=[],u=x,y({suggestions:[],status:"idle",error:null,open:!1});return}let S=t.debounceMs??100;if(q||S<=0)re(x);else m=setTimeout(()=>void re(x),S)}async function re(q){m=void 0,g?.abort();let x=new AbortController;g=x,d+=1;let S=d;y({status:"loading",error:null});try{let M=await r().search(B(q),{kind:o(),limit:t.limit,municipalityCodes:t.municipalityCodes,includeProvisional:t.includeProvisional,signal:x.signal});if(S!==d||q!==a.value)return;p=M,u=q,y({status:"success",suggestions:H()})}catch(M){if(S!==d||Ht(M)||q!==a.value)return;p=[],u=q,y({status:"error",error:M,suggestions:H(),expanded:a.expanded||i()!==void 0})}finally{if(g===x)g=void 0}}async function ce(q){A?.abort();let x=new AbortController;A=x;let S=()=>!x.signal.aborted&&a.selection?.suggestion===q;try{let M=q.type==="address"?await r().getAddress(q.id,{signal:x.signal}):await r().getAccessAddress(q.id,{signal:x.signal});if(!S())return;if(!M){y({selection:{suggestion:q,status:"error",details:null,error:Error(`KDS has no ${q.type} with id ${q.id}`)},expanded:a.expanded||i()!==void 0});return}let _={suggestion:q,status:"success",details:M,error:null},N=i();y({selection:_,...N&&T(M,N)}),t.onSelect?.(_)}catch(M){if(!S()||Ht(M))return;y({selection:{suggestion:q,status:"error",details:null,error:M},expanded:a.expanded||i()!==void 0})}}let ae={getState:()=>a,subscribe(q){return c.add(q),()=>c.delete(q)},setInput(q){if(q===a.value)return;let x=null;if(f){if(x=Br(q,f),!x)f=null}let S=I(q)?a.selection:null;if(!S)A?.abort();if(y({value:q,caret:null,slot:x,selection:S,open:ot(q)!==""}),F(x).length>0)y({suggestions:H()});Z(!1)},async select(q){let x=_i(q,o());if(x.action==="refine"){if(f=x.template,f?.streetId&&t.houseNumberPrefix!==!1)U(f.streetId);A?.abort(),y({value:x.value,caret:X(x.caret),slot:f?Br(x.value,f):null,selection:null,open:!0}),Z(!0);return}if(q.type!=="address"&&q.type!=="accessAddress")return;te(),f=null,l=null;let S=t.fetchDetails!==!1,M={suggestion:q,status:S?"loading":"success",details:null,error:null};if(y({value:x.value,caret:X(x.caret),slot:null,open:!1,selection:M}),S)await ce(q);else{if(i())y({expanded:!0});t.onSelect?.(M)}},async selectById(q){te(),f=null,A?.abort();let x=new AbortController;A=x;let S=x.signal;try{let M=o()==="address"?await r().getAddress(q,{signal:S}):await r().getAccessAddress(q,{signal:S});if(S.aborted||!M)return null;let N={suggestion:M.type==="address"?{type:"address",id:M.id,label:M.label,accessAddressId:M.accessAddress.id}:{type:"accessAddress",id:M.id,label:M.label,streetName:M.streetName,houseNumber:M.houseNumber},status:"success",details:M,error:null};p=[],u=null,l=null;let Q=i();return y({value:M.label,caret:X(M.label.length),slot:null,suggestions:[],status:"idle",error:null,open:!1,selection:N,...Q&&T(M,Q)}),t.onSelect?.(N),N}catch(M){if(S.aborted||Ht(M))return null;return y({status:"error",error:M}),null}},setOpen(q){if(q!==a.open)y({open:q})},setOptions(q){let x=t;t={...t,...q};let S=(x.kind??"address")!==o(),M=S||x.limit!==t.limit||x.includeProvisional!==t.includeProvisional||String(x.municipalityCodes??"")!==String(t.municipalityCodes??"");if(S)f=null,A?.abort(),y({slot:null,selection:null});if(JSON.stringify(x.fields?.fields)!==JSON.stringify(t.fields?.fields)){let _=t.fields,N=a.selection?.details;if(_&&N)y(T(N,_));else l=null,y({fields:zr(_,a.fields),expanded:_?a.expanded:!1})}if(M&&ot(a.value))u=null,y({open:!0}),Z(!0)},setField(q,x){if(q===s()){ae.setInput(x);return}if(!(q in a.fields)||a.fields[q]===x)return;let S=a.selection&&l?.fields[q]===x?a.selection:null;if(!S)A?.abort();y({fields:{...a.fields,[q]:x},selection:S})},expand(){if(!a.expanded)y({expanded:!0})},clear(){te(),A?.abort(),f=null,l=null,p=[],u=null,y({...Ui,fields:zr(i()),caret:X(0)})},destroy(){te(),A?.abort()}};return ae}var he=!1;function We(e){}function Ae(e,t,n){}function Yi(e,t){return e}function Xi(e,t){}function Gi(e,t,n,r,o,i){}function Qi(e,t,n,r){}function Ji(e,t,n){}function Zi(e){}function es(e,t){}function ts(e){e()}var ns=()=>!1;function rs(e,t,n){}function os(e,t,n,r){}function Ur(e,t,n){}var kn=new Set,Bt=!1;function Xe(e){if(kn.add(e),!Bt)Bt=!0,queueMicrotask(is)}function is(){Bt=!1;try{for(let e of kn)kn.delete(e),e()}finally{if(kn.size&&!Bt)Bt=!0,queueMicrotask(is)}}var Ud='input, textarea, select, [contenteditable]:not([contenteditable="false"])';function ss(e,{el:t}){let n=e.target.closest(Ud);if(n&&!n.contains(t??null))return;e.preventDefault()}var it={pointerdown:ss,mousedown:ss};var as;function ls(e){let t=as?.get(e);return as?.delete(e),t}var Yd=4,Fe=(e,t)=>!!(e.compareDocumentPosition(t)&Yd),Yr=(e,t)=>Fe(e,t)?-1:1,Xd=16,cs=32;function st(e){let t=e.length;if(t<=1)return e;let n=e[0].el.parentNode;if(n){let o=!0,i=!0;for(let s=1;s<t;s++){let a=e[s].el;if(a.parentNode!==n){o=!1;break}if(i&&e[s-1].el.nextElementSibling!==a)i=!1}if(o){if(i)return e;if("firstElementChild"in n){let s=new Map;for(let c=0;c<t;c++)s.set(e[c].el,e[c]);let a=[],l=t*cs;for(let c=n.firstElementChild;c&&l--;c=c.nextElementSibling){let f=s.get(c);if(f&&a.push(f)===t)return a}}}}let r=t<Xd?null:n;while(r){let o=!0;for(let i=0;i<t;i++)if(!r.contains(e[i].el)){o=!1;break}if(o)break;r=r.parentNode}if(r){let o=new Map;for(let l=0;l<t;l++)o.set(e[l].el,e[l]);let i=[],s=e[0].el.ownerDocument.createTreeWalker(r,1),a=t*cs;for(let l=r;l&&a--;l=s.nextNode()){let c=o.get(l);if(c&&i.push(c)===t)return i}}return e.sort((o,i)=>Yr(o.el,i.el))}function us(){let e=new Map,t,n=[],r=!1,o,i=new Set,s=(f)=>e.get(f.key)===f;function a(f,p){o??=new MutationObserver(()=>t=void 0);let u=p[p.length-1]?.el;for(let{el:m}of f)for(let g=m.parentNode;g&&!i.has(g);g=g.parentNode)if(i.add(g),o.observe(g,{childList:!0}),g.contains(u))break}function l(){let f=[];for(let u of e.values())if(u.el.isConnected)f.push(u);let p=st(f);if(p.length<e.size)return p;if(typeof MutationObserver<"u")o?.disconnect(),i.clear(),a(p,p);return t=p}function c(f){let p=n.filter(s);if(p.some((m)=>!m.el.isConnected))return;let u=f.filter(s);if(p.length*Math.log2(u.length+2)>u.length)return;for(let m of p){let g=0,A=u.length;while(g<A){let d=g+A>>1;if(Fe(u[d].el,m.el))g=d+1;else A=d}u.splice(g,0,m)}if(o)a(p,u);return u}return{list(){if(o?.takeRecords().length)t=void 0;if(t&&(n.length||r))t=c(t);return n=[],r=!1,t??l()},add(f){if(t&&e.has(f.key))r=!0;if(e.set(f.key,f),t)n.push(f);return()=>{if(!s(f))return;if(e.delete(f.key),r=!0,!e.size)o?.disconnect(),i.clear(),t=void 0}},get:(f)=>e.get(f),size:()=>e.size}}var An=(e)=>e.isTrusted;function ds(e,t){setTimeout(()=>{if(!e.defaultPrevented)t()})}var Xr=new Set;function Gr(e,t){if(Xr.has(e))return t();Xr.add(e);try{t()}finally{Xr.delete(e)}}function fs(e,t){return e!==void 0&&t===void 0}var Gd=new WeakMap,En=new WeakMap;function ps(e,t){return En.set(e,t),()=>{if(En.get(e)===t)En.delete(e)}}function Qd(e){let t=En.get(e);if(t)t();else e.focus()}var Qr=new WeakSet;function ms(e,t){let n=t??e.ownerDocument;if(Qr.has(n))return;Qr.add(n),setTimeout(()=>Qr.delete(n)),Qd(e)}function Zr(e,t,n){Gd.set(e,{internals:t,bind:n})}var Jd=new Set;function zt(e){Jd.forEach((t)=>t(e))}var Zd=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]),ef=new WeakSet;var tf=(e)=>Array.from(e.getRootNode().querySelectorAll("button, input[type=submit], input[type=image]")).find((t)=>t.form===e&&(t.type==="submit"||t.type==="image")),nf=(e)=>e.filter((t)=>t instanceof HTMLInputElement&&Zd.has(t.type));function hs(e){if(!e)return;let t=tf(e);if(t){if(!t.disabled)t.click();return}if(nf(Array.from(e.elements)).filter((n)=>!ef.has(n)).length<=1)e.requestSubmit()}function gs(e){for(let t=e.parentElement;t;t=t.parentElement){if(!(t instanceof HTMLFieldSetElement)||!t.disabled)continue;if(!t.querySelector(":scope > legend")?.contains(e))return!0}return!1}var Jr=new WeakMap;function ys(e,t){let n,r,o=!0,i=()=>{let a=null,l=!1;for(let c=e.parentElement;c;c=c.parentElement)if(c instanceof HTMLFieldSetElement){if(a=c,!l&&c.disabled){if(!c.querySelector(":scope > legend")?.contains(e))l=!0}}if(a&&typeof MutationObserver<"u"){r??=new MutationObserver(i),r.disconnect();for(let c=e.parentElement;c;c=c.parentElement)if(r.observe(c,{childList:!0,attributeFilter:["disabled"]}),c===a)break}else r?.disconnect();if(l!==n)t(n=l)},s=()=>{if(!o)return;i(),Jr.set(e,i)};if(e.isConnected)s();else queueMicrotask(s);return()=>{o=!1,r?.disconnect(),Jr.delete(e)}}var eo=(e)=>Jr.get(e)?.(),Re=(e)=>e.disabled||e.formDisabled;var rf=globalThis[Symbol.for("ui-sdk.label-ids@1")]??={count:0};function Cn(e){let t=[],n=e.closest("label");if(n?.control===e)t.push(n);if(e.id)e.getRootNode().querySelectorAll(`label[for="${CSS.escape(e.id)}"]`).forEach((o)=>{if(o!==n&&o.control===e)t.push(o)});return t.sort(Yr)}function bs(e,t,n=e){let r,o=()=>{let i=e.getAttribute("aria-labelledby");if(e.hasAttribute("aria-label")||i!==null&&i!==r)return;let s=t();for(let l of s)if(!l.id)l.id=`ui-sdk-native-label-${++rf.count}`;let a=s.map((l)=>l.id).join(" ");if(!a){if(r!==void 0)e.removeAttribute("aria-labelledby");r=void 0;return}if(r=a,i!==a)e.setAttribute("aria-labelledby",a)};return queueMicrotask(o),n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)}function vs(e,t,n){let r=()=>e.value!==e.defaultValue&&!t().includes(e.value),o=ls(e);if(r()){n();return}if(o===void 0)return;queueMicrotask(()=>{if(e.isConnected&&!r()){if(e.value=o,r())n()}})}Ve();function Pn(){return Ee&&typeof HTMLElement.prototype.showPopover==="function"}function to(e){if(e)return e;if(Ee&&!Pn())return document.body;return null}function we(e=document){let t=e.activeElement;while(t?.shadowRoot?.activeElement)t=t.shadowRoot.activeElement;return t}function On(e){let t=[e],n=e;while(n){let r=n.assignedSlot??n.parentNode??n.host;if(r&&r!==n.parentNode)t.push(r);n=r}return t}function Me(e,t){return On(t).some((n)=>e.contains(n))}var xs;var of;function _t(){if(xs)return xs==="apple";return of??=Ee&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function sf(e){try{return Intl.getCanonicalLocales(e?e.split(/[.@]/)[0].replaceAll("_","-"):[])[0]}catch{}}function Ss(){if(typeof navigator>"u")return;return sf(navigator.languages?.[0]??navigator.language)}var af="abcdefghijklmnopqrstuvwxyz",lf=/\p{Diacritic}/gu,cf=/\p{Script=Latin}/u,uf=/^[\u0000-\u007f]*$/,df=/^(tr|az|lt)\b/i;function ff(e){let t=new Intl.Collator(e,{sensitivity:"base",usage:"search"}),n=df.test(e??"")?(a)=>a.toLocaleLowerCase(e):(a)=>a.toLowerCase(),r=new Map,o=new Map;function i(a){let l=r.get(a);if(l!==void 0)return l;let c=n(a);if(a<"")return r.set(a,c),c;let f=n(a.normalize("NFD").replace(lf,""));if(f.length===a.length&&f!==c&&t.compare(a,f)===0)l=f;else if(cf.test(a))l=[...af].find((p)=>t.compare(a,p)===0);return l??=c.length===a.length?c:a,r.set(a,l),l}function s(a){let l=o.get(a);if(l!==void 0)return l;if(uf.test(a))l=n(a);else{l="";for(let c of a)l+=i(c)}if(o.size>50000)o.clear();return o.set(a,l),l}return{locale:e,fold:s}}var Ut,no=0,ks=!1;function pf(){if(Ut)return Ut;if(!ks&&typeof window<"u"&&typeof window.addEventListener==="function")ks=!0,window.addEventListener("languagechange",()=>{no++,Ut=void 0});return no++,Ut=ff(Ss())}var As=()=>no,_e=(e)=>(Ut??pf()).fold(e);function ro(e){let t=0;while(t<e.length&&e.charCodeAt(t)<=32)t++;return t}var mf=(()=>{let e=new Uint8Array(128);for(let t of" -_/.:,()[]@#")e[t.charCodeAt(0)]=1;return e})(),Tn=(e,t)=>t===0||mf[e.charCodeAt(t-1)]===1;function Es(e,t,n){let r=_e(t.trim());if(!r)return[];let o=_e(e),i=o.indexOf(r);if(n==="startsWith"){let s=ro(o);return o.startsWith(r,s)?[{start:s,end:s+r.length}]:[]}if(i!==-1){let s=n==="fuzzy"?hf(o,r,i):i;return[{start:s,end:s+r.length}]}return n==="fuzzy"?gf(o,r):[]}function hf(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(Tn(e,r))return r;return n}function gf(e,t){let n=[],r=0;for(let o of t){if(o===" ")continue;let i=e.indexOf(o,r);if(i===-1)return[];let s=n.at(-1);if(s&&s.end===i)s.end=i+1;else n.push({start:i,end:i+1});r=i+1}return n}function Cs(e,t){if(!t.length)return[{text:e,match:!1}];let n=[],r=0;for(let{start:o,end:i}of t){if(o>r)n.push({text:e.slice(r,o),match:!1});n.push({text:e.slice(o,i),match:!0}),r=i}if(r<e.length)n.push({text:e.slice(r),match:!1});return n}function $e(e){let t=_e(e),n=t.length;if(!n)return t;let r=t.charCodeAt(0),o=t.charCodeAt(n-1);if(r>32&&r<127&&o>32&&o<127)return t;return t.trim()}function Ps(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Os(e){let t="";for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3)t+=n.nodeValue;else if(n.nodeType===1){let r=n;if(r.hasAttribute("hidden")||r.hasAttribute("aria-hidden")&&r.getAttribute("aria-hidden")==="true")continue;t+=r.firstElementChild?Os(r):r.textContent??""}return t}function yf(e){if(e.hasAttribute("aria-hidden")&&e.getAttribute("aria-hidden")==="true")return"";if(!e.firstElementChild)return e.textContent??"";return Os(e)}function Ts(e){return yf(e).replace(/\s+/g," ").trim()||(e.getAttribute("aria-label")??"")}function Ms(e,t){return t.length===1?e+1:Math.max(e,0)}function Ds(e=500){let t="",n="",r=!1,o;function i(){t="",n="",r=!1,clearTimeout(o)}function s(l,c,f){let p=l.length;for(let u=0;u<p;u++){let m=((f+u)%p+p)%p;if($e(l[m]).startsWith(c))return m}return-1}function a(l,c,f){if(l.length!==1||l===" "&&!t)return-1;clearTimeout(o),o=setTimeout(i,e);let p=$e(l)||l;if(r=p===n&&(r||t.length===1),n=p,t+=p,r){let u=s(c,t,Math.max(f,0));return u!==-1?u:s(c,p,Ms(f,p))}return s(c,t,Ms(f,t))}return Object.assign(a,{reset:i,active:()=>t.length>0})}var Is=(e,t)=>0.09*e.length/t.length;function bf(e,t,n){for(let r=n;r!==-1;r=e.indexOf(t,r+1))if(Tn(e,r))return r;return-1}function vf(e,t){let n=0,r=-2,o=0,i=0;for(let s=0;s<t.length;s++){let a=t.charCodeAt(s);if(a===32)continue;let l=a>=55296&&a<=56319&&s+1<t.length?t.slice(s,++s+1):t[s],c=e.indexOf(l,n);if(c===-1)return 0;if(i++,Tn(e,c))o+=1;if(c===r+1)o+=1;r=c,n=c+1}if(!i)return 0;return 0.1+0.4*o/(2*i)}function Ls(e,t){if(e===t)return 1;let n=e.indexOf(t);if(n===0)return 0.9+Is(t,e);if(n>0)return(bf(e,t,n)!==-1?0.75:0.6)+Is(t,e);return vf(e,t)}var Fs,Rs=-1,$s="";function wf(e){let t=As();if(e!==Fs||t!==Rs)Fs=e,Rs=t,$s=$e(e);return $s}function Ns(e,t){let n=wf(t);if(!n)return 1;let r=Ls($e(e.label),n),o=e.keywords;if(o)for(let i=0;i<o.length;i++){let s=Ls($e(o[i]),n)*0.95;if(s>r)r=s}return r}function Dn(e,t,n,r){if(t==="first")return 0;if(t==="last")return n-1;let o=e+t;if(r)return(o%n+n)%n;return Math.max(0,Math.min(n-1,o))}function Ws(e,t,n,r,o=0,i=0){if(n-o<e)return Math.max(0,n-o);if(n+r+i>e+t)return Math.max(0,n+r+i-t);return e}function kt(e){return typeof e==="string"?{value:e,label:e}:e}var In=(e)=>typeof e==="object"&&("type"in e)&&e.type==="group",Ln=(e)=>typeof e==="object"&&("type"in e)&&e.type==="separator";function Vs(e,t){for(let n=e.parentElement;n;n=n.parentElement){let r=getComputedStyle(n);if(/(auto|scroll)/.test(r.overflowY)&&n.scrollHeight>n.clientHeight){let o=n.getBoundingClientRect(),i=n.offsetHeight,s=i>0&&o.height>0&&Math.abs(i-o.height)>0.5?i/o.height:1,a=(e.getBoundingClientRect().top-o.top)*s-n.clientTop+n.scrollTop,l=parseFloat(r.scrollPaddingTop)||0,c=parseFloat(r.scrollPaddingBottom)||0,f=Ws(n.scrollTop,n.clientHeight,a,e.offsetHeight,l,c),p=Math.min(f,n.scrollHeight-n.clientHeight);if(p!==n.scrollTop)n.scrollTop=p;return}if(n===t)return}}function qs(e,t){let{store:n}=e,r=typeof e.focus==="function"?e.focus:()=>e.focus,o=us(),i=new Map,s=Ds(),a=new Set,l,c,f,p,u=0,m=0,g=(h,E)=>{let C=e.toKey(h.value),j=!!h.disabled;return{key:C,value:h.value,label:h.label,keywords:h.keywords,get disabled(){return j||!!o.get(C)?.meta().disabled},group:E}};function A(h){let E=[];for(let C=0;C<h.length;C++){let j=h[C];if(Ln(j))continue;if(In(j)){let Y=`group-${C}`;for(let G=0;G<j.items.length;G++)E.push(g(kt(j.items[G]),Y));continue}E.push(g(kt(j)))}return E}let d=(h,E)=>{if(E?.data===h)return E;let C=A(h),j=new Map;for(let Y=0;Y<C.length;Y++)j.set(C[Y].key,C[Y]);return{data:h,flat:C,byKey:j}},b,v;function y(h,E){if(b!==h){b=h,v=new Map;for(let C=0;C<h.length;C++){let j=h[C].key;if(!v.has(j))v.set(j,C)}}return v.get(E)??-1}function I(){let h=e.items();if(!h)return;return l=d(h,l)}function T(){let h=e.emptyItems?.();return h&&(c=d(h,c))}function B(){if(!e.items()||!(e.showEmpty?.()??!e.query().trim()))return;return T()}function X(h){return I()?.byKey.get(h)??T()?.byKey.get(h)}function F(){let h=B()??I();if(!h)return;let E=e.query(),C=e.filter(),j=e.rank?.()??!1;if(f?.data!==h.data||f.query!==E||f.filter!==C||f.rank!==j){let Y=t.data(h.data,E,C,{rank:j});f={data:h.data,query:E,filter:C,rank:j,list:Y,flat:Y===h.data?h.flat:A(Y)}}return f}function H(h,E){let C=o.get(h)?.el;if(!C||C===E||!C.isConnected)return;let j=E.getAttribute("data-slot")??"";Ae(`Two items have the value "${h}". Give each item its own value, or arrow keys skip one and choosing it picks the other.`,{component:j.replace(/-item$/,"")||"listbox"})}function U(h,E){let C=E.meta(),j=C.label??Ts(E.el);if(C.pinned)return j;let Y=i.get(h);if(Y?.label!==j)i.set(h,{...Y,label:j,value:C.value}),u++;return j}function te(h,E){let C=E.meta();return{key:h,value:C.value,label:U(h,E),keywords:C.keywords,get disabled(){return!!E.meta().disabled},group:C.group,pinned:C.pinned}}let Z=new Map,re=new Set,ce=new Set,ae=(h,E)=>!!I()||x(h,E);function q(h,E){if(Z.set(h,E),E.index!==void 0)re.add(h);else if(re.size)re.delete(h);let C=ae(h,E);if(!C)ce.add(h);else if(ce.size)ce.delete(h);return C}function x(h,E){let C=o.get(h),j=E.label??(C?U(h,C):i.get(h)?.label)??(typeof E.value==="string"?E.value:"");return t.matches({value:E.value,label:j,keywords:E.keywords},e.query(),e.filter())}function S(h){if(!a.size)return h;let E=h.length?o.get(h[0].key)?.el:void 0,C=[],j=[];for(let Y of a){let G=o.get(Y);if(!G?.el.isConnected)continue;(!!E?.isConnected&&Fe(G.el,E)?C:j).push(te(Y,G))}return C.length||j.length?[...C,...h,...j]:h}function M(){let h=o.list(),E=e.query(),C=e.filter();if(p?.order===h&&p.query===E&&p.filter===C&&p.version===u)return p.list;let j=C!==!1&&C!==void 0&&!!E.trim(),Y=[];for(let G=0;G<h.length;G++){let pe=h[G],ye=te(pe.key,pe);if(!j||ye.pinned||t.matches({value:ye.value,label:ye.label,keywords:ye.keywords},E,C))Y.push(ye)}return p={order:h,query:E,filter:C,version:u,list:Y},Y}function _(){let h=F();if(h)return S(h.flat);return M()}let N=(h)=>h.disabled||!!e.blocked?.(h);function Q(h){if(h===null)return;let E=X(h);if(E)return E;let C=o.get(h);if(C)return te(h,C);let j=i.get(h);if(j)return{key:h,value:j.value,label:j.label,disabled:!1}}function ne(h,E){if(r()==="real"&&E&&e.active())h.focus({preventScroll:!0});if(e.keepInView?.()!==!1)Vs(h,(e.scrollRoot??e.container)?.())}let ee=null;function fe(h,{focus:E=!0,event:C}={}){if(n.set({highlighted:h}),e.onHighlight||e.onLastReached){let Y=_(),G=h===null?-1:y(Y,h);if(e.onHighlight?.(h,G,C),e.onLastReached&&G!==-1){let pe=Y.length-1;if(e.skipDisabled)while(pe>0&&Y[pe].disabled)pe--;if(G===pe)e.onLastReached()}}if(h===null)return;let j=o.get(h)?.el;if(j?.isConnected)ee=h,ne(j,E)}function ue(h,{loop:E=e.loop()&&Math.abs(Number(h))===1}={}){let C=_(),j=C.length;if(!j)return;let Y=n.get().highlighted;if(!e.skipDisabled){let V=Y===null?-1:y(C,Y);if(V!==-1||typeof h!=="number")return C[Dn(V,h,j,E)].key;return C[h>0?0:j-1].key}if(h==="first"){for(let V=0;V<j;V++)if(!C[V].disabled)return C[V].key;return}if(h==="last"){for(let V=j-1;V>=0;V--)if(!C[V].disabled)return C[V].key;return}let G=Y===null?-1:y(C,Y);if(G===-1){if(h>0){for(let V=0;V<j;V++)if(!C[V].disabled)return C[V].key}else for(let V=j-1;V>=0;V--)if(!C[V].disabled)return C[V].key;return}if(h===1){for(let V=G+1;V<j;V++)if(!C[V].disabled)return C[V].key;if(E){for(let V=0;V<=G;V++)if(!C[V].disabled)return C[V].key;return}if(!C[G].disabled)return C[G].key;for(let V=0;V<G;V++)if(!C[V].disabled)return C[G].key;return}if(h===-1){for(let V=G-1;V>=0;V--)if(!C[V].disabled)return C[V].key;if(E){for(let V=j-1;V>=G;V--)if(!C[V].disabled)return C[V].key;return}if(!C[G].disabled)return C[G].key;for(let V=G+1;V<j;V++)if(!C[V].disabled)return C[G].key;return}let pe=[],ye=-1,W=0;for(let V=0;V<j;V++)if(!C[V].disabled){if(V===G)ye=pe.length;else if(V<G)W++;pe.push(C[V])}if(!pe.length)return;if(ye!==-1)return pe[Dn(ye,h,pe.length,E)].key;if(!E&&W===(h>0?pe.length:0))return C[G].key;return pe[Dn(h>0?W-1:W,h,pe.length,E)].key}function le(h,E){let C=ue(h);if(C!==void 0)fe(C,{event:E})}function z(h,E){let C=_().filter((Y)=>!Y.pinned),j=s(h,C.map((Y)=>N(Y)?"":Y.label),C.findIndex((Y)=>Y.key===E));return j===-1?void 0:C[j]}function k(h){let E=h.ownerDocument;return!E.activeElement||E.activeElement===E.body}let L,D;function w(h){if(typeof MutationObserver>"u")return;if(!L)L=new MutationObserver(O);if(!D)D=new WeakSet;if(!D.has(h))D.add(h),L.observe(h,{childList:!0})}function O(){let h=n.get().highlighted,E=h===null?void 0:o.get(h)?.el;if(E?.isConnected&&k(E))ne(E,!0)}let P,R;function K(){let h=P;if(P=void 0,!h)return;for(let E=0;E<h.length;E++){let C=h[E];if(o.get(C.key)!==C||!C.el.isConnected)continue;if(U(C.key,C),n.get().highlighted===C.key&&ee!==C.key)ee=C.key,ne(C.el,!1);if(C.el.parentNode)w(C.el.parentNode)}}function J(){let h=R;if(R=void 0,!h)return;for(let E=0;E<h.length;E++)de(h[E][0],h[E][1])}function oe(h,E){let C=()=>n.get().highlighted===h&&e.active();if(r()!=="real"||!C()||E.ownerDocument.activeElement===E)return;queueMicrotask(()=>{if(C()&&E.isConnected)ne(E,!0)})}function ie(h,E,C){if(m++,he)H(h,E);let j={key:h,el:E,meta:C},Y=o.add(j),G=C();if(G.index!==void 0)re.add(h);if(G.pinned)a.add(h);else{let pe=i.get(h);if(G.label!==void 0&&pe?.label!==G.label)u++;i.set(h,{...pe,label:G.label??pe?.label??"",value:G.value,keywords:G.keywords,group:G.group})}if(!P)P=[j],queueMicrotask(K);else P.push(j);return e.onRegister?.(h),oe(h,E),()=>{if(o.get(h)!==j)return;if(Y(),m++,a.delete(h),!o.size())L?.disconnect(),D=void 0;if(e.onRegister?.(h),!R)R=[[h,E]],queueMicrotask(J);else R.push([h,E])}}function de(h,E){if(o.get(h)||X(h)||n.get().highlighted!==h)return;if(n.set({highlighted:null}),e.onHighlight?.(null,-1),r()==="real"&&e.active()&&k(E))e.container?.()?.focus({preventScroll:!0})}return{entries:_,visibleData:F,dataItems:()=>I()?.flat,find:Q,disabled:N,isItemDisabled:(h)=>!!Q(h)?.disabled,highlight:fe,move:le,stepKey:ue,firstEnabled:()=>_().find((h)=>!h.pinned&&!N(h))?.key,search:z,register:ie,typing:()=>s.active(),resetTyping:()=>s.reset(),labelOf(h){let E=X(h);if(E)return E.label;let C=o.get(h);if(C)return U(h,C);return i.get(h)?.label},valueOf(h){let E=X(h);if(E)return E.value;return o.get(h)?.meta().value??i.get(h)?.value},matches:q,listing(h,E,C){let j=!I()&&!!e.query().trim();if(!j&&(!h||E!==void 0)){if(!re.size&&(!E||!E.length))return xf;let ge={};if(re.size){let me=String(_().length),Se=E?.length?new Set(E):void 0;for(let ke of re)if((Z.get(ke)??o.get(ke)?.meta())?.index!==void 0)ge[ke]=Se?.has(ke)?`${me}s`:me;else re.delete(ke)}if(E)for(let me=0;me<E.length;me++){let Se=E[me];if(typeof ge[Se]!=="string")ge[Se]="s"}return ge}let Y={},G=new Set,pe,ye=j?new Set(M().map((ge)=>ge.key)):void 0,W=(ge,me,Se)=>{if(G.has(ge))return;G.add(ge);let ke=o.get(ge),Le=Se?me:ke?.meta()??me,xn=!ye||ye.has(ge)||!ke?.el.isConnected&&x(ge,Le)?"":"-";if(Le.index!==void 0)xn+=pe??=_().length;if(h)xn+=h(ge,Le.value);if(xn||ce.size&&ce.delete(ge)&&typeof C?.[ge]!=="string")Y[ge]=xn};for(let[ge,me]of Z)W(ge,me,!0);for(let[ge,me]of i)W(ge,me,!1);let V=I()?.flat;if(V)for(let ge=0;ge<V.length;ge++){let me=V[ge];W(me.key,me,!1)}let ve=T()?.flat;if(ve)for(let ge=0;ge<ve.length;ge++){let me=ve[ge];W(me.key,me,!1)}return Y},listingInputs:()=>[e.items()?a.size:m,e.items()?0:u,e.query(),e.filter(),e.items(),e.emptyItems?.(),e.showEmpty?.(),e.rank?.()],selectable(h){let E=[];for(let C of _()){if(C.pinned||C.disabled)continue;if(h!==void 0&&(o.get(C.key)?.meta().group??C.group)!==h)continue;E.push(C.key)}return E},count(){let h=0;for(let E of _())if(!E.pinned)h++;return h},groupMatches(h){if(I()||!e.query().trim())return!0;return o.list().some((E)=>E.meta().group===h&&x(E.key,E.meta()))},element:(h)=>o.get(h)?.el,labelsVersion:()=>u,remember(h,E,C,j){let Y=i.get(h),G=Y?.keywords,pe=Y?.label===E&&(!j||G?.length===j.length&&j.every((ye,W)=>ye===G[W]));if(Y&&pe){if(Y.value!==C)i.set(h,{...Y,value:C});return}i.set(h,{...Y,label:E,value:C,...j&&{keywords:j}}),u++}}}var xf=Object.freeze({}),Hs=(e,t)=>e.entries().find((n)=>n.key===t&&!n.pinned&&!e.disabled(n));function oo(e,t,n){if(t===n||t!==null&&!Hs(e,t))return!1;return e.highlight(t),!0}function io(e,t){let n=e.find(t);return n&&!n.pinned?n.value??null:null}function Fn(e,t,n){let r=_e(e);return n==="startsWith"?r.startsWith(t,ro(r)):r.includes(t)}function so(e,t,n){if(Fn(e.label,t,n))return!0;let r=e.keywords;if(r){for(let o=0;o<r.length;o++)if(Fn(r[o],t,n))return!0}return!1}function Sf(e,t,n){if(n===!1||n===void 0||!t.trim())return 1;if(typeof n==="function"){let o=n(e,t);return typeof o==="number"?Math.max(0,o):o?1:0}let r=_e(t.trim());return!r||so(e,r,n)?1:0}function kf(e,t,n){return Sf(e,t,n)>0}function Af(e,t,n,{rank:r=!1}={}){if(n===!1||n===void 0)return e;let o=t.trim();if(!o)return e;if(r)return Ef(e,t,o,n);let i=typeof n==="function"?"":_e(o);if(typeof n!=="function"&&!i)return e;let s=(f)=>{if(typeof n==="function"){let p=n(kt(f),t);return typeof p==="number"?p>0:!!p}return typeof f==="string"?Fn(f,i,n):so(f,i,n)},a=[],l,c=(f)=>{if(l&&a.length)a.push(l);l=void 0,a.push(f)};for(let f=0;f<e.length;f++){let p=e[f];if(Ln(p)){l=p;continue}if(In(p)){let u=[];for(let m=0;m<p.items.length;m++){let g=p.items[m];if(s(g))u.push(g)}if(u.length)c({...p,items:u});continue}if(s(p))c(p)}return a}var js=(e,t)=>t.score-e.score;function Ef(e,t,n,r){let o=typeof r==="function"?"":_e(n),i=(u)=>{if(typeof r==="function"){let m=r(kt(u),t);return typeof m==="number"?Math.max(0,m):m?1:0}if(!o)return 1;return(typeof u==="string"?Fn(u,o,r):so(u,o,r))?1:0},s=[],a=!0,l=1/0,c,f=(u,m)=>{if(m>l)a=!1;l=m,s.push({entry:u,score:m,separator:s.length?c:void 0}),c=void 0};for(let u=0;u<e.length;u++){let m=e[u];if(Ln(m)){c=m;continue}if(In(m)){let A=[],d=!0,b=1/0;for(let y=0;y<m.items.length;y++){let I=m.items[y],T=i(I);if(T>0){if(T>b)d=!1;b=T,A.push({entry:I,score:T})}}if(!A.length)continue;if(!d)A.sort(js);let v=[];for(let y=0;y<A.length;y++)v.push(A[y].entry);f({...m,items:v},A[0].score);continue}let g=i(m);if(g>0)f(m,g)}if(!a){s.sort(js);let u=[];for(let m=0;m<s.length;m++)u.push(s[m].entry);return u}let p=[];for(let u=0;u<s.length;u++){let m=s[u];if(m.separator)p.push(m.separator);p.push(m.entry)}return p}var Cf={data:Af,matches:kf};function Ks(e){return qs(e,Cf)}function Bs(e,t){return(n)=>{if(n===null)return;if(n==="false")return!1;return e.includes(n)?n:t}}var zs=10;function ao(e,{apple:t}){let{key:n}=e;if(n==="ArrowDown")return e.metaKey?"last":1;if(n==="ArrowUp")return e.metaKey?"first":-1;if(n==="PageDown")return zs;if(n==="PageUp")return-zs;let r=t&&e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey;if(r&&n==="n")return 1;if(r&&n==="p")return-1}function _s(e,{listbox:t,highlighted:n,choose:r,focusInput:o}){let i=e.key==="Home"?"first":e.key==="End"?"last":ao(e,{apple:_t()});if(i!==void 0)return e.preventDefault(),t.move(i,e);if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),n===null)return;let s=t.element(n);if(e.key==="Enter"&&s?.matches("a[href]"))return s.click();return r(n,e)}if(Ps(e))o()}var Rn=new WeakMap;function Us(e,t){let n=Rn.get(e);if(!n)Rn.set(e,n=[]);n.push(t)}function lt(e,t,n){Us(e.store,{from:"options",keys:t,derive:n})}function Ys(e,t,n,{live:r=!0}={}){let{store:o}=e;Us(o,{from:"state",keys:t,derive:n}),o.subscribe((i)=>{if(i&&!r)return;let s=n(o.get());if(s)o.set(s)})}function Xs(e,t,n,r){let o=Rn.get(e);if(!o)return n;let i=n??{},s=!n,a=!!n;for(let l=0;l<o.length;l++){let c=o[l];if(!n&&c.from==="state")continue;let f=a?{...r,...i}:r,p=c.from==="state"?e.view(f,()=>c.derive(f)):c.derive(i,r,t);if(!p&&c.from==="options")continue;if(!s)i={...i},s=!0;for(let u=0;u<c.keys.length;u++){let m=c.keys[u];if(p&&m in p)i[m]=p[m],a=!0;else if(c.from==="state")i[m]=f[m],a=!0}}return a?i:void 0}var Gs=(e)=>Rn.has(e);var Qs=new WeakSet;function Oe(e,t){if(Object.is(e,t))return!0;if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;if(Qs.has(e)||Qs.has(t))return!1;return e.every((n,r)=>Object.is(n,t[r]))}function Js(e,t){let n=e,r,o,i=!1,s,a=new Set,l=new Map,c,f={state:e,renders:0,writes:0,touch:()=>m([],n,!1,!1),skipping:l},p={get(){return s??u()},set(g,A=!1){if(r&&!A&&!i){let y=u();if(y!==n){let I={...y};for(let T in g)delete I[T];p.set(I,!0)}}let d;for(let y in g)if(!Oe(n[y],g[y]))(d??=[]).push(y);if(!d)return;let b=n;n={...n,...g},f.state=n;let v=t.length>0;if(v){for(let y=0;y<d.length;y++)if(!t.includes(d[y])){v=!1;break}}m(d,b,v,A)},subscribe(g){return a.add(g),()=>{a.delete(g)}},setFanout(g){c=g},follow(g){r=g},view(g,A){let d=s;s=g;try{return A()}finally{s=d}}};function u(){if(!r||i)return n;i=!0;let g;try{g=r(n)}finally{i=!1}if(!g)return n;if(o?.state===n&&o.over===g)return o.result;let A=n;for(let d in g)if(!Oe(n[d],g[d])){A={...n,...g};break}return o={state:n,over:g,result:A},A}function m(g,A,d,b){if(!d)f.renders++;if(!b)f.writes++;for(let v of a)v(d,b,g);for(let[v,y]of l){let I=!g.length;if(!I){for(let T=0;T<g.length;T++)if(!Object.hasOwn(v,g[T])){I=!0;break}}if(I)for(let T of y)T(d,b,g)}c?.(g,A,d,b)}return ct.set(p,f),p}var ct=new WeakMap;function $n(e,t,n){return Mf(ct.get(e).skipping,t,n)}function Mf(e,t,n){let r=e.get(t);if(!r)e.set(t,r=new Set);return r.add(n),()=>{if(r.delete(n),!r.size&&e.get(t)===r)e.delete(t)}}var Yt=(e)=>ct.get(e).state;var Nn=(e)=>ct.get(e).renders,Zs=(e,t)=>{ct.set(e,ct.get(t))},ea=(e)=>ct.get(e).touch();var ta={};function na(e,t,n){let r;Ys({store:e},["listing"],(o)=>{let i=[...t.listingInputs(),...n?.inputs()??[]];if(!r||!Oe(i,r.inputs)){let s=t.listing(n?.entry,n?.selectedKeys?.(),o.listing);r={inputs:i,listing:Pf(o.listing,s)?o.listing:s}}return{listing:r.listing}},{live:!1})}function Pf(e,t){for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(typeof e[n]!=="string")return!1;return!0}var lo=new WeakMap;function Wn(e,t){let n=lo.get(e);if(n)return void n.push(t);let r=[t];lo.set(e,r),Xe(()=>{lo.delete(e);let o={};for(let i of r)i(o);e.set(o)})}function ra(e,t,n){let r=(s)=>Wn(e,(a)=>{a[t]=s(a[t]??e.get()[t])}),o=!0,i=!1;return r((s)=>{if(!o)return s;return i=!0,[...s,n]}),()=>{o=!1,r((s)=>{if(!i)return s;let a=s.indexOf(n);return a===-1?s:s.filter((l,c)=>c!==a)})}}function Vn(e,t,{now:n=!1}={}){let r=(o)=>n?e.set({[t]:o}):Wn(e,(i)=>i[t]=o);return r(!0),()=>r(!1)}function Of(e,t){let n=e.getAttribute("aria-labelledby");if(n&&n!==`${t}-label`)return{labelledBy:n};let r=[...e.labels??[]].map((i)=>i.id).filter(Boolean);if(r.length)return{labelledBy:r.join(" ")};let o=e.getAttribute("aria-label");return o?{label:o}:null}function oa(e,t,n){Wn(t,(r)=>{let o=Of(e,n);if(JSON.stringify(o)!==JSON.stringify(t.get().fieldName))r.fieldName=o})}function co(e,t){let n=e.labeled?null:e.fieldName;return{"aria-labelledby":e.labeled?`${t}-label`:n&&("label"in n)?void 0:n?.labelledBy??`${t}-input`,"aria-label":n&&"label"in n?n.label:void 0}}Ve();De();var qn=new WeakMap;function Hn(e,t){qn.get(e)?.();let n=At.delete(e)?[]:e.getAnimations?.({subtree:!0}).filter(ca),r=n?.every((a)=>ho(a)!==e);if(e.setAttribute("data-starting-style",""),n&&r){for(let a of e.getAnimations?.({subtree:!0})??[])if(ca(a)&&!n.some((l)=>If(a,l)))a.finish()}let o,i,s=requestAnimationFrame(()=>i=setTimeout(()=>{if(e.removeAttribute("data-starting-style"),t)o=fa(e,t)}));return()=>{cancelAnimationFrame(s),clearTimeout(i),o?.(),e.removeAttribute("data-starting-style")}}var ca=(e)=>("transitionProperty"in e),ho=(e)=>e.effect?.target,If=(e,t)=>ho(e)===ho(t)&&e.transitionProperty===t.transitionProperty;function ua(e){return e.split(",").map((t)=>{let n=parseFloat(t)||0;return t.trim().endsWith("ms")?n/1000:n})}function Lf(e){return Math.max(da(getComputedStyle(e)),da(getComputedStyle(e,"::backdrop")))}function da(e){let t=(n,r,o="1")=>{let i=ua(n),s=ua(r),a=o.split(",").map((l)=>l.trim()==="infinite"?1:parseFloat(l)||1);return i.map((l,c)=>(l*(a[c%a.length]??1)+(s[c%s.length]??0))*1000)};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function Ff(e){let t=0;for(let n of e){let r=n.effect?.getComputedTiming(),o=Number(r?.endTime);if(!r||!Number.isFinite(o))continue;t=Math.max(t,o-(Number(r.localTime)||0))}return t}var Rf=(e)=>!e.timeline||!("source"in e.timeline);function fa(e,t){let n=!1,r=e.getAnimations({subtree:!0}).filter(Rf),o=()=>{if(n)return;n=!0,clearTimeout(i),t()},i=r.length?setTimeout(o,Math.max(Lf(e),Ff(r))+50):void 0;if(!r.length)ts(o);else Promise.allSettled(r.map((s)=>s.finished)).then(o);return()=>{n=!0,clearTimeout(i)}}function go(e,t){e.toggleAttribute("data-open",t),e.toggleAttribute("data-closed",!t)}function pa(e,t){let n=e.length,r=!1,o=[],i=e.map((s)=>$f(s,(a,l)=>{if(o.push(a),r||=l,--n>0)return;o.forEach((c)=>c(r)),t()}));return()=>i.forEach((s)=>s())}function $f(e,t){qn.get(e)?.(),e.removeAttribute("data-starting-style"),e.setAttribute("data-ending-style","");let n=e.hasAttribute("inert");e.setAttribute("inert","");let r=e.ownerDocument?.defaultView?.MutationObserver,o=!1,i=r&&new r(()=>o=!0);i?.observe(e,{attributeFilter:["inert"]});let s=0,a=()=>{if(cancelAnimationFrame(s),qn.delete(e),e.removeAttribute("data-ending-style"),o||=!!i?.takeRecords().length,i?.disconnect(),!o)e.toggleAttribute("inert",n)},l=(p)=>{if(!p)return a();qn.set(e,a),s=requestAnimationFrame(()=>{s=requestAnimationFrame(a)})},c=!1,f=fa(e,()=>t(l,c));return c=!0,()=>{f(),a()}}function ut(e){return{"data-open":e?"":void 0,"data-closed":e?void 0:""}}var Nf=/[\s%]/;function Et(e){return Nf.test(e)?e.replace(/[\s%]/g,encodeURIComponent):e}var jn=["ArrowDown","ArrowUp","PageDown","PageUp","ctrl+n","ctrl+p"],Kn=(e)=>Re(e)||e.readOnly,Bn=(e)=>({"data-disabled":Re(e)?"":void 0,"data-readonly":e.readOnly?"":void 0,"data-required":e.required?"":void 0});function Wf(e,t,n){let r=e.ownerDocument.createDocumentFragment(),o=()=>{if(t()&&r.childNodes.length)e.append(r);else if(!t()&&e.childNodes.length)r.append(...Array.from(e.childNodes))};o();let i=n(o);return()=>{if(i(),r.childNodes.length)e.append(r)}}function ma(e,t,n,r=()=>!1){if(!Ee)return;setTimeout(()=>{if(!e.isConnected||r()||e.getAttribute("aria-labelledby")||e.getAttribute("aria-label")||Cn(e).length)return;Ae(t,n)},300)}function ha(e,t){if(e===void 0)return{};return{"aria-posinset":String(e+1),"aria-setsize":String(t.entries().length)}}function ga(e,{api:t,key:n,props:r}){return t.internal.listbox.register(n,e,()=>{let o=t.internal.itemProps(n)??r;return{value:o.value,label:o.label,keywords:o.keywords,disabled:o.disabled,group:o.group,index:o.index}})}function ya(){return{props:{id:"id"},role:"group",attrs:(e,{id:t,key:n,api:r})=>({"aria-labelledby":Vf(e,t,n),hidden:r.internal.listbox.groupMatches(n)?void 0:""})}}var Vf=(e,t,n)=>e.groupLabels.includes(n)?`${t}-group-${Et(n)}`:void 0;function ba(){return{role:"none",attrs:(e,{api:t})=>({"aria-hidden":"true",hidden:t.internal.filterQuery()&&!e.items?"":void 0})}}function va(){let e=(t,n)=>n.internal.isEmpty(t);return{props:{stash:"boolean"},state:(t,{api:n})=>({loading:t.status==="loading",empty:e(t,n),query:t.query}),role:"status",attrs:(t,{api:n})=>({"aria-live":"polite","aria-atomic":"true","data-empty":e(t,n)?"":void 0,"data-loading":t.status==="loading"?"":void 0}),bind(t,{api:n,store:r,props:o}){if(o.stash)return Wf(t,()=>e(r.get(),n),r.subscribe)}}}function wa(){return{state:(e,{api:t})=>({status:e.status,loading:e.status==="loading",count:t.internal.itemCount()}),role:"status",attrs:(e)=>({"aria-live":"polite","aria-atomic":"true","data-loading":e.status==="loading"?"":void 0})}}function xa(){return{props:{id:{kind:"string",from:"group.id",required:!0},group:{kind:"string",from:"group.id",required:!0}},attrs:(e,{id:t,props:n})=>({id:`${t}-group-${Et(n.group)}`}),bind:(e,{store:t,props:n})=>ra(t,"groupLabels",n.group)}}function Sa(){return{state:(e)=>({open:e.open}),attrs:(e)=>({"aria-hidden":"true",...ut(e.open)}),bind(e,{api:t}){t.internal.popup.checkPlacement()}}}Ma();var vo="pointer",yo=!1,Pa=!1,Oa=!1,Ta=!1,wo=!1,Qt="mouse",bo=!1,Hf=()=>bo=!1,zn=null,jf=()=>zn=null;function La(e){if(e.key!=="Enter"&&e.key!==" ")return;zn=e.target,setTimeout(jf)}function Kf(e){La(e),wo=!1;let t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);if(e.key==="Tab"||!t)vo="keyboard"}function Da(e){if(vo="pointer",wo=!1,!("pointerType"in e)){if(!bo)Qt="touch";return}bo=!0,setTimeout(Hf);let t=e.pointerType;Qt=Fa(e)?"virtual":t==="touch"||t==="pen"?t:"mouse"}function _n(){if(yo||typeof document>"u")return;yo=!0,document.addEventListener("keydown",Kf,!0),document.addEventListener("keyup",La,!0),document.addEventListener("pointerdown",Da,!0),document.addEventListener("touchstart",Da,{capture:!0,passive:!0}),window.addEventListener("blur",(e)=>{if(e.target===window)wo=!0})}function Un(){if(yo||Pa)return;Pa=!0,queueMicrotask(_n)}function Fa(e){if(e.type==="pointermove")return!1;if(e.width===0&&e.height===0&&e.pressure===0)return!0;return e.pointerType==="mouse"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}function Bf(e){if(e.detail>0)return Qt;return!!zn&&zn.contains(e.target)?"keyboard":"virtual"}var Ia=()=>vo==="keyboard"?"keyboard":Qt;function Ge(e){if(_n(),!e)return Ia();if(!An(e))return"programmatic";if(e.type.startsWith("key"))return"keyboard";if(e.type.startsWith("touch"))return"touch";if(e.type==="click")return Bf(e);let t=e.pointerType;if(t==="mouse"||t==="touch"||t==="pen")return Fa(e)?"virtual":t;if("button"in e)return Qt;return Ia()}function Yn(e){_n(),Oa=!0;try{e.focus({preventScroll:!0})}finally{Oa=!1}}function xo(e){_n(),Ta=!0;try{e.focus({preventScroll:!0})}finally{Ta=!1}}var Ra=(e)=>e==="pointer"||e==="touch"?"pointer":"keyboard";function $a(e,t,n=()=>[]){let r=t,o,i=(f)=>{if(r=f,e.getAttribute("data-modality")!==f)e.setAttribute("data-modality",f)};i(t);let s=(f)=>{if(f.metaKey||f.ctrlKey||/^(Meta|Control|Alt|Shift)$/.test(f.key))return;i("keyboard")},a=()=>i("pointer"),l=(f)=>{let p={x:f.clientX,y:f.clientY},u=o&&Math.hypot(p.x-o.x,p.y-o.y)>2;if(o=p,u&&r!=="pointer")i("pointer")},c=[e,...n().filter((f)=>!!f)];for(let f of c)f.addEventListener("keydown",s,!0);return e.addEventListener("pointerdown",a,!0),e.addEventListener("pointermove",l,!0),()=>{for(let f of c)f.removeEventListener("keydown",s,!0);e.removeEventListener("pointerdown",a,!0),e.removeEventListener("pointermove",l,!0),e.removeAttribute("data-modality")}}function zf(e){if(e.type==="removed")return`${e.label} removed`;if(e.loading)return"Loading";if(!e.count)return"No results";return e.count===1?"1 result":`${e.count} results`}function Na(e){return e==="contains"||e==="startsWith"||e==="fuzzy"?e:void 0}var _f=(e)=>({segments:[{text:e,match:!1}],matched:!1});function Wa(){let e=new WeakMap,t=(n,r,o)=>{let{matchQuery:i,matchMode:s}=n.internal,a=s()?i():"",l=e.get(n);if(!l)e.set(n,l=new Map);let c=l.get(r);if(c&&c.text===o&&c.query===a)return c.state;let f=a.trim()?Es(o,a,s()):[],p=f.length?{segments:Cs(o,f),matched:!0}:c&&!c.state.matched&&c.text===o?c.state:_f(o);return l.set(r,{text:o,query:a,state:p}),p};return{props:{text:"string",write:"boolean",id:"id"},state:(n,{api:r,key:o,props:i})=>t(r,o,i.text),attrs:(n,{api:r,key:o,props:i})=>({"data-matched":t(r,o,i.text).matched?"":void 0}),bind(n,{api:r,key:o,props:i,store:s}){if(!i.write)return;let a,l=()=>{let f=t(r,o,i.text);if(f===a)return;a=f,n.replaceChildren(...f.segments.map(({text:p,match:u})=>{if(!u)return p;let m=n.ownerDocument.createElement("mark");return m.textContent=p,m}))};l();let c=s.subscribe(l);return()=>{c(),n.textContent=i.text}}}}var Va=(e)=>!!e&&An(e)&&Ge(e)==="virtual",Uf=500;function qa({store:e,query:t,count:n,loading:r,shown:o,silent:i,announcement:s}){let a,l=t(),c=r(),f=!1,p=()=>{if(a=void 0,!o()||i()||!t().trim())return;let u={type:"results",count:n(),query:t(),loading:r()},m=(s()??zf)(u);if(m)Ca(m);f=u.loading};e.subscribe(()=>{let u=t(),m=r(),g=u!==l,A=c&&!m&&f;if(l=u,c=m,!g&&!A)return;clearTimeout(a),a=setTimeout(p,Uf)})}function Ha({count:e,status:t,onLoadMore:n}){let r=-1;function o(){let s=n(),a=t();if(!s||a==="loading")return;if(e()===r&&a!=="error")return;r=e(),s()}function i(s){let a=(l)=>{let c=l.target;if(!(c instanceof HTMLElement))return;if(c.scrollTop+c.clientHeight>=c.scrollHeight-40)o()};return s.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>s.removeEventListener("scroll",a,{capture:!0})}return{reached:o,bind:i}}De();Pe();var Xn=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),ja=new WeakMap;function Yf(e){let t=ja.get(e);if(t)return t;let n={selectors:new Map,selecting:new Map};return ja.set(e,n),e.setFanout((r,o,i,s)=>{let a=e.get(),l=r,c,f=(p)=>{let u=c?.get(String(p));if(typeof u==="function")u(i,s,l);else if(u)for(let m of u)m(i,s,l)};for(let p=0;p<r.length;p++){let u=r[p],m=n.selecting.get(u);if(!m)continue;c=n.selectors.get(u);let g=o[u];for(let[A,{naming:d}]of m)if(A(g,a[u],f)===!0)for(let b of d)b(i,s,l)}}),n}function Xf(e){if(typeof e==="string")return`s${e.length}:${e}`;if(typeof e==="number")return`n:${e}`;if(typeof e==="boolean")return e?"t":"f";if(e===null)return"0";if(e===void 0)return"u";return`o:${String(e)}`}function Ba(e){let t=Object.entries(e).filter(([,s])=>Xn(s)||typeof s==="function"||s.length>0),n=(s,a)=>Xn(s)?s.values(a):typeof s==="function"?s(a):s,r=(s)=>{let a=e[s];return Xn(a)?a.moved:So},o=(s)=>{let a=`${s.length}:`;for(let l=0;l<s.length;l++){if(l)a+=",";a+=Xf(s[l])}return a},i=!t.length?"":t.every(([,s])=>Array.isArray(s))?t.map(([s,a])=>`${String(s)}=${o(a)}`).join("|"):void 0;return{reading(s,a,l){let c=Object.hasOwn(e,l)?e[l]:void 0;if(c===void 0||Xn(c))return;let f=typeof c==="function"?c(qe(s,a)):c;return f},selection(s,a){if(i!==void 0)return i;let l=qe(s,a),c="";for(let f=0;f<t.length;f++){let[p,u]=t[f];if(f)c+="|";c+=`${String(p)}=${o(n(u,l))}`}return c},subscribe(s,a,l){let{store:c}=s,f=$n(c,e,a);if(!t.length)return f;let p=Yf(c),u=qe(s,l),m=[];for(let A=0;A<t.length;A++){let[d,b]=t[A],v=n(b,u),y=r(d);m.push([d,v,y]);for(let I=0;I<v.length;I++)Gf(p,d,v[I],a,y);if(y!==So)za(p,d,y,a)}let g=!0;return()=>{if(!g)return;g=!1,f();for(let A=0;A<m.length;A++){let[d,b,v]=m[A];for(let y=0;y<b.length;y++)Qf(p,d,b[y],a,v);if(v!==So)_a(p,d,v,a)}}}}}function Gf(e,t,n,r,o){za(e,t,o);let i=e.selectors.get(t);if(!i)e.selectors.set(t,i=new Map);let s=String(n),a=i.get(s);if(!a)i.set(s,r);else if(typeof a==="function"){if(a!==r)i.set(s,new Set([a,r]))}else a.add(r)}function Qf(e,t,n,r,o){let i=e.selectors.get(t),s=String(n),a=i?.get(s);if(a===r)i.delete(s);else if(typeof a==="object"){if(a.delete(r),!a.size)i.delete(s)}if(i&&!i.size)e.selectors.delete(t);_a(e,t,o)}function za({selecting:e},t,n,r){let o=e.get(t);if(!o)e.set(t,o=new Map);let i=o.get(n);if(!i)o.set(n,i={held:0,naming:new Set});if(i.held++,r)i.naming.add(r)}function _a({selecting:e},t,n,r){let o=e.get(t),i=o?.get(n);if(!o||!i)return;if(r)i.naming.delete(r);if(--i.held)return;if(o.delete(n),!o.size)e.delete(t)}function So(e,t,n){if(e==null)e=Ka(t,e);else if(t==null)t=Ka(e,t);if(ko(e)&&ko(t)){for(let i in e)if(!Object.hasOwn(t,i)||!Object.is(e[i],t[i]))n(i);for(let i in t)if(!Object.hasOwn(e,i))n(i);return}if(!Array.isArray(e)||!Array.isArray(t)){n(e),n(t);return}let r=0,o=0;while(r<e.length&&e[r]===t[r])r++;while(o<e.length-r&&o<t.length-r&&e[e.length-1-o]===t[t.length-1-o])o++;for(let i=r;i<e.length-o;i++)n(e[i]);for(let i=r;i<t.length-o;i++)n(t[i])}var ko=(e)=>!!e&&Object.getPrototypeOf(e)===Object.prototype,Jf=[],Zf={},Ka=(e,t)=>Array.isArray(e)?Jf:ko(e)?Zf:t;var xb=Object.freeze({}),ep=Object.freeze({}),tp=Object.freeze({}),Ao=Symbol(),en=(e)=>e.owner,He=(e)=>en(e).slots[e.slot],Ga=class{slot;key;mapKey;id;store;props;el=void 0;owner;leases=0;constructor(e,t,n,r,o,i,s){this.slot=e,this.key=t,this.mapKey=n,this.id=r,this.store=o,this.props=i,this.owner=s}get api(){return this.owner.api}},np=class{id;key;props;[Ao];constructor(e,t){this.id=e.id,this.key=e.key,this.props=t,this[Ao]=e}get api(){return rl(this[Ao])}},rp=class{el;id;key;props;store;#e;constructor(e,t){this.el=e.el,this.id=e.id,this.key=e.key,this.props=t,this.store=e.store,this.#e=e}get api(){return rl(this.#e)}};function qe(e,t){let n=e;if(n.owner.sleeping)return new np(n,t);let r=n.view;if(r&&r.props===t&&r.api===e.api)return r;let o={id:e.id,key:e.key,props:t,api:e.api};if(t===e.props)n.view=o;return o}var Ua=(e,t=e.props)=>en(e).sleeping?new rp(e,t):{el:e.el,id:e.id,key:e.key,props:t,store:e.store,api:e.api};function Qa(e){if(e.dropped&&!e.owner.parts.has(e.mapKey))Jn(e),e.dropped=!1;e.leases++;let t=!0;return()=>{if(!t)return;if(t=!1,--e.leases)return;let{owner:n}=e;if(!n.released)n.released=[e],queueMicrotask(()=>Za(n));else n.released.push(e)}}function Ja(e){let{owner:t}=e;if(!t.released)t.released=[e],queueMicrotask(()=>Za(t));else t.released.push(e)}function Za(e){let t=e.released;if(!t)return;e.released=void 0;for(let n=0;n<t.length;n++){let r=t[n];if(!r.leases&&e.parts.get(r.mapKey)===r){e.parts.delete(r.mapKey);let o=e.keyed.get(r.slot);if(o===r)e.keyed.delete(r.slot);else if(o instanceof Map&&o.get(r.key)===r)o.delete(r.key);r.dropped=!0}}}function Eo(e){let{parts:t}=e;if(e.unordered){e.unordered=!1;let n=0,r=!0;for(let o of t.values()){if(o.rank<n){r=!1;break}n=o.rank}if(!r){let o=[...t.values()].sort((i,s)=>i.rank-s.rank);t.clear();for(let i of o)t.set(i.mapKey,i)}}return t}function Jn(e){let{owner:t}=e,{parts:n,keyed:r}=t;e.rank=++t.rank,n.set(e.mapKey,e);let o=r.get(e.slot);if(!o)r.set(e.slot,e);else if(o instanceof Map)o.set(e.key,e);else if(o.key===e.key)r.set(e.slot,e);else{let i=new Map;i.set(o.key,o),i.set(e.key,e),r.set(e.slot,i)}}function ft(e,t=e.props,n=e.store.get()){let r=en(e),o=r.slots[e.slot],i=o.role,s=o.attrs||typeof i==="function"||he&&o.live?qe(e,t):void 0,a=o.attrs?.(n,s),l=typeof i==="function"?i(n,s):i;if(he)Gi(o,e.slot,a,l,{component:r.label,id:e.id},o.live?.read(n,s));if(a){let u=Zt.get(o);if(u===void 0)Zt.set(o,("hidden"in a?Po:0)|("id"in a?Jt:0));else if(!(u&Jt)&&"id"in a)Zt.set(o,u|Jt)}let c=t.id;e.made=c===void 0||a?.id!==c?a?.id??null:void 0;let f=r.slotNames[e.slot]??(r.slotNames[e.slot]=e.slot==="root"?r.name:`${r.name}-${e.slot}`),p=i===void 0?{"data-slot":f,...a}:{"data-slot":f,role:l,...a};if(i!==void 0)p.role=l;return sl(e,p)}var pt=new Set(["aria-label","aria-labelledby","aria-description","title","autocomplete","autocapitalize","autocorrect","spellcheck","inputmode","enterkeyhint"]);function Co(e,t){let n;for(let r in e)if(e[r]!==void 0&&pt.has(r)&&t(r))(n??={...e})[r]=void 0;return n??e}var Zn=(e)=>typeof e==="string"&&e.split(/\s+/).every((t)=>t.startsWith("ui-sdk-"));function er(e,t=e.props,n=e.store.get()){let r=He(e).present;return r?r(n,qe(e,t)):!0}function Mo(e){return He(e).present!==void 0}function el(e,t=e.props){let n=He(e).live;return n?sl(e,n.read(e.store.get(),qe(e,t))):ep}var tr=(e,t=e.props)=>He(e).selects?.selection(e,t)??"";var op={};function Pt(e,t,n=e.props){let r=He(e).selects,o=Qa(e),i=r?r.subscribe(e,t,n):$n(e.store,op,t);return()=>{o(),i()}}function tl(e){let t=e,n=He(e);if(t.handlersFor===n&&t.handlers)return t.handlers;let{on:r,press:o}=n;if(!r&&typeof o!=="function")return t.handlersFor=n,t.handlers=tp;let i={};for(let s in r){let a=r[s];i[s]=(l)=>{if(l.defaultPrevented||mp(l))return;a(l,Ua(e))}}if(typeof o==="function"&&!i.click)i.click=(s)=>{if(!s.defaultPrevented)t.owner.sleeping?.wake(),o(Ua(e),s)};return t.handlersFor=n,t.handlers=i}function nl(e){e.propsListeners?.forEach((t)=>t())}function rl(e){return en(e).sleeping?.wake(),e.api}function ol(e,t){let n=e.propsListeners??=new Set;return n.add(t),()=>{n.delete(t)}}var Po=1,Jt=2,Zt=new WeakMap,Ya=new WeakMap;function ip(e){let t=Ya.get(e);if(!t)t=new Set(e),Ya.set(e,t);return t}function sp(e){let t=He(e),n=Zt.get(t);if(n===void 0){let r=t.attrs?.(e.store.get(),qe(e,e.props));n=r?("hidden"in r?Po:0)|("id"in r?Jt:0):0,Zt.set(t,n)}return n}function Oo(e,t,n={by:"core"}){let r=e,{owner:o}=r,i=e.el?r:o.parts.get(r.mapKey);if(!i)Jn(r);else if(!e.el&&i===r&&r.rank!==o.rank)r.rank=++o.rank,o.unordered=!0;let s=He(e);if(he){ap(e,e.el,t);let{focus:u}=s;Qi(typeof u==="function"?u(e.store.get(),qe(e,e.props)):u,e.slot,t,{component:o.label,id:e.id})}let a={};e.el=t,r.binding=a;let l=[Qa(r)],c=sp(e);if(c&Po)mo(t.ownerDocument);if((n.by==="core"||n.attaches!=="all")&&(s.on||typeof s.press==="function")){let u=n.by==="framework"&&n.attaches!=="all"?ip(n.attaches):void 0,m=n.by==="core";if(u){for(let g in s.on)if(!u.has(g)){m=!0;break}if(!m&&typeof s.press==="function"&&!u.has("click"))m=!0}if(m){let g=tl(e);for(let A in g)if(!u||!u.has(A))l.push(se(t,A,g[A]))}}if(s.live)l.push(s.live.attach(e,t));if(n.by==="framework"&&s.direct)l.push(s.direct.attach(e,t));let f=s.asleep?.(t,e);if(f)l.push(f);let{sleeping:p}=o;if(p&&s.bind){let u=()=>{let m=s.bind?.(t,e);if(m)l.push(m)};p.binds.add(u),l.push(()=>p.binds.delete(u))}else if(s.bind){let u=s.bind(t,e);if(u)l.push(u)}if(c&Jt&&typeof MutationObserver<"u")l.push(cp(r,t));return()=>{for(let u=0;u<l.length;u++)l[u]();if(r.binding!==a)return;if(e.el=r.binding=void 0,r.own!==void 0)Qn(r)}}function ap(e,t,n){if(!e.key||!t||t===n)return;queueMicrotask(()=>{if(e.el!==n||!t.isConnected||!n.isConnected)return;let{parts:r,label:o}=en(e);for(let i of r.values())if(i.el===t)return;Ae(`two "${e.slot}" parts share the key "${e.key}". Give each an id or a unique value.`,{component:o,id:e.id})})}var To=(e,t)=>He(e).connect?.(t)??(()=>{}),Gn=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns","for","headers"],il=(e)=>He(e).attrs?.(e.store.get(),qe(e,{...e.props,id:void 0})).id;function sl(e,t){let{owner:n}=e;if(!n.named?.size||!Gn.some((i)=>t[i]))return t;let r=lp(n,e.store);if(!r.size)return t;let o={...t};for(let i of Gn){let s=o[i];if(s)o[i]=s.split(" ").map((a)=>r.get(a)??a).join(" ")}return o}function lp(e,t){let n=Nn(t);if(e.aliases?.version===n)return e.aliases.map;let r=new Map;for(let o of e.named){let i=il(o);if(i!==void 0&&i!==o.own)r.set(i,o.own)}return e.aliases={version:n,map:r},r}function cp(e,t){let n=al(t);if(e.own!==void 0||n&&n!==e.made)Qn(e);let r=dt.get(t);if(!r)dt.set(t,e),dp().observe(t,up);else if(r instanceof Set)r.add(e);else if(r!==e)dt.set(t,new Set([r,e]));Xa++;let o=!0;return()=>{if(!o)return;o=!1;let i=dt.get(t);if(i===e)dt.delete(t);else if(i instanceof Set){if(i.delete(e),!i.size)dt.delete(t)}if(!--Xa&&Mt)Mt.disconnect(),Mt=void 0}}var up={attributeFilter:["id"]},dt=new WeakMap,Mt,Xa=0;function dp(){if(!Mt)Mt=new MutationObserver((e)=>{for(let{target:t}of e){let n=dt.get(t);if(n instanceof Set)for(let r of n)Qn(r);else if(n)Qn(n)}});return Mt}function Qn(e){let{owner:t}=e;if(!t.unread)t.unread=new Set,Xe(()=>fp(t,e.store));t.unread.add(e)}function fp(e,t){let n=e.unread;e.unread=void 0;let r=e.renamed===!0;e.renamed=void 0;for(let o of n)r=pp(o,o.el&&al(o.el))||r;if(r)ea(t)}function al(e){let t=e.id;return t&&typeof t==="object"?e.getAttribute("id"):t}function pp(e,t){let n=il(e),r=t&&t!==n?t:void 0;if(r===e.own)return!1;let{owner:o}=e;if(e.own=r,o.named??=new Set,r===void 0)o.named.delete(e);else o.named.add(e);return o.aliases=void 0,n!==void 0}function mp(e){return(e.type==="keydown"||e.type==="keyup")&&(typeof e.key!=="string"||Ct(e))}function Io(e){return{read:e,attach(t,n){let r=`live:${t.id}`,o=()=>tn(n,el(t),r);o();let i=Pt(t,o);return()=>{i(),tn(n,{},r)}}}}function ll(e){let t=new WeakMap;return{names:e,attach:(n,r)=>{let o=ft(n),i=t.get(r);if(i){for(let[a,l]of i)if(o[a]===void 0&&r.getAttribute(a)===l)r.removeAttribute(a);i.clear()}let s=(a)=>{for(let l=0;l<e.length;l++){let c=e[l],f=a[c];if(f===void 0){if(o[c]!==void 0&&r.getAttribute(c)===o[c])r.removeAttribute(c);continue}let p=r.getAttribute(c);if(p===f)continue;if(pt.has(c)&&p!==null&&p!==o[c])continue;if(r.setAttribute(c,f),!i)t.set(r,i=new Map);i.set(c,f)}o=a};return s(o),Pt(n,()=>s(ft(n)))}}}var rr=new WeakMap,mt=new WeakMap,nr;function tn(e,t,n="render"){cl(e,t,n,!1)}function Lo(e,t){cl(e,{},t,!0)}function nn(e,t){if(e===nr)return;for(let n of Object.values(rr.get(e)??{}))n.delete(t);for(let n of Object.values(mt.get(e)??{}))n.delete(t)}function cl(e,t,n,r){let o=nr;nr=e;try{hp(e,t,n,r)}finally{nr=o}}function hp(e,t,n,r){let o=rr.get(e);if(!o&&!r){gp(e,t,n);return}yp(e,t,n,r,o)}function gp(e,t,n){let r=new Map;if(t.style!==void 0){for(let[o,i]of fl(t.style))if(r.set(`style:${o}`,i),e.style.getPropertyValue(o)!==i)e.style.setProperty(o,i)}for(let[o,i]of Object.entries(t)){if(i===void 0||o==="style")continue;let s=e.getAttribute(o);if(o==="id"&&ul(s,{},n))continue;if(s!==null&&s!==i&&pt.has(o)&&!(o==="aria-labelledby"&&Zn(s)))continue;if(r.set(o,i),s!==null)Do(e,n,o,s);if(s===i)continue;if(o==="value"&&dl(e)&&e.value!==i)e.value=i;e.setAttribute(o,i)}rr.set(e,{[n]:r})}function yp(e,t,n,r,o){let i=o?.[n],s=!1,a=!1;for(let g in t)if(t[g]!==void 0){if(s=!0,pt.has(g))a=!0}if(!i&&!s){if(r)delete mt.get(e)?.[n];return}if(!o)rr.set(e,o={});let l=new Map,c=t.style===void 0?void 0:fl(t.style);if(c)for(let g=0;g<c.length;g++)l.set(`style:${c[g][0]}`,c[g][1]);for(let g in t){let A=t[g];if(A!==void 0&&g!=="style")l.set(g,A)}let f=l.has("id")||i?.has("id")?e.getAttribute("id"):null,p=ul(f,o,n);if(p)l.delete("id");if(!a&&i){for(let g of i.keys())if(pt.has(g)){a=!0;break}}let u,m;if(a){u=new Set,m=new Map;let g=(A)=>{if(!pt.has(A)||m.has(A))return;let d=e.getAttribute(A);if(m.set(A,d),d===null||d===l.get(A)||A==="aria-labelledby"&&Zn(d))return;for(let b in o)if(o[b].get(A)===d)return;u.add(A)};for(let A of l.keys())g(A);if(i)for(let A of i.keys())g(A);for(let A of u)l.delete(A)}if(i)for(let g of i.keys()){if(l.has(g)||u?.has(g)||g==="id"&&p)continue;if(g.startsWith("style:")){e.style.removeProperty(g.slice(6));continue}if(!r){e.removeAttribute(g),Do(e,n,g,null);continue}let A=e.getAttribute(g);if(A!==i.get(g))continue;let d=mt.get(e)?.[n]?.get(g);if(d===void 0)e.removeAttribute(g);else if(A!==d)e.setAttribute(g,d)}if(c)for(let g=0;g<c.length;g++){let[A,d]=c[g];if(e.style.getPropertyValue(A)!==d)e.style.setProperty(A,d)}for(let g in t){let A=t[g];if(A===void 0||!l.has(g))continue;let d=g==="id"?f:m?.has(g)?m.get(g):e.getAttribute(g);if(d!==(i?.get(g)??null))Do(e,n,g,d);if(d===A)continue;if(g==="value"&&dl(e)&&e.value!==A)e.value=A;e.setAttribute(g,A)}if(l.size)o[n]=l;else delete o[n];if(r)delete mt.get(e)?.[n]}function Do(e,t,n,r){let o=r==null||n==="id"?void 0:Gn.includes(n)?bp(r):r;if(o===void 0)return void mt.get(e)?.[t]?.delete(n);let i=mt.get(e);if(!i)mt.set(e,i={});(i[t]??=new Map).set(n,o)}var bp=(e)=>e.split(/\s+/).filter((t)=>t&&!t.startsWith("ui-sdk-")).join(" ")||void 0;function ul(e,t,n){if(e===null||e===t[n]?.get("id"))return!1;if(!e.startsWith("ui-sdk-"))return!0;for(let r in t)if(t[r].get("id")===e)return!0;return!1}var dl=(e)=>e.localName==="textarea"||e.localName==="input"&&e.type!=="file";function fl(e){let t=[];for(let n of e.split(";")){let r=n.indexOf(":");if(r>0)t.push([n.slice(0,r).trim(),n.slice(r+1).trim()])}return t}function Qe(e,t){let n=[...e.parts()].filter((r)=>r.slot===t&&!!r.el?.isConnected);return st(n).map(({el:r,key:o,props:i})=>({el:r,key:o,props:i}))}var vp=(e)=>e==="fuzzy"?Ns:e;function pl(e,t){let{id:n,store:r,options:o}=e,i=!1,s=null,a,l=()=>a??t.query(),c,f=Ha({count:()=>p.count(),status:()=>r.get().status,onLoadMore:()=>o().onLoadMore}),p=Ks({store:r,focus:()=>r.get().focusInList?"real":"virtual",items:t.items,emptyItems:t.emptyItems,toKey:(y)=>String(y??""),filter:()=>vp(t.filter()),rank:()=>t.filter()==="fuzzy"||typeof t.filter()==="function",query:l,loop:()=>o().loop??!0,skipDisabled:!0,active:()=>r.get().open,onHighlight:t.onHighlight,onLastReached:f.reached,container:t.container,scrollRoot:t.scrollRoot,onRegister(){if(i)return;i=!0,Xe(()=>{i=!1,r.set({mounts:r.get().mounts+1})})}});na(r,p);let u=(y)=>e.props("item",y);function m(y){let{highlighted:I,settled:T}=r.get();if(!t.items()&&!T)return I;let B=t.autoHighlight(),X=B==="always"||B==="typing"&&l()!=="",F=I!==null&&p.entries().some((U)=>U.key===I),H=X?t.preferred?.(p)??p.firstEnabled()??null:null;return y&&X?H:F?I:H}function g(y,I){let T=m(y);if(T!==r.get().highlighted)t.highlight(T,I)}function A(y){let I=ao(y,{apple:_t()});if(I===void 0||y.altKey&&y.key==="ArrowUp")return!1;if(!r.get().open){if(!t.open||I!==1&&I!==-1)return!1;return y.preventDefault(),t.open(y,I===-1?"last":"first"),!0}y.preventDefault();let T=p.stepKey(I);if(T!==void 0)t.highlight(T,{reason:"list-navigation",event:y});return!0}let d=t.query(),b=r.get();r.subscribe(()=>{let y=r.get(),I=b;b=y;let T=t.query();if(T!==d){d=T;let B=s??{reason:"imperative"};s=null,g(!0,B)}else if(y.mounts!==I.mounts&&!t.settlesMount?.()||y.items!==I.items||y.settled!==I.settled){let B=I.highlighted===null?null:{reason:"item-removed"};if(y.highlighted!==I.highlighted)t.highlight(y.highlighted,B);else g(!1,B)}}),e.onOptions(()=>{if(c===void 0)return;let y=c,I=s;c=void 0,queueMicrotask(()=>{if(t.query()===y)g(!0,I)})});let v=t.autoHighlight();return e.onOptions(()=>{let y=t.autoHighlight();if(y===v)return;v=y,queueMicrotask(()=>g(!1,{reason:"imperative"}))}),qa({store:r,query:t.query,count:()=>p.count(),loading:()=>r.get().status==="loading",shown:()=>r.get().open,silent:()=>Qe(e,"status").length>0,announcement:()=>o().announcement}),{listbox:p,itemProps:u,settledHighlight:m,settle:g,navigate:A,loadMore:f,matchQuery:t.query,matchMode:()=>Na(t.filter()),cause(y,I){s={reason:y,event:I}},settleFor(y){c=t.query(),a=y;try{g(!0,s)}finally{a=void 0}},hover(y,I){if(I.pointerType==="touch"||!r.get().open||u(y)?.disabled)return;if(r.get().highlighted!==y)t.highlight(y,{reason:"item-hover",event:I})},isEmpty:(y)=>(!!t.items()||y.settled)&&p.count()===0,itemCount:()=>p.count(),filterQuery:t.query,activeDescendant(y){let{highlighted:I}=y;if(!y.open||y.focusInList||I===null)return;if(!p.element(I)?.isConnected)return;return`${n}-option-${Et(I)}`}}}function ml(){let e=(t,n)=>t.internal.text(n);return{role:"combobox",focus:"native",keys:jn,attrs:(t,{id:n,api:r})=>({id:`${n}-input`,value:e(r,t),autocomplete:"off",autocapitalize:"none",spellcheck:"false","aria-expanded":String(t.open)}),live:Io((t,{api:n})=>({"aria-activedescendant":n.internal.activeDescendant(t)})),on:{input:(t,{api:n,el:r})=>n.internal.typed(r,t),compositionend:(t,{api:n,el:r})=>n.internal.onCompositionEnd(r,t),keydown:(t,{api:n})=>n.internal.onInputKeyDown(t)},bind(t,{api:n,id:r,store:o}){oa(t,o,r);let i=t,s,a=()=>{let l=e(n,o.get());if(l===s)return;if(s=l,i.value!==l)i.value=l};return vs(i,()=>[e(n,o.get())],()=>n.internal.typed(i)),a(),o.subscribe(a)}}}function hl(){return{props:{value:"string",label:"string",keywords:"list",disabled:"boolean",index:"number",group:{kind:"string",from:"group.id"}},role:"option",focus:"active-descendant",attrs:(e,{id:t,key:n,props:r,api:o})=>({id:`${t}-option-${Et(n)}`,tabindex:e.focusInList?"-1":void 0,"aria-disabled":r.disabled?"true":void 0,"aria-selected":void 0,...ha(r.index,o.internal.listbox),hidden:o.internal.listbox.matches(n,r)?void 0:"","data-disabled":r.disabled?"":void 0}),direct:ll(["hidden"]),live:Io((e,{key:t})=>({"aria-selected":e.highlighted===t?"true":"false","data-highlighted":e.highlighted===t?"":void 0})),on:{...it,pointermove:(e,{api:t,key:n})=>t.internal.hover(n,e)},press:({api:e,key:t},n)=>e.internal.press(t,n),bind(e,{api:t,key:n,props:r}){let o=ga(e,{api:t,key:n,props:r});return()=>{o(),e.removeAttribute("data-highlighted"),e.setAttribute("aria-selected","false")}}}}var rn=new WeakMap,Je,wp=!1,gl=0;function bl(e){gl++;try{e()}finally{gl--}}function vl(e){let t=Je,n={starts:[]};Je=n;let r;try{r=e()}finally{Je=t}if(rn.set(r,n),t)t.starts.push(()=>(yl(r),()=>xl(r)));else if(!wp&&typeof document<"u")yl(r);return r}function Ot(e){if(Je)Je.starts.push(e);else if(he)Ae("`whenKept` runs only while an instance is made, so this work never starts.")}function wl(e,t){let n=Je,r={starts:[]};Je=r;try{t()}finally{Je=n}let o=rn.get(e);if(!o)return;o.starts.push(...r.starts);for(let i of o.stops?r.starts:[]){let s=i();if(s)o.stops.push(s)}}function yl(e){let t=rn.get(e);if(!t||t.stops)return;let n=t.stops=[];for(let r of t.starts){let o=r();if(o)n.push(o)}}function xl(e){let t=rn.get(e),n=t?.stops;if(!n)return;t.stops=void 0,n.forEach((r)=>r())}function Sl(e){xl(e),rn.delete(e)}var xp=Symbol.for("ui-sdk.controller.attach"),Sp=Symbol.for("ui-sdk.controller.detach");function kl(e,t){e?.[xp]?.(t)}function Al(e,t){e?.[Sp]?.(t)}function El(e,t){let n=e.options().controller,r=!1;Ot(()=>(r=!0,kl(n,t),()=>{r=!1,Al(n,t)})),e.onOptions(({controller:o})=>{if(o===n)return;if(Al(n,t),n=o,r)kl(o,t)})}Pe();Pe();function kp(e,t){let{x:n,y:r}=e,{borders:o}=t,i=n>=o.left&&n<t.width-o.right&&r>=o.top&&r<t.height-o.bottom,s=n>=t.clientLeft&&n<t.clientLeft+t.clientWidth&&r>=t.clientTop&&r<t.clientTop+t.clientHeight;return i&&!s}function Cl(e,t){if(!(t instanceof Element))return!1;let n=t.ownerDocument;if(t===n.documentElement)return e.clientX>=t.clientWidth||e.clientY>=t.clientHeight;if(t.clientWidth===0&&t.clientHeight===0)return!1;let r=t.getBoundingClientRect(),o=getComputedStyle(t);return kp({x:e.clientX-r.left,y:e.clientY-r.top},{width:r.width,height:r.height,clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,borders:{top:parseFloat(o.borderTopWidth)||0,right:parseFloat(o.borderRightWidth)||0,bottom:parseFloat(o.borderBottomWidth)||0,left:parseFloat(o.borderLeftWidth)||0}})}var xe=globalThis[Symbol.for("ui-sdk.layers@2")]??={stack:[],listening:new Map};function Pl(){return xe.persistent??=new Set}function Ap(e){for(let t of Pl())if(Me(t,e))return!0;return!1}function Ol(){return[...Pl()].filter((e)=>e.isConnected)}function Tl(){return xe.pushed??0}function Fo(e){return Tt().some((t)=>(t.order??0)>e)}function Tt(){return xe.stack.filter((e)=>e.active())}function ir(){return Tt()}function Dl(){return xe.escapeAt??-1/0}function or(e,t,n){return Il(e,On(t),n)}function Il(e,t,n){if(t.some((r)=>e.contains(r,n)))return!0;return Tt().some((r)=>r.parent===e&&(t.some((o)=>r.covers?.(o))||Il(r,t,n)))}function Ep(e,t){let n=!1,r,o;function i(u,m,g){let A=[],d=!1;if(Ap(m))return{dismissed:A,consume:d};for(let b of[...xe.stack].reverse())if(b.active()){if(or(b,m,u))break;if(b.modal!==!1)d=!0;if(A.push(b),b.shield)break}else if(b.exiting?.()){if(or(b,m,u))break;if(b.modal===!1)continue;if(b.overBackdrop?.(g.x,g.y))d=!0;break}return{dismissed:A,consume:d}}function s(u,m,g){let{dismissed:A,consume:d}=i(u,m,g);for(let b of A)b.onOutsidePress?.(u);return d}let a=se(t,"pointerdown",(u)=>{n=!1;let m=u.composedPath()[0];if(u.pointerType==="touch"){r={x:u.clientX,y:u.clientY,target:m};return}if(r=void 0,o=void 0,Cl(u,m))return;let g={x:u.clientX,y:u.clientY},{dismissed:A,consume:d}=i(u,m,g);if(A[0]?.outsidePress==="click"){if(u.button!==0)return;if(o={layer:A[0],target:m,point:g},d)u.preventDefault(),n=!0;return}if(d)u.preventDefault(),n=!0;for(let b of A)b.onOutsidePress?.(u)},{capture:!0}),l=se(t,"pointerup",(u)=>{let m=o;if(o=void 0,!m||!m.layer.active())return;if(or(m.layer,u.composedPath()[0],u))return;s(u,m.target,m.point)},{capture:!0}),c=se(t,"click",(u)=>{if(n&&u.detail){n=!1,u.preventDefault(),u.stopPropagation();return}if(n=!1,!r)return;let m=r;if(r=void 0,Math.hypot(u.clientX-m.x,u.clientY-m.y)>10)return;if(s(u,m.target,{x:m.x,y:m.y}))u.preventDefault(),u.stopPropagation()},{capture:!0}),f=se(e,"keydown",(u)=>Fl(e,u)),p=se(t,"blur",(u)=>{for(let m of Tt().reverse())m.onBlur?.(u)});return()=>{if(a(),l(),f(),p(),!n)return c();let u=()=>(c(),m(),g()),m=se(t,"pointerdown",u,{capture:!0}),g=se(t,"click",u,{capture:!0})}}function on(e,t){return or(e,t)}function sn(e){let t=On(e);return Tt().reverse().find((n)=>t.some((r)=>n.contains(r)))}function Ll(e){xe.closed=e,setTimeout(()=>{if(xe.closed===e)xe.closed=void 0})}function Ro(){return xe.closed}function Ml(){if(!he)return;We({type:"layers",stack:xe.stack.map((e)=>({component:e.component??"popup",id:e.id??"",modal:e.modal,blocking:!!e.blocking,el:e.el}))})}function Cp(e){let t=e.defaultView;if(!t)return()=>{};let n=xe.listening.get(e);if(!n)xe.listening.set(e,n={layers:0,stop:Ep(e,t)});let r=n;return r.layers++,()=>{if(--r.layers>0)return;xe.listening.delete(e),r.stop()}}function $o(e){return e.el?.ownerDocument??document}function Fl(e,t,n){if(t.key!=="Escape"||t.defaultPrevented||Ct(t))return;let r=Tt().filter((o)=>$o(o)===e).at(-1);if(!r?.onEscape||r.takesEscape?.()===!1||n&&r!==n)return;xe.escapeAt=performance.now(),r.onEscape(t)}function Rl(e,t){Fl($o(e),t,e)}function $l(e){xe.pushed=(xe.pushed??0)+1,e.order=xe.pushed,xe.stack.push(e);let t=Cp($o(e));Ml();let n=!1;return()=>{if(n)return;n=!0;let r=xe.stack.indexOf(e);if(r!==-1)xe.stack.splice(r,1);t(),Ml()}}Pe();Ve();De();var je=globalThis[Symbol.for("ui-sdk.modal@2")]??={holders:new WeakMap,thaw:new WeakMap,inert:new WeakMap};function Vl(e=document,t){let n={},r=je.holders.get(e);if(!r)je.holders.set(e,r=new Set);if(!r.size)je.thaw.set(e,Pp(e));r.add(n);let o=t&&at()?Wp(t):void 0;return()=>{if(!r.delete(n))return;if(o?.(),r.size)return;je.thaw.get(e)?.(),je.thaw.delete(e)}}function Mp({scrollbar:e,gutter:t,padding:n}){let r={overflow:"hidden","scroll-behavior":"auto"};if(e>0)if(t)r["scrollbar-gutter"]="stable";else r["padding-right"]=`${n+e}px`;return r}function Pp(e){let{scroller:t,gutter:n,padding:r}=Op.get(e)??Tp(e),o=Mp({scrollbar:n,gutter:typeof CSS<"u"&&CSS.supports("scrollbar-gutter","stable"),padding:r}),i=Object.entries(o).map(([s,a])=>Ne(t,s,a));if(n>0)i.push(Ne(e.documentElement,"--scrollbar-width",`${n}px`));return()=>i.forEach((s)=>s())}var Op=new WeakMap;function Tp(e){let t=e.defaultView??window,n=Dp(e,t),r=t.getComputedStyle(n);return{scroller:n,gutter:Ip(n,e,t,r),padding:parseFloat(r.paddingRight)||0}}function Dp(e,t){let{body:n,documentElement:r}=e;if(!n||t.getComputedStyle(r).overflowY==="visible")return r;return/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:r}function Ip(e,t,n,r){if(e===t.documentElement)return n.innerWidth-e.clientWidth;let o=(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-o}function Lp(e,t){let n=t.getComputedStyle(e),r=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,o=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return r||o}function Fp(e,t){let{body:n,documentElement:r}=e.ownerDocument;for(let o=e;o&&o!==n&&o!==r;o=o.parentElement)if(Lp(o,t))return!0;return!1}function Rp(e){if(e.fingers>1||e.zoomed)return"browser";if(e.scroller||e.slider||e.selecting)return"element";return"page"}var $p="@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }",Np=8;function Wp(e){let t=e.ownerDocument,n=t.defaultView??window;Te(t,"ui-sdk-scroll-guard",$p);let r=!e.hasAttribute("data-scroll-guard");if(r)e.setAttribute("data-scroll-guard","");let o="browser",i={x:0,y:0},s=!1,a=!0,l=se(t,"touchstart",(p)=>{let u=p.target instanceof Element?p.target:null,m=p.touches[0];i={x:m?.clientX??0,y:m?.clientY??0},s=!1,a=!0,o=Rp({fingers:p.touches.length,zoomed:(n.visualViewport?.scale??1)!==1,scroller:!!u&&Fp(u,n),slider:!!u?.closest('input[type="range"]'),selecting:t.getSelection()?.type==="Range"})},{capture:!0,passive:!0}),c=se(t,"touchmove",(p)=>{let u=p.touches[0];if(!u||Math.hypot(u.clientX-i.x,u.clientY-i.y)>Np)a=!1;if(o==="page"&&p.cancelable)p.preventDefault(),s=!0},{passive:!1}),f=se(t,"touchend",(p)=>{let u=p.target;if(p.defaultPrevented||!s||!a||!p.cancelable||!(u instanceof n.Element))return;if(p.preventDefault(),u.closest("input, textarea, select, [contenteditable]")?.focus(),u instanceof n.HTMLElement)u.click();else u.dispatchEvent(new n.MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0}))},{passive:!1});return()=>{if(l(),c(),f(),r)e.removeAttribute("data-scroll-guard")}}var Vp='[aria-live]:not([aria-live="off"]):not([data-slot="carousel-content"]),[role="status"],[role="alert"],[role="log"],output';function Nl(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function Wl(e){let t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll(Vp)),...Ol()],r=n.filter((s)=>!n.some((a)=>a!==s&&a.contains(s))),o=new Set;for(let s of r)for(let a=s;a;a=Nl(a))o.add(a);let i=[];for(let s of r)for(let a=s;a&&a!==t.body;a=Nl(a))for(let l of Array.from(a.parentNode?.children??[])){if(o.has(l)||!(l instanceof HTMLElement))continue;let c=je.inert.get(l)??(l.inert?1/0:0);if(c===0)l.inert=!0;if(c!==1/0)je.inert.set(l,c+1);i.push(l)}return()=>{for(let s of i){let a=je.inert.get(s);if(a===void 0)continue;if(a<=1)s.inert=!1,je.inert.delete(s);else je.inert.set(s,a-1)}}}function ql(e){let t=e,n=Wl(t),r=!1,o=(i)=>{let s=n;t=i,n=Wl(i),s()};return Object.assign(()=>{if(r)return;r=!0,n()},{keep(i){if(r)return()=>{};return o([...t,i]),()=>{if(!r)o(t.filter((s)=>s!==i))}}})}Ve();De();var Ue={tab:"close",blur:"always",outsidePress:"pointerdown",shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},Hl=(e)=>e.trapFocus?"trap":"flow",qp={menu:Ue,select:Ue,combobox:{...Ue,tab:"native"},popover:{...Ue,tab:Hl,blur:"iframe"},dialog:{...Ue,tab:Hl,blur:"never",outsidePress:"click",shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:(e)=>e.inertAndLock},tooltip:{...Ue,tab:"native",movesFocus:!1},hoverCard:{...Ue,tab:"flow"},navigationMenu:{...Ue,tab:"flow",blur:"never"}};function jl(e,t){let n={...qp[e]};for(let r of Object.keys(Ue)){let o=t[r];if(o!==void 0)Object.assign(n,{[r]:o})}return n}var Hp=()=>globalThis[Symbol.for("ui-sdk.popup-elements@1")]??=new WeakMap;function Dt(e){let t=Hp();t.set(e,(t.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(t.get(e)??1)-1;if(r>0)t.set(e,r);else t.delete(e)}}Pe();var Kl=["a[href]","area[href]","button","input:not([type='hidden'])","select","textarea","iframe","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(",");function No(e){if(!(e instanceof HTMLElement)||e.tabIndex<0)return!1;if(e.matches(":disabled")||e.closest("[inert]"))return!1;if((e.checked?[]:Wo(e)).some((n)=>n.checked&&No(n)))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility({visibilityProperty:!0});return e.getClientRects().length>0&&getComputedStyle(e).visibility!=="hidden"}function Wo(e){if(!(e instanceof HTMLInputElement)||e.type!=="radio"||!e.name)return[];return(e.form?Array.from(e.form.elements):Array.from(e.getRootNode().querySelectorAll(`input[name="${CSS.escape(e.name)}"]`))).filter((n)=>n instanceof HTMLInputElement&&n.type==="radio"&&n.name===e.name&&n.form===e.form)}function Ze(e){return Array.from(e.querySelectorAll(Kl)).filter(No)}function Vo(e){let t=(o)=>[...o.filter((i)=>i.index>0).sort((i,s)=>i.index-s.index),...o.filter((i)=>i.index<=0)].flatMap((i)=>i.stops),n=(o,i)=>{for(let s of o){let a=s.hasAttribute("tabindex")?s.tabIndex:0;if(s.hasAttribute("inert")||s.shadowRoot&&a<0)continue;let l=s.matches(Kl)&&!s.shadowRoot?.delegatesFocus&&No(s)?[s]:[],c=s instanceof HTMLSlotElement?s.assignedElements():[];if(s.shadowRoot||c.length){let f=[];n(s.shadowRoot?.children??c,f),i.push({index:a,stops:[...l,...t(f)]})}else i.push({index:a,stops:l}),n(s.children,i)}},r=[];return n(e.children,r),r.flatMap((o)=>o.stops)}function Bl(e,t){let n=(r)=>{for(let o=r;o&&o!==t;o=o.parentElement)if(o.assignedSlot)return!0;return!1};return e.filter((r)=>r.tabIndex>0&&!n(r)).sort((r,o)=>r.tabIndex-o.tabIndex)}function zl(e,t){let n=e.ownerDocument??document;return Ze(n.body).find((r)=>!r.contains(e)&&!t?.contains(r)&&Fe(e,r))}var jp="position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;outline:none";function _l(e,t){let n=e.ownerDocument,r,o=[],i=()=>{o.forEach((u)=>u.remove()),o=[],r=void 0},s=()=>{let u=n.createElement("span");return u.tabIndex=0,u.setAttribute("aria-hidden","true"),u.style.cssText=jp,u},a=()=>{let u=n.activeElement;if(o.length||!t()||!(u instanceof HTMLIFrameElement)||!e.contains(u))return;r=u,o=[s(),s()],u.before(o[0]),u.after(o[1])},l=()=>{a(),setTimeout(a)},c=se(n.defaultView??window,"blur",l),f=se(n,"focusout",l),p=se(n,"focusin",(u)=>{let m=o.indexOf(u.target),g=r;if(i(),m<0||!g)return;let A=Ze(e),d=m===0?-1:1;(A.at((A.indexOf(g)+d)%A.length)??e).focus({preventScroll:!0})});return()=>{c(),f(),p(),i()}}function lr(e){return{consumeOutsidePress:e===!0||e==="pointer",trapFocus:e===!0||e==="trap-focus",inertAndLock:e===!0}}var Kp={mouse:"pointer",pen:"pointer",touch:"touch",keyboard:"keyboard",virtual:"keyboard",programmatic:"imperative",agent:"imperative"},Zl=(e)=>e?Kp[Ge(e)]:"imperative",Bp=new Set;function zp(e){if(e==="initial"||e==="hover")return"none";if(e==="touch")return"popup";return"auto"}function _p(e){if(e.focusable&&!e.consumed)return!1;return e.type==="pointerdown"?"later":!0}var Up=new Set(["text","search","url","tel","email","password"]);function Yp(e){if(e.localName==="input"&&Up.has(e.type)&&e.value&&e.getAttribute("aria-expanded")!=="true")e.select()}function Ul(e,t){for(let n of e){let r=n();if(r&&t(r))return r}}function jo(e,t,n){lt(e,t,(r,o)=>("open"in r)&&r.open!==o.open?n(!!r.open,o):void 0)}function ec(e,t){return{id:`${t}-content`,tabindex:"-1",hidden:e.mounted?void 0:"",...ut(e.open)}}var Xp="a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]";function Gp(e,t){if(typeof e==="function")return e()??void 0;if(typeof e==="string")return t.querySelector(e)??void 0;return e}function sr(e){return e.isConnected&&!e.closest("[inert]")}function Yl(e){let t=e.getRangeAt(0).cloneRange(),n=!t.collapsed&&e.anchorNode===t.endContainer&&e.anchorOffset===t.endOffset;return{range:t,backward:n}}function qo(){let e=we();return!e||e===e.ownerDocument.body||!sr(e)||e.checkVisibility?.()===!1}function Ho(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function Xl(e){return e.getRootNode().activeElement}function Qp(e){let t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener("close",(r)=>{if(performance.now()-Dl()<100)return;e(r)}),()=>n?.destroy()}var Gl=new WeakMap,ar=new WeakSet,Ql=new WeakMap;function Jl(e,t){for(let n=e;n;n=n.parent)if(n===t||ar.has(n)&&(n.order??0)>(t.order??0))return!0;return!1}function tc(e){let t=jl(e.preset,e),n=()=>typeof t.tab==="function"?t.tab(e.modal()):t.tab,{store:r}=e,o,i,s,a=!1,l,c,f,p=r.get().open?"initial":"imperative",u=t.focusOnMount&&r.get().open,m=!1,g=!1,A=!1,d=!0,b=!1,v,y=!1,I,T=r.get().open,B=()=>{return},X=[],F=e.returnTrigger??e.trigger,H,U,te,Z,re=(k,L)=>e.onOpenChangeComplete?.(k,L),ce=(k)=>k||!!i?.el&&Ee;jo({store:r},["mounted"],(k)=>ce(k)===k?{mounted:k}:void 0);function ae(k){v=k;let L=k?.isContentEditable?k.ownerDocument.getSelection():null;I=L?.rangeCount&&k.contains(L.anchorNode)?Yl(L):void 0;let D=v&&sn(v),w=D?void 0:Ro();B=D?.returnTarget??(()=>w)}let q=r.get().open;r.subscribe(()=>{let{open:k}=r.get();if(k===q)return;if(q=k,k){if(Z?.(!0),e.onOpenChange?.(!0),l?.(),l=void 0,i){for(let V of[i.el,i.backdrop])if(V)go(V,!0)}let G=e.trigger();b=p==="imperative"&&!!G&&Bp.has(G),u=!b,m=!0,d=!0;let pe=Ee?we():null;ae(pe&&pe!==pe.ownerDocument.body?pe:void 0);let ye=F();T=p==="imperative"||A&&!!v&&!sn(v)&&!Ro()&&!(ye&&Me(ye,v));let W=!!i;if(r.set({mounted:!0}),o){if(W)le();ee()}else if(!Ee)m=!1,re(!0);return}let L=t.movesFocus&&!b&&d;d=!0,u=!1,m=!1,p="imperative",A=!1;let D=Z?.(!1);a=D?.reason==="outside-press";let w=i?.el;if(s)Ll(M());let O=B,P=I;if(I=void 0,!w||!Ee){e.onOpenChange?.(!1,D),r.set({mounted:!1}),re(!1,D);return}let R=we(),K=e.trigger(),J=!R||R===w.ownerDocument.body||Me(w,R)||!!s&&on(s,R)&&!(K&&Me(K,R));e.onOpenChange?.(!1,D),o?.config.onClose?.();let oe=Tl(),ie=e.finalFocus?.()??"trigger",de=[w,...i?.backdrop?[i.backdrop]:[]];de.forEach((G)=>go(G,!1));let h=!1,E=pa(de,()=>{h=!0,l=void 0,r.set({mounted:!1}),le(),re(!1,D)});if(!h)l=E;if(c?.(),c=void 0,f?.(),f=void 0,!L||!J)return;if(L===!0){N(w,O,!1,P,ie);let G=we();setTimeout(()=>{if(G&&!G.isConnected&&qo()&&!Fo(oe))N(w,O,!1,void 0,ie)});return}if(L==="unless-moved"){queueMicrotask(()=>{let G=we();if(!(!!G&&G!==w.ownerDocument.body&&!Me(w,G))&&!Fo(oe))N(w,O,!1,P,ie)});return}let C=()=>{j(),clearTimeout(Y),setTimeout(()=>{let G=we();if(!G||G===w.ownerDocument.body)N(w,O,!1,P,ie)})},j=se(window,"pointerup",C,{capture:!0}),Y=setTimeout(C,1000)});function x(k,L,D=B,w=!1){let O=()=>D(L,w),P=()=>_(k,w);return T?[()=>v,O,F,P,e.trigger]:[F,()=>v,O,P,e.trigger]}let S=!1;function M(k=sr,L=!1){if(S)return;S=!0;try{return Ul(x(i?.el,k,B,L),k)}finally{S=!1}}function _(k,L=!1){let D=X[0]?.node;if(D?.isConnected&&!k?.contains(D)){for(let h of[...X.slice(1).map((E)=>E.node),D.ownerDocument.body]){let E=Ze(h).filter((j)=>!k?.contains(j)),C=E.find((j)=>Fe(D,j)&&!D.contains(j))??E.filter((j)=>Fe(j,D)).pop();if(C)return C}return}let w=X.findIndex((h,E)=>!h.node.isConnected&&X[E+1]?.node.isConnected);if(w===-1)return;let O=X[w],P=O.next?.deref(),R=O.previous?.deref(),K=X[w+1].node,J=(h)=>!!h?.isConnected&&h.parentNode===K,oe=J(P)?P.previousElementSibling===(O.previous?R:null):!O.next&&(O.previous?J(R)&&!R.nextElementSibling:!K.firstElementChild);if(L&&!oe)return;let ie=(h,E)=>h.contains(E)||Fe(h,E),de=J(P)?(h)=>ie(P,h):J(R)?(h)=>Fe(R,h)&&!R.contains(h):(h)=>ie(K,h);for(let{node:h}of X.slice(w+1)){let E=Ze(h).filter((Y)=>!k?.contains(Y)),C=J(R)?E.filter((Y)=>!ie(R,Y)||R.contains(Y)).pop():void 0,j=E.find(de)??C??E[0];if(j)return j}}function N(k,L,D=!1,w,O=e.finalFocus?.()??"trigger"){if(O==="none")return;let P=(K)=>{if(!sr(K)||k.contains(K))return!1;let J=K.ownerDocument.getSelection(),oe=w&&K===v?J?.rangeCount&&K.contains(J.anchorNode)?Yl(J):w:void 0;if(Yn(K),we()!==K)return!1;if(oe&&K.contains(oe.range.startContainer)){let{startContainer:ie,startOffset:de,endContainer:h,endOffset:E}=oe.range;if(oe.backward)J?.setBaseAndExtent(h,E,ie,de);else J?.setBaseAndExtent(ie,de,h,E)}return!0},R=x(k,P,L,D);if(O!=="trigger")R.unshift(()=>Gp(O,k.ownerDocument));Ul(R,P)}function Q(k,L){if(!u||!i||!r.get().open||!t.movesFocus)return;u=!1;let D=zp(p),w=p==="initial"&&t.focusOnMount||D==="popup"&&L?.()?"auto":D;if(w==="none")return;let O=()=>{if(!i||!r.get().open)return;let P=w==="popup"?i.el:k?.();if(!P)return;if(xo(P),!i||!r.get().open)return;let R=we();if(!R||!Me(P,R)&&!Me(i.el,R)){xo(i.el);return}Yp(P)};if(g)requestAnimationFrame(()=>{let P=we();if(!i||!P||!Me(i.el,P))O()});else O()}function ne(k,L,D){let w=[],O=e.trigger(),P=L.host?.()??k;if(p==="initial"&&!v){let W=we();ae(W&&W!==W.ownerDocument.body&&!Me(k,W)?W:void 0)}k.removeAttribute("hidden"),P.removeAttribute("hidden");let R=i?.backdrop;if(R){let W=fe(R,L.inline);w.push(()=>{W(),ue(R)})}if(!L.inline){P.setAttribute("popover","manual");try{P.showPopover()}catch{}}if(D)At.add(k);if(L.position&&e.position){let W=e.position(()=>L.anchor?.()??e.trigger(),k,L.position,()=>e.close("anchor-hidden",{focus:!1}));if(H=W.place,U=W.follow,w.push(W,()=>H=U=void 0),L.rendered)w.push(L.rendered(W.follow))}if(!L.inline&&!Pn()&&!P.style.zIndex)P.style.zIndex="2147483000";w.push(Hn(k,m?()=>{m=!1,re(!0)}:void 0)),Un();let K=b?lr(!1):e.modal(),J=t.blur,oe=e.persistent?.()??[],ie=(W,V)=>W===k&&!!V&&("clientX"in V)&&Ho({x:V.clientX,y:V.clientY},k.getBoundingClientRect()),de=F()??(!O&&v?.isConnected?v:void 0);if(de||!O)X=[];for(let W=de??null;W&&W!==k.ownerDocument.body;W=W.parentElement){let{nextElementSibling:V,previousElementSibling:ve}=W;X.push({node:W,next:V&&new WeakRef(V),previous:ve&&new WeakRef(ve)})}let h={parent:e.parent?.()??(O&&sn(O)),active:()=>r.get().open,exiting:()=>!r.get().open&&r.get().mounted,modal:K.consumeOutsidePress,blocking:typeof t.blocking==="function"?t.blocking(K):t.blocking,outsidePress:t.outsidePress,shield:t.shield,component:e.owner?.component,id:e.owner?.id,el:k,covers:(W)=>P.contains(W),contains:(W,V)=>k.contains(W)&&!ie(W,V)||oe.some((ve)=>ve.contains(W))||(e.contains?e.contains(W,V):!!e.trigger()?.contains(W)),overBackdrop:(W,V)=>a&&!!i?.backdrop&&!Ho({x:W,y:V},i.backdrop.getBoundingClientRect())&&Ho({x:W,y:V},k.getBoundingClientRect()),returnTarget:M,onOutsidePress:(W)=>{let V=W.composedPath()[0];e.close("outside-press",{event:W,focus:_p({type:W.type,focusable:!!V?.closest?.(Xp),consumed:K.consumeOutsidePress})})},takesEscape:e.takesEscape,onEscape:(W)=>{if(W.preventDefault(),e.onEscape)e.onEscape(W);else e.close("escape-key",{event:W,focus:!0})},onBlur:J==="never"?void 0:J==="always"?(W)=>e.close("window-blur",{event:W,focus:!1}):(W)=>setTimeout(()=>{let V=Xl(k)??k.ownerDocument.activeElement;if(V?.tagName==="IFRAME"&&!k.contains(V))e.close("focus-out",{event:W,focus:!1})})};if(s=h,Gl.set(h,[k,...R?[R]:[]]),w.push($l(h)),Ql.set(h,{inside:(W)=>W.contains(k)||!!O&&W.contains(O),again:()=>{let W=we();le();for(let V of[P,R])try{V?.hidePopover()}catch{}if(ee(),W&&W!==we())W.focus({preventScroll:!0})}}),K.inertAndLock)ar.add(h);for(let W of[e.onShow,L.onShow]){let V=W?.(h);if(V)w.push(V)}let E,C,j,Y=()=>{let W=[k,...i?.backdrop?[i.backdrop]:[],...oe];if(O&&t.keepTrigger)W.push(O);for(let ve of ir())if(ve!==h&&Jl(ve,h))W.push(...Gl.get(ve)??[]);E=Vl(k.ownerDocument,k);let V=ql(W);h.keep=V.keep,c=C=V},G=()=>{if(j?.(),C?.(),E?.(),c===C)c=void 0;C=E=h.keep=void 0};if(K.inertAndLock)j=la(()=>{if(j=void 0,!r.get().open)return;let W=we();if(Y(),n()==="trap"&&W&&!sr(W))u=!0,Q(L.initialFocus,L.chosenFocus)});te=()=>{let W=b?lr(!1):e.modal();if(h.modal=W.consumeOutsidePress,h.blocking=typeof t.blocking==="function"?t.blocking(W):t.blocking,W.inertAndLock)ar.add(h);else ar.delete(h);if(W.inertAndLock&&!K.inertAndLock&&r.get().open)Y();else if(!W.inertAndLock&&K.inertAndLock)G();K=W},w.push(G,()=>te=void 0);let pe=new Set(ir());for(let W=h.parent;W;W=W.parent)pe.add(W);pe.delete(h);for(let W of pe)if(W.keep&&Jl(h,W))for(let V of[k,...R?[R]:[]])w.push(W.keep(V));if(n()==="flow"&&t.dismissOnFocusLoss){let W;w.push(se(k.ownerDocument,"mousedown",(V)=>{W=V,y=!1,setTimeout(()=>{if(W===V)W=void 0})},{capture:!0}),se(k.ownerDocument,"focusin",(V)=>{y=!1;let ve=Xl(k)??V.target;if(!r.get().open||on(h,ve))return;if(W&&h.contains(ve,W))return;e.close("focus-out",{event:V,focus:!1})}),se(k,"focusout",(V)=>{if(!y||V.relatedTarget)return;setTimeout(()=>{let ve=we(k.ownerDocument);if(r.get().open&&!(ve&&on(h,ve)))e.close("focus-out",{event:V,focus:!1})})}))}if(w.push(_l(k,()=>n()==="trap")),t.closeWatcher){let W=Qp((V)=>e.close("back",{event:V,focus:!0}));if(W)f=W,w.push(()=>{if(W(),f===W)f=void 0})}let ye=(W)=>{let{target:V,submitter:ve}=W;if((ve?.getAttribute("formmethod")??V.getAttribute("method"))?.toLowerCase()!=="dialog"||sn(V)!==h)return;W.preventDefault(),e.close("close-press",{event:W,focus:!0,returnValue:ve?.value||void 0})};if(k.addEventListener("submit",ye),w.push(()=>k.removeEventListener("submit",ye)),r.get().open&&!u&&n()==="trap"&&qo())u=!0;for(let W of ir()){let V=Ql.get(W);if(W!==h&&V?.inside(k))V.again()}return queueMicrotask(()=>Q(L.initialFocus,L.chosenFocus)),()=>{if(w.forEach((W)=>W()),s===h)s=void 0;if(!r.get().mounted&&!L.inline)try{P.hidePopover()}catch{}}}function ee(k=!1){if(!o||i)return;let{el:L,config:D}=o;i={el:L,cleanup:()=>{},backdrop:D.backdrop?.()},i.cleanup=ne(L,D,k)}function fe(k,L=!1){if(k.removeAttribute("hidden"),L)return Hn(k);k.setAttribute("popover","manual");try{k.showPopover()}catch{}if(!Pn()&&!k.style.zIndex)k.style.zIndex="2147483000";return Hn(k)}function ue(k){if(!r.get().mounted)try{k.hidePopover()}catch{}}function le(){if(!i)return;let{cleanup:k}=i;i=void 0,k()}function z(k){if(y=k.key==="Tab",k.key==="Escape"&&s)return Rl(s,k);let L=i?.el;if(k.key!=="Tab"||!L)return;let D=n();if(D==="native")return;if(D==="close")return e.close("focus-out",{event:k,focus:!1});let w=Ze(L),O=Vo(L),P=O[0],R=O.at(-1),K=we(),J=!P||K===P||K===L,oe=!R||K===R,ie=D==="trap"?Bl(w,L):[];if(ie.length){let h=[...ie,...w.filter((pe)=>!ie.includes(pe))],E=h.indexOf(K),C=K===L?h.at(k.shiftKey?-1:0):h.at((E+(k.shiftKey?-1:1))%h.length),j=ie.includes(K)||!!C&&ie.includes(C),Y=K?.shadowRoot,G=!k.shiftKey&&!!Y&&Ze(Y).length>0;if(K!==L&&(E<0||!j||G))return;k.preventDefault(),C?.focus({preventScroll:!0});return}if(D==="trap"){if(k.shiftKey?J:oe){k.preventDefault(),((k.shiftKey?R:P)??L).focus({preventScroll:!0});return}let h=w.indexOf(K),E=h<0?void 0:w[h+(k.shiftKey?-1:1)],C=E&&!E.checked?Wo(E):[];if(C.some((j)=>j.checked)&&!C.includes(K)){k.preventDefault(),E?.focus({preventScroll:!0});return}setTimeout(()=>{let j=we(L.ownerDocument);if(i?.el===L&&!(j&&(Me(L,j)||!!s&&on(s,j))))((k.shiftKey?R:P)??L).focus({preventScroll:!0})});return}let de=e.trigger()??(v?.isConnected?v:void 0);if(!de)return;if(k.shiftKey&&J)k.preventDefault(),de.focus({preventScroll:!0});else if(!k.shiftKey&&oe){let h=zl(de,L);if(!h)return;k.preventDefault(),h.focus()}}return{bind(k,L={}){let D=!1,w=Dt(k),O=()=>{if(o={el:k,config:L},r.get().mounted){if(i&&i.el!==k)le();ee(!0)}};if(k.isConnected)O();else queueMicrotask(()=>{if(!D&&k.isConnected)O()});return()=>{D=!0;let P=e.finalFocus?.()??"trigger";if(w(),o?.el!==k)return;if(o=void 0,i?.el===k){let R=we(),K=r.get().open&&t.movesFocus&&!b&&(!R||R===k.ownerDocument.body||Me(k,R)),J=B;if(le(),K){let oe=I;I=void 0,queueMicrotask(()=>{if(!o&&!k.isConnected&&qo())N(k,J,!0,oe,P)})}}}},keydown:z,triggerKeydown(k){let L=i?.el;if(k.key!=="Tab"||k.shiftKey||!L||!r.get().open)return;if(n()!=="flow")return;k.preventDefault(),(Vo(L)[0]??L).focus({preventScroll:!0})},opening(k,L){p=k,g=L?.type==="pointerdown",A=L?.type==="keydown"},opener:()=>p,observe(k){Z=k},requestClose:(k,L)=>e.close(k,{event:L,focus:!0}),returnFocus(k){d=k},initialFocus:Q,place:()=>H?.(),checkPlacement:()=>U?.(),updateModal:()=>te?.(),layer:()=>s,element:()=>i?.el,mountedAs:ce,backdrop(k){if(!i||i.backdrop===k)return()=>{};let{el:L}=i,D=o?.config.host?.()??L,w=!!o?.config.inline;i.backdrop=k;let O=fe(k,w),P=we();if(!w)try{D.hidePopover(),D.showPopover()}catch{}if(P&&P!==we())P.focus({preventScroll:!0});let R=s?.keep?.(k);return()=>{if(R?.(),O(),i?.backdrop===k)i.backdrop=void 0;ue(k)}}}}Pe();Ve();var tu,Zc=()=>tu??=Promise.resolve().then(() => (Jc(),Qc)),eu=(e)=>Ee&&typeof matchMedia==="function"&&matchMedia(e).matches;function nu(e,t,n,r,o){let i=()=>{let l=n(),c=l==="auto"&&eu("(max-width: 640px) and (pointer: coarse)");return l==="sheet"||c?"sheet":r},s=()=>e.set({presentation:i()}),a=n();if(a==="sheet")s();if(Ee&&!tu&&(a==="sheet"||a==="auto"&&eu("(pointer: coarse)")))(window.requestIdleCallback??setTimeout)(()=>Zc().then((l)=>l.prepareVariables()));return{open:s,resolve:i,bind(l,c){let f=t();if(n()==="auto"&&f.opener()==="initial"&&e.get().open)queueMicrotask(s);if(e.get().presentation!=="sheet")return f.bind(l,c);let p,u=!1,m=()=>l.hidden||(l.hidden=!0),g=new MutationObserver(m),A=(b)=>{if(g.disconnect(),!u)p=b()};Zc().then(({presentSheet:b})=>A(()=>b(l,f,{...o?.sheet,...c})),()=>A(()=>f.bind(l,c))),m(),g.observe(l,{attributeFilter:["hidden"]});let d=Dt(l);return()=>{u=!0,g.disconnect(),d(),p?.()}}}}var ru=[0.5,1];function ou(e,t){let{store:n}=t;if(fn.get(n)&&n.get().presentation==="sheet"&&Ge()!=="touch")queueMicrotask(()=>e.isConnected&&e.focus({preventScroll:!0}));fn.delete(n);let r=[se(e,"touchend",(o)=>{if(n.get().open||!o.cancelable||t.presentation.resolve()!=="sheet")return;o.preventDefault(),t.open(o)},{passive:!1}),se(e,"focus",()=>fn.set(n,!0)),se(e,"blur",(o)=>o.relatedTarget&&fn.set(n,!1))];return()=>{if(r.forEach((o)=>o()),e.ownerDocument.activeElement===e)fn.set(n,!0)}}var fn=new WeakMap;vr();var iu;function Xm(){return iu??=typeof CSS<"u"&&typeof CSS.supports==="function"&&["position-anchor: --a","position-try-fallbacks: flip-y","position-visibility: always"].every((e)=>CSS.supports(e)),iu}var ai=(e)=>{let t=document.documentElement;return!e.x&&!e.y&&Math.abs(e.width-t.clientWidth)<1&&Math.abs(e.height-t.clientHeight)<1};function su(e,t,n,r,o){if(!Xm()||e.getRootNode()!==n.getRootNode()||!(t.width||t.height)||!ai(o))return!1;let i=(s)=>s.split(",").some((a)=>parseFloat(a)>0);return!i(r.transitionDuration)&&(r.animationName==="none"||!i(r.animationDuration))}function au(e,t,n,r,o){let{sideOffset:i,alignOffset:s,collisionPadding:a}=r,l=t==="top"||t==="bottom",[c,f]=l?["left","right"]:["top","bottom"],p=l?o.width:o.height,u=n==="start"?`anchor(${c}) + ${s}px`:n==="end"?`anchor(${f}) - ${p+s}px`:`anchor(center) - ${p/2-s}px`,m=br[t];return{[m]:`round(anchor(${t}), 1px)`,[t]:"auto",[`margin-${m}`]:`${i}px`,[`margin-${t}`]:`${a}px`,[c]:`round(min(max(${u}, min(${a}px, anchor(${f}))), max(100% - ${p+a}px, anchor(${c}) - ${p}px)), 1px)`,"position-anchor":e,"position-try-fallbacks":l?"flip-y":"flip-x","position-visibility":"always"}}var si=new WeakMap,Gm=globalThis[Symbol.for("ui-sdk.anchor-names@1")]??={count:0};function li(e){let t=si.get(e);if(!t)t=`--ui-anchor-${++Gm.count}`,si.set(e,t);if(!e.style.getPropertyValue("anchor-name").split(",").some((r)=>r.trim()===t)){let r=getComputedStyle(e).getPropertyValue("anchor-name");e.style.setProperty("anchor-name",r&&r!=="none"?`${r}, ${t}`:t)}return t}function lu(e){let t=si.get(e),n=e.style.getPropertyValue("anchor-name").split(",").map((r)=>r.trim()).filter((r)=>r&&r!==t);if(n.length)e.style.setProperty("anchor-name",n.join(", "));else e.style.removeProperty("anchor-name");if(!e.getAttribute("style"))e.removeAttribute("style")}var Ft=new Map,cu=()=>{},ci=cu,uu=(e)=>Ft.forEach((t,n)=>e.target instanceof Node&&t?.contains(e.target)||n()),du=(e)=>Ft.forEach((t,n)=>e.some((r)=>r.attributeName!="aria-activedescendant"&&!t?.contains(r.target))&&n());function Qm(){let e=new AbortController,t={capture:!0,passive:!0,signal:e.signal},n=[[document,["scroll","load","input","pointermove","focusin","transitionstart","animationstart"]],[window,["resize"]],[window.visualViewport,["resize","scroll"]],[document.fonts,["loadingdone"]]];for(let[o,i]of n)for(let s of i)o?.addEventListener(s,uu,t);let r=new MutationObserver(du);return r.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{e.abort(),r.disconnect()}}var Pr=new Map;function Jm(e){let t=new AbortController,n={capture:!0,passive:!0,signal:t.signal};for(let o of["scroll","load","transitionstart","animationstart"])e.addEventListener(o,uu,n);let r=new MutationObserver(du);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{t.abort(),r.disconnect()}}function fu(e){let t=[];for(let n=e;n;)if(n.nodeType===11&&"host"in n)t.push(n),n=n.host;else n=n.assignedSlot??n.parentNode;return t}function pu(e){let t=[...e];for(let n of t){let r=Pr.get(n)??{count:0,stop:Jm(n)};r.count++,Pr.set(n,r)}return()=>{for(let n of t.splice(0)){let r=Pr.get(n);if(--r.count)continue;r.stop(),Pr.delete(n)}}}function mu(e,t){if(!Ft.size)ci=Qm();let n=typeof ResizeObserver=="function"?new ResizeObserver(e):void 0;if(t)n?.observe(t);return Ft.set(e,n&&t),()=>{if(n?.disconnect(),Ft.delete(e),Ft.size)return;ci(),ci=cu}}vr();De();function Zm(e){let t=e;if(!e.getClientRects().length){if(getComputedStyle(e).display!=="contents")return;if(t=e.ownerDocument.createRange(),t.selectNodeContents(e),!t.getClientRects().length)return}let{x:n,y:r,width:o,height:i}=t.getBoundingClientRect();return{x:n,y:r,width:o,height:i}}function eh(e){let t="getBoundingClientRect"in e?e.getBoundingClientRect():{width:0,height:0,...e};return{x:t.x,y:t.y,width:t.width,height:t.height,left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height}}var Rt=(e)=>e==="top"||e==="bottom";function hu(e,t,n,r,o){let{sideOffset:i,alignOffset:s}=o,a=n==="top"||n==="bottom",l=0,c=0;if(n==="bottom")c=e.y+e.height+i;if(n==="top")c=e.y-t.height-i;if(n==="right")l=e.x+e.width+i;if(n==="left")l=e.x-t.width-i;if(a){if(r==="start")l=e.x+s;if(r==="center")l=e.x+e.width/2-t.width/2+s;if(r==="end")l=e.x+e.width-t.width-s}else{if(r==="start")c=e.y+s;if(r==="center")c=e.y+e.height/2-t.height/2+s;if(r==="end")c=e.y+e.height-t.height-s}return{x:l,y:c}}function ui(e,t,n,r,o){if(e==="bottom")return t.y+n.height-(r.y+r.height-o);if(e==="top")return r.y+o-t.y;if(e==="right")return t.x+n.width-(r.x+r.width-o);return r.x+o-t.x}function th(e,t,n,r){let{sideOffset:o,collisionPadding:i}=r,s=e==="bottom"?n.y+n.height-i-(t.y+t.height+o):e==="top"?t.y-o-i-n.y:n.height-i*2,a=e==="right"?n.x+n.width-i-(t.x+t.width+o):e==="left"?t.x-o-i-n.x:n.width-i*2;return{width:Math.max(0,a),height:Math.max(0,s)}}var wu=(e,t,n=!1)=>n&&Rt(e)&&t!=="center"?t==="start"?"end":"start":t,et=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n));function gu(e,t,n,r){let o={x:0,y:0,...n},i={...r,side:an(r.side,r.rtl)},s=wu(i.side,i.align,i.rtl),a=i.side,l=hu(e,t,a,s,i),c=ui(a,l,t,o,i.collisionPadding);if(c>0){let m=br[a],g=hu(e,t,m,s,i);if(ui(m,g,t,o,i.collisionPadding)<c)a=m,l=g}let f=i.collisionPadding,p=th(a,e,o,i),u=!1;if(ui(a,l,t,o,f)>0){if((a==="top"||a==="bottom")&&t.height&&(e.height>=t.height||i.inside))u=!0,l.y=et(et(l.y,o.y+f,o.y+o.height-t.height-f),e.y,e.y+e.height-t.height),p.height=Math.max(0,o.height-f*2);else if((a==="left"||a==="right")&&t.width&&(e.width>=t.width||i.inside))u=!0,l.x=et(et(l.x,o.x+f,o.x+o.width-t.width-f),e.x,e.x+e.width-t.width),p.width=Math.max(0,o.width-f*2)}if(a==="top"||a==="bottom"){let m=et(l.x,o.x+f,o.x+o.width-t.width-f);l.x=m===l.x?m:et(m,e.x-t.width,e.x+e.width)}else{let m=et(l.y,o.y+f,o.y+o.height-t.height-f);l.y=m===l.y?m:et(m,e.y-t.height,e.y+e.height)}return{...l,side:a,align:i.align,available:p,inside:u}}var nh=3,rh=500,xu=["--available-height","--available-width"],yu=!1;function Su(){if(yu)return;yu=!0,Gt(()=>po(xu))}function bu(e){let t=new Map,n=(r,o)=>{if(t.get(r)===o)return!1;return t.set(r,o),!0};return{style(r,o){if(n(`style:${r}`,o))e.style.setProperty(r,o)},attribute(r,o){if(!n(r,o))return;if(o===null)e.removeAttribute(r);else e.setAttribute(r,o)},reset:()=>t.clear()}}function oh(){let e=window.visualViewport;return{x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.width??document.documentElement.clientWidth,height:e?.height??document.documentElement.clientHeight}}function ku(e,t,n={},r){let o=()=>typeof n==="function"?n():n,i=()=>typeof e==="function"?e():e,s=(_)=>({side:_.side??"bottom",align:_.align??"start",sideOffset:Number(_.sideOffset??4),alignOffset:Number(_.alignOffset??0),collisionPadding:Number(_.collisionPadding??8)});po(xu),Object.assign(t.style,{position:"fixed",inset:"auto",margin:"0",left:"0",top:"0"});let a=bu(t),l=getComputedStyle(t),c,f="",p="",u=!1,m,g=!1,A=!1,d=[],b=()=>{},v=!1,y,I={left:"0",top:"0"},T,B=new Set;function X(_={left:"0",top:"0"}){if(y)lu(y.anchor);y=void 0;for(let N of B)a.style(N,"");B.clear(),f="",a.style("inset","auto"),a.style("margin","0"),a.style("left",_.left),a.style("top",_.top)}function F(){if(A)return!1;let _=o(),N=s(_),Q=Number(_.arrowPadding??6),ne=i();if(!ne)return!1;let ee="nodeType"in ne?ne:void 0,fe=ee&&Zm(ee);if(ee&&u&&(!ee.isConnected||!fe)){if(y)X(I);if(ee.isConnected&&m===ee)m=void 0,r?.();return!1}m=fe?ee:void 0;let ue=ee?fu(ee):[];if(ue.length!==d.length||ue.some((me,Se)=>me!==d[Se]))b(),d=ue,b=pu(ue);g=!ee&&"getBoundingClientRect"in ne;let le=oh();if(y&&(ee!==y.anchor||!ai(le)))X();if(!v){if(v=!0,ee&&fe&&su(ee,fe,t,l,le))y={anchor:ee,name:li(ee)};else for(let me of ih)if(t.style.getPropertyValue(me))t.style.removeProperty(me)}else if(y)li(y.anchor);let z=!u,k=z&&At.has(t),L=t.style.transition;if(z&&!k)t.style.transition="none";let D=eh(fe??ne),w={width:t.offsetWidth,height:t.offsetHeight},O=di(_),P=O?{width:O.offsetWidth,height:O.offsetHeight}:void 0,R=`${D.x},${D.y},${D.width},${D.height},${le.x},${le.y},${le.width},${le.height},${N.side},${N.align},${N.sideOffset},${N.alignOffset},${N.collisionPadding}`,K=`${R},${w.width},${w.height},${P?.width??""},${P?.height??""},${Q}`;if(K===f&&(!O||O===c?.el))return!1;f=K;let J={left:t.clientLeft,top:t.clientTop,width:t.clientWidth,height:t.clientHeight},oe=l.direction==="rtl",ie=sh(l,w);if(y){let me=an(N.side,oe),Se=au(y.name,me,wu(me,N.align,oe),N,ie);for(let[ke,Le]of Object.entries(Se))B.add(ke),a.style(ke,Le)}let de=lh(t.getBoundingClientRect(),ie,l),{scale:h}=de,E={width:ie.width*h.x,height:ie.height*h.y},C={...N,inside:p===R,sideOffset:N.sideOffset*(Rt(N.side)?h.y:h.x),alignOffset:N.alignOffset*(Rt(N.side)?h.x:h.y),rtl:oe},j={x:D.x,y:D.y,width:D.width,height:D.height},Y=gu(j,E,le,C);p=Y.inside?R:"";let G=T;T=j;let pe=(me)=>Math.abs(de.x-me.x)<=1&&Math.abs(de.y-me.y)<=1;if(y){let me=pe(Y),Se=!me&&!!G&&pe(gu(G,E,le,C));if(!me&&!Se){if(X(),!k)t.style.transition=L;return F()}if(Se)f="";I={left:`${parseFloat(l.left)+parseFloat(l.marginLeft)}px`,top:`${parseFloat(l.top)+parseFloat(l.marginTop)}px`}}else{let me={x:de.x-(parseFloat(l.left)||0)*h.x,y:de.y-(parseFloat(l.top)||0)*h.y},Se=t.ownerDocument.defaultView?.devicePixelRatio||1,ke=(Le)=>Math.round(Le*Se)/Se;a.style("left",`${ke((Y.x-me.x)/h.x)}px`),a.style("top",`${ke((Y.y-me.y)/h.y)}px`)}let ye=Rt(Y.side)?h.x:h.y;if(z){if(u=!0,!k)l.left,t.style.transition=L}a.attribute("data-side",Y.side),a.attribute("data-align",Y.align),a.style("--available-height",`${Y.available.height/h.y}px`),a.style("--available-width",`${Y.available.width/h.x}px`),a.style("--anchor-width",`${D.width/h.x}px`),a.style("--anchor-height",`${D.height/h.y}px`);let[W,V]=dh(Y.side,Y.align,oe,D,E,Y);a.style("--transform-origin",`${Math.round(W/h.x)}px ${Math.round(V/h.y)}px`);let ve={x:Y.x+J.left*h.x,y:Y.y+J.top*h.y,width:J.width*h.x,height:J.height*h.y},ge=uh(D,ve,Y.side,Q*ye);if(a.style("--arrow-offset",`${Math.round(ge/ye)}px`),O&&P){let me={...ve,...E},Se={width:P.width*h.x,height:P.height*h.y},ke=ch(D,me,Se,Y.side,Q*ye),Le=Math.round(ke.offset/ye);if(c?.el!==O)c={el:O,write:bu(O)};let{write:rt}=c;rt.style("position","absolute"),rt.style("left",Rt(Y.side)?`${Le}px`:""),rt.style("top",Rt(Y.side)?"":`${Le}px`),rt.attribute("data-side",Y.side),rt.attribute("data-align",Y.align),rt.attribute("data-arrow-clamped",ke.clamped?"":null)}return!0}let H=0,U=0;function te(){if(H=0,U=F()?0:U+1,U<nh||g)H=requestAnimationFrame(te)}function Z(){U=0,H||=requestAnimationFrame(te)}let re=mu(Z,t),ce=setInterval(()=>H||F()&&Z(),rh);F(),Z();let ae=()=>{cancelAnimationFrame(H),clearInterval(ce),re(),b(),d=[],A=!0},q=o(),x=vu(q),S=di(q);function M(){let _=o(),N=vu(_),Q=di(_);if(N===x&&Q===S)return;x=N,S=Q,Z()}return Object.assign(ae,{follow:M,place(){u=!1,f="",a.reset(),c?.write.reset(),F()}})}var ih=["position-anchor","position-try-fallbacks","position-visibility"],di=(e)=>typeof e.arrow==="function"?e.arrow():e.arrow,vu=(e)=>[e.side,e.align,e.sideOffset,e.alignOffset,e.collisionPadding,e.arrowPadding].join();function sh(e,t){let n=(a)=>parseFloat(e.getPropertyValue(a))||0,r=(a,l)=>e.boxSizing==="border-box"?0:n(`padding-${a}`)+n(`padding-${l}`)+n(`border-${a}-width`)+n(`border-${l}-width`),o=parseFloat(e.width)+r("left","right"),i=parseFloat(e.height)+r("top","bottom"),s={width:Math.abs(o-t.width)<1,height:Math.abs(i-t.height)<1};return{width:s.width?o:t.width,height:s.height?i:t.height,exact:s}}var ah=(e)=>{let t=parseFloat(e)||0;if(e.endsWith("turn"))return t*2*Math.PI;if(e.endsWith("grad"))return t*Math.PI/200;if(e.endsWith("rad"))return t;return t*Math.PI/180},Or=(e,t,n=!1)=>t>0.01&&Math.abs(e-t)>=(n?0.05:1)?e/t:1;function lh(e,t,n){let r=!!n.translate&&n.translate!=="none",o=!!n.rotate&&n.rotate!=="none",i=!!n.scale&&n.scale!=="none",s=!!n.transform&&n.transform!=="none";if(!r&&!o&&!i&&!s)return{x:e.x,y:e.y,scale:{x:Or(e.width,t.width,t.exact?.width),y:Or(e.height,t.height,t.exact?.height)}};let[a=0,l=0]=n.transformOrigin.split(" ").map((L)=>parseFloat(L)||0),c=(L,D)=>!L?0:L.endsWith("%")?parseFloat(L)/100*D:parseFloat(L)||0,f=r?n.translate.split(" "):[],p=c(f[0],t.width),u=c(f[1],t.height),m=o?n.rotate.split(" "):[],g={x:[1,0,0],y:[0,1,0],z:[0,0,1]}[m[0]],[A,d,b]=g??(m.length===4?m.slice(0,3).map(parseFloat):[0,0,1]),v=Math.hypot(A,d,b)||1,[y,I,T]=[A/v,d/v,b/v],B=m.length?ah(m[m.length-1]):0,[X,F]=[Math.cos(B),Math.sin(B)],H=[X+(1-X)*y*y,(1-X)*y*I-F*T,(1-X)*y*I+F*T,X+(1-X)*I*I],[U=1,te=U]=i?n.scale.split(" ").map(parseFloat):[],Z=s?/^matrix(3d)?\((.*)\)$/.exec(n.transform):null,re=Z?.[2].split(",").map(parseFloat)??[],[ce,ae,q,x,S,M,_,N,Q]=!Z?[1,0,0,1,0,0,0,0,1]:Z[1]?[re[0],re[1],re[4],re[5],re[12],re[13],re[3],re[7],re[15]]:[...re,0,0,1],ne=(L,D)=>{let[w,O]=[L-a,D-l],P=_*w+N*O+Q||1,R=U*(ce*w+q*O+S)/P,K=te*(ae*w+x*O+M)/P;return[a+p+H[0]*R+H[1]*K,l+u+H[2]*R+H[3]*K]},ee=[ne(0,0),ne(t.width,0),ne(0,t.height),ne(t.width,t.height)],fe=ee.map(([L])=>L),ue=ee.map(([,L])=>L),le=Math.min(...fe),z=Math.min(...ue),k={x:Or(e.width,Math.max(...fe)-le,t.exact?.width),y:Or(e.height,Math.max(...ue)-z,t.exact?.height)};return{x:e.x-k.x*le,y:e.y-k.y*z,scale:k}}function ch(e,t,n,r,o){let i=r==="top"||r==="bottom",s=i?n.width:n.height,l=(i?e.x+e.width/2-t.x:e.y+e.height/2-t.y)-s/2,c=(i?t.width:t.height)-s-o,f=Math.max(o,Math.min(l,c));return{offset:Math.round(f),clamped:Math.abs(f-l)>0.5}}function uh(e,t,n,r){let o=n==="top"||n==="bottom",i=o?e.x+e.width/2-t.x:e.y+e.height/2-t.y,s=o?t.width:t.height;return Math.round(Math.min(Math.max(i,r),Math.max(r,s-r)))}function dh(e,t,n,r,o,i){if(e==="top"||e==="bottom"){let a=n?r.right-i.x:r.left-i.x,l=n?r.left-i.x:r.right-i.x;return[t==="center"?r.left+r.width/2-i.x:t==="start"?a:l,e==="bottom"?0:o.height]}let s=t==="center"?r.top+r.height/2-i.y:t==="start"?r.top-i.y:r.bottom-i.y;return[e==="right"?0:o.width,s]}function fi(e,t,n){if(typeof t!=="string")return t??n();let r=e.getRootNode();return(r===e.ownerDocument?null:r.querySelector(t))??e.ownerDocument.querySelector(t)}function pi(e,t,n){return{side:e.side??t.side??"bottom",align:e.align??t.align,sideOffset:e.sideOffset??t.sideOffset??4,alignOffset:e.alignOffset??t.alignOffset??0,collisionPadding:e.collisionPadding,arrow:n,arrowPadding:e.arrowPadding}}var Au={position:ku,prepare:()=>Ot(Su),anchor:fi,options:pi};var mi=(e)=>({open:e.open,disabled:Re(e),readOnly:e.readOnly,required:e.required}),hi=(e,t)=>`${t}-${e.listed?"list":"content"}`,fh={"aria-labelledby":void 0,"aria-label":void 0};function Eu(){return{props:{side:"string",align:"string",sideOffset:"number",alignOffset:"number",collisionPadding:"number",arrowPadding:"number",container:"value",anchor:"string",keepMounted:"boolean"},connect:Dt,present:(e,{props:t})=>e.mounted||!!t.keepMounted||!!e.prepared,role:(e)=>e.listed?"presentation":"listbox",roles:["presentation","listbox"],keys:[...jn,"Home","End","Enter"," ","typeahead"],attrs:(e,{id:t})=>({...ec(e,t),"aria-multiselectable":!e.listed&&e.multiple?"true":void 0,...e.listed?fh:co(e,t),"aria-busy":!e.listed&&e.status==="loading"?"true":void 0,"data-presentation":e.presentation}),on:{...it,keydown:(e,{api:t})=>t.internal.onListKeyDown(e)},bind:(e,t)=>ph(e,t.key,t.store,t.api.internal,{part:t,anchor:t.api.internal.anchorElement,snapPoints:ru})}}function ph(e,t,n,r,o){let{aligned:i}=o,s=!0;Xe(()=>s&&n.set({settled:!0}));let a=r.loadMore.bind(e),l=r.presentation.bind(e,{snapPoints:o.snapPoints,anchor:()=>fi(e,r.contentProps(t).anchor,()=>i?.()||o.anchor()),position:()=>{let c=r.contentProps(t),f=i?.()?{...c,side:"bottom",align:"start",sideOffset:0}:c;return pi(f,{align:"start"},r.arrowElement())},rendered:(c)=>ol(o.part,c),initialFocus:r.initialFocus});return()=>{s=!1,a(),l(),n.set({settled:!1})}}function Cu(){return{role:"listbox",keys:{none:"The field's input handles them, or the content around the list once focus is in it."},attrs:(e,{id:t})=>({id:`${t}-list`,"aria-multiselectable":e.multiple?"true":void 0,...co(e,t),"aria-busy":e.status==="loading"?"true":void 0}),bind:(e,{store:t})=>Vn(t,"listed")}}function Mu(e,t,n){}De();var Pu=new WeakMap;function Ou(e,t){let n=Pu.get(e);if(!n)Pu.set(e,n={});if(n[t]=(n[t]??0)+1,n[t]===1)e.setAttribute(t,"");return()=>{if(n[t]--,n[t]===0)e.removeAttribute(t)}}function mh(e){Te(e,"ui-sdk-mirror","@layer ui-sdk{:where([data-mirror][aria-hidden]){display:inline-block}:where([data-mirror][aria-hidden]:dir(rtl)){scale:-1 1}}")}function hh(e,t,n,r){let o,i,s,a=!0,l=()=>{let f=e.parentElement?.closest(t.item);if(!f)return!1;if(!o)o=Ou(f,"data-has-icon"),r(f);if(!t.list)return!0;let p=f.parentElement?.closest(t.list);if(p)i=Ou(p,"data-has-icons");return!!p},c=()=>{if(!l())return;s?.(),s=void 0};if(!l())queueMicrotask(()=>{if(a&&!l())s=n(c)});return()=>{a=!1,s?.(),o?.(),i?.()}}function Tu(e){return{props:{mirror:"boolean",id:"id",item:{kind:"string",from:"item.value"}},state:(t,{props:n})=>({mirror:!!n.mirror}),attrs:(t,{props:n})=>({"aria-hidden":"true","data-mirror":n.mirror?"":void 0}),bind(t,{api:n,props:r,id:o,store:i}){mh(t.ownerDocument);let s=(p)=>he&&queueMicrotask(()=>{if(p.isConnected)Mu(p,"An item with only an icon",{component:e.component,id:o})}),a=e.subscribe?.(n),c=hh(t,e,(p)=>{let u=[i.subscribe(p),a?.(p)];return()=>u.forEach((m)=>m?.())},s),f=e.register?.(t,{api:n,props:r});return()=>{c(),f?.()}}}}var Du={item:'[role="option"]',list:'[role="listbox"]'};var gh=[];function Iu(e,{api:t}){return{open:e.open,presentation:e.presentation,status:e.status,items:t.internal.listbox.visibleData()?.list??gh}}var pn=ml(),yh={open:[],mounted:[],value:[],query:[],composingFrom:[],initial:[],items:[],status:[],listed:[],labeled:[],inline:[],disabled:[],formDisabled:[],readOnly:[],required:[],name:[],form:[],mounts:[],settled:[],groupLabels:[],fieldName:[],presentation:[],trigger:[],payload:[],titled:[],named:[],described:[],modal:[]},Lu=(e)=>({label:e({attrs:(t,{id:n})=>({id:`${n}-label`,for:`${n}-input`,...Bn(t)}),press({api:t,el:n}){if(n instanceof HTMLLabelElement&&n.control)return;t.focus()},bind:(t,{store:n})=>Vn(n,"labeled")}),input:e({...pn,keys:(t)=>[...pn.keys,"Enter","Escape","Tab",...t.inline?["ArrowRight","End"]:[]],state:mi,attrs:(t,n)=>({...pn.attrs(t,n),name:t.name,form:t.form,"aria-autocomplete":t.inline?"both":"list","aria-controls":t.mounted?hi(t,n.id):void 0,"aria-labelledby":t.labeled?`${n.id}-label`:void 0,required:t.required?"":void 0,readonly:t.readOnly?"":void 0,disabled:t.disabled?"":void 0,...ut(t.open),...Bn(t)}),on:{...pn.on,focusin(t,{api:n,store:r}){if(n.internal.options().openOnFocus&&!r.get().open)n.internal.show({event:t,by:"keyboard",reason:"trigger-focus"})},focusout(t,{api:n,store:r}){let o=t.relatedTarget;if(!r.get().open)return;if(!o&&r.get().presentation==="sheet")return;if(o&&(n.internal.ownsElement(o)||n.internal.contentElement()?.contains(o)))return;if(!o&&!document.hasFocus())return;n.internal.hide({reason:"focus-out",event:t})}},press({api:t,store:n},r){if(n.get().open||!t.internal.options().openOnFocus)return;t.internal.show({event:r,by:Zl(r),reason:"trigger-press"})},bind(t,n){let{api:r,id:o}=n,i=t;if(he)ma(t,"The field has no accessible name. Add an AutocompleteLabel, a Field label or an aria-label.",{component:"autocomplete",id:o});let s=[pn.bind(t,n),r.internal.bindReset(i),ys(i,r.internal.setFormDisabled),ou(t,{store:n.store,presentation:r.internal.presentation,open:(a)=>r.internal.show({event:a,by:"touch",reason:"trigger-press"})})];return()=>s.forEach((a)=>a())}}),trigger:e({state:mi,attrs:(t,{id:n})=>({type:"button",tabindex:"-1","aria-expanded":String(t.open),"aria-controls":t.mounted?hi(t,n):void 0,disabled:Re(t)?"":void 0,...ut(t.open),...Bn(t)}),on:it,press({api:t,store:n},r){if(t.internal.inputElement()?.focus({preventScroll:!0}),n.get().open)t.internal.hide({reason:"trigger-press",event:r});else t.internal.show({event:r,by:"pointer",reason:"trigger-press"})}}),clear:e({props:{keepMounted:"boolean"},present:(t,{props:n})=>!!n.keepMounted||t.value!==""&&!Kn(t),state:(t)=>({disabled:Kn(t)}),attrs:(t)=>({type:"button",tabindex:"-1",disabled:Re(t)?"":void 0,"data-disabled":Kn(t)?"":void 0}),on:it,press({api:t}){t.clear({reason:"clear-press"}),t.internal.inputElement()?.focus({preventScroll:!0})}}),content:e({...Eu(),state:Iu}),viewport:e({present:(t)=>t.presentation==="sheet"}),header:e({present:(t)=>t.presentation==="sheet"&&t.open}),list:e({...Cu(),state:Iu}),item:e({...hl(),selects:Ba({highlighted:({key:t})=>[t],listing:({key:t})=>[t],...yh}),state:(t,{key:n,props:r})=>({highlighted:t.highlighted===n,disabled:!!r.disabled})}),"item-text":e(Wa()),"item-icon":e(Tu({component:"autocomplete",...Du})),group:e(ya()),"group-label":e(xa()),separator:e(ba()),empty:e(va()),status:e(wa()),arrow:e(Sa())});var bh=["escape-key","outside-press","focus-out","window-blur","back","swipe"];function Fu(e){return bh.includes(e)}var vh=new Set(["image-load","image-error","imperative","item-removed","unmount","reset","restore","timeout","resize","page-hide"]),tt;function Tr(e,t){if(tt==="agent")return tt;if(vh.has(e))return"programmatic";if(t){let n=t();return n==="programmatic"&&tt?tt:n}return tt??"programmatic"}function mn(e,t){let n=tt;tt=e;try{return t()}finally{tt=n}}function hn(e,t,n=!0){if(!n)return{...e,source:t};let r=!1;return{...e,source:t,cancel:()=>{r=!0},get canceled(){return r}}}var wh=(e)=>`${e[0].toUpperCase()}${e.slice(1)}`,Dr=(e,t)=>`on${wh(e)}${t}`;var $t={},gn=new Set,xh=new WeakMap;function Ru(e,t,n,r){Ot(()=>{let o,i,s;if($t.add)o=$t.add(e,t,n,r);else if(typeof document<"u"){if(gn.add(i=new WeakRef(e)),s={parts:t,definition:n,options:r},xh.set(e,s),gn.size%1000===0){for(let a of gn)if(!a.deref())gn.delete(a)}}return()=>{if((o??s?.unwatch)?.(),o=void 0,s)s.unwatch=void 0;if(i)gn.delete(i),i=void 0}})}function $u(e,t,n,r,o){if(he&&e.options().debug)console.debug(`[ui-sdk] ${e.label}#${e.id} ${t}: ${String(n)} (${r}, ${o})`)}function Nu(e,t){let{store:n,options:r}=e,o=new Map,i=new Map,s=new Map;if(e.onOptions((a,l)=>{if(he)es(o,a);if(!l)return;let c;for(let[f,p]of o){if(!(f in l))continue;if(Oe(l[f],p.value))c=p.source;o.delete(f)}return c}),he)e.onDestroy(()=>Zi(o));return(a,l,c)=>{if(s.has(a)&&Oe(s.get(a),l))return!1;let f=(i.get(a)??0)+1;i.set(a,f);let p=n.get()[a];if(Oe(p,l))return!1;let{reason:u,event:m}=c,g=hn(c,c.source??t(u,m));if(he)rs(u,m,{component:e.label,id:e.id});$u(e,a,l,u,g.source);let A=r(),d=A[a]!==void 0,b=s.has(a),v=s.get(a);s.set(a,l);try{mn(g.source,()=>{let y=Dr(a,"Change"),I=A[y];if(typeof I==="function"){let B=he&&!!m?.defaultPrevented;if(I(l,g),he)os(y,B,g,{component:e.label,id:e.id})}let T=i.get(a)!==f;if(!g.canceled&&!d&&!T)n.set({[a]:l})})}finally{if(b)s.set(a,v);else s.delete(a)}if(he)We({type:"change",component:e.label,id:e.id,key:a,value:l,reason:u,source:g.source,canceled:g.canceled,controlled:d});if(g.canceled)return!1;if($t.change?.(e.id,a,l,g,p),d){if(o.set(a,{value:l,source:g.source}),he)Ji(o,{component:e.label,id:e.id,key:a,value:l,reason:u,source:g.source},()=>r()[a])}return!0}}function Wu(e,t,n,r){let o=r.source??Tr(r.reason);if(he)We({type:"change",component:e.label,id:e.id,key:t,value:n,reason:r.reason,source:o,canceled:!1,controlled:!1});$u(e,t,n,r.reason,o)}var Nt=(e,t)=>Tr(e,t&&(()=>Ge(t)));function Sh(){return Un(),Nt}function Ir(e,t=Sh()){return Nu(e,t)}var kh=new WeakSet,gi=(e)=>(kh.add(e),e);function Vu(e,t){return gi(Promise.resolve({reason:e,source:Nt(e,t)}))}function qu(e){let{popup:t,store:n,rules:r={}}=e,o="imperative",i="trigger-press",s,a,l;t.observe((b)=>{let v=b?void 0:a??{reason:"imperative",source:"programmatic"};if(a=void 0,!v)return;return s?.resolve(v),s=void 0,v}),e.onDestroy(()=>{s?.resolve({reason:"unmount",source:"programmatic"}),s=void 0});function c(b){if(!s){let v;s={promise:gi(new Promise((I)=>v=I)),resolve:v}}if(b&&!b.aborted){let v=()=>t.requestClose("imperative");b.addEventListener("abort",v,{once:!0}),s.promise.then(()=>b.removeEventListener("abort",v))}return s.promise}let f,p=(b,v)=>{let y=f;f=b;try{return e.change(b,v)}finally{f=y}};function u(b={},v){return m(b,v).result}function m(b,v){let{event:y,signal:I}=b;if(I?.aborted)return{opened:!1,result:Vu("imperative")};let T=b.reason??(y?"trigger-press":"imperative"),B=v??T,X={...b,reason:B,payloadReason:T},F=!1,H=(U=b.by??"imperative")=>{l=b.anchor;let te=e.payload?.opening(b.trigger,b.payload,{reason:T,event:y});if(t.opening(U,y),F=p(!0,{reason:B,event:y}),!F)te?.();return F};if(n.get().open){if(t.opener()==="hover"&&b.by!=="hover")t.opening(b.by??"imperative",y);if(b.trigger===void 0&&e.payload?.reopening(b,{reason:T})&&b.anchor)l=b.anchor;return r.reopen?.(X,H),{opened:F,result:c(I)}}if(r.open)r.open(X,H);else H();return{opened:F,result:F?c(I):Vu(B,y)}}function g(b={}){if(!n.get().open)return!1;let{event:v,returnValue:y}=b,I=b.reason??"imperative";if(e.dismissal&&!e.dismissal.allows(I,v))return!1;let T=!1,B=()=>{a={reason:I,source:Nt(I,v),returnValue:y},t.returnFocus(b.focus??e.returnFocus??!0);let X=p(!1,{reason:I,event:v,...y!==void 0&&{returnValue:y}});if(!X)t.returnFocus(!0),a=void 0;return T=X,X};if(r.close)r.close({...b,reason:I},B);else B();return T}function A({trigger:b,payload:v,anchor:y,reason:I,event:T}){l=y,e.payload?.handOver(b,v,{reason:I,event:T})}let d=(b,v)=>m({reason:"imperative",event:v},b).opened;return{api:{isOpen:()=>n.get().open,setOpen:(b,{reason:v,event:y}={})=>b!==(f??n.get().open)&&(b?d(v,y):g({reason:v,event:y})),open:(b={})=>u({...b,reason:b.reason??"imperative"}),close:({reason:b,event:v,returnValue:y}={})=>g({reason:b,event:v,returnValue:y}),toggle:({reason:b,event:v}={})=>n.get().open?g({reason:b,event:v}):d(b,v)},show:u,attempt:m,hide:g,takeOver:A,result:c,anchor:()=>l}}function Hu(e,t){let n=e,{store:r,element:o,options:i}=n,{preset:s}=t,a=t.slot??"content",l=t.trigger??"trigger",c=Ir(n),f=(S)=>S!==void 0&&n.props(a,S)||Qe(n,a)[0]?.props||n.props(a)||{},p=()=>{if(v?.trigger)return v.trigger();let S=r.get().trigger;return S!==null&&o(l,S)||o(l)},u=null,m,g=()=>{let S=r.get().trigger;if(v?.trigger||S===null||S===u)return p();let M=m??Qe(n,l).length<=1;return o(l,S)??(M?o(l):void 0)},A=r.get().open;r.subscribe(()=>{let{open:S,trigger:M}=r.get();if(S===A)return;if(A=S,!S)return;u=M!==null&&!o(l,M)?M:null,m=Qe(n,l).length<=1});function d(S){for(let M of n.parts())if(M.slot===l&&M.key!==S&&M.el?.isConnected)return M.key}let b={label:n.label,role:t.role??s.role,store:r,options:i,onOptions:n.onOptions,onDestroy:n.onDestroy,element:o,parts:n.parts,preset:s,get popup(){return re},get control(){return ce},triggerElement:p,triggerSlot:l,nextTrigger:d,firstTrigger(){for(let S of n.parts())if(S.slot===l)return d()??S.key},triggerDisabled:(S)=>!!n.props(l,S)?.disabled,contentProps:f},v=b.rules=t.rules?.(b),y=s.dismissal?.(i,v),I=s.presentation?.(b,y),T=s.press?.(b),B=s.group?.(b),X=s.hover?.(b,B),F=s.focus?.(b),H=s.triggerName?.(b);s.resetStyles?.prepare(n.label,a),s.placement?.prepare();function U(S,M){if(s.modal===void 0)return;return{modal:S.modal??(M.presentation==="sheet"?!0:s.modal)}}function te(){let S=U(i(),r.get());if(S)r.set(S)}function Z(S,M){if(v?.dismiss)v.dismiss(S,M);else ce.hide({reason:S,...M})}let re=tc({...t.behavior,preset:s.behavior,position:s.placement?.position,owner:{component:n.label,id:n.id},store:r,trigger:p,returnTrigger:g,contains:(S,M)=>v?.contains?v.contains(S,M):!!p()?.contains(S)||!!T?.contains(S,M),close:Z,modal:()=>v?.modal?.()??lr(r.get().modal),parent:()=>v?.parent?.(),persistent:()=>v?.persistent?.()??[],finalFocus:()=>f().finalFocus,takesEscape:v?.takesEscape,onEscape:(S)=>v?.onEscape?v.onEscape(S):Z("escape-key",{event:S,focus:!0}),onShow:(S)=>v?.onShow?.(S),onOpenChange(S,M){if(v?.onOpenChange?.(S,M),B?.change(S),S){I?.open(),te();return}X?.clear(),F?.clear()},onOpenChangeComplete(S,M){v?.onOpenChangeComplete?.(S,M),i().onOpenChangeComplete?.(S)}}),ce=qu({dismissal:y,popup:re,store:r,payload:s.payload?.(r,(S,M)=>c("payload",S,M)),change:(S,M)=>c("open",S,{...M,...v?.details?.()}),onDestroy:n.onDestroy,get returnFocus(){return v?.returnFocus},rules:{open(S,M){if(X?.clear(),B?.opening(S.event),v?.open)v.open(S,M);else M()},reopen(S){if(X?.clear(),v?.reopen)return v.reopen(S);let{trigger:M,payload:_,payloadReason:N,event:Q}=S;if(M!==void 0&&M!==r.get().trigger)ce.takeOver({trigger:M,payload:_,reason:N,event:Q})},close:(S,M)=>v?.close?v.close(S,M):M()}});te(),lt(n,["modal"],(S,M,_)=>U(_,{...M,...S}));let ae=r.get().modal;r.subscribe(()=>{let{modal:S}=r.get();if(S===ae)return;ae=S,re.updateModal()});let q={dismissal:y,presentation:I,press:T,group:B,hover:X,focus:F,triggerName:H,rules:v};return{...{...ce.api,getPayload:()=>r.get().payload,focus:()=>p()?.focus()},internal:Object.assign(b,q)}}function ju(e){let t=e.open??e.defaultOpen??!1;return{open:t,mounted:t,trigger:null,payload:void 0,titled:null,described:!1,modal:!1,presentation:"popover"}}function Ku(e,t={}){let n=()=>e().dismissible!==!1,r=(o,i)=>e().onDismissAttempt?.({reason:o,event:i});return{allows(o,i){let s=t.refusal?.(o)??(Fu(o)&&!n()?"attempt":void 0);if(!s)return!0;if(s==="attempt"&&o!=="focus-out"&&o!=="window-blur")r(o,i),t.refused?.(o);return!1},sheet:{dismissible:n,onDismissAttempt:(o)=>r("swipe",o)}}}function Ah(e,t){let n=e.preset.behavior==="dialog";if(n)e.store.set({presentation:"dialog"});return nu(e.store,()=>e.popup,()=>e.rules?.presentation?e.rules.presentation():e.options().presentation,n?"dialog":"popover",t)}var Bu={behavior:"combobox",modal:!1,dismissal:Ku,placement:Au,presentation:Ah};Pe();Pe();Ve();var Eh=/[\u1100-\u11ff\u3130-\u318f\uac00-\ud7af]/;function zu(e,t,n){let r=!!t&&Ct(t)&&!ws()&&!Eh.test(t.data??""),o=e.get().composingFrom!==null;if(r&&!o)e.set({composingFrom:n()});else if(!r&&o)e.set({composingFrom:null});return r}function _u(e,t,n,r,o){if(t.get().composingFrom===null)return;t.set({composingFrom:null});let i=hn({reason:"input-change",event:o,composing:!1},Nt("input-change",o));Wu(e,n,r,i);let s=e.options()[Dr(n,"Change")];if(typeof s==="function")s(r,i);$t.change?.(e.id,n,r,i,r)}var Ch=["input","trigger","clear","label"];function Uu(e){let t=e.value??e.defaultValue??"";return{...ju(e),value:t,query:t,composingFrom:null,initial:e.defaultValue??"",highlighted:null,items:e.items,status:e.status??"idle",listed:!1,labeled:!1,fieldName:null,inline:!!e.inlineComplete,disabled:!!e.disabled,formDisabled:!1,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,mounts:0,settled:!1,focusInList:!1,groupLabels:[],presentation:"popover",listing:ta}}function Yu(e){return{items:e.items,status:e.status??"idle",inline:!!e.inlineComplete,disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,...e.defaultValue===void 0?{}:{initial:e.defaultValue},...e.open===void 0?{}:{open:e.open},...e.value===void 0?{}:{value:e.value}}}function Mh(e){let{id:t,store:n,options:r,element:o}=e;jo(e,["highlighted","focusInList"],(x)=>x?void 0:{highlighted:null,focusInList:!1});let i=Ir(e),s=n.get().value,a="imperative",l=null,c=()=>o("input"),f=()=>v.element()??o("content"),p=()=>{let x=n.get();return!Re(x)&&!x.readOnly},u=()=>!!r().inlineComplete;function m(x,S){let M=$e(x);if(!M)return;return S.entries().find((_)=>!S.disabled(_)&&$e(_.label).startsWith(M))}let g=pl(e,{query:()=>n.get().composingFrom??n.get().query,items:()=>n.get().items,emptyItems:()=>r().emptyItems,filter:()=>r().filter??"contains",autoHighlight:()=>r().autoHighlight||u()?"typing":!1,preferred:(x)=>u()?m(n.get().query,x)?.key:void 0,highlight(x,S){if(g.listbox.highlight(x,{event:S?.event}),x!==null&&u()&&S?.reason==="list-navigation")F(x,S.event)},open(x,S){if(!x.altKey)l=S;I({event:x,by:"keyboard"})},onHighlight:(x,S,M)=>r().onHighlight?.(x,{index:S,event:M}),container:()=>o("list")??f(),scrollRoot:f});lt(e,["highlighted"],(x,S)=>{if(x.items===S.items)return;return{highlighted:n.view({...S,...x},()=>g.settledHighlight(!1))}});let A=(x)=>Ch.some((S)=>Qe(e,S).some(({el:M})=>M.contains(x))),d=Hu(e,{preset:Bu,rules:()=>({trigger:c,returnFocus:!1,dismiss:(x,{event:S})=>T({reason:x,event:S}),contains:A,onOpenChange(x){if(x)return;l=null,n.set({highlighted:null,focusInList:!1})},onShow(){let x=o("content");if(x)return $a(x,Ra(a),()=>[c()])},open({event:x,by:S},M){if(!p())return;a=S==="touch"&&y.resolve()!=="sheet"?"pointer":S??"imperative",n.set({focusInList:Va(x)&&x?.target!==c()}),M(a)},close(x,S){let M=n.get().focusInList&&!!f()?.contains(document.activeElement);S();let _=c();if(M&&_&&!n.get().open)Yn(_)}})}),{control:b,popup:v}=d.internal,y=d.internal.presentation,{show:I,hide:T}=b;function B(x,S,{event:M,query:_=x,item:N,composing:Q=!1}={}){let ne=n.get();if((Re(ne)||ne.readOnly)&&S!=="reset")return!1;if(s=x,g.cause(S,M),x===ne.value||i("value",x,{reason:S,event:M,composing:Q,...N&&{item:N}})){if(s===x)n.set({query:_});return!0}let ee=c();if(ee&&ee.value!==ne.value)ee.value=ne.value;return!1}function X(x,S){if(!p())return;let M=x.value,_=S,Q=u()&&!_?.isComposing&&!!_?.inputType?.startsWith("insert")&&_.inputType!=="insertReplacementText"&&x.selectionEnd===M.length?m(M,g.listbox):void 0,ne=Q?M+Q.label.slice(M.length):M,ee=zu(n,S,()=>n.get().query);if(!B(ne,"input-change",{event:S,query:M,composing:ee}))return;if(Q&&ne!==M)x.value=ne,x.setSelectionRange(M.length,ne.length);if(!n.get().open&&(S||x.matches(":focus"))){if(M)l="first";I({event:S,by:"keyboard",reason:"input-change"})}}function F(x,S){let M=g.listbox.find(x)?.label,_=c(),{query:N}=n.get();if(M===void 0||!B(M,"list-navigation",{event:S,query:N}))return;if(!_)return;_.value=M;let Q=$e(M).startsWith($e(N))?N.length:M.length;_.setSelectionRange(Q,M.length)}function H(x){return r().onSubmit?.(n.get().value,{event:x}),!x?.defaultPrevented}function U(x,S){let M=g.listbox.find(x);if(!M||g.listbox.disabled(M)||!p())return!1;B(M.label,"item-press",{event:S,item:{value:M.key,label:M.label}});let _=c();if(_&&_.value!==n.get().value)_.value=n.get().value;return T({reason:"item-press",event:S}),!0}function te(x,S){if(!U(x,S)||!r().submitOnSelect)return;if(H(S))hs(c()?.form)}function Z(x){let{open:S,highlighted:M}=n.get();if(S&&M!==null){let _=g.listbox.element(M);if(_?.matches("a[href]"))return x.preventDefault(),_.click();if(!U(M,x))return x.preventDefault();if(!r().submitOnSelect||!H(x))x.preventDefault();return}if(S)T({reason:"input-commit",event:x});if(!H(x))x.preventDefault()}function re(x){if(g.navigate(x))return;let{open:S,value:M,query:_}=n.get();switch(x.key){case"ArrowUp":if(x.altKey&&S)x.preventDefault(),T({reason:"escape-key",event:x});return;case"ArrowDown":if(x.altKey&&!S)x.preventDefault(),I({event:x,by:"keyboard"});return;case"Enter":return Z(x);case"ArrowRight":case"End":if(u()&&M!==_&&!x.shiftKey)g.cause("input-change",x),n.set({query:M});return;case"Escape":if(S&&M!==_&&B(_,"escape-key",{event:x})){let N=c();if(N)N.value=_}return;case"Tab":if(S)T({reason:"focus-out",event:x})}}function ce(x){return se(x.ownerDocument,"reset",(S)=>{if(S.target!==x.form||fs(r().value,r().defaultValue))return;ds(S,()=>{let{initial:M}=n.get();if(B(M,"reset"),x.value!==n.get().value)x.value=n.get().value})},{capture:!0})}let ae={id:t,isOpen:d.isOpen,setOpen:d.setOpen,open:d.open,close:d.close,toggle:d.toggle,getValue:()=>n.get().value,setValue:(x,{reason:S="imperative",event:M}={})=>x!==n.get().value&&B(x,S,{event:M}),clear:({reason:x="imperative",event:S}={})=>n.get().value!==""&&B("",x,{event:S}),getHighlighted:()=>io(g.listbox,n.get().highlighted),highlight:(x)=>n.get().open&&oo(g.listbox,x===null?null:String(x),n.get().highlighted),focus:()=>c()?.focus(),internal:{...g,options:r,popup:v,presentation:y,show:I,hide:T,press:te,typed:X,onCompositionEnd:(x,S)=>{if(x.value===n.get().value)_u(e,n,"value",x.value,S);else X(x,S)},onInputKeyDown:re,ownsElement:A,bindReset:ce,inputElement:c,anchorElement:c,contentElement:f,arrowElement:()=>o("arrow"),text:(x)=>x.value,itemProps:(x)=>e.props("item",x),setFormDisabled:(x)=>n.set({formDisabled:x}),initialFocus(){let x=l;if(l=null,n.get().focusInList){let S=g.listbox.firstEnabled();if(S===void 0)return f();return g.listbox.highlight(S,{focus:!1}),g.listbox.element(S)??f()}if(x==="first"&&n.get().query)g.settle(!0,null);else if(x)g.listbox.highlight(g.listbox.stepKey(x)??null);return n.get().presentation==="sheet"?c():void 0},onListKeyDown(x){if(!n.get().focusInList||x.target===c())return;_s(x,{listbox:g.listbox,highlighted:n.get().highlighted,choose:te,focusInput(){n.set({focusInList:!1}),c()?.focus({preventScroll:!0})}})},contentProps:(x)=>d.internal.contentProps(x)}};lt(e,["query"],(x,S)=>("value"in x)&&x.value!==S.value&&x.value!==s?{query:x.value}:void 0);let q=n.get().value;return n.subscribe(()=>{let{value:x}=n.get();if(x===q)return;if(q=x,x===s)return;s=x,n.set({query:x})}),ae}var Xu=Mh;function Gu(e){if(e===null)return;if(e==="false")return!1;if(e==="pointer")return"pointer";return!0}function Ju(e){let t=e.slots((a)=>a),n=e.name,r=e.label??n,o={};for(let a in t)o[a]=a==="root"?n:`${n}-${a}`;if(he)Xi(t,{component:r});let i=(a)=>{let l=a,c=a.id,f=e.state(l),p=e.sync?.(l),u=p?{...f,...p}:f,m=Js(u,e.live??Oh),g,A,d=he?{component:r,id:c}:void 0,b=he?(e.controlled??["open","value","checked"]).filter((N)=>(N in m.get())):Th;if(he)Ur(d,b,l);let v=he?Yi(t,d):t,y;function I(N){if(y?.has(N))return;if(!y)y=new Set,T.slots=Object.create(v);y.add(N),Object.assign(T.slots,N.slots),ae(),N.extend?.(Z)}let T={name:n,label:r,slots:v,slotNames:o,parts:new Map,keyed:new Map,rank:0},{parts:B}=T;function X(N={}){return N.id??(N.value==null?"":String(N.value))}let F;function H(N,Q={},ne=!1){let ee=X(Q),fe=T.keyed.get(N),ue=fe instanceof Map?fe.get(ee):fe?.key===ee?fe:void 0;if(!ue){let le=`${N}:${ee}`;if(ue=T.sleeping?new Ga(N,ee,le,c,m,Q,T):{slot:N,key:ee,mapKey:le,id:c,api:Z,store:m,props:Q,el:void 0,owner:T,leases:0},Jn(ue),ne)Ja(ue)}else if(ne)return ue;return ue.props=Q,nl(ue),ue}function U(N,Q){if(Q===void 0){for(let ee of Eo(T).values())if(ee.slot===N&&ee.el?.isConnected)return ee.el;return}let ne=B.get(`${N}:${Q}`)?.el;return ne?.isConnected?ne:void 0}let te={id:c,label:r,store:m,options:()=>l,onOptions:(N)=>{(A??=[]).push(N)},onDestroy:(N)=>{(g??=[]).push(N)},parts:()=>Eo(T).values(),element:U,props:(N,Q="")=>{let ne=F?.[N];return ne&&X(ne)===Q?ne:B.get(`${N}:${Q}`)?.props}},Z=void 0;function re(){if(Z=e.api(te),T.api=Z,El(te,Z),he){for(let N of e.agent?.actions??[])if(typeof Z[N]!=="function")Ae(`lists \`${N}\` in \`agent.actions\`, but its api has no such method.`,d)}}let ce=!1;function ae(){let{sleeping:N}=T;if(!N||ce)return;ce=!0,wl(_,re),T.sleeping=void 0;for(let Q of[...N.binds])Q()}if(e.asleep?.(l))T.sleeping={wake:ae,binds:new Set};else re();let q=!1,x=!1,S=!1,M=(N,Q)=>Xs(m,N,e.sync?.(N),Q),_={types:void 0,name:n,id:c,get:m.get,subscribe:m.subscribe,get api(){return ae(),Z},part:H,use:I,preview(N){let Q=M({...N,id:c},m.get()),ne=m.get();for(let ee in Q)if(!Oe(ne[ee],Q[ee]))return{...ne,...Q}},get derives(){return Gs(m)},view(N,Q,ne){let ee=F;F=ne;try{return m.view(N,Q)}finally{F=ee}},setOptions(N){let Q=Yt(m),ne=N.id===c?N:{...N,id:c},ee=he&&x?M(ne,Q):void 0;if(l=ne,he)Ur(d,b,l);if(T.sleeping&&!e.asleep(l))ae();let fe=M(l,Q);if(he&&ee){let le=Ph(ee,fe,Q);if(le.length)We({type:"relay",...d,keys:le})}let ue;q=!0;try{if(A)for(let z of A)ue=z(l,fe)??ue;let le=Yt(m)===Q?fe:M(l,Yt(m));if(le)mn(ue,()=>m.set(le,!0))}finally{q=!1}},startState:(N)=>e.state({...N,id:c}),follow(N){x=!0;let Q,ne,ee=(fe=Yt(m),ue)=>{if(ue)return M({...ue,id:c},fe);if(S)return ne;let le=N();if(Q?.options!==le||Q.state!==fe)Q={options:le,state:fe},ne=M({...le,id:c},fe);return ne};if(m.follow(ee),he)m.subscribe((fe,ue,le)=>{if(q&&!ue&&!ns())We({type:"relay",...d,keys:[...le]})});return ee},destroy(){if(S)return;if(S=!0,Sl(_),g)bl(()=>{for(let N=0;N<g.length;N++)g[N]()});if(he)We({type:"instance",action:"destroy",...d,controlled:b})}};if(Zs(_,m),Ru(_,B,e,te.options),he)We({type:"instance",action:"create",...d,controlled:b});return _},s=(a)=>vl(()=>i(a));return Object.defineProperty(s,"name",{value:n}),Object.assign(s,{options:e.options,slots:t})}function Ph(e,t,n){let r=e,o=t??{},i=n;return[...new Set([...Object.keys(r),...Object.keys(o)])].filter((a)=>!Oe(a in r?r[a]:i[a],a in o?o[a]:i[a]))}var Oh=[],Th=[],Qu=new WeakMap;function yi(e){let t=Qu.get(e);if(!t){let{options:n,slots:r={}}=e;t={options:{debug:"boolean",...n},slots:Object.fromEntries(Object.entries(r).map(([o,i])=>[o,i.props??{}]))},Qu.set(e,t)}return t}var yn=(e)=>Nn(e);var Dh=Ju({name:"autocomplete",options:{container:"value",value:"string",defaultValue:"string",onValueChange:"callback",open:"boolean",defaultOpen:"boolean",onOpenChange:"callback",onOpenChangeComplete:"callback",onSubmit:"callback",items:"value",emptyItems:"value",filter:Bs(["contains","startsWith","fuzzy"],"contains"),inlineComplete:"boolean",autoHighlight:"boolean",openOnFocus:"boolean",submitOnSelect:"boolean",status:"string",onHighlight:"callback",onLoadMore:"callback",announcement:"value",loop:"boolean",modal:Gu,presentation:"string",disabled:"boolean",readOnly:"boolean",required:"boolean",name:"string",form:"string",controller:"value",dismissible:"boolean",onDismissAttempt:"callback"},state:Uu,live:["highlighted"],controlled:["open","value"],sync:Yu,api:Xu,slots:(e)=>Lu(e),agent:{actions:["setOpen","setValue","clear"]}}),Zu=Dh;var bi=new WeakMap,ed=new WeakMap;function Wt(e,t,...n){if(t==="customValidity")ed.set(e,n[0]);let r=bi.get(e)?.[t];return r?.(...n),!!r}function vi(e,t,n){let r="",o=()=>{let c=n.value();if(c instanceof FormData)t.setFormValue(c,n.state());else if(Array.isArray(c)){let m=new FormData,g=n.name?.();if(g)for(let A of c)m.append(g,A);t.setFormValue(m,n.state())}else t.setFormValue(c,n.state());let f=n.valueMissing(),p=ed.get(e),u=n.invalid?.();if(p)t.setValidity({customError:!0},p,n.anchor?.()??e);else if(u)t.setValidity(u.flags,u.message,u.anchor??n.anchor?.()??e);else if(f)t.setValidity({valueMissing:!0},n.message(),n.anchor?.()??e);else t.setValidity({});if((u?.message??"")===r)return;r=u?.message??"",zt(e)};o();let i=n.subscribe(o),s=n.focus?ps(e,n.focus):()=>{};if(gs(e))n.disabled(!0);bi.set(e,{reset:()=>{n.reset(),o()},disabled:(c)=>n.disabled(c),restore:(c)=>{if(typeof c==="string")n.restore(c)},customValidity:o});let a=bs(e,()=>Cn(e)),l=()=>{if(n.focus)ms(e,t.form)};return e.addEventListener("invalid",l),()=>{e.removeEventListener("invalid",l),i(),a(),bi.delete(e),s()}}De();function td(){let e=[],t=!0;return{waitUntil:(o)=>{if(!t)throw new DOMException("waitUntil() can only be called while the event dispatches.","InvalidStateError");e.push(o)},done:()=>(t=!1,e)}}var wi=new WeakMap,fd=0,nd=new Set;function pd(e){if(typeof customElements>"u"||nd.has(e))return!1;if(customElements.get(e))return Ae(`<${e}> is already defined by another library or another copy of ui-sdk. This one is skipped.`),!1;return nd.add(e),!0}function Ei(e){if(!wi.has(e))wi.set(e,`auto-${++fd}`);return wi.get(e)}var md=(e)=>!!e.closest("[data-drag-preview]");function Li(e){return e.querySelector(":scope > button, :scope > a, :scope > ui-button > button, :scope > ui-button > a")??e.firstElementChild}var Fi=(e)=>(t)=>t.querySelector(`:scope > ${e}`)??t.firstElementChild;function vt(e,t){if(t)return t(e);return e.hasAttribute("as-child")?e.firstElementChild:e}var hd=(e,t)=>e.id!==t.id||e.value!==t.value,Ri=(e)=>e.replace(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`),Rr=["role","aria-disabled"];function gd(e,t){if(t===null)return;if(typeof e==="function")return e(t);if(e==="boolean")return t!=="false";if(e==="number"){let n=Number(t);return t.trim()===""||Number.isNaN(n)?void 0:n}if(e==="list")return t.split(",").map((n)=>n.trim()).filter(Boolean);return t}var yd=new Set(["disabled","required"]);function bd(e){return Object.entries(e).map(([t,n])=>[t,Ri(t),n,n==="boolean"&&yd.has(t)])}function vd(e,t,n,r){let o=e.getAttribute(t);if(r)return o===null?void 0:!0;return gd(n,o)}function wd(e,t,n){return vd(e,Ri(t),n,n==="boolean"&&yd.has(t))}function xd(e,t){let n={};if(!t.length||!e.hasAttributes())return n;for(let[r,o,i,s]of t){let a=vd(e,o,i,s);if(a!==void 0)n[r]=a}return n}var rd=(e,t)=>typeof t==="function"?t(e):t;function Sd(e,t,n={},r=[]){for(let[o,i]of Object.entries(t)){if(o in e)continue;let s=Ri(o);Object.defineProperty(e,o,{configurable:!0,get(){return wd(this,o,i)??rd(this,n[o])??(i==="boolean"?!1:void 0)},set(a){let l=a===!1&&i==="boolean"&&!r.includes(o)&&!rd(this,n[o]);if(a==null||l)this.removeAttribute(s);else this.setAttribute(s,a===!0?"":Array.isArray(a)?a.join(","):String(a))}})}}function kd(e,t){for(let n of t){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n];delete e[n],e[n]=r}}var nt=new Set;function Ad(e,t,n){nt.add(e);try{return Wt(e,"restore",t,n)}finally{nt.delete(e)}}var wt=new Map;function Ci(e){for(let t of wt.keys())if(t.contains(e))wt.delete(t)}function Ed(e,t,n){let r={};wt.set(e,r),queueMicrotask(()=>{if(wt.get(e)!==r)return;wt.delete(e),Ad(e,t,n)})}function Ih(e){let t=Vt.get(e);if(nt.has(e)||!!t&&nt.has(t))return!0;for(let n of nt)if(e.contains(n))return!0;return!1}function Lh(e,t){return t===void 0&&!!e&&typeof e==="object"&&"reason"in e&&!(typeof Event<"u"&&e instanceof Event)}var Mi=[],Fh={};function Pi(e,t,n=Mi,r=Mi,o=Fh){let i;return new Proxy(t,{get(s,a){if(a in s||typeof a!=="string"||!/^on[A-Z]/.test(a))return s[a];if(n.length&&n.includes(a))return;if(i&&a in i)return i[a];let l=o[a]??a.slice(2).toLowerCase(),c=a.endsWith("ChangeComplete"),f=r.length>0&&r.includes(a),p=(u,m)=>{if(Ih(e)&&!c)return;let g=Lh(u,m),{cancel:A,canceled:d,...b}=(g?u:m)??{},v=g?b:{...b,value:u},y=f?td():void 0;if(y)v.waitUntil=y.waitUntil;let I=new CustomEvent(l,{detail:v,bubbles:!1,cancelable:typeof A==="function"||typeof u?.preventDefault==="function",composed:!0}),T=e.dispatchEvent(I),B=y?.done()??[];if(!T){if(typeof A==="function")A();else if(u&&typeof u.preventDefault==="function")u.preventDefault()}return B.length>1?Promise.all(B).then((X)=>X.at(-1)):B[0]};return(i??={})[a]=p,p}})}var Fr=new WeakMap;function Rh(e){return e?Fr.get(e):void 0}var $h=/^(?:get|is|can)[A-Z]|^focus$/;function Nh(e,t,n){let r={};for(let o of n){let i=t[o];if(typeof i==="function")r[o]=(...s)=>{if(!$h.test(o))Ci(e);return i.apply(t,s)}}return Object.freeze(r)}var Cd=new Map,Md=new Set,xi;function Pd(){if(xi)return xi;let e=globalThis,t=Symbol.for("ui-sdk.web-styles@1");return e[t]=(e[t]??0)+1,xi=`ui-sdk-web-${e[t]}`}var $r="",bn=0,od=new WeakMap;function Od(e,t,n=!1){if(n)Md.add(e);if(!t&&!n)return;if(t)Cd.set(e,t);$r=Td(),Te(document,Pd(),$r),bn++}function Td(){return["@layer ui-sdk {",' :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important }',...[...Cd].map(([e,t])=>` :where(${e}:not([hidden]), ${e}[hidden="until-found"]) { display: ${t} }`),...[...Md].map((e)=>` :where(${e}[align]) { text-align: inherit }`)," :where([as-child]) { display: contents }","}"].join(`
|
|
2
|
+
`)}function Oi(e){let t=e.getRootNode();if(!Wh(t))return qh(e.ownerDocument);let n=Vh(t.ownerDocument);if(!n||t.adoptedStyleSheets.includes(n))return;t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}var Wh=(e)=>e.nodeType===11&&("host"in e);function Vh(e){let t=e.defaultView;if(!t)return;let n=od.get(e);if(!n)od.set(e,n={sheet:new t.CSSStyleSheet,version:-1});if(n.version!==bn)n.sheet.replaceSync(Td()),n.version=bn;return n.sheet}var id=new WeakMap;function qh(e){if(!$r)return;let t=id.get(e);if(t&&t.version===bn&&t.el?.isConnected)return;let n=Pd();Te(e,n,$r),id.set(e,{el:e.getElementById(n),version:bn})}function Hh(e,t){if(!e)return!1;let n=0;for(let o in e){if(e[o]===void 0)continue;if(n++,t[o]!==e[o])return!1}let r=0;for(let o in t){if(t[o]===void 0)continue;r++}return n===r}function jh(e,t){let n;return Co(t,(r)=>((n??=[]).push([r,e.getAttribute(r)]),!1)),n}function Kh(e){if(!e.authored)return!0;for(let[t,n]of e.authored)if(e.el.getAttribute(t)!==n)return!1;return!0}var Ti=new Set;function sd(e){for(let t of Ti)if(t!==e&&e.contains(t))t.reconfigure()}var Di=new WeakMap;var Vt=new WeakMap,qt=new WeakMap;function Bh(e,t){for(let n=e.el;n&&n!==t;n=n.parentElement){let r=qt.get(n);if(r===e)return;if(r?.el===e.el&&vn.has(r))return r}}function zh(e){e.dataSlot=void 0;let t=[];for(let n=e.el;n;n=n.parentElement){let r=qt.get(n);if(r&&r!==e&&r.el===e.el&&vn.has(r))t.push(r)}if(!t.length)return;e.el.removeAttribute("data-slot"),nn(e.el,"data-slot");for(let n of t)n.lastAttrs=void 0,n.sync?.()}var vn=new WeakSet,Si=[],Nr;function ad(e){for(let t of e)try{t()}catch(n){queueMicrotask(()=>{throw n})}}function _h(e){if(!Si.length)queueMicrotask(()=>{let t=Nr=[];ad(Si.splice(0)),Nr=void 0,ad(t)});Si.push(e)}var Ii=new WeakMap,Dd=(e)=>e.value!==void 0&&typeof e.value!=="string";function Uh(e,t,n){for(let r=e.parentElement;r;r=r.parentElement){let o=qt.get(r);if(o?.slot!==t||Vt.get(r)!==n)continue;return o.keyed&&Dd(o.props)?{...o.props,value:o.props.id}:o.props}}var ld=new Map,Yh=/^[a-z][a-z0-9-]*$/;function Xh(e){let t=ld.get(e);if(t)return t;let n=e.split(",").map((r)=>r.trim());if(n.every((r)=>Yh.test(r)))if(n.length===1){let r=n[0];t=(o)=>o.localName===r}else{let r=new Set(n);t=(o)=>r.has(o.localName)}else t=(r)=>r.matches(e);return ld.set(e,t),t}function Lr(e,t){let n=Xh(t),r=e.getAttribute("for");if(r){let o=e.getRootNode(),i="getElementById"in o?o.getElementById(r):null;if(i&&n(i))return i}for(let o=e.parentElement;o;o=o.parentElement){if(n(o))return o;let i=Vt.get(o);if(i&&n(i))return i}}function Id(e,t){queueMicrotask(()=>{if(!e.isConnected)t()})}var Ld=new WeakMap,Gh=(e,t,n)=>(Ld.set(e,n.state),vi(e,t,n));function Fd(e){return class extends e{static formAssociated=!0;#e;constructor(){super();this.#e=this.attachInternals(),Zr(this,this.#e,Gh)}get form(){return this.#e.form}get labels(){return this.#e.labels}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}get willValidate(){return this.#e.willValidate}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}setCustomValidity(t){if(!Wt(this,"customValidity",t))this.#e.setValidity(t?{customError:!0}:{},t)}formResetCallback(){wt.delete(this),Wt(this,"reset")}formDisabledCallback(t){Wt(this,"disabled",t)}formStateRestoreCallback(t,n){if(wt.delete(this),!Ad(this,t,n))Ed(this,t,n)}}}var ki=(e)=>`default${e[0].toUpperCase()}${e.slice(1)}`;function Qh(e,t,n){if(!pd(e))return;let r={debug:"boolean",...n.attributes},o=bd(r);Od(e,n.display,"align"in r);let i=n.state??{},s=Object.entries(i),a=s.map(([A])=>A),l=a.map(ki),c=Object.entries(n.host??{}),f=Object.entries(n.children??{}),p=[...a,...n.properties??[],...o.map(([A])=>A)],u=`ui-sdk-${e.replace(/^ui-/,"")}-`,m=!!n.options&&n.options.length>0,g=(A,d,b)=>{let v=xd(A,o);if(b.size)for(let I of b)delete v[I];for(let I in d){let T=d[I];if(T!==void 0)v[I]=T}for(let I=0;I<a.length;I++){let T=a[I];if(!(T in v))continue;let B=l[I];if(!(B in v))v[B]=v[T];delete v[T]}let y=n.options?.(A);if(y)Object.assign(v,y);return v};customElements.define(e,class A extends(n.formAssociated?Fd(HTMLElement):HTMLElement){static observedAttributes=[...o.map(([,d])=>d),...Rr];#e;#t;get#n(){return Fr.get(this)}get api(){if(!this.#n)return;return this.#e??=Nh(this,this.#n.api,n.api??[])}#o=new Set;#r=new Set;#i=!1;#c=!1;#p=new Set;#b=new Set;#x=new Set;#u=!1;#d={};#f={};#v;static{for(let[d,{get:b,set:v}]of s)Object.defineProperty(A.prototype,d,{get(){if(d in this.#f)return this.#f[d];return this.#n?b(this.#n.api):void 0},set(y){if(Ci(this),this.#n&&!this.#u)this.#S(()=>v(this.#n.api,y));else this.#f[d]=y}});for(let d of n.properties??[])Object.defineProperty(A.prototype,d,{get(){return this.#d[d]},set(b){if(Object.is(this.#d[d],b))return;if(this.#d[d]=b,!this.#i)return;this.#s(),this.#k()}});Sd(A.prototype,r,n.defaults)}#s(d){this.#n?.setOptions(Pi(this,{...g(this,this.#d,this.#p),...d,id:this.#n.id},n.silent,n.actions,n.events))}attributeChangedCallback(d,b,v){if(nn(this,d),Rr.includes(d))return;let y=d.replace(/-(\w)/g,(B,X)=>X.toUpperCase());if(y in i&&v!==b&&!this.#c)Ci(this);if(!this.#c||v===null)this.#p.delete(y);else if(b===null)this.#p.add(y);if(!this.#i)return;if(this.#s(),sd(this),!(y in i)||v===b)return;let I=r[y],T=I==="boolean"?!1:I==="list"?[]:null;this.#S(()=>i[y].set(this.#n.api,v===null?T:gd(I,v)))}#S(d){let b=nt.has(this);nt.add(this);try{Gr(this,d)}finally{if(!b)nt.delete(this),zt(this)}}connectedCallback(){if(Oi(this),md(this))return;if(this.#i){for(let T of this.#o)eo(T.el);if(n.options)this.#s();return}kd(this,p);for(let[T,B]of c)if(!this.hasAttribute(T))this.setAttribute(T,B);let d=Object.keys(this.#f).length>0,b=this.#u&&!d?this.#v:void 0,v={},y=!1;if(this.#u&&b===void 0)for(let[T,{get:B}]of s)v[T]=B(this.#n.api),y=!0;if(d)Object.assign(v,this.#f),this.#f={},y=!0;if(this.#u)Fr.delete(this),this.#e=void 0,this.#u=!1,this.#v=void 0;let I=this.#n;if(I)this.#s();else{let T=g(this,this.#d,this.#p);if(y)for(let B in v)T[ki(B)]=v[B];T.id=this.id||(this.#t??=`${u}${++fd}`),I=t(Pi(this,T,n.silent,n.actions,n.events)),Fr.set(this,I)}if(n.formAssociated&&y){let T=I.startState(g(this,this.#d,this.#p)),B={};for(let X in v)B[ki(X)]=T[X];this.#s(B)}if(this.#i=!0,m)Ti.add(this);if(n.self){let T=vt(this,n.target);if(T)this.#A(T);else Ae(`<${e}> needs an element inside it.`)}for(let[T,B]of f){let X=B(this);if(X)this.#E(T,X);else if(!n.optionalChildren?.includes(T))Ae(`<${e}> needs its native element inside it for "${T}".`)}if(n.children||n.target)this.#y=new MutationObserver(()=>{this.#I(),this.#D()}),this.#y.observe(this,{childList:!0});if(this.#k(),this.id){let T=this.getRootNode();for(let B of T.querySelectorAll(`[for="${CSS.escape(this.id)}"]`))Ii.get(B)?.()}if(b!==void 0)Ed(this,b,"restore")}#h;#k(){this.#h?.(),this.#h=n.render?.(this,this.#n)||void 0}reconfigure(){if(this.#i)this.#s()}#g=new Map;#y;#a;#A(d){if(this.#a={slot:n.self,el:d,props:{}},d!==this)qt.set(this,this.#a);this.register(this.#a)}#D(){if(!n.self||!n.target)return;let d=vt(this,n.target);if(d===this.#a?.el)return;if(this.#a)this.unregister(this.#a);if(this.#a=void 0,this.#s(),d)this.#A(d)}#E(d,b){let v={slot:d,el:b,props:n.childProps?.read?.(b)??{}};if(n.childProps)v.observer=new MutationObserver(()=>{v.props=n.childProps.read?.(b)??{},this.#s(),this.update(v,!1)}),v.observer.observe(b,{attributeFilter:n.childProps.attributes});this.#g.set(d,v),this.register(v)}#I(){for(let[d,b]of Object.entries(n.children??{})){let v=b(this),y=this.#g.get(d);if(y?.el===v)continue;if(y)this.unregister(y),this.#g.delete(d);if(v)this.#E(d,v)}}disconnectedCallback(){Id(this,()=>{this.#v=Ld.get(this)?.(),this.#h?.(),this.#h=void 0,this.#y?.disconnect(),this.#y=void 0,this.#g.clear(),this.#a=void 0,this.#i=!1,Ti.delete(this);for(let d of this.#o)this.unregister(d);this.#n?.destroy(),this.#u=!0})}register(d){if(this.#o.add(d),vn.add(d),d.sync=()=>this.#r.has(d)||this.#l(d),!this.#r.size)_h(()=>this.#L());this.#r.add(d)}#L(){let d=this.#r.size>1?st([...this.#r]):[...this.#r];this.#r.clear();for(let b of d){if(!this.#o.has(b))continue;if(b.reread)b.props=b.reread();if(b.feature)this.#n.use(b.feature);this.#C(b),this.#l(b)}}#C(d){let b=this.#n;d.unwatch?.();let v=b.part(d.slot,d.props);d.record=v,d.selected=tr(v),d.version=yn(b),d.unwatch=Pt(v,(y)=>{if(er(v)!==d.shown)return d.version=yn(b),this.#l(d);if(y)return;let I=yn(b);if(I===d.version)return;d.version=I,this.#l(d)})}unregister(d){d.unwatch?.(),d.unwatch=void 0,d.observer?.disconnect(),d.observer=void 0,this.#m(d),Lo(d.el,this.#T),d.record=void 0,d.lastAttrs=void 0,d.disconnect?.(),d.disconnect=void 0,this.#w(d),this.#o.delete(d),vn.delete(d),this.#r.delete(d),zh(d)}rebind(){let d=st([...this.#o].filter((b)=>!this.#r.has(b)));for(let b of d)this.#m(b),b.record=void 0,b.lastAttrs=void 0;for(let b of d)this.#l(b)}update(d,b){if(this.#r.has(d))return;this.#M(d,b),this.#l(d);for(let v of this.#o){if(v===d||this.#r.has(v))continue;if(v.reread){let y=v.props;v.props=v.reread(),this.#M(v,hd(y,v.props))}this.#l(v)}sd(d.el)}#M(d,b){if(b)this.#m(d),d.lastAttrs=void 0;let v=this.#n.part(d.slot,d.props),y=v!==d.record||tr(v)!==d.selected;if(d.record=v,y)this.#C(d)}#l(d){if(this.#b.has(d))return void this.#x.add(d);Oi(d.el);let b=this.#n,v=b.part(d.slot,d.props);if(d.record=v,d.disconnect??=To(v,d.el),d.shown=er(v),d.shown){let y=this.#F(d);if(y!==void 0&&this.#R(d,y))this.#m(d),this.#$(d,y);let I=ft(v);if(I.hidden===void 0&&(Mo(v)||("hidden"in I)))d.el.removeAttribute("hidden");if(this.#O(d,I),Nr)Nr.push(()=>{if(!d.unbind&&d.shown&&this.#o.has(d))this.#P(d,d.record??this.#n.part(d.slot,d.props))});else if(!d.unbind)this.#P(d,v)}else{if(d.unbind)this.#O(d,ft(v)),this.#m(d);if(d.lastAttrs=void 0,!d.el.hasAttribute("hidden"))d.el.setAttribute("hidden","");if(!d.el.hasAttribute("data-slot"))d.el.setAttribute("data-slot",d.slot==="root"?b.name:`${b.name}-${d.slot}`);this.#w(d)}}#P(d,b){let v,y=!1;if(d.unbind=()=>{y=!0,v?.()},v=Oo(b,d.el),y)v()}#m(d){let b=d.unbind;d.unbind=void 0,b?.()}#F(d){if(!n.portal?.slots.includes(d.slot))return;return to(n.portal.container(this,d))}#R(d,b){return b?d.el.parentNode!==b:!!d.placeholder}#$(d,b){if(this.#w(d),!b)return;d.placeholder=document.createComment(`${e} ${d.slot}`),d.el.replaceWith(d.placeholder),b.appendChild(d.el),Di.set(d.el,b)}#O(d,b){let v=Bh(d,this);if(v?.dataSlot)b={...b,"data-slot":v.dataSlot};if(Hh(d.lastAttrs,b)&&Kh(d))return;d.lastAttrs=b,d.dataSlot=b["data-slot"];let y=this.#c;this.#c=d.el===this,this.#b.add(d);try{tn(d.el,b,this.#T),d.authored=jh(d.el,b)}finally{this.#c=y,this.#b.delete(d)}if(this.#x.delete(d))this.#l(d)}get#T(){return`render:${Ei(this)}`}#w(d){if(!d.placeholder)return;d.placeholder.replaceWith(d.el),d.placeholder=void 0,Di.delete(d.el)}})}var Jh=new Set(["payload"]);function Zh(e,t){if(!pd(e))return;let n=t.props??{},r=bd(n),o=t.properties??[],i=o.filter((f)=>Jh.has(f)),s=new Set(i),a=Object.entries(t.from??{}),l=t.ids??[],c=[...o,...r.map(([f])=>f)];Od(e,t.display,"align"in n),customElements.define(e,class f extends(t.formAssociated?Fd(HTMLElement):HTMLElement){static observedAttributes=[...r.map(([,p])=>p),...i,"for",...Rr];#e;#t;#n;static{for(let p of o){let u=s.has(p);Object.defineProperty(f.prototype,p,{get(){let m=this.#n?.[p];if(u)return m!==void 0?m:this.getAttribute(p)??void 0;return m??(n[p]&&wd(this,p,n[p]))},set(m){(this.#n??={})[p]=m,this.attributeChangedCallback("")}})}Sd(f.prototype,n,t.defaults,a.map(([p])=>p))}#o(){let p=xd(this,r);if(t.context){let u=t.context(this);for(let m in u)if(!(m in p))p[m]=u[m]}for(let u of o){let m=this.#n?.[u];if(m!==void 0)p[u]=m;else if(s.has(u)&&this.hasAttribute(u))p[u]=this.getAttribute(u)}for(let[u,{slot:m,prop:g}]of a)p[u]??=Uh(this,m,this.#e)?.[g];for(let u of l)p[u]??=Ei(this);if(p.value===void 0&&p.id===void 0)p.id=Ei(this);if(t.keyed&&Dd(p))p.id??=Rh(this.#e)?.api.internal.keyOf(p.value);return Pi(this,p,Mi,t.actions)}#r;connectedCallback(){if(md(this))return;if(kd(this,c),Oi(this),(t.target||this.hasAttribute("as-child"))&&!this.#r)this.#r=new MutationObserver(()=>this.#c()),this.#r.observe(this,{childList:!0});let p=Lr(this,t.owner)??this.#e;if(!p)return queueMicrotask(()=>this.#i());if(!("register"in p)){customElements.whenDefined(p.localName).then(()=>this.isConnected&&this.connectedCallback());return}if(p===this.#e&&this.#t&&vn.has(this.#t))return;if(this.#e&&this.#t)this.#e.unregister(this.#t);let u=vt(this,t.target);if(!u)return queueMicrotask(()=>{if(this.isConnected&&!this.#t&&!vt(this,t.target))Ae(`<${e}> needs an element inside it.`)});if(!this.#t){if(t.render?.(this),this.#t)return}this.#e=p;let m=Boolean(t.context||t.from);this.#t={slot:t.slot,feature:t.feature,el:u,props:m?{}:this.#o(),reread:m?()=>this.#o():void 0,keyed:t.keyed},Vt.set(this,p),qt.set(this,this.#t),p.register(this.#t)}#i(){if(!this.isConnected||this.#e)return;if(Lr(this,t.owner))this.connectedCallback();else if(t.alone)t.alone(vt(this,t.target)??this,this);else if(!this.hasAttribute("for"))Ae(`<${e}> must be inside ${t.owner}.`)}#c(){let p=this.#t?.el;if(!this.isConnected||p&&Di.has(p))return;let u=vt(this,t.target);if(u===(p??null))return;if(this.#e&&this.#t)this.#e.unregister(this.#t);if(this.#e=void 0,this.#t=void 0,u)this.connectedCallback()}disconnectedCallback(){Id(this,()=>{if(this.#r?.disconnect(),this.#r=void 0,this.#e&&this.#t)this.#e.unregister(this.#t);Vt.delete(this),qt.delete(this),this.#e=void 0,this.#t=void 0})}attributeChangedCallback(p){if(nn(this,p),Rr.includes(p))return;if(p==="for"){if(this.hasAttribute("for")&&!Ii.has(this))Ii.set(this,()=>{if(this.isConnected)this.connectedCallback()});if(!this.isConnected)return;if(!Lr(this,t.owner)&&this.#e&&this.#t)this.#e.unregister(this.#t),this.#e=void 0,Vt.delete(this);this.connectedCallback();return}if(!this.#e||!this.#t){if(t.alone&&this.isConnected&&!Lr(this,t.owner))t.alone(vt(this,t.target)??this,this);return}let u=this.#t.props;this.#t.props=this.#o();let m=this.#t.props,g=hd(u,m)||!!t.rebind?.some((A)=>u[A]!==m[A]);this.#e.update(this.#t,g),t.changed?.(this)}})}var Ai=new WeakMap;function cd(e,t,n={},r=!1){let o={},i=[],s=[],a=[],l=!1,c={};for(let[f,p]of Object.entries({...e,...n})){if(!p)continue;if(typeof p==="object"){let[m,g=f]=p.from.split(".");if(m in t.slots)c[f]={slot:m,prop:g};if(!(r&&(m in t.slots))&&!(f in n))continue}let u=typeof p==="object"?p.kind:p;if(u==="value")i.push(f);else if(u==="action")a.push(f);else if(u==="id")s.push(f);else if(u==="key")l=!0;if(u==="value"||u==="action"||u==="callback")continue;if(f!=="id"||f in n)o[f]=u==="id"||u==="key"?"string":u}return{attributes:o,properties:i,ids:s,actions:a,keyed:l,from:Object.keys(c).length?c:void 0}}var eg=["anchor","initialFocus","finalFocus"],ud=(e)=>typeof e==="string"?{tag:e}:e;function dd(e,t,n,r,o=!1){let i=yi(e);if(t==="root"){let{tag:b,self:v,kinds:y,properties:I=[],...T}=ud(n);Ai.set(e,[...new Set([...Ai.get(e)??[],b])]);let{debug:B,...X}=i.options,F=cd(X,i,y),H={...T,self:v??("root"in i.slots&&!T.children?.root?"root":void 0),attributes:F.attributes,properties:[...new Set([...F.properties,...I])].filter((U)=>!T.state?.[U]),actions:F.actions};return{kind:"owner",key:t,tagName:b,config:H}}let{tag:s,slot:a=t,owners:l=[],kinds:c,properties:f=[],...p}=ud(n),u=Ai.get(e);if(!u)throw Error(`<${s}> is a part of ${e.name}: define its root first.`);let m=i.slots[a]??(p.feature?.slots[a]&&(p.feature.slots[a].props??{}));if(!m)throw Error(`<${s}>: ${e.name} has no ${a} slot.`);let{attributes:g,...A}=cd(m,i,c,o),d={...p,slot:a,owner:[...new Set([...r?[r]:[],...u,...l])].join(", "),props:g,...A,properties:[...new Set([...A.properties,...f,...eg.filter((b)=>(b in m))])]};return{kind:"part",key:t,tagName:s,config:d}}function tg(e,t,n=!1){let{root:r,...o}=t,i=dd(e,"root",r,void 0,n);return[i,...Object.entries(o).flatMap(([s,a])=>a?[dd(e,s,a,i.tagName,n)]:[])]}function ng(e,t){if(t.kind==="owner")Qh(t.tagName,e,t.config);else Zh(t.tagName,t.config)}var rg=(e)=>e.replace(/(^|-)(\w)/g,(t,n,r)=>r.toUpperCase());function og(e,t,n=!1){let r={};for(let o of tg(e,t,n))ng(e,o),r[rg(o.key)]=typeof customElements>"u"?void 0:customElements.get(o.tagName);return r}function $i(e,t){return og(e,t,!0)}var ze=new WeakMap,wn=new WeakMap;function Wr(e,t){let{state:n,store:r}=e;if(!t){if(e.wantedId="",n.value||n.selection)r.clear();return}if(t===e.wantedId||t===n.selection?.suggestion.id)return;e.wantedId=t,r.selectById(t)}var ig={kind:"string",municipalityCodes:"list",limit:"number",debounceMs:"number",includeProvisional:"boolean",houseNumberPrefix:"boolean",fetchDetails:"boolean",defaultAddressId:"string",idName:"string",defaultValue:null,defaultOpen:null,filter:null,items:null,emptyItems:null,inlineComplete:null,openOnFocus:null,submitOnSelect:null,controller:null},sg=["kind","municipality-codes","limit","debounce-ms","include-provisional","house-number-prefix","fetch-details"];function ag(e){return e.open&&e.status!=="idle"}function Wi(e){return{client:e.client,kind:e.kind==="accessAddress"?"accessAddress":"address",municipalityCodes:e.municipalityCodes?.length?e.municipalityCodes:void 0,limit:e.limit??void 0,debounceMs:e.debounceMs??void 0,includeProvisional:e.includeProvisional,houseNumberPrefix:e.houseNumberPrefix,fetchDetails:e.fetchDetails}}function lg(e,t){let n=new Map;for(let o of e.children)if(o.localName==="dk-address-item")n.set(o.getAttribute("value")??"",o);let r=t.map((o)=>{let i=Kt(o),s=n.get(i);if(n.delete(i),!s)s=document.createElement("dk-address-item"),s.setAttribute("value",i),s.setAttribute("label",o.label),s.dataset.type=o.type,s.textContent=o.label;return s});for(let o of n.values())o.remove();r.forEach((o,i)=>{if(e.children[i]!==o)e.insertBefore(o,e.children[i]??null)})}var Ni=new WeakMap;function cg(e,t){let n=Ni.get(e);if(t&&n)e.append(n),Ni.delete(e);else if(!t&&!n){let r=document.createDocumentFragment();r.append(...e.childNodes),Ni.set(e,r)}}var Rd=new WeakSet,ug=0;function dg(e,t){for(let n of e.querySelectorAll("dk-address-popup")){if(n.hasAttribute("anchor")&&!Rd.has(n))continue;if(!t.id)t.id=`dk-address-control-${++ug}`;let r=`#${CSS.escape(t.id)}`;if(n.getAttribute("anchor")!==r)n.setAttribute("anchor",r);Rd.add(n)}}function fg(e,t){let n=e.querySelector(":scope > input[type=hidden][data-dk-address-id]");if(!e.idName){n?.remove();return}if(!n)n=document.createElement("input"),n.type="hidden",n.dataset.dkAddressId="",e.append(n);n.name=e.idName;let r=e.getAttribute("form");if(r)n.setAttribute("form",r);else n.removeAttribute("form");n.value=t?.suggestion.id??""}function $d(e,t){let{state:n}=t,r=ag(n),o=e;if(o.value!==n.value)o.value=n.value;let i=n.status==="success"?"idle":n.status;if(o.status!==i)o.status=i;let s=r?"true":"false";if(e.getAttribute("open")!==s)e.setAttribute("open",s);for(let c of e.querySelectorAll("dk-address-list"))lg(c,n.suggestions);let a=n.status==="success"&&n.suggestions.length===0;for(let c of e.querySelectorAll("dk-address-empty"))cg(c,a);let l=e.querySelector("dk-address-control");if(l?.toggleAttribute("data-open",r),l?.toggleAttribute("data-loading",n.status==="loading"),l)dg(e,l);fg(e,n.selection),pg(e,t)}function pg(e,t){let{caret:n,value:r}=t.state;if(!n||n.revision===t.caretRevision)return;t.caretRevision=n.revision;let o=e.querySelector("dk-address-input input"),i=()=>{if(!o||o.ownerDocument.activeElement!==o||o.value!==r)return;o.setSelectionRange(n.position,n.position)};i(),requestAnimationFrame(i)}function mg(e){let t=_r({...Wi(e),onSelect:(c)=>{e.dispatchEvent(new CustomEvent("addressselect",{detail:c,bubbles:!0}))}}),n=new AbortController,{signal:r}=n,o={store:t,state:t.getState(),byKey:new Map,pickHandled:!1,caretRevision:null,id:"",wantedId:"",stop:()=>{}},i=(c)=>{let f=c?o.byKey.get(c):void 0;if(f)t.select(f)},s=t.subscribe(()=>{let c=t.getState();if(c.suggestions!==o.state.suggestions)o.byKey=new Map(c.suggestions.map((p)=>[Kt(p),p]));o.state=c,$d(e,o),e.dispatchEvent(new CustomEvent("statechange",{detail:c}));let f=c.selection?.suggestion.id??"";if(f!==o.id)o.id=f,o.wantedId=f,e.dispatchEvent(new CustomEvent("addressidchange",{detail:{value:f,selection:c.selection},bubbles:!0}))});e.addEventListener("valuechange",(c)=>{let{detail:f}=c;switch(f.reason){case"imperative":return;case"item-press":c.preventDefault(),o.pickHandled=!0,i(f.item?.value);return;case"clear-press":t.clear();return;case"escape-key":c.preventDefault();return;default:t.setInput(f.value)}},{signal:r}),e.addEventListener("openchange",(c)=>{let{detail:f}=c;if(f.reason==="imperative")return;if(f.reason==="item-press"){let p=f.event?.target,m=((p instanceof Element?p.closest("dk-address-item"):null)??e.querySelector("dk-address-item[data-highlighted]"))?.getAttribute("value");queueMicrotask(()=>{if(!o.pickHandled)i(m);o.pickHandled=!1}),c.preventDefault();return}t.setOpen(f.value)},{signal:r}),e.ownerDocument.addEventListener("reset",(c)=>{let f=e.querySelector("dk-address-input input")?.form;if(!f||c.target!==f)return;setTimeout(()=>{if(t.clear(),e.defaultAddressId)Wr(o,e.defaultAddressId)})},{signal:r});let a=new MutationObserver((c)=>{let f=new Set(c.map((p)=>p.attributeName));if(f.delete("address-id"))Wr(o,e.getAttribute("address-id")??"");if(f.size>0)t.setOptions(Wi(e))});if(a.observe(e,{attributeFilter:[...sg,"address-id"]}),o.stop=()=>{s(),n.abort(),a.disconnect(),t.destroy()},$d(e,o),Object.hasOwn(e,"addressId")){let c=e.addressId;delete e.addressId,wn.set(e,typeof c==="string"?c:"")}let l=wn.get(e)??e.getAttribute("address-id")??e.defaultAddressId;if(wn.delete(e),l)Wr(o,l);return o}var hg=$i(Zu,{root:{tag:"dk-address",display:"block",kinds:ig,defaults:{houseNumberPrefix:!0,fetchDetails:!0},properties:["client"],options:()=>({filter:!1}),render:(e)=>{let t=e,n=ze.get(t);if(n)n.store.setOptions(Wi(t));else ze.set(t,mg(t));return()=>{queueMicrotask(()=>{if(t.isConnected)return;ze.get(t)?.stop(),ze.delete(t)})}}},label:"dk-address-label",input:{tag:"dk-address-input",target:Fi("input"),display:"contents"},clear:{tag:"dk-address-clear",target:Li,display:"contents"},content:{tag:"dk-address-popup",display:"block"},status:{tag:"dk-address-status",display:"block"},empty:{tag:"dk-address-empty",display:"block"},list:{tag:"dk-address-list",display:"block"},item:{tag:"dk-address-item",display:"block"}});if(typeof customElements<"u"&&!customElements.get("dk-address-control")){customElements.define("dk-address-control",class extends HTMLElement{});let e=document.createElement("style");e.textContent=":where(dk-address-control) { display: block; }",document.head.append(e)}var Nd=hg.Root;if(Nd)Object.defineProperties(Nd.prototype,{state:{get(){return ze.get(this)?.state??null}},selection:{get(){return ze.get(this)?.state.selection??null}},addressId:{get(){let e=ze.get(this);return e?e.id:wn.get(this)??""},set(e){let t=typeof e==="string"?e:"",n=ze.get(this);if(n)Wr(n,t);else wn.set(this,t)}},selectById:{value(e){let t=ze.get(this);return t?t.store.selectById(e):Promise.resolve(null)}},clear:{value(){ze.get(this)?.store.clear()}}});export{Sn as createClient,Kt as suggestionKey};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=48A2AB57E2EAA4A764756E2164756E21
|
|
5
5
|
//# sourceMappingURL=dk-address.js.map
|