UNPKG

bknd

Version:

Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.

3 lines 58.1 kB
"use client";
import*as ht from'react';import ht__default,{createContext,forwardRef,useContext,cloneElement,createElement,isValidElement,useState,useRef,useImperativeHandle,useEffect,memo,useCallback,useMemo,Children,Fragment as Fragment$1,useId}from'react';import {useApi}from'bknd/client';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {transform}from'lodash-es';import {useSyncExternalStore}from'use-sync-external-store/shim/index.js';import U1 from'dayjs';import Aa from'dayjs/plugin/weekOfYear.js';import {Switch}from'radix-ui';import {useClickOutside,useInViewport}from'@mantine/hooks';import Tr from'use-sync-external-store/shim/with-selector.js';import {decode}from'hono/jwt';import Qr,{useSWRConfig}from'swr';import $r from'swr/infinite';var G0=Object.create;var c1=Object.defineProperty;var V0=Object.getOwnPropertyDescriptor;var X0=Object.getOwnPropertyNames;var K0=Object.getPrototypeOf,Q0=Object.prototype.hasOwnProperty;var Z0=(t,a)=>()=>(a||t((a={exports:{}}).exports,a),a.exports);var $0=(t,a,r,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of X0(a))!Q0.call(t,e)&&e!==r&&c1(t,e,{get:()=>a[e],enumerable:!(o=V0(a,e))||o.enumerable});return t};var Y0=(t,a,r)=>(r=t!=null?G0(K0(t)):{},$0(c1(r,"default",{value:t,enumerable:true}),t));var _1=Z0((Y2,Ht)=>{var u=String,H1=function(){return {isColorSupported:false,reset:u,bold:u,dim:u,italic:u,underline:u,inverse:u,hidden:u,strikethrough:u,black:u,red:u,green:u,yellow:u,blue:u,magenta:u,cyan:u,white:u,gray:u,bgBlack:u,bgRed:u,bgGreen:u,bgYellow:u,bgBlue:u,bgMagenta:u,bgCyan:u,bgWhite:u,blackBright:u,redBright:u,greenBright:u,yellowBright:u,blueBright:u,magentaBright:u,cyanBright:u,whiteBright:u,bgBlackBright:u,bgRedBright:u,bgGreenBright:u,bgYellowBright:u,bgBlueBright:u,bgMagentaBright:u,bgCyanBright:u,bgWhiteBright:u}};Ht.exports=H1();Ht.exports.createColors=H1;});var Rt=t=>{let[a,r]=useState(),o=useApi(t?.baseUrl);return useEffect(()=>{(async()=>{let e=await o.auth.strategies();e.res.ok&&r(e.body);})();},[t?.baseUrl]),{strategies:a?.strategies,basepath:a?.basepath,loading:!a}};function p1(t){var a,r,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var e=t.length;for(a=0;a<e;a++)t[a]&&(r=p1(t[a]))&&(o&&(o+=" "),o+=r);}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}function ra(){for(var t,a,r=0,o="",e=arguments.length;r<e;r++)(t=arguments[r])&&(a=p1(t))&&(o&&(o+=" "),o+=a);return o}var lt=ra;function g1(t,a){let r=t?.tagName.toLowerCase()??"",o=["input","select","textarea"];return !t||!a?.contains(t)||!o.includes(r)||!("name"in t)||t.hasAttribute("data-ignore")||t.closest("[data-ignore]")}function s1(t){let a=t.currentTarget,r=t.target;return g1(r,a)?null:r}function u1(t,a){let r=t.querySelectorAll(`[name="${a}"]`);return Array.from(r).filter(o=>g1(o))}function v1(t,a){if(!t)return a;let r=t.required;if(!(!a&&!r))if(t.type==="number"){let o=Number(a);if(Number.isNaN(o)&&!r)return;let e="min"in t&&t.min.length>0?Number(t.min):void 0,l="max"in t&&t.max.length>0?Number(t.max):void 0,i="step"in t&&t.step.length>0?Number(t.step):void 0;return e&&o<e?e:l&&o>l?l:i&&i!==1?Math.round(o/i)*i:o}else if(t.type==="text"){let o="maxLength"in t&&t.maxLength>-1?Number(t.maxLength):void 0,e="pattern"in t?new RegExp(t.pattern):void 0;return o&&a.length>o?a.slice(0,o):e&&!e.test(a)?"":a}else return t.type==="checkbox"?"checked"in t?!!t.checked:["on","1","true",1,true].includes(a):a}function Mt(t,a){if(!t)return t;let r=[null,void 0,""],o={empty:a?.empty??r,emptyInArray:a?.emptyInArray??r,keepEmptyArray:a?.keepEmptyArray??false};return Object.entries(t).reduce((e,[l,i])=>{if(i&&Array.isArray(i)&&i.some(h=>typeof h=="object")){let h=i.map(d=>Mt(d,o));(h.length>0||o?.keepEmptyArray)&&(e[l]=h);}else if(i&&typeof i=="object"&&!Array.isArray(i)){let h=Mt(i,o);Object.keys(h).length>0&&(e[l]=h);}else if(Array.isArray(i)){let h=i.filter(d=>!o.emptyInArray.includes(d));(h.length>0||o?.keepEmptyArray)&&(e[l]=h);}else o.empty.includes(i)||(e[l]=i);return e},{})}function At(t,a,r){let o=a;if(typeof o=="string"){let i=h=>h[0]==='"'&&h.at(-1)==='"';o=o.split(/[.\[\]]+/).filter(h=>h).map(h=>Number.isNaN(Number(h))?h:Number(h)).map(h=>typeof h=="string"&&i(h)?h.slice(1,-1):h);}if(o.length===0)throw new Error("The path must have at least one entry in it");let[e,...l]=o;return l.length===0?(t[e]=r,t):(e in t||(t[e]=typeof l[0]=="number"?[]:{}),At(t[e],l,r),t)}function k1({children:t,validateOn:a="submit",hiddenSubmit:r=false,errorFieldSelector:o,reportValidity:e,onSubmit:l,onSubmitInvalid:i,onError:h,clean:d,disableSubmitOnError:s=true,...p}){let n=useRef(null),[g,L]=useState([]);useEffect(()=>{!n.current||p.noValidate||x();},[]),useEffect(()=>{if(!n.current||p.noValidate)return;let M=g.length>0;n.current.querySelectorAll("[type=submit]").forEach(b=>{!b||!("type"in b)||b.type!=="submit"||(b.disabled=M);}),h?.(g);},[g]);let m=(M,b)=>{if(p.noValidate||!M||!("name"in M))return;let k=n.current?.querySelector(o?.(M.name)??`[data-role="input-error"][data-name="${M.name}"]`);if(M.checkValidity())L(B=>B.filter(P=>P.name!==M.name)),k&&(k.textContent="");else {let B={name:M.name,message:M.validationMessage};return L(P=>[...P.filter(V=>V.name!==M.name),B]),b?.report&&(k?k.textContent=B.message:e&&M.reportValidity()),B}},x=M=>{if(!n.current||p.noValidate)return [];let b=[];return n.current.querySelectorAll("input, select, textarea").forEach(k=>{let P=m(k,M);P&&b.push(P);}),s&&n.current.querySelectorAll("[type=submit]").forEach(k=>{b.length>0?k.setAttribute("disabled","disabled"):k.removeAttribute("disabled");}),b},C=()=>{if(!n.current)return {};let M=new FormData(n.current),b={};return M.forEach((k,B)=>{let P=u1(n.current,B);if(P.length===0){console.warn(`No target found for key: ${B}`);return}let $=P.length>1;P.forEach((Q,f)=>{let R=B;$&&(R=`${B}[${f}]`),At(b,R,v1(Q,Q.value));});}),typeof d>"u"?b:Mt(b,d===true?void 0:d)};return jsxs("form",{...p,onChange:async M=>{if(!n.current)return;let k=s1(M);k&&((a==="change"||g.length>0)&&m(k,{report:true}),p.onChange&&await p.onChange(C(),{event:M,key:k.name,value:k.value,errors:g}));},onSubmit:async M=>{M.preventDefault();let b=n.current;if(!b)return;let k=x({report:true});if(k.length>0){i?.(k,{event:M});return}l?await l(C(),{event:M}):b.submit();},ref:n,onKeyDown:M=>{n.current&&M.keyCode===13&&g.length>0&&!p.noValidate&&e&&n.current.reportValidity();},children:[t,r&&jsx("input",{type:"submit",style:{visibility:"hidden"}})]})}function y(...t){return t.filter(Boolean).join(" ")}function f1(t,a){if(t instanceof RegExp)return {keys:false,pattern:t};var r,o,e,l,i=[],h="",d=t.split("/");for(d[0]||d.shift();e=d.shift();)r=e[0],r==="*"?(i.push(r),h+=e[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(o=e.indexOf("?",1),l=e.indexOf(".",1),i.push(e.substring(1,~o?o:~l?l:e.length)),h+=~o&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(h+=(~o?"?":"")+"\\"+e.substring(l))):h+="/"+e;return {keys:i,pattern:new RegExp("^"+h+(a?"(?=$|/)":"/?$"),"i")}}var ha=ht.useInsertionEffect,da=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x1=da?ht.useLayoutEffect:ht.useEffect,na=ha||x1,Ot=t=>{let a=ht.useRef([t,(...r)=>a[0](...r)]).current;return na(()=>{a[0]=t;}),a[1]};var sa="popstate",It="pushState",Nt="replaceState",ua="hashchange",m1=[sa,It,Nt,ua],va=t=>{for(let a of m1)addEventListener(a,t);return ()=>{for(let a of m1)removeEventListener(a,t);}},z1=(t,a)=>useSyncExternalStore(va,t,a),Ma=()=>location.search,y1=({ssrSearch:t=""}={})=>z1(Ma,()=>t),W1=()=>location.pathname,ka=({ssrPath:t}={})=>z1(W1,t?()=>t:W1);var fa=(t,{replace:a=false,state:r=null}={})=>history[a?Nt:It](r,"",t),S1=(t={})=>[ka(t),fa],j1=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[j1]>"u"){for(let t of [It,Nt]){let a=history[t];history[t]=function(){let r=a.apply(this,arguments),o=new Event(t);return o.arguments=arguments,dispatchEvent(o),r};}Object.defineProperty(window,j1,{value:true});}var xa=(t,a)=>a.toLowerCase().indexOf(t.toLowerCase())?"~"+a:a.slice(t.length)||"/",D1=(t="")=>t==="/"?"":t,La=(t,a)=>t[0]==="~"?t.slice(1):D1(a)+t,Ca=(t="",a)=>xa(F1(D1(t)),F1(a));var F1=t=>{try{return decodeURI(t)}catch{return t}};var ba={hook:S1,searchHook:y1,parser:f1,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:t=>t},Ba=createContext(ba),Ut=()=>useContext(Ba),wa={};createContext(wa);var Ta=t=>{let[a,r]=t.hook(t);return [Ca(t.base,a),Ot((o,e)=>r(La(o,t.base),e))]};var P1=forwardRef((t,a)=>{let r=Ut(),[o,e]=Ta(r),{to:l="",href:i=l,onClick:h,asChild:d,children:s,className:p,replace:n,state:g,...L}=t,m=Ot(C=>{C.ctrlKey||C.metaKey||C.altKey||C.shiftKey||C.button!==0||(h?.(C),C.defaultPrevented||(C.preventDefault(),e(i,t)));}),x=r.hrefs(i[0]==="~"?i.slice(1):r.base+i,r);return d&&isValidElement(s)?cloneElement(s,{onClick:m,href:x}):createElement("a",{...L,onClick:m,href:x,className:p?.call?p(o===i):p,children:s,ref:a})});var qt=(t,a)=>typeof t=="string"?[1,"1","true"].includes(t):!!(t||a);function kt(){try{return qt(0)}catch{return  false}}var ma={cli_log_level:{key:"BKND_CLI_LOG_LEVEL",validate:t=>{if(typeof t=="string"&&["log","info","warn","error","debug"].includes(t.toLowerCase()))return t.toLowerCase()}},cli_create_ref:{key:"BKND_CLI_CREATE_REF",validate:t=>typeof t=="string"?t:void 0},cli_telemetry:{key:"BKND_CLI_TELEMETRY",validate:t=>{if(!(typeof t>"u"))return qt(t,true)}},modules_debug:{key:"BKND_MODULES_DEBUG",validate:qt}},R1=(t,a,r)=>{try{let o=r?.source??process.env,e=ma[t],l=o[e.key],i=e.validate(l);if(typeof i<"u")return r?.onValid?.(i),i;r?.onFallback?.(l);}catch{}return a};var I=t=>(kt(),t);var Wa=(t="",a="")=>a.toLowerCase().indexOf(t.toLowerCase())?"~"+a:a.slice(t.length)||"/",O1=(t,a="")=>t[0]==="~"?t.slice(1):a+t;var ja=t=>{try{return decodeURI(t)}catch{return t}},za=t=>{let[a,r]=t.hook(t);return [ja(Wa(t.base,a)),I((o,e)=>r(O1(o,t.base),e))]};function E1({className:t,native:a,onClick:r,...o}){let e=Ut(),[l,i]=za(e);function h(L,m){if(L.startsWith(m)){let x=L.replace(m,"");return x.length===0||x[0]==="/"}return  false}let d=o.href??o.to,s=e.hrefs(d[0]==="~"?d.slice(1):e.base+d,e).replace("//","/"),p=O1(l,e.base).replace("//","/"),n=s.replace(e.base,"").length<=1?s===p:h(p,s);if(a)return jsx("a",{className:`${n?"active ":""}${t}`,...o});let g=L=>{r?.(L);};return jsx(P1,{className:`${n?"active ":""}${t}`,...o,onClick:g})}var Sa={small:"px-2 py-1.5 rounded-md gap-1 text-sm",default:"px-3 py-2.5 rounded-md gap-1.5",large:"px-4 py-3 rounded-md gap-2.5 text-lg"},Fa={small:12,default:16,large:20},Da={default:"bg-primary/5 hover:bg-primary/10 link text-primary/70",primary:"bg-primary hover:bg-primary/80 link text-background",ghost:"bg-transparent hover:bg-primary/5 link text-primary/70",outline:"border border-primary/20 bg-transparent hover:bg-primary/5 link text-primary/80",red:"dark:bg-red-950 dark:hover:bg-red-900 bg-red-100 hover:bg-red-200 link text-primary/70",subtlered:"dark:text-red-700 text-red-700 dark:hover:bg-red-900 dark:hover:text-red-200 bg-transparent hover:bg-red-50 link"},N1=({children:t,size:a,variant:r,IconLeft:o,IconRight:e,iconSize:l=Fa[a??"default"],iconProps:i,labelClassName:h,...d})=>({...d,className:y("flex flex-row flex-nowrap items-center !font-semibold disabled:opacity-50 cursor-pointer disabled:cursor-not-allowed transition-[opacity,background-color,color,border-color]",Sa[a??"default"],Da[r??"default"],d.className),children:jsxs(Fragment,{children:[o&&jsx(o,{size:l,...i}),t&&Children.count(t)===1?jsx("span",{className:y("leading-none",h),children:t}):t,e&&jsx(e,{size:l,...i})]})}),at=forwardRef((t,a)=>jsx("button",{type:"button",ref:a,...N1(t)}));forwardRef((t,a)=>jsx(E1,{ref:a,href:"#",...N1(t)}));U1.extend(Aa);function q1(t){return U1(t).format("YYYY-MM-DD HH:mm:ss")}var O=Y0(_1());function Oa(){try{let t=process||{},a=t.argv||[],r=t.env||{};return !(r.NO_COLOR||a.includes("--no-color"))&&(!!r.FORCE_COLOR||a.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI)}catch{return  false}}var _t={critical:{prefix:"CRT",color:O.default.red,args_color:O.default.red,original:console.error},error:{prefix:"ERR",color:O.default.red,args_color:O.default.red,original:console.error},warn:{prefix:"WRN",color:O.default.yellow,args_color:O.default.yellow,original:console.warn},info:{prefix:"INF",color:O.default.cyan,original:console.info},log:{prefix:"LOG",color:O.default.dim,args_color:O.default.dim,original:console.log},debug:{prefix:"DBG",color:O.default.yellow,args_color:O.default.dim,original:console.debug}};function Ea(t,a){let r=Oa(),o=_t[t],e=o.color(`[${o.prefix}]`),l=a.map(i=>"args_color"in o&&r&&typeof i=="string"?o.args_color(i):i);return o.original(e,O.default.gray(q1()),...l)}var V1=R1("cli_log_level","log"),ft=globalThis.__consoleConfig??={level:V1},G1=Object.keys(_t),Gt=new Proxy(ft,{get:(t,a)=>{switch(a){case "original":return console;case "setLevel":return e=>{ft.level=e;};case "resetLevel":return ()=>{ft.level=V1;}}let r=G1.indexOf(ft.level),o=G1.indexOf(a);return a in _t&&o<=r?(...e)=>Ea(a,e):()=>null}});function X1(){return (navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))!==-1?"Opera":navigator.userAgent.indexOf("Edg")!==-1?"Edge":navigator.userAgent.indexOf("Chrome")!==-1?"Chrome":navigator.userAgent.indexOf("Safari")!==-1?"Safari":navigator.userAgent.indexOf("Firefox")!==-1?"Firefox":navigator.userAgent.indexOf("MSIE")!==-1||document.documentMode?"IE":"unknown"}function Ia(t,a=" "){return !t||t.length===0?t:t.split(a).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(a)}function Na(t){return !t||t.length===0?t:t.split("_").map(a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join(" ")}function K1(t,a=" "){return Ia(Na(t),a)}function Q1(t){return Object.prototype.toString.call(t)==="[object Object]"}function Z1(t,a){let r=new Set(a),o={};for(let[e,l]of Object.entries(t))r.has(e)||(o[e]=l);return o}var Ua={video:["mp4","webm"],audio:["ogg"],image:["jpeg","png","gif","webp","bmp","tiff","avif","heic","heif"],text:["html","css","mdx","yaml","vcard","csv","vtt"],application:["zip","xml","toml","json","json5"],font:["woff","woff2","ttf","otf"]},v={vnd:"vnd.openxmlformats-officedocument",z:"application/x-7z-compressed",t:(t="plain")=>`text/${t}`,a:(t="octet-stream")=>`application/${t}`,i:t=>`image/${t}`,v:t=>`video/${t}`},qa=new Map([["7z",v.z],["7zip",v.z],["ai",v.a("pdf")],["apk",v.a("vnd.android.package-archive")],["doc",v.a("msword")],["docx",`${v.vnd}.wordprocessingml.document`],["eps",v.a("postscript")],["epub",v.a("epub+zip")],["ini",v.t()],["ico",v.i("vnd.microsoft.icon")],["jar",v.a("java-archive")],["jsonld",v.a("ld+json")],["jpg",v.i("jpeg")],["js",v.t("javascript")],["log",v.t()],["m3u",v.t()],["m3u8",v.a("vnd.apple.mpegurl")],["manifest",v.t("cache-manifest")],["md",v.t("markdown")],["mkv",v.v("x-matroska")],["mp3",v.a("mpeg")],["mobi",v.a("x-mobipocket-ebook")],["ppt",v.a("powerpoint")],["pptx",`${v.vnd}.presentationml.presentation`],["qt",v.v("quicktime")],["svg",v.i("svg+xml")],["tif",v.i("tiff")],["tsv",v.t("tab-separated-values")],["tgz",v.a("x-tar")],["txt",v.t()],["text",v.t()],["vcd",v.a("x-cdlink")],["vcs",v.t("x-vcalendar")],["wav",v.a("x-wav")],["webmanifest",v.a("manifest+json")],["xls",v.a("vnd.ms-excel")],["xlsx",`${v.vnd}.spreadsheetml.sheet`],["yml",v.t("yaml")]]);function $1(t){try{let a=t.split(".").pop();if(!a)return v.a();for(let[r,o]of Object.entries(Ua))if(o.includes(a))return `${r}/${a}`;return qa.get(a)}catch{return v.a()}}function Y1(t,a){let r="";function o(e){return e}for(let e in t){let l=t[e];if(l!==void 0)if(Array.isArray(l))for(let i=0;i<l.length;i++)r.length>0&&(r+="&"),r+=`${o(e)}=${o(l[i])}`;else typeof l=="object"&&(l=JSON.stringify(l)),r.length>0&&(r+="&"),r+=`${o(e)}=${o(l)}`;}return ("")+r}function J1(t,a,r){let o=Math.min(a,r),e=Math.max(a,r);return Math.max(o,Math.min(t,e))}var t0={fileSize:(t,a=2)=>{if(t===0)return "0 Bytes";let r=1024,o=a<0?0:a,e=["Bytes","KB","MB","GB","TB"],l=Math.floor(Math.log(t)/Math.log(r));return Number.parseFloat((t/r**l).toFixed(o))+" "+e[l]}};var Vt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Xt=ht__default.createContext&&ht__default.createContext(Vt);var Ha=["attr","size","title"];function _a(t,a){if(t==null)return {};var r=Ga(t,a),o,e;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(e=0;e<l.length;e++)o=l[e],!(a.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(r[o]=t[o]);}return r}function Ga(t,a){if(t==null)return {};var r={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(a.indexOf(o)>=0)continue;r[o]=t[o];}return r}function xt(){return xt=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);}return t},xt.apply(this,arguments)}function r0(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);a&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,o);}return r}function Lt(t){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{};a%2?r0(Object(r),true).forEach(function(o){Va(t,o,r[o]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):r0(Object(r)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o));});}return t}function Va(t,a,r){return a=Xa(a),a in t?Object.defineProperty(t,a,{value:r,enumerable:true,configurable:true,writable:true}):t[a]=r,t}function Xa(t){var a=Ka(t,"string");return typeof a=="symbol"?a:a+""}function Ka(t,a){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var o=r.call(t,a);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return (a==="string"?String:Number)(t)}function o0(t){return t&&t.map((a,r)=>ht__default.createElement(a.tag,Lt({key:r},a.attr),o0(a.child)))}function G(t){return a=>ht__default.createElement(Qa,xt({attr:Lt({},t.attr)},a),o0(t.child))}function Qa(t){var a=r=>{var{attr:o,size:e,title:l}=t,i=_a(t,Ha),h=e||r.size||"1em",d;return r.className&&(d=r.className),t.className&&(d=(d?d+" ":"")+t.className),ht__default.createElement("svg",xt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,i,{className:d,style:Lt(Lt({color:t.color||r.color},r.style),t.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),l&&ht__default.createElement("title",null,l),t.children)};return Xt!==void 0?ht__default.createElement(Xt.Consumer,null,r=>a(r)):a(Vt)}function e0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z"},child:[]},{tag:"path",attr:{d:"M16 3v4"},child:[]},{tag:"path",attr:{d:"M8 3v4"},child:[]},{tag:"path",attr:{d:"M4 11h16"},child:[]},{tag:"path",attr:{d:"M11 15h1"},child:[]},{tag:"path",attr:{d:"M12 15v3"},child:[]}]})(t)}function l0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 9l6 6l6 -6"},child:[]}]})(t)}function i0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]}]})(t)}function h0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6"},child:[]},{tag:"path",attr:{d:"M11 13l9 -9"},child:[]},{tag:"path",attr:{d:"M15 4h5v5"},child:[]}]})(t)}function d0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"},child:[]},{tag:"path",attr:{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"},child:[]},{tag:"path",attr:{d:"M3 3l18 18"},child:[]}]})(t)}function n0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"},child:[]},{tag:"path",attr:{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"},child:[]}]})(t)}function c0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7l16 0"},child:[]},{tag:"path",attr:{d:"M10 11l0 6"},child:[]},{tag:"path",attr:{d:"M14 11l0 6"},child:[]},{tag:"path",attr:{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"},child:[]},{tag:"path",attr:{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"},child:[]}]})(t)}function p0(t){return G({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},child:[]},{tag:"path",attr:{d:"M7 9l5 -5l5 5"},child:[]},{tag:"path",attr:{d:"M12 4l0 12"},child:[]}]})(t)}var $a={xs:{className:"p-0.5",size:13},sm:{className:"p-0.5",size:15},md:{className:"p-1",size:18},lg:{className:"p-1.5",size:22}},dt=forwardRef(({Icon:t,size:a,variant:r="ghost",onClick:o,disabled:e,iconProps:l,...i},h)=>{let d=$a[a??"md"];return jsx(at,{ref:h,variant:r,iconSize:d.size,iconProps:l,IconLeft:t,className:y(d.className,i.className),onClick:o,disabled:e})});var Kt=({error:t,as:a,...r})=>jsx(a||"div",{...r,className:y("flex flex-col gap-1.5",a==="fieldset"&&"border border-primary/10 p-3 rounded-md",a==="fieldset"&&t&&"border-red-500",t&&"text-red-500",r.className)});var Qt=({as:t,...a})=>jsx(t||"label",{...a});var nt=forwardRef((t,a)=>{let r=t.disabled||t.readOnly;return jsx("input",{type:"text",...t,ref:a,className:y("bg-muted/40 h-11 rounded-md py-2.5 px-4 outline-none w-full",r&&"bg-muted/50 text-primary/50",!r&&"focus:bg-muted focus:outline-none focus:ring-2 focus:ring-zinc-500 focus:border-transparent transition-all",t.className)})});forwardRef((t,a)=>t.type==="password"?jsx(Zt,{...t,ref:a}):jsx(nt,{...t,ref:a}));var Zt=forwardRef((t,a)=>{let[r,o]=useState(false);function e(){o(l=>!l);}return jsxs("div",{className:"relative w-full",children:[jsx(nt,{...t,type:r?"text":"password",className:"w-full",ref:a}),jsx("div",{className:"absolute right-3 top-0 bottom-0 flex items-center",children:jsx(dt,{Icon:r?d0:n0,onClick:e,variant:"ghost",className:"opacity-70"})})]})});forwardRef((t,a)=>jsx("textarea",{rows:3,...t,ref:a,className:y("bg-muted/40 min-h-11 rounded-md py-2.5 px-4 focus:bg-muted outline-none focus:outline-none focus:ring-2 focus:ring-zinc-500 focus:border-transparent transition-all disabled:bg-muted/50 disabled:text-primary/50",t.className)}));forwardRef((t,a)=>{let r=useRef(null),o=X1();useImperativeHandle(a,()=>r.current);let e=I(()=>{r?.current&&(r.current.focus(),["Safari"].includes(o)?r.current.click():r.current.showPicker());});return jsxs("div",{className:"relative w-full",children:[jsx("div",{className:"absolute h-full right-3 top-0 bottom-0 flex items-center",children:jsx(dt,{Icon:e0,onClick:e})}),jsx(nt,{...t,type:t.type??"date",ref:r,className:"w-full appearance-none"})]})});forwardRef((t,a)=>{let[r,o]=useState(!!t.value);useEffect(()=>{o(!!t.value);},[t.value]);function e(l){o(l.target.checked),t.onChange?.(l.target.checked);}return jsx("div",{className:"h-11 flex items-center",children:jsx("input",{...t,type:"checkbox",ref:a,className:"outline-none focus:outline-none focus:ring-2 focus:ring-zinc-500  transition-all disabled:opacity-70 scale-150 ml-1",checked:r,onChange:e,disabled:t.disabled})})});var s0={xs:{root:"h-5 w-8",thumb:"data-[state=checked]:left-[calc(100%-1rem)]"},sm:{root:"h-6 w-10",thumb:"data-[state=checked]:left-[calc(100%-1.25rem)]"},md:{root:"h-7 w-12",thumb:"data-[state=checked]:left-[calc(100%-1.5rem)]"}};forwardRef(({type:t,required:a,...r},o)=>jsx(Switch.Root,{className:lt("relative cursor-pointer rounded-full bg-muted border-2 border-transparent outline-none ring-1 dark:ring-primary/10 ring-primary/20 data-[state=checked]:ring-primary/60 data-[state=checked]:bg-primary/60 appearance-none transition-colors hover:bg-muted/80",s0[r.size??"md"].root,r.disabled&&"opacity-50 !cursor-not-allowed"),onCheckedChange:e=>{console.log("setting",e),r.onChange?.({target:{value:e}});},...r,checked:typeof r.checked<"u"?r.checked:typeof r.value<"u"?!!r.value:void 0,ref:o,children:jsx(Switch.Thumb,{className:lt("absolute top-0 left-0 h-full aspect-square rounded-full bg-primary/30 data-[state=checked]:bg-background transition-[left,right] duration-100 border border-muted",s0[r.size??"md"].thumb)})}));forwardRef(({children:t,options:a,...r},o)=>jsxs("div",{className:"flex w-full relative",children:[jsx("select",{...r,ref:o,className:y("bg-muted/40 focus:bg-muted rounded-md py-2.5 px-4 outline-none focus:outline-none focus:ring-2 focus:ring-zinc-500 focus:border-transparent transition-all disabled:bg-muted/50 disabled:text-primary/50","appearance-none h-11 w-full",!r.multiple&&"border-r-8 border-r-transparent",r.className),children:a?jsxs(Fragment,{children:[!r.required&&jsx("option",{value:""}),a.map(e=>typeof e!="object"?{value:e,label:String(e)}:e).map(e=>jsx("option",{value:e.value,children:e.label},e.value))]}):t}),!r.multiple&&jsx(l0,{className:"absolute right-3 top-0 bottom-0 h-full opacity-70 pointer-events-none",size:18})]}));function bt({label:t,provider:a,icon:r,action:o,method:e="POST",basepath:l="/api/auth",children:i}){let h=[l,a,o].join("/");return jsxs("form",{method:e,action:h,className:"w-full",children:[jsxs(at,{type:"submit",size:"large",variant:"outline",className:"justify-center w-full",IconLeft:r,children:["Continue with ",t??K1(a)]}),i]})}function Bt({formData:t,className:a,method:r="POST",action:o,auth:e,buttonLabel:l=o==="login"?"Sign in":"Sign up",...i}){let h=e?.basepath??"/api/auth",d={action:`${h}/password/${o}`,strategy:e?.strategies?.password??{}},s=transform(e?.strategies??{},(n,g,L)=>{g.type!=="password"&&(n[L]=g.config);},{}),p=Object.keys(s).length>0;return jsxs("div",{className:"flex flex-col gap-4 w-full",children:[p&&jsxs(Fragment,{children:[jsx("div",{children:Object.entries(s)?.map(([n,g],L)=>jsx(bt,{provider:n,method:r,basepath:h,action:o},L))}),jsx(er,{})]}),jsxs(k1,{method:r,action:d.action,...i,validateOn:"change",className:lt("flex flex-col gap-3 w-full",a),children:[jsxs(Kt,{children:[jsx(Qt,{htmlFor:"email",children:"Email address"}),jsx(nt,{type:"email",name:"email",required:true})]}),jsxs(Kt,{children:[jsx(Qt,{htmlFor:"password",children:"Password"}),jsx(Zt,{name:"password",required:true,minLength:8})]}),jsx(at,{type:"submit",variant:"primary",size:"large",className:"w-full mt-2 justify-center",children:l})]})]})}var er=()=>jsxs("div",{className:"w-full flex flex-row items-center",children:[jsx("div",{className:"relative flex grow",children:jsx("div",{className:"h-px bg-primary/10 w-full absolute top-[50%] z-0"})}),jsx("div",{className:"mx-5",children:"or"}),jsx("div",{className:"relative flex grow",children:jsx("div",{className:"h-px bg-primary/10 w-full absolute top-[50%] z-0"})})]});function M0({method:t="POST",action:a="login",logo:r,intro:o,formOnly:e}){let{strategies:l,basepath:i,loading:h}=Rt(),d=jsx(Bt,{auth:{basepath:i,strategies:l},method:t,action:a});return e?h?null:d:jsx("div",{className:"flex flex-1 flex-col select-none h-dvh w-dvw justify-center items-center bknd-admin",children:!h&&jsxs("div",{className:"flex flex-col gap-4 items-center w-96 px-6 py-7",children:[r||null,isValidElement(o)?o:jsxs("div",{className:"flex flex-col items-center",children:[jsxs("h1",{className:"text-xl font-bold",children:["Sign ",a==="login"?"in":"up"," to your admin panel"]}),jsx("p",{className:"text-primary/50",children:"Enter your credentials below to get access."})]}),d]})})}var ce={Screen:M0,Form:Bt,SocialLink:bt};function k0(){let t=useRef(0);return t.current++,t.current}function f0({children:t,defaultOpen:a=false,openEvent:r="onClick",position:o="bottom-start",dropdownWrapperProps:e,items:l,title:i,hideOnEmpty:h=true,onClickItem:d,renderItem:s,itemsClassName:p,className:n}){let[g,L]=useState(a),[m,x]=useState(o),C=useClickOutside(()=>L(false)),U=l.filter(Boolean),[H,_]=useState(0),M=I((f=50)=>setTimeout(()=>L(R=>!R),typeof f=="number"?f:0)),b=r==="onClick"?f=>{f.stopPropagation(),M();}:void 0,k=I(f=>{if(r!=="onContextMenu")return;if(f.preventDefault(),g){M(0),setTimeout(()=>{x(o),_(0);},10);return}let R=f.clientX-f.currentTarget.getBoundingClientRect().left,{left:q=0,right:Y=0}=C.current?.getBoundingClientRect()??{};if(q>0&&Y>0){let ut=J1(R,q,Y);R<(q+Y)/2?(x("bottom-start"),_(ut)):(x("bottom-end"),_(Y-ut));}else x(o),_(0);M();}),B=4,P={"bottom-start":{top:"100%",left:H,marginTop:B},"bottom-end":{right:H,top:"100%",marginTop:B},"top-start":{bottom:"100%",marginBottom:B},"top-end":{bottom:"100%",right:H,marginBottom:B}}[m],V=I(f=>{f.onClick&&f.onClick(),d&&d(f),M(50);});if(U.length===0&&h)return null;let $=U.some(f=>"icon"in f&&f.icon),Q=s||((f,{key:R,onClick:q})=>typeof f=="function"?jsx(Fragment$1,{children:f()},R):jsxs("button",{type:"button",disabled:f.disabled,className:y("flex flex-row flex-nowrap text-nowrap items-center outline-none cursor-pointer px-2.5 rounded-md link leading-none h-8",p,f.disabled?"opacity-50 cursor-not-allowed":"hover:bg-primary/10",f.destructive&&"text-red-500 hover:bg-red-600 hover:text-white"),onClick:q,title:f.title,children:[$&&jsx("div",{className:"size-[16px] text-left mr-1.5 opacity-80",children:f.icon&&jsx(f.icon,{className:"size-[16px]"})}),jsx("div",{className:"flex flex-grow truncate text-nowrap",children:f.label})]},R));return jsxs("div",{role:"dropdown",className:y("relative flex",n),ref:C,onContextMenu:k,children:[cloneElement(t,{onClick:b}),g&&jsxs("div",{...e,className:y("absolute z-30 flex flex-col bg-background border border-muted px-1 py-1 rounded-lg shadow-lg min-w-full",e?.className),style:P,children:[i&&jsx("div",{className:"text-sm font-bold px-2.5 mb-1 mt-1 opacity-50 truncate",children:i}),U.map((f,R)=>Q(f,{key:R,onClick:q=>{q.stopPropagation(),V(f);}}))]})]})}var pr=[".DS_Store","Thumbs.db"];function pt(t,a){let r=gr(t);if(typeof r.path!="string"){let{webkitRelativePath:o}=t;Object.defineProperty(r,"path",{value:typeof a=="string"?a:typeof o=="string"&&o.length>0?o:t.name,writable:false,configurable:false,enumerable:true});}return r}function gr(t){let{name:a}=t,r=a&&a.lastIndexOf(".")!==-1;if(console.log("withMimeType",a,r),r&&!t.type){let o=$1(a);console.log("guessed",o),o&&Object.defineProperty(t,"type",{value:o,writable:false,configurable:false,enumerable:true});}return t}async function gt(t){return wt(t)&&sr(t.dataTransfer)?kr(t.dataTransfer,t.type):ur(t)?vr(t):Array.isArray(t)&&t.every(a=>"getFile"in a&&typeof a.getFile=="function")?Mr(t):[]}function sr(t){return wt(t)}function ur(t){return wt(t)&&wt(t.target)}function wt(t){return typeof t=="object"&&t!==null}function vr(t){return a1(t.target.files).map(a=>pt(a))}async function Mr(t){return (await Promise.all(t.map(r=>r.getFile()))).map(r=>pt(r))}async function kr(t,a){if(t.items){let r=a1(t.items).filter(e=>e.kind==="file");if(a!=="drop")return r;let o=await Promise.all(r.map(fr));return x0(C0(o))}return x0(a1(t.files).map(r=>pt(r)))}function x0(t){return t.filter(a=>pr.indexOf(a.name)===-1)}function a1(t){if(t===null)return [];let a=[];for(let r=0;r<t.length;r++){let o=t[r];a.push(o);}return a}function fr(t){if(typeof t.webkitGetAsEntry!="function")return L0(t);let a=t.webkitGetAsEntry();return a?.isDirectory?b0(a):L0(t)}function C0(t){return t.reduce((a,r)=>[...a,...Array.isArray(r)?C0(r):[r]],[])}function L0(t){let a=t.getAsFile();if(!a)return Promise.reject(`${t} is not a File`);let r=pt(a);return Promise.resolve(r)}async function xr(t){return t.isDirectory?b0(t):Lr(t)}function b0(t){let a=t.createReader();return new Promise((r,o)=>{let e=[];function l(){a.readEntries(async i=>{if(i.length){let h=Promise.all(i.map(xr));e.push(h),l();}else try{let h=await Promise.all(e);r(h);}catch(h){o(h);}},i=>{o(i);});}l();})}async function Lr(t){return new Promise((a,r)=>{t.file(o=>{let e=pt(o,t.fullPath);a(e);},o=>{r(o);});})}var r1={enter:["dragenter","dragover","dragstart"],leave:["dragleave","drop"]},w0=[...r1.enter,...r1.leave];function T0({onDropped:t,onOver:a,onLeave:r}){let[o,e]=useState(false),l=useRef(null),i=useRef(false),h=useCallback(n=>{n.preventDefault(),n.stopPropagation();},[]),d=useCallback(async n=>{let g=r1.enter.includes(n.type);a&&g!==o&&!i.current&&(a(await gt(n),n),i.current=true),e(g),g===false&&i.current&&(i.current=false,r?.());},[]),s=useCallback(async n=>{let g=await gt(n);t?.(g),i.current=false;},[t]),p=useCallback(async n=>{let g=await gt(n);t?.(g);},[t]);return useEffect(()=>{let n=l.current;return w0.forEach(g=>{n.addEventListener(g,h),n.addEventListener(g,d);}),n.addEventListener("drop",s),()=>{w0.forEach(g=>{n.removeEventListener(g,h),n.removeEventListener(g,d);}),n.removeEventListener("drop",s);}},[]),{ref:l,isOver:o,fromEvent:gt,onDropped:t,handleFileInputChange:p}}function Br(t,a={overrides:{},baseUrl:""}){return {body:`${a.baseUrl}/api/media/file/${t.path}`,path:t.path,name:t.path,size:t.size??0,type:t.mime_type??"",state:"uploaded",progress:0,...a.overrides}}function m0(t,a={overrides:{},baseUrl:""}){return t.map(r=>Br(r,a))}function o1({maxItems:t,current:a=0,overwrite:r,added:o}){if(!t)return {reject:false,to_drop:0};let e=t-a,l=o>e?o:o-e>0?o-e:0;return {reject:r?o>t:e-o<0,to_drop:l}}var W0=t=>{let a,r=new Set,o=(p,n)=>{let g=typeof p=="function"?p(a):p;if(!Object.is(g,a)){let L=a;a=n??(typeof g!="object"||g===null)?g:Object.assign({},a,g),r.forEach(m=>m(a,L));}},e=()=>a,d={setState:o,getState:e,getInitialState:()=>s,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(import.meta.env?import.meta.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();}},s=a=t(o,e,d);return d},j0=t=>t?W0(t):W0;var {useDebugValue:mr}=ht__default,{useSyncExternalStoreWithSelector:Wr}=Tr,jr=t=>t;function A(t,a=jr,r){(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&r;let o=Wr(t.subscribe,t.getState,t.getServerState||t.getInitialState,a,r);return mr(o),o}var y0=(t,a)=>(...r)=>Object.assign({},t,a(...r));var S0=()=>j0(y0({files:[],isOver:false,isOverAccepted:false,uploading:false},(t,a)=>({setFiles:r=>t(({files:o})=>({files:r(o)})),getFilesLength:()=>a().files.length,setIsOver:(r,o)=>t({isOver:r,isOverAccepted:o}),setUploading:r=>t({uploading:r}),setIsOverAccepted:r=>t({isOverAccepted:r}),reset:()=>t({files:[],isOver:false,isOverAccepted:false}),addFile:r=>t(o=>({files:[...o.files,r]})),removeFile:r=>t(o=>({files:o.files.filter(e=>e.path!==r)})),removeAllFiles:()=>t({files:[]}),setFileProgress:(r,o)=>t(e=>({files:e.files.map(l=>l.path===r?{...l,progress:o}:l)})),setFileState:(r,o,e)=>t(l=>({files:l.files.map(i=>i.path===r?{...i,state:o,progress:e??i.progress}:i)}))})));function Sr(t){if(t&&t instanceof XMLHttpRequest){let a=JSON.parse(t.responseText);alert(`Upload failed with code ${t.status}: ${a.error}`);}else alert("Upload failed");}function R0({getUploadInfo:t,handleDelete:a,initialItems:r=[],flow:o="start",allowedMimeTypes:e,maxItems:l,overwrite:i,autoUpload:h,placeholder:d,onRejected:s,onDeleted:p,onUploadedAll:n,onUploaded:g,children:L,onClick:m,footer:x}){let C=useRef(S0()).current,U=A(C,c=>c.files),H=A(C,c=>c.setFiles),_=A(C,c=>c.getFilesLength),M=A(C,c=>c.setUploading),b=A(C,c=>c.setIsOver),k=A(C,c=>c.uploading),B=A(C,c=>c.setFileState),P=A(C,c=>c.removeFile),V=useRef(null);useEffect(()=>{H(()=>r);},[r.length]);function $(c){return (Array.isArray(c)?c:[c]).map(W=>({kind:"kind"in W?W.kind:"file",type:W.type,size:"size"in W?W.size:0})).every(W=>W.kind!=="file"?false:!(e&&!e.includes(W.type)))}let Q=useCallback(c=>{if(console.log("onDropped",c),!$(c))return;let F=c.length;H(D=>{let W=0;if(l){let j=o1({maxItems:l,overwrite:i,added:F,current:D.length});if(j.reject)return s?s(c):console.warn("maxItems reached"),D;W=j.to_drop;}let J=D.slice(W),vt=J.map(j=>j.path),et=c.filter(j=>!("path"in j)||j.path&&!vt.includes(j.path)).map(j=>({body:j,path:"path"in j?j.path:j.name,name:j.name,size:j.size,type:j.type,state:"pending",progress:0})),z=o==="start"?[...et,...J]:[...J,...et];return h&&et.length>0&&setTimeout(()=>M(true),0),z});},[h,o,l,i]),{handleFileInputChange:f,ref:R}=T0({onDropped:c=>{console.log("onDropped",c),Q(c);},onOver:c=>{if(!$(c)){b(true,false);return}let F=_(),D=o1({maxItems:l,overwrite:i,added:c.length,current:F});console.log("--files in onOver",F,D),b(true,!D.reject);},onLeave:()=>{b(false,false);}});useEffect(()=>{console.log("files updated");},[U]),useEffect(()=>{k&&(async()=>{let c=U.filter(F=>F.state==="pending");if(c.length===0){M(false);return}else {let F=[];for(let D of c)try{let W=await q(D);F.push(W),g?.(W);}catch(W){Sr(W);}M(false),n?.(F);}})();},[k]);function q(c){return new Promise((F,D)=>{if(c.body){if(c.state!=="pending"){console.error("File is not pending"),D();return}else if(!(c.body instanceof File)){console.error("File body is not a File instance"),D();return}}else {console.error("File has no body"),D();return}let W=t({path:c.body.path});console.log("dropzone:uploadInfo",W);let{url:J,headers:vt,method:et="POST"}=W,z=new XMLHttpRequest;console.log("xhr:url",J);let j=new URLSearchParams;i&&j.append("overwrite","1"),z.open(et,String(J)+"?"+String(j),true),vt&&vt.forEach((S,tt)=>{z.setRequestHeader(tt,S);}),z.upload.addEventListener("progress",S=>{if(console.log("progress",S.loaded,S.total),S.lengthComputable){B(c.path,"uploading",S.loaded/S.total);let tt=S.loaded/S.total*100;console.log(`Progress: ${tt.toFixed(2)}%`);}else console.log("Unable to compute progress information since the total size is unknown");}),z.onload=()=>{if(console.log("onload",c.path,z.status),z.status>=200&&z.status<300){console.log("Upload complete");try{let S=JSON.parse(z.responseText);console.log("Response:",c,S);let tt={...S.state,progress:1,state:"uploaded"};B(c.path,tt.state),F({...S,...c,...tt});}catch(S){B(c.path,"uploaded",1),console.error("Error parsing response",S),D(S);}}else B(c.path,"failed",1),console.error("Upload failed with status: ",z.status,z.statusText),D(z);},z.onerror=()=>{console.error("Error during the upload process.");},z.onloadstart=()=>{B(c.path,"uploading",0),console.log("loadstart");},z.setRequestHeader("Accept","application/json"),z.send(c.body);})}let Y=useCallback(async c=>{switch(console.log("deleteFile",c),c.state){case "uploaded":case "initial":window.confirm("Are you sure you want to delete this file?")&&(console.log('setting state to "deleting"',c),B(c.path,"deleting"),await a(c),P(c.path),p?.(c));break}},[]),ut=useCallback(async c=>{let F=await q(c);n?.([F]),g?.(F);},[]),H0=useCallback(()=>V.current?.click(),[V]),_0=useMemo(()=>!!(d?.show===true||!l||l&&U.length<l),[d,l,U.length]),Pt=useMemo(()=>({store:C,wrapperRef:R,inputProps:{ref:V,type:"file",multiple:!l||l>1,onChange:f},showPlaceholder:_0,actions:{uploadFile:ut,deleteFile:Y,openFileInput:H0,addFiles:Q},dropzoneProps:{maxItems:l,placeholder:d,autoUpload:h,flow:o},onClick:m,footer:x}),[l,o,d,h,x]);return jsx(A0.Provider,{value:Pt,children:L?typeof L=="function"?L(Pt):L:jsx(O0,{...Pt})})}var A0=createContext(void 0);function Wt(){return useContext(A0)}var jt=()=>{let{store:t}=Wt(),a=A(t,l=>l.files),r=A(t,l=>l.isOver),o=A(t,l=>l.isOverAccepted),e=A(t,l=>l.uploading);return {files:a,isOver:r,isOverAccepted:o,uploading:e}},Z=(t,a)=>{let{store:r}=Wt();return A(r,o=>{let e=typeof t=="string"?o.files.find(l=>l.path===t):o.files.find(l=>l.path===t.path);return e?a(e):void 0})};function Dr(t){if(t&&t instanceof XMLHttpRequest){let a=JSON.parse(t.responseText);alert(`Upload failed with code ${t.status}: ${a.error}`);}else alert("Upload failed");}var O0=({wrapperRef:t,inputProps:a,showPlaceholder:r,actions:{uploadFile:o,deleteFile:e,openFileInput:l},dropzoneProps:{placeholder:i,flow:h},onClick:d,footer:s})=>{let{files:p,isOver:n,isOverAccepted:g}=jt(),L=r&&jsx(Pr,{onClick:l,text:i?.text}),m=useCallback(async x=>{try{return await o(x)}catch(C){Dr(C);}},[o]);return jsxs("div",{ref:t,className:y("dropzone w-full h-full align-start flex flex-col select-none",n&&g&&"bg-green-200/10",n&&!g&&"bg-red-200/40 cursor-not-allowed"),children:[jsx("div",{className:"hidden",children:jsx("input",{...a})}),jsx("div",{className:"flex flex-1 flex-col",children:jsxs("div",{className:"flex flex-row flex-wrap gap-2 md:gap-3",children:[h==="start"&&L,p.map(x=>jsx(Ar,{file:x,handleUpload:m,handleDelete:e,onClick:d},x.path)),h==="end"&&L,s]})})]})},Pr=({onClick:t,text:a="Upload files"})=>jsx("div",{className:"w-[49%] aspect-square md:w-60 flex flex-col border-2 border-dashed border-muted relative justify-center items-center text-primary/30 hover:border-primary/30 hover:text-primary/50 hover:cursor-pointer hover:bg-muted/20 transition-colors duration-200",onClick:t,children:jsx("span",{className:"",children:a})}),Rr=({file:t,fallback:a,...r})=>t.type.startsWith("image/")?jsx(Nr,{...r,file:t}):t.type.startsWith("video/")?jsx(Ur,{...r,file:t}):a?a({file:t}):null,i1=memo(Rr,(t,a)=>t.file.path===a.file.path),Ar=memo(({file:t,handleUpload:a,handleDelete:r,onClick:o})=>{k0();let l=Z(t,h=>{let{progress:d,...s}=h;return s});if(!l)return null;let i=useCallback(()=>{o&&o(l);},[o,l.path]);return jsxs("div",{className:y("w-[49%] md:w-60 aspect-square flex flex-col border border-muted relative hover:bg-primary/5 cursor-pointer transition-colors",l.state==="failed"&&"border-red-500 bg-red-200/20",l.state==="deleting"&&"opacity-70"),onClick:i,children:[jsx("div",{className:"absolute top-2 right-2",children:jsx(Er,{file:l,handleDelete:r,handleUpload:a})}),jsx(Or,{file:l}),jsx("div",{className:"flex bg-primary/5 aspect-[1/0.78] overflow-hidden items-center justify-center",children:jsx(i1,{file:l,fallback:qr,className:"max-w-full max-h-full"})}),jsxs("div",{className:"flex flex-col px-1.5 py-1",children:[jsxs("div",{className:"flex flex-row gap-2 items-center",children:[jsx("p",{className:"truncate select-text w-[calc(100%-10px)]",children:l.name}),jsx(Ir,{file:l})]}),jsxs("div",{className:"flex flex-row justify-between text-sm font-mono opacity-50 text-nowrap gap-2",children:[jsx("span",{className:"truncate select-text",children:l.type}),jsx("span",{children:t0.fileSize(l.size)})]})]})]})},(t,a)=>t.file.path===a.file.path&&t.file.state===a.file.state),Or=({file:t})=>{let a=Z(t.path,r=>({state:r.state,progress:r.progress}));return !a||a.state!=="uploading"?null:jsx("div",{className:"absolute w-full top-0 left-0 right-0 h-1",children:jsx("div",{className:"bg-blue-600 h-1 transition-all duration-75",style:{width:(a.progress*100).toFixed(0)+"%"}})})},Er=memo(({file:t,handleDelete:a,handleUpload:r})=>{let o=Z(t.path,l=>{let{progress:i,...h}=l;return h});if(!o)return null;let e=useMemo(()=>[o.state==="uploaded"&&typeof o.body=="string"&&{label:"Open",icon:h0,onClick:()=>{window.open(o.body,"_blank");}},["initial","uploaded"].includes(o.state)&&{label:"Delete",destructive:true,icon:c0,onClick:()=>a(o)},["initial","pending"].includes(o.state)&&{label:"Upload",icon:p0,onClick:()=>r(o)}],[o,a,r]);return jsx(f0,{items:e,position:"bottom-end",children:jsx(dt,{Icon:i0})})},(t,a)=>t.file.path===a.file.path),Ir=({file:t})=>{let a=Z(t.path,o=>o.state);if(!a||a==="uploaded")return null;let r={failed:"bg-red-500",deleting:"bg-orange-500 animate-pulse",uploading:"bg-blue-500 animate-pulse"}[a]??"bg-primary/50";return jsx("div",{className:"w-2 h-2 rounded-full mt-px "+r,title:a})},Nr=({file:t,...a})=>{let r=typeof t.body=="string"?t.body:URL.createObjectURL(t.body);return jsx("img",{...a,src:r})},Ur=({file:t,...a})=>{let r=typeof t.body=="string"?t.body:URL.createObjectURL(t.body);return jsx("video",{...a,src:r})},qr=({file:t})=>jsx("div",{className:"text-xs text-primary/50 text-center",children:t.type});var N=class{constructor(a={},r){this._options=a;this.fetcher=r??fetch;}fetcher;getDefaultOptions(){return {}}get options(){return {host:"http://localhost",token:void 0,...this.getDefaultOptions(),...this._options}}key(){return this.options.basepath??""}getUrl(a){let r=this.options.basepath??"";return this.options.host+(r+"/"+a).replace(/\/{2,}/g,"/").replace(/\/$/,"")}request(a,r,o){let e=o?.method??"GET",l=Array.isArray(a)?a.join("/"):a,i=this.getUrl(l);r instanceof URLSearchParams?i+="?"+r.toString():typeof r=="object"&&Object.keys(r).length>0&&(i+="?"+Y1(r));let h=new Headers(this.options.headers??{});for(let[p,n]of Object.entries(o?.headers??{}))h.set(p,n);h.has("Accept")||h.set("Accept","application/json"),this.options.token&&this.options.token_transport==="header"&&h.set("Authorization",`Bearer ${this.options.token}`);let d=o?.body;if(o&&"body"in o&&["POST","PATCH","PUT"].includes(e)){let p=h.get("Content-Type")??void 0;(!p||p.startsWith("application/json")||Q1(d))&&(d=JSON.stringify(o.body),h.set("Content-Type","application/json"));}let s=new Request(i,{...o,method:e,body:d,headers:h});return new st(s,{fetcher:this.fetcher,verbose:this.options.verbose})}get(a,r,o){return this.request(a,r,{...o,method:"GET"})}post(a,r,o){return this.request(a,void 0,{...o,body:r,method:"POST"})}patch(a,r,o){return this.request(a,void 0,{...o,body:r,method:"PATCH"})}put(a,r,o){return this.request(a,void 0,{...o,body:r,method:"PUT"})}delete(a,r,o){return this.request(a,void 0,{...o,body:r,method:"DELETE"})}};function Hr(t,a,r){let o=typeof r<"u"?r:a,e=["raw","body","ok","status","res","data","toJSON"];return typeof o!="object"&&(o={}),new Proxy(o,{get(l,i,h){return i==="raw"||i==="res"?t:i==="body"?a:i==="data"?r:i==="ok"?t.ok:i==="status"?t.status:i==="toJSON"?()=>l:Reflect.get(l,i,h)},has(l,i){return e.includes(i)?true:Reflect.has(l,i)},ownKeys(l){return Array.from(new Set([...Reflect.ownKeys(l),...e]))},getOwnPropertyDescriptor(l,i){return e.includes(i)?{configurable:true,enumerable:true,value:Reflect.get({raw:t,body:a,ok:t.ok,status:t.status},i)}:Reflect.getOwnPropertyDescriptor(l,i)}})}var st=class t{constructor(a,r,o){this.request=a;this.options=r;this.refineData=o;}[Symbol.toStringTag];get verbose(){return this.options?.verbose??false}refine(a){return new t(this.request,this.options,a)}async execute(){kt()&&await new Promise(i=>setTimeout(i,200));let a=this.options?.fetcher??fetch;this.verbose&&Gt.debug("[FetchPromise] Request",{method:this.request.method,url:this.request.url});let r=await a(this.request);this.verbose&&Gt.debug("[FetchPromise] Response",{res:r,ok:r.ok,status:r.status});let o,e,l=r.headers.get("Content-Type")??"";if(l.startsWith("application/json")?(o=await r.json(),typeof o=="object"&&(e="data"in o?o.data:o)):l.startsWith("text")?o=await r.text():o=r.body,this.refineData)try{e=this.refineData(e);}catch(i){console.warn("[FetchPromise] Error in refineData",i),e=void 0;}return Hr(r,o,e)}then(a,r){return this.execute().then(a,r)}catch(a){return this.then(void 0,a)}finally(a){return this.then(r=>(a?.(),r),r=>{throw a?.(),r})}path(){return new URL(this.request.url).pathname}key(a){let r=new URL(this.request.url);return a?.search!==false?this.path()+r.search:this.path()}keyArray(a){let r=new URL(this.request.url),o=this.path().split("/");return (a?.search!==false?[...o,r.searchParams.toString()]:o).filter(Boolean)}toString(){return this.key({search:true})}toJSON(){return {url:this.request.url,method:this.request.method}}};var zt=class extends N{getDefaultOptions(){return {basepath:"/api/auth",credentials:"include"}}async login(a,r){let o=await this.post([a,"login"],r,{credentials:this.options.credentials});return o.ok&&o.body.token&&await this.options.onTokenUpdate?.(o.body.token),o}async register(a,r){let o=await this.post([a,"register"],r,{credentials:this.options.credentials});return o.ok&&o.body.token&&await this.options.onTokenUpdate?.(o.body.token),o}async actionSchema(a,r){return this.get([a,"actions",r,"schema.json"])}async action(a,r,o){return this.post([a,"actions",r],o)}async loginWithPassword(a){return this.login("password",a)}async registerWithPassword(a){return this.register("password",a)}me(){return this.get(["me"])}strategies(){return this.get(["strategies"])}async logout(){await this.options.onTokenUpdate?.(void 0);}};var yt=class extends N{getDefaultOptions(){return {basepath:"/api/data",queryLengthLimit:1e3,defaultQuery:{limit:10}}}requireObjectSet(a,r){if(!a||typeof a!="object"||Object.keys(a).length===0)throw new Error(r??"object is required")}readOne(a,r,o={}){return this.get(["entity",a,r],o)}readOneBy(a,r={}){return this.readMany(a,{...r,limit:1,offset:0}).refine(o=>o[0])}readMany(a,r={}){let o=r??this.options.defaultQuery,e=this.get(["entity",a],o);return e.request.url.length<=this.options.queryLengthLimit?e:this.post(["entity",a,"query"],o)}readManyByReference(a,r,o,e={}){return this.get(["entity",a,r,o],e??this.options.defaultQuery)}createOne(a,r){return this.post(["entity",a],r)}createMany(a,r){if(!r||!Array.isArray(r)||r.length===0)throw new Error("input is required");return this.post(["entity",a],r)}updateOne(a,r,o){if(!r)throw new Error("ID is required");return this.patch(["entity",a,r],o)}updateMany(a,r,o){return this.requireObjectSet(r),this.patch(["entity",a],{update:o,where:r})}deleteOne(a,r){if(!r)throw new Error("ID is required");return this.delete(["entity",a,r])}deleteMany(a,r){return this.requireObjectSet(r),this.delete(["entity",a],r)}count(a,r={}){return this.post(["entity",a,"fn","count"],r)}exists(a,r={}){return this.post(["entity",a,"fn","exists"],r)}};var St=class extends N{getDefaultOptions(){return {basepath:"/api/media",upload_fetcher:fetch,init:{}}}listFiles(){return this.get(["files"])}getFile(a){return this.get(["file",a],void 0,{headers:{Accept:"*/*"}})}async getFileStream(a){let{res:r}=await this.getFile(a);if(!r.ok||!r.body)throw new Error("Failed to fetch file");return r.body}async download(a){let{res:r}=await this.getFile(a);if(!r.ok||!r.body)throw new Error("Failed to fetch file");return await r.blob()}getFileUploadUrl(a){return a?this.getUrl(`/upload/${a.path}`):this.getUrl("/upload")}getEntityUploadUrl(a,r,o){return this.getUrl(`/entity/${a}/${r}/${o}`)}getUploadHeaders(){return this.options.token_transport==="header"&&this.options.token?new Headers({Authorization:`Bearer ${this.options.token}`}):new Headers}uploadFile(a,r){let o={"Content-Type":"application/octet-stream",...r?._init?.headers||{}},e=r?.filename||"";try{typeof a.type<"u"&&(o["Content-Type"]=a.type),r?.filename||(e=a.name);}catch{}e&&e.length>0&&e.includes("/")&&(e=e.split("/").pop()||"");let l={...this.options.init,...r?._init||{},headers:o};if(r?.path)return this.post(r.path,a,l);if(!e||e.length===0)throw new Error("Invalid filename");return this.post(r?.path??["upload",e],a,l)}async upload(a,r={}){if(a instanceof Request||typeof a=="string"){let e=await(r.fetcher??this.options.upload_fetcher)(a);if(!e.ok||!e.body)throw new Error("Failed to fetch file");return this.uploadFile(e.body,r)}else if(a instanceof Response){if(!a.body)throw new Error("Invalid response");return this.uploadFile(a.body,{...r??{},_init:{...r._init??{},headers:{...r._init?.headers??{},"Content-Type":a.headers.get("Content-Type")||"application/octet-stream"}}})}return this.uploadFile(a,r)}async uploadToEntity(a,r,o,e,l){return this.upload(e,{...l,path:["entity",a,r,o]})}deleteFile(a){return this.delete(["file",a])}};var Ft=class extends N{getDefaultOptions(){return {basepath:"/api/system"}}readConfig(){return this.get("config")}readSchema(a){return this.get("schema",{config:a?.config?1:0,secrets:a?.secrets?1:0,fresh:a?.fresh?1:0})}setConfig(a,r,o){return this.post(["config","set",a].join("/")+`?force=${o?1:0}`,r)}addConfig(a,r,o){return this.post(["config","add",a,r],o)}patchConfig(a,r,o){return this.patch(["config","patch",a,r],o)}overwriteConfig(a,r,o){return this.put(["config","overwrite",a,r],o)}removeConfig(a,r){return this.delete(["config","remove",a,r])}};var Dt=class{constructor(a={}){this.options=a;this.verified=a.verified===true,"request"in a&&a.request?(this.options.host=a.host??new URL(a.request.url).origin,this.options.headers=a.headers??a.request.headers,this.extractToken()):"token"in a&&a.token?(this.token_transport="header",this.updateToken(a.token,{trigger:false})):"user"in a&&a.user?(this.token_transport="none",this.user=a.user,this.verified=a.verified!==false):this.extractToken(),this.buildApis();}token;user;verified=false;token_transport="header";system;data;auth;media;get fetcher(){return this.options.fetcher??fetch}get baseUrl(){return this.options.host??"http://localhost"}get tokenKey(){return this.options.key??"auth"}extractToken(){if(this.verified=false,this.options.headers){let a=Gr(this.options.headers.get("cookie"),"auth");if(a){this.token_transport="cookie",this.updateToken(a);return}let r=this.options.headers.get("authorization")?.replace("Bearer ","");if(r){this.token_transport="header",this.updateToken(r);return}}else this.storage&&this.storage.getItem(this.tokenKey).then(a=>{this.token_transport="header",this.updateToken(a?String(a):void 0);});}get storage(){return this.options.storage?{getItem:async a=>await this.options.storage.getItem(a),setItem:async(a,r)=>await this.options.storage.setItem(a,r),removeItem:async a=>await this.options.storage.removeItem(a)}:null}updateToken(a,r){if(this.token=a,this.verified=false,a?this.user=Z1(decode(a).payload,["iat","iss","exp"]):this.user=void 0,this.storage){let o=this.tokenKey;a?this.storage.setItem(o,a).then(()=>{this.options.onAuthStateChange?.(this.getAuthState());}):this.storage.removeItem(o).then(()=>{this.options.onAuthStateChange?.(this.getAuthState());});}else r?.trigger!==false&&this.options.onAuthStateChange?.(this.getAuthState());r?.rebuild&&this.buildApis();}markAuthVerified(a){return this.verified=a,this}isAuthVerified(){return this.verified}getAuthState(){return {token:this.token,user:this.user,verified:this.verified}}isAuthenticated(){let{token:a,user:r}=this.getAuthState();return !!a&&!!r}async getVerifiedAuthState(){return await this.verifyAuth(),this.getAuthState()}async verifyAuth(){if(!this.token){this.markAuthVerified(false);return}try{let{ok:a,data:r}=await this.auth.me(),o=r?.user;if(!a||!o)throw new Error;this.user=o,this.markAuthVerified(!0);}catch{this.markAuthVerified(false),this.updateToken(void 0);}}getUser(){return this.user||null}getParams(){return Object.freeze({host:this.baseUrl,token:this.token,headers:this.options.headers,token_transport:this.token_transport,verbose:this.options.verbose})}buildApis(){let a=this.getParams(),r=this.options.fetcher;this.system=new Ft(a,r),this.data=new yt({...a,...this.options.data},r),this.auth=new zt({...a,credentials:this.options.storage?"omit":"include",...this.options.auth,onTokenUpdate:o=>{this.updateToken(o,{rebuild:true}),this.options.auth?.onTokenUpdate?.(o);}},r),this.media=new St({...a,...this.options.media},r);}};function Gr(t,a){if(!t)return null;for(let r of t.split("; ")){let[o,e]=r.split("=");if(o===a&&e)return decodeURIComponent(e)}return null}var Kr=createContext(void 0);var h1=t=>{let a=useContext(Kr);return !a?.api||t?new Dt({host:""}):a.api};var I0=(t,a)=>{let r=useApi(),o=t(r),e=a?.refine??(d=>d),l=()=>o.execute().then(e),i=o.key();return {...Qr(a?.enabled===false?null:i,l,a),promise:o,key:i,api:r}},N0=(t,a)=>{let[r,o]=useState(false),e=useApi(),l=s=>t(e,s),i=a?.refine??(s=>s),h=$r((s,p)=>p&&!p.length?(o(true),null):l(s).request.url,s=>new st(new Request(s),{fetcher:e.fetcher},i).execute(),{revalidateFirstPage:false}),d=h.data?[].concat(...h.data):[];return {...h,_data:h.data,data:d,endReached:r,promise:l(h.size),key:l(h.size).key(),api:e}},U0=t=>{let a=useSWRConfig().mutate,r=useApi();return async o=>{let e="";return typeof o=="string"?e=o:typeof o=="function"&&(e=o(r).key()),a(l=>typeof l=="string"&&l.startsWith(e))}};function q0({initialItems:t,media:a,entity:r,query:o,randomFilename:e,infinite:l=false,...i}){let h=useId(),d=h1(),s=U0(),p=d.baseUrl,n=o?.limit??i.maxItems??50,g=k=>({limit:n,offset:k*n}),L=a?.entity_name??"media",m=(k,B=0)=>r?k.data.readManyByReference(r.name,r.id,r.field,{...g(B),...o}):k.data.readMany(L,{...g(B),...o}),x=l?N0(m,{}):I0(m,{enabled:t!==false&&!t,revalidateOnFocus:false}),C=I(k=>({url:r?d.media.getEntityUploadUrl(r.name,r.id,r.field):d.media.getFileUploadUrl(e?void 0:k),headers:d.media.getUploadHeaders(),method:"POST"}));I(async()=>{await s(x.promise.key({search:false}));});let H=I(async k=>d.media.deleteFile(k.path)),_=t??(Array.isArray(x.data)?x.data:[])??[],M=m0(_,{baseUrl:p}),b=h+JSON.stringify(M);return jsx(R0,{getUploadInfo:C,handleDelete:H,autoUpload:true,initialItems:M,footer:l&&"setSize"in x&&jsx(e2,{items:M.length,length:Math.min(x._data?.[0]?.body.meta.count??0,M.length+n),onFirstVisible:()=>x.setSize(x.size+1)}),...i},h+b)}var e2=({items:t=0,length:a=0,onFirstVisible:r})=>{let{ref:o,inViewport:e}=useInViewport(),[l,i]=useState(0),h=useRef(-1);return useEffect(()=>{e&&t>h.current&&(h.current=t,i(s=>s+1),r());},[e]),a-t<=0?null:new Array(Math.max(a-t,0)).fill(0).map((s,p)=>jsx("div",{ref:p===0?o:void 0,className:"w-[49%] md:w-60 bg-muted aspect-square"},p))};var Yl={Dropzone:q0,Preview:i1,useDropzone:Wt,useDropzoneState:jt,useDropzoneFileState:Z};
export{ce as Auth,Yl as Media,k1 as NativeForm,Rt as useAuthStrategies,Wt as useMediaDropzone,Z as useMediaDropzoneFileState,jt as useMediaDropzoneState};