2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{A as ue,D as ee,X as se,c2 as te,v as $,Y as j,t as D,U as z,bg as ie,bh as ae,bi as q,cJ as ce,p as M,aC as ne,cF as fe,a5 as Y}from"./index-CnBLdARH.js";function de(e,n){let t,l,r;const u=D(!0),a=()=>{u.value=!0,r()};z(e,a,{flush:"sync"});const s=typeof n=="function"?n:n.get,m=typeof n=="function"?void 0:n.set,f=te((p,o)=>(l=p,r=o,{get(){return u.value&&(t=s(t),u.value=!1),l(),t},set(d){m==null||m(d)}}));return Object.isExtensible(f)&&(f.trigger=a),f}function I(e){return ie()?(ae(e),!0):!1}function x(e){return typeof e=="function"?e():ue(e)}const le=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ve=e=>typeof e<"u",pe=Object.prototype.toString,me=e=>pe.call(e)==="[object Object]",V=()=>{};function U(e,n){function t(...l){return new Promise((r,u)=>{Promise.resolve(e(()=>n.apply(this,l),{fn:n,thisArg:this,args:l})).then(r).catch(u)})}return t}const re=e=>e();function he(e,n={}){let t,l,r=V;const u=s=>{clearTimeout(s),r(),r=V};return s=>{const m=x(e),f=x(n.maxWait);return t&&u(t),m<=0||f!==void 0&&f<=0?(l&&(u(l),l=null),Promise.resolve(s())):new Promise((p,o)=>{r=n.rejectOnCancel?o:p,f&&!l&&(l=setTimeout(()=>{t&&u(t),l=null,p(s())},f)),t=setTimeout(()=>{l&&u(l),l=null,p(s())},m)})}}function ge(...e){let n=0,t,l=!0,r=V,u,a,s,m,f;!ee(e[0])&&typeof e[0]=="object"?{delay:a,trailing:s=!0,leading:m=!0,rejectOnCancel:f=!1}=e[0]:[a,s=!0,m=!0,f=!1]=e;const p=()=>{t&&(clearTimeout(t),t=void 0,r(),r=V)};return d=>{const c=x(a),w=Date.now()-n,g=()=>u=d();return p(),c<=0?(n=Date.now(),g()):(w>c&&(m||!l)?(n=Date.now(),g()):s&&(u=new Promise((b,i)=>{r=f?i:b,t=setTimeout(()=>{n=Date.now(),l=!0,b(g()),p()},Math.max(0,c-w))})),!m&&!t&&(t=setTimeout(()=>l=!0,c)),l=!1,u)}}function we(e=re){const n=D(!0);function t(){n.value=!1}function l(){n.value=!0}const r=(...u)=>{n.value&&e(...u)};return{isActive:ce(n),pause:t,resume:l,eventFilter:r}}function be(e){return q()}function Se(e,n=200,t={}){return U(he(n,t),e)}function ye(e,n=200,t=!1,l=!0,r=!1){return U(ge(n,t,l,r),e)}function Ee(e,n,t={}){const{eventFilter:l=re,...r}=t;return z(e,U(l,n),r)}function Fe(e,n,t={}){const{eventFilter:l,...r}=t,{eventFilter:u,pause:a,resume:s,isActive:m}=we(l);return{stop:Ee(e,n,{...r,eventFilter:u}),pause:a,resume:s,isActive:m}}function Re(e,n={}){if(!ee(e))return se(e);const t=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const l in e.value)t[l]=te(()=>({get(){return e.value[l]},set(r){var u;if((u=x(n.replaceRef))!=null?u:!0)if(Array.isArray(e.value)){const s=[...e.value];s[l]=r,e.value=s}else{const s={...e.value,[l]:r};Object.setPrototypeOf(s,Object.getPrototypeOf(e.value)),e.value=s}else e.value[l]=r}}));return t}function B(e,n=!0,t){be()?$(e,t):n?e():j(e)}const L=le?window:void 0,xe=le?window.document:void 0;function C(e){var n;const t=x(e);return(n=t==null?void 0:t.$el)!=null?n:t}function P(...e){let n,t,l,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,l,r]=e,n=L):[n,t,l,r]=e,!n)return V;Array.isArray(t)||(t=[t]),Array.isArray(l)||(l=[l]);const u=[],a=()=>{u.forEach(p=>p()),u.length=0},s=(p,o,d,c)=>(p.addEventListener(o,d,c),()=>p.removeEventListener(o,d,c)),m=z(()=>[C(n),x(r)],([p,o])=>{if(a(),!p)return;const d=me(o)?{...o}:o;u.push(...t.flatMap(c=>l.map(w=>s(p,c,w,d))))},{immediate:!0,flush:"post"}),f=()=>{m(),a()};return I(f),f}function _e(){const e=D(!1),n=q();return n&&$(()=>{e.value=!0},n),e}function oe(e){const n=_e();return M(()=>(n.value,!!e()))}function Oe(e){return JSON.parse(JSON.stringify(e))}const J=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},k="__vueuse_ssr_handlers__",Ae=Te();function Te(){return k in J||(J[k]=J[k]||{}),J[k]}function Ce(e,n){return Ae[e]||n}function De(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Me={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},K="vueuse-storage";function Ve(e,n,t,l={}){var r;const{flush:u="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:m=!0,mergeDefaults:f=!1,shallow:p,window:o=L,eventFilter:d,onError:c=v=>{console.error(v)},initOnMounted:w}=l,g=(p?ne:D)(typeof n=="function"?n():n);if(!t)try{t=Ce("getDefaultStorage",()=>{var v;return(v=L)==null?void 0:v.localStorage})()}catch(v){c(v)}if(!t)return g;const b=x(n),i=De(b),E=(r=l.serializer)!=null?r:Me[i],{pause:F,resume:N}=Fe(g,()=>W(g.value),{flush:u,deep:a,eventFilter:d});o&&s&&B(()=>{t instanceof Storage?P(o,"storage",O):P(o,K,_),w&&O()}),w||O();function A(v,S){if(o){const y={key:e,oldValue:v,newValue:S,storageArea:t};o.dispatchEvent(t instanceof Storage?new StorageEvent("storage",y):new CustomEvent(K,{detail:y}))}}function W(v){try{const S=t.getItem(e);if(v==null)A(S,null),t.removeItem(e);else{const y=E.write(v);S!==y&&(t.setItem(e,y),A(S,y))}}catch(S){c(S)}}function h(v){const S=v?v.newValue:t.getItem(e);if(S==null)return m&&b!=null&&t.setItem(e,E.write(b)),b;if(!v&&f){const y=E.read(S);return typeof f=="function"?f(y,b):i==="object"&&!Array.isArray(y)?{...b,...y}:y}else return typeof S!="string"?S:E.read(S)}function O(v){if(!(v&&v.storageArea!==t)){if(v&&v.key==null){g.value=b;return}if(!(v&&v.key!==e)){F();try{(v==null?void 0:v.newValue)!==E.write(g.value)&&(g.value=h(v))}catch(S){c(S)}finally{v?j(N):N()}}}}function _(v){O(v.detail)}return g}function We(e){const n=q(),t=de(()=>null,()=>n.proxy.$el);return fe(t.trigger),$(t.trigger),t}function Ne(e,n,t={}){const{window:l=L,...r}=t;let u;const a=oe(()=>l&&"ResizeObserver"in l),s=()=>{u&&(u.disconnect(),u=void 0)},m=M(()=>{const o=x(e);return Array.isArray(o)?o.map(d=>C(d)):[C(o)]}),f=z(m,o=>{if(s(),a.value&&l){u=new ResizeObserver(n);for(const d of o)d&&u.observe(d,r)}},{immediate:!0,flush:"post"}),p=()=>{s(),f()};return I(p),{isSupported:a,stop:p}}function Le(e,n={width:0,height:0},t={}){const{window:l=L,box:r="content-box"}=t,u=M(()=>{var o,d;return(d=(o=C(e))==null?void 0:o.namespaceURI)==null?void 0:d.includes("svg")}),a=D(n.width),s=D(n.height),{stop:m}=Ne(e,([o])=>{const d=r==="border-box"?o.borderBoxSize:r==="content-box"?o.contentBoxSize:o.devicePixelContentBoxSize;if(l&&u.value){const c=C(e);if(c){const w=c.getBoundingClientRect();a.value=w.width,s.value=w.height}}else if(d){const c=Array.isArray(d)?d:[d];a.value=c.reduce((w,{inlineSize:g})=>w+g,0),s.value=c.reduce((w,{blockSize:g})=>w+g,0)}else a.value=o.contentRect.width,s.value=o.contentRect.height},t);B(()=>{const o=C(e);o&&(a.value="offsetWidth"in o?o.offsetWidth:n.width,s.value="offsetHeight"in o?o.offsetHeight:n.height)});const f=z(()=>C(e),o=>{a.value=o?n.width:0,s.value=o?n.height:0});function p(){m(),f()}return{width:a,height:s,stop:p}}const Q=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function Pe(e,n={}){const{document:t=xe,autoExit:l=!1}=n,r=M(()=>{var i;return(i=C(e))!=null?i:t==null?void 0:t.querySelector("html")}),u=D(!1),a=M(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(i=>t&&i in t||r.value&&i in r.value)),s=M(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(i=>t&&i in t||r.value&&i in r.value)),m=M(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(i=>t&&i in t||r.value&&i in r.value)),f=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(i=>t&&i in t),p=oe(()=>r.value&&t&&a.value!==void 0&&s.value!==void 0&&m.value!==void 0),o=()=>f?(t==null?void 0:t[f])===r.value:!1,d=()=>{if(m.value){if(t&&t[m.value]!=null)return t[m.value];{const i=r.value;if((i==null?void 0:i[m.value])!=null)return!!i[m.value]}}return!1};async function c(){if(!(!p.value||!u.value)){if(s.value)if((t==null?void 0:t[s.value])!=null)await t[s.value]();else{const i=r.value;(i==null?void 0:i[s.value])!=null&&await i[s.value]()}u.value=!1}}async function w(){if(!p.value||u.value)return;d()&&await c();const i=r.value;a.value&&(i==null?void 0:i[a.value])!=null&&(await i[a.value](),u.value=!0)}async function g(){await(u.value?c():w())}const b=()=>{const i=d();(!i||i&&o())&&(u.value=i)};return P(t,Q,b,!1),P(()=>C(r),Q,b,!1),l&&I(c),{isSupported:p,isFullscreen:u,enter:w,exit:c,toggle:g}}const Z=1;function He(e,n={}){const{throttle:t=0,idle:l=200,onStop:r=V,onScroll:u=V,offset:a={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:m="auto",window:f=L,onError:p=h=>{console.error(h)}}=n,o=D(0),d=D(0),c=M({get(){return o.value},set(h){g(h,void 0)}}),w=M({get(){return d.value},set(h){g(void 0,h)}});function g(h,O){var _,v,S,y;if(!f)return;const T=x(e);if(!T)return;(S=T instanceof Document?f.document.body:T)==null||S.scrollTo({top:(_=x(O))!=null?_:w.value,left:(v=x(h))!=null?v:c.value,behavior:x(m)});const H=((y=T==null?void 0:T.document)==null?void 0:y.documentElement)||(T==null?void 0:T.documentElement)||T;c!=null&&(o.value=H.scrollLeft),w!=null&&(d.value=H.scrollTop)}const b=D(!1),i=Y({left:!0,right:!1,top:!0,bottom:!1}),E=Y({left:!1,right:!1,top:!1,bottom:!1}),F=h=>{b.value&&(b.value=!1,E.left=!1,E.right=!1,E.top=!1,E.bottom=!1,r(h))},N=Se(F,t+l),A=h=>{var O;if(!f)return;const _=((O=h==null?void 0:h.document)==null?void 0:O.documentElement)||(h==null?void 0:h.documentElement)||C(h),{display:v,flexDirection:S}=getComputedStyle(_),y=_.scrollLeft;E.left=y<o.value,E.right=y>o.value;const T=Math.abs(y)<=(a.left||0),H=Math.abs(y)+_.clientWidth>=_.scrollWidth-(a.right||0)-Z;v==="flex"&&S==="row-reverse"?(i.left=H,i.right=T):(i.left=T,i.right=H),o.value=y;let R=_.scrollTop;h===f.document&&!R&&(R=f.document.body.scrollTop),E.top=R<d.value,E.bottom=R>d.value;const G=Math.abs(R)<=(a.top||0),X=Math.abs(R)+_.clientHeight>=_.scrollHeight-(a.bottom||0)-Z;v==="flex"&&S==="column-reverse"?(i.top=X,i.bottom=G):(i.top=G,i.bottom=X),d.value=R},W=h=>{var O;if(!f)return;const _=(O=h.target.documentElement)!=null?O:h.target;A(_),b.value=!0,N(h),u(h)};return P(e,"scroll",t?ye(W,t,!0,!1):W,s),B(()=>{try{const h=x(e);if(!h)return;A(h)}catch(h){p(h)}}),P(e,"scrollend",F,s),{x:c,y:w,isScrolling:b,arrivedState:i,directions:E,measure(){const h=x(e);f&&h&&A(h)}}}function Je(e=We()){const n=ne(),t=()=>{const l=C(e);l&&(n.value=l.parentElement)};return B(t),z(()=>x(e),t),n}function ke(e,n,t,l={}){var r,u,a;const{clone:s=!1,passive:m=!1,eventName:f,deep:p=!1,defaultValue:o,shouldEmit:d}=l,c=q(),w=t||(c==null?void 0:c.emit)||((r=c==null?void 0:c.$emit)==null?void 0:r.bind(c))||((a=(u=c==null?void 0:c.proxy)==null?void 0:u.$emit)==null?void 0:a.bind(c==null?void 0:c.proxy));let g=f;n||(n="modelValue"),g=g||"update:".concat(n.toString());const b=F=>s?typeof s=="function"?s(F):Oe(F):F,i=()=>ve(e[n])?b(e[n]):o,E=F=>{d?d(F)&&w(g,F):w(g,F)};if(m){const F=i(),N=D(F);let A=!1;return z(()=>e[n],W=>{A||(A=!0,N.value=b(W),j(()=>A=!1))}),z(N,W=>{!A&&(W!==e[n]||p)&&E(W)},{deep:p}),N}else return M({get(){return i()},set(F){E(F)}})}export{ke as a,Pe as b,Ve as c,Je as d,Le as e,Re as t,He as u};
|