@wheatley-ai/cli 0.0.0 → 0.1.1

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.
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-RnxedkKh.js";var c=new WeakSet,l=e=>c.has(e);function u(e,t=!1,n){let r=e.defaultView??window,i=e=>n===void 0||!(`pointerId`in e)||e.pointerId===n,a=t=>{i(t)&&(t.preventDefault(),t.stopPropagation(),e.removeEventListener(`click`,a,!0))},o=()=>{e.removeEventListener(`click`,a,!0),e.removeEventListener(`pointerdown`,s,!0),e.removeEventListener(`pointerup`,c,!0),e.removeEventListener(`pointercancel`,c,!0)},s=e=>i(e)&&o(),c=e=>i(e)&&r.setTimeout(o);if(e.addEventListener(`click`,a,!0),e.addEventListener(`pointerdown`,s,!0),!t)return r.setTimeout(o);e.addEventListener(`pointerup`,c,!0),e.addEventListener(`pointercancel`,c,!0)}function d(e){return e.towardMore?!e.atLargest&&e.expandOnScroll?`sheet`:`scroll`:e.scrollAtStart?`sheet`:`scroll`}function f(e,t){return e*t/(1-t)}function p(e){let{extent:t,velocity:n,candidates:r}=e;if(Math.abs(n)<e.minFlingVelocity)return m(r,t);let i=t+f(n,e.rate),a=h(r,t,Math.sign(n)),o=m(r,i);return(n>0?r[o]<=t+.5:r[o]>=t-.5)&&a!==-1&&(o=a),!e.skipSnapPoints&&a!==-1&&(o=n>0?Math.min(o,a):Math.max(o,a)),o}function m(e,t){let n=0;for(let r=1;r<e.length;r++)Math.abs(e[r]-t)<Math.abs(e[n]-t)&&(n=r);return n}function h(e,t,n){if(n>0)return e.findIndex(e=>e>t+.5);for(let n=e.length-1;n>=0;n--)if(e[n]<t-.5)return n;return-1}var g=.55;function _(e,t,n=g){return e<=0?0:(1-1/(e*n/t+1))*t}function v(e,t,n=g){return e<=0?0:(1/(1-Math.min(e/t,.999999))-1)*t/n}function y(e,t,n=g){if(e<=0)return 1;let r=e*n/t+1;return n/(r*r)}function b(e,t,n,r){let i=2*Math.PI/(e*1e3),a=t;return Math.abs(a-1)<1e-6?S(i,n,r):a<1?x(i,a,n,r):C(i,a,n,r)}function x(e,t,n,r){let i=t*e,a=e*Math.sqrt(1-t*t),o=(r+i*n)/a;return{position:e=>Math.exp(-i*e)*(n*Math.cos(a*e)+o*Math.sin(a*e)),velocity:e=>{let t=Math.cos(a*e),r=Math.sin(a*e);return Math.exp(-i*e)*((o*a-i*n)*t-(n*a+i*o)*r)}}}function S(e,t,n){let r=n+e*t;return{position:n=>Math.exp(-e*n)*(t+r*n),velocity:n=>Math.exp(-e*n)*(r-e*(t+r*n))}}function C(e,t,n,r){let i=Math.sqrt(t*t-1),a=-e*(t+i),o=-e*(t-i),s=(r-a*n)/(o-a),c=n-s;return{position:e=>s*Math.exp(o*e)+c*Math.exp(a*e),velocity:e=>s*o*Math.exp(o*e)+c*a*Math.exp(a*e)}}function ee(e,{positionTolerance:t=.5,velocityTolerance:n=.02,step:r=1,limit:i=1e4}={}){for(let a=0;a<=i;a+=r)if(Math.abs(e.position(a))<=t&&Math.abs(e.velocity(a))<=n)return a;return i}function w(e,t,n,r,i=1e3/120){let a=n-t;if(Math.abs(a)<1e-6)return`linear`;let o=[];for(let t=0;t<r;t+=i)o.push(T(1+e.position(t)/a));return o.push(`1`),`linear(${o.join(`, `)})`}function T(e){return String(Math.round(e*1e4)/1e4)}var E=[],D=1;function O(e,t){return{phase:`idle`,extent:e,restingIndex:t}}function k(e,t,n){switch(t.type){case`down`:return j(e,t,n);case`move`:return M(e,t,n);case`up`:return I(e,t,n);case`settled`:return L(e);case`rest`:return R(e,t,n);case`snap-to`:return z(e,t,n);case`nudge`:return B(e,t,n);case`close`:return V(e,n,{targetIndex:-1,motion:A(e,t.time),time:t.time,reason:`imperative`,outcome:{type:`dismiss`,reason:`imperative`}})}}function A(e,t){if(e.phase!==`settling`)return{extent:e.extent,velocity:0};let n=b(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 j(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:E};if(e.phase!==`settling`)return{state:e,effects:E};let{extent:i}=A(e,t.time);return{state:{phase:`dragging`,extent:i,restingIndex:e.restingIndex,anchorY:t.y,anchorExtent:U(i,n),lastY:t.y,isScrollingContent:!1},effects:[{type:`move`,extent:i}]}}function M(e,t,n){return e.phase===`pending`?N(e,t,n):e.phase===`scrolling`&&n.contentScroll?n.contentScroll.move(e,t):e.phase===`dragging`?F(e,t,n):{state:e,effects:E}}function N(e,t,n){let r=t.x-e.originX,i=t.y-e.originY;if(Math.max(Math.abs(r),Math.abs(i))<e.slop)return{state:e,effects:E};if(Math.abs(r)>Math.abs(i))return{state:O(e.extent,e.restingIndex),effects:E};let a=n.contentScroll?.claim(e,t,i<0,n);if(a)return{state:a,effects:E};let o={...P(e,e.originY+Math.sign(i)*e.slop),lastY:t.y},s=H(o.anchorExtent+(o.anchorY-t.y),n);return{state:{...o,extent:s},effects:[{type:`move`,extent:s}]}}function P(e,t){return{phase:`dragging`,extent:e.extent,restingIndex:e.restingIndex,anchorY:t,anchorExtent:e.extent,lastY:t,isScrollingContent:!1}}function F(e,t,n){let r=e.lastY-t.y,i=e.isScrollingContent?{anchorY:e.lastY,anchorExtent:e.extent}:e,a=i.anchorExtent+(i.anchorY-t.y),o=n.contentScroll?.drag(e,t,r,a,n);if(o)return o;let s=H(a,n);return{state:{...e,anchorY:i.anchorY,anchorExtent:i.anchorExtent,extent:s,lastY:t.y,isScrollingContent:!1},effects:[{type:`move`,extent:s}]}}function I(e,t,n){if(e.phase===`pending`||e.phase===`scrolling`)return{state:O(e.extent,e.restingIndex),effects:E};if(e.phase!==`dragging`)return{state:e,effects:E};let r=n.contentScroll?.release(e,t,n);if(r)return r;let i=-t.velocity*G(e.extent,n),a=[0,...q(n)],o=n.physics,s={candidates:a,rate:o.projectionRate,minFlingVelocity:o.minFlingVelocity,skipSnapPoints:o.skipSnapPoints},c=p({...s,extent:e.extent,velocity:i}),l={motion:{extent:e.extent,velocity:i},time:t.time,reason:`swipe`};if(n.dismissible)return c>0?V(e,n,{...l,targetIndex:c-1}):V(e,n,{...l,targetIndex:-1,outcome:{type:`dismiss`,reason:`swipe`}});let u=e.anchorExtent+(e.anchorY-e.lastY),d=p({...s,extent:u,velocity:-t.velocity})===0,f=Math.max(0,c-1);return d?V(e,n,{...l,targetIndex:0,outcome:{type:`attempt-dismiss`,reason:`swipe`}}):V(e,n,{...l,targetIndex:f})}function L(e){return e.phase===`settling`?{state:O(e.to,e.targetIndex),effects:E}:{state:e,effects:E}}function R(e,t,n){if(t.extent<1&&n.dismissible)return{state:O(0,-1),effects:[{type:`dismiss`,reason:`swipe`}]};let r=m(q(n),t.extent),i=r===e.restingIndex?[]:[{type:`snap`,id:n.snapPoints[r].id,reason:`swipe`}];return{state:O(t.extent,r),effects:i}}function z(e,t,n){let r=n.snapPoints.findIndex(e=>e.id===t.id);return r===-1||e.phase===`dragging`?{state:e,effects:E}:V(e,n,{targetIndex:r,motion:A(e,t.time),time:t.time,reason:t.reason})}function B(e,t,n){return e.phase!==`idle`||e.restingIndex<0?{state:e,effects:E}:V(e,n,{targetIndex:e.restingIndex,motion:{extent:e.extent,velocity:-D},time:t.time,reason:`imperative`})}function V(e,t,n){let{targetIndex:r,motion:i,time:a,reason:o}=n,s=t.physics,c=r<0?0:t.snapPoints[r].extent,l=Math.abs(i.velocity)>=s.minFlingVelocity?s.momentumDampingRatio:s.dampingRatio,u={phase:`settling`,extent:i.extent,restingIndex:e.restingIndex,targetIndex:r,from:i.extent,to:c,velocity:i.velocity,response:s.response,dampingRatio:l,startTime:a},d=[{type:`settle`,from:i.extent,to:c,velocity:i.velocity,response:s.response,dampingRatio:l}];return r>=0&&r!==e.restingIndex&&d.push({type:`snap`,id:t.snapPoints[r].id,reason:o}),n.outcome&&d.push(n.outcome),{state:u,effects:d}}function H(e,t){let n=K(t),{coefficient:r,dimension:i}=W(t);if(e>n)return n+_(e-n,i,r);if(t.dismissible)return Math.max(0,e);let a=t.snapPoints[0].extent;return e<a?a-_(a-e,i,r):e}function U(e,t){let n=K(t),{coefficient:r,dimension:i}=W(t);if(e>n)return n+v(e-n,i,r);let a=t.snapPoints[0].extent;return!t.dismissible&&e<a?a-v(a-e,i,r):e}function W(e){return{coefficient:e.physics.rubberBand,dimension:e.physics.rubberBandDimension??e.dimension}}function G(e,t){let{coefficient:n,dimension:r}=W(t),i=K(t),a=t.snapPoints[0].extent,o=e>i?e-i:!t.dismissible&&e<a?a-e:0;return o<=0?1:y(v(o,r,n),r,n)}function K(e){return e.snapPoints[e.snapPoints.length-1].extent}function q(e){return e.snapPoints.map(e=>e.extent)}var J=[],te={claim(e,t,n,r){if(t.scroll&&d({towardMore:n,scrollAtStart:t.scroll.atStart,atLargest:e.extent>=K(r)-.5,expandOnScroll:r.expandOnScroll})===`scroll`)return{phase:`scrolling`,extent:e.extent,restingIndex:e.restingIndex,lastY:t.y}},move(e,t){return t.y>e.lastY&&t.scroll?.atStart?{state:P(e,t.y),effects:J}:{state:{...e,lastY:t.y},effects:J}},drag(e,t,n,r,i){let a=t.scroll;if(!a)return;if(e.isScrollingContent&&(n>0?!a.atEnd:!a.atStart)){let r=[{type:`scroll`,delta:n}];return{state:{...e,lastY:t.y},effects:r}}let o=K(i);if(!(n>0&&r>o&&e.extent<=o&&!a.atEnd))return;let s=[{type:`scroll`,delta:r-o}];return e.extent!==o&&s.unshift({type:`move`,extent:o}),{state:{...e,extent:o,anchorY:t.y,anchorExtent:o,lastY:t.y,isScrollingContent:!0},effects:s}},release(e,t,n){if(!e.isScrollingContent)return;let r=n.snapPoints.length-1,i=[{type:`fling-scroll`,velocity:-t.velocity}];return e.restingIndex!==r&&i.push({type:`snap`,id:n.snapPoints[r].id,reason:`swipe`}),{state:O(e.extent,r),effects:i}}},Y={ios:{response:.34,dampingRatio:1,momentumDampingRatio:.88,projectionRate:.99,minFlingVelocity:.5,skipSnapPoints:!0,rubberBand:1.9,rubberBandDimension:24,touchSlop:8,mouseSlop:4,dim:.2,velocityHorizon:70}};function ne(e){return String(e)}function re(e,t){if(typeof e==`number`)return e<=1?e*t.container:e;if(e===`content`)return t.content;let n=parseFloat(e);return e.endsWith(`rem`)?n*t.rootFontSize:e.endsWith(`%`)?n/100*t.container:e.endsWith(`px`)?n:NaN}function X(e,t){let n=e.map((e,n)=>({value:e,index:n,extent:Math.min(re(e,t),t.content)})).filter(e=>e.extent>0).sort((e,t)=>e.extent-t.extent||e.index-t.index),r=[];for(let e of n){let t=ne(e.value),n=r[r.length-1];n&&e.extent-n.extent<1?(n.ids.push(t),e.index>n.index&&Object.assign(n,{id:t,value:e.value,index:e.index}),n.extent=Math.max(n.extent,e.extent)):r.push({id:t,value:e.value,extent:Math.round(e.extent*100)/100,ids:[t],index:e.index})}return r.map(({index:e,...t})=>t)}function Z(e,t){if(t==null)return-1;let n=String(t);return e.findIndex(e=>e.ids.includes(n))}function ie(e,t,n){let r=Z(e,n),i=Z(e,t);return r>=0&&i>=0&&i<=r}function ae(e,t){return r(e,e===`start`||e===`end`?o(t):!1)}var Q=e=>e===`bottom`||e===`top`,oe=e=>e===`bottom`||e===`right`?1:-1;function $(e,t,n,r){let i=Q(e);return r.y=(i?n:t)*oe(e),r.x=i?t:n,r}function se(e,t){let n=`${Math.round(t*oe(e)*100)/100}px`;return Q(e)?`0 ${n}`:`${n} 0`}function ce(e,t){return Q(t)?e.offsetHeight:e.offsetWidth}function le(e,t,n){let r=ue(e,t,n);if(!r)return null;let{start:i,end:a}=fe(r,n);return{atStart:i,atEnd:a,area:r}}function ue(e,t,n){let r=t.ownerDocument.defaultView;if(!r||!(e instanceof Element)||!t.contains(e))return null;let i=Q(n);for(let n=e;n&&n!==t.parentElement;n=n.parentElement){if(!(i?n.scrollHeight>n.clientHeight+1:n.scrollWidth>n.clientWidth+1)||!(n instanceof HTMLElement))continue;let e=i?r.getComputedStyle(n).overflowY:r.getComputedStyle(n).overflowX;if(/auto|scroll/.test(e))return n}return null}function de(e,t){if(Q(t)){let n=e.scrollHeight-e.clientHeight;return{position:t===`bottom`?e.scrollTop:n-e.scrollTop,max:n}}let n=e.scrollWidth-e.clientWidth,r=Math.abs(e.scrollLeft),i=o(e)?n-r:r;return{position:t===`right`?i:n-i,max:n}}function fe(e,t){let{position:n,max:r}=de(e,t);return{start:n<=.5,end:n>=r-1}}function pe(e,t,n){if(Q(t))e.scrollTop+=t===`bottom`?n:-n;else{let r=t===`right`?n:-n;e.scrollLeft+=o(e)?-r:r}}var me=1e3;function he(e,t){e.requestAnimationFrame(()=>e.requestAnimationFrame(t))}function ge(e){return e===`bottom`?-120:-32}function _e(e,t){let n=[];for(let r=0;r<e.duration;r+=1e3/60)n.push(t(e.extentAt(r)));return n.push(t(e.extentAt(e.duration))),n}function ve(e,t){let r=Object.entries(t).map(([t,r])=>n(e,t,r));return()=>r.forEach(e=>e())}var ye=e=>Math.max(0,Math.min(1,e));function be(e,t,n=-1){let r=n<0?0:t[n],i=n<0?t[0]:t[n+1];return i===void 0||i<=r?+(e>r):ye((e-r)/(i-r))}function xe(e,t){let n=t[t.length-1],r=t.length>1?t[t.length-2]:0;return n<=r?+(e>=n):ye((e-r)/(n-r))}function Se(e,t){let n=t[t.length-1];return n>0?ye(e/n):0}var Ce=1e3/60,we=[`--drawer-progress`,`--drawer-dim`,`--drawer-expand`,`--drawer-stack`],Te=new WeakSet;function Ee(e){let t=e.defaultView?.CSS;if(!Te.has(e)&&t?.registerProperty){Te.add(e);for(let e of we)try{t.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:`0`})}catch{}}}function De(){typeof document<`u`&&!Te.has(document)&&a(()=>Ee(document))}var Oe=()=>typeof CSS<`u`&&CSS.supports(`animation-timing-function`,`linear(0, 1)`),ke=e=>Math.round(e*1e4)/1e4;function Ae(e){Ee(e.sheet.ownerDocument);let t=[1],n=-1,r=[],i=new Map,a={dim:0,progress:0,expand:0},o;function s(e){t=e.snapExtents.length?e.snapExtents:[1],n=e.undimmedIndex}function c(e,r=a){return r.dim=ke(be(e,t,n)),r.progress=ke(Se(e,t)),r.expand=ke(xe(e,t)),r}let l=!1;function u(t,{rest:n=!1}={}){if(!l){x(),c(t),d(a.dim),m(e.sheet,a),p(a.progress);for(let t of e.outlets())m(t.el,a),t.keyframes&&h(t,a.expand,n);n&&e.themeColor?.(a.dim)}}function d(t){let n=e.backdrop();n&&(n.style.opacity=String(t));let r=f();r&&(r.currentTime=t*1e3)}function f(){return!e.dimmed||o||(o=e.dimmed.animate({opacity:[0,1]},{...je,duration:1e3,fill:`both`}),o.pause(),o.currentTime=0),o}function p(t){let n=e.ancestors();for(let e=0;e<n.length;e++)n[e].style.setProperty(`--drawer-stack`,String(e+t))}function m(e,{dim:t,progress:n,expand:r}){e.style.setProperty(`--drawer-progress`,String(n)),e.style.setProperty(`--drawer-dim`,String(t)),e.style.setProperty(`--drawer-expand`,String(r))}function h(e,t,n){let r=i.get(e.el);r||(r=e.el.animate(Ne(e.keyframes),{duration:1e3,fill:`both`}),r.pause(),i.set(e.el,r)),r.currentTime=t*1e3,n&&(r.commitStyles?.(),r.cancel(),i.delete(e.el))}function g(t){if(l)return;if(x(),S(),!Oe())return u(t.type===`settle`?t.extentAt(t.duration):0,{rest:!0});let n=y(t);f();let i=t.type===`settle`?{duration:Math.max(1,t.duration),fill:`both`}:{timeline:t.timeline,fill:`both`},a=(e,n,a,o)=>{let s=e.animate(n,{...i,...o,easing:Me(a)});t.type===`settle`&&(s.startTime=t.startTime),r.push(s)},o=e.backdrop();o&&a(o,{opacity:[0,1]},n.dim),e.dimmed&&a(e.dimmed,{opacity:[0,1]},n.dim,je),_(e.sheet,n,a),e.ancestors().forEach((e,t)=>a(e,{"--drawer-stack":[t,t+1]},n.progress));for(let t of e.outlets())_(t.el,n,a),t.keyframes&&a(t.el,Ne(t.keyframes),n.expand);if(t.type!==`settle`)return;v(t.extentAt(t.duration));let s=r;s[0]&&(s[0].onfinish=()=>r===s&&x())}function _(e,t,n){n(e,{"--drawer-progress":[0,1]},t.progress),n(e,{"--drawer-dim":[0,1]},t.dim),n(e,{"--drawer-expand":[0,1]},t.expand)}function v(t){let n=c(t,{dim:0,progress:0,expand:0});d(n.dim),m(e.sheet,n),p(n.progress);for(let t of e.outlets())if(m(t.el,n),t.keyframes)for(let[e,r]of Object.entries(t.keyframes)){let i=r[n.expand>=.5?r.length-1:0];t.el.style.setProperty(Pe(e),String(i))}e.themeColor?.(n.dim)}function y(e){let t={dim:[],progress:[],expand:[]},n={dim:0,progress:0,expand:0},r=e.type===`settle`?Math.max(2,Math.ceil(e.duration/Ce)+1):61;for(let i=0;i<r;i++){let a=i/(r-1);c(e.type===`settle`?e.extentAt(Math.min(e.duration,i*Ce)):e.extentAt(a),n),t.dim.push(n.dim),t.progress.push(n.progress),t.expand.push(n.expand)}return t}function b(e){for(let t of r)t.startTime=e}function x(){if(r.length){for(let e of r)e.cancel();r=[]}}function S(){for(let e of i.values())e.cancel();i.clear()}function C(){l=!0,x(),S(),e.backdrop()?.style.removeProperty(`opacity`),o?.cancel();for(let t of we.slice(0,3))e.sheet.style.removeProperty(t);for(let t of e.outlets()){for(let e of we.slice(0,3))t.el.style.removeProperty(e);for(let e of Object.keys(t.keyframes??{}))t.el.style.removeProperty(Pe(e))}}return{configure:s,compute:c,apply:u,play:g,sync:b,follow:g,stop:x,destroy:C}}var je={pseudoElement:`::backdrop`};function Me(e){return`linear(${e.map(ke).join(`, `)})`}var Ne=e=>e;function Pe(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var Fe={horizon:70,staleAfter:40,maxSpeed:8,capacity:20};function Ie(e,t,n=0,r=e.length){let i=r-n;if(i<2)return 0;let a=e[r-1];if(i<4)return Le(e,t,n,r);let o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0;for(let i=n;i<r;i++){let n=e[i]-a,r=t[i],m=n*n;o+=1,s+=n,c+=m,l+=m*n,u+=m*m,d+=r,f+=r*n,p+=r*m}let m=o*(c*u-l*l)-s*(s*u-l*c)+c*(s*l-c*c);return Math.abs(m)<1e-9?Le(e,t,n,r):(o*(f*u-l*p)-d*(s*u-l*c)+c*(s*p-f*c))/m}function Le(e,t,n,r){let i=0,a=0,o=r-n;for(let s=n;s<r;s++)i+=e[s]/o,a+=t[s]/o;let s=0,c=0;for(let o=n;o<r;o++){let n=e[o]-i;s+=n*(t[o]-a),c+=n*n}return c>0?s/c:0}function Re(e={}){let{horizon:t,staleAfter:n,maxSpeed:r,capacity:i}={...Fe,...e},a=new Float64Array(i),o=new Float64Array(i),s=new Float64Array(i),c=new Float64Array(i),l=0,u=-1;function d(e,t){l>0&&e<=a[u]||(u=(u+1)%i,a[u]=e,o[u]=t,l=Math.min(l+1,i))}function f(e){if(l<2)return 0;let d=a[u];if(e-d>n)return 0;let f=0;for(let e=l-1;e>=0;e--){let n=(u-e+i)%i;d-a[n]>t||(s[f]=a[n],c[f]=o[n],f++)}let p=Ie(s,c,0,f);return Math.max(-r,Math.min(r,p))}function p(){l=0,u=-1}return{add:d,velocity:f,reset:p}}var ze=.998,Be=`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-drawer-no-drag]`;function Ve(e){let{sheet:n}=e,r=n.ownerDocument,i=r.defaultView??window,a=O(0,-1),o=0,s=null,c=0,f=0,p=null,h=null,g=null,_=null,v=null,y=null,x=null,S=!1,C=!1,T=null,E=null,D=null,A={x:0,y:0},j=Re({horizon:e.config().physics.velocityHorizon}),M=[t(r,`touchstart`,q,{capture:!0,passive:!0}),t(r,`touchmove`,J,{capture:!0,passive:!1}),t(r,`touchend`,Y,{capture:!0,passive:!0}),t(r,`touchcancel`,Y,{capture:!0,passive:!0}),t(n,`pointerdown`,re)],N=!1;function P(t){N||(n.style.translate=se(e.side(),e.size()-t),o=t)}function F(t,n){if(N)return;let r=k(a,t,e.config());a=r.state;let i=`time`in t?t.time:performance.now();for(let e of r.effects)I(e,i,n);let o=a.phase===`dragging`;o!==S&&(S=o,e.onDragChange(S))}function I(t,n,r){switch(t.type){case`move`:p?(B(),P(t.extent),e.onFrame(t.extent)):(s=t.extent,H());return;case`settle`:return L(t,n);case`scroll`:return c+=t.delta,H();case`fling-scroll`:return v&&(_={velocity:t.velocity,startTime:n,startScroll:0,area:v}),H();case`snap`:return E=t.id,e.onSnap(t.id,t.reason,r);case`dismiss`:return t.reason===`swipe`?(g=`swipe`,e.onDismiss(r)):void 0;case`attempt-dismiss`:return e.onDismissAttempt(r)}}function L(t,r){B(),s=null;let i=e.closedExtent(),a=t.from<=0?i:t.from,o=t.to<=0?i:t.to,c=e.reducedMotion()&&(a===i||o===i),l=e.reducedMotion()?z(a,o,c):R(a,o,t);if(P(c?Math.max(o,0):o),Math.abs(o-a)<.5&&t.velocity===0||l.duration===0)return V();let u=e.size(),d=e.side();p=c?n.animate({opacity:a===i?[0,1]:[1,0]},{duration:l.duration,fill:`both`}):Math.abs(o-a)<1||!Oe()?n.animate({translate:_e(l,e=>se(d,u-e))},{duration:l.duration,fill:`backwards`}):n.animate({translate:[se(d,u-a),se(d,u-o)]},{duration:l.duration,easing:l.easing,fill:`backwards`}),c&&(h=p);let f=p;p.onfinish=()=>{p===f&&V()},p.startTime=r,e.onMotion({type:`settle`,extentAt:l.extentAt,startTime:r,duration:l.duration})}function R(e,t,n){let r=b(n.response,n.dampingRatio,e-t,n.velocity),i=ee(r);return{duration:i,easing:w(r,e,t,i),extentAt:e=>t+r.position(e)}}function z(e,t,n){let r=n?150:200,i=e=>1-(1-e)**3;return{duration:r,easing:`cubic-bezier(0.33, 1, 0.68, 1)`,extentAt:n=>e+(t-e)*i(Math.min(1,n/r))}}function B(){p?.cancel(),p=null,h&&=(h.cancel(),null)}function V(){if(B(),F({type:`settled`}),a.phase===`idle`){if(a.restingIndex<0)return g=null,E=null,e.onRest(null);E=e.config().snapPoints[a.restingIndex].id,e.onRest(E)}}function H(){f||=i.requestAnimationFrame(U)}function U(t){f=0,c&&v&&(pe(v,e.side(),c),c=0),_&&W(t),s!==null&&(P(s),s=null,e.onFrame(o))}function W(t){if(!_)return;let n=Math.max(0,t-_.startTime),r=_.velocity*(ze**n-1)/Math.log(ze);pe(_.area,e.side(),r-_.startScroll),_.startScroll=r,Math.abs(_.velocity*ze**n)<.01?_=null:H()}function G(e){return e instanceof Element&&e.closest(Be)!==null}function K(t){let r=le(t,n,e.side());return v=r?.area??null,r&&{atStart:r.atStart,atEnd:r.atEnd}}function q(t){let n=T!==null&&l(T);if(T=null,y||t.touches.length>1||g||n||!e.owns(t.target)||G(t.target))return;let r=t.changedTouches[0];y={id:r.identifier,originX:r.clientX,originY:r.clientY},_=null,j.reset(),$(e.side(),r.clientX,r.clientY,A),j.add(t.timeStamp,A.y),F({type:`down`,time:t.timeStamp,x:A.x,y:A.y,pointer:`touch`},t)}function J(t){let n=ne(t.changedTouches);if(!n)return;$(e.side(),n.clientX,n.clientY,A),j.add(t.timeStamp,A.y);let r=a.phase===`dragging`,i=K(t.target);if(F({type:`move`,time:t.timeStamp,x:A.x,y:A.y,scroll:i},t),a.phase===`pending`)return te(t,n,i);a.phase===`dragging`&&(t.cancelable?t.preventDefault():!r&&v&&(v.style.overscrollBehavior=`none`))}function te(t,n,r){if(!t.cancelable||!y)return;let i=$(e.side(),y.originX,y.originY,{x:0,y:0});if(Math.abs(A.y-i.y)<Math.abs(A.x-i.x))return;let a=e.config().snapPoints.at(-1)?.extent??0;(r?d({towardMore:A.y<i.y,scrollAtStart:r.atStart,atLargest:o>=a-.5,expandOnScroll:e.config().expandOnScroll}):`sheet`)===`sheet`&&t.preventDefault()}function Y(e){if(!ne(e.changedTouches))return;y=null,v&&v.style.removeProperty(`overscroll-behavior`);let t=e.type===`touchcancel`?0:j.velocity(e.timeStamp);F({type:`up`,time:e.timeStamp,velocity:t},e)}function ne(e){if(!y)return null;for(let t=0;t<e.length;t++)if(e[t].identifier===y.id)return e[t];return null}function re(n){if(T=n,n.pointerType===`touch`||n.button!==0||x!==null||g)return;let i=n.target;if(!e.owns(i)||G(i)||!(i instanceof Element)||!e.canMouseDrag(i))return;x=n.pointerId,C=!1,D=a.phase===`settling`&&a.targetIndex>=0?E:null,_=null,j.reset(),$(e.side(),n.clientX,n.clientY,A),j.add(n.timeStamp,A.y),X=[t(r,`pointermove`,Z,{capture:!0}),t(r,`pointerup`,ie,{capture:!0}),t(r,`pointercancel`,ie,{capture:!0})];let o=n.pointerType===`pen`?`pen`:`mouse`;F({type:`down`,time:n.timeStamp,x:A.x,y:A.y,pointer:o},n)}let X=[];function Z(t){if(t.pointerId!==x)return;if(T&&l(T))return ae(t,0,D);let i=t.getCoalescedEvents?.();for(let n of i?.length?i:[t])j.add(n.timeStamp,$(e.side(),n.clientX,n.clientY,A).y);if($(e.side(),t.clientX,t.clientY,A),F({type:`move`,time:t.timeStamp,x:A.x,y:A.y,scroll:K(t.target)},t),!(a.phase!==`dragging`||C)){C=!0,r.getSelection()?.removeAllRanges(),n.style.userSelect=`none`;try{n.setPointerCapture(t.pointerId)}catch{}}}function ie(e){if(e.pointerId===x){if(T&&l(T))return ae(e,0,D);ae(e,e.type===`pointercancel`?0:j.velocity(e.timeStamp))}}function ae(t,i,o=null){x=null,T=null,X.forEach(e=>e()),X=[],n.style.removeProperty(`user-select`);let s=t.timeStamp,c=e.config().snapPoints.findIndex(e=>e.id===o);o!==null&&c>=0?(a=O(a.extent,c),F({type:`snap-to`,time:s,id:o,reason:`imperative`})):F({type:`up`,time:s,velocity:i},t),C&&u(r)}return{open(t,n){g=null,E=t,B();let r=e.config().snapPoints.findIndex(e=>e.id===t);if(!n&&r>=0)return a=O(e.config().snapPoints[r].extent,r),P(a.extent),e.onRest(t);a=O(0,-1),P(e.closedExtent()),F({type:`snap-to`,time:performance.now()+me,id:t,reason:`imperative`});let o=p;o&&he(i,t=>{p===o&&a.phase===`settling`&&(o.startTime=t,a={...a,startTime:t},e.onMotionStart(t))})},close(){let e=g;g=`close`,e||F({type:`close`,time:performance.now()})},snapTo(e,t){g!==`close`&&(g=null,F({type:`snap-to`,time:performance.now(),id:e,reason:t}))},nudge(){!g&&!e.reducedMotion()&&F({type:`nudge`,time:performance.now()})},relayout(t,n){let r=e.config().snapPoints;if(g||E===null||a.phase===`dragging`||a.phase===`pending`)return P(o);let i=r.findIndex(e=>e.id===E),s=r.findIndex(e=>e.id===n),c=i>=0?i:s>=0?s:m(r.map(e=>e.extent),o),{id:l,extent:u}=r[c];if(a.phase===`idle`&&(a=O(o,i),t||Math.abs(u-o)<.5))return a=O(u,c),P(u),t?(l!==E&&I({type:`snap`,id:l,reason:`content-resize`},performance.now()),e.onRest(l)):void 0;F({type:`snap-to`,time:performance.now(),id:l,reason:`content-resize`})},target:()=>g?null:E,isMoving:()=>a.phase!==`idle`,destroy(){N=!0,B(),f&&i.cancelAnimationFrame(f),M.forEach(e=>e()),X.forEach(e=>e()),S&&e.onDragChange(!1);for(let e of[`translate`,`user-select`,`opacity`])n.style.removeProperty(e)}}}var He=120,Ue=24;function We(e){let{sheet:n,host:r}=e,a=n.ownerDocument,o=a.defaultView??window,s=O(0,-1),c=0,l=[],u=null,d=!1,f=!1,p=!1,h=null,g=0,_=0,v=null,y=new Map,x=null,S=ve(r,{inset:`0 0 calc(var(--keyboard-inset, 0px) - 120px) 0`,display:`block`,"overflow-y":`scroll`,"overflow-x":`hidden`,"scroll-snap-type":`y mandatory`,"scrollbar-width":`none`,"overscroll-behavior":`contain`,"pointer-events":`auto`}),C=ve(n,{position:`absolute`,left:`0`,right:`0`}),T=`onscrollend`in r,E=o.ScrollTimeline,D=[t(r,`scroll`,R,{passive:!0}),...T?[t(r,`scrollend`,H)]:[],t(r,`touchstart`,()=>{d=!0,f=!1,u&&!h&&W()},{passive:!0}),t(r,`touchend`,B,{passive:!0}),t(r,`touchcancel`,B,{passive:!0})],A=i()?1:121,j=new IntersectionObserver(U,{root:r,rootMargin:`0px 0px -${A}px 0px`,threshold:0});j.observe(n);let M=()=>e.config().dimension,N=()=>e.config().snapPoints.at(-1)?.extent??0,P=()=>N()+Ue-c,F=()=>Math.min(r.scrollTop+c,N());function I(){let t=e.config();c=t.dismissible?-120:t.snapPoints[0].extent,n.style.top=`${M()-c}px`;for(let e of l)e.remove();let i=t.snapPoints.map(e=>e.extent);l=(t.dismissible?[c,...i]:i).map(e=>L(e-c,`start`)),l.push(L(P()+r.clientHeight-1,`none`)),r.append(...l);for(let e of y.keys())n.contains(e)||y.delete(e);for(let e of Ge(n))y.has(e)||y.set(e,[e.style.getPropertyValue(`overflow-y`),e.style.getPropertyPriority(`overflow-y`)])}function L(e,t){let n=a.createElement(`div`);return n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position:absolute;left:0;width:1px;height:1px;top:${e}px;scroll-snap-align:${t};pointer-events:none`,n}function R(){u||h||(x&&d&&Math.abs(r.scrollTop-x.offsetTop)>1&&G(),d&&!p&&V(!0),E||(_||=o.requestAnimationFrame(z)),o.clearTimeout(g),!T&&!d&&(g=o.setTimeout(H,He)))}function z(){_=0,e.onFrame(F())}function B(){if(d=!1,V(!1),x){G();let t=e.config().snapPoints;return Y(t[m(t.map(e=>e.extent),F())].id,`swipe`)}!e.config().dismissible&&r.scrollTop<-2&&e.onDismissAttempt(),(f||!T)&&(g=o.setTimeout(H,He)),f=!1}function V(t){p!==t&&(p=t,e.onDragChange(t))}function H(){if(d){f=!0;return}if(u||h)return;let t=e.config(),n=k(s,{type:`rest`,extent:F()},t);s=n.state;for(let t of n.effects)t.type===`snap`&&(v=t.id,e.onSnap(t.id,t.reason));s.restingIndex>=0&&J(t.snapPoints[s.restingIndex].id)}function U(t){t[t.length-1].isIntersecting||u||h||v===null||!e.config().dismissible||(h=`swipe`,v=null,e.onDismiss())}function W(){if(!u)return;let e=Math.max(0,u.extentAt(performance.now()-u.startTime)-c);q(),x=L(e,`start`),r.append(x),r.scrollTop=e,z(),te()}function G(){x?.remove(),x=null}function K(t,i,a,o){q();let s=e.config().physics,l=b(s.response,s.dampingRatio,i-t,0),d=Math.max(1,ee(l)),f=Math.max(c,t);r.scrollTop=f-c;let p=e=>t+l.position(Math.max(0,e)),m=Math.abs(t-i)<.5,h=!m&&!Oe(),g=n.animate({translate:h?_e({duration:d,extentAt:p},e=>`0 ${f-e}px`):[`0 ${f-i}px`,`0 ${f-t}px`]},{duration:d,easing:m||h?`linear`:w(l,i,t,d),fill:`both`});g.startTime=a,u={animation:g,to:t,extentAt:p,startTime:a},e.onMotion({type:`settle`,extentAt:p,startTime:a,duration:d}),g.onfinish=()=>{u?.animation===g&&(u=null,o(),g.cancel())}}function q(){u?.animation.cancel(),u=null}function J(t){let n=e.config(),i=n.snapPoints.findIndex(e=>e.id===t);s=O(n.snapPoints[i].extent,i),v=t,r.style.pointerEvents=e.isInteractive(t)?`none`:`auto`;let a=i===n.snapPoints.length-1;for(let[e,[t,n]]of y)a?e.style.setProperty(`overflow-y`,t,n):e.style.overflowY=`hidden`;e.onRest(t),te()}function te(){if(!E)return;let t=P(),n=new E({source:r,axis:`block`});e.onMotion({type:`timeline`,timeline:n,extentAt:e=>Math.min(N(),e*t+c)})}function Y(t,n){let r=e.config().snapPoints.find(e=>e.id===t);if(!r||h===`close`)return;h=null,t!==v&&(v=t,e.onSnap(t,n));let i=u?u.extentAt(performance.now()-u.startTime):F();K(r.extent,i,performance.now(),()=>J(t))}return{open(t,n){h=null,v=t,I();let i=e.config().snapPoints.find(e=>e.id===t);if(!i)return;if(!n)return r.scrollTop=i.extent-c,J(t);K(i.extent,-120,performance.now()+me,()=>J(t));let a=u;he(o,t=>{a&&u===a&&(a.animation.startTime=t,a.startTime=t,e.onMotionStart(t))})},close(){let t=h;h=`close`,t||(v=null,K(-120,u?u.extentAt(performance.now()-u.startTime):F(),performance.now(),()=>e.onRest(null)))},snapTo:Y,nudge(){if(h||e.reducedMotion()||v===null)return;let t=e.config().snapPoints.find(e=>e.id===v);t&&K(t.extent,t.extent-20,performance.now(),()=>J(t.id))},relayout(t,n){if(h||d)return;let i=e.config().snapPoints,a=i.findIndex(e=>e.id===v),o=i.findIndex(e=>e.id===n),s=a>=0?a:o>=0?o:m(i.map(e=>e.extent),F()),l=c;I();let f=i[s];if(f.id!==v&&(v=f.id,e.onSnap(f.id,`content-resize`)),u){let e=u,t=performance.now();(e.to!==f.extent||c!==l)&&(K(f.extent,e.extentAt(t-e.startTime),Math.max(t,e.startTime),()=>J(f.id)),u=Object.assign(e,u))}else r.scrollTop=f.extent-c,J(f.id)},target:()=>h?null:v,isMoving:()=>!!u||p,destroy(){q(),G(),o.clearTimeout(g),_&&o.cancelAnimationFrame(_),j.disconnect(),D.forEach(e=>e());for(let e of l)e.remove();for(let[e,[t,n]]of y)e.style.setProperty(`overflow-y`,t,n);p&&e.onDragChange(!1),n.style.removeProperty(`top`),C(),S()}}}function Ge(e){let t=e.ownerDocument.defaultView??window;return Array.from(e.querySelectorAll(`*`)).filter(e=>/auto|scroll/.test(t.getComputedStyle(e).overflowY))}function Ke(e){let t=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e);return t?[t[1],t[2],t[3]].map(Number):null}function qe(e,t){let n=Array.from(e.querySelectorAll(`meta[name="theme-color"]`)),r=n.map(e=>e.content),i=r.map(t=>Ke(Je(e,t))),a=-1;function o(e){let o=Math.round(e*t*100)/100;o!==a&&(a=o,n.forEach((e,t)=>{let n=i[t];n&&(e.content=o?`rgb(${n.map(e=>Math.round(e*(1-o))).join(` `)})`:r[t])}))}function s(){n.forEach((e,t)=>e.content=r[t]),a=-1}return{write:o,restore:s}}function Je(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 Ye=`a[href], button, label, summary, [role="button"], [role="link"], [role="slider"], [tabindex]:not([tabindex="-1"])`,Xe=e=>!e.closest(Ye),Ze=()=>{};function Qe(e){return{side:()=>`bottom`,snapPoints:()=>[`content`],snapPoint:()=>null,dismissible:()=>!0,modalAbove:()=>void 0,driver:()=>`auto`,expandOnScroll:()=>!0,physics:()=>void 0,backdrop:()=>void 0,hostBackdrop:!1,outlets:()=>[],parent:()=>void 0,themeColor:()=>!1,preventEdgeSwipe:()=>!1,canMouseDrag:Xe,onSnap:Ze,onRest:Ze,onDismissAttempt:Ze,onDragChange:Ze,onLayout:Ze,...$e(e)}}function $e(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var et=new WeakSet,tt=new WeakMap;function nt(e){for(let t=e.parent;t;t=t.parent){let e=tt.get(t);if(e)return e}}function rt(e){for(let t=e instanceof Element?e:null;t;){if(et.has(t))return t;let e=t.getRootNode();t=t.parentElement??(e instanceof ShadowRoot?e.host:null)}return null}function it(e,t){let n=e.closest(`[popover]`);return!!n&&n!==t&&t.contains(n)}var at=24;function ot(e,t){let n=t.driver();return n===`auto`?t.modalAbove()===void 0&&t.expandOnScroll()&&!!e.matchMedia?.(`(hover: none) and (pointer: coarse)`).matches:n===`scroll-snap`}var st={duration:250,easing:`cubic-bezier(0.38, 0.7, 0.125, 1)`};function ct(e,n){let r=Qe(n),{host:a}=r,o=e.ownerDocument,c=o.defaultView??window,l=c.matchMedia?.(`(prefers-reduced-motion: reduce)`),u=ae(r.side(),e),d=[],f=0,p,m=Y.ios,h,g,_={snapPoints:[],dimension:0,dismissible:!0,expandOnScroll:!0,physics:m,contentScroll:te},v=u===`bottom`&&ot(c,r);et.add(e);let y=[lt(a,u,e),ut(e)],b=[],x=Ae({sheet:e,backdrop:r.backdrop,dimmed:r.hostBackdrop?a:void 0,outlets:r.outlets,ancestors:()=>b,themeColor:e=>h?.write(e)});function S(){let e=r.physics();return e!==p&&(p=e,m=e?{...Y.ios,...e}:Y.ios),_.physics=m,_.dismissible=r.dismissible(),_.expandOnScroll=r.expandOnScroll(),_}let C=!1;function ee(){C=!0;let t=ae(r.side(),e);t!==u&&(u=t,y[0](),y[0]=lt(a,u,e));let n=(Q(u)?a.clientHeight:a.clientWidth)-(v?120:0);M??=c.visualViewport?.height,f=ce(e,u);let i=parseFloat(c.getComputedStyle(o.documentElement).fontSize)||16,s=X(r.snapPoints(),{container:n,content:f,rootFontSize:i});s.length||s.push({id:`content`,value:`content`,extent:f,ids:[`content`]});let l=n!==_.dimension||s.length!==d.length||s.some((e,t)=>e.id!==d[t].id||Math.abs(e.extent-d[t].extent)>=.5);return d=s,_.dimension=n,_.snapPoints=d.map(({id:e,extent:t})=>({id:e,extent:t})),x.configure({snapExtents:_.snapPoints.map(e=>e.extent),undimmedIndex:Z(d,r.modalAbove())}),l&&O(),l}let w=!1,T=e=>e===null?null:d.find(t=>t.id===e)?.value??null,E={sheet:e,host:a,side:()=>u,config:S,size:()=>f,closedExtent:()=>ge(u),reducedMotion:()=>!!l?.matches,owns:t=>rt(t)===e,canMouseDrag:r.canMouseDrag,onSnap:(e,t,n)=>{let i=T(e);i!==null&&r.onSnap(i,t,n)},onRest(e){if(w)return;let t=d.find(t=>t.id===e);x.apply(t?.extent??ge(u),{rest:!0}),r.onRest(T(e)),R&&e!==null&&B(),R=!1},onDismiss:r.onDismiss,onDismissAttempt:r.onDismissAttempt,onDragChange:r.onDragChange,isInteractive:e=>U.isInteractiveAt(T(e)),onFrame:e=>w||x.apply(e),onMotion:e=>w||x.play(e),onMotionStart:e=>w||x.sync(e)},D=!0;function O(){if(!D)return r.onLayout({side:u,snapPoints:d});queueMicrotask(()=>w||r.onLayout({side:u,snapPoints:d}))}S();let k=v?We(E):Ve(E);e.setAttribute(`data-driver`,v?`scroll-snap`:`pointer`),D=!1;let A=new ResizeObserver(()=>{V(!1)});A.observe(e),A.observe(a);let j=0,M,N=null,P=[s(a,{before:()=>j=e.getBoundingClientRect().top,after:F}),...r.preventEdgeSwipe()?[t(o,`touchstart`,I,{capture:!0,passive:!1})]:[],...i()?[t(o,`touchend`,L,{capture:!0,passive:!1})]:[],t(e,`focusin`,z)];function F(){V(!0),B();let t=c.visualViewport?.height;if(t===M)return;M=t,N?.cancel(),N=null;let n=j-e.getBoundingClientRect().top;Math.abs(n)<1||l?.matches||(N=a.animate({translate:[`0 ${n}px`,`0 0`]},st))}function I(e){if(!e.cancelable)return;let t=e.touches[0];if(!t||t.clientX>at&&t.clientX<c.innerWidth-at)return;let n=e.target;n&&(a.contains(n)||r.backdrop()?.contains(n))&&e.preventDefault()}function L(t){let n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&e.contains(n)&&n!==o.activeElement&&!k.isMoving()&&t.cancelable&&(t.preventDefault(),n.focus({preventScroll:!0}))}let R=!1;function z(){k.isMoving()?R=!0:B()}function B(){let t=o.activeElement;if(!(t instanceof HTMLElement)||!e.contains(t)||t===e||it(t,e))return;let n=ue(t,e,`bottom`);if(!n)return;let r=c.visualViewport,i=Math.min(n.getBoundingClientRect().bottom,r?r.offsetTop+r.height:c.innerHeight),{top:a,bottom:s}=t.getBoundingClientRect(),u=n.getBoundingClientRect().top,d=s+16>i?s+16-i:a-16<u?a-16-u:0;d&&n.scrollBy({top:d,behavior:l?.matches?`instant`:`smooth`})}function V(e){let t=!C;ee()&&!t&&k.relayout(e,d[Z(d,r.snapPoint())]?.id)}function H(e){let t=Z(d,e);return d[t>=0?t:0]?.id}let U={element:e,parent:r.parent,open(e){if(w)return;b=[];for(let e=r.parent();e;e=e.parent())b.push(e.element);ee(),S(),r.themeColor()&&(h??=qe(o,m.dim)),e&&x.apply(ge(u)),g?.();let t=r.backdrop();g=t&&ve(t,{"will-change":`opacity`}),k.open(H(r.snapPoint()),e)},close:()=>w||k.close(),snapTo(e,t){let n=Z(d,e);n>=0&&d[n].id!==k.target()&&k.snapTo(d[n].id,t)},nudge:()=>k.nudge(),snapPoints:()=>d,target:()=>T(k.target()),isInteractiveAt:e=>ie(d,e,r.modalAbove()),refresh(){V(!1)},destroy(){w=!0,A.disconnect(),N?.cancel(),P.forEach(e=>e()),k.destroy(),x.destroy(),g?.(),h?.restore(),y.forEach(e=>e()),e.removeAttribute(`data-driver`),et.delete(e)}};return U}function lt(e,t,n){let r=Q(t),i=r?t===`bottom`:t===`right`!=(n.ownerDocument.defaultView?.getComputedStyle(e).direction===`rtl`);return ve(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":i?`flex-end`:`flex-start`,"pointer-events":`none`})}function ut(e){return ve(e,{"pointer-events":`auto`,"overscroll-behavior":`contain`,"will-change":`translate`})}function dt(t){let n=t.getAttribute(`data-slot`);n&&e(t.ownerDocument,`ui-sdk-sheet-${n}`,`@layer ui-sdk { :where([data-slot="${n}"])::backdrop { background: var(--sheet-backdrop, rgb(0 0 0 / 0.2)); pointer-events: auto } }`)}function ft(e,t){let r=[],i=e=>{for(let a of Array.from(e.children))t.includes(a)||(t.some(e=>e&&a.contains(e))?i(a):a instanceof HTMLElement&&r.push(n(a,`display`,`none`)))};return i(e),()=>r.forEach(e=>e())}function pt(e,t,r){let i,a=t.bind(e,{...r,position:void 0,inline:!0,onShow(){let[t,n]=r.drillIn();return t&&(i=ft(t,[e,n])),()=>i?.()},onClose(){i?.(),i=n(e,`display`,`none`)}});return()=>{a(),i?.()}}function mt(e,t,n){if(n.drillIn)return pt(e,t,n);let r=e.parentElement;if(!r)return;dt(r);let i;return t.bind(e,{...n,position:void 0,host:()=>r,onShow(a){let o=ht(e,r,t,n,a);return i=o.sheet,()=>{o.hide(),i=void 0}},onClose:()=>i?.close()})}function ht(e,n,r,i,a){let o=null,s=nt(a),c=!i.backdrop?.(),l=ct(e,{host:n,snapPoints:()=>i.snapPoints??[`content`],snapPoint:()=>o,backdrop:i.backdrop,hostBackdrop:c,dismissible:i.dismissible,onDismissAttempt:i.onDismissAttempt,parent:()=>s?.(),onSnap:e=>o=e,onDismiss(e){r.requestClose(`swipe`,e),requestAnimationFrame(()=>{let e=o??l.snapPoints()[0]?.value;a.active()&&e!==void 0&&l.snapTo(e,`imperative`)})}});tt.set(a,()=>l),i.onSheet?.(l);let u=t(e,`focusin`,e=>{let t=l.snapPoints().at(-1);t&&l.snapPoints().length>1&&e.target.matches(`input, textarea`)&&l.snapTo(t.value,`imperative`)}),d=c?getComputedStyle(e).getPropertyValue(`--sheet-backdrop`):`transparent`;return d&&n.style.setProperty(`--sheet-backdrop`,d),a.active()&&l.open(r.opener()!==`initial`),{sheet:l,hide(){u(),tt.delete(a),l.destroy(),i.onSheet?.(void 0),n.style.removeProperty(`--sheet-backdrop`)}}}export{De as prepareVariables,mt as presentSheet};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-DXzGGAxQ.js";var c=new WeakSet,l=e=>c.has(e);function u(e,t=!1,n){let r=e.defaultView??window,i=e=>n===void 0||!(`pointerId`in e)||e.pointerId===n,a=t=>{i(t)&&(t.preventDefault(),t.stopPropagation(),e.removeEventListener(`click`,a,!0))},o=()=>{e.removeEventListener(`click`,a,!0),e.removeEventListener(`pointerdown`,s,!0),e.removeEventListener(`pointerup`,c,!0),e.removeEventListener(`pointercancel`,c,!0)},s=e=>i(e)&&o(),c=e=>i(e)&&r.setTimeout(o);if(e.addEventListener(`click`,a,!0),e.addEventListener(`pointerdown`,s,!0),!t)return r.setTimeout(o);e.addEventListener(`pointerup`,c,!0),e.addEventListener(`pointercancel`,c,!0)}function d(e){return e.towardMore?!e.atLargest&&e.expandOnScroll?`sheet`:`scroll`:e.scrollAtStart?`sheet`:`scroll`}function f(e,t){return e*t/(1-t)}function p(e){let{extent:t,velocity:n,candidates:r}=e;if(Math.abs(n)<e.minFlingVelocity)return m(r,t);let i=t+f(n,e.rate),a=h(r,t,Math.sign(n)),o=m(r,i);return(n>0?r[o]<=t+.5:r[o]>=t-.5)&&a!==-1&&(o=a),!e.skipSnapPoints&&a!==-1&&(o=n>0?Math.min(o,a):Math.max(o,a)),o}function m(e,t){let n=0;for(let r=1;r<e.length;r++)Math.abs(e[r]-t)<Math.abs(e[n]-t)&&(n=r);return n}function h(e,t,n){if(n>0)return e.findIndex(e=>e>t+.5);for(let n=e.length-1;n>=0;n--)if(e[n]<t-.5)return n;return-1}var g=.55;function _(e,t,n=g){return e<=0?0:(1-1/(e*n/t+1))*t}function v(e,t,n=g){return e<=0?0:(1/(1-Math.min(e/t,.999999))-1)*t/n}function y(e,t,n=g){if(e<=0)return 1;let r=e*n/t+1;return n/(r*r)}function b(e,t,n,r){let i=2*Math.PI/(e*1e3),a=t;return Math.abs(a-1)<1e-6?S(i,n,r):a<1?x(i,a,n,r):C(i,a,n,r)}function x(e,t,n,r){let i=t*e,a=e*Math.sqrt(1-t*t),o=(r+i*n)/a;return{position:e=>Math.exp(-i*e)*(n*Math.cos(a*e)+o*Math.sin(a*e)),velocity:e=>{let t=Math.cos(a*e),r=Math.sin(a*e);return Math.exp(-i*e)*((o*a-i*n)*t-(n*a+i*o)*r)}}}function S(e,t,n){let r=n+e*t;return{position:n=>Math.exp(-e*n)*(t+r*n),velocity:n=>Math.exp(-e*n)*(r-e*(t+r*n))}}function C(e,t,n,r){let i=Math.sqrt(t*t-1),a=-e*(t+i),o=-e*(t-i),s=(r-a*n)/(o-a),c=n-s;return{position:e=>s*Math.exp(o*e)+c*Math.exp(a*e),velocity:e=>s*o*Math.exp(o*e)+c*a*Math.exp(a*e)}}function ee(e,{positionTolerance:t=.5,velocityTolerance:n=.02,step:r=1,limit:i=1e4}={}){for(let a=0;a<=i;a+=r)if(Math.abs(e.position(a))<=t&&Math.abs(e.velocity(a))<=n)return a;return i}function w(e,t,n,r,i=1e3/120){let a=n-t;if(Math.abs(a)<1e-6)return`linear`;let o=[];for(let t=0;t<r;t+=i)o.push(T(1+e.position(t)/a));return o.push(`1`),`linear(${o.join(`, `)})`}function T(e){return String(Math.round(e*1e4)/1e4)}var E=[],D=1;function O(e,t){return{phase:`idle`,extent:e,restingIndex:t}}function k(e,t,n){switch(t.type){case`down`:return j(e,t,n);case`move`:return M(e,t,n);case`up`:return I(e,t,n);case`settled`:return L(e);case`rest`:return R(e,t,n);case`snap-to`:return z(e,t,n);case`nudge`:return B(e,t,n);case`close`:return V(e,n,{targetIndex:-1,motion:A(e,t.time),time:t.time,reason:`imperative`,outcome:{type:`dismiss`,reason:`imperative`}})}}function A(e,t){if(e.phase!==`settling`)return{extent:e.extent,velocity:0};let n=b(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 j(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:E};if(e.phase!==`settling`)return{state:e,effects:E};let{extent:i}=A(e,t.time);return{state:{phase:`dragging`,extent:i,restingIndex:e.restingIndex,anchorY:t.y,anchorExtent:U(i,n),lastY:t.y,isScrollingContent:!1},effects:[{type:`move`,extent:i}]}}function M(e,t,n){return e.phase===`pending`?N(e,t,n):e.phase===`scrolling`&&n.contentScroll?n.contentScroll.move(e,t):e.phase===`dragging`?F(e,t,n):{state:e,effects:E}}function N(e,t,n){let r=t.x-e.originX,i=t.y-e.originY;if(Math.max(Math.abs(r),Math.abs(i))<e.slop)return{state:e,effects:E};if(Math.abs(r)>Math.abs(i))return{state:O(e.extent,e.restingIndex),effects:E};let a=n.contentScroll?.claim(e,t,i<0,n);if(a)return{state:a,effects:E};let o={...P(e,e.originY+Math.sign(i)*e.slop),lastY:t.y},s=H(o.anchorExtent+(o.anchorY-t.y),n);return{state:{...o,extent:s},effects:[{type:`move`,extent:s}]}}function P(e,t){return{phase:`dragging`,extent:e.extent,restingIndex:e.restingIndex,anchorY:t,anchorExtent:e.extent,lastY:t,isScrollingContent:!1}}function F(e,t,n){let r=e.lastY-t.y,i=e.isScrollingContent?{anchorY:e.lastY,anchorExtent:e.extent}:e,a=i.anchorExtent+(i.anchorY-t.y),o=n.contentScroll?.drag(e,t,r,a,n);if(o)return o;let s=H(a,n);return{state:{...e,anchorY:i.anchorY,anchorExtent:i.anchorExtent,extent:s,lastY:t.y,isScrollingContent:!1},effects:[{type:`move`,extent:s}]}}function I(e,t,n){if(e.phase===`pending`||e.phase===`scrolling`)return{state:O(e.extent,e.restingIndex),effects:E};if(e.phase!==`dragging`)return{state:e,effects:E};let r=n.contentScroll?.release(e,t,n);if(r)return r;let i=-t.velocity*G(e.extent,n),a=[0,...q(n)],o=n.physics,s={candidates:a,rate:o.projectionRate,minFlingVelocity:o.minFlingVelocity,skipSnapPoints:o.skipSnapPoints},c=p({...s,extent:e.extent,velocity:i}),l={motion:{extent:e.extent,velocity:i},time:t.time,reason:`swipe`};if(n.dismissible)return c>0?V(e,n,{...l,targetIndex:c-1}):V(e,n,{...l,targetIndex:-1,outcome:{type:`dismiss`,reason:`swipe`}});let u=e.anchorExtent+(e.anchorY-e.lastY),d=p({...s,extent:u,velocity:-t.velocity})===0,f=Math.max(0,c-1);return d?V(e,n,{...l,targetIndex:0,outcome:{type:`attempt-dismiss`,reason:`swipe`}}):V(e,n,{...l,targetIndex:f})}function L(e){return e.phase===`settling`?{state:O(e.to,e.targetIndex),effects:E}:{state:e,effects:E}}function R(e,t,n){if(t.extent<1&&n.dismissible)return{state:O(0,-1),effects:[{type:`dismiss`,reason:`swipe`}]};let r=m(q(n),t.extent),i=r===e.restingIndex?[]:[{type:`snap`,id:n.snapPoints[r].id,reason:`swipe`}];return{state:O(t.extent,r),effects:i}}function z(e,t,n){let r=n.snapPoints.findIndex(e=>e.id===t.id);return r===-1||e.phase===`dragging`?{state:e,effects:E}:V(e,n,{targetIndex:r,motion:A(e,t.time),time:t.time,reason:t.reason})}function B(e,t,n){return e.phase!==`idle`||e.restingIndex<0?{state:e,effects:E}:V(e,n,{targetIndex:e.restingIndex,motion:{extent:e.extent,velocity:-D},time:t.time,reason:`imperative`})}function V(e,t,n){let{targetIndex:r,motion:i,time:a,reason:o}=n,s=t.physics,c=r<0?0:t.snapPoints[r].extent,l=Math.abs(i.velocity)>=s.minFlingVelocity?s.momentumDampingRatio:s.dampingRatio,u={phase:`settling`,extent:i.extent,restingIndex:e.restingIndex,targetIndex:r,from:i.extent,to:c,velocity:i.velocity,response:s.response,dampingRatio:l,startTime:a},d=[{type:`settle`,from:i.extent,to:c,velocity:i.velocity,response:s.response,dampingRatio:l}];return r>=0&&r!==e.restingIndex&&d.push({type:`snap`,id:t.snapPoints[r].id,reason:o}),n.outcome&&d.push(n.outcome),{state:u,effects:d}}function H(e,t){let n=K(t),{coefficient:r,dimension:i}=W(t);if(e>n)return n+_(e-n,i,r);if(t.dismissible)return Math.max(0,e);let a=t.snapPoints[0].extent;return e<a?a-_(a-e,i,r):e}function U(e,t){let n=K(t),{coefficient:r,dimension:i}=W(t);if(e>n)return n+v(e-n,i,r);let a=t.snapPoints[0].extent;return!t.dismissible&&e<a?a-v(a-e,i,r):e}function W(e){return{coefficient:e.physics.rubberBand,dimension:e.physics.rubberBandDimension??e.dimension}}function G(e,t){let{coefficient:n,dimension:r}=W(t),i=K(t),a=t.snapPoints[0].extent,o=e>i?e-i:!t.dismissible&&e<a?a-e:0;return o<=0?1:y(v(o,r,n),r,n)}function K(e){return e.snapPoints[e.snapPoints.length-1].extent}function q(e){return e.snapPoints.map(e=>e.extent)}var J=[],te={claim(e,t,n,r){if(t.scroll&&d({towardMore:n,scrollAtStart:t.scroll.atStart,atLargest:e.extent>=K(r)-.5,expandOnScroll:r.expandOnScroll})===`scroll`)return{phase:`scrolling`,extent:e.extent,restingIndex:e.restingIndex,lastY:t.y}},move(e,t){return t.y>e.lastY&&t.scroll?.atStart?{state:P(e,t.y),effects:J}:{state:{...e,lastY:t.y},effects:J}},drag(e,t,n,r,i){let a=t.scroll;if(!a)return;if(e.isScrollingContent&&(n>0?!a.atEnd:!a.atStart)){let r=[{type:`scroll`,delta:n}];return{state:{...e,lastY:t.y},effects:r}}let o=K(i);if(!(n>0&&r>o&&e.extent<=o&&!a.atEnd))return;let s=[{type:`scroll`,delta:r-o}];return e.extent!==o&&s.unshift({type:`move`,extent:o}),{state:{...e,extent:o,anchorY:t.y,anchorExtent:o,lastY:t.y,isScrollingContent:!0},effects:s}},release(e,t,n){if(!e.isScrollingContent)return;let r=n.snapPoints.length-1,i=[{type:`fling-scroll`,velocity:-t.velocity}];return e.restingIndex!==r&&i.push({type:`snap`,id:n.snapPoints[r].id,reason:`swipe`}),{state:O(e.extent,r),effects:i}}},Y={ios:{response:.34,dampingRatio:1,momentumDampingRatio:.88,projectionRate:.99,minFlingVelocity:.5,skipSnapPoints:!0,rubberBand:1.9,rubberBandDimension:24,touchSlop:8,mouseSlop:4,dim:.2,velocityHorizon:70}};function ne(e){return String(e)}function re(e,t){if(typeof e==`number`)return e<=1?e*t.container:e;if(e===`content`)return t.content;let n=parseFloat(e);return e.endsWith(`rem`)?n*t.rootFontSize:e.endsWith(`%`)?n/100*t.container:e.endsWith(`px`)?n:NaN}function X(e,t){let n=e.map((e,n)=>({value:e,index:n,extent:Math.min(re(e,t),t.content)})).filter(e=>e.extent>0).sort((e,t)=>e.extent-t.extent||e.index-t.index),r=[];for(let e of n){let t=ne(e.value),n=r[r.length-1];n&&e.extent-n.extent<1?(n.ids.push(t),e.index>n.index&&Object.assign(n,{id:t,value:e.value,index:e.index}),n.extent=Math.max(n.extent,e.extent)):r.push({id:t,value:e.value,extent:Math.round(e.extent*100)/100,ids:[t],index:e.index})}return r.map(({index:e,...t})=>t)}function Z(e,t){if(t==null)return-1;let n=String(t);return e.findIndex(e=>e.ids.includes(n))}function ie(e,t,n){let r=Z(e,n),i=Z(e,t);return r>=0&&i>=0&&i<=r}function ae(e,t){return r(e,e===`start`||e===`end`?o(t):!1)}var Q=e=>e===`bottom`||e===`top`,oe=e=>e===`bottom`||e===`right`?1:-1;function $(e,t,n,r){let i=Q(e);return r.y=(i?n:t)*oe(e),r.x=i?t:n,r}function se(e,t){let n=`${Math.round(t*oe(e)*100)/100}px`;return Q(e)?`0 ${n}`:`${n} 0`}function ce(e,t){return Q(t)?e.offsetHeight:e.offsetWidth}function le(e,t,n){let r=ue(e,t,n);if(!r)return null;let{start:i,end:a}=fe(r,n);return{atStart:i,atEnd:a,area:r}}function ue(e,t,n){let r=t.ownerDocument.defaultView;if(!r||!(e instanceof Element)||!t.contains(e))return null;let i=Q(n);for(let n=e;n&&n!==t.parentElement;n=n.parentElement){if(!(i?n.scrollHeight>n.clientHeight+1:n.scrollWidth>n.clientWidth+1)||!(n instanceof HTMLElement))continue;let e=i?r.getComputedStyle(n).overflowY:r.getComputedStyle(n).overflowX;if(/auto|scroll/.test(e))return n}return null}function de(e,t){if(Q(t)){let n=e.scrollHeight-e.clientHeight;return{position:t===`bottom`?e.scrollTop:n-e.scrollTop,max:n}}let n=e.scrollWidth-e.clientWidth,r=Math.abs(e.scrollLeft),i=o(e)?n-r:r;return{position:t===`right`?i:n-i,max:n}}function fe(e,t){let{position:n,max:r}=de(e,t);return{start:n<=.5,end:n>=r-1}}function pe(e,t,n){if(Q(t))e.scrollTop+=t===`bottom`?n:-n;else{let r=t===`right`?n:-n;e.scrollLeft+=o(e)?-r:r}}var me=1e3;function he(e,t){e.requestAnimationFrame(()=>e.requestAnimationFrame(t))}function ge(e){return e===`bottom`?-120:-32}function _e(e,t){let n=[];for(let r=0;r<e.duration;r+=1e3/60)n.push(t(e.extentAt(r)));return n.push(t(e.extentAt(e.duration))),n}function ve(e,t){let r=Object.entries(t).map(([t,r])=>n(e,t,r));return()=>r.forEach(e=>e())}var ye=e=>Math.max(0,Math.min(1,e));function be(e,t,n=-1){let r=n<0?0:t[n],i=n<0?t[0]:t[n+1];return i===void 0||i<=r?+(e>r):ye((e-r)/(i-r))}function xe(e,t){let n=t[t.length-1],r=t.length>1?t[t.length-2]:0;return n<=r?+(e>=n):ye((e-r)/(n-r))}function Se(e,t){let n=t[t.length-1];return n>0?ye(e/n):0}var Ce=1e3/60,we=[`--drawer-progress`,`--drawer-dim`,`--drawer-expand`,`--drawer-stack`],Te=new WeakSet;function Ee(e){let t=e.defaultView?.CSS;if(!Te.has(e)&&t?.registerProperty){Te.add(e);for(let e of we)try{t.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:`0`})}catch{}}}function De(){typeof document<`u`&&!Te.has(document)&&a(()=>Ee(document))}var Oe=()=>typeof CSS<`u`&&CSS.supports(`animation-timing-function`,`linear(0, 1)`),ke=e=>Math.round(e*1e4)/1e4;function Ae(e){Ee(e.sheet.ownerDocument);let t=[1],n=-1,r=[],i=new Map,a={dim:0,progress:0,expand:0},o;function s(e){t=e.snapExtents.length?e.snapExtents:[1],n=e.undimmedIndex}function c(e,r=a){return r.dim=ke(be(e,t,n)),r.progress=ke(Se(e,t)),r.expand=ke(xe(e,t)),r}let l=!1;function u(t,{rest:n=!1}={}){if(!l){x(),c(t),d(a.dim),m(e.sheet,a),p(a.progress);for(let t of e.outlets())m(t.el,a),t.keyframes&&h(t,a.expand,n);n&&e.themeColor?.(a.dim)}}function d(t){let n=e.backdrop();n&&(n.style.opacity=String(t));let r=f();r&&(r.currentTime=t*1e3)}function f(){return!e.dimmed||o||(o=e.dimmed.animate({opacity:[0,1]},{...je,duration:1e3,fill:`both`}),o.pause(),o.currentTime=0),o}function p(t){let n=e.ancestors();for(let e=0;e<n.length;e++)n[e].style.setProperty(`--drawer-stack`,String(e+t))}function m(e,{dim:t,progress:n,expand:r}){e.style.setProperty(`--drawer-progress`,String(n)),e.style.setProperty(`--drawer-dim`,String(t)),e.style.setProperty(`--drawer-expand`,String(r))}function h(e,t,n){let r=i.get(e.el);r||(r=e.el.animate(Ne(e.keyframes),{duration:1e3,fill:`both`}),r.pause(),i.set(e.el,r)),r.currentTime=t*1e3,n&&(r.commitStyles?.(),r.cancel(),i.delete(e.el))}function g(t){if(l)return;if(x(),S(),!Oe())return u(t.type===`settle`?t.extentAt(t.duration):0,{rest:!0});let n=y(t);f();let i=t.type===`settle`?{duration:Math.max(1,t.duration),fill:`both`}:{timeline:t.timeline,fill:`both`},a=(e,n,a,o)=>{let s=e.animate(n,{...i,...o,easing:Me(a)});t.type===`settle`&&(s.startTime=t.startTime),r.push(s)},o=e.backdrop();o&&a(o,{opacity:[0,1]},n.dim),e.dimmed&&a(e.dimmed,{opacity:[0,1]},n.dim,je),_(e.sheet,n,a),e.ancestors().forEach((e,t)=>a(e,{"--drawer-stack":[t,t+1]},n.progress));for(let t of e.outlets())_(t.el,n,a),t.keyframes&&a(t.el,Ne(t.keyframes),n.expand);if(t.type!==`settle`)return;v(t.extentAt(t.duration));let s=r;s[0]&&(s[0].onfinish=()=>r===s&&x())}function _(e,t,n){n(e,{"--drawer-progress":[0,1]},t.progress),n(e,{"--drawer-dim":[0,1]},t.dim),n(e,{"--drawer-expand":[0,1]},t.expand)}function v(t){let n=c(t,{dim:0,progress:0,expand:0});d(n.dim),m(e.sheet,n),p(n.progress);for(let t of e.outlets())if(m(t.el,n),t.keyframes)for(let[e,r]of Object.entries(t.keyframes)){let i=r[n.expand>=.5?r.length-1:0];t.el.style.setProperty(Pe(e),String(i))}e.themeColor?.(n.dim)}function y(e){let t={dim:[],progress:[],expand:[]},n={dim:0,progress:0,expand:0},r=e.type===`settle`?Math.max(2,Math.ceil(e.duration/Ce)+1):61;for(let i=0;i<r;i++){let a=i/(r-1);c(e.type===`settle`?e.extentAt(Math.min(e.duration,i*Ce)):e.extentAt(a),n),t.dim.push(n.dim),t.progress.push(n.progress),t.expand.push(n.expand)}return t}function b(e){for(let t of r)t.startTime=e}function x(){if(r.length){for(let e of r)e.cancel();r=[]}}function S(){for(let e of i.values())e.cancel();i.clear()}function C(){l=!0,x(),S(),e.backdrop()?.style.removeProperty(`opacity`),o?.cancel();for(let t of we.slice(0,3))e.sheet.style.removeProperty(t);for(let t of e.outlets()){for(let e of we.slice(0,3))t.el.style.removeProperty(e);for(let e of Object.keys(t.keyframes??{}))t.el.style.removeProperty(Pe(e))}}return{configure:s,compute:c,apply:u,play:g,sync:b,follow:g,stop:x,destroy:C}}var je={pseudoElement:`::backdrop`};function Me(e){return`linear(${e.map(ke).join(`, `)})`}var Ne=e=>e;function Pe(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var Fe={horizon:70,staleAfter:40,maxSpeed:8,capacity:20};function Ie(e,t,n=0,r=e.length){let i=r-n;if(i<2)return 0;let a=e[r-1];if(i<4)return Le(e,t,n,r);let o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0;for(let i=n;i<r;i++){let n=e[i]-a,r=t[i],m=n*n;o+=1,s+=n,c+=m,l+=m*n,u+=m*m,d+=r,f+=r*n,p+=r*m}let m=o*(c*u-l*l)-s*(s*u-l*c)+c*(s*l-c*c);return Math.abs(m)<1e-9?Le(e,t,n,r):(o*(f*u-l*p)-d*(s*u-l*c)+c*(s*p-f*c))/m}function Le(e,t,n,r){let i=0,a=0,o=r-n;for(let s=n;s<r;s++)i+=e[s]/o,a+=t[s]/o;let s=0,c=0;for(let o=n;o<r;o++){let n=e[o]-i;s+=n*(t[o]-a),c+=n*n}return c>0?s/c:0}function Re(e={}){let{horizon:t,staleAfter:n,maxSpeed:r,capacity:i}={...Fe,...e},a=new Float64Array(i),o=new Float64Array(i),s=new Float64Array(i),c=new Float64Array(i),l=0,u=-1;function d(e,t){l>0&&e<=a[u]||(u=(u+1)%i,a[u]=e,o[u]=t,l=Math.min(l+1,i))}function f(e){if(l<2)return 0;let d=a[u];if(e-d>n)return 0;let f=0;for(let e=l-1;e>=0;e--){let n=(u-e+i)%i;d-a[n]>t||(s[f]=a[n],c[f]=o[n],f++)}let p=Ie(s,c,0,f);return Math.max(-r,Math.min(r,p))}function p(){l=0,u=-1}return{add:d,velocity:f,reset:p}}var ze=.998,Be=`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-drawer-no-drag]`;function Ve(e){let{sheet:n}=e,r=n.ownerDocument,i=r.defaultView??window,a=O(0,-1),o=0,s=null,c=0,f=0,p=null,h=null,g=null,_=null,v=null,y=null,x=null,S=!1,C=!1,T=null,E=null,D=null,A={x:0,y:0},j=Re({horizon:e.config().physics.velocityHorizon}),M=[t(r,`touchstart`,q,{capture:!0,passive:!0}),t(r,`touchmove`,J,{capture:!0,passive:!1}),t(r,`touchend`,Y,{capture:!0,passive:!0}),t(r,`touchcancel`,Y,{capture:!0,passive:!0}),t(n,`pointerdown`,re)],N=!1;function P(t){N||(n.style.translate=se(e.side(),e.size()-t),o=t)}function F(t,n){if(N)return;let r=k(a,t,e.config());a=r.state;let i=`time`in t?t.time:performance.now();for(let e of r.effects)I(e,i,n);let o=a.phase===`dragging`;o!==S&&(S=o,e.onDragChange(S))}function I(t,n,r){switch(t.type){case`move`:p?(B(),P(t.extent),e.onFrame(t.extent)):(s=t.extent,H());return;case`settle`:return L(t,n);case`scroll`:return c+=t.delta,H();case`fling-scroll`:return v&&(_={velocity:t.velocity,startTime:n,startScroll:0,area:v}),H();case`snap`:return E=t.id,e.onSnap(t.id,t.reason,r);case`dismiss`:return t.reason===`swipe`?(g=`swipe`,e.onDismiss(r)):void 0;case`attempt-dismiss`:return e.onDismissAttempt(r)}}function L(t,r){B(),s=null;let i=e.closedExtent(),a=t.from<=0?i:t.from,o=t.to<=0?i:t.to,c=e.reducedMotion()&&(a===i||o===i),l=e.reducedMotion()?z(a,o,c):R(a,o,t);if(P(c?Math.max(o,0):o),Math.abs(o-a)<.5&&t.velocity===0||l.duration===0)return V();let u=e.size(),d=e.side();p=c?n.animate({opacity:a===i?[0,1]:[1,0]},{duration:l.duration,fill:`both`}):Math.abs(o-a)<1||!Oe()?n.animate({translate:_e(l,e=>se(d,u-e))},{duration:l.duration,fill:`backwards`}):n.animate({translate:[se(d,u-a),se(d,u-o)]},{duration:l.duration,easing:l.easing,fill:`backwards`}),c&&(h=p);let f=p;p.onfinish=()=>{p===f&&V()},p.startTime=r,e.onMotion({type:`settle`,extentAt:l.extentAt,startTime:r,duration:l.duration})}function R(e,t,n){let r=b(n.response,n.dampingRatio,e-t,n.velocity),i=ee(r);return{duration:i,easing:w(r,e,t,i),extentAt:e=>t+r.position(e)}}function z(e,t,n){let r=n?150:200,i=e=>1-(1-e)**3;return{duration:r,easing:`cubic-bezier(0.33, 1, 0.68, 1)`,extentAt:n=>e+(t-e)*i(Math.min(1,n/r))}}function B(){p?.cancel(),p=null,h&&=(h.cancel(),null)}function V(){if(B(),F({type:`settled`}),a.phase===`idle`){if(a.restingIndex<0)return g=null,E=null,e.onRest(null);E=e.config().snapPoints[a.restingIndex].id,e.onRest(E)}}function H(){f||=i.requestAnimationFrame(U)}function U(t){f=0,c&&v&&(pe(v,e.side(),c),c=0),_&&W(t),s!==null&&(P(s),s=null,e.onFrame(o))}function W(t){if(!_)return;let n=Math.max(0,t-_.startTime),r=_.velocity*(ze**n-1)/Math.log(ze);pe(_.area,e.side(),r-_.startScroll),_.startScroll=r,Math.abs(_.velocity*ze**n)<.01?_=null:H()}function G(e){return e instanceof Element&&e.closest(Be)!==null}function K(t){let r=le(t,n,e.side());return v=r?.area??null,r&&{atStart:r.atStart,atEnd:r.atEnd}}function q(t){let n=T!==null&&l(T);if(T=null,y||t.touches.length>1||g||n||!e.owns(t.target)||G(t.target))return;let r=t.changedTouches[0];y={id:r.identifier,originX:r.clientX,originY:r.clientY},_=null,j.reset(),$(e.side(),r.clientX,r.clientY,A),j.add(t.timeStamp,A.y),F({type:`down`,time:t.timeStamp,x:A.x,y:A.y,pointer:`touch`},t)}function J(t){let n=ne(t.changedTouches);if(!n)return;$(e.side(),n.clientX,n.clientY,A),j.add(t.timeStamp,A.y);let r=a.phase===`dragging`,i=K(t.target);if(F({type:`move`,time:t.timeStamp,x:A.x,y:A.y,scroll:i},t),a.phase===`pending`)return te(t,n,i);a.phase===`dragging`&&(t.cancelable?t.preventDefault():!r&&v&&(v.style.overscrollBehavior=`none`))}function te(t,n,r){if(!t.cancelable||!y)return;let i=$(e.side(),y.originX,y.originY,{x:0,y:0});if(Math.abs(A.y-i.y)<Math.abs(A.x-i.x))return;let a=e.config().snapPoints.at(-1)?.extent??0;(r?d({towardMore:A.y<i.y,scrollAtStart:r.atStart,atLargest:o>=a-.5,expandOnScroll:e.config().expandOnScroll}):`sheet`)===`sheet`&&t.preventDefault()}function Y(e){if(!ne(e.changedTouches))return;y=null,v&&v.style.removeProperty(`overscroll-behavior`);let t=e.type===`touchcancel`?0:j.velocity(e.timeStamp);F({type:`up`,time:e.timeStamp,velocity:t},e)}function ne(e){if(!y)return null;for(let t=0;t<e.length;t++)if(e[t].identifier===y.id)return e[t];return null}function re(n){if(T=n,n.pointerType===`touch`||n.button!==0||x!==null||g)return;let i=n.target;if(!e.owns(i)||G(i)||!(i instanceof Element)||!e.canMouseDrag(i))return;x=n.pointerId,C=!1,D=a.phase===`settling`&&a.targetIndex>=0?E:null,_=null,j.reset(),$(e.side(),n.clientX,n.clientY,A),j.add(n.timeStamp,A.y),X=[t(r,`pointermove`,Z,{capture:!0}),t(r,`pointerup`,ie,{capture:!0}),t(r,`pointercancel`,ie,{capture:!0})];let o=n.pointerType===`pen`?`pen`:`mouse`;F({type:`down`,time:n.timeStamp,x:A.x,y:A.y,pointer:o},n)}let X=[];function Z(t){if(t.pointerId!==x)return;if(T&&l(T))return ae(t,0,D);let i=t.getCoalescedEvents?.();for(let n of i?.length?i:[t])j.add(n.timeStamp,$(e.side(),n.clientX,n.clientY,A).y);if($(e.side(),t.clientX,t.clientY,A),F({type:`move`,time:t.timeStamp,x:A.x,y:A.y,scroll:K(t.target)},t),!(a.phase!==`dragging`||C)){C=!0,r.getSelection()?.removeAllRanges(),n.style.userSelect=`none`;try{n.setPointerCapture(t.pointerId)}catch{}}}function ie(e){if(e.pointerId===x){if(T&&l(T))return ae(e,0,D);ae(e,e.type===`pointercancel`?0:j.velocity(e.timeStamp))}}function ae(t,i,o=null){x=null,T=null,X.forEach(e=>e()),X=[],n.style.removeProperty(`user-select`);let s=t.timeStamp,c=e.config().snapPoints.findIndex(e=>e.id===o);o!==null&&c>=0?(a=O(a.extent,c),F({type:`snap-to`,time:s,id:o,reason:`imperative`})):F({type:`up`,time:s,velocity:i},t),C&&u(r)}return{open(t,n){g=null,E=t,B();let r=e.config().snapPoints.findIndex(e=>e.id===t);if(!n&&r>=0)return a=O(e.config().snapPoints[r].extent,r),P(a.extent),e.onRest(t);a=O(0,-1),P(e.closedExtent()),F({type:`snap-to`,time:performance.now()+me,id:t,reason:`imperative`});let o=p;o&&he(i,t=>{p===o&&a.phase===`settling`&&(o.startTime=t,a={...a,startTime:t},e.onMotionStart(t))})},close(){let e=g;g=`close`,e||F({type:`close`,time:performance.now()})},snapTo(e,t){g!==`close`&&(g=null,F({type:`snap-to`,time:performance.now(),id:e,reason:t}))},nudge(){!g&&!e.reducedMotion()&&F({type:`nudge`,time:performance.now()})},relayout(t,n){let r=e.config().snapPoints;if(g||E===null||a.phase===`dragging`||a.phase===`pending`)return P(o);let i=r.findIndex(e=>e.id===E),s=r.findIndex(e=>e.id===n),c=i>=0?i:s>=0?s:m(r.map(e=>e.extent),o),{id:l,extent:u}=r[c];if(a.phase===`idle`&&(a=O(o,i),t||Math.abs(u-o)<.5))return a=O(u,c),P(u),t?(l!==E&&I({type:`snap`,id:l,reason:`content-resize`},performance.now()),e.onRest(l)):void 0;F({type:`snap-to`,time:performance.now(),id:l,reason:`content-resize`})},target:()=>g?null:E,isMoving:()=>a.phase!==`idle`,destroy(){N=!0,B(),f&&i.cancelAnimationFrame(f),M.forEach(e=>e()),X.forEach(e=>e()),S&&e.onDragChange(!1);for(let e of[`translate`,`user-select`,`opacity`])n.style.removeProperty(e)}}}var He=120,Ue=24;function We(e){let{sheet:n,host:r}=e,a=n.ownerDocument,o=a.defaultView??window,s=O(0,-1),c=0,l=[],u=null,d=!1,f=!1,p=!1,h=null,g=0,_=0,v=null,y=new Map,x=null,S=ve(r,{inset:`0 0 calc(var(--keyboard-inset, 0px) - 120px) 0`,display:`block`,"overflow-y":`scroll`,"overflow-x":`hidden`,"scroll-snap-type":`y mandatory`,"scrollbar-width":`none`,"overscroll-behavior":`contain`,"pointer-events":`auto`}),C=ve(n,{position:`absolute`,left:`0`,right:`0`}),T=`onscrollend`in r,E=o.ScrollTimeline,D=[t(r,`scroll`,R,{passive:!0}),...T?[t(r,`scrollend`,H)]:[],t(r,`touchstart`,()=>{d=!0,f=!1,u&&!h&&W()},{passive:!0}),t(r,`touchend`,B,{passive:!0}),t(r,`touchcancel`,B,{passive:!0})],A=i()?1:121,j=new IntersectionObserver(U,{root:r,rootMargin:`0px 0px -${A}px 0px`,threshold:0});j.observe(n);let M=()=>e.config().dimension,N=()=>e.config().snapPoints.at(-1)?.extent??0,P=()=>N()+Ue-c,F=()=>Math.min(r.scrollTop+c,N());function I(){let t=e.config();c=t.dismissible?-120:t.snapPoints[0].extent,n.style.top=`${M()-c}px`;for(let e of l)e.remove();let i=t.snapPoints.map(e=>e.extent);l=(t.dismissible?[c,...i]:i).map(e=>L(e-c,`start`)),l.push(L(P()+r.clientHeight-1,`none`)),r.append(...l);for(let e of y.keys())n.contains(e)||y.delete(e);for(let e of Ge(n))y.has(e)||y.set(e,[e.style.getPropertyValue(`overflow-y`),e.style.getPropertyPriority(`overflow-y`)])}function L(e,t){let n=a.createElement(`div`);return n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position:absolute;left:0;width:1px;height:1px;top:${e}px;scroll-snap-align:${t};pointer-events:none`,n}function R(){u||h||(x&&d&&Math.abs(r.scrollTop-x.offsetTop)>1&&G(),d&&!p&&V(!0),E||(_||=o.requestAnimationFrame(z)),o.clearTimeout(g),!T&&!d&&(g=o.setTimeout(H,He)))}function z(){_=0,e.onFrame(F())}function B(){if(d=!1,V(!1),x){G();let t=e.config().snapPoints;return Y(t[m(t.map(e=>e.extent),F())].id,`swipe`)}!e.config().dismissible&&r.scrollTop<-2&&e.onDismissAttempt(),(f||!T)&&(g=o.setTimeout(H,He)),f=!1}function V(t){p!==t&&(p=t,e.onDragChange(t))}function H(){if(d){f=!0;return}if(u||h)return;let t=e.config(),n=k(s,{type:`rest`,extent:F()},t);s=n.state;for(let t of n.effects)t.type===`snap`&&(v=t.id,e.onSnap(t.id,t.reason));s.restingIndex>=0&&J(t.snapPoints[s.restingIndex].id)}function U(t){t[t.length-1].isIntersecting||u||h||v===null||!e.config().dismissible||(h=`swipe`,v=null,e.onDismiss())}function W(){if(!u)return;let e=Math.max(0,u.extentAt(performance.now()-u.startTime)-c);q(),x=L(e,`start`),r.append(x),r.scrollTop=e,z(),te()}function G(){x?.remove(),x=null}function K(t,i,a,o){q();let s=e.config().physics,l=b(s.response,s.dampingRatio,i-t,0),d=Math.max(1,ee(l)),f=Math.max(c,t);r.scrollTop=f-c;let p=e=>t+l.position(Math.max(0,e)),m=Math.abs(t-i)<.5,h=!m&&!Oe(),g=n.animate({translate:h?_e({duration:d,extentAt:p},e=>`0 ${f-e}px`):[`0 ${f-i}px`,`0 ${f-t}px`]},{duration:d,easing:m||h?`linear`:w(l,i,t,d),fill:`both`});g.startTime=a,u={animation:g,to:t,extentAt:p,startTime:a},e.onMotion({type:`settle`,extentAt:p,startTime:a,duration:d}),g.onfinish=()=>{u?.animation===g&&(u=null,o(),g.cancel())}}function q(){u?.animation.cancel(),u=null}function J(t){let n=e.config(),i=n.snapPoints.findIndex(e=>e.id===t);s=O(n.snapPoints[i].extent,i),v=t,r.style.pointerEvents=e.isInteractive(t)?`none`:`auto`;let a=i===n.snapPoints.length-1;for(let[e,[t,n]]of y)a?e.style.setProperty(`overflow-y`,t,n):e.style.overflowY=`hidden`;e.onRest(t),te()}function te(){if(!E)return;let t=P(),n=new E({source:r,axis:`block`});e.onMotion({type:`timeline`,timeline:n,extentAt:e=>Math.min(N(),e*t+c)})}function Y(t,n){let r=e.config().snapPoints.find(e=>e.id===t);if(!r||h===`close`)return;h=null,t!==v&&(v=t,e.onSnap(t,n));let i=u?u.extentAt(performance.now()-u.startTime):F();K(r.extent,i,performance.now(),()=>J(t))}return{open(t,n){h=null,v=t,I();let i=e.config().snapPoints.find(e=>e.id===t);if(!i)return;if(!n)return r.scrollTop=i.extent-c,J(t);K(i.extent,-120,performance.now()+me,()=>J(t));let a=u;he(o,t=>{a&&u===a&&(a.animation.startTime=t,a.startTime=t,e.onMotionStart(t))})},close(){let t=h;h=`close`,t||(v=null,K(-120,u?u.extentAt(performance.now()-u.startTime):F(),performance.now(),()=>e.onRest(null)))},snapTo:Y,nudge(){if(h||e.reducedMotion()||v===null)return;let t=e.config().snapPoints.find(e=>e.id===v);t&&K(t.extent,t.extent-20,performance.now(),()=>J(t.id))},relayout(t,n){if(h||d)return;let i=e.config().snapPoints,a=i.findIndex(e=>e.id===v),o=i.findIndex(e=>e.id===n),s=a>=0?a:o>=0?o:m(i.map(e=>e.extent),F()),l=c;I();let f=i[s];if(f.id!==v&&(v=f.id,e.onSnap(f.id,`content-resize`)),u){let e=u,t=performance.now();(e.to!==f.extent||c!==l)&&(K(f.extent,e.extentAt(t-e.startTime),Math.max(t,e.startTime),()=>J(f.id)),u=Object.assign(e,u))}else r.scrollTop=f.extent-c,J(f.id)},target:()=>h?null:v,isMoving:()=>!!u||p,destroy(){q(),G(),o.clearTimeout(g),_&&o.cancelAnimationFrame(_),j.disconnect(),D.forEach(e=>e());for(let e of l)e.remove();for(let[e,[t,n]]of y)e.style.setProperty(`overflow-y`,t,n);p&&e.onDragChange(!1),n.style.removeProperty(`top`),C(),S()}}}function Ge(e){let t=e.ownerDocument.defaultView??window;return Array.from(e.querySelectorAll(`*`)).filter(e=>/auto|scroll/.test(t.getComputedStyle(e).overflowY))}function Ke(e){let t=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e);return t?[t[1],t[2],t[3]].map(Number):null}function qe(e,t){let n=Array.from(e.querySelectorAll(`meta[name="theme-color"]`)),r=n.map(e=>e.content),i=r.map(t=>Ke(Je(e,t))),a=-1;function o(e){let o=Math.round(e*t*100)/100;o!==a&&(a=o,n.forEach((e,t)=>{let n=i[t];n&&(e.content=o?`rgb(${n.map(e=>Math.round(e*(1-o))).join(` `)})`:r[t])}))}function s(){n.forEach((e,t)=>e.content=r[t]),a=-1}return{write:o,restore:s}}function Je(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 Ye=`a[href], button, label, summary, [role="button"], [role="link"], [role="slider"], [tabindex]:not([tabindex="-1"])`,Xe=e=>!e.closest(Ye),Ze=()=>{};function Qe(e){return{side:()=>`bottom`,snapPoints:()=>[`content`],snapPoint:()=>null,dismissible:()=>!0,modalAbove:()=>void 0,driver:()=>`auto`,expandOnScroll:()=>!0,physics:()=>void 0,backdrop:()=>void 0,hostBackdrop:!1,outlets:()=>[],parent:()=>void 0,themeColor:()=>!1,preventEdgeSwipe:()=>!1,canMouseDrag:Xe,onSnap:Ze,onRest:Ze,onDismissAttempt:Ze,onDragChange:Ze,onLayout:Ze,...$e(e)}}function $e(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var et=new WeakSet,tt=new WeakMap;function nt(e){for(let t=e.parent;t;t=t.parent){let e=tt.get(t);if(e)return e}}function rt(e){for(let t=e instanceof Element?e:null;t;){if(et.has(t))return t;let e=t.getRootNode();t=t.parentElement??(e instanceof ShadowRoot?e.host:null)}return null}function it(e,t){let n=e.closest(`[popover]`);return!!n&&n!==t&&t.contains(n)}var at=24;function ot(e,t){let n=t.driver();return n===`auto`?t.modalAbove()===void 0&&t.expandOnScroll()&&!!e.matchMedia?.(`(hover: none) and (pointer: coarse)`).matches:n===`scroll-snap`}var st={duration:250,easing:`cubic-bezier(0.38, 0.7, 0.125, 1)`};function ct(e,n){let r=Qe(n),{host:a}=r,o=e.ownerDocument,c=o.defaultView??window,l=c.matchMedia?.(`(prefers-reduced-motion: reduce)`),u=ae(r.side(),e),d=[],f=0,p,m=Y.ios,h,g,_={snapPoints:[],dimension:0,dismissible:!0,expandOnScroll:!0,physics:m,contentScroll:te},v=u===`bottom`&&ot(c,r);et.add(e);let y=[lt(a,u,e),ut(e)],b=[],x=Ae({sheet:e,backdrop:r.backdrop,dimmed:r.hostBackdrop?a:void 0,outlets:r.outlets,ancestors:()=>b,themeColor:e=>h?.write(e)});function S(){let e=r.physics();return e!==p&&(p=e,m=e?{...Y.ios,...e}:Y.ios),_.physics=m,_.dismissible=r.dismissible(),_.expandOnScroll=r.expandOnScroll(),_}let C=!1;function ee(){C=!0;let t=ae(r.side(),e);t!==u&&(u=t,y[0](),y[0]=lt(a,u,e));let n=(Q(u)?a.clientHeight:a.clientWidth)-(v?120:0);M??=c.visualViewport?.height,f=ce(e,u);let i=parseFloat(c.getComputedStyle(o.documentElement).fontSize)||16,s=X(r.snapPoints(),{container:n,content:f,rootFontSize:i});s.length||s.push({id:`content`,value:`content`,extent:f,ids:[`content`]});let l=n!==_.dimension||s.length!==d.length||s.some((e,t)=>e.id!==d[t].id||Math.abs(e.extent-d[t].extent)>=.5);return d=s,_.dimension=n,_.snapPoints=d.map(({id:e,extent:t})=>({id:e,extent:t})),x.configure({snapExtents:_.snapPoints.map(e=>e.extent),undimmedIndex:Z(d,r.modalAbove())}),l&&O(),l}let w=!1,T=e=>e===null?null:d.find(t=>t.id===e)?.value??null,E={sheet:e,host:a,side:()=>u,config:S,size:()=>f,closedExtent:()=>ge(u),reducedMotion:()=>!!l?.matches,owns:t=>rt(t)===e,canMouseDrag:r.canMouseDrag,onSnap:(e,t,n)=>{let i=T(e);i!==null&&r.onSnap(i,t,n)},onRest(e){if(w)return;let t=d.find(t=>t.id===e);x.apply(t?.extent??ge(u),{rest:!0}),r.onRest(T(e)),R&&e!==null&&B(),R=!1},onDismiss:r.onDismiss,onDismissAttempt:r.onDismissAttempt,onDragChange:r.onDragChange,isInteractive:e=>U.isInteractiveAt(T(e)),onFrame:e=>w||x.apply(e),onMotion:e=>w||x.play(e),onMotionStart:e=>w||x.sync(e)},D=!0;function O(){if(!D)return r.onLayout({side:u,snapPoints:d});queueMicrotask(()=>w||r.onLayout({side:u,snapPoints:d}))}S();let k=v?We(E):Ve(E);e.setAttribute(`data-driver`,v?`scroll-snap`:`pointer`),D=!1;let A=new ResizeObserver(()=>{V(!1)});A.observe(e),A.observe(a);let j=0,M,N=null,P=[s(a,{before:()=>j=e.getBoundingClientRect().top,after:F}),...r.preventEdgeSwipe()?[t(o,`touchstart`,I,{capture:!0,passive:!1})]:[],...i()?[t(o,`touchend`,L,{capture:!0,passive:!1})]:[],t(e,`focusin`,z)];function F(){V(!0),B();let t=c.visualViewport?.height;if(t===M)return;M=t,N?.cancel(),N=null;let n=j-e.getBoundingClientRect().top;Math.abs(n)<1||l?.matches||(N=a.animate({translate:[`0 ${n}px`,`0 0`]},st))}function I(e){if(!e.cancelable)return;let t=e.touches[0];if(!t||t.clientX>at&&t.clientX<c.innerWidth-at)return;let n=e.target;n&&(a.contains(n)||r.backdrop()?.contains(n))&&e.preventDefault()}function L(t){let n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&e.contains(n)&&n!==o.activeElement&&!k.isMoving()&&t.cancelable&&(t.preventDefault(),n.focus({preventScroll:!0}))}let R=!1;function z(){k.isMoving()?R=!0:B()}function B(){let t=o.activeElement;if(!(t instanceof HTMLElement)||!e.contains(t)||t===e||it(t,e))return;let n=ue(t,e,`bottom`);if(!n)return;let r=c.visualViewport,i=Math.min(n.getBoundingClientRect().bottom,r?r.offsetTop+r.height:c.innerHeight),{top:a,bottom:s}=t.getBoundingClientRect(),u=n.getBoundingClientRect().top,d=s+16>i?s+16-i:a-16<u?a-16-u:0;d&&n.scrollBy({top:d,behavior:l?.matches?`instant`:`smooth`})}function V(e){let t=!C;ee()&&!t&&k.relayout(e,d[Z(d,r.snapPoint())]?.id)}function H(e){let t=Z(d,e);return d[t>=0?t:0]?.id}let U={element:e,parent:r.parent,open(e){if(w)return;b=[];for(let e=r.parent();e;e=e.parent())b.push(e.element);ee(),S(),r.themeColor()&&(h??=qe(o,m.dim)),e&&x.apply(ge(u)),g?.();let t=r.backdrop();g=t&&ve(t,{"will-change":`opacity`}),k.open(H(r.snapPoint()),e)},close:()=>w||k.close(),snapTo(e,t){let n=Z(d,e);n>=0&&d[n].id!==k.target()&&k.snapTo(d[n].id,t)},nudge:()=>k.nudge(),snapPoints:()=>d,target:()=>T(k.target()),isInteractiveAt:e=>ie(d,e,r.modalAbove()),refresh(){V(!1)},destroy(){w=!0,A.disconnect(),N?.cancel(),P.forEach(e=>e()),k.destroy(),x.destroy(),g?.(),h?.restore(),y.forEach(e=>e()),e.removeAttribute(`data-driver`),et.delete(e)}};return U}function lt(e,t,n){let r=Q(t),i=r?t===`bottom`:t===`right`!=(n.ownerDocument.defaultView?.getComputedStyle(e).direction===`rtl`);return ve(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":i?`flex-end`:`flex-start`,"pointer-events":`none`})}function ut(e){return ve(e,{"pointer-events":`auto`,"overscroll-behavior":`contain`,"will-change":`translate`})}function dt(t){let n=t.getAttribute(`data-slot`);n&&e(t.ownerDocument,`ui-sdk-sheet-${n}`,`@layer ui-sdk { :where([data-slot="${n}"])::backdrop { background: var(--sheet-backdrop, rgb(0 0 0 / 0.2)); pointer-events: auto } }`)}function ft(e,t){let r=[],i=e=>{for(let a of Array.from(e.children))t.includes(a)||(t.some(e=>e&&a.contains(e))?i(a):a instanceof HTMLElement&&r.push(n(a,`display`,`none`)))};return i(e),()=>r.forEach(e=>e())}function pt(e,t,r){let i,a=t.bind(e,{...r,position:void 0,inline:!0,onShow(){let[t,n]=r.drillIn();return t&&(i=ft(t,[e,n])),()=>i?.()},onClose(){i?.(),i=n(e,`display`,`none`)}});return()=>{a(),i?.()}}function mt(e,t,n){if(n.drillIn)return pt(e,t,n);let r=e.parentElement;if(!r)return;dt(r);let i;return t.bind(e,{...n,position:void 0,host:()=>r,onShow(a){let o=ht(e,r,t,n,a);return i=o.sheet,()=>{o.hide(),i=void 0}},onClose:()=>i?.close()})}function ht(e,n,r,i,a){let o=null,s=nt(a),c=!i.backdrop?.(),l=ct(e,{host:n,snapPoints:()=>i.snapPoints??[`content`],snapPoint:()=>o,backdrop:i.backdrop,hostBackdrop:c,dismissible:i.dismissible,onDismissAttempt:i.onDismissAttempt,parent:()=>s?.(),onSnap:e=>o=e,onDismiss(e){r.requestClose(`swipe`,e),requestAnimationFrame(()=>{let e=o??l.snapPoints()[0]?.value;a.active()&&e!==void 0&&l.snapTo(e,`imperative`)})}});tt.set(a,()=>l),i.onSheet?.(l);let u=t(e,`focusin`,e=>{let t=l.snapPoints().at(-1);t&&l.snapPoints().length>1&&e.target.matches(`input, textarea`)&&l.snapTo(t.value,`imperative`)}),d=c?getComputedStyle(e).getPropertyValue(`--sheet-backdrop`):`transparent`;return d&&n.style.setProperty(`--sheet-backdrop`,d),a.active()&&l.open(r.opener()!==`initial`),{sheet:l,hide(){u(),tt.delete(a),l.destroy(),i.onSheet?.(void 0),n.style.removeProperty(`--sheet-backdrop`)}}}export{De as prepareVariables,mt as presentSheet};
@@ -3,9 +3,14 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link
7
+ rel="icon"
8
+ type="image/svg+xml"
9
+ href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%234f46e5'/%3E%3Ccircle cx='16' cy='16' r='6' fill='%23a5f3fc'/%3E%3C/svg%3E"
10
+ />
6
11
  <title>Wheatley</title>
7
- <script type="module" crossorigin src="/assets/index-RnxedkKh.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-3COz_MZq.css">
12
+ <script type="module" crossorigin src="/assets/index-DXzGGAxQ.js"></script>
13
+ <link rel="stylesheet" crossorigin href="/assets/index-C9Rul5vE.css">
9
14
  </head>
10
15
  <body>
11
16
  <div id="root"></div>
@@ -42,6 +42,16 @@ export declare const WebhooksConfigSchema: Type.TObject<{
42
42
  port: Type.TOptional<Type.TInteger>;
43
43
  }>;
44
44
  export type WebhooksConfig = Static<typeof WebhooksConfigSchema>;
45
+ /** The Webhook Ingress host if `webhooks.host` is absent. A reverse proxy in front of it terminates TLS. */
46
+ export declare const DEFAULT_WEBHOOK_HOST = "127.0.0.1";
47
+ /** The Webhook Ingress port if `webhooks.port` is absent. */
48
+ export declare const DEFAULT_WEBHOOK_PORT = 8788;
49
+ /**
50
+ * Returns the Webhook Ingress path of the webhook Trigger `triggerId` of `agent`: `/webhooks/<agent>/<triggerId>`.
51
+ * The ingress matches the raw path segments without percent-decoding, so the parts stay unencoded. Agent names are
52
+ * URL-safe by `AgentNameSchema`.
53
+ */
54
+ export declare const webhookTriggerPath: (agent: string, triggerId: string) => string;
45
55
  /** Memory settings of one Agent (ADR 0009). */
46
56
  export declare const MemoryConfigSchema: Type.TObject<{
47
57
  consolidation: Type.TOptional<Type.TObject<{
@@ -40,6 +40,16 @@ export const WebhooksConfigSchema = Type.Object({
40
40
  host: Type.Optional(Type.String({ minLength: 1 })),
41
41
  port: Type.Optional(Type.Integer({ maximum: MAX_TCP_PORT, minimum: 1 })),
42
42
  }, strict);
43
+ /** The Webhook Ingress host if `webhooks.host` is absent. A reverse proxy in front of it terminates TLS. */
44
+ export const DEFAULT_WEBHOOK_HOST = "127.0.0.1";
45
+ /** The Webhook Ingress port if `webhooks.port` is absent. */
46
+ export const DEFAULT_WEBHOOK_PORT = 8788;
47
+ /**
48
+ * Returns the Webhook Ingress path of the webhook Trigger `triggerId` of `agent`: `/webhooks/<agent>/<triggerId>`.
49
+ * The ingress matches the raw path segments without percent-decoding, so the parts stay unencoded. Agent names are
50
+ * URL-safe by `AgentNameSchema`.
51
+ */
52
+ export const webhookTriggerPath = (agent, triggerId) => `/webhooks/${agent}/${triggerId}`;
43
53
  /** Memory settings of one Agent (ADR 0009). */
44
54
  export const MemoryConfigSchema = Type.Object({
45
55
  consolidation: Type.Optional(Type.Object({
@@ -1,4 +1,4 @@
1
- export { type AgentConfig, AgentConfigSchema, type DaemonConfig, DaemonConfigSchema, type DeploymentConfig, DeploymentConfigSchema, type FrontendBindingConfig, FrontendBindingConfigSchema, type McpServerConfig, McpServerConfigSchema, type MemoryConfig, MemoryConfigSchema, type ModelChoice, ModelChoiceSchema, type PluginConfig, PluginConfigSchema, type ProviderConfig, ProviderConfigSchema, type SecretRef, SecretRefSchema, type StringOrSecret, StringOrSecretSchema, type WebhooksConfig, WebhooksConfigSchema, } from "./config.js";
1
+ export { type AgentConfig, AgentConfigSchema, type DaemonConfig, DaemonConfigSchema, DEFAULT_WEBHOOK_HOST, DEFAULT_WEBHOOK_PORT, type DeploymentConfig, DeploymentConfigSchema, type FrontendBindingConfig, FrontendBindingConfigSchema, type McpServerConfig, McpServerConfigSchema, type MemoryConfig, MemoryConfigSchema, type ModelChoice, ModelChoiceSchema, type PluginConfig, PluginConfigSchema, type ProviderConfig, ProviderConfigSchema, type SecretRef, SecretRefSchema, type StringOrSecret, StringOrSecretSchema, type WebhooksConfig, WebhooksConfigSchema, webhookTriggerPath, } from "./config.js";
2
2
  export { type AgentHealth, AgentHealthSchema, type AgentName, AgentNameSchema, type AgentState, AgentStateSchema, type ApprovalDecision, ApprovalDecisionSchema, type ApprovalOutcome, ApprovalOutcomeSchema, type ApprovalResolution, ApprovalResolutionSchema, type AttachmentInfo, AttachmentInfoSchema, type AttachmentUpload, AttachmentUploadSchema, type BindingStatus, BindingStatusSchema, type ChatKey, ChatKeySchema, type ChatMessage, ChatMessageSchema, type CommandName, CommandNameSchema, type ConfigIssue, ConfigIssueSchema, type ConsolidationLogEntry, ConsolidationLogEntrySchema, type ConversationMode, ConversationModeSchema, type DaemonStatus, DaemonStatusSchema, type DeliveryKind, DeliveryKindSchema, type Duration, DurationSchema, type ExtensionState, ExtensionStateSchema, type ExtensionStatus, ExtensionStatusSchema, type FailedDelivery, FailedDeliverySchema, type GatePressure, GatePressureSchema, type Id, IdSchema, type LogLevel, LogLevelSchema, type LogRecord, LogRecordSchema, type MemoryBudget, MemoryBudgetSchema, type MemoryFile, MemoryFileSchema, type MemoryName, MemoryNameSchema, type MemorySearchHit, MemorySearchHitSchema, type MemorySearchScope, MemorySearchScopeSchema, type PendingApproval, PendingApprovalSchema, type PendingRestart, PendingRestartSchema, type PermissionAction, PermissionActionSchema, type PermissionRule, PermissionRuleSchema, type RunOrigin, RunOriginSchema, type RunStatus, RunStatusSchema, type RunSummary, RunSummarySchema, type RunTimelineItem, RunTimelineItemSchema, type RunUsage, RunUsageSchema, type SecretInfo, SecretInfoSchema, type SecretName, SecretNameSchema, type SecretSource, SecretSourceSchema, type SkillInfo, SkillInfoSchema, type Timestamp, TimestampSchema, type ToolInfo, ToolInfoSchema, type ToolSource, ToolSourceSchema, type Trigger, type TriggerInput, TriggerInputSchema, type TriggerPatch, TriggerPatchSchema, type TriggerSchedule, TriggerScheduleSchema, TriggerSchema, } from "./domain.js";
3
3
  export { parseDuration } from "./duration.js";
4
4
  export { EVENT_NAMES, type EventName, type EventPayload, events, type EventTopic, eventTopic, EventTopicSchema, isEventName, } from "./events.js";
@@ -1,4 +1,4 @@
1
- export { AgentConfigSchema, DaemonConfigSchema, DeploymentConfigSchema, FrontendBindingConfigSchema, McpServerConfigSchema, MemoryConfigSchema, ModelChoiceSchema, PluginConfigSchema, ProviderConfigSchema, SecretRefSchema, StringOrSecretSchema, WebhooksConfigSchema, } from "./config.js";
1
+ export { AgentConfigSchema, DaemonConfigSchema, DEFAULT_WEBHOOK_HOST, DEFAULT_WEBHOOK_PORT, DeploymentConfigSchema, FrontendBindingConfigSchema, McpServerConfigSchema, MemoryConfigSchema, ModelChoiceSchema, PluginConfigSchema, ProviderConfigSchema, SecretRefSchema, StringOrSecretSchema, WebhooksConfigSchema, webhookTriggerPath, } from "./config.js";
2
2
  export { AgentHealthSchema, AgentNameSchema, AgentStateSchema, ApprovalDecisionSchema, ApprovalOutcomeSchema, ApprovalResolutionSchema, AttachmentInfoSchema, AttachmentUploadSchema, BindingStatusSchema, ChatKeySchema, ChatMessageSchema, CommandNameSchema, ConfigIssueSchema, ConsolidationLogEntrySchema, ConversationModeSchema, DaemonStatusSchema, DeliveryKindSchema, DurationSchema, ExtensionStateSchema, ExtensionStatusSchema, FailedDeliverySchema, GatePressureSchema, IdSchema, LogLevelSchema, LogRecordSchema, MemoryBudgetSchema, MemoryFileSchema, MemoryNameSchema, MemorySearchHitSchema, MemorySearchScopeSchema, PendingApprovalSchema, PendingRestartSchema, PermissionActionSchema, PermissionRuleSchema, RunOriginSchema, RunStatusSchema, RunSummarySchema, RunTimelineItemSchema, RunUsageSchema, SecretInfoSchema, SecretNameSchema, SecretSourceSchema, SkillInfoSchema, TimestampSchema, ToolInfoSchema, ToolSourceSchema, TriggerInputSchema, TriggerPatchSchema, TriggerScheduleSchema, TriggerSchema, } from "./domain.js";
3
3
  export { parseDuration } from "./duration.js";
4
4
  export { EVENT_NAMES, events, eventTopic, EventTopicSchema, isEventName, } from "./events.js";
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "name": "@wheatley-ai/sdk",
9
9
  "type": "module",
10
- "version": "0.0.0"
10
+ "version": "0.1.1"
11
11
  }
package/dist/ops/cli.js CHANGED
@@ -24,7 +24,7 @@ const EXIT_FAILURE = 1;
24
24
  const EXIT_USAGE = 2;
25
25
  const SERVICE_USAGE = "Usage: wheatley service <install|start|stop|restart|status>";
26
26
  const UPDATE_USAGE = "Usage: wheatley update [--check] [--manager npm|pnpm]";
27
- const RESTORE_USAGE = "Usage: wheatley restore <agent> <backup>";
27
+ const RESTORE_USAGE = "Usage: wheatley restore <agent> [backup]";
28
28
  class UsageError extends Error {
29
29
  name = "UsageError";
30
30
  }
@@ -158,19 +158,18 @@ const restoreCommand = (deps) => async (args, io) => {
158
158
  });
159
159
  const [agent, backup, ...extra] = positionals;
160
160
  if (agent === undefined || extra.length > 0) {
161
- throw new UsageError("Pass an Agent name and a backup.");
161
+ throw new UsageError("Pass an Agent name and at most one backup.");
162
162
  }
163
163
  const agentDir = agentDirFor(deps.homeDir, agent);
164
164
  if (backup === undefined) {
165
165
  const backups = await listBackups(agentDir);
166
- io.err(RESTORE_USAGE);
167
- io.err(backups.length === 0
166
+ io.out(backups.length === 0
168
167
  ? `Agent ${agent} has no backups.`
169
168
  : `Backups of Agent ${agent}, newest first:`);
170
169
  for (const info of backups) {
171
- io.err(` ${info.file} (${info.reason}, ${info.createdAt})`);
170
+ io.out(` ${info.file} (${info.reason}, ${info.createdAt})`);
172
171
  }
173
- return EXIT_USAGE;
172
+ return EXIT_OK;
174
173
  }
175
174
  if (await deps.isDaemonRunning()) {
176
175
  io.err("The Wheatley daemon is running and holds agent.sqlite open. Stop it first, for example: wheatley service stop");
@@ -1,9 +1,10 @@
1
+ import { DEFAULT_WEBHOOK_HOST, DEFAULT_WEBHOOK_PORT, } from "@wheatley-ai/protocol";
1
2
  import { SqliteDeliveryOutbox } from "./delivery-outbox.js";
2
3
  import { OUTBOX_NAMESPACE, outboxMigrations, TRIGGERS_NAMESPACE, triggersMigrations, } from "./migrations.js";
3
4
  import { createOutboxRpc, createTriggerRpc } from "./rpc.js";
4
5
  import { SqliteTriggerRuntime } from "./trigger-runtime.js";
5
6
  import { createTriggerToolProvider } from "./trigger-tools.js";
6
- import { DEFAULT_WEBHOOK_HOST, DEFAULT_WEBHOOK_PORT, HttpWebhookIngress, } from "./webhook-ingress.js";
7
+ import { HttpWebhookIngress } from "./webhook-ingress.js";
7
8
  export { OUTBOX_NAMESPACE, outboxMigrations, TRIGGERS_NAMESPACE, triggersMigrations, } from "./migrations.js";
8
9
  export { createOutboxRpc, createTriggerRpc } from "./rpc.js";
9
10
  /**
@@ -24,6 +25,7 @@ export const triggersModule = {
24
25
  api: {
25
26
  runtime,
26
27
  tools: createTriggerToolProvider({
28
+ bindingIds: deps.bindingIds,
27
29
  clock: ctx.clock,
28
30
  runtime,
29
31
  suppressDelivery: runtime.suppressDelivery,
@@ -46,7 +46,7 @@ const ScheduleTriggerInputSchema = Type.Object({
46
46
  schedule: ScheduleInputSchema,
47
47
  target: Type.Optional(Type.Object(ChatTargetSchema.properties, {
48
48
  additionalProperties: false,
49
- description: "The Chat that receives the result. The default is the current Chat.",
49
+ description: "The Chat that receives the result. Omit it to use the current Chat. Set it only for another known Chat.",
50
50
  })),
51
51
  }, { additionalProperties: false });
52
52
  const EmptyInputSchema = Type.Object({}, { additionalProperties: false });
@@ -89,11 +89,14 @@ const scheduleTrigger = defineTriggerTool({
89
89
  defaultAction: "allow",
90
90
  description: "Schedule a reminder or recurring task. A `cron` schedule repeats in a time zone. A `once` schedule fires one " +
91
91
  "time at `at` or after `delay`. The result goes to the current Chat unless you set `target`.",
92
- execute: async (input, ctx, { clock, runtime }) => {
92
+ execute: async (input, ctx, { bindingIds, clock, runtime }) => {
93
93
  const target = input.target ?? ctx.chat;
94
94
  if (target === null) {
95
95
  return errorResult("This Run has no Chat. Set `target` to the Chat that receives the result.");
96
96
  }
97
+ if (!bindingIds.includes(target.bindingId)) {
98
+ return errorResult(`Unknown Frontend Binding: ${target.bindingId}. Use one of ${bindingIds.join(", ")}, or omit \`target\` to use the current Chat.`);
99
+ }
97
100
  const trigger = await runtime.create({
98
101
  conversationMode: input.conversationMode ?? "per_firing",
99
102
  name: input.name,
@@ -4,10 +4,6 @@ import { createServer } from "node:http";
4
4
  import { SeamError } from "../contracts/errors.js";
5
5
  import { MAX_WEBHOOK_BODY_BYTES } from "../contracts/webhook-ingress.js";
6
6
  import { errorText } from "./errors.js";
7
- /** The listener host if `webhooks.host` is absent. A reverse proxy in front of it terminates TLS. */
8
- export const DEFAULT_WEBHOOK_HOST = "127.0.0.1";
9
- /** The listener port if `webhooks.port` is absent. */
10
- export const DEFAULT_WEBHOOK_PORT = 8788;
11
7
  /** A request must arrive in full within this time. */
12
8
  const REQUEST_TIMEOUT_MS = 30_000;
13
9
  const BEARER = /^Bearer (?<token>\S+)$/u;
@@ -3,6 +3,7 @@ import { approvalsModule } from "../approvals/module.js";
3
3
  import { createApprovalsRpc } from "../approvals/rpc.js";
4
4
  import { SeamError } from "../contracts/errors.js";
5
5
  import { migrationNamespace } from "../contracts/module.js";
6
+ import { CLI_BINDING_ID } from "../core/config/validate.js";
6
7
  import { formatSnapshotPrompt, memoryModule } from "../memory/module.js";
7
8
  import { deliveryOutboxModule, triggersModule } from "../triggers/module.js";
8
9
  import { createFrontendHost } from "./frontend-host.js";
@@ -72,6 +73,12 @@ export const createAgentServices = (deps) => (agent, config) => {
72
73
  migrations: migrationNamespace(triggersModule),
73
74
  mount: async (ctx, host) => {
74
75
  const instance = await triggersModule.create(ctx, {
76
+ bindingIds: [
77
+ CLI_BINDING_ID,
78
+ ...(config.frontends ?? [])
79
+ .filter((binding) => binding.enabled !== false)
80
+ .map((binding) => binding.id),
81
+ ],
75
82
  runner: host.triggers,
76
83
  });
77
84
  const { runtime } = instance.api;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wheatley-ai/cli",
3
- "version": "0.0.0",
3
+ "version": "0.1.1",
4
4
  "description": "Wheatley daemon and CLI",
5
5
  "license": "ISC",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "@types/ws": "8.18.2",
42
42
  "@wheatley-ai/dashboard": "0.0.0",
43
43
  "@wheatley-ai/protocol": "0.0.0",
44
- "@wheatley-ai/sdk": "0.0.0"
44
+ "@wheatley-ai/sdk": "0.1.1"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=26.13.1"