import{d as h,bF as v,s as g,c as b,o as l,w,b as r,cp as y,cq as x,q as k,cr as $,ag as V,i as p,n as m,j as M,e as f,cs as C,u as B,f as N,y as T,t as D}from"./Dih1Xbo1.js";import{_ as P}from"./BYYLVaSZ.js";const j=h({__name:"NDarkToggle",setup(c){const s=v({storageKey:"unpress-color-mode"}),t=g({get(){return s.value==="dark"},set(){s.value=t.value?"light":"dark"}}),d=typeof document<"u"&&document.startViewTransition&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;function i(a){if(!d||!a){t.value=!t.value;return}const n=a.clientX,o=a.clientY,_=Math.hypot(Math.max(n,innerWidth-n),Math.max(o,innerHeight-o));document.startViewTransition(async()=>{t.value=!t.value,await k()}).ready.then(()=>{const u=[`circle(0px at ${n}px ${o}px)`,`circle(${_}px at ${n}px ${o}px)`];document.documentElement.animate({clipPath:t.value?[...u].reverse():u},{duration:400,easing:"ease-in",pseudoElement:t.value?"::view-transition-old(root)":"::view-transition-new(root)"})})}const e={mode:s,isDark:t,toggle:i};return(a,n)=>{const o=$;return l(),b(o,{"placeholder-tag":"span"},{default:w(()=>[r(a.$slots,"default",y(x(e)))]),_:3})}}}),S=["disabled"],E={key:0,value:"",disabled:"",hidden:""},A=h({__name:"NSelect",props:{modelValue:{default:void 0},placeholder:{default:""},icon:{default:""},disabled:{type:Boolean,default:!1}},setup(c,{emit:s}){const i=V(c,"modelValue",s,{passive:!0});return(e,a)=>{const n=P;return l(),p("div",{class:m(["n-select flex flex items-center border rounded px-2 py-1 focus-within:n-focus-base focus-within:border-context n-bg-base",e.disabled?"border-gray:10":"n-border-base"])},[r(e.$slots,"icon",{},()=>[e.icon?(l(),b(n,{key:0,icon:e.icon,class:"mr-0.4em text-1.1em op50"},null,8,["icon"])):f("",!0)]),M(N("select",{"onUpdate:modelValue":a[0]||(a[0]=o=>T(i)?i.value=o:null),disabled:e.disabled,class:m(["w-full flex-auto n-bg-base !outline-none",e.disabled?"appearance-none":""])},[e.placeholder?(l(),p("option",E,D(e.placeholder),1)):f("",!0),r(e.$slots,"default")],10,S),[[C,B(i)]])],2)}}});export{j as _,A as a};
