nextjs-themes
Advanced tools
Comparing version 0.0.1 to 0.2.0
"use client"; | ||
import"./chunk-56AIYZZD.js";import{a as t}from"./chunk-GJZEVZN5.js";import"./chunk-ZKUJ2JYR.js";import{a as e}from"./chunk-L3QTUTME.js";import"./chunk-WPVNOEJG.js";import{a as r}from"./chunk-TTHJDQZ7.js";import{a as o}from"./chunk-FBWSB2FJ.js";export{t as ForceColorScheme,e as ForceTheme,r as ThemeSwitcher,o as useTheme}; | ||
import"./chunk-56AIYZZD.js";import{a as t}from"./chunk-GJZEVZN5.js";import"./chunk-ZKUJ2JYR.js";import{a as e}from"./chunk-L3QTUTME.js";import"./chunk-WPVNOEJG.js";import{a as r}from"./chunk-W2LLIQZZ.js";import{a as o}from"./chunk-FBWSB2FJ.js";export{t as ForceColorScheme,e as ForceTheme,r as ThemeSwitcher,o as useTheme}; |
"use client"; | ||
import"../chunk-WPVNOEJG.js";import{a}from"../chunk-TTHJDQZ7.js";import"../chunk-FBWSB2FJ.js";export{a as ThemeSwitcher}; | ||
import"../chunk-WPVNOEJG.js";import{a}from"../chunk-W2LLIQZZ.js";import"../chunk-FBWSB2FJ.js";export{a as ThemeSwitcher}; |
"use client"; | ||
import{a}from"../chunk-TTHJDQZ7.js";import"../chunk-FBWSB2FJ.js";export{a as ThemeSwitcher}; | ||
import{a}from"../chunk-W2LLIQZZ.js";import"../chunk-FBWSB2FJ.js";export{a as ThemeSwitcher}; |
"use client"; | ||
"use strict";var _e=Object.create;var x=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),De=(e,t)=>{for(var r in t)x(e,r,{get:t[r],enumerable:!0})},$=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Te(t))!Oe.call(e,s)&&s!==r&&x(e,s,{get:()=>t[s],enumerable:!(o=Ee(t,s))||o.enumerable});return e};var M=(e,t,r)=>(r=e!=null?_e(ge(e)):{},$(t||!e||!e.__esModule?x(r,"default",{value:e,enumerable:!0}):r,e)),be=e=>$(x({},"__esModule",{value:!0}),e);var ee=C(Z=>{"use strict";var L=require("react");function we(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ce=typeof Object.is=="function"?Object.is:we,Le=L.useState,Ie=L.useEffect,Re=L.useLayoutEffect,Ae=L.useDebugValue;function xe(e,t){var r=t(),o=Le({inst:{value:r,getSnapshot:t}}),s=o[0].inst,n=o[1];return Re(function(){s.value=r,s.getSnapshot=t,U(s)&&n({inst:s})},[e,r,t]),Ie(function(){return U(s)&&n({inst:s}),e(function(){U(s)&&n({inst:s})})},[e]),Ae(r),r}function U(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ce(e,r)}catch{return!0}}function Me(e,t){return t()}var Ne=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Me:xe;Z.useSyncExternalStore=L.useSyncExternalStore!==void 0?L.useSyncExternalStore:Ne});var re=C(te=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(h){{for(var y=arguments.length,g=new Array(y>1?y-1:0),T=1;T<y;T++)g[T-1]=arguments[T];o("error",h,g)}}function o(h,y,g){{var T=t.ReactDebugCurrentFrame,D=T.getStackAddendum();D!==""&&(y+="%s",g=g.concat([D]));var b=g.map(function(O){return String(O)});b.unshift("Warning: "+y),Function.prototype.apply.call(console[h],console,b)}}function s(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:s,S=e.useState,m=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue,l=!1,f=!1;function _(h,y,g){l||e.startTransition!==void 0&&(l=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=y();if(!f){var D=y();n(T,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var b=S({inst:{value:T,getSnapshot:y}}),O=b[0].inst,I=b[1];return u(function(){O.value=T,O.getSnapshot=y,p(O)&&I({inst:O})},[h,T,y]),m(function(){p(O)&&I({inst:O});var P=function(){p(O)&&I({inst:O})};return h(P)},[h]),d(T),T}function p(h){var y=h.getSnapshot,g=h.value;try{var T=y();return!n(g,T)}catch{return!0}}function v(h,y,g){return y()}var a=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",i=!a,E=i?v:_,c=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;te.useSyncExternalStore=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var J=C((st,W)=>{"use strict";process.env.NODE_ENV==="production"?W.exports=ee():W.exports=re()});var oe=C(ne=>{"use strict";var N=require("react"),je=J();function ke(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fe=typeof Object.is=="function"?Object.is:ke,He=je.useSyncExternalStore,Pe=N.useRef,ze=N.useEffect,Be=N.useMemo,Ve=N.useDebugValue;ne.useSyncExternalStoreWithSelector=function(e,t,r,o,s){var n=Pe(null);if(n.current===null){var S={hasValue:!1,value:null};n.current=S}else S=n.current;n=Be(function(){function u(p){if(!d){if(d=!0,l=p,p=o(p),s!==void 0&&S.hasValue){var v=S.value;if(s(v,p))return f=v}return f=p}if(v=f,Fe(l,p))return v;var a=o(p);return s!==void 0&&s(v,a)?v:(l=p,f=a)}var d=!1,l,f,_=r===void 0?null:r;return[function(){return u(t())},_===null?void 0:function(){return u(_())}]},[t,r,o,s]);var m=He(e,n[0],n[1]);return ze(function(){S.hasValue=!0,S.value=m},[m]),Ve(m),m}});var ie=C(se=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=J();function r(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var o=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,n=e.useRef,S=e.useEffect,m=e.useMemo,u=e.useDebugValue;function d(l,f,_,p,v){var a=n(null),i;a.current===null?(i={hasValue:!1,value:null},a.current=i):i=a.current;var E=m(function(){var g=!1,T,D,b=function(R){if(!g){g=!0,T=R;var z=p(R);if(v!==void 0&&i.hasValue){var B=i.value;if(v(B,z))return D=B,B}return D=z,z}var ye=T,V=D;if(o(ye,R))return V;var G=p(R);return v!==void 0&&v(V,G)?V:(T=R,D=G,G)},O=_===void 0?null:_,I=function(){return b(f())},P=O===null?void 0:function(){return b(O())};return[I,P]},[f,_,p,v]),c=E[0],h=E[1],y=s(l,c,h);return S(function(){i.hasValue=!0,i.value=y},[y]),u(y),y}se.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var ae=C((ut,K)=>{"use strict";process.env.NODE_ENV==="production"?K.exports=oe():K.exports=ie()});var et={};De(et,{ForceColorScheme:()=>Ze,ForceTheme:()=>Qe,ThemeSwitcher:()=>Xe,useTheme:()=>w});module.exports=be(et);var k=M(require("react")),ve=require("react");var Y={},X=e=>{let t,r=new Set,o=(u,d)=>{let l=typeof u=="function"?u(t):u;if(!Object.is(l,t)){let f=t;t=(d!=null?d:typeof l!="object")?l:Object.assign({},t,l),r.forEach(_=>_(t,f))}},s=()=>t,m={setState:o,getState:s,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(Y.env?Y.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(o,s,m),m},Q=e=>e?X(e):X;var ce=require("react"),le=M(ae(),1),j={},{useSyncExternalStoreWithSelector:Ge}=le.default;function Ue(e,t=e.getState,r){(j.env?j.env.MODE:void 0)!=="production"&&r&&console.warn("[DEPRECATED] Use `createWithEqualityFn` from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937");let o=Ge(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,ce.useDebugValue)(o),o}var ue=e=>{(j.env?j.env.MODE:void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t=typeof e=="function"?Q(e):e,r=(o,s)=>Ue(t,o,s);return Object.assign(r,t),r},de=e=>e?ue(e):ue;var fe={};function We(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var n;let S=u=>u===null?null:JSON.parse(u,t==null?void 0:t.reviver),m=(n=r.getItem(s))!=null?n:null;return m instanceof Promise?m.then(S):S(m)},setItem:(s,n)=>r.setItem(s,JSON.stringify(n,t==null?void 0:t.replacer)),removeItem:s=>r.removeItem(s)}}var A=e=>t=>{try{let r=e(t);return r instanceof Promise?r:{then(o){return A(o)(r)},catch(o){return this}}}catch(r){return{then(o){return this},catch(o){return A(o)(r)}}}},Je=(e,t)=>(r,o,s)=>{let n={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:i=>i,version:0,merge:(i,E)=>({...E,...i}),...t},S=!1,m=new Set,u=new Set,d;try{d=n.getStorage()}catch{}if(!d)return e((...i)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...i)},o,s);let l=A(n.serialize),f=()=>{let i=n.partialize({...o()}),E,c=l({state:i,version:n.version}).then(h=>d.setItem(n.name,h)).catch(h=>{E=h});if(E)throw E;return c},_=s.setState;s.setState=(i,E)=>{_(i,E),f()};let p=e((...i)=>{r(...i),f()},o,s),v,a=()=>{var i;if(!d)return;S=!1,m.forEach(c=>c(o()));let E=((i=n.onRehydrateStorage)==null?void 0:i.call(n,o()))||void 0;return A(d.getItem.bind(d))(n.name).then(c=>{if(c)return n.deserialize(c)}).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var h;return v=n.merge(c,(h=o())!=null?h:p),r(v,!0),f()}).then(()=>{E==null||E(v,void 0),S=!0,u.forEach(c=>c(v))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:i=>{n={...n,...i},i.getStorage&&(d=i.getStorage())},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>a(),hasHydrated:()=>S,onHydrate:i=>(m.add(i),()=>{m.delete(i)}),onFinishHydration:i=>(u.add(i),()=>{u.delete(i)})},a(),v||p},Ke=(e,t)=>(r,o,s)=>{let n={storage:We(()=>localStorage),partialize:a=>a,version:0,merge:(a,i)=>({...i,...a}),...t},S=!1,m=new Set,u=new Set,d=n.storage;if(!d)return e((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...a)},o,s);let l=()=>{let a=n.partialize({...o()});return d.setItem(n.name,{state:a,version:n.version})},f=s.setState;s.setState=(a,i)=>{f(a,i),l()};let _=e((...a)=>{r(...a),l()},o,s),p,v=()=>{var a,i;if(!d)return;S=!1,m.forEach(c=>{var h;return c((h=o())!=null?h:_)});let E=((i=n.onRehydrateStorage)==null?void 0:i.call(n,(a=o())!=null?a:_))||void 0;return A(d.getItem.bind(d))(n.name).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var h;return p=n.merge(c,(h=o())!=null?h:_),r(p,!0),l()}).then(()=>{E==null||E(p,void 0),p=o(),S=!0,u.forEach(c=>c(p))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:a=>{n={...n,...a},a.storage&&(d=a.storage)},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>v(),hasHydrated:()=>S,onHydrate:a=>(m.add(a),()=>{m.delete(a)}),onFinishHydration:a=>(u.add(a),()=>{u.delete(a)})},n.skipHydration||v(),p||_},qe=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((fe.env?fe.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Je(e,t)):Ke(e,t),me=qe;var q=require("react");var $e=(e,t)=>(r,o,s)=>{let n=o()!==void 0,S=!1,m=new BroadcastChannel(t.name),u=(...l)=>{let f=o();if(r(...l),t.unsync)return;let _=o(),p=Object.entries(_).reduce((v,[a,i])=>(f[a]!==i&&(v={...v,[a]:i}),v),{});m.postMessage(p)};return m.onmessage=l=>{if(l.data.sync===t.name){if(!S)return;let f=Object.entries(o()).reduce((_,[p,v])=>(typeof v!="function"&&typeof v!="symbol"&&(_={..._,[p]:v}),_),{});m.postMessage(f);return}r(l.data),n=!0},n||(()=>{var l;m.postMessage({sync:t.name}),setTimeout(()=>{n||(S=!0,n=!0)},(l=t.mainTimeout)!=null?l:100)})(),e(u,o,s)},he=$e;var w=de()(he(me((e,t)=>({theme:"",defaultTheme:"",defaultDarkTheme:"dark",defaultLightTheme:"",colorSchemePref:"system",forcedTheme:"",forcedColorScheme:"",setTheme:r=>e({...t(),theme:r}),setDefaultTheme:r=>e({...t(),defaultTheme:r}),setDefaultDarkTheme:r=>e({...t(),defaultDarkTheme:r}),setDefaultLightTheme:r=>e({...t(),defaultLightTheme:r}),setForcedTheme:r=>e({...t(),forcedTheme:r}),setForcedColorScheme:r=>e({...t(),forcedColorScheme:r}),setColorSchemePref:r=>e({...t(),colorSchemePref:r})}),{name:"nextjs-themes"}),{name:"nextjs-themes"}));function Xe(e){let[t,r,o,s,n,S,m]=w(u=>[u.theme,u.defaultTheme,u.defaultDarkTheme,u.defaultLightTheme,u.colorSchemePref,u.forcedTheme,u.forcedColorScheme]);return(0,ve.useEffect)(()=>{let u=matchMedia("(prefers-color-scheme: dark)"),d=()=>{let l=Ye(),f="";if(e.forcedTheme!==void 0||S)f=e.forcedTheme||S;else if(m||n)switch(m||n){case"system":f=u.matches?o:s;break;case"dark":f=o;break;case"light":f=s}document.documentElement.setAttribute("data-theme",f||t||r),l()};return u.addEventListener("change",d),d(),()=>{u.removeEventListener("change",d)}},[t,r,o,s,S,n,m,e.forcedTheme]),k.createElement(k.Fragment,null)}var Ye=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}};var F=M(require("react")),pe=require("react");function Qe(e){let[t]=w(r=>[r.setForcedTheme]);return(0,pe.useEffect)(()=>(t(e.theme),()=>{t("")}),[e.theme]),F.createElement(F.Fragment,null)}var H=M(require("react")),Se=require("react");function Ze(e){let[t]=w(r=>[r.setForcedColorScheme]);return(0,Se.useEffect)(()=>(t(e.colorScheme),console.log(e),()=>{t("")}),[]),H.createElement(H.Fragment,null)}0&&(module.exports={ForceColorScheme,ForceTheme,ThemeSwitcher,useTheme}); | ||
"use strict";var _e=Object.create;var x=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),De=(e,t)=>{for(var r in t)x(e,r,{get:t[r],enumerable:!0})},$=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Te(t))!Oe.call(e,s)&&s!==r&&x(e,s,{get:()=>t[s],enumerable:!(o=Ee(t,s))||o.enumerable});return e};var M=(e,t,r)=>(r=e!=null?_e(ge(e)):{},$(t||!e||!e.__esModule?x(r,"default",{value:e,enumerable:!0}):r,e)),Ce=e=>$(x({},"__esModule",{value:!0}),e);var ee=w(Z=>{"use strict";var L=require("react");function be(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var we=typeof Object.is=="function"?Object.is:be,Le=L.useState,Ie=L.useEffect,Re=L.useLayoutEffect,Ae=L.useDebugValue;function xe(e,t){var r=t(),o=Le({inst:{value:r,getSnapshot:t}}),s=o[0].inst,n=o[1];return Re(function(){s.value=r,s.getSnapshot=t,U(s)&&n({inst:s})},[e,r,t]),Ie(function(){return U(s)&&n({inst:s}),e(function(){U(s)&&n({inst:s})})},[e]),Ae(r),r}function U(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!we(e,r)}catch{return!0}}function Me(e,t){return t()}var Ne=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Me:xe;Z.useSyncExternalStore=L.useSyncExternalStore!==void 0?L.useSyncExternalStore:Ne});var re=w(te=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(f){{for(var y=arguments.length,g=new Array(y>1?y-1:0),T=1;T<y;T++)g[T-1]=arguments[T];o("error",f,g)}}function o(f,y,g){{var T=t.ReactDebugCurrentFrame,D=T.getStackAddendum();D!==""&&(y+="%s",g=g.concat([D]));var C=g.map(function(O){return String(O)});C.unshift("Warning: "+y),Function.prototype.apply.call(console[f],console,C)}}function s(f,y){return f===y&&(f!==0||1/f===1/y)||f!==f&&y!==y}var n=typeof Object.is=="function"?Object.is:s,p=e.useState,v=e.useEffect,S=e.useLayoutEffect,d=e.useDebugValue,i=!1,m=!1;function _(f,y,g){i||e.startTransition!==void 0&&(i=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=y();if(!m){var D=y();n(T,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),m=!0)}var C=p({inst:{value:T,getSnapshot:y}}),O=C[0].inst,I=C[1];return S(function(){O.value=T,O.getSnapshot=y,l(O)&&I({inst:O})},[f,T,y]),v(function(){l(O)&&I({inst:O});var P=function(){l(O)&&I({inst:O})};return f(P)},[f]),d(T),T}function l(f){var y=f.getSnapshot,g=f.value;try{var T=y();return!n(g,T)}catch{return!0}}function h(f,y,g){return y()}var u=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",a=!u,E=a?h:_,c=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;te.useSyncExternalStore=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var J=w((st,W)=>{"use strict";process.env.NODE_ENV==="production"?W.exports=ee():W.exports=re()});var oe=w(ne=>{"use strict";var N=require("react"),je=J();function ke(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fe=typeof Object.is=="function"?Object.is:ke,He=je.useSyncExternalStore,Pe=N.useRef,ze=N.useEffect,Be=N.useMemo,Ve=N.useDebugValue;ne.useSyncExternalStoreWithSelector=function(e,t,r,o,s){var n=Pe(null);if(n.current===null){var p={hasValue:!1,value:null};n.current=p}else p=n.current;n=Be(function(){function S(l){if(!d){if(d=!0,i=l,l=o(l),s!==void 0&&p.hasValue){var h=p.value;if(s(h,l))return m=h}return m=l}if(h=m,Fe(i,l))return h;var u=o(l);return s!==void 0&&s(h,u)?h:(i=l,m=u)}var d=!1,i,m,_=r===void 0?null:r;return[function(){return S(t())},_===null?void 0:function(){return S(_())}]},[t,r,o,s]);var v=He(e,n[0],n[1]);return ze(function(){p.hasValue=!0,p.value=v},[v]),Ve(v),v}});var ie=w(se=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=J();function r(i,m){return i===m&&(i!==0||1/i===1/m)||i!==i&&m!==m}var o=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,n=e.useRef,p=e.useEffect,v=e.useMemo,S=e.useDebugValue;function d(i,m,_,l,h){var u=n(null),a;u.current===null?(a={hasValue:!1,value:null},u.current=a):a=u.current;var E=v(function(){var g=!1,T,D,C=function(R){if(!g){g=!0,T=R;var z=l(R);if(h!==void 0&&a.hasValue){var B=a.value;if(h(B,z))return D=B,B}return D=z,z}var ye=T,V=D;if(o(ye,R))return V;var G=l(R);return h!==void 0&&h(V,G)?V:(T=R,D=G,G)},O=_===void 0?null:_,I=function(){return C(m())},P=O===null?void 0:function(){return C(O())};return[I,P]},[m,_,l,h]),c=E[0],f=E[1],y=s(i,c,f);return p(function(){a.hasValue=!0,a.value=y},[y]),S(y),y}se.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var ae=w((ut,K)=>{"use strict";process.env.NODE_ENV==="production"?K.exports=oe():K.exports=ie()});var et={};De(et,{ForceColorScheme:()=>Ze,ForceTheme:()=>Qe,ThemeSwitcher:()=>Xe,useTheme:()=>b});module.exports=Ce(et);var k=M(require("react")),ve=require("react");var Y={},X=e=>{let t,r=new Set,o=(S,d)=>{let i=typeof S=="function"?S(t):S;if(!Object.is(i,t)){let m=t;t=(d!=null?d:typeof i!="object")?i:Object.assign({},t,i),r.forEach(_=>_(t,m))}},s=()=>t,v={setState:o,getState:s,subscribe:S=>(r.add(S),()=>r.delete(S)),destroy:()=>{(Y.env?Y.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(o,s,v),v},Q=e=>e?X(e):X;var ce=require("react"),le=M(ae(),1),j={},{useSyncExternalStoreWithSelector:Ge}=le.default;function Ue(e,t=e.getState,r){(j.env?j.env.MODE:void 0)!=="production"&&r&&console.warn("[DEPRECATED] Use `createWithEqualityFn` from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937");let o=Ge(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,ce.useDebugValue)(o),o}var ue=e=>{(j.env?j.env.MODE:void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t=typeof e=="function"?Q(e):e,r=(o,s)=>Ue(t,o,s);return Object.assign(r,t),r},de=e=>e?ue(e):ue;var fe={};function We(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var n;let p=S=>S===null?null:JSON.parse(S,t==null?void 0:t.reviver),v=(n=r.getItem(s))!=null?n:null;return v instanceof Promise?v.then(p):p(v)},setItem:(s,n)=>r.setItem(s,JSON.stringify(n,t==null?void 0:t.replacer)),removeItem:s=>r.removeItem(s)}}var A=e=>t=>{try{let r=e(t);return r instanceof Promise?r:{then(o){return A(o)(r)},catch(o){return this}}}catch(r){return{then(o){return this},catch(o){return A(o)(r)}}}},Je=(e,t)=>(r,o,s)=>{let n={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:a=>a,version:0,merge:(a,E)=>({...E,...a}),...t},p=!1,v=new Set,S=new Set,d;try{d=n.getStorage()}catch{}if(!d)return e((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...a)},o,s);let i=A(n.serialize),m=()=>{let a=n.partialize({...o()}),E,c=i({state:a,version:n.version}).then(f=>d.setItem(n.name,f)).catch(f=>{E=f});if(E)throw E;return c},_=s.setState;s.setState=(a,E)=>{_(a,E),m()};let l=e((...a)=>{r(...a),m()},o,s),h,u=()=>{var a;if(!d)return;p=!1,v.forEach(c=>c(o()));let E=((a=n.onRehydrateStorage)==null?void 0:a.call(n,o()))||void 0;return A(d.getItem.bind(d))(n.name).then(c=>{if(c)return n.deserialize(c)}).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return h=n.merge(c,(f=o())!=null?f:l),r(h,!0),m()}).then(()=>{E==null||E(h,void 0),p=!0,S.forEach(c=>c(h))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:a=>{n={...n,...a},a.getStorage&&(d=a.getStorage())},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>u(),hasHydrated:()=>p,onHydrate:a=>(v.add(a),()=>{v.delete(a)}),onFinishHydration:a=>(S.add(a),()=>{S.delete(a)})},u(),h||l},Ke=(e,t)=>(r,o,s)=>{let n={storage:We(()=>localStorage),partialize:u=>u,version:0,merge:(u,a)=>({...a,...u}),...t},p=!1,v=new Set,S=new Set,d=n.storage;if(!d)return e((...u)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...u)},o,s);let i=()=>{let u=n.partialize({...o()});return d.setItem(n.name,{state:u,version:n.version})},m=s.setState;s.setState=(u,a)=>{m(u,a),i()};let _=e((...u)=>{r(...u),i()},o,s),l,h=()=>{var u,a;if(!d)return;p=!1,v.forEach(c=>{var f;return c((f=o())!=null?f:_)});let E=((a=n.onRehydrateStorage)==null?void 0:a.call(n,(u=o())!=null?u:_))||void 0;return A(d.getItem.bind(d))(n.name).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return l=n.merge(c,(f=o())!=null?f:_),r(l,!0),i()}).then(()=>{E==null||E(l,void 0),l=o(),p=!0,S.forEach(c=>c(l))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:u=>{n={...n,...u},u.storage&&(d=u.storage)},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>h(),hasHydrated:()=>p,onHydrate:u=>(v.add(u),()=>{v.delete(u)}),onFinishHydration:u=>(S.add(u),()=>{S.delete(u)})},n.skipHydration||h(),l||_},qe=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((fe.env?fe.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Je(e,t)):Ke(e,t),me=qe;var q=require("react");var $e=(e,t)=>(r,o,s)=>{let n=o()!==void 0,p=!1,v=new BroadcastChannel(t.name),S=(...i)=>{let m=o();if(r(...i),t.unsync)return;let _=o(),l=Object.entries(_).reduce((h,[u,a])=>(m[u]!==a&&(h={...h,[u]:a}),h),{});v.postMessage(l)};return v.onmessage=i=>{if(i.data.sync===t.name){if(!p)return;let m=Object.entries(o()).reduce((_,[l,h])=>(typeof h!="function"&&typeof h!="symbol"&&(_={..._,[l]:h}),_),{});v.postMessage(m);return}r(i.data),n=!0},n||(()=>{var i;v.postMessage({sync:t.name}),setTimeout(()=>{n||(p=!0,n=!0)},(i=t.mainTimeout)!=null?i:100)})(),e(S,o,s)},he=$e;var b=de()(he(me((e,t)=>({theme:"",defaultTheme:"",defaultDarkTheme:"dark",defaultLightTheme:"",colorSchemePref:"system",forcedTheme:"",forcedColorScheme:"",setTheme:r=>e({...t(),theme:r}),setDefaultTheme:r=>e({...t(),defaultTheme:r}),setDefaultDarkTheme:r=>e({...t(),defaultDarkTheme:r}),setDefaultLightTheme:r=>e({...t(),defaultLightTheme:r}),setForcedTheme:r=>e({...t(),forcedTheme:r}),setForcedColorScheme:r=>e({...t(),forcedColorScheme:r}),setColorSchemePref:r=>e({...t(),colorSchemePref:r})}),{name:"nextjs-themes"}),{name:"nextjs-themes"}));function Xe(e){let[t,r,o,s,n,p,v]=b(i=>[i.theme,i.defaultTheme,i.defaultDarkTheme,i.defaultLightTheme,i.colorSchemePref,i.forcedTheme,i.forcedColorScheme]),S=e.forcedTheme===void 0?p:e.forcedTheme,d=e.forcedColorScheme===void 0?v:e.forcedColorScheme;return(0,ve.useEffect)(()=>{let i=matchMedia("(prefers-color-scheme: dark)"),m=()=>{let _=Ye(),l="";if(S)l=S;else if(d||n)switch(d||n){case"system":l=i.matches?o:s;break;case"dark":l=o;break;case"light":l=s}document.documentElement.setAttribute("data-theme",l||t||r),_()};return i.addEventListener("change",m),m(),()=>{i.removeEventListener("change",m)}},[t,r,o,s,S,n,d]),k.createElement(k.Fragment,null)}var Ye=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}};var F=M(require("react")),Se=require("react");function Qe(e){let[t]=b(r=>[r.setForcedTheme]);return(0,Se.useEffect)(()=>(t(e.theme),()=>{t("")}),[e.theme]),F.createElement(F.Fragment,null)}var H=M(require("react")),pe=require("react");function Ze(e){let[t]=b(r=>[r.setForcedColorScheme]);return(0,pe.useEffect)(()=>(t(e.colorScheme),console.log(e),()=>{t("")}),[]),H.createElement(H.Fragment,null)}0&&(module.exports={ForceColorScheme,ForceTheme,ThemeSwitcher,useTheme}); | ||
/*! Bundled license information: | ||
@@ -4,0 +4,0 @@ |
{ | ||
"name": "nextjs-themes", | ||
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>", | ||
"version": "0.0.1", | ||
"version": "0.2.0", | ||
"main": "index.js", | ||
@@ -21,2 +21,6 @@ "types": "index.d.ts", | ||
}, | ||
"funding": { | ||
"type": "github", | ||
"url": "https://github.com/sponsors/mayank1513" | ||
}, | ||
"keywords": [ | ||
@@ -23,0 +27,0 @@ "nextjs", |
@@ -1,2 +0,2 @@ | ||
# Nextjs-Themes [![Version](https://img.shields.io/npm/v/next-themes.svg?colorB=green)](https://www.npmjs.com/package/nextjs-themes) | ||
# Nextjs-Themes [![Version](https://img.shields.io/npm/v/nextjs-themes.svg?colorB=green)](https://www.npmjs.com/package/nextjs-themes) | ||
@@ -3,0 +3,0 @@ This project is inspired by next-themes. Next-themes is an awesome package, however, it requires wrapping everything in a provider. The provider has to be a client component as it uses hooks. And thus, it takes away all the benefits of Server Components. |
export { ThemeSwitcher } from './ThemeSwitcher.js'; | ||
import 'react'; | ||
import '../store.js'; | ||
import 'zustand'; |
"use client"; | ||
"use strict";var he=Object.create;var A=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ee=(e,t)=>{for(var r in t)A(e,r,{get:t[r],enumerable:!0})},W=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pe(t))!_e.call(e,s)&&s!==r&&A(e,s,{get:()=>t[s],enumerable:!(o=Se(t,s))||o.enumerable});return e};var J=(e,t,r)=>(r=e!=null?he(ye(e)):{},W(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e)),ge=e=>W(A({},"__esModule",{value:!0}),e);var Y=w(X=>{"use strict";var C=require("react");function Te(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oe=typeof Object.is=="function"?Object.is:Te,De=C.useState,be=C.useEffect,we=C.useLayoutEffect,Ce=C.useDebugValue;function Le(e,t){var r=t(),o=De({inst:{value:r,getSnapshot:t}}),s=o[0].inst,n=o[1];return we(function(){s.value=r,s.getSnapshot=t,B(s)&&n({inst:s})},[e,r,t]),be(function(){return B(s)&&n({inst:s}),e(function(){B(s)&&n({inst:s})})},[e]),Ce(r),r}function B(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Oe(e,r)}catch{return!0}}function Ie(e,t){return t()}var Re=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Ie:Le;X.useSyncExternalStore=C.useSyncExternalStore!==void 0?C.useSyncExternalStore:Re});var Z=w(Q=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(v){{for(var y=arguments.length,T=new Array(y>1?y-1:0),g=1;g<y;g++)T[g-1]=arguments[g];o("error",v,T)}}function o(v,y,T){{var g=t.ReactDebugCurrentFrame,D=g.getStackAddendum();D!==""&&(y+="%s",T=T.concat([D]));var b=T.map(function(O){return String(O)});b.unshift("Warning: "+y),Function.prototype.apply.call(console[v],console,b)}}function s(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var n=typeof Object.is=="function"?Object.is:s,p=e.useState,m=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue,l=!1,f=!1;function _(v,y,T){l||e.startTransition!==void 0&&(l=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=y();if(!f){var D=y();n(g,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var b=p({inst:{value:g,getSnapshot:y}}),O=b[0].inst,L=b[1];return u(function(){O.value=g,O.getSnapshot=y,S(O)&&L({inst:O})},[v,g,y]),m(function(){S(O)&&L({inst:O});var j=function(){S(O)&&L({inst:O})};return v(j)},[v]),d(g),g}function S(v){var y=v.getSnapshot,T=v.value;try{var g=y();return!n(T,g)}catch{return!0}}function h(v,y,T){return y()}var a=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",i=!a,E=i?h:_,c=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;Q.useSyncExternalStore=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var F=w((Ze,V)=>{"use strict";process.env.NODE_ENV==="production"?V.exports=Y():V.exports=Z()});var te=w(ee=>{"use strict";var x=require("react"),Ae=F();function xe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Me=typeof Object.is=="function"?Object.is:xe,Ne=Ae.useSyncExternalStore,je=x.useRef,ke=x.useEffect,He=x.useMemo,Pe=x.useDebugValue;ee.useSyncExternalStoreWithSelector=function(e,t,r,o,s){var n=je(null);if(n.current===null){var p={hasValue:!1,value:null};n.current=p}else p=n.current;n=He(function(){function u(S){if(!d){if(d=!0,l=S,S=o(S),s!==void 0&&p.hasValue){var h=p.value;if(s(h,S))return f=h}return f=S}if(h=f,Me(l,S))return h;var a=o(S);return s!==void 0&&s(h,a)?h:(l=S,f=a)}var d=!1,l,f,_=r===void 0?null:r;return[function(){return u(t())},_===null?void 0:function(){return u(_())}]},[t,r,o,s]);var m=Ne(e,n[0],n[1]);return ke(function(){p.hasValue=!0,p.value=m},[m]),Pe(m),m}});var ne=w(re=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=F();function r(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var o=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,n=e.useRef,p=e.useEffect,m=e.useMemo,u=e.useDebugValue;function d(l,f,_,S,h){var a=n(null),i;a.current===null?(i={hasValue:!1,value:null},a.current=i):i=a.current;var E=m(function(){var T=!1,g,D,b=function(I){if(!T){T=!0,g=I;var k=S(I);if(h!==void 0&&i.hasValue){var H=i.value;if(h(H,k))return D=H,H}return D=k,k}var ve=g,P=D;if(o(ve,I))return P;var z=S(I);return h!==void 0&&h(P,z)?P:(g=I,D=z,z)},O=_===void 0?null:_,L=function(){return b(f())},j=O===null?void 0:function(){return b(O())};return[L,j]},[f,_,S,h]),c=E[0],v=E[1],y=s(l,c,v);return p(function(){i.hasValue=!0,i.value=y},[y]),u(y),y}re.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var oe=w((rt,G)=>{"use strict";process.env.NODE_ENV==="production"?G.exports=te():G.exports=ne()});var qe={};Ee(qe,{ThemeSwitcher:()=>Je});module.exports=ge(qe);var N=J(require("react")),me=require("react");var q={},K=e=>{let t,r=new Set,o=(u,d)=>{let l=typeof u=="function"?u(t):u;if(!Object.is(l,t)){let f=t;t=(d!=null?d:typeof l!="object")?l:Object.assign({},t,l),r.forEach(_=>_(t,f))}},s=()=>t,m={setState:o,getState:s,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(q.env?q.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(o,s,m),m},$=e=>e?K(e):K;var ie=require("react"),ae=J(oe(),1),M={},{useSyncExternalStoreWithSelector:ze}=ae.default;function Be(e,t=e.getState,r){(M.env?M.env.MODE:void 0)!=="production"&&r&&console.warn("[DEPRECATED] Use `createWithEqualityFn` from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937");let o=ze(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,ie.useDebugValue)(o),o}var se=e=>{(M.env?M.env.MODE:void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t=typeof e=="function"?$(e):e,r=(o,s)=>Be(t,o,s);return Object.assign(r,t),r},ue=e=>e?se(e):se;var ce={};function Ve(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var n;let p=u=>u===null?null:JSON.parse(u,t==null?void 0:t.reviver),m=(n=r.getItem(s))!=null?n:null;return m instanceof Promise?m.then(p):p(m)},setItem:(s,n)=>r.setItem(s,JSON.stringify(n,t==null?void 0:t.replacer)),removeItem:s=>r.removeItem(s)}}var R=e=>t=>{try{let r=e(t);return r instanceof Promise?r:{then(o){return R(o)(r)},catch(o){return this}}}catch(r){return{then(o){return this},catch(o){return R(o)(r)}}}},Fe=(e,t)=>(r,o,s)=>{let n={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:i=>i,version:0,merge:(i,E)=>({...E,...i}),...t},p=!1,m=new Set,u=new Set,d;try{d=n.getStorage()}catch{}if(!d)return e((...i)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...i)},o,s);let l=R(n.serialize),f=()=>{let i=n.partialize({...o()}),E,c=l({state:i,version:n.version}).then(v=>d.setItem(n.name,v)).catch(v=>{E=v});if(E)throw E;return c},_=s.setState;s.setState=(i,E)=>{_(i,E),f()};let S=e((...i)=>{r(...i),f()},o,s),h,a=()=>{var i;if(!d)return;p=!1,m.forEach(c=>c(o()));let E=((i=n.onRehydrateStorage)==null?void 0:i.call(n,o()))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)return n.deserialize(c)}).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var v;return h=n.merge(c,(v=o())!=null?v:S),r(h,!0),f()}).then(()=>{E==null||E(h,void 0),p=!0,u.forEach(c=>c(h))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:i=>{n={...n,...i},i.getStorage&&(d=i.getStorage())},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>a(),hasHydrated:()=>p,onHydrate:i=>(m.add(i),()=>{m.delete(i)}),onFinishHydration:i=>(u.add(i),()=>{u.delete(i)})},a(),h||S},Ge=(e,t)=>(r,o,s)=>{let n={storage:Ve(()=>localStorage),partialize:a=>a,version:0,merge:(a,i)=>({...i,...a}),...t},p=!1,m=new Set,u=new Set,d=n.storage;if(!d)return e((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...a)},o,s);let l=()=>{let a=n.partialize({...o()});return d.setItem(n.name,{state:a,version:n.version})},f=s.setState;s.setState=(a,i)=>{f(a,i),l()};let _=e((...a)=>{r(...a),l()},o,s),S,h=()=>{var a,i;if(!d)return;p=!1,m.forEach(c=>{var v;return c((v=o())!=null?v:_)});let E=((i=n.onRehydrateStorage)==null?void 0:i.call(n,(a=o())!=null?a:_))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var v;return S=n.merge(c,(v=o())!=null?v:_),r(S,!0),l()}).then(()=>{E==null||E(S,void 0),S=o(),p=!0,u.forEach(c=>c(S))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:a=>{n={...n,...a},a.storage&&(d=a.storage)},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>h(),hasHydrated:()=>p,onHydrate:a=>(m.add(a),()=>{m.delete(a)}),onFinishHydration:a=>(u.add(a),()=>{u.delete(a)})},n.skipHydration||h(),S||_},Ue=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((ce.env?ce.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Fe(e,t)):Ge(e,t),le=Ue;var U=require("react");var We=(e,t)=>(r,o,s)=>{let n=o()!==void 0,p=!1,m=new BroadcastChannel(t.name),u=(...l)=>{let f=o();if(r(...l),t.unsync)return;let _=o(),S=Object.entries(_).reduce((h,[a,i])=>(f[a]!==i&&(h={...h,[a]:i}),h),{});m.postMessage(S)};return m.onmessage=l=>{if(l.data.sync===t.name){if(!p)return;let f=Object.entries(o()).reduce((_,[S,h])=>(typeof h!="function"&&typeof h!="symbol"&&(_={..._,[S]:h}),_),{});m.postMessage(f);return}r(l.data),n=!0},n||(()=>{var l;m.postMessage({sync:t.name}),setTimeout(()=>{n||(p=!0,n=!0)},(l=t.mainTimeout)!=null?l:100)})(),e(u,o,s)},de=We;var fe=ue()(de(le((e,t)=>({theme:"",defaultTheme:"",defaultDarkTheme:"dark",defaultLightTheme:"",colorSchemePref:"system",forcedTheme:"",forcedColorScheme:"",setTheme:r=>e({...t(),theme:r}),setDefaultTheme:r=>e({...t(),defaultTheme:r}),setDefaultDarkTheme:r=>e({...t(),defaultDarkTheme:r}),setDefaultLightTheme:r=>e({...t(),defaultLightTheme:r}),setForcedTheme:r=>e({...t(),forcedTheme:r}),setForcedColorScheme:r=>e({...t(),forcedColorScheme:r}),setColorSchemePref:r=>e({...t(),colorSchemePref:r})}),{name:"nextjs-themes"}),{name:"nextjs-themes"}));function Je(e){let[t,r,o,s,n,p,m]=fe(u=>[u.theme,u.defaultTheme,u.defaultDarkTheme,u.defaultLightTheme,u.colorSchemePref,u.forcedTheme,u.forcedColorScheme]);return(0,me.useEffect)(()=>{let u=matchMedia("(prefers-color-scheme: dark)"),d=()=>{let l=Ke(),f="";if(e.forcedTheme!==void 0||p)f=e.forcedTheme||p;else if(m||n)switch(m||n){case"system":f=u.matches?o:s;break;case"dark":f=o;break;case"light":f=s}document.documentElement.setAttribute("data-theme",f||t||r),l()};return u.addEventListener("change",d),d(),()=>{u.removeEventListener("change",d)}},[t,r,o,s,p,n,m,e.forcedTheme]),N.createElement(N.Fragment,null)}var Ke=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}};0&&(module.exports={ThemeSwitcher}); | ||
"use strict";var ve=Object.create;var A=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ee=(e,t)=>{for(var r in t)A(e,r,{get:t[r],enumerable:!0})},W=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pe(t))!_e.call(e,s)&&s!==r&&A(e,s,{get:()=>t[s],enumerable:!(o=Se(t,s))||o.enumerable});return e};var J=(e,t,r)=>(r=e!=null?ve(ye(e)):{},W(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e)),ge=e=>W(A({},"__esModule",{value:!0}),e);var Y=w(X=>{"use strict";var C=require("react");function Te(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oe=typeof Object.is=="function"?Object.is:Te,De=C.useState,be=C.useEffect,we=C.useLayoutEffect,Ce=C.useDebugValue;function Le(e,t){var r=t(),o=De({inst:{value:r,getSnapshot:t}}),s=o[0].inst,n=o[1];return we(function(){s.value=r,s.getSnapshot=t,B(s)&&n({inst:s})},[e,r,t]),be(function(){return B(s)&&n({inst:s}),e(function(){B(s)&&n({inst:s})})},[e]),Ce(r),r}function B(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Oe(e,r)}catch{return!0}}function Ie(e,t){return t()}var Re=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Ie:Le;X.useSyncExternalStore=C.useSyncExternalStore!==void 0?C.useSyncExternalStore:Re});var Z=w(Q=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(f){{for(var y=arguments.length,T=new Array(y>1?y-1:0),g=1;g<y;g++)T[g-1]=arguments[g];o("error",f,T)}}function o(f,y,T){{var g=t.ReactDebugCurrentFrame,D=g.getStackAddendum();D!==""&&(y+="%s",T=T.concat([D]));var b=T.map(function(O){return String(O)});b.unshift("Warning: "+y),Function.prototype.apply.call(console[f],console,b)}}function s(f,y){return f===y&&(f!==0||1/f===1/y)||f!==f&&y!==y}var n=typeof Object.is=="function"?Object.is:s,p=e.useState,v=e.useEffect,S=e.useLayoutEffect,d=e.useDebugValue,i=!1,m=!1;function _(f,y,T){i||e.startTransition!==void 0&&(i=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=y();if(!m){var D=y();n(g,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),m=!0)}var b=p({inst:{value:g,getSnapshot:y}}),O=b[0].inst,L=b[1];return S(function(){O.value=g,O.getSnapshot=y,l(O)&&L({inst:O})},[f,g,y]),v(function(){l(O)&&L({inst:O});var j=function(){l(O)&&L({inst:O})};return f(j)},[f]),d(g),g}function l(f){var y=f.getSnapshot,T=f.value;try{var g=y();return!n(T,g)}catch{return!0}}function h(f,y,T){return y()}var u=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",a=!u,E=a?h:_,c=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;Q.useSyncExternalStore=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var F=w((Ze,V)=>{"use strict";process.env.NODE_ENV==="production"?V.exports=Y():V.exports=Z()});var te=w(ee=>{"use strict";var x=require("react"),Ae=F();function xe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Me=typeof Object.is=="function"?Object.is:xe,Ne=Ae.useSyncExternalStore,je=x.useRef,ke=x.useEffect,He=x.useMemo,Pe=x.useDebugValue;ee.useSyncExternalStoreWithSelector=function(e,t,r,o,s){var n=je(null);if(n.current===null){var p={hasValue:!1,value:null};n.current=p}else p=n.current;n=He(function(){function S(l){if(!d){if(d=!0,i=l,l=o(l),s!==void 0&&p.hasValue){var h=p.value;if(s(h,l))return m=h}return m=l}if(h=m,Me(i,l))return h;var u=o(l);return s!==void 0&&s(h,u)?h:(i=l,m=u)}var d=!1,i,m,_=r===void 0?null:r;return[function(){return S(t())},_===null?void 0:function(){return S(_())}]},[t,r,o,s]);var v=Ne(e,n[0],n[1]);return ke(function(){p.hasValue=!0,p.value=v},[v]),Pe(v),v}});var ne=w(re=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=F();function r(i,m){return i===m&&(i!==0||1/i===1/m)||i!==i&&m!==m}var o=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,n=e.useRef,p=e.useEffect,v=e.useMemo,S=e.useDebugValue;function d(i,m,_,l,h){var u=n(null),a;u.current===null?(a={hasValue:!1,value:null},u.current=a):a=u.current;var E=v(function(){var T=!1,g,D,b=function(I){if(!T){T=!0,g=I;var k=l(I);if(h!==void 0&&a.hasValue){var H=a.value;if(h(H,k))return D=H,H}return D=k,k}var he=g,P=D;if(o(he,I))return P;var z=l(I);return h!==void 0&&h(P,z)?P:(g=I,D=z,z)},O=_===void 0?null:_,L=function(){return b(m())},j=O===null?void 0:function(){return b(O())};return[L,j]},[m,_,l,h]),c=E[0],f=E[1],y=s(i,c,f);return p(function(){a.hasValue=!0,a.value=y},[y]),S(y),y}re.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var oe=w((rt,G)=>{"use strict";process.env.NODE_ENV==="production"?G.exports=te():G.exports=ne()});var qe={};Ee(qe,{ThemeSwitcher:()=>Je});module.exports=ge(qe);var N=J(require("react")),me=require("react");var q={},K=e=>{let t,r=new Set,o=(S,d)=>{let i=typeof S=="function"?S(t):S;if(!Object.is(i,t)){let m=t;t=(d!=null?d:typeof i!="object")?i:Object.assign({},t,i),r.forEach(_=>_(t,m))}},s=()=>t,v={setState:o,getState:s,subscribe:S=>(r.add(S),()=>r.delete(S)),destroy:()=>{(q.env?q.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(o,s,v),v},$=e=>e?K(e):K;var ie=require("react"),ae=J(oe(),1),M={},{useSyncExternalStoreWithSelector:ze}=ae.default;function Be(e,t=e.getState,r){(M.env?M.env.MODE:void 0)!=="production"&&r&&console.warn("[DEPRECATED] Use `createWithEqualityFn` from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937");let o=ze(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,ie.useDebugValue)(o),o}var se=e=>{(M.env?M.env.MODE:void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t=typeof e=="function"?$(e):e,r=(o,s)=>Be(t,o,s);return Object.assign(r,t),r},ue=e=>e?se(e):se;var ce={};function Ve(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var n;let p=S=>S===null?null:JSON.parse(S,t==null?void 0:t.reviver),v=(n=r.getItem(s))!=null?n:null;return v instanceof Promise?v.then(p):p(v)},setItem:(s,n)=>r.setItem(s,JSON.stringify(n,t==null?void 0:t.replacer)),removeItem:s=>r.removeItem(s)}}var R=e=>t=>{try{let r=e(t);return r instanceof Promise?r:{then(o){return R(o)(r)},catch(o){return this}}}catch(r){return{then(o){return this},catch(o){return R(o)(r)}}}},Fe=(e,t)=>(r,o,s)=>{let n={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:a=>a,version:0,merge:(a,E)=>({...E,...a}),...t},p=!1,v=new Set,S=new Set,d;try{d=n.getStorage()}catch{}if(!d)return e((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...a)},o,s);let i=R(n.serialize),m=()=>{let a=n.partialize({...o()}),E,c=i({state:a,version:n.version}).then(f=>d.setItem(n.name,f)).catch(f=>{E=f});if(E)throw E;return c},_=s.setState;s.setState=(a,E)=>{_(a,E),m()};let l=e((...a)=>{r(...a),m()},o,s),h,u=()=>{var a;if(!d)return;p=!1,v.forEach(c=>c(o()));let E=((a=n.onRehydrateStorage)==null?void 0:a.call(n,o()))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)return n.deserialize(c)}).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return h=n.merge(c,(f=o())!=null?f:l),r(h,!0),m()}).then(()=>{E==null||E(h,void 0),p=!0,S.forEach(c=>c(h))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:a=>{n={...n,...a},a.getStorage&&(d=a.getStorage())},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>u(),hasHydrated:()=>p,onHydrate:a=>(v.add(a),()=>{v.delete(a)}),onFinishHydration:a=>(S.add(a),()=>{S.delete(a)})},u(),h||l},Ge=(e,t)=>(r,o,s)=>{let n={storage:Ve(()=>localStorage),partialize:u=>u,version:0,merge:(u,a)=>({...a,...u}),...t},p=!1,v=new Set,S=new Set,d=n.storage;if(!d)return e((...u)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...u)},o,s);let i=()=>{let u=n.partialize({...o()});return d.setItem(n.name,{state:u,version:n.version})},m=s.setState;s.setState=(u,a)=>{m(u,a),i()};let _=e((...u)=>{r(...u),i()},o,s),l,h=()=>{var u,a;if(!d)return;p=!1,v.forEach(c=>{var f;return c((f=o())!=null?f:_)});let E=((a=n.onRehydrateStorage)==null?void 0:a.call(n,(u=o())!=null?u:_))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return l=n.merge(c,(f=o())!=null?f:_),r(l,!0),i()}).then(()=>{E==null||E(l,void 0),l=o(),p=!0,S.forEach(c=>c(l))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:u=>{n={...n,...u},u.storage&&(d=u.storage)},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>h(),hasHydrated:()=>p,onHydrate:u=>(v.add(u),()=>{v.delete(u)}),onFinishHydration:u=>(S.add(u),()=>{S.delete(u)})},n.skipHydration||h(),l||_},Ue=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((ce.env?ce.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Fe(e,t)):Ge(e,t),le=Ue;var U=require("react");var We=(e,t)=>(r,o,s)=>{let n=o()!==void 0,p=!1,v=new BroadcastChannel(t.name),S=(...i)=>{let m=o();if(r(...i),t.unsync)return;let _=o(),l=Object.entries(_).reduce((h,[u,a])=>(m[u]!==a&&(h={...h,[u]:a}),h),{});v.postMessage(l)};return v.onmessage=i=>{if(i.data.sync===t.name){if(!p)return;let m=Object.entries(o()).reduce((_,[l,h])=>(typeof h!="function"&&typeof h!="symbol"&&(_={..._,[l]:h}),_),{});v.postMessage(m);return}r(i.data),n=!0},n||(()=>{var i;v.postMessage({sync:t.name}),setTimeout(()=>{n||(p=!0,n=!0)},(i=t.mainTimeout)!=null?i:100)})(),e(S,o,s)},de=We;var fe=ue()(de(le((e,t)=>({theme:"",defaultTheme:"",defaultDarkTheme:"dark",defaultLightTheme:"",colorSchemePref:"system",forcedTheme:"",forcedColorScheme:"",setTheme:r=>e({...t(),theme:r}),setDefaultTheme:r=>e({...t(),defaultTheme:r}),setDefaultDarkTheme:r=>e({...t(),defaultDarkTheme:r}),setDefaultLightTheme:r=>e({...t(),defaultLightTheme:r}),setForcedTheme:r=>e({...t(),forcedTheme:r}),setForcedColorScheme:r=>e({...t(),forcedColorScheme:r}),setColorSchemePref:r=>e({...t(),colorSchemePref:r})}),{name:"nextjs-themes"}),{name:"nextjs-themes"}));function Je(e){let[t,r,o,s,n,p,v]=fe(i=>[i.theme,i.defaultTheme,i.defaultDarkTheme,i.defaultLightTheme,i.colorSchemePref,i.forcedTheme,i.forcedColorScheme]),S=e.forcedTheme===void 0?p:e.forcedTheme,d=e.forcedColorScheme===void 0?v:e.forcedColorScheme;return(0,me.useEffect)(()=>{let i=matchMedia("(prefers-color-scheme: dark)"),m=()=>{let _=Ke(),l="";if(S)l=S;else if(d||n)switch(d||n){case"system":l=i.matches?o:s;break;case"dark":l=o;break;case"light":l=s}document.documentElement.setAttribute("data-theme",l||t||r),_()};return i.addEventListener("change",m),m(),()=>{i.removeEventListener("change",m)}},[t,r,o,s,S,n,d]),N.createElement(N.Fragment,null)}var Ke=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}};0&&(module.exports={ThemeSwitcher}); | ||
/*! Bundled license information: | ||
@@ -4,0 +4,0 @@ |
import * as React from 'react'; | ||
import { ColorSchemeType } from '../store.js'; | ||
import 'zustand'; | ||
declare function ThemeSwitcher(props: { | ||
forcedTheme?: string; | ||
forcedColorScheme?: ColorSchemeType; | ||
}): React.JSX.Element; | ||
export { ThemeSwitcher }; |
"use client"; | ||
"use strict";var he=Object.create;var A=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ee=(e,t)=>{for(var r in t)A(e,r,{get:t[r],enumerable:!0})},W=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pe(t))!_e.call(e,s)&&s!==r&&A(e,s,{get:()=>t[s],enumerable:!(o=Se(t,s))||o.enumerable});return e};var J=(e,t,r)=>(r=e!=null?he(ye(e)):{},W(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e)),ge=e=>W(A({},"__esModule",{value:!0}),e);var Y=w(X=>{"use strict";var C=require("react");function Te(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oe=typeof Object.is=="function"?Object.is:Te,De=C.useState,be=C.useEffect,we=C.useLayoutEffect,Ce=C.useDebugValue;function Le(e,t){var r=t(),o=De({inst:{value:r,getSnapshot:t}}),s=o[0].inst,n=o[1];return we(function(){s.value=r,s.getSnapshot=t,B(s)&&n({inst:s})},[e,r,t]),be(function(){return B(s)&&n({inst:s}),e(function(){B(s)&&n({inst:s})})},[e]),Ce(r),r}function B(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Oe(e,r)}catch{return!0}}function Ie(e,t){return t()}var Re=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Ie:Le;X.useSyncExternalStore=C.useSyncExternalStore!==void 0?C.useSyncExternalStore:Re});var Z=w(Q=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(v){{for(var y=arguments.length,T=new Array(y>1?y-1:0),g=1;g<y;g++)T[g-1]=arguments[g];o("error",v,T)}}function o(v,y,T){{var g=t.ReactDebugCurrentFrame,D=g.getStackAddendum();D!==""&&(y+="%s",T=T.concat([D]));var b=T.map(function(O){return String(O)});b.unshift("Warning: "+y),Function.prototype.apply.call(console[v],console,b)}}function s(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var n=typeof Object.is=="function"?Object.is:s,p=e.useState,m=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue,l=!1,f=!1;function _(v,y,T){l||e.startTransition!==void 0&&(l=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=y();if(!f){var D=y();n(g,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var b=p({inst:{value:g,getSnapshot:y}}),O=b[0].inst,L=b[1];return u(function(){O.value=g,O.getSnapshot=y,S(O)&&L({inst:O})},[v,g,y]),m(function(){S(O)&&L({inst:O});var j=function(){S(O)&&L({inst:O})};return v(j)},[v]),d(g),g}function S(v){var y=v.getSnapshot,T=v.value;try{var g=y();return!n(T,g)}catch{return!0}}function h(v,y,T){return y()}var a=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",i=!a,E=i?h:_,c=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;Q.useSyncExternalStore=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var F=w((Ze,V)=>{"use strict";process.env.NODE_ENV==="production"?V.exports=Y():V.exports=Z()});var te=w(ee=>{"use strict";var x=require("react"),Ae=F();function xe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Me=typeof Object.is=="function"?Object.is:xe,Ne=Ae.useSyncExternalStore,je=x.useRef,ke=x.useEffect,He=x.useMemo,Pe=x.useDebugValue;ee.useSyncExternalStoreWithSelector=function(e,t,r,o,s){var n=je(null);if(n.current===null){var p={hasValue:!1,value:null};n.current=p}else p=n.current;n=He(function(){function u(S){if(!d){if(d=!0,l=S,S=o(S),s!==void 0&&p.hasValue){var h=p.value;if(s(h,S))return f=h}return f=S}if(h=f,Me(l,S))return h;var a=o(S);return s!==void 0&&s(h,a)?h:(l=S,f=a)}var d=!1,l,f,_=r===void 0?null:r;return[function(){return u(t())},_===null?void 0:function(){return u(_())}]},[t,r,o,s]);var m=Ne(e,n[0],n[1]);return ke(function(){p.hasValue=!0,p.value=m},[m]),Pe(m),m}});var ne=w(re=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=F();function r(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var o=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,n=e.useRef,p=e.useEffect,m=e.useMemo,u=e.useDebugValue;function d(l,f,_,S,h){var a=n(null),i;a.current===null?(i={hasValue:!1,value:null},a.current=i):i=a.current;var E=m(function(){var T=!1,g,D,b=function(I){if(!T){T=!0,g=I;var k=S(I);if(h!==void 0&&i.hasValue){var H=i.value;if(h(H,k))return D=H,H}return D=k,k}var ve=g,P=D;if(o(ve,I))return P;var z=S(I);return h!==void 0&&h(P,z)?P:(g=I,D=z,z)},O=_===void 0?null:_,L=function(){return b(f())},j=O===null?void 0:function(){return b(O())};return[L,j]},[f,_,S,h]),c=E[0],v=E[1],y=s(l,c,v);return p(function(){i.hasValue=!0,i.value=y},[y]),u(y),y}re.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var oe=w((rt,G)=>{"use strict";process.env.NODE_ENV==="production"?G.exports=te():G.exports=ne()});var qe={};Ee(qe,{ThemeSwitcher:()=>Je});module.exports=ge(qe);var N=J(require("react")),me=require("react");var q={},K=e=>{let t,r=new Set,o=(u,d)=>{let l=typeof u=="function"?u(t):u;if(!Object.is(l,t)){let f=t;t=(d!=null?d:typeof l!="object")?l:Object.assign({},t,l),r.forEach(_=>_(t,f))}},s=()=>t,m={setState:o,getState:s,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(q.env?q.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(o,s,m),m},$=e=>e?K(e):K;var ie=require("react"),ae=J(oe(),1),M={},{useSyncExternalStoreWithSelector:ze}=ae.default;function Be(e,t=e.getState,r){(M.env?M.env.MODE:void 0)!=="production"&&r&&console.warn("[DEPRECATED] Use `createWithEqualityFn` from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937");let o=ze(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,ie.useDebugValue)(o),o}var se=e=>{(M.env?M.env.MODE:void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t=typeof e=="function"?$(e):e,r=(o,s)=>Be(t,o,s);return Object.assign(r,t),r},ue=e=>e?se(e):se;var ce={};function Ve(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var n;let p=u=>u===null?null:JSON.parse(u,t==null?void 0:t.reviver),m=(n=r.getItem(s))!=null?n:null;return m instanceof Promise?m.then(p):p(m)},setItem:(s,n)=>r.setItem(s,JSON.stringify(n,t==null?void 0:t.replacer)),removeItem:s=>r.removeItem(s)}}var R=e=>t=>{try{let r=e(t);return r instanceof Promise?r:{then(o){return R(o)(r)},catch(o){return this}}}catch(r){return{then(o){return this},catch(o){return R(o)(r)}}}},Fe=(e,t)=>(r,o,s)=>{let n={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:i=>i,version:0,merge:(i,E)=>({...E,...i}),...t},p=!1,m=new Set,u=new Set,d;try{d=n.getStorage()}catch{}if(!d)return e((...i)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...i)},o,s);let l=R(n.serialize),f=()=>{let i=n.partialize({...o()}),E,c=l({state:i,version:n.version}).then(v=>d.setItem(n.name,v)).catch(v=>{E=v});if(E)throw E;return c},_=s.setState;s.setState=(i,E)=>{_(i,E),f()};let S=e((...i)=>{r(...i),f()},o,s),h,a=()=>{var i;if(!d)return;p=!1,m.forEach(c=>c(o()));let E=((i=n.onRehydrateStorage)==null?void 0:i.call(n,o()))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)return n.deserialize(c)}).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var v;return h=n.merge(c,(v=o())!=null?v:S),r(h,!0),f()}).then(()=>{E==null||E(h,void 0),p=!0,u.forEach(c=>c(h))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:i=>{n={...n,...i},i.getStorage&&(d=i.getStorage())},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>a(),hasHydrated:()=>p,onHydrate:i=>(m.add(i),()=>{m.delete(i)}),onFinishHydration:i=>(u.add(i),()=>{u.delete(i)})},a(),h||S},Ge=(e,t)=>(r,o,s)=>{let n={storage:Ve(()=>localStorage),partialize:a=>a,version:0,merge:(a,i)=>({...i,...a}),...t},p=!1,m=new Set,u=new Set,d=n.storage;if(!d)return e((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...a)},o,s);let l=()=>{let a=n.partialize({...o()});return d.setItem(n.name,{state:a,version:n.version})},f=s.setState;s.setState=(a,i)=>{f(a,i),l()};let _=e((...a)=>{r(...a),l()},o,s),S,h=()=>{var a,i;if(!d)return;p=!1,m.forEach(c=>{var v;return c((v=o())!=null?v:_)});let E=((i=n.onRehydrateStorage)==null?void 0:i.call(n,(a=o())!=null?a:_))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var v;return S=n.merge(c,(v=o())!=null?v:_),r(S,!0),l()}).then(()=>{E==null||E(S,void 0),S=o(),p=!0,u.forEach(c=>c(S))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:a=>{n={...n,...a},a.storage&&(d=a.storage)},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>h(),hasHydrated:()=>p,onHydrate:a=>(m.add(a),()=>{m.delete(a)}),onFinishHydration:a=>(u.add(a),()=>{u.delete(a)})},n.skipHydration||h(),S||_},Ue=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((ce.env?ce.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Fe(e,t)):Ge(e,t),le=Ue;var U=require("react");var We=(e,t)=>(r,o,s)=>{let n=o()!==void 0,p=!1,m=new BroadcastChannel(t.name),u=(...l)=>{let f=o();if(r(...l),t.unsync)return;let _=o(),S=Object.entries(_).reduce((h,[a,i])=>(f[a]!==i&&(h={...h,[a]:i}),h),{});m.postMessage(S)};return m.onmessage=l=>{if(l.data.sync===t.name){if(!p)return;let f=Object.entries(o()).reduce((_,[S,h])=>(typeof h!="function"&&typeof h!="symbol"&&(_={..._,[S]:h}),_),{});m.postMessage(f);return}r(l.data),n=!0},n||(()=>{var l;m.postMessage({sync:t.name}),setTimeout(()=>{n||(p=!0,n=!0)},(l=t.mainTimeout)!=null?l:100)})(),e(u,o,s)},de=We;var fe=ue()(de(le((e,t)=>({theme:"",defaultTheme:"",defaultDarkTheme:"dark",defaultLightTheme:"",colorSchemePref:"system",forcedTheme:"",forcedColorScheme:"",setTheme:r=>e({...t(),theme:r}),setDefaultTheme:r=>e({...t(),defaultTheme:r}),setDefaultDarkTheme:r=>e({...t(),defaultDarkTheme:r}),setDefaultLightTheme:r=>e({...t(),defaultLightTheme:r}),setForcedTheme:r=>e({...t(),forcedTheme:r}),setForcedColorScheme:r=>e({...t(),forcedColorScheme:r}),setColorSchemePref:r=>e({...t(),colorSchemePref:r})}),{name:"nextjs-themes"}),{name:"nextjs-themes"}));function Je(e){let[t,r,o,s,n,p,m]=fe(u=>[u.theme,u.defaultTheme,u.defaultDarkTheme,u.defaultLightTheme,u.colorSchemePref,u.forcedTheme,u.forcedColorScheme]);return(0,me.useEffect)(()=>{let u=matchMedia("(prefers-color-scheme: dark)"),d=()=>{let l=Ke(),f="";if(e.forcedTheme!==void 0||p)f=e.forcedTheme||p;else if(m||n)switch(m||n){case"system":f=u.matches?o:s;break;case"dark":f=o;break;case"light":f=s}document.documentElement.setAttribute("data-theme",f||t||r),l()};return u.addEventListener("change",d),d(),()=>{u.removeEventListener("change",d)}},[t,r,o,s,p,n,m,e.forcedTheme]),N.createElement(N.Fragment,null)}var Ke=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}};0&&(module.exports={ThemeSwitcher}); | ||
"use strict";var ve=Object.create;var A=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ee=(e,t)=>{for(var r in t)A(e,r,{get:t[r],enumerable:!0})},W=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pe(t))!_e.call(e,s)&&s!==r&&A(e,s,{get:()=>t[s],enumerable:!(o=Se(t,s))||o.enumerable});return e};var J=(e,t,r)=>(r=e!=null?ve(ye(e)):{},W(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e)),ge=e=>W(A({},"__esModule",{value:!0}),e);var Y=w(X=>{"use strict";var C=require("react");function Te(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oe=typeof Object.is=="function"?Object.is:Te,De=C.useState,be=C.useEffect,we=C.useLayoutEffect,Ce=C.useDebugValue;function Le(e,t){var r=t(),o=De({inst:{value:r,getSnapshot:t}}),s=o[0].inst,n=o[1];return we(function(){s.value=r,s.getSnapshot=t,B(s)&&n({inst:s})},[e,r,t]),be(function(){return B(s)&&n({inst:s}),e(function(){B(s)&&n({inst:s})})},[e]),Ce(r),r}function B(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Oe(e,r)}catch{return!0}}function Ie(e,t){return t()}var Re=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Ie:Le;X.useSyncExternalStore=C.useSyncExternalStore!==void 0?C.useSyncExternalStore:Re});var Z=w(Q=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(f){{for(var y=arguments.length,T=new Array(y>1?y-1:0),g=1;g<y;g++)T[g-1]=arguments[g];o("error",f,T)}}function o(f,y,T){{var g=t.ReactDebugCurrentFrame,D=g.getStackAddendum();D!==""&&(y+="%s",T=T.concat([D]));var b=T.map(function(O){return String(O)});b.unshift("Warning: "+y),Function.prototype.apply.call(console[f],console,b)}}function s(f,y){return f===y&&(f!==0||1/f===1/y)||f!==f&&y!==y}var n=typeof Object.is=="function"?Object.is:s,p=e.useState,v=e.useEffect,S=e.useLayoutEffect,d=e.useDebugValue,i=!1,m=!1;function _(f,y,T){i||e.startTransition!==void 0&&(i=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=y();if(!m){var D=y();n(g,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),m=!0)}var b=p({inst:{value:g,getSnapshot:y}}),O=b[0].inst,L=b[1];return S(function(){O.value=g,O.getSnapshot=y,l(O)&&L({inst:O})},[f,g,y]),v(function(){l(O)&&L({inst:O});var j=function(){l(O)&&L({inst:O})};return f(j)},[f]),d(g),g}function l(f){var y=f.getSnapshot,T=f.value;try{var g=y();return!n(T,g)}catch{return!0}}function h(f,y,T){return y()}var u=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",a=!u,E=a?h:_,c=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E;Q.useSyncExternalStore=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var F=w((Ze,V)=>{"use strict";process.env.NODE_ENV==="production"?V.exports=Y():V.exports=Z()});var te=w(ee=>{"use strict";var x=require("react"),Ae=F();function xe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Me=typeof Object.is=="function"?Object.is:xe,Ne=Ae.useSyncExternalStore,je=x.useRef,ke=x.useEffect,He=x.useMemo,Pe=x.useDebugValue;ee.useSyncExternalStoreWithSelector=function(e,t,r,o,s){var n=je(null);if(n.current===null){var p={hasValue:!1,value:null};n.current=p}else p=n.current;n=He(function(){function S(l){if(!d){if(d=!0,i=l,l=o(l),s!==void 0&&p.hasValue){var h=p.value;if(s(h,l))return m=h}return m=l}if(h=m,Me(i,l))return h;var u=o(l);return s!==void 0&&s(h,u)?h:(i=l,m=u)}var d=!1,i,m,_=r===void 0?null:r;return[function(){return S(t())},_===null?void 0:function(){return S(_())}]},[t,r,o,s]);var v=Ne(e,n[0],n[1]);return ke(function(){p.hasValue=!0,p.value=v},[v]),Pe(v),v}});var ne=w(re=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=require("react"),t=F();function r(i,m){return i===m&&(i!==0||1/i===1/m)||i!==i&&m!==m}var o=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,n=e.useRef,p=e.useEffect,v=e.useMemo,S=e.useDebugValue;function d(i,m,_,l,h){var u=n(null),a;u.current===null?(a={hasValue:!1,value:null},u.current=a):a=u.current;var E=v(function(){var T=!1,g,D,b=function(I){if(!T){T=!0,g=I;var k=l(I);if(h!==void 0&&a.hasValue){var H=a.value;if(h(H,k))return D=H,H}return D=k,k}var he=g,P=D;if(o(he,I))return P;var z=l(I);return h!==void 0&&h(P,z)?P:(g=I,D=z,z)},O=_===void 0?null:_,L=function(){return b(m())},j=O===null?void 0:function(){return b(O())};return[L,j]},[m,_,l,h]),c=E[0],f=E[1],y=s(i,c,f);return p(function(){a.hasValue=!0,a.value=y},[y]),S(y),y}re.useSyncExternalStoreWithSelector=d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var oe=w((rt,G)=>{"use strict";process.env.NODE_ENV==="production"?G.exports=te():G.exports=ne()});var qe={};Ee(qe,{ThemeSwitcher:()=>Je});module.exports=ge(qe);var N=J(require("react")),me=require("react");var q={},K=e=>{let t,r=new Set,o=(S,d)=>{let i=typeof S=="function"?S(t):S;if(!Object.is(i,t)){let m=t;t=(d!=null?d:typeof i!="object")?i:Object.assign({},t,i),r.forEach(_=>_(t,m))}},s=()=>t,v={setState:o,getState:s,subscribe:S=>(r.add(S),()=>r.delete(S)),destroy:()=>{(q.env?q.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(o,s,v),v},$=e=>e?K(e):K;var ie=require("react"),ae=J(oe(),1),M={},{useSyncExternalStoreWithSelector:ze}=ae.default;function Be(e,t=e.getState,r){(M.env?M.env.MODE:void 0)!=="production"&&r&&console.warn("[DEPRECATED] Use `createWithEqualityFn` from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937");let o=ze(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,ie.useDebugValue)(o),o}var se=e=>{(M.env?M.env.MODE:void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t=typeof e=="function"?$(e):e,r=(o,s)=>Be(t,o,s);return Object.assign(r,t),r},ue=e=>e?se(e):se;var ce={};function Ve(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var n;let p=S=>S===null?null:JSON.parse(S,t==null?void 0:t.reviver),v=(n=r.getItem(s))!=null?n:null;return v instanceof Promise?v.then(p):p(v)},setItem:(s,n)=>r.setItem(s,JSON.stringify(n,t==null?void 0:t.replacer)),removeItem:s=>r.removeItem(s)}}var R=e=>t=>{try{let r=e(t);return r instanceof Promise?r:{then(o){return R(o)(r)},catch(o){return this}}}catch(r){return{then(o){return this},catch(o){return R(o)(r)}}}},Fe=(e,t)=>(r,o,s)=>{let n={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:a=>a,version:0,merge:(a,E)=>({...E,...a}),...t},p=!1,v=new Set,S=new Set,d;try{d=n.getStorage()}catch{}if(!d)return e((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...a)},o,s);let i=R(n.serialize),m=()=>{let a=n.partialize({...o()}),E,c=i({state:a,version:n.version}).then(f=>d.setItem(n.name,f)).catch(f=>{E=f});if(E)throw E;return c},_=s.setState;s.setState=(a,E)=>{_(a,E),m()};let l=e((...a)=>{r(...a),m()},o,s),h,u=()=>{var a;if(!d)return;p=!1,v.forEach(c=>c(o()));let E=((a=n.onRehydrateStorage)==null?void 0:a.call(n,o()))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)return n.deserialize(c)}).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return h=n.merge(c,(f=o())!=null?f:l),r(h,!0),m()}).then(()=>{E==null||E(h,void 0),p=!0,S.forEach(c=>c(h))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:a=>{n={...n,...a},a.getStorage&&(d=a.getStorage())},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>u(),hasHydrated:()=>p,onHydrate:a=>(v.add(a),()=>{v.delete(a)}),onFinishHydration:a=>(S.add(a),()=>{S.delete(a)})},u(),h||l},Ge=(e,t)=>(r,o,s)=>{let n={storage:Ve(()=>localStorage),partialize:u=>u,version:0,merge:(u,a)=>({...a,...u}),...t},p=!1,v=new Set,S=new Set,d=n.storage;if(!d)return e((...u)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...u)},o,s);let i=()=>{let u=n.partialize({...o()});return d.setItem(n.name,{state:u,version:n.version})},m=s.setState;s.setState=(u,a)=>{m(u,a),i()};let _=e((...u)=>{r(...u),i()},o,s),l,h=()=>{var u,a;if(!d)return;p=!1,v.forEach(c=>{var f;return c((f=o())!=null?f:_)});let E=((a=n.onRehydrateStorage)==null?void 0:a.call(n,(u=o())!=null?u:_))||void 0;return R(d.getItem.bind(d))(n.name).then(c=>{if(c)if(typeof c.version=="number"&&c.version!==n.version){if(n.migrate)return n.migrate(c.state,c.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return c.state}).then(c=>{var f;return l=n.merge(c,(f=o())!=null?f:_),r(l,!0),i()}).then(()=>{E==null||E(l,void 0),l=o(),p=!0,S.forEach(c=>c(l))}).catch(c=>{E==null||E(void 0,c)})};return s.persist={setOptions:u=>{n={...n,...u},u.storage&&(d=u.storage)},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>h(),hasHydrated:()=>p,onHydrate:u=>(v.add(u),()=>{v.delete(u)}),onFinishHydration:u=>(S.add(u),()=>{S.delete(u)})},n.skipHydration||h(),l||_},Ue=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((ce.env?ce.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Fe(e,t)):Ge(e,t),le=Ue;var U=require("react");var We=(e,t)=>(r,o,s)=>{let n=o()!==void 0,p=!1,v=new BroadcastChannel(t.name),S=(...i)=>{let m=o();if(r(...i),t.unsync)return;let _=o(),l=Object.entries(_).reduce((h,[u,a])=>(m[u]!==a&&(h={...h,[u]:a}),h),{});v.postMessage(l)};return v.onmessage=i=>{if(i.data.sync===t.name){if(!p)return;let m=Object.entries(o()).reduce((_,[l,h])=>(typeof h!="function"&&typeof h!="symbol"&&(_={..._,[l]:h}),_),{});v.postMessage(m);return}r(i.data),n=!0},n||(()=>{var i;v.postMessage({sync:t.name}),setTimeout(()=>{n||(p=!0,n=!0)},(i=t.mainTimeout)!=null?i:100)})(),e(S,o,s)},de=We;var fe=ue()(de(le((e,t)=>({theme:"",defaultTheme:"",defaultDarkTheme:"dark",defaultLightTheme:"",colorSchemePref:"system",forcedTheme:"",forcedColorScheme:"",setTheme:r=>e({...t(),theme:r}),setDefaultTheme:r=>e({...t(),defaultTheme:r}),setDefaultDarkTheme:r=>e({...t(),defaultDarkTheme:r}),setDefaultLightTheme:r=>e({...t(),defaultLightTheme:r}),setForcedTheme:r=>e({...t(),forcedTheme:r}),setForcedColorScheme:r=>e({...t(),forcedColorScheme:r}),setColorSchemePref:r=>e({...t(),colorSchemePref:r})}),{name:"nextjs-themes"}),{name:"nextjs-themes"}));function Je(e){let[t,r,o,s,n,p,v]=fe(i=>[i.theme,i.defaultTheme,i.defaultDarkTheme,i.defaultLightTheme,i.colorSchemePref,i.forcedTheme,i.forcedColorScheme]),S=e.forcedTheme===void 0?p:e.forcedTheme,d=e.forcedColorScheme===void 0?v:e.forcedColorScheme;return(0,me.useEffect)(()=>{let i=matchMedia("(prefers-color-scheme: dark)"),m=()=>{let _=Ke(),l="";if(S)l=S;else if(d||n)switch(d||n){case"system":l=i.matches?o:s;break;case"dark":l=o;break;case"light":l=s}document.documentElement.setAttribute("data-theme",l||t||r),_()};return i.addEventListener("change",m),m(),()=>{i.removeEventListener("change",m)}},[t,r,o,s,S,n,d]),N.createElement(N.Fragment,null)}var Ke=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}};0&&(module.exports={ThemeSwitcher}); | ||
/*! Bundled license information: | ||
@@ -4,0 +4,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138046
894