Files

5 lines
24 KiB
JavaScript
Raw Permalink Normal View History

import{d as N,t as ie,i as D,k as E,n as Q,ai as we,c as k,o as _,w as x,a as L,z as M,u,M as I,b as A,aj as Fe,ak as H,al as he,am as Be,an as je,m as R,ao as Y,ap as Ve,af as ue,aq as Ue,ar as Ke,F as be,as as de,at as ce,au as qe,av as ge,aw as He,q as Je,x as z,y as G,ax as We,T as Ee,ay as Te,az as Xe,aA as Ye,aB as xe,aC as ze,aD as _e,aE as Ge,p as Qe,ag as Ze}from"./globals-BVeJWRKG.js";function ke(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,a=Symbol(n);return[o=>{const s=he(a,o);if(s||s===null)return s;throw new Error(`Injection \`${a.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(_e(a,o),o)]}function pe(e){return Xe()?(Ye(e),!0):!1}function et(e){let t=!1,n;const a=ze(!0);return(...o)=>(t||(n=a.run(()=>e(...o)),t=!0),n)}function Z(e){return typeof e=="function"?e():u(e)}const ee=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const tt=e=>typeof e<"u",nt=Object.prototype.toString,at=e=>nt.call(e)==="[object Object]",Ce=()=>{};function ot(e,t,n={}){const{immediate:a=!0}=n,o=E(!1);let s=null;function r(){s&&(clearTimeout(s),s=null)}function l(){o.value=!1,r()}function i(...d){r(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=null,e(...d)},Z(t))}return a&&(o.value=!0,ee&&i()),pe(l),{isPending:Te(o),start:i,stop:l}}function st(e=1e3,t={}){const{controls:n=!1,callback:a}=t,o=ot(a??Ce,e,t),s=D(()=>!o.isPending.value);return n?{ready:s,...o}:s}function U(e){var t;const n=Z(e);return(t=n?.$el)!=null?t:n}const te=ee?window:void 0;function rt(...e){let t,n,a,o;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,a,o]=e,t=te):[t,n,a,o]=e,!t)return Ce;Array.isArray(n)||(n=[n]),Array.isArray(a)||(a=[a]);const s=[],r=()=>{s.forEach(c=>c()),s.length=0},l=(c,p,T,g)=>(c.addEventListener(p,T,g),()=>c.removeEventListener(p,T,g)),i=R(()=>[U(t),Z(o)],([c,p])=>{if(r(),!c)return;const T=at(p)?{...p}:p;s.push(...n.flatMap(g=>a.map(C=>l(c,g,C,T))))},{immediate:!0,flush:"post"}),d=()=>{i(),r()};return pe(d),d}function lt(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ne(...e){let t,n,a={};e.length===3?(t=e[0],n=e[1],a=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],a=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:o=te,eventName:s="keydown",passive:r=!1,dedupe:l=!1}=a,i=lt(t);return rt(o,s,d=>{d.repeat&&Z(l)||i(d)&&n(d)},r)}function Pe(e,t={}){const{immediate:n=!0,fpsLimit:a=void 0,window:o=te}=t,s=E(!1),r=a?1e3/a:null;let l=0,i=null;function d(T){if(!s.value||!o)return;l||(l=T);const g=T-l;if(r&&g<r){i=o.requestAnimationFrame(d);return}l=T,e({delta:g,timestamp:T}),i=o.requestAnimationFrame(d)}function c(){!s.value&&o&&(s.value=!0,l=0,i=o.requestAnimationFrame(d))}function p(){s.value=!1,i!=null&&o&&(o.cancelAnimationFrame(i),i=null)}return n&&c(),pe(p),{isActive:Te(s),pause:p,resume:c}}function it(e){return JSON.parse(JSON.stringify(e))}function ut(e,t,n,a={}){var o,s,r;const{clone:l=!1,passive:i=!1,eventName:d,deep:c=!1,defaultValue:p,shouldEmit:T}=a,g=H(),C=n||g?.emit||((o=g?.$emit)==null?void 0:o.bind(g))||((r=(s=g?.proxy)==null?void 0:s.$emit)==null?void 0:r.bind(g?.proxy));let m=d;m=m||`update:${t.toString()}`;const f=w=>l?typeof l=="function"?l(w):it(w):w,h=()=>tt(e[t])?f(e[t]):p,y=w=>{T?T(w)&&C(m,w):C(m,w)};if(i){const w=h(),b=E(w);let v=!1;return R(()=>e[t],P=>{v||(v=!0,b.value=f(P),xe(()=>v=!1))}),R(b,P=>{!v&&(P!==e[t]||c)&&y(P)},{deep:c}),b}else return D({get(){return h()},set(w){y(w)}})}function fe(e){return e?e.flatMap(t=>t.type===be?fe(t.children):[t]):[]}function K(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}const dt="data-radix-vue-collection-item";function ct(e,t=dt){const n=Symbol();return{createCollection:a=>{const o=E([]);function s(){const r=U(a);return r?o.value=Array.from(r.querySelectorAll(`[${t}]:not([data-disabled])`)):o.value=[]}return Be(()=>{o.value=[]}),Q(s),j
`)].join(`
`))}return()=>s.value||o.value||l.value?Y(t.default({present:l})[0],{ref:c=>{const p=U(c);return typeof p?.hasAttribute>"u"||(p!=null&&p.hasAttribute("data-radix-popper-content-wrapper")?r.value=p.firstElementChild:r.value=p),p}}):null}}),ve=Ve({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bt=N({__name:"DismissableLayerBranch",props:{asChild:{type:Boolean},as:{}},setup(e){const t=e,{forwardRef:n,currentElement:a}=O();return Q(()=>{ve.branches.add(a.value)}),ue(()=>{ve.branches.delete(a.value)}),(o,s)=>(_(),k(u(F),I({ref:u(n)},t),{default:x(()=>[A(o.$slots,"default")]),_:3},16))}});function se(e,{select:t=!1}={}){const n=K();for(const a of e)if(Tt(a,{select:t}),K()!==n)return!0}function gt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Et(e){return e instanceof HTMLInputElement&&"select"in e}function Tt(e,{select:t=!1}={}){if(e&&e.focus){const n=K();e.focus({preventScroll:!0}),e!==n&&Et(e)&&t&&e.select()}}et(()=>E([]));const Ae=N({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return O(),(t,n)=>(_(),k(u(F),{as:t.as,"as-child":t.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:x(()=>[A(t.$slots,"default")]),_:3},8,["as","as-child"]))}});function xt(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}xt();const[ne,_t]=ke("ToastProvider"),kt=N({inheritAttrs:!1,__name:"ToastProvider",props:{label:{default:"Notification"},duration:{default:5e3},swipeDirection:{default:"right"},swipeThreshold:{default:50}},setup(e){const t=e,{label:n,duration:a,swipeDirection:o,swipeThreshold:s}=ie(t),r=E(),l=E(0),i=E(!1),d=E(!1);if(t.label&&typeof t.label=="string"&&!t.label.trim()){const c="Invalid prop `label` supplied to `ToastProvider`. Expected non-empty `string`.";throw new Error(c)}return _t({label:n,duration:a,swipeDirection:o,swipeThreshold:s,toastCount:l,viewport:r,onViewportChange(c){r.value=c},onToastAdd(){l.value++},onToastRemove(){l.value--},isFocusedToastEscapeKeyDownRef:i,isClosePausedRef:d}),(c,p)=>A(c.$slots,"default")}}),Ct="toast.swipeStart",Nt="toast.swipeMove",Pt="toast.swipeCancel",At="toast.swipeEnd",re="toast.viewportPause",le="toast.viewportResume";function X(e,t,n){const a=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),a.dispatchEvent(o)}function me(e,t,n=0){const a=Math.abs(e.x),o=Math.abs(e.y),s=a>o;return t==="left"||t==="right"?s&&a>n:!s&&o>n}function St(e){return e.nodeType===e.ELEMENT_NODE}function Se(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),St(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!a)if(o){const s=n.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Se(n))}}),t}const Dt=N({__name:"ToastAnnounce",setup(e){const t=ne(),n=st(1e3),a=E(!1);return Pe(()=>{a.value=!0}),(o,s)=>u(n)||a.value?(_(),k(u(Ae),{key:0},{default:x(()=>[z(G(u(t).label.value)+" ",1),A(o.$slots,"default")]),_:3})):L("",!0)}}),[Mt,Ot]=ke("ToastRoot"),$t=N({inheritAttrs:!1,__name:"ToastRootImpl",props:{type:{},open:{type:Boolean,default:!1},duration:{},asChild:{type:Boolean},as:{default:"li"}},emits:["close","escapeKeyDown","pause","resume","swipeStart","swipeMove","swipeCancel","swipeEnd"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:o,currentElement:s}=O(),r=ne(),l=E(null),i=E(null),d=D(()=>typeof n.duration=="number"?n.duration:r.duration.value),c=E(0),p=E(d.value),T=E(0),g=E(d.value),C=Pe(()=>{const y=new Date().getTime()-c.value;g.value=Math.max(p.value-y,0)},{fpsLimit:60});functi
//# sourceMappingURL=index-BKcJu8c2.js.map