@noxickon/onyx 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";require('../ui.css');const m=require("react"),C1=require("./hooks-DiKvsNs-.js"),r2=require("react-dom");function Q0(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var d2={exports:{}},X1={};/**
1
+ "use strict";require('../ui.css');const m=require("react"),C1=require("./hooks-DB942JYB.js"),r2=require("react-dom");function Q0(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var d2={exports:{}},X1={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -38,4 +38,4 @@ object-assign
38
38
  (c) Sindre Sorhus
39
39
  @license MIT
40
40
  */var J2,i3;function ht2(){if(i3)return J2;i3=1;var H=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;function L(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function M(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var a={},i=0;i<10;i++)a["_"+String.fromCharCode(i)]=i;var t=Object.getOwnPropertyNames(a).map(function(A){return a[A]});if(t.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(A){n[A]=A}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return J2=M()?Object.assign:function(e,a){for(var i,t=L(e),n,A=1;A<arguments.length;A++){i=Object(arguments[A]);for(var d in i)C.call(i,d)&&(t[d]=i[d]);if(H){n=H(i);for(var l=0;l<n.length;l++)V.call(i,n[l])&&(t[n[l]]=i[n[l]])}}return t},J2}var C5,t3;function O5(){if(t3)return C5;t3=1;var H="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return C5=H,C5}var H5,A3;function o0(){return A3||(A3=1,H5=Function.call.bind(Object.prototype.hasOwnProperty)),H5}var V5,n3;function gt2(){if(n3)return V5;n3=1;var H=function(){};if(process.env.NODE_ENV!=="production"){var C=O5(),V={},L=o0();H=function(e){var a="Warning: "+e;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function M(e,a,i,t,n){if(process.env.NODE_ENV!=="production"){for(var A in e)if(L(e,A)){var d;try{if(typeof e[A]!="function"){var l=Error((t||"React class")+": "+i+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}d=e[A](a,A,t,i,null,C)}catch(o){d=o}if(d&&!(d instanceof Error)&&H((t||"React class")+": type specification of "+i+" `"+A+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in V)){V[d.message]=!0;var v=n?n():"";H("Failed "+i+" type: "+d.message+(v??""))}}}}return M.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(V={})},V5=M,V5}var L5,o3;function Ot2(){if(o3)return L5;o3=1;var H=n0(),C=ht2(),V=O5(),L=o0(),M=gt2(),e=function(){};process.env.NODE_ENV!=="production"&&(e=function(i){var t="Warning: "+i;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});function a(){return null}return L5=function(i,t){var n=typeof Symbol=="function"&&Symbol.iterator,A="@@iterator";function d(g){var c=g&&(n&&g[n]||g[A]);if(typeof c=="function")return c}var l="<<anonymous>>",v={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:h(),arrayOf:f,element:w(),elementType:p(),instanceOf:O,node:$(),objectOf:y,oneOf:D,oneOfType:F,shape:K,exact:k};function o(g,c){return g===c?g!==0||1/g===1/c:g!==g&&c!==c}function u(g,c){this.message=g,this.data=c&&typeof c=="object"?c:{},this.stack=""}u.prototype=Error.prototype;function Z(g){if(process.env.NODE_ENV!=="production")var c={},T=0;function B(U,E,b,G,Q,Y,H1){if(G=G||l,Y=Y||b,H1!==V){if(t){var R=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw R.name="Invariant Violation",R}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var S1=G+":"+b;!c[S1]&&T<3&&(e("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),c[S1]=!0,T++)}}return E[b]==null?U?E[b]===null?new u("The "+Q+" `"+Y+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new u("The "+Q+" `"+Y+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:g(E,b,G,Q,Y)}var P=B.bind(null,!1);return P.isRequired=B.bind(null,!0),P}function S(g){function c(T,B,P,U,E,b){var G=T[B],Q=N(G);if(Q!==g){var Y=j(G);return new u("Invalid "+U+" `"+E+"` of type "+("`"+Y+"` supplied to `"+P+"`, expected ")+("`"+g+"`."),{expectedType:g})}return null}return Z(c)}function h(){return Z(a)}function f(g){function c(T,B,P,U,E){if(typeof g!="function")return new u("Property `"+E+"` of component `"+P+"` has invalid PropType notation inside arrayOf.");var b=T[B];if(!Array.isArray(b)){var G=N(b);return new u("Invalid "+U+" `"+E+"` of type "+("`"+G+"` supplied to `"+P+"`, expected an array."))}for(var Q=0;Q<b.length;Q++){var Y=g(b,Q,P,U,E+"["+Q+"]",V);if(Y instanceof Error)return Y}return null}return Z(c)}function w(){function g(c,T,B,P,U){var E=c[T];if(!i(E)){var b=N(E);return new u("Invalid "+P+" `"+U+"` of type "+("`"+b+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return Z(g)}function p(){function g(c,T,B,P,U){var E=c[T];if(!H.isValidElementType(E)){var b=N(E);return new u("Invalid "+P+" `"+U+"` of type "+("`"+b+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return Z(g)}function O(g){function c(T,B,P,U,E){if(!(T[B]instanceof g)){var b=g.name||l,G=X(T[B]);return new u("Invalid "+U+" `"+E+"` of type "+("`"+G+"` supplied to `"+P+"`, expected ")+("instance of `"+b+"`."))}return null}return Z(c)}function D(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&(arguments.length>1?e("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):e("Invalid argument supplied to oneOf, expected an array.")),a;function c(T,B,P,U,E){for(var b=T[B],G=0;G<g.length;G++)if(o(b,g[G]))return null;var Q=JSON.stringify(g,function(H1,R){var S1=j(R);return S1==="symbol"?String(R):R});return new u("Invalid "+U+" `"+E+"` of value `"+String(b)+"` "+("supplied to `"+P+"`, expected one of "+Q+"."))}return Z(c)}function y(g){function c(T,B,P,U,E){if(typeof g!="function")return new u("Property `"+E+"` of component `"+P+"` has invalid PropType notation inside objectOf.");var b=T[B],G=N(b);if(G!=="object")return new u("Invalid "+U+" `"+E+"` of type "+("`"+G+"` supplied to `"+P+"`, expected an object."));for(var Q in b)if(L(b,Q)){var Y=g(b,Q,P,U,E+"."+Q,V);if(Y instanceof Error)return Y}return null}return Z(c)}function F(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&e("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var c=0;c<g.length;c++){var T=g[c];if(typeof T!="function")return e("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(T)+" at index "+c+"."),a}function B(P,U,E,b,G){for(var Q=[],Y=0;Y<g.length;Y++){var H1=g[Y],R=H1(P,U,E,b,G,V);if(R==null)return null;R.data&&L(R.data,"expectedType")&&Q.push(R.data.expectedType)}var S1=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new u("Invalid "+b+" `"+G+"` supplied to "+("`"+E+"`"+S1+"."))}return Z(B)}function $(){function g(c,T,B,P,U){return _(c[T])?null:new u("Invalid "+P+" `"+U+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return Z(g)}function q(g,c,T,B,P){return new u((g||"React class")+": "+c+" type `"+T+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+P+"`.")}function K(g){function c(T,B,P,U,E){var b=T[B],G=N(b);if(G!=="object")return new u("Invalid "+U+" `"+E+"` of type `"+G+"` "+("supplied to `"+P+"`, expected `object`."));for(var Q in g){var Y=g[Q];if(typeof Y!="function")return q(P,U,E,Q,j(Y));var H1=Y(b,Q,P,U,E+"."+Q,V);if(H1)return H1}return null}return Z(c)}function k(g){function c(T,B,P,U,E){var b=T[B],G=N(b);if(G!=="object")return new u("Invalid "+U+" `"+E+"` of type `"+G+"` "+("supplied to `"+P+"`, expected `object`."));var Q=C({},T[B],g);for(var Y in Q){var H1=g[Y];if(L(g,Y)&&typeof H1!="function")return q(P,U,E,Y,j(H1));if(!H1)return new u("Invalid "+U+" `"+E+"` key `"+Y+"` supplied to `"+P+"`.\nBad object: "+JSON.stringify(T[B],null," ")+`
41
- Valid keys: `+JSON.stringify(Object.keys(g),null," "));var R=H1(b,Y,P,U,E+"."+Y,V);if(R)return R}return null}return Z(c)}function _(g){switch(typeof g){case"number":case"string":case"undefined":return!0;case"boolean":return!g;case"object":if(Array.isArray(g))return g.every(_);if(g===null||i(g))return!0;var c=d(g);if(c){var T=c.call(g),B;if(c!==g.entries){for(;!(B=T.next()).done;)if(!_(B.value))return!1}else for(;!(B=T.next()).done;){var P=B.value;if(P&&!_(P[1]))return!1}}else return!1;return!0;default:return!1}}function z(g,c){return g==="symbol"?!0:c?c["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&c instanceof Symbol:!1}function N(g){var c=typeof g;return Array.isArray(g)?"array":g instanceof RegExp?"object":z(c,g)?"symbol":c}function j(g){if(typeof g>"u"||g===null)return""+g;var c=N(g);if(c==="object"){if(g instanceof Date)return"date";if(g instanceof RegExp)return"regexp"}return c}function x(g){var c=j(g);switch(c){case"array":case"object":return"an "+c;case"boolean":case"date":case"regexp":return"a "+c;default:return c}}function X(g){return!g.constructor||!g.constructor.name?l:g.constructor.name}return v.checkPropTypes=M,v.resetWarningCache=M.resetWarningCache,v.PropTypes=v,v},L5}var M5,d3;function xt2(){if(d3)return M5;d3=1;var H=O5();function C(){}function V(){}return V.resetWarningCache=C,M5=function(){function L(a,i,t,n,A,d){if(d!==H){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}L.isRequired=L;function M(){return L}var e={array:L,bigint:L,bool:L,func:L,number:L,object:L,string:L,symbol:L,any:L,arrayOf:M,element:L,elementType:L,instanceOf:M,node:L,objectOf:M,oneOf:M,oneOfType:M,shape:M,exact:M,checkPropTypes:V,resetWarningCache:C};return e.PropTypes=e,e},M5}var l3;function bt2(){if(l3)return v2.exports;if(l3=1,process.env.NODE_ENV!=="production"){var H=n0(),C=!0;v2.exports=Ot2()(H.isElement,C)}else v2.exports=xt2()();return v2.exports}var e5,m3;function yt2(){return m3||(m3=1,e5=(function(H){var C={};function V(L){if(C[L])return C[L].exports;var M=C[L]={i:L,l:!1,exports:{}};return H[L].call(M.exports,M,M.exports,V),M.l=!0,M.exports}return V.m=H,V.c=C,V.d=function(L,M,e){V.o(L,M)||Object.defineProperty(L,M,{enumerable:!0,get:e})},V.r=function(L){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})},V.t=function(L,M){if(1&M&&(L=V(L)),8&M||4&M&&typeof L=="object"&&L&&L.__esModule)return L;var e=Object.create(null);if(V.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:L}),2&M&&typeof L!="string")for(var a in L)V.d(e,a,(function(i){return L[i]}).bind(null,a));return e},V.n=function(L){var M=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(M,"a",M),M},V.o=function(L,M){return Object.prototype.hasOwnProperty.call(L,M)},V.p="",V(V.s=2)})([function(H,C){H.exports=bt2()},function(H,C){H.exports=m},function(H,C,V){V.r(C);var L=V(1),M=V(0),e=function(){return(e=Object.assign||function(o){for(var u,Z=1,S=arguments.length;Z<S;Z++)for(var h in u=arguments[Z])Object.prototype.hasOwnProperty.call(u,h)&&(o[h]=u[h]);return o}).apply(this,arguments)},a=function(o,u){var Z={};for(var S in o)Object.prototype.hasOwnProperty.call(o,S)&&u.indexOf(S)<0&&(Z[S]=o[S]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(S=Object.getOwnPropertySymbols(o);h<S.length;h++)u.indexOf(S[h])<0&&Object.prototype.propertyIsEnumerable.call(o,S[h])&&(Z[S[h]]=o[S[h]])}return Z},i=0,t=L.forwardRef((function(o,u){var Z=o.title,S=Z===void 0?null:Z,h=o.description,f=h===void 0?null:h,w=o.size,p=w===void 0?null:w,O=o.color,D=O===void 0?"currentColor":O,y=o.horizontal,F=y===void 0?null:y,$=o.vertical,q=$===void 0?null:$,K=o.rotate,k=K===void 0?null:K,_=o.spin,z=_===void 0?null:_,N=o.style,j=N===void 0?{}:N,x=o.children,X=a(o,["title","description","size","color","horizontal","vertical","rotate","spin","style","children"]);i++;var g,c=z!==null&&z,T=L.Children.map(x,(function(E){var b=E;c!==!0&&(c=(z===null?b.props.spin:z)===!0);var G=b.props.size;typeof p=="number"&&typeof b.props.size=="number"&&(G=b.props.size/p);var Q={size:G,color:D===null?b.props.color:D,horizontal:F===null?b.props.horizontal:F,vertical:q===null?b.props.vertical:q,rotate:k===null?b.props.rotate:k,spin:z===null?b.props.spin:z,inStack:!0};return L.cloneElement(b,Q)}));p!==null&&(j.width=typeof p=="string"?p:1.5*p+"rem");var B,P="stack_labelledby_"+i,U="stack_describedby_"+i;if(S)g=f?P+" "+U:P;else if(B="presentation",f)throw new Error("title attribute required when description is set");return L.createElement("svg",e({ref:u,viewBox:"0 0 24 24",style:j,role:B,"aria-labelledby":g},X),S&&L.createElement("title",{id:P},S),f&&L.createElement("desc",{id:U},f),c&&L.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }","@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"),T)}));t.displayName="Stack",t.propTypes={size:M.oneOfType([M.number,M.string]),color:M.string,horizontal:M.bool,vertical:M.bool,rotate:M.number,spin:M.oneOfType([M.bool,M.number]),children:M.oneOfType([M.arrayOf(M.node),M.node]).isRequired,className:M.string,style:M.object},t.defaultProps={size:null,color:null,horizontal:null,vertical:null,rotate:null,spin:null};var n=t;V.d(C,"Icon",(function(){return v})),V.d(C,"Stack",(function(){return n}));var A=function(){return(A=Object.assign||function(o){for(var u,Z=1,S=arguments.length;Z<S;Z++)for(var h in u=arguments[Z])Object.prototype.hasOwnProperty.call(u,h)&&(o[h]=u[h]);return o}).apply(this,arguments)},d=function(o,u){var Z={};for(var S in o)Object.prototype.hasOwnProperty.call(o,S)&&u.indexOf(S)<0&&(Z[S]=o[S]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(S=Object.getOwnPropertySymbols(o);h<S.length;h++)u.indexOf(S[h])<0&&Object.prototype.propertyIsEnumerable.call(o,S[h])&&(Z[S[h]]=o[S[h]])}return Z},l=0,v=L.forwardRef((function(o,u){var Z=o.path,S=o.id,h=S===void 0?++l:S,f=o.title,w=f===void 0?null:f,p=o.description,O=p===void 0?null:p,D=o.size,y=D===void 0?null:D,F=o.color,$=F===void 0?"currentColor":F,q=o.horizontal,K=q!==void 0&&q,k=o.vertical,_=k!==void 0&&k,z=o.rotate,N=z===void 0?0:z,j=o.spin,x=j!==void 0&&j,X=o.style,g=X===void 0?{}:X,c=o.inStack,T=c!==void 0&&c,B=d(o,["path","id","title","description","size","color","horizontal","vertical","rotate","spin","style","inStack"]),P={},U=[];y!==null&&(T?U.push("scale("+y+")"):(g.width=typeof y=="string"?y:1.5*y+"rem",g.height=g.width)),K&&U.push("scaleX(-1)"),_&&U.push("scaleY(-1)"),N!==0&&U.push("rotate("+N+"deg)"),$!==null&&(P.fill=$);var E=L.createElement("path",A({d:Z,style:P},T?B:{})),b=E;U.length>0&&(g.transform=U.join(" "),g.transformOrigin="center",T&&(b=L.createElement("g",{style:g},E,L.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var G,Q=b,Y=x===!0||typeof x!="number"?2:x,H1=!T&&(K||_);if(Y<0&&(H1=!H1),x&&(Q=L.createElement("g",{style:{animation:"spin"+(H1?"-inverse":"")+" linear "+Math.abs(Y)+"s infinite",transformOrigin:"center"}},b,!(K||_||N!==0)&&L.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),T)return Q;var R,S1="icon_labelledby_"+h,F1="icon_describedby_"+h;if(w)G=O?S1+" "+F1:S1;else if(R="presentation",O)throw new Error("title attribute required when description is set");return L.createElement("svg",A({ref:u,viewBox:"0 0 24 24",style:g,role:R,"aria-labelledby":G},B),w&&L.createElement("title",{id:S1},w),O&&L.createElement("desc",{id:F1},O),!T&&x&&(H1?L.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):L.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),Q)}));v.displayName="Icon",v.propTypes={path:M.string.isRequired,size:M.oneOfType([M.number,M.string]),color:M.string,horizontal:M.bool,vertical:M.bool,rotate:M.number,spin:M.oneOfType([M.bool,M.number]),style:M.object,inStack:M.bool,className:M.string},v.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},C.default=v}])),e5}var wt2=yt2();const kt2=Q0(wt2),e1=({className:H,path:C,placeholder:V=!1,size:L=.9,...M})=>{const e=()=>{const a=St2;return C&&a[C]?a[C]:a.mdiHelpCircleOutline};return r.jsx(kt2,{"aria-hidden":"true",className:s({"text-gray-1200":!V,"text-transparent":V},H),"data-ox-slot":"icon","data-testid":"icon",path:e(),size:L,...M})},O2=({data:H,level:C})=>{const[V,L]=m.useState(C>2),M=" ".repeat(C);if(H===null)return r.jsx("span",{className:"text-gray-1000",children:"null"});if(H===void 0)return r.jsx("span",{className:"text-gray-1000",children:"undefined"});if(typeof H=="string")return r.jsxs("span",{className:a1.green.text,children:['"',H,'"']});if(typeof H=="number")return r.jsx("span",{className:a1.blue.text,children:H});if(typeof H=="boolean")return r.jsx("span",{className:a1.amber.text,children:H.toString()});if(Array.isArray(H))return H.length===0?r.jsx("span",{className:a1.gray.text,children:"[]"}):r.jsxs("div",{className:"inline","data-ox-slot":"json-array",children:[r.jsxs("button",{className:"ox-violet-outset-focus text-gray-1100 hover:text-gray-1200","data-ox-state":V?"collapsed":"expanded",onClick:()=>L(!V),children:[r.jsx("span",{className:"text-gray-1200",children:"["}),V?r.jsxs("span",{className:"ml-1 text-gray-900",children:[H.length," item",H.length!==1?"s":""]}):null]}),V?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"ml-4",children:H.map((e,a)=>r.jsxs("div",{className:"block",children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsx(O2,{data:e,level:C+1}),a<H.length-1&&r.jsx("span",{className:"text-gray-1100",children:","})]},a))}),r.jsxs("div",{children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsx("span",{className:"text-gray-1200",children:"]"})]})]}),V&&r.jsx("span",{className:"text-gray-1200",children:"]"})]});if(typeof H=="object"){const e=Object.keys(H);return e.length===0?r.jsx("span",{className:"text-gray-1100",children:"{}"}):r.jsxs("div",{className:"inline",children:[r.jsxs("button",{className:"ox-violet-outset-focus text-gray-1100 hover:text-gray-1200","data-ox-state":V?"collapsed":"expanded",onClick:()=>L(!V),children:[r.jsx("span",{className:"text-gray-1200",children:"{"}),V?r.jsxs("span",{className:"text-gray-1100 ml-1",children:[e.length," key",e.length!==1?"s":""]}):null]}),V?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"ml-4",children:e.map((a,i)=>r.jsxs("div",{className:"block",children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsxs("span",{className:"text-gray-1200",children:['"',a,'"']}),r.jsx("span",{className:"text-gray-1100",children:": "}),r.jsx(O2,{data:H[a],level:C+1}),i<e.length-1&&r.jsx("span",{className:"text-gray-1100",children:","})]},a))}),r.jsxs("div",{children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsx("span",{className:"text-gray-1200",children:"}"})]})]}),V&&r.jsx("span",{className:"text-gray-1200",children:"}"})]})}return r.jsx("span",{className:"text-gray-1100",children:String(H)})},Tt2=({className:H,value:C,...V})=>{const[L,M]=m.useState(!1),{error:e,isValid:a,parsedData:i}=m.useMemo(()=>{if(C==null)return{parsedData:null,isValid:!0,error:null};if(typeof C=="object")return{parsedData:C,isValid:!0,error:null};if(typeof C=="string")try{return{parsedData:JSON.parse(C),isValid:!0,error:null}}catch(n){return{parsedData:null,isValid:!1,error:n instanceof Error?n.message:"Invalid JSON"}}return{parsedData:C,isValid:!0,error:null}},[C]),t=async()=>{const n=typeof C=="string"?C:JSON.stringify(i,null,2);try{await navigator.clipboard.writeText(n),M(!0),setTimeout(()=>M(!1),2e3)}catch(A){console.error("Failed to copy:",A)}};return r.jsxs("div",{className:s("ox-gray-border relative w-full overflow-auto rounded-lg bg-gray-50 p-4 font-mono text-sm",H),"data-ox-slot":"json-field",...V,"data-ox-state":a?L?"copied":"default":"error",children:[r.jsx(m1,{"aria-label":"Copy JSON to clipboard",className:"absolute right-1 top-1",size:"sm",variant:"ghost",onClick:t,children:r.jsx(m1.Icon,{path:L?"mdiCheck":"mdiContentCopy"})}),r.jsx("div",{className:"text-gray-1200 pr-8",children:a?r.jsx(O2,{data:i,level:0}):r.jsxs("div",{className:"text-rose-400",children:[r.jsx("div",{className:"font-medium",children:"Invalid JSON:"}),r.jsx("div",{className:"mt-1 text-xs text-gray-900",children:e}),r.jsx("div",{className:"text-gray-1100 mt-2",children:r.jsx("pre",{className:"whitespace-pre-wrap",children:C})})]})})]})},d0=Tt2;d0.Node=O2;const Pt2={primary:"border border-violet-700 bg-gradient-to-br from-violet-700 from-20% to-rose-500",secondary:"ox-gray-border bg-transparent",ghost:"border border-transparent bg-transparent",link:"border border-transparent bg-transparent",danger:"border border-rose-700 bg-rose-700/80"},Bt2={primary:"ox-violet-outset-focus",secondary:"ox-gray-outset-focus",ghost:"ox-gray-outset-focus",link:"ox-gray-outset-focus",danger:"ox-rose-outset-focus"},Rt2={primary:"hover:brightness-120",secondary:"hover:bg-gray-300",ghost:"hover:bg-gray-300",link:"underline-offset-4 decoration-violet-700 hover:underline",danger:"hover:bg-rose-700"},Ft2={sm:`px-1.5 min-w-8 ${i1.sm} ${u1.sm}`,md:`px-2 min-w-10 ${i1.md} ${u1.md}`},Et2=({children:H,className:C,disabled:V,href:L,size:M="sm",variant:e="link",...a})=>r.jsx("a",{"aria-disabled":V,className:s("inline-flex items-center rounded-lg font-medium transition-colors",Ft2[M],Pt2[e],{[Rt2[e]]:!V,[Bt2[e]]:!V,"ox-default-disabled cursor-not-allowed":V},C),"data-ox-slot":"link",href:V?void 0:L,tabIndex:V?-1:void 0,onClick:V?i=>i.preventDefault():void 0,...a,children:H}),l0=m.createContext(null),Dt2={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"},Nt2=({children:H,className:C,closeOnOutsideClick:V=!0,isOpen:L,onClose:M,persistent:e=!1,showCloseButton:a=!0,size:i="sm",...t})=>{const n=m.useId(),A=m.useId(),d=m.useRef(null),[l,v]=m.useState(!1),[o,u]=C1.useControllableState({value:L,onChange:f=>f?void 0:M?.(),defaultValue:!1,name:"OxDialog"});C1.useFocus({containerRef:d,options:{enabled:l&&o,restoreFocus:!0,trapFocus:!0,autoFocus:!0}});const Z={onClose:()=>u(!1),titleId:n,bodyId:A,persistent:e,showCloseButton:a},S=f=>{f.target===d.current&&!o&&l&&(v(!1),d.current?.close())},h=m.useCallback(()=>{e&&o?d.current?.showModal():e||u(!1)},[e,o,u]);return m.useEffect(()=>{o&&v(!0)},[o]),m.useEffect(()=>{const f=d.current;if(!(!f||!l))return o&&(document.body.classList.add("overflow-hidden"),f.showModal()),()=>{document.body.classList.remove("overflow-hidden")}},[o,l]),m.useEffect(()=>{const f=d.current;if(!f||!l)return;const w=D=>{D.key==="Escape"&&e&&(D.preventDefault(),D.stopPropagation())},p=D=>{D.preventDefault(),h()},O=D=>{V&&D.target===f&&h()};return document.addEventListener("keydown",w),f.addEventListener("cancel",p),f.addEventListener("click",O),f.addEventListener("close",h),()=>{document.removeEventListener("keydown",w),f.removeEventListener("cancel",p),f.removeEventListener("click",O),f.removeEventListener("close",h)}},[l,V,h,e]),l?r2.createPortal(r.jsx("dialog",{"aria-describedby":A,"aria-labelledby":n,className:s("ox-gray-border fixed inset-0 m-auto h-fit w-full rounded-lg bg-gray-50","ox-dialog-animation ox-dialog-backdrop",Dt2[i],C),"data-ox-slot":"dialog",ref:d,role:"dialog",onAnimationEnd:S,...t,"data-ox-state":o?"open":"closing",children:r.jsx(l0.Provider,{value:Z,children:H})}),document.body):null},m0=()=>{const H=m.useContext(l0);if(!H)throw new Error("Dialog sub-components must be used within OxDialog");return H},jt2=({children:H,className:C,...V})=>{const{bodyId:L}=m0();return r.jsx("div",{id:L,className:s("text-gray-1200 p-4 text-sm",C),"data-ox-slot":"dialog-body",...V,children:H})},It2=({children:H,className:C,...V})=>r.jsx("div",{className:s("mx-4 flex justify-end gap-3 border-t border-gray-400 py-4",C),"data-ox-slot":"dialog-footer",...V,children:H}),Wt2=({children:H,className:C,...V})=>{const{onClose:L,persistent:M,showCloseButton:e,titleId:a}=m0(),i=e&&!M;return r.jsxs("div",{id:a,className:s("text-gray-1200 mx-4 box-content flex h-8 items-center justify-between border-b border-gray-400 py-4",C),"data-ox-slot":"dialog-header",...V,children:[r.jsx("div",{className:"flex-1",children:H}),i?r.jsx(m1,{"aria-label":"Close Dialog",size:"sm",variant:"ghost",onClick:L,children:r.jsx(m1.Icon,{path:"mdiClose"})}):null]})},T2=Nt2;T2.Body=jt2;T2.Footer=It2;T2.Header=Wt2;const L2=m.createContext(null),P2=()=>{const H=m.useContext(L2);if(!H)throw new Error("useNotificationsContext must be used within a NotificationsContext.Provider");return H},s0=({children:H,className:C,icon:V,img:L,message:M,timestamp:e,title:a,type:i="default",unread:t=!1,...n})=>{const{isMobile:A,onItemClick:d,setOpen:l}=P2(),v=f1[i],o=()=>{const Z={id:crypto.randomUUID(),icon:V,img:L,message:M,read:!t,timestamp:e||new Date,title:a||"",type:i};d?.(Z),A&&l(!1)},u=H||r.jsxs(r.Fragment,{children:[r.jsx("div",{className:s("mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",v.background),"data-ox-slot":"notifications-icon",children:L?r.jsx(b2,{alt:"User avatar",fallback:"NA",size:"md",src:L}):r.jsx(e1,{className:v.text,path:V??v.icon,size:.75})}),r.jsxs("div",{className:"min-w-0 flex-1","data-ox-slot":"notifications-content",children:[a&&r.jsx("h5",{className:"text-gray-1200 mb-1 text-pretty text-sm font-semibold leading-tight",children:a}),M&&r.jsx("p",{className:"mb-1 text-xs leading-4",children:M}),e&&r.jsx("p",{className:"text-gray-1000 text-xs",children:u5(e)})]}),t&&r.jsx("div",{className:"mt-1.5 h-2 w-2 flex-shrink-0 rounded-full bg-rose-500","data-ox-slot":"notifications-unread"})]});return r.jsx("li",{className:"contents",children:r.jsx("button",{className:s("col-span-3 grid cursor-pointer grid-cols-subgrid items-start gap-3 px-3 py-3 text-left","ox-gray-inset-focus hover:bg-gray-400",{"bg-gray-300/80":t},C),"data-ox-slot":"notifications-button",...n,"data-ox-state":t?"unread":"read",onClick:o,children:u})})},s3=s("grid min-h-0 flex-1 auto-rows-min grid-cols-[auto_1fr_auto] overflow-y-auto",'[&_[data-ox-slot="notifications-icon"]]:justify-self-center [&_[data-ox-slot="notifications-icon"]]:[grid-column-start:var(--ox-menu-icon-col)]','[&_[data-ox-slot="notifications-content"]]:[grid-column-start:var(--ox-menu-label-col)]','[&_[data-ox-slot="notifications-unread"]]:justify-self-end [&_[data-ox-slot="notifications-unread"]]:[grid-column-start:var(--ox-menu-shortcut-col)]'),Z2=({children:H,className:C,...V})=>{const{emptyMessage:L,isMobile:M,items:e,onMarkAllRead:a,setOpen:i,unreadCount:t}=P2(),n=e.length>0,A=t>0,d=()=>{a?.(),M&&i(!1)},l=H||r.jsx(r.Fragment,{children:n?e.map((v,o)=>r.jsx(s0,{className:s({"border-t border-gray-400":o>0}),icon:v.icon,img:v.img,message:v.message,timestamp:v.timestamp,title:v.title,type:v.type,unread:!v.read},v.id)):r.jsxs("li",{className:"col-span-3 px-3 py-8 text-center",role:"status",children:[r.jsx(e1,{className:"mx-auto mb-2 opacity-50",path:"mdiBellOffOutline",size:2}),r.jsx("p",{className:"text-sm opacity-50",children:L})]})});return M?r.jsxs(w1.Content,{closeOnOutsideClick:!0,side:"right",children:[r.jsxs("div",{className:"h-15 flex items-center justify-between border-b border-gray-400 px-4",children:[r.jsx(m1,{"aria-label":"Close notifications",size:"md",variant:"ghost",onClick:()=>i(!1),children:r.jsx(m1.Icon,{path:"mdiClose"})}),r.jsx("h5",{className:"text-gray-1200 text-sm font-semibold",children:"Notifications"}),r.jsx("div",{className:"flex items-center gap-2",children:A&&a&&r.jsx("button",{className:"text-gray-1000 hover:text-gray-1200 cursor-pointer text-xs transition-colors",onClick:d,children:"Mark all read"})})]}),r.jsx("ul",{"aria-orientation":"vertical",className:s(s3,C),"data-ox-slot":"notifications-body",...V,children:l})]}):r.jsxs(r.Fragment,{children:[r.jsx(Z1.Header,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h5",{className:"text-gray-1200 text-sm font-semibold",children:"Notifications"}),A&&a&&r.jsx("button",{className:"ox-gray-outset-focus text-gray-1000 hover:text-gray-1200 cursor-pointer rounded-lg p-1 text-xs transition-colors",onClick:a,children:"Mark all read"})]})}),r.jsx("ul",{"aria-orientation":"vertical",className:s("w-85",s3,C),"data-ox-slot":"notifications-body",...V,children:l})]})},S2=({children:H,className:C,customIcon:V,unreadCount:L,...M})=>{const{disabled:e,isMobile:a,open:i,setOpen:t,unreadCount:n}=P2(),A=L??n,d=A>99?"99+":A.toString(),l=A>0,v=V??"mdiBellOutline",o=`Notifications${l?` (${A} unread)`:""}`,u=l&&r.jsx("div",{className:s("absolute -right-2 -top-2",{"opacity-50":e}),children:r.jsx(f2,{className:"min-w-[1.25rem] justify-center px-1",color:"violet",size:"sm",children:d})}),Z=H||u;return a?r.jsxs(m1,{"aria-label":o,className:s("relative",C),"data-ox-slot":"notifications-trigger",disabled:e,size:"md",variant:"ghost",...M,"data-ox-state":i?"open":"closed",onClick:()=>t(!0),children:[r.jsx(m1.Icon,{path:v}),Z]}):r.jsxs(Z1.Trigger,{"aria-label":o,className:s("relative flex h-10 min-w-10 items-center justify-center rounded-lg border border-transparent bg-transparent px-2 text-sm","ox-gray-outset-focus enabled:text-gray-1200 disabled:ox-default-disabled enabled:cursor-pointer enabled:hover:bg-gray-300",{"bg-gray-300":i},C),"data-ox-slot":"notifications-trigger",disabled:e,hideIcon:!0,...M,"data-ox-state":i?"open":"closed",children:[r.jsx(e1,{path:v}),Z]})},_t2=({children:H,disabled:C=!1,emptyMessage:V="No notifications",items:L=[],onItemClick:M,onMarkAllRead:e,unreadCount:a=0,...i})=>{const[t,n]=m.useState(!1),[A,d]=m.useState(!1);m.useEffect(()=>{const v=()=>{d(window.innerWidth<j3)};return v(),window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v)}},[]);const l=m.useMemo(()=>({disabled:C,emptyMessage:V,isMobile:A,items:L,open:t,setOpen:n,unreadCount:a,onItemClick:M,onMarkAllRead:e}),[C,V,A,L,t,a,M,e]);if(H){const v=m.Children.toArray(H).find(u=>m.isValidElement(u)&&u.type===S2),o=m.Children.toArray(H).find(u=>m.isValidElement(u)&&u.type===Z2);return A?r.jsx(L2.Provider,{value:l,children:r.jsxs("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"mobile",children:[v,r.jsx(w1,{open:t,onOpenChange:n,children:o})]})}):r.jsx(L2.Provider,{value:l,children:r.jsx("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"desktop",children:r.jsxs(Z1,{align:"end",className:"p-0",disabled:C,open:t,side:"bottom",onOpenChange:n,children:[v,o]})})})}return A?r.jsx(L2.Provider,{value:l,children:r.jsxs("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"mobile",children:[r.jsx(S2,{}),r.jsx(w1,{open:t,onOpenChange:n,children:r.jsx(Z2,{})})]})}):r.jsx(L2.Provider,{value:l,children:r.jsx("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"desktop",children:r.jsxs(Z1,{align:"end",className:"p-0",disabled:C,open:t,side:"bottom",onOpenChange:n,children:[r.jsx(S2,{}),r.jsx(Z2,{})]})})})},zt2=({children:H,className:C,href:V,icon:L,img:M,message:e,timestamp:a,title:i,type:t="default",unread:n=!1,...A})=>{const{isMobile:d,onItemClick:l,setOpen:v}=P2(),o=f1[t],u=()=>{const S={id:crypto.randomUUID(),icon:L,img:M,message:e,read:!n,timestamp:a||new Date,title:i||"",type:t};l?.(S),d&&v(!1)},Z=H||r.jsxs(r.Fragment,{children:[r.jsx("div",{className:s("mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",o.background),"data-ox-slot":"notifications-icon",children:M?r.jsx(b2,{alt:"User avatar",fallback:"NA",size:"md",src:M}):r.jsx(e1,{className:o.text,path:L??o.icon,size:.75})}),r.jsxs("div",{className:"min-w-0 flex-1","data-ox-slot":"notifications-content",children:[i&&r.jsx("h5",{className:"text-gray-1200 mb-1 text-pretty text-sm font-semibold leading-tight",children:i}),e&&r.jsx("p",{className:"mb-1 text-xs leading-4",children:e}),a&&r.jsx("p",{className:"text-gray-1000 text-xs",children:u5(a)})]}),n&&r.jsx("div",{className:"mt-1.5 h-2 w-2 flex-shrink-0 rounded-full bg-rose-500","data-ox-slot":"notifications-unread"})]});return r.jsx("li",{className:"contents",children:r.jsx("a",{className:s("col-span-3 grid cursor-pointer grid-cols-subgrid items-start gap-3 px-3 py-3 text-left","ox-gray-inset-focus hover:bg-gray-400",{"bg-gray-300/80":n},C),"data-ox-slot":"notifications-link",href:V,...A,"data-ox-state":n?"unread":"read",onClick:u,children:Z})})},j1=_t2;j1.Body=Z2;j1.Button=s0;j1.Link=zt2;j1.Trigger=S2;const Gt2=({children:H,className:C,...V})=>r.jsx("nav",{"aria-label":"Pagination",className:s("flex justify-center",C),"data-ox-slot":"pagination",role:"navigation",...V,children:r.jsx("ul",{className:"flex items-center gap-1",children:H})}),B2={sm:`px-2 ${i1.sm}`,md:`px-2.5 ${i1.md}`},Ut2=({className:H,size:C="sm",...V})=>r.jsx("li",{children:r.jsx("span",{"aria-hidden":"true",className:s("flex items-center justify-center text-gray-900",B2[C],a2[C],H),"data-ox-slot":"pagination-ellipsis",...V,children:r.jsx(e1,{path:"mdiDotsHorizontal",size:c1[C]})})}),Qt2=({className:H,disabled:C=!1,isActive:V=!1,onClick:L,page:M,size:e="sm",...a})=>{const i=()=>{C||L(M)};return r.jsx("li",{children:r.jsx("button",{"aria-current":V?"page":void 0,"aria-label":`Go to page ${M}`,className:s("ox-gray-outset-focus ox-pagination-button",B2[e],a2[e],{"enabled:text-gray-1200 bg-gray-300":V},H),"data-ox-slot":"pagination-link",disabled:C,type:"button",onClick:i,...a,children:M})})},$t2=({className:H,disabled:C=!1,onClick:V,short:L=!1,size:M="sm",...e})=>{const a=()=>{C||V()};return r.jsx("li",{children:r.jsxs("button",{"aria-label":"Go to next page",className:s("ox-gray-outset-focus ox-pagination-button",B2[M],{[`gap-1 ${a2[M]}`]:L,[u1[M]]:!L},H),"data-ox-slot":"pagination-next",disabled:C,type:"button",onClick:a,...e,children:[L?null:"Next",r.jsx(e1,{path:"mdiChevronRight",size:c1[M]})]})})},Yt2=({className:H,disabled:C=!1,onClick:V,short:L=!1,size:M="sm",...e})=>{const a=()=>{C||V()};return r.jsx("li",{children:r.jsxs("button",{"aria-label":"Go to previous page",className:s("ox-gray-outset-focus ox-pagination-button gap-1",B2[M],{[`gap-1 ${a2[M]}`]:L,[u1[M]]:!L},H),"data-ox-slot":"pagination-previous",disabled:C,type:"button",onClick:a,...e,children:[r.jsx(e1,{path:"mdiChevronLeft",size:c1[M]}),L?null:"Previous"]})})},i2=Gt2;i2.Ellipsis=Ut2;i2.Link=Qt2;i2.Next=$t2;i2.Previous=Yt2;const v0=m.createContext(void 0),u0=()=>{const H=m.useContext(v0);if(H===void 0)throw new Error("usePopoverContext must be used within a PopoverProvider");return H},m5=({children:H,...C})=>{const{disabled:V}=u0();return r.jsx("div",{"data-ox-slot":"popover-trigger",...C,...V&&{"data-ox-disabled":""},children:H})},qt2=({align:H="center",children:C,defaultOpen:V=!1,disabled:L=!1,onOpenChange:M,open:e,side:a="bottom",...i})=>{const[t,n]=m.useState(V),A=e!==void 0,d=A?e:t,l=S=>{L||(A||n(S),M?.(S))},v={open:d,setOpen:l,disabled:L},o=m.Children.toArray(C).find(S=>m.isValidElement(S)&&S.type===m5),u=m.Children.toArray(C).filter(S=>!(m.isValidElement(S)&&S.type===m5)),Z=r.jsx("div",{...i,children:u});return r.jsx(v0.Provider,{value:v,children:r.jsx("div",{className:"inline-block","data-ox-slot":"popover",children:r.jsx(q1,{align:H,animationDuration:100,content:Z,contentClassName:"ox-popover-animate",disabled:L,open:d,portal:!0,position:a,trigger:"click",onOpenChange:l,children:o})})})},Kt2=({children:H,className:C,showCloseButton:V=!0,...L})=>{const{open:M,setOpen:e}=u0();return r.jsxs("div",{className:s("ox-gray-border relative min-w-[16rem] max-w-sm rounded-lg bg-gray-200 p-4 shadow-lg",C),"data-ox-slot":"popover-content","data-ox-state":M?"open":"closing",...L,children:[V&&r.jsx("div",{className:"absolute right-2 top-2",children:r.jsx(m1,{"aria-label":"Close popover",size:"sm",variant:"ghost",onClick:()=>e(!1),children:r.jsx(m1.Icon,{path:"mdiClose"})})}),r.jsx("div",{className:s({"pr-8":V}),children:H})]})},x5=qt2;x5.Content=Kt2;x5.Trigger=m5;const Xt2={purple:"bg-purple-500/30",lime:"bg-lime-400/30",red:"bg-red-500/30",yellow:"bg-yellow-500/30",green:"bg-green-500/30",blue:"bg-blue-500/30",indigo:"bg-indigo-500/30",pink:"bg-pink-500/30",amber:"bg-amber-500/30",emerald:"bg-emerald-500/30",teal:"bg-teal-500/30",cyan:"bg-cyan-500/30",sky:"bg-sky-500/30",violet:"bg-violet-500/30",fuchsia:"bg-fuchsia-500/30",orange:"bg-orange-500/30",rose:"bg-rose-500/30",gray:"bg-gray-1100/30"},Jt2=({buffer:H,className:C,max:V=100,value:L=0,variant:M="violet",...e})=>{const a=Math.max(0,Math.min(L,V)),i=H?Math.max(0,Math.min(H,V)):0,t=a1[M];return r.jsxs("div",{className:s("relative h-2 overflow-hidden rounded-full bg-gray-300",C),"data-ox-slot":"progress",role:"progressbar",...e,children:[H!==void 0?r.jsx("div",{className:s("absolute inset-y-0 left-0 rounded-full transition-all duration-300",Xt2[M]),style:{width:`${i/V*100}%`}}):null,r.jsx("div",{className:s("absolute inset-y-0 left-0 rounded-full transition-all duration-300",t.backgroundSolid),style:{width:`${a/V*100}%`}})]})},CA2={sm:40,md:48},HA2=({className:H,max:C=100,showPercentage:V=!1,size:L="sm",value:M=0,variant:e="violet",...a})=>{const i=Math.max(0,Math.min(M,C)),t=Math.round(i/C*100),n=CA2[L],A=a1[e],d=(n-4)/2,l=2*Math.PI*d,v=l-i/C*l;return r.jsx("div",{className:s("inline-flex items-center justify-center",H),"data-ox-slot":"progress",...a,children:r.jsxs("div",{className:"relative",children:[r.jsx("svg",{className:"-rotate-90 transform",height:n,width:n,children:r.jsx("circle",{className:s("transition-all duration-300 ease-in-out",A.stroke),cx:n/2,cy:n/2,fill:"none",r:d,strokeLinecap:"round",strokeWidth:"4",style:{strokeDasharray:l,strokeDashoffset:v}})}),V&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsxs("span",{className:s("text-gray-1200 font-medium",{"text-xxs":L==="sm","text-xs":L==="md"}),children:[t,"%"]})})]})})},c0=Jt2;c0.Circular=HA2;const b5=({className:H,decorative:C=!0,orientation:V="horizontal",...L})=>r.jsx("div",{"aria-orientation":C?void 0:V,className:s("shrink-0 bg-gray-400",V==="horizontal"?"h-0.25 w-full":"w-0.25 h-full",H),"data-ox-slot":"separator",role:C?"none":"separator",...L}),VA2={rectangle:"rounded-lg",circle:"rounded-full"},R2=({animate:H=!0,className:C,color:V="gray",fullWidth:L=!1,height:M,shape:e="rectangle",width:a,...i})=>{const t={height:typeof M=="number"?`${M}px`:M,width:typeof a=="number"?`${a}px`:a};return r.jsx("div",{"aria-busy":"true","aria-label":"Loading...",className:s("relative overflow-hidden",a1[V].background,VA2[e],{"animate-pulse":H,"w-full":L},C),"data-ox-slot":"skeleton",role:"status",style:t,...i})},LA2=({animate:H=!0,className:C,color:V="gray",fullWidth:L=!1,height:M=20,lines:e=1,width:a,...i})=>{const t=n=>{if(!L){if(a!==void 0&&!Array.isArray(a))return typeof a=="number"?`${a}px`:a;if(Array.isArray(a)&&a.length>0){const A=a[n%a.length];return typeof A=="number"?`${A}px`:A}return"100px"}};return r.jsx("div",{className:s("flex flex-col space-y-2",C),...i,children:Array.from({length:e}).map((n,A)=>r.jsx(R2,{animate:H,color:V,"data-ox-slot":"skeleton-text",fullWidth:L,height:M,width:t(A)},A))})},MA2={sm:{track:"h-1",handle:"size-4",text:"text-xs"},md:{track:"h-2",handle:"size-5",text:"text-sm"}},v3=(H,C,V)=>{if(Array.isArray(H))return[Math.max(C,Math.min(V,H[0])),Math.max(C,Math.min(V,H[1]))];const L=Math.max(C,Math.min(V,H));return[L,L]},u3=(H,C,V)=>(H-C)/(V-C)*100,eA2=(H,C,V,L)=>{const M=C+H/100*(V-C),e=Math.round(M/L)*L;return Math.max(C,Math.min(V,e))},rA2=({"aria-label":H,"aria-labelledby":C,className:V,defaultValue:L=0,disabled:M=!1,max:e=100,min:a=0,onChange:i,onChangeCommitted:t,orientation:n="horizontal",showValue:A=!1,size:d="md",step:l=1,value:v,...o})=>{const u=m.useRef(null),Z=m.useRef(!1),S=m.useRef(0),h=v!==void 0,f=Array.isArray(L)||Array.isArray(v),[w,p]=m.useState(v3(v||L,a,e)),O=h?v3(v,a,e):w,D=m.useCallback(j=>{if(M)return;const x=f?j:j[0];h||p(j),i?.(x)},[M,f,h,i]),y=m.useCallback(j=>{if(!u.current)return a;const x=u.current.getBoundingClientRect(),X=n==="horizontal"?(j.clientX-x.left)/x.width*100:(x.bottom-j.clientY)/x.height*100;return eA2(Math.max(0,Math.min(100,X)),a,e,l)},[a,e,l,n]),F=m.useCallback((j,x)=>{if(M)return;j.preventDefault(),Z.current=!0,S.current=x||0;const X=y(j);if(f&&x!==void 0){const g=[...O];g[x]=X,x===0&&g[0]>g[1]?g[1]=g[0]:x===1&&g[1]<g[0]&&(g[0]=g[1]),D(g)}else D([X,X])},[M,y,f,O,D]),$=m.useCallback(j=>{if(M||Z.current)return;const x=y(j);if(f){const[X,g]=O,c=Math.abs(x-X),T=Math.abs(x-g),B=c<=T?0:1,P=[...O];P[B]=x,D(P)}else D([x,x])},[M,y,f,O,D]),q=m.useCallback((j,x)=>{if(M)return;let X=0;switch(j.key){case"ArrowRight":case"ArrowUp":X=l;break;case"ArrowLeft":case"ArrowDown":X=-l;break;case"PageUp":X=(e-a)*.1;break;case"PageDown":X=-(e-a)*.1;break;case"Home":X=a-O[x];break;case"End":X=e-O[x];break;default:return}j.preventDefault();const g=[...O];g[x]=Math.max(a,Math.min(e,O[x]+X)),f&&(x===0&&g[0]>g[1]?g[1]=g[0]:x===1&&g[1]<g[0]&&(g[0]=g[1])),D(g)},[M,l,e,a,O,f,D]);m.useEffect(()=>{const j=X=>{if(!Z.current)return;const g=y(X);if(f){const c=[...O];c[S.current]=g,S.current===0&&c[0]>c[1]?c[1]=c[0]:S.current===1&&c[1]<c[0]&&(c[0]=c[1]),D(c)}else D([g,g])},x=()=>{Z.current&&(Z.current=!1,t?.(f?O:O[0]))};return Z.current&&(document.addEventListener("mousemove",j),document.addEventListener("mouseup",x)),()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",x)}},[y,f,O,D,t]);const K=MA2[d],[k,_]=O,z=u3(k,a,e),N=u3(_,a,e);return r.jsx("div",{className:s("w-full py-3",V),"data-ox-slot":"slider",...o,children:r.jsxs("div",{className:"relative py-3",children:[r.jsxs("div",{className:s("relative w-full cursor-pointer rounded-full bg-gray-300",K.track,{"ox-default-disabled":M}),ref:u,onClick:$,children:[r.jsx("div",{className:"absolute h-full rounded-full bg-violet-700",style:{left:`${f?z:0}%`,width:`${f?N-z:z}%`}}),r.jsx("div",{"aria-label":f?`${H} minimum`:H,"aria-labelledby":C,"aria-orientation":n,"aria-valuemax":e,"aria-valuemin":a,"aria-valuenow":k,"aria-valuetext":String(k),className:s("ox-violet-outset-focus absolute top-1/2 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-violet-700 bg-gray-50 active:cursor-grabbing",K.handle,{"cursor-not-allowed":M}),role:"slider",style:{left:`${z}%`},tabIndex:M?-1:0,onKeyDown:j=>q(j,0),onMouseDown:j=>F(j,0)}),f?r.jsx("div",{"aria-label":f?`${H} maximum`:H,"aria-labelledby":C,"aria-orientation":n,"aria-valuemax":e,"aria-valuemin":a,"aria-valuenow":_,"aria-valuetext":String(_),className:s("ox-violet-outset-focus absolute top-1/2 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-violet-700 bg-gray-50 active:cursor-grabbing",K.handle,{"cursor-not-allowed":M}),role:"slider",style:{left:`${N}%`},tabIndex:M?-1:0,onKeyDown:j=>q(j,1),onMouseDown:j=>F(j,1)}):null]}),A&&r.jsxs("div",{className:s("text-gray-1000 mt-2 flex justify-between text-xs"),children:[r.jsx("span",{children:f?`${k} - ${_}`:k}),r.jsxs("span",{children:[a," - ",e]})]})]})})},aA2={sm:.8,md:1.2},iA2=({className:H,size:C="md",variant:V="violet",...L})=>{const M=C1.isString(C)?aA2[C]:C,e=a1[V];return r.jsx("div",{className:s("inline-flex items-center justify-center",H),"data-ox-slot":"spinner",...L,children:r.jsx(e1,{className:s("animate-spin",e.text),path:"mdiLoading",size:M})})},tA2={loading:{title:"Loading...",message:"Good things take time",icon:"mdiLoading",showAction:!1},empty:{title:"Nothing here",message:"It's so empty... like my soul",icon:"mdiPackageVariant",showAction:!1},offline:{title:"You're offline",message:"Did you forget to pay the internet bill?",icon:"mdiWifiOff",showAction:!0},success:{title:"Success!",message:"Everything went perfectly as planned",icon:"mdiCheckCircle",showAction:!1},warning:{title:"Heads up!",message:"Something needs your attention",icon:"mdiAlertCircle",showAction:!1},info:{title:"Just so you know",message:"Here's some helpful information",icon:"mdiInformationCircle",showAction:!1},401:{title:"Please log in",message:"You need to authenticate to access this page",showAction:!0},403:{title:"Access denied",message:"You don't have permission to view this content",showAction:!0},404:{title:"Page not found",message:"Nothing to see here... just... go away... now.",showAction:!0},408:{title:"Request timeout",message:"Taking too long? Try refreshing the page",showAction:!0},429:{title:"Slow down there!",message:"Too many requests. Take a coffee break",showAction:!0},500:{title:"Oops! We broke something",message:"Don't worry, it's not your fault... probably",showAction:!0},502:{title:"Bad gateway",message:"The server is having an existential crisis",showAction:!0},503:{title:"Taking a quick nap",message:"Service will be back after coffee break",showAction:!0},504:{title:"Server timeout",message:"Server is slower than a Windows 95 boot",showAction:!0}},AA2={sm:{container:"max-w-sm space-y-4",spacing:"space-y-1",title:"text-lg",message:i1.sm,numberText:"text-3xl"},md:{container:"max-w-md space-y-6",spacing:"space-y-2",title:"text-xl",message:"text-base",numberText:"text-4xl"}},nA2=H=>H==="success"?f1.success:H==="warning"?f1.warning:H==="info"?f1.info:typeof H=="number"?f1.error:{text:"text-violet-700"},oA2=({action:H,children:C,className:V,inline:L=!1,message:M,onBack:e,size:a="sm",title:i,type:t,...n})=>{if(C)return r.jsx("div",{className:s("min-h-screen w-full",V),children:C});const A=tA2[t],d=i||A.title,l=M||A.message,v=()=>{e?e():window.history.back()},o=()=>H!==void 0?H:A.showAction?r.jsx(m1,{size:a,variant:"secondary",onClick:v,children:"Back"}):null,u=AA2[a],Z=nA2(t);return r.jsx("div",{"aria-live":typeof t=="number"?"assertive":"polite",className:s("flex w-full items-center justify-center",{"min-h-screen bg-gray-50":!L,"h-full":L},V),"data-ox-slot":"status-display",role:typeof t=="number"?"alert":"status",...n,children:r.jsxs("div",{className:s("flex flex-col items-center text-center",u.container),children:[r.jsx("div",{className:"flex items-center space-x-4",children:A.icon?r.jsx(e1,{className:s(Z.text,{"animate-spin":t==="loading"}),path:A.icon,size:a==="md"?1.75:1.25}):typeof t=="number"?r.jsx("div",{className:s("bg-gradient-to-br from-violet-700 from-20% to-rose-500 bg-clip-text font-bold text-transparent",u.numberText),children:t}):null}),r.jsxs("div",{className:u.spacing,children:[r.jsx("h1",{id:"status-title","aria-describedby":"status-message",className:s("text-gray-1200 font-bold",u.title),children:d}),r.jsx("p",{id:"status-message",className:s("text-gray-1000",u.message),children:l})]}),o()]})})},Z0=m.createContext(null),y5=()=>{const H=m.useContext(Z0);if(!H)throw new Error("OxStepperItem must be used within OxStepper");return H},S0=({children:H,className:C,...V})=>{const{orientation:L}=y5();return r.jsx("div",{className:s("mt-2 p-4",{"border-t border-gray-400":L==="vertical"},C),"data-ox-slot":"stepper-actions",...V,children:H})},dA2=(H,C,V)=>H==="error"?f1.error.icon:H==="warning"?f1.warning.icon:C||(V?f1.success.icon:null),f0=(H,C)=>H==="error"?f1.error:H==="warning"?f1.warning:a1[C],c3=(H,C)=>H==="error"||H==="warning"?C.text:"text-gray-1200",p0=({className:H,state:C,stepIndex:V,...L})=>{const{color:M,currentStep:e,orientation:a}=y5(),i=e>V,n=f0(C||(i?"completed":"current"),M);return r.jsx("div",{className:s("flex-1 border transition-colors duration-300",{"mx-4 mt-[19px]":a==="horizontal","my-2 min-h-6":a==="vertical","border-gray-400":!i,[n.border]:i},H),"data-ox-slot":"stepper-connector",...L})},e2=({children:H,className:C,disabled:V=!1,...L})=>r.jsx("div",{className:s("text-gray-1100 text-pretty text-xs leading-relaxed",{"ox-default-disabled":V},C),"data-ox-slot":"description",...L,children:H}),lA2=({children:H,className:C,icon:V="mdiAlertCircleOutline",...L})=>H?r.jsxs("div",{className:s("grid grid-cols-[auto_1fr] items-center gap-1 text-pretty text-xs text-rose-400",C),"data-ox-slot":"error",role:"alert",...L,children:[V?r.jsx(e1,{className:"shrink-0 text-current",path:V,size:c1.md}):null,H]}):null,mA2={1:"text-2xl font-bold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold",6:"text-sm font-medium",7:"text-sm"},sA2=({as:H="h2",children:C,className:V,level:L,...M})=>{const e=L??(H!=="div"?parseInt(H.slice(1)):2),a=C1.clamp(e,1,7),i={className:s("text-gray-1200",mA2[a],V),"data-ox-slot":"heading",...M,...H==="div"&&{role:"heading","aria-level":e}};return m.createElement(H,i,C)},vA2=({children:H,className:C,disabled:V=!1,htmlFor:L,required:M=!1,...e})=>r.jsxs("label",{className:s("block text-sm font-medium",{"text-gray-1200":!V,"ox-default-disabled":V},C),"data-ox-slot":"label",htmlFor:L,...e,children:[H,M&&r.jsx("span",{className:"ml-1 text-rose-400",children:"*"})]}),uA2=({children:H,className:C,disabled:V=!1,required:L=!1,...M})=>r.jsxs("legend",{className:s("block text-base font-semibold",{"text-gray-1200":!V,"ox-default-disabled":V},C),"data-ox-slot":"legend",...M,children:[H,L&&r.jsx("span",{className:"ml-1 text-rose-400",children:"*"})]}),cA2={completed:"check",error:"close",warning:"warning",current:"current step",upcoming:"upcoming step"},h0=({children:H,className:C,description:V,icon:L,state:M,stepIndex:e=0,title:a,...i})=>{const{color:t,currentStep:n,onStepChange:A,orientation:d,totalSteps:l,type:v}=y5(),o=n===e,u=n>e,Z=M||(e<n?"completed":e===n?"current":"upcoming"),S=v==="non-linear"||u||o,h=dA2(Z,L,u),f=f0(Z,t),w=()=>{S&&A&&A(e)},p=()=>r.jsx("button",{"aria-current":o?"step":void 0,"aria-describedby":V?`step-${e}-desc`:void 0,"aria-label":`${a} - ${cA2[Z]} (${e+1} of ${l})`,className:s("flex items-center justify-center rounded-lg transition-colors","enabled:cursor-pointer",Z==="error"?"ox-rose-outset-focus":"ox-violet-outset-focus",{"cursor-pointer":S,"opacity-50":Z==="upcoming"}),disabled:!S,type:"button",onClick:w,children:r.jsx("div",{className:s("flex size-10 flex-shrink-0 items-center justify-center rounded-lg border",f.border,f.background),children:h?r.jsx(e1,{className:f.text,path:h}):r.jsx("span",{className:s("text-base font-medium text-current"),children:e+1})})});return d==="horizontal"?r.jsxs("div",{className:s("flex flex-col items-center text-center",C),"data-ox-slot":"stepper-item",...i,children:[p(),r.jsxs("div",{className:"mt-2",children:[r.jsx("h6",{className:s("text-sm font-medium",c3(Z,f)),children:a}),V?r.jsx(e2,{id:`step-${e}-desc`,children:V}):null]})]}):r.jsxs("div",{className:s("flex gap-3",C),"data-ox-slot":"stepper-item",...i,children:[r.jsxs("div",{className:"flex flex-col items-center",children:[p(),e<l-1?r.jsx(p0,{state:M,stepIndex:e}):null]}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("h6",{className:s("text-sm font-medium",c3(Z,f)),children:a}),V?r.jsx(e2,{id:`step-${e}-desc`,children:V}):null]}),o&&H?r.jsx("div",{className:"ox-gray-border mb-4 rounded-lg bg-gray-50 p-4",children:H}):null]})]})},ZA2=({children:H,className:C,color:V="violet",currentStep:L=0,onStepChange:M,orientation:e="vertical",type:a="linear",...i})=>{const t=m.Children.toArray(H).filter(l=>m.isValidElement(l)&&l.type===h0),n=m.Children.toArray(H).find(l=>m.isValidElement(l)&&l.type===S0),A=t.map((l,v)=>m.cloneElement(l,{stepIndex:v,key:v})),d={color:V,currentStep:L,onStepChange:M,orientation:e,totalSteps:t.length,type:a};return r.jsx(Z0.Provider,{value:d,children:r.jsxs("div",{"aria-label":"Step-by-step progress","aria-valuemax":t.length,"aria-valuenow":L+1,className:s("w-full",C),"data-ox-slot":"stepper",role:"navigation",...i,children:[e==="horizontal"?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex w-full items-start",children:A.map((l,v)=>r.jsxs(m.Fragment,{children:[m.cloneElement(l,{className:s("min-w-0 flex-1",l.props.className)}),v<t.length-1?r.jsx(p0,{state:t[v].props.state,stepIndex:v}):null]},v))}),t[L]?.props.children?r.jsx("div",{className:"ox-gray-border mt-6 rounded-lg bg-gray-50 p-4",children:t[L].props.children}):null]}):A,n]})})},w5=ZA2;w5.Actions=S0;w5.Item=h0;const g0=m.createContext(void 0),SA2=({allRowIds:H=[],children:C,className:V,onSelectionChange:L,selectable:M=!1,selectedRows:e=[],...a})=>{const i=m.useMemo(()=>{const t=H.length>0&&e.length===H.length,n=e.length>0&&e.length<H.length;return{allRowIds:H,selectable:M,selectedRows:e,onSelectionChange:L,isSelected:A=>e.includes(A),toggleSelection:A=>{if(!L)return;const d=e.includes(A);L(d?e.filter(l=>l!==A):[...e,A])},toggleAll:()=>{L&&L(t?[]:[...H])},isAllSelected:t,isIndeterminate:n}},[H,M,e,L]);return r.jsx(g0.Provider,{value:i,children:r.jsx("div",{className:"ox-gray-border overflow-hidden rounded-lg bg-gray-50",children:r.jsx("table",{className:s("w-full table-auto",V),"data-ox-slot":"table",...a,children:C})})})},fA2=({children:H,className:C,...V})=>r.jsx("tbody",{className:C,"data-ox-slot":"table-body",...V,children:H}),pA2=({children:H,className:C,...V})=>r.jsx("td",{className:s("text-gray-1200 px-3 py-2 text-sm",C),"data-ox-slot":"table-cell",...V,children:H}),hA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("mb-4 flex items-center justify-between gap-4",C),"data-ox-slot":"table-controls",...V,children:H}),gA2=({children:H,className:C,...V})=>r.jsx("tfoot",{className:s("border-t border-gray-400 bg-gray-100 font-semibold",C),"data-ox-slot":"table-footer",...V,children:H}),O0=m.createContext(void 0),OA2=()=>m.useContext(O0),xA2={sm:"size-4.5",md:"size-5.5"},bA2=({checked:H,className:C,defaultChecked:V,disabled:L=!1,error:M=!1,id:e,indeterminate:a=!1,name:i,onChange:t,onCheckedChange:n,required:A=!1,size:d,value:l,...v})=>{const o=m.useId(),u=OA2(),Z=m.useRef(null),h=`${e||o}-checkbox`,f=d||u?.size||"sm",w=L||u?.disabled||!1,p=i||u?.name,O=H!==void 0||u&&l!==void 0;let D;u&&l!==void 0?D=u.value?.includes(l)||!1:D=H,m.useEffect(()=>{Z.current&&(Z.current.indeterminate=a)},[a]);const y=a?"mixed":D===!0?"true":"false",F=q=>{const K=q.target.checked;if(u&&l!==void 0){const k=u.value,_=K?[...k,l]:k.filter(z=>z!==l);u.onChange?.(_)}else t?.(q),n?.(K)},$=a?"mdiMinus":"mdiCheck";return r.jsxs("div",{className:"relative inline-flex shrink-0",children:[r.jsx("input",{id:h,"aria-checked":y,"aria-invalid":M,"aria-required":A,"data-ox-slot":"checkbox",ref:Z,...O?{checked:D}:{defaultChecked:V},className:s("peer cursor-pointer appearance-none rounded-sm bg-gray-50",xA2[f],"ox-violet-outset-focus checked:bg-violet-700 disabled:cursor-not-allowed disabled:opacity-50",{"ox-rose-border":M,"ox-gray-border":!M},C),disabled:w,name:p,required:A,type:"checkbox",value:l,onChange:F,...v,"data-ox-state":w?"disabled":a?"indeterminate":D?"checked":"unchecked"}),r.jsx(e1,{className:s("text-gray-1200 pointer-events-none absolute inset-0 m-auto",{"opacity-80":a,"peer-checked:opacity-80":!a,"opacity-0":!a}),path:$,size:c1[f]})]})},yA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-1","input:data-[ox-slot=checkbox]:[grid-column-start:var(--ox-field-control-col)] input:data-[ox-slot=checkbox]:[grid-row-start:var(--ox-field-control-row)]","*:data-[ox-slot=label]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=label]:[grid-row-start:var(--ox-field-label-row)]","*:data-[ox-slot=description]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=description]:[grid-row-start:var(--ox-field-desc-row)]",C),...V,children:H}),wA2=({children:H,className:C,disabled:V=!1,name:L,onChange:M,size:e="sm",value:a=[],...i})=>r.jsx(O0.Provider,{value:{value:a,onChange:M,name:L,size:e,disabled:V},children:r.jsx("div",{className:s("space-y-2",C),"data-ox-slot":"checkbox-group",role:"group",...i,children:H})}),t2=bA2;t2.Group=wA2;t2.Field=yA2;const x0=m.createContext(null),Z3=H=>{const C={B:1,KB:1024,MB:1048576,GB:1073741824},V=H.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!V)throw new Error(`Invalid size format: ${H}. Use format like "5MB", "1.5GB", etc.`);const[,L,M]=V;return parseFloat(L)*C[M.toUpperCase()]},kA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),TA2=(H,C)=>C.some(V=>V.includes("/")?V.endsWith("/*")?H.type.startsWith(V.slice(0,-1)):H.type===V:H.name.toLowerCase().endsWith(`.${V.toLowerCase()}`)),PA2=({accept:H=[],children:C,className:V,disabled:L=!1,maxFiles:M,maxSize:e,minSize:a,multiple:i=!1,onError:t,onFileSelect:n,...A})=>{const[d,l]=m.useState([]),[v,o]=m.useState(!1),[u,Z]=m.useState(),S=m.useCallback(F=>{if(!i&&F.length>1)return"Only single file selection is allowed";if(M&&F.length>M)return`Maximum ${M} file${M===1?"":"s"} allowed`;if(F.length===0)return null;if(H.length>0&&F.filter(q=>!TA2(q,H)).length>0)return`Invalid file type. Accepted formats: ${H.join(", ")}`;if(e){const $=Z3(e);if(F.filter(K=>K.size>$).length>0)return`File size must not exceed ${e}`}if(a){const $=Z3(a);if(F.filter(K=>K.size<$).length>0)return`File size must be at least ${a}`}return null},[H,M,e,a,i]),h=m.useCallback(F=>{const $=S(F);if($){Z($),t?.($);return}Z(void 0),l(F),n?.(F)},[S,t,n]),f=m.useCallback(()=>{l([]),Z(void 0)},[]),w=m.useMemo(()=>({accept:H,clearFiles:f,disabled:L,error:u,files:d,isDragActive:v,maxFiles:M,maxSize:e,minSize:a,multiple:i,onError:t,onFileSelect:n,selectFiles:h,validateFiles:S}),[H,f,L,u,d,v,M,e,a,i,t,n,h,S]),p=m.useCallback(F=>{F.preventDefault(),F.stopPropagation(),L||o(!0)},[L]),O=m.useCallback(F=>{F.preventDefault(),F.stopPropagation(),!L&&!F.currentTarget.contains(F.relatedTarget)&&o(!1)},[L]),D=m.useCallback(F=>{F.preventDefault(),F.stopPropagation()},[]),y=m.useCallback(F=>{if(F.preventDefault(),F.stopPropagation(),L)return;o(!1);const $=Array.from(F.dataTransfer.files);h($)},[L,h]);return r.jsx(x0.Provider,{value:w,children:r.jsxs("div",{className:s("relative",V),"data-ox-slot":"file-upload",...A,"data-ox-state":v?"drag-active":"idle",onDragEnter:p,onDragLeave:O,onDragOver:D,onDrop:y,children:[C,r.jsx("input",{accept:H.length>0?kA2(H):void 0,className:"hidden","data-ox-slot":"file-upload-input",disabled:L,multiple:i,style:{display:"none"},type:"file"})]})})},k5=()=>{const H=m.useContext(x0);if(!H)throw new Error("useFileUploadContext must be used within a FileUploadContext.Provider");return H},BA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),RA2=({children:H,className:C,...V})=>{const L=m.useRef(null),{accept:M,disabled:e,error:a,isDragActive:i,multiple:t,selectFiles:n}=k5(),A=()=>{!e&&L.current&&L.current.click()},d=l=>{const v=Array.from(l.target.files||[]);v.length>0&&n(v),l.target.value=""};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:s("rounded-lg border-2 border-dashed p-6 transition-all duration-200",{"border-gray-400 bg-gray-50":!i&&!a,"border-violet-500 bg-gray-50":i,"border-rose-500 bg-gray-50":a,"cursor-pointer hover:border-violet-500 focus:border-violet-500 focus:outline-none":!a&&!e,"ox-default-disabled":e},C),"data-ox-slot":"file-upload-area",role:"button",tabIndex:e?-1:0,...V,"data-ox-state":a?"error":i?"drag-active":e?"disabled":"idle",onClick:A,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&!e&&(l.preventDefault(),A())},children:[H,a&&r.jsx("div",{className:"mt-2 text-center text-sm text-rose-500",children:a})]}),r.jsx("input",{accept:M.length>0?BA2(M):void 0,className:"hidden","data-ox-slot":"file-upload-area-input",disabled:e,multiple:t,ref:L,style:{display:"none"},type:"file",onChange:d})]})},FA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),EA2=({children:H,className:C,size:V="sm",variant:L="primary",...M})=>{const e=m.useRef(null),{accept:a,disabled:i,multiple:t,selectFiles:n}=k5(),A=()=>{!i&&e.current&&e.current.click()},d=l=>{const v=Array.from(l.target.files||[]);v.length>0&&n(v),l.target.value=""};return r.jsxs(r.Fragment,{children:[r.jsx(m1,{className:s("cursor-pointer",C),"data-ox-slot":"file-upload-button",disabled:i,size:V,type:"button",variant:L,...M,onClick:A,children:H}),r.jsx("input",{accept:a.length>0?FA2(a):void 0,className:"hidden","data-ox-slot":"file-upload-button-input",disabled:i,multiple:t,ref:e,style:{display:"none"},type:"file",onChange:d})]})},DA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),NA2=({children:H,className:C,...V})=>{const L=m.useRef(null),[M,e]=m.useState(!1),{accept:a,disabled:i,isDragActive:t,multiple:n,selectFiles:A}=k5(),d=()=>{!i&&L.current&&L.current.click()},l=o=>{const u=Array.from(o.target.files||[]);u.length>0&&A(u),o.target.value=""},v=(M||t)&&!i;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:s("ox-backdrop-blur-parent group relative w-fit cursor-pointer overflow-hidden rounded-lg","ox-violet-outset-focus",{"cursor-not-allowed opacity-50":i},C),"data-ox-slot":"file-upload-overlay",role:"button",tabIndex:i?-1:0,...V,"data-ox-state":t?"drag-active":M?"hovered":i?"disabled":"idle",onClick:d,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&!i&&(o.preventDefault(),d())},onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[H,r.jsx("div",{className:s("absolute inset-0 flex w-full items-center justify-center transition-all duration-200","bg-gray-50/50 backdrop-blur-[2px]",{"pointer-events-none opacity-0":!v,"opacity-100":v,"bg-violet-700/60":t}),"data-ox-slot":"file-upload-overlay-backdrop",children:r.jsx("div",{className:s("flex flex-col items-center gap-2 text-white transition-transform duration-200",{"scale-90":!v,"scale-100":v,"scale-110":t}),children:r.jsx(e1,{className:"drop-shadow-sm",path:t?"mdiCloudUpload":"mdiUpload",size:1.5})})})]}),r.jsx("input",{accept:a.length>0?DA2(a):void 0,className:"hidden","data-ox-slot":"file-upload-overlay-input",disabled:i,multiple:n,ref:L,style:{display:"none"},type:"file",onChange:l})]})},F2=PA2;F2.Area=RA2;F2.Button=EA2;F2.Overlay=NA2;const jA2=({children:H,className:C,fullWidth:V=!1,noValidate:L=!0,...M})=>r.jsx("form",{className:s({"w-full":V},C),"data-ox-slot":"form",noValidate:L,...M,children:H}),IA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("space-y-1",C),"data-ox-slot":"form-field",...V,children:H}),WA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("space-y-6",C),"data-ox-slot":"form-fields",...V,children:H}),_A2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid gap-6 lg:grid-cols-[1fr_2fr] lg:gap-8",C),"data-ox-slot":"form-group",...V,children:H}),E2=jA2;E2.Group=_A2;E2.Fields=WA2;E2.Field=IA2;const A2=m.createContext(null),k1=()=>{const H=m.useContext(A2);if(!H)throw new Error("useBaseInputContext must be used within a BaseInput component");return H},T1=({children:H,className:C,path:V,...L})=>{const{disabled:M,size:e}=k1();return r.jsx("button",{className:s("enabled:cursor-pointer","disabled:ox-default-disabled",{[i1[e]]:!V},C),"data-ox-slot":"input-button",disabled:M,tabIndex:-1,type:"button",...L,children:V?r.jsx(e1,{path:V,size:c1[e]}):H})},zA2=H=>r.jsx(T1,{...H}),D2=({children:H,className:C,...V})=>{const{error:L,showValidation:M,size:e,validationMessage:a}=k1();return r.jsx(U0,{content:a,open:M,position:"bottom",trigger:"click",variant:"error",children:r.jsx("div",{className:s("flex w-full items-center gap-1.5 rounded-lg bg-gray-50 p-1.5","ox-violet-outset-within-focus",u1[e],{"ox-gray-border":!L,"ox-rose-border":L},C),"data-ox-slot":"input-container",...V,children:H})})},b0=m.createContext(null),GA2=({defaultValue:H,onChange:C,value:V})=>{const[L,M]=C1.useControllableState({value:V,defaultValue:H??"",onChange:o=>C?.(o??"")}),e=o=>{if(!o)return{day:"",month:"",year:""};const[u="",Z="",S=""]=o.split("-");return{day:S,month:Z,year:u}},a=(o,u,Z)=>{if(!o&&!u&&!Z)return"";const S=o?o.padStart(2,"0"):"",h=u?u.padStart(2,"0"):"";return`${Z?Z.padStart(4,"0"):""}-${h}-${S}`},{day:i,month:t,year:n}=e(L);return{day:i,month:t,year:n,setValue:o=>{const u=o.day??i,Z=o.month??t,S=o.year??n,h=a(u,Z,S);M(h)},dateValue:L,setDateValue:M,isValidCompleteDate:(o,u,Z)=>{if(!o||!u||!Z||Z.length<4)return!1;const S=a(o,u,Z),h=E6(S,"yyyy-MM-dd",new Date);return $3(h)},getMaxDayForMonth:(o,u)=>{if(!o)return 31;const Z=parseInt(o,10);if(Z<1||Z>12)return 31;const S=u&&u.length===4?parseInt(u,10):new Date().getFullYear(),h=new Date(S,Z-1,1);return j9(h)},autoCompleteYear:o=>o.length===2?parseInt(o,10)<50?`20${o}`:`19${o}`:o}},UA2=({children:H,className:C,customValidationMessage:V,defaultValue:L="",disabled:M=!1,error:e=!1,onChange:a,pickOnly:i=!1,readOnly:t=!1,required:n=!1,showValidation:A=!1,showValidationTooltip:d=!1,size:l="sm",value:v,...o})=>{const u=t||i,{autoCompleteYear:Z,day:S,getMaxDayForMonth:h,isValidCompleteDate:f,month:w,setValue:p,year:O}=GA2({value:v,defaultValue:L,onChange:a}),[D,y]=m.useState(""),[F,$]=m.useState(A),[q,K]=m.useState(!1),k=S&&w&&O&&O.length===4?`${O}-${w.padStart(2,"0")}-${S.padStart(2,"0")}`:void 0,_=N=>{const[j,x,X]=N.split("-");p({day:X,month:x,year:j}),K(!1)},z=r.jsx("div",{className:"ox-gray-border z-50 rounded-lg bg-gray-200 p-4",children:r.jsx(e0,{value:k,onChange:_})});return r.jsx(q1,{align:"start",content:z,open:q,portal:!0,position:"bottom",trigger:"click",onOpenChange:K,children:r.jsx(A2.Provider,{value:{disabled:M,error:e,showValidation:F,showValidationTooltip:d,required:n,size:l,validationMessage:V||D,setShowValidation:$,setValidationMessage:y},children:r.jsx(b0.Provider,{value:{day:S,month:w,year:O,setValue:p,isValidCompleteDate:f,getMaxDayForMonth:h,autoCompleteYear:Z,readOnly:u,pickOnly:i,isCalendarOpen:q,setIsCalendarOpen:K},children:r.jsx(D2,{className:s("w-fit",C),"data-ox-slot":"input-date-container",...o,children:H})})})})},N2=({children:H,className:C,path:V,...L})=>{const{disabled:M,size:e}=k1();return r.jsx("span",{className:s("enabled:cursor-pointer",{"ox-default-disabled":M},C),"data-ox-slot":"input-icon",tabIndex:-1,...L,children:V?r.jsx(e1,{path:V,size:c1[e]}):H})},QA2=H=>r.jsx(N2,{...H}),N1=({className:H,id:C,...V})=>{const L=m.useId(),{customValidationMessage:M,disabled:e,error:a,required:i,setShowValidation:t,setValidationMessage:n,showValidationTooltip:A,size:d}=k1(),l=o=>{o.preventDefault(),A&&(n(M||o.currentTarget.validationMessage),t(!0))},v=C||L;return r.jsx("input",{id:v,"aria-invalid":a,"aria-required":i,className:s("enabled:text-gray-1200 w-full min-w-10 appearance-none bg-transparent outline-none","disabled:ox-default-disabled placeholder:text-gray-900",i1[d],H),disabled:e,required:i,onInput:()=>t(!1),onInvalid:l,...V})},y0=()=>{const H=m.useContext(b0);if(!H)throw new Error("useDateContext must be used within a DateInput component");return H},$A2=()=>{const{autoCompleteYear:H,day:C,getMaxDayForMonth:V,isValidCompleteDate:L,month:M,pickOnly:e,readOnly:a,setIsCalendarOpen:i,setValue:t,year:n}=y0(),{disabled:A,setValidationMessage:d,size:l}=k1(),v=m.useRef(null),o=m.useRef(null),u=m.useRef(null),Z=k=>{const _=V(M,n),z=C?parseInt(C,10):k===1?0:_+1,N=k===1?z>=_?1:z+1:z<=1?_:z-1;t({day:String(N)})},S=k=>{const _=M?parseInt(M,10):k===1?0:13,z=k===1?_>=12?1:_+1:_<=1?12:_-1,N=V(String(z),n);(C?parseInt(C,10):0)>N?t({day:String(N),month:String(z)}):t({month:String(z)})},h=k=>{const _=k.target.value,z=V(M,n);(_===""||/^\d{1,2}$/.test(_)&&parseInt(_,10)<=z)&&t({day:_})},f=k=>{const _=k.target.value;(_===""||/^\d{1,2}$/.test(_)&&parseInt(_,10)<=12)&&t({month:_})},w=k=>{const _=k.target.value;(_===""||/^\d{1,4}$/.test(_)&&parseInt(_,10)<=2100)&&t({year:_})},p=k=>{k.key==="ArrowUp"?(k.preventDefault(),Z(1)):k.key==="ArrowDown"?(k.preventDefault(),Z(-1)):(k.key==="Tab"&&!k.shiftKey||k.key==="Enter"||k.key==="-")&&(k.preventDefault(),o.current?.focus())},O=k=>{k.key==="ArrowUp"?(k.preventDefault(),S(1)):k.key==="ArrowDown"?(k.preventDefault(),S(-1)):k.key==="Tab"&&k.shiftKey?(k.preventDefault(),v.current?.focus()):k.key==="Tab"&&!k.shiftKey||k.key==="Enter"||k.key==="-"?(k.preventDefault(),u.current?.focus()):k.key==="Backspace"&&M===""&&v.current?.focus()},D=k=>{k.key==="Tab"&&k.shiftKey?(k.preventDefault(),o.current?.focus()):k.key==="Backspace"&&n===""&&o.current?.focus()},y=()=>{C&&M&&n?L(C,M,n)?d(""):d("Invalid date"):d("")},F=()=>{y()},$=()=>{y()},q=()=>{if(n.length===2){const k=H(n);t({year:k})}y()},K=()=>{e&&i(!0)};return r.jsxs("div",{className:s("flex items-center bg-transparent",{"cursor-pointer":e&&!A}),"data-ox-slot":"input-date",onClick:K,children:[r.jsx(N1,{"aria-label":"Day",autoComplete:"off",className:s("w-6 min-w-6 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"enabled:cursor-pointer":e}),inputMode:"numeric",max:"31",min:"0",pattern:"[0-9]*",placeholder:"dd",readOnly:a,ref:v,type:"number",value:C,onBlur:F,onChange:h,onKeyDown:p}),r.jsx("span",{className:s(i1[l],{"text-gray-1000":!A,"ox-default-disabled":A}),children:"-"}),r.jsx(N1,{"aria-label":"Month",autoComplete:"off",className:s("w-6 min-w-6 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"enabled:cursor-pointer":e}),inputMode:"numeric",max:"12",min:"0",pattern:"[0-9]*",placeholder:"mm",readOnly:a,ref:o,type:"number",value:M,onBlur:$,onChange:f,onKeyDown:O}),r.jsx("span",{className:s(i1[l],{"text-gray-1000":!A,"ox-default-disabled":A}),children:"-"}),r.jsx(N1,{"aria-label":"Year",autoComplete:"off",className:s("w-10 min-w-10 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"enabled:cursor-pointer":e}),inputMode:"numeric",max:"2100",min:"0",pattern:"[0-9]*",placeholder:"yyyy",readOnly:a,ref:u,type:"number",value:n,onBlur:q,onChange:w,onKeyDown:D})]})},YA2=({children:H,...C})=>{const{isCalendarOpen:V,setIsCalendarOpen:L}=y0();return r.jsx(T1,{...C,path:"mdiCalendar",onClick:()=>L(!V),children:H})},n2=$A2;n2.Container=UA2;n2.Icon=QA2;n2.Button=zA2;n2.PickerButton=YA2;const qA2=H=>r.jsx(T1,{...H}),w0=m.createContext(null),KA2=({children:H,defaultValue:C,disabled:V=!1,error:L=!1,locale:M="en-US",max:e,maximumFractionDigits:a,min:i,minimumFractionDigits:t,onChange:n,required:A=!1,showValidationTooltip:d=!1,size:l="sm",steps:v=1,useGrouping:o=!0,value:u,...Z})=>{const S=m.useRef(null),h=m.useMemo(()=>new Intl.NumberFormat(M,{useGrouping:o!==!1,minimumFractionDigits:t,maximumFractionDigits:a}),[M,o,t,a]),[f,w]=C1.useControllableState({value:u,onChange:n,defaultValue:C,name:"OxNumberInput"}),[p,O]=m.useState(f!==void 0?h.format(f):""),[D,y]=m.useState(""),[F,$]=m.useState(!1),q=m.useCallback(N=>{if(!N.trim())return;const j=N.replace(/[^\d.-]/g,""),x=parseFloat(j);return!isNaN(x)&&isFinite(x)?x:void 0},[]),K=m.useCallback(N=>C1.clamp(N,i??-1/0,e??1/0),[i,e]),k=N=>{let j=q(p);j===void 0&&(j=f!==void 0?f:0);const x=K(j),X=K(x+N);w(X),O(h.format(X))},_=()=>k(v),z=()=>k(-v);return r.jsx(A2.Provider,{value:{disabled:V,error:L,showValidation:F,showValidationTooltip:d,required:A,size:l,validationMessage:D,setShowValidation:$,setValidationMessage:y},children:r.jsx(w0.Provider,{value:{internalValue:f,setInternalValue:w,max:e,min:i,steps:v,handleIncrement:_,handleDecrement:z,displayValue:p,setDisplayValue:O,formatter:h,parse:q,clampValue:K,inputRef:S},children:r.jsx(D2,{"data-ox-slot":"input-number-container",...Z,children:H})})})},T5=()=>{const H=m.useContext(w0);if(!H)throw new Error("useNumberContext must be used within a Number component");return H},XA2=()=>{const{size:H}=k1(),{handleDecrement:C,inputRef:V}=T5();return r.jsx(T1,{"aria-controls":V.current?.id,"aria-label":"Decrease value","data-ox-slot":"input-number-decrement",onClick:C,children:r.jsx(e1,{path:"mdiMinus",size:c1[H]})})},JA2=H=>r.jsx(N2,{...H}),Cn2=()=>{const{size:H}=k1(),{handleIncrement:C,inputRef:V}=T5();return r.jsx(T1,{"aria-controls":V.current?.id,"aria-label":"Increase value","data-slot":"input-number-increment",onClick:C,children:r.jsx(e1,{path:"mdiPlus",size:c1[H]})})},Hn2=({"aria-label":H,"aria-labelledby":C,className:V,...L})=>{const{clampValue:M,displayValue:e,formatter:a,handleDecrement:i,handleIncrement:t,inputRef:n,internalValue:A,max:d,min:l,parse:v,setDisplayValue:o,setInternalValue:u}=T5(),[Z,S]=m.useState(!1),h=O=>{o(O.target.value)},f=O=>{const D=O.nativeEvent,y=O.target,F=y.value.slice(0,y.selectionStart??void 0)+(D.data??"")+y.value.slice(y.selectionEnd??void 0);!/^-?[\d.,]*$/.test(F)&&F!==""&&O.preventDefault()},w=()=>{const O=v(e);if(O!==void 0){const D=M(O);u(D),o(a.format(D))}else u(void 0),o("")},p=O=>{const D=O.clipboardData.getData("text"),y=v(D);y!==void 0&&(O.preventDefault(),o(a.format(y)),u(y))};return C1.useKeyboard({onArrowDown:i,onArrowUp:t,onEnter:w,enabled:Z,allowRepeat:!0}),r.jsx(N1,{"aria-label":H,"aria-labelledby":C,"aria-valuemax":d,"aria-valuemin":l,"aria-valuenow":A,autoComplete:"off",className:s("text-center",V),"data-ox-slot":"input-number",inputMode:"decimal",ref:n,role:"spinbutton",type:"text",value:e,onBeforeInput:f,onBlur:()=>{S(!1),w()},onChange:h,onFocus:()=>S(!0),onPaste:p,...L})},K1=Hn2;K1.Button=qA2;K1.Container=KA2;K1.DecrementButton=XA2;K1.Icon=JA2;K1.IncrementButton=Cn2;const Vn2={sm:"size-8 text-sm",md:"size-9 text-sm"},Ln2={sm:"gap-1",md:"gap-2"},Mn2=H=>{switch(H){case"numeric":return{inputMode:"numeric",pattern:"[0-9]*"};case"alphanumeric":return{inputMode:"text",pattern:"[A-Z0-9]*"};case"text":default:return{inputMode:"text"}}},en2=(H,C)=>{switch(C){case"numeric":return H.replace(/[^0-9]/g,"");case"alphanumeric":return H.replace(/[^A-Z0-9]/gi,"").toUpperCase();default:return H}},rn2=({className:H,disabled:C=!1,error:V=!1,length:L=6,onComplete:M,onValueChange:e,placeholder:a="",size:i="md",type:t="numeric"})=>{const n=m.useId(),[A,d]=m.useState(()=>new Array(L).fill("")),l=m.useRef([]),v=Mn2(t);l.current=l.current.slice(0,L);const o=h=>r2.flushSync(()=>{d(h)}),u=(h,f)=>{const w=en2(f,t),p=[...A];p[h]=w[0]||"";const O=p[h]&&h<L-1?h+1:void 0;o(p),O!==void 0&&l.current[O]?.focus();const D=p.filter(F=>F!==""),y=D.join("");e?.(y),D.length===L&&M?.(y)},Z=(h,f)=>{const w=[...A];if(f.key==="Backspace"){if(A[h]){w[h]="",o(w);const p=w.filter(O=>O!=="");e?.(p.join(""))}else if(h>0){w[h-1]="",o(w),l.current[h-1]?.focus();const p=w.filter(O=>O!=="");e?.(p.join(""))}}f.key==="ArrowLeft"&&h>0&&l.current[h-1]?.focus(),f.key==="ArrowRight"&&h<L-1&&l.current[h+1]?.focus()},S=h=>{l.current[h]?.select()};return r.jsx("div",{className:s("inline-flex",Ln2[i],H),"data-ox-slot":"otp-input",children:Array.from({length:L},(h,f)=>{const w=f===0||A.slice(0,f).every(O=>O!==""),p=C||!w;return r.jsx("input",{id:`${n}-digit-${f}`,"aria-label":`Digit ${f+1} of ${L}`,autoComplete:"one-time-code",className:s("rounded-lg border bg-gray-50 text-center font-mono transition-all duration-200","ox-violet-outset-focus",Vn2[i],{"ox-gray-border":!V,"ox-rose-border":V,"ox-default-disabled":C}),"data-ox-slot":"otp-digit",disabled:p,maxLength:1,placeholder:a,ref:O=>{l.current[f]=O},type:"text",value:A[f],onChange:O=>u(f,O.target.value),onFocus:()=>S(f),onKeyDown:O=>Z(f,O),onPaste:O=>O.preventDefault(),...v},f)})})},an2=H=>r.jsx(T1,{...H}),k0=m.createContext(null),P5=()=>{const H=m.useContext(k0);if(!H)throw new Error("useTextContext must be used within a Text component");return H},in2=()=>{const{handleClear:H,internalValue:C}=P5();return r.jsx(T1,{"aria-label":"Clear input",className:s("",{invisible:!C}),"data-ox-slot":"input-text-clear",path:"mdiClose",onClick:H})},tn2=({children:H,className:C,customValidationMessage:V,defaultValue:L,disabled:M=!1,error:e=!1,onChange:a,required:i=!1,showValidation:t=!1,showValidationTooltip:n=!1,size:A="sm",type:d="text",value:l,...v})=>{const o=m.useRef(null),[u,Z]=C1.useControllableState({value:l,onChange:q=>{a?.(q??"")},defaultValue:L,name:"OxTextInput"}),S=u??"",h=q=>Z(q),[f,w]=m.useState(d),[p,O]=m.useState(""),[D,y]=m.useState(t),F=()=>{h(""),o.current?.focus()},$=()=>{f==="password"?w("text"):f==="text"&&w("password")};return r.jsx(A2.Provider,{value:{disabled:M,error:e,showValidation:D,showValidationTooltip:n,required:i,size:A,validationMessage:V||p,setShowValidation:y,setValidationMessage:O},children:r.jsx(k0.Provider,{value:{handleClear:F,handleTypeToggle:$,inputRef:o,internalValue:S,setInternalValue:h,type:f},children:r.jsx(D2,{className:s("[&_[data-ox-slot='input-text']:only-child]:px-2",C),"data-ox-slot":"input-text-container",...v,children:H})})})},An2=({className:H,currentLength:C=0,disabled:V=!1,maxLength:L,size:M="sm",...e})=>r.jsxs("div",{className:s("text-gray-1000 mt-1 text-right tabular-nums",i1[M],{"ox-default-disabled":V},H),"data-ox-slot":"input-counter",...e,children:[C,"/",L]}),nn2=H=>r.jsx(An2,{...H}),on2=H=>r.jsx(N2,{...H}),dn2=({autoComplete:H,className:C,id:V,maxLength:L,placeholder:M,spellCheck:e=!1,...a})=>{const{disabled:i,error:t,required:n}=k1(),{inputRef:A,internalValue:d,setInternalValue:l,type:v}=P5(),o=u=>{l(u.target.value)};return r.jsx(N1,{id:V,"aria-invalid":t,"aria-required":n,autoComplete:H,className:C,"data-ox-slot":"input-text",disabled:i,maxLength:L,placeholder:M,ref:A,required:n,spellCheck:e,type:v,value:d,onChange:o,...a})},ln2=()=>{const{handleTypeToggle:H,type:C}=P5(),V=C==="text";return r.jsx(T1,{"aria-label":V?"Hide password":"Show password","data-ox-slot":"input-text-toggle",path:V?"mdiEyeOff":"mdiEye",onClick:H})},I1=dn2;I1.Button=an2;I1.ClearButton=in2;I1.Container=tn2;I1.Counter=nn2;I1.Icon=on2;I1.VisibilityButton=ln2;const mn2=H=>r.jsx(T1,{...H}),T0=m.createContext(null),sn2=({defaultValue:H,onChange:C,value:V})=>{const[L,M]=C1.useControllableState({value:V,defaultValue:H??"",onChange:d=>C?.(d??"")}),e=d=>{if(!d)return{hours:"",minutes:""};const[l="",v=""]=d.split(":");return{hours:l,minutes:v}},a=(d,l)=>{if(!d&&!l)return"";const v=d?d.padStart(2,"0"):"",o=l?l.padStart(2,"0"):"";return`${v}:${o}`},{hours:i,minutes:t}=e(L);return{hours:i,minutes:t,setHours:d=>{const l=a(d,t);M(l)},setMinutes:d=>{const l=a(i,d);M(l)},timeValue:L,setTimeValue:M}},vn2=({children:H,className:C,customValidationMessage:V,defaultValue:L="",disabled:M=!1,error:e=!1,onChange:a,required:i=!1,showValidation:t=!1,showValidationTooltip:n=!1,size:A="sm",value:d,...l})=>{const{hours:v,minutes:o,setHours:u,setMinutes:Z}=sn2({value:d,defaultValue:L,onChange:a}),[S,h]=m.useState(""),[f,w]=m.useState(t);return r.jsx(A2.Provider,{value:{disabled:M,error:e,showValidation:f,showValidationTooltip:n,required:i,size:A,validationMessage:V||S,setShowValidation:w,setValidationMessage:h},children:r.jsx(T0.Provider,{value:{hours:v,minutes:o,setHours:u,setMinutes:Z},children:r.jsx(D2,{className:s("w-fit [&_[data-ox-slot='input-time']:only-child]:px-2",C),"data-ox-slot":"input-time-container",...l,children:H})})})},un2=H=>r.jsx(N2,{...H}),cn2=()=>{const H=m.useContext(T0);if(!H)throw new Error("useTimeContext must be used within a TimeInput component");return H},Zn2=()=>{const{hours:H,minutes:C,setHours:V,setMinutes:L}=cn2(),{disabled:M,size:e}=k1(),a=m.useRef(null),i=m.useRef(null),t=l=>{const v=l.target.value;(v===""||/^\d{1,2}$/.test(v)&&parseInt(v,10)<=23)&&V(v)},n=l=>{const v=l.target.value;(v===""||/^\d{1,2}$/.test(v)&&parseInt(v,10)<=59)&&L(v)},A=l=>{(l.key==="Tab"||l.key==="Enter"||l.key===":")&&(l.preventDefault(),i.current?.focus())},d=l=>{l.key==="Backspace"&&C===""&&a.current?.focus()};return r.jsxs("div",{className:"flex items-center gap-1 bg-transparent px-2","data-ox-slot":"input-time",children:[r.jsx(N1,{autoComplete:"off",className:s("w-8 min-w-8 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"),max:"23",min:"0",placeholder:"hh",ref:a,type:"number",value:H,onChange:t,onKeyDown:A}),r.jsx("span",{className:s(i1[e],{"text-gray-1000":!M,"ox-default-disabled":M}),children:":"}),r.jsx(N1,{autoComplete:"off",className:s("w-8 min-w-8 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"),max:"59",min:"0",placeholder:"mm",ref:i,type:"number",value:C,onChange:n,onKeyDown:d})]})},j2=Zn2;j2.Container=vn2;j2.Icon=un2;j2.Button=mn2;const P0=m.createContext(void 0),Sn2=()=>{const H=m.useContext(P0);if(!H)throw new Error("OxRadio must be used within OxRadioGroup");return H},fn2={sm:"size-4.5",md:"size-5.5"},pn2=({checked:H,className:C,defaultChecked:V,disabled:L=!1,error:M=!1,id:e,name:a,onChange:i,onCheckedChange:t,required:n=!1,size:A,value:d,...l})=>{const v=m.useId(),o=Sn2(),u=m.useRef(null),S=`${e||v}-radio`,h=A||o.size,f=L||o.disabled,w=a||o?.name,p=H!==void 0||o&&d!==void 0&&o.value!==void 0;let O;o&&d!==void 0&&o.value!==void 0?O=o.value===d:O=H;const D=y=>{const F=y.target.checked;o&&d!==void 0&&o.onChange?.(d),i?.(y),t?.(F)};return r.jsxs("div",{className:"relative inline-flex shrink-0",children:[r.jsx("input",{id:S,"aria-invalid":M,"aria-required":n,"data-ox-slot":"radio",ref:u,...p?{checked:O}:{defaultChecked:V},className:s("peer cursor-pointer appearance-none rounded-full bg-gray-50",fn2[h],"ox-violet-outset-focus checked:bg-violet-700 disabled:cursor-not-allowed disabled:opacity-50",{"ox-rose-border":M,"ox-gray-border":!M},C),disabled:f,name:w,required:n,type:"radio",value:d,onChange:D,...l,"data-ox-state":O?"checked":"unchecked"}),r.jsx("div",{className:s("bg-gray-1200 pointer-events-none absolute inset-0 m-auto size-2 rounded-full opacity-0 peer-checked:opacity-100",{"bg-gray-800 opacity-50":f})})]})},hn2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-1","input:data-[ox-slot=radio]:[grid-column-start:var(--ox-field-control-col)] input:data-[ox-slot=radio]:[grid-row-start:var(--ox-field-control-row)]","*:data-[ox-slot=label]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=label]:[grid-row-start:var(--ox-field-label-row)]","*:data-[ox-slot=description]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=description]:[grid-row-start:var(--ox-field-desc-row)]",C),"data-ox-slot":"radio-field",...V,children:H}),gn2=({children:H,className:C,disabled:V=!1,name:L,onChange:M,size:e="sm",value:a,...i})=>r.jsx(P0.Provider,{value:{value:a,onChange:M,name:L,size:e,disabled:V},children:r.jsx("div",{className:s("contents space-y-2",C),"data-ox-slot":"radio-group",role:"radiogroup",...i,children:H})}),B5=pn2;B5.Group=gn2;B5.Field=hn2;const B0=m.createContext(void 0),R0=({children:H,className:C,...V})=>r.jsx("span",{className:s("overflow-hidden text-ellipsis",C),"data-ox-slot":"select-label",...V,children:H}),o2=()=>{const H=m.useContext(B0);if(!H)throw new Error("Select components must be used within an OxSelect");return H},On2={sm:`px-2 ${i1.sm} ${u1.sm}`,md:`px-2.5 ${i1.md} ${u1.md}`},F0=({children:H,className:C,disabled:V=!1,value:L,...M})=>{const{closeDropdown:e,onSelect:a,registerOption:i,selectedValue:t,size:n}=o2();m.useLayoutEffect(()=>{i(L,H)},[L,H,i]);const A=()=>{a({value:L,label:H})},d=v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),a({value:L,label:H})),v.key==="Escape"&&e()},l=t.includes(L);return r.jsx("li",{className:"contents",role:"none",children:r.jsxs("button",{"aria-selected":l,className:s("text-gray-1200 group col-span-3 grid grid-cols-subgrid items-center rounded-sm text-left",On2[n],"ox-violet-inset-focus enabled:cursor-pointer enabled:hover:bg-gray-400","disabled:ox-default-disabled",{"bg-gray-400":l},C),"data-ox-slot":"select-option",disabled:V,role:"option",tabIndex:V?-1:0,onClick:A,onKeyDown:d,...M,children:[H,l&&!V?r.jsx(e1,{className:"justify-self-center text-violet-700","data-ox-slot":"select-check-icon",path:"mdiCheck",size:c1[n]}):null]})})},xn2=H=>{const C=new Map,V=L=>{if(!m.isValidElement(L))return;if(L.type===F0){const{children:a,value:i}=L.props,t=m.Children.toArray(a).find(A=>m.isValidElement(A)&&(A.type===R0||G1(A,"select-label"))),n=t&&m.isValidElement(t)?t.props.children:a;C.set(i,n);return}const M=L.props,{children:e}=M;e&&m.Children.forEach(e,V)};return H.forEach(V),C},bn2={sm:`px-1.25 ${i1.sm} ${u1.sm}`,md:`px-1.75 ${i1.md} ${u1.md}`},s5=({badgeColor:H="purple",className:C,displayAsBadges:V=!1,placeholder:L="Select an option",size:M="sm",...e})=>{const{buttonRef:a,disabled:i,error:t,handleResize:n,isOpen:A,multiple:d,overflowAmount:l,required:v,selectId:o,selectedOptions:u,size:Z}=o2(),S=M||Z,h=l>0;return r.jsxs("button",{id:o,"aria-controls":`${o}-listbox`,"aria-disabled":i,"aria-expanded":A,"aria-haspopup":"listbox","aria-invalid":t,"aria-label":u.length>0?`Selected: ${u.map(f=>f.label).join(", ")}`:L,"aria-required":v,className:s("enabled:text-gray-1200 relative flex w-full items-center gap-x-2 rounded-lg bg-gray-50 pe-9 ps-3 text-start enabled:cursor-pointer","ox-violet-outset-focus disabled:ox-default-disabled",bn2[S],{"ox-rose-border":t,"ox-gray-border":!t,"default-active-border":A},C),"data-ox-slot":"select-trigger",disabled:i,ref:a,role:"combobox",type:"button",...e,"data-ox-state":A?"open":"closed",children:[u.length>0?r.jsxs("div",{className:s("flex w-full items-center overflow-hidden","[&_[data-ox-slot=select-icon]]:hidden",{"opacity-50":i&&V}),children:[r.jsx("div",{className:s("overflow-hidden text-ellipsis whitespace-nowrap",{"flex gap-1":V&&d}),ref:n,children:V&&d?u.map(f=>r.jsx(f2,{color:H,"data-ox-state":"selected",size:S,children:f.label},String(f.value))):u.map((f,w,p)=>{const O=p.length-l,D=w===O-1;return r.jsxs("span",{"data-ox-state":"selected",children:[f.label,w<p.length-1&&!D&&", "]},String(f.value))})}),h&&d?r.jsxs(f2,{className:"ml-1",color:H,size:S,children:["+",l]}):null]}):r.jsx("span",{className:"w-full overflow-hidden text-ellipsis whitespace-nowrap",children:L}),r.jsx("div",{className:"absolute end-3 top-1/2 -translate-y-1/2",children:r.jsx(e1,{className:s("text-current transition-transform duration-300 ease-in-out",{"rotate-180":A}),path:"mdiChevronDown",size:c1[S]})})]})},S3=H=>H==null?[]:Array.isArray(H)?H:[H],yn2=({children:H,className:C,defaultValue:V=null,disabled:L=!1,error:M=!1,id:e,isLoading:a=!1,multiple:i=!1,onChange:t,required:n=!1,size:A="sm",value:d,wrapperClassName:l})=>{if(a)return r.jsx("div",{className:s("flex w-full flex-col",l),children:r.jsx(R2,{className:s("rounded-lg",u1[A],{"ox-rose-border":M,"ox-gray-border":!M}),fullWidth:!0})});const v=m.useId(),o=m.useRef(null),{checkOverflow:u,handleResize:Z,overflowAmount:S}=C1.useOverflowDetection(),h=m.Children.toArray(H).find(N=>m.isValidElement(N)&&(N.type===s5||G1(N,"select-trigger"))),f=m.Children.toArray(H).filter(N=>!(m.isValidElement(N)&&(N.type===s5||G1(N,"select-trigger")))),[w,p]=C1.useControllableState({value:void 0,defaultValue:!1,name:"OxSelect-open"}),[O,D]=C1.useControllableState({value:d?new Set(S3(d)):void 0,defaultValue:new Set(S3(V)),onChange:N=>{if(!N)return;const j=i?Array.from(N):N.size>0?Array.from(N)[0]:null;t?.(j)},name:"OxSelect"}),[y,F]=C1.useControllableState({value:void 0,defaultValue:m.useMemo(()=>xn2(f),[f]),name:"OxSelect-itemsMap"}),$=m.useMemo(()=>Array.from(O??new Set).map(N=>({value:N,label:y?.get(N)??N})),[O,y]),K=`${e||v}-select`,k=m.useCallback(N=>{const{label:j,value:x}=N;F(X=>new Map(X).set(x,j)),D(X=>{const g=new Set(X);return i?g.has(x)?g.delete(x):g.add(x):(g.clear(),g.add(x),p(!1)),g})},[i,D,p,F]),_=m.useCallback((N,j)=>{F(x=>(x??new Map).has(N)?x:new Map(x??new Map).set(N,j))},[F]),z=m.useCallback(()=>p(!1),[p]);return m.useLayoutEffect(()=>{u()},[O,u]),r.jsx(B0.Provider,{value:m.useMemo(()=>({selectedValue:Array.from(O??new Set),onSelect:k,closeDropdown:z,multiple:i,size:A,disabled:L,error:M,isOpen:w??!1,selectedOptions:$,registerOption:_,required:n,handleResize:Z,overflowAmount:S,selectId:K,buttonRef:o}),[O,k,z,i,A,L,M,w,$,_,n,Z,S,K,o]),children:r.jsx("div",{className:s("flex w-full flex-col",l),children:r.jsx(q1,{align:"start",animationDuration:100,content:f,contentClassName:s("ox-gray-border ox-select-animate rounded-lg bg-gray-200 p-1",C),contentStyle:{minWidth:`${o.current?.offsetWidth||200}px`},disabled:L,open:w,position:"bottom",trigger:"click",onOpenChange:p,children:h})})})},wn2=({children:H,className:C,...V})=>{const{multiple:L,selectId:M}=o2();return r.jsx("ul",{id:`${M}-listbox`,"aria-multiselectable":L,className:s("grid max-h-72 grid-cols-[auto_1fr_auto] gap-y-0.5 overflow-hidden overflow-y-auto",'[&_[data-ox-slot="select-icon"]]:justify-self-center [&_[data-ox-slot="select-icon"]]:[grid-column-start:var(--ox-menu-icon-col)]','[&_[data-ox-slot="select-label"]]:[grid-column-start:var(--ox-menu-label-col)]','[&_[data-ox-slot="select-check-icon"]]:justify-self-end [&_[data-ox-slot="select-check-icon"]]:[grid-column-start:var(--ox-menu-shortcut-col)]',C),"data-ox-slot":"select-listbox",role:"listbox",...V,children:H})},kn2=({className:H,path:C,...V})=>{const{size:L}=o2();return r.jsx(e1,{className:s("mr-2 shrink-0 text-current",H),"data-ox-slot":"select-icon",path:C,size:c1[L],...V})},Tn2=({children:H,className:C,label:V,...L})=>{const{size:M}=o2();return r.jsxs("div",{className:"contents [&_[data-ox-slot=select-option]]:pl-4",children:[r.jsx("div",{className:s("text-gray-1000 col-span-full px-2 py-1 font-semibold",i1[M],C),"data-ox-slot":"select-option-group",...L,children:V}),H]})},W1=yn2;W1.Content=wn2;W1.Icon=kn2;W1.Label=R0;W1.Option=F0;W1.OptionGroup=Tn2;W1.Trigger=s5;const Pn2={sm:{container:"h-4.5 w-9",thumb:"size-3.75",translate:"translate-x-4.25"},md:{container:"h-5.5 w-11",thumb:"size-4.75",translate:"translate-x-5.25"}},Bn2=({checked:H=!1,className:C,disabled:V=!1,error:L=!1,id:M,onChange:e,required:a=!1,size:i="sm",...t})=>{const n=m.useId(),d=`${M||n}-switch`,l=Pn2[i],v=()=>{e?.(!H)};return r.jsx("button",{id:d,"aria-checked":H,"aria-invalid":L,"aria-required":a,className:s("ox-violet-outset-focus relative inline-flex shrink-0 items-center rounded-full border-2 transition-colors duration-200 ease-in-out","enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",l.container,{"bg-violet-700":H,"bg-gray-400":!H,"ox-rose-border":L,"border-transparent":!L},C),"data-ox-slot":"switch",disabled:V,role:"switch",type:"button",onClick:v,...t,"data-ox-state":H?"checked":"unchecked",children:r.jsx("span",{className:s("bg-gray-1200 inline-block transform rounded-full shadow-sm","transition-transform duration-200 ease-in-out",l.thumb,{[l.translate]:H})})})},Rn2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid grid-cols-[1fr_auto] items-center gap-x-3 gap-y-1","[--ox-field-control-col:2] [--ox-field-control-row:1] [--ox-field-desc-row:2] [--ox-field-label-col:1] [--ox-field-label-row:1]","button:data-[ox-slot=control]:[grid-column-start:var(--ox-field-control-col)] button:data-[ox-slot=control]:[grid-row-start:var(--ox-field-control-row)]","*:data-[ox-slot=label]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=label]:[grid-row-start:var(--ox-field-label-row)]","*:data-[ox-slot=description]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=description]:[grid-row-start:var(--ox-field-desc-row)]",C),"data-ox-slot":"switch-field",...V,children:H}),E0=Bn2;E0.Field=Rn2;const Fn2={sm:`${i1.sm} min-${u1.sm}`,md:`${i1.md} min-${u1.md}`},En2=({className:H,disabled:C=!1,error:V=!1,id:L,name:M,onChange:e,placeholder:a="Enter text...",required:i=!1,rows:t=3,showMaxLength:n=!1,size:A="sm",value:d,...l})=>{const v=m.useId(),[o,u]=m.useState(typeof d=="string"?d.length:0),S=`${L||v}-textarea`,h=l.maxLength;m.useEffect(()=>{typeof d=="string"&&u(d.length)},[d]);const f=w=>{const p=w.target.value.length;u(p),e?.(w)};return r.jsxs("div",{className:"flex w-full flex-col",children:[r.jsx("textarea",{id:S,"aria-invalid":V,"aria-required":i,className:s("enabled:text-gray-1200 flex w-full resize-y rounded-lg bg-gray-50 px-2 py-2","ox-violet-outset-focus disabled:ox-default-disabled placeholder:text-gray-900",Fn2[A],{"ox-rose-border":V,"ox-gray-border":!V},H),"data-ox-slot":"textarea",disabled:C,name:M,placeholder:a,required:i,rows:t,value:d,onChange:f,...l}),n&&typeof h=="number"?r.jsxs("div",{className:"text-gray-1000 pointer-events-none mt-1 text-right text-xs",children:[o,"/",h]}):null]})},D0=()=>m.useContext(g0),Dn2=({children:H,className:C,...V})=>{const L=D0(),M=L?.selectable&&(H==null||typeof H=="string"&&H.trim()===""),e=()=>{L?.toggleAll()};return r.jsx("th",{className:s("text-gray-1200 border-b border-gray-400 bg-gray-100 px-3 py-2 text-left text-sm font-semibold",C),"data-ox-slot":"table-head",...V,children:M?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"sr-only",children:"Select all rows"}),r.jsx(t2,{"aria-label":"Select all rows",checked:L.isAllSelected,indeterminate:L.isIndeterminate,onCheckedChange:e})]}):H})},Nn2=({children:H,className:C,...V})=>r.jsx("thead",{className:C,"data-ox-slot":"table-header",...V,children:H}),jn2=({children:H,className:C,rowId:V,...L})=>{const M=D0(),e=()=>{V&&M?.selectable&&M.toggleSelection(V)};return r.jsxs("tr",{className:s("border-b border-gray-400 last:border-b-0 hover:bg-gray-300","in-[tfoot]:hover:bg-transparent in-[thead]:hover:bg-transparent",{"bg-gray-300":M?.selectable&&V&&M.isSelected(V)},C),"data-ox-slot":"table-row",...L,children:[M?.selectable&&V&&r.jsx("td",{className:"px-3 py-2",children:r.jsx(t2,{"aria-label":`Select row ${V}`,checked:M.isSelected(V),onCheckedChange:e})}),H]})},R1=SA2;R1.Body=fA2;R1.Cell=pA2;R1.Controls=hA2;R1.Footer=gA2;R1.Head=Dn2;R1.Header=Nn2;R1.Row=jn2;const N0=m.createContext(null),In2=({children:H,className:C,defaultValue:V,onValueChange:L,value:M,...e})=>{const[a,i]=m.useState(V||""),t=M!==void 0,d={value:t?M:a,onValueChange:l=>{t||i(l),L?.(l)}};return r.jsx(N0.Provider,{value:d,children:r.jsx("div",{className:s("w-full",C),"data-ox-slot":"tabs",...e,children:H})})},j0=()=>{const H=m.useContext(N0);if(!H)throw new Error("Tabs components must be used within OxTabs");return H},Wn2=({children:H,className:C,value:V,...L})=>{const{value:M}=j0();return M===V?r.jsx("div",{"aria-labelledby":`tab-${V}`,className:s("text-gray-1200 pt-4",C),"data-ox-slot":"tabs-content",role:"tabpanel",...L,children:H}):null},_n2=({children:H,className:C,...V})=>r.jsx("div",{className:s("flex border-b border-gray-400",C),"data-ox-slot":"tabs-list",role:"tablist",...V,children:H}),zn2=({children:H,className:C,disabled:V=!1,value:L,...M})=>{const{onValueChange:e,value:a}=j0(),i=a===L,t=()=>{V||e(L)},n=A=>{(A.key==="Enter"||A.key==="Space")&&(A.preventDefault(),t())};return r.jsx("button",{"aria-selected":i,className:s("relative rounded-t-lg border-l border-r border-t border-transparent px-4 py-2 text-sm font-medium transition-colors enabled:cursor-pointer","ox-violet-outset-focus enabled:hover:text-gray-1200 enabled:hover:bg-gray-300","disabled:ox-default-disabled",{"text-gray-1200 border-gray-400":i,"text-gray-1100":!i},C),"data-ox-slot":"tabs-trigger",disabled:V,role:"tab",onClick:t,onKeyDown:n,...M,"data-ox-state":i?"active":"inactive",children:H})},I2=In2;I2.List=_n2;I2.Trigger=zn2;I2.Content=Wn2;const Gn2=({children:H,className:C,...V})=>r.jsx("ol",{"aria-label":"Timeline",className:s("grid grid-cols-[1fr_auto_1fr] items-start gap-4",C),"data-ox-slot":"timeline",role:"list",...V,children:H}),Un2=({align:H="left",children:C,className:V,color:L="purple",description:M,icon:e,label:a,showSeparator:i=!1,timestamp:t,...n})=>{const A=C||M;return r.jsxs("li",{className:s("col-span-3 grid grid-cols-subgrid",V),"data-ox-slot":"timeline-item",role:"listitem",...n,children:[r.jsx("div",{children:H==="left"&&r.jsxs("div",{className:"space-y-1 text-right",children:[r.jsx("h6",{className:s("text-sm font-medium leading-tight",a1[L].text),children:a}),A&&r.jsx(e2,{children:A}),t&&r.jsx("span",{className:"text-gray-1000 text-xs",children:t})]})}),r.jsxs("div",{className:"grid shrink-0 grid-rows-[auto_1fr] gap-4",children:[r.jsx("div",{className:s("flex items-center justify-center rounded-lg",a2.md,a1[L].background,a1[L].border),children:r.jsx(e1,{className:s("text-gray-1200",a1[L].text),path:e||"mdiCircle",size:c1.md})}),i?r.jsx(b5,{className:"mx-auto",orientation:"vertical"}):null]}),r.jsx("div",{children:H==="right"&&r.jsxs("div",{className:"space-y-1 text-left",children:[r.jsx("h6",{className:s("text-sm font-medium leading-tight",a1[L].text),children:a}),A&&r.jsx(e2,{children:A}),t&&r.jsx("span",{className:"text-gray-1000 text-xs",children:t})]})})]})},I0=Gn2;I0.Item=Un2;const Qn2=({index:H,onRemove:C,position:V,toast:L})=>{const M=L.icon??f1[L.type].icon,e=L.color?a1[L.color]:f1[L.type],[a,i]=m.useState(!0);m.useEffect(()=>{const d=setTimeout(()=>i(!1),50);return()=>clearTimeout(d)},[]);const t=H*8,n=1-H*.05,A=()=>{const d=a?V==="top"?-16:16:0;return V==="top"?{top:`${t+d}px`,transform:`scale(${n})`,zIndex:30-H,opacity:L.isRemoving||a?0:1}:{top:`${-t+d}px`,transform:`scale(${n})`,zIndex:30-H,opacity:L.isRemoving||a?0:1}};return L.customContent?r.jsx("div",{className:"ox-gray-border pointer-events-auto absolute w-full cursor-pointer rounded-lg bg-gray-200 transition-all duration-300 ease-out md:w-80","data-ox-slot":"toast-item",role:"status",style:A(),onClick:()=>C(L.id),children:L.customContent}):r.jsxs("div",{"aria-describedby":L.description?`${L.id}-desc`:void 0,className:"ox-gray-border pointer-events-auto absolute flex w-full cursor-pointer items-center gap-3 rounded-lg bg-gray-200 p-4 transition-all duration-300 ease-out md:w-80","data-ox-slot":"toast-item",role:L.type==="error"||L.type==="warning"?"alert":"status",style:A(),onClick:()=>C(L.id),children:[r.jsxs("span",{className:"sr-only",children:[L.type," notification:"]}),r.jsx("div",{className:s("mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",e.background),children:r.jsx(e1,{className:e.text,path:M,size:.7})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-gray-1200 text-xs font-medium",children:L.title}),L.description?r.jsx("p",{id:`${L.id}-desc`,className:"mt-1 text-xs",children:L.description}):null]})]})},$n2={left:"left-1/2 -translate-x-1/2 md:translate-none md:left-4",center:"left-1/2 -translate-x-1/2",right:"left-1/2 -translate-x-1/2 md:translate-none md:left-auto md:right-4"},Yn2={top:"top-4",bottom:"bottom-24"},W0=({align:H,onRemove:C,position:V,toasts:L})=>r2.createPortal(r.jsx("div",{"aria-atomic":"false","aria-label":"Notifications","aria-live":"polite",className:s("pointer-events-none fixed z-50 w-11/12 md:w-80",$n2[H],Yn2[V]),"data-ox-slot":"toast-container",role:"region",children:L.map((M,e)=>r.jsx(Qn2,{index:e,position:V,toast:M,onRemove:C},M.id))}),document.body),_0=m.createContext(null),qn2=({align:H="right",children:C,maxToasts:V=3,position:L="top"})=>{const[M,e]=m.useState([]),a=m.useCallback(A=>{e(d=>d.map(l=>l.id===A?{...l,isRemoving:!0}:l)),setTimeout(()=>{e(d=>C1.reject(d,l=>l.id===A))},200)},[]),i=m.useCallback((A,d,l,v)=>{const o=C1.uniqueId(),u=l?.duration??5e3,Z={id:o,title:A,type:d,duration:u,description:l?.description,icon:l?.icon,color:l?.color,customContent:v};return e(S=>C1.take([Z,...S],V)),u>0&&setTimeout(()=>{a(o)},u),o},[a,V]),t=m.useCallback(A=>{A?a(A):e([])},[a]),n=Object.assign((A,d)=>i(A,"default",d),{success:(A,d)=>i(A,"success",d),error:(A,d)=>i(A,"error",d),warning:(A,d)=>i(A,"warning",d),info:(A,d)=>i(A,"info",d),custom:(A,d)=>i("","default",{duration:d?.duration},A),dismiss:t});return r.jsxs(_0.Provider,{value:n,children:[C,r.jsx(W0,{align:H,position:L,toasts:M,onRemove:a})]})},Kn2=()=>{const H=m.useContext(_0);if(!H)throw new Error("useOxToast must be used within a ToastProvider");return H},z0=m.createContext(null),Xn2=()=>m.useContext(z0),Jn2={sm:`px-3 ${u1.sm} ${i1.sm}`,md:`px-4 ${u1.md} ${i1.md}`},Co2=({children:H,className:C,disabled:V,id:L,onPressedChange:M,pressed:e,size:a,value:i,...t})=>{const n=m.useId(),A=Xn2(),l=`${L||n}-toggle`,v=A!==null,o=a||A?.size||"sm",u=V||A?.disabled||!1;let Z,S;return v&&i!==void 0?(A.type==="single"?Z=A.value===i:Z=(A.value||[]).includes(i),S=()=>{!u&&A.onToggle&&A.onToggle(i)}):(Z=e||!1,S=()=>{!u&&M&&M(!Z)}),r.jsx("button",{id:l,"aria-pressed":Z,className:s("inline-flex items-center gap-2 rounded-md border transition-colors duration-200","ox-gray-outset-focus disabled:ox-default-disabled enabled:cursor-pointer",Jn2[o],{"text-gray-1200 border-gray-400 bg-gray-300 enabled:hover:bg-gray-500":Z,"text-gray-1000 border-gray-400 bg-gray-50 enabled:hover:bg-gray-300":!Z},C),"data-ox-slot":"toggle",disabled:u,role:"button",type:"button",onClick:S,...t,children:H})},Ho2=({children:H,className:C,disabled:V=!1,name:L,onValueChange:M,size:e="sm",type:a="single",value:i,...t})=>{const n=A=>{if(M)if(a==="single")M(i===A?"":A);else{const d=i||[],l=d.includes(A)?d.filter(v=>v!==A):[...d,A];M(l)}};return r.jsx(z0.Provider,{value:{value:i,onToggle:n,name:L,size:e,disabled:V,type:a},children:r.jsx("div",{className:s("flex flex-wrap gap-2",C),"data-ox-slot":"toggle-group",role:"group",...t,children:H})})},G0=Co2;G0.Group=Ho2;const Vo2={default:"ox-gray-border text-gray-1200 bg-gray-200",error:s(...Object.values(C1.pick(a1.rose,["background","border","text"]))),warning:s(...Object.values(C1.pick(a1.amber,["background","border","text"]))),info:s(...Object.values(C1.pick(a1.blue,["background","border","text"]))),success:s(...Object.values(C1.pick(a1.green,["background","border","text"])))},U0=({align:H="center",children:C,className:V,content:L,disabled:M=!1,hoverDelay:e=500,id:a,onOpenChange:i,open:t,position:n="top",trigger:A="hover",variant:d="default"})=>{const l=r.jsx("div",{className:s("max-w-xs break-words rounded-md border px-2 py-1 text-xs",Vo2[d],V),"data-ox-slot":"tooltip-content",children:L});return r.jsx(q1,{id:a,align:H,animationDuration:100,asChild:!0,content:l,contentClassName:"ox-tooltip-animate backdrop-blur-sm rounded-md",contentRole:"tooltip",disabled:M,hoverDelay:e,offset:8,open:t,position:n,trigger:A,useAriaControls:!1,onOpenChange:i,children:C})};exports.COLOR_STYLES=a1;exports.MOBILE_BREAKPOINT=j3;exports.OxAccordion=x2;exports.OxAlert=I3;exports.OxAvatar=b2;exports.OxBadge=f2;exports.OxBreadcrumb=y2;exports.OxButton=m1;exports.OxCalendar=e0;exports.OxCard=w2;exports.OxCheckbox=t2;exports.OxDateInput=n2;exports.OxDescription=e2;exports.OxDescriptionList=h5;exports.OxDialog=T2;exports.OxDrawer=w1;exports.OxDropdown=Z1;exports.OxError=lA2;exports.OxFileUpload=F2;exports.OxFloating=q1;exports.OxForm=E2;exports.OxHeading=sA2;exports.OxIcon=e1;exports.OxJsonField=d0;exports.OxLabel=vA2;exports.OxLegend=uA2;exports.OxLink=Et2;exports.OxNotifications=j1;exports.OxNumberInput=K1;exports.OxOtpInput=rn2;exports.OxPagination=i2;exports.OxPopover=x5;exports.OxProgress=c0;exports.OxRadio=B5;exports.OxSelect=W1;exports.OxSeparator=b5;exports.OxSkeleton=R2;exports.OxSkeletonText=LA2;exports.OxSlider=rA2;exports.OxSpinner=iA2;exports.OxStatusDisplay=oA2;exports.OxStepper=w5;exports.OxSwitch=E0;exports.OxTable=R1;exports.OxTabs=I2;exports.OxTextInput=I1;exports.OxTextarea=En2;exports.OxTimeInput=j2;exports.OxTimeline=I0;exports.OxToast=W0;exports.OxToastProvider=qn2;exports.OxToggle=G0;exports.OxTooltip=U0;exports.buildMailTo=X0;exports.buildUrl=K0;exports.cn=s;exports.copyToClipboard=B7;exports.createId=N7;exports.formatBytes=I7;exports.formatCurrency=W7;exports.formatDate=_7;exports.formatNumber=z7;exports.formatTimestamp=u5;exports.generateRandomString=P3;exports.handleFormErrors=R3;exports.handleGraphQLFormErrors=j7;exports.hasDataSlot=G1;exports.jsxRuntimeExports=r;exports.parseGraphQLErrors=B3;exports.scrollToElement=G7;exports.useOxToast=Kn2;exports.validateEmail=X7;exports.validatePhone=H4;exports.validateUrl=J7;
41
+ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var R=H1(b,Y,P,U,E+"."+Y,V);if(R)return R}return null}return Z(c)}function _(g){switch(typeof g){case"number":case"string":case"undefined":return!0;case"boolean":return!g;case"object":if(Array.isArray(g))return g.every(_);if(g===null||i(g))return!0;var c=d(g);if(c){var T=c.call(g),B;if(c!==g.entries){for(;!(B=T.next()).done;)if(!_(B.value))return!1}else for(;!(B=T.next()).done;){var P=B.value;if(P&&!_(P[1]))return!1}}else return!1;return!0;default:return!1}}function z(g,c){return g==="symbol"?!0:c?c["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&c instanceof Symbol:!1}function N(g){var c=typeof g;return Array.isArray(g)?"array":g instanceof RegExp?"object":z(c,g)?"symbol":c}function j(g){if(typeof g>"u"||g===null)return""+g;var c=N(g);if(c==="object"){if(g instanceof Date)return"date";if(g instanceof RegExp)return"regexp"}return c}function x(g){var c=j(g);switch(c){case"array":case"object":return"an "+c;case"boolean":case"date":case"regexp":return"a "+c;default:return c}}function X(g){return!g.constructor||!g.constructor.name?l:g.constructor.name}return v.checkPropTypes=M,v.resetWarningCache=M.resetWarningCache,v.PropTypes=v,v},L5}var M5,d3;function xt2(){if(d3)return M5;d3=1;var H=O5();function C(){}function V(){}return V.resetWarningCache=C,M5=function(){function L(a,i,t,n,A,d){if(d!==H){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}L.isRequired=L;function M(){return L}var e={array:L,bigint:L,bool:L,func:L,number:L,object:L,string:L,symbol:L,any:L,arrayOf:M,element:L,elementType:L,instanceOf:M,node:L,objectOf:M,oneOf:M,oneOfType:M,shape:M,exact:M,checkPropTypes:V,resetWarningCache:C};return e.PropTypes=e,e},M5}var l3;function bt2(){if(l3)return v2.exports;if(l3=1,process.env.NODE_ENV!=="production"){var H=n0(),C=!0;v2.exports=Ot2()(H.isElement,C)}else v2.exports=xt2()();return v2.exports}var e5,m3;function yt2(){return m3||(m3=1,e5=(function(H){var C={};function V(L){if(C[L])return C[L].exports;var M=C[L]={i:L,l:!1,exports:{}};return H[L].call(M.exports,M,M.exports,V),M.l=!0,M.exports}return V.m=H,V.c=C,V.d=function(L,M,e){V.o(L,M)||Object.defineProperty(L,M,{enumerable:!0,get:e})},V.r=function(L){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})},V.t=function(L,M){if(1&M&&(L=V(L)),8&M||4&M&&typeof L=="object"&&L&&L.__esModule)return L;var e=Object.create(null);if(V.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:L}),2&M&&typeof L!="string")for(var a in L)V.d(e,a,(function(i){return L[i]}).bind(null,a));return e},V.n=function(L){var M=L&&L.__esModule?function(){return L.default}:function(){return L};return V.d(M,"a",M),M},V.o=function(L,M){return Object.prototype.hasOwnProperty.call(L,M)},V.p="",V(V.s=2)})([function(H,C){H.exports=bt2()},function(H,C){H.exports=m},function(H,C,V){V.r(C);var L=V(1),M=V(0),e=function(){return(e=Object.assign||function(o){for(var u,Z=1,S=arguments.length;Z<S;Z++)for(var h in u=arguments[Z])Object.prototype.hasOwnProperty.call(u,h)&&(o[h]=u[h]);return o}).apply(this,arguments)},a=function(o,u){var Z={};for(var S in o)Object.prototype.hasOwnProperty.call(o,S)&&u.indexOf(S)<0&&(Z[S]=o[S]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(S=Object.getOwnPropertySymbols(o);h<S.length;h++)u.indexOf(S[h])<0&&Object.prototype.propertyIsEnumerable.call(o,S[h])&&(Z[S[h]]=o[S[h]])}return Z},i=0,t=L.forwardRef((function(o,u){var Z=o.title,S=Z===void 0?null:Z,h=o.description,f=h===void 0?null:h,w=o.size,p=w===void 0?null:w,O=o.color,D=O===void 0?"currentColor":O,y=o.horizontal,F=y===void 0?null:y,$=o.vertical,q=$===void 0?null:$,K=o.rotate,k=K===void 0?null:K,_=o.spin,z=_===void 0?null:_,N=o.style,j=N===void 0?{}:N,x=o.children,X=a(o,["title","description","size","color","horizontal","vertical","rotate","spin","style","children"]);i++;var g,c=z!==null&&z,T=L.Children.map(x,(function(E){var b=E;c!==!0&&(c=(z===null?b.props.spin:z)===!0);var G=b.props.size;typeof p=="number"&&typeof b.props.size=="number"&&(G=b.props.size/p);var Q={size:G,color:D===null?b.props.color:D,horizontal:F===null?b.props.horizontal:F,vertical:q===null?b.props.vertical:q,rotate:k===null?b.props.rotate:k,spin:z===null?b.props.spin:z,inStack:!0};return L.cloneElement(b,Q)}));p!==null&&(j.width=typeof p=="string"?p:1.5*p+"rem");var B,P="stack_labelledby_"+i,U="stack_describedby_"+i;if(S)g=f?P+" "+U:P;else if(B="presentation",f)throw new Error("title attribute required when description is set");return L.createElement("svg",e({ref:u,viewBox:"0 0 24 24",style:j,role:B,"aria-labelledby":g},X),S&&L.createElement("title",{id:P},S),f&&L.createElement("desc",{id:U},f),c&&L.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }","@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"),T)}));t.displayName="Stack",t.propTypes={size:M.oneOfType([M.number,M.string]),color:M.string,horizontal:M.bool,vertical:M.bool,rotate:M.number,spin:M.oneOfType([M.bool,M.number]),children:M.oneOfType([M.arrayOf(M.node),M.node]).isRequired,className:M.string,style:M.object},t.defaultProps={size:null,color:null,horizontal:null,vertical:null,rotate:null,spin:null};var n=t;V.d(C,"Icon",(function(){return v})),V.d(C,"Stack",(function(){return n}));var A=function(){return(A=Object.assign||function(o){for(var u,Z=1,S=arguments.length;Z<S;Z++)for(var h in u=arguments[Z])Object.prototype.hasOwnProperty.call(u,h)&&(o[h]=u[h]);return o}).apply(this,arguments)},d=function(o,u){var Z={};for(var S in o)Object.prototype.hasOwnProperty.call(o,S)&&u.indexOf(S)<0&&(Z[S]=o[S]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(S=Object.getOwnPropertySymbols(o);h<S.length;h++)u.indexOf(S[h])<0&&Object.prototype.propertyIsEnumerable.call(o,S[h])&&(Z[S[h]]=o[S[h]])}return Z},l=0,v=L.forwardRef((function(o,u){var Z=o.path,S=o.id,h=S===void 0?++l:S,f=o.title,w=f===void 0?null:f,p=o.description,O=p===void 0?null:p,D=o.size,y=D===void 0?null:D,F=o.color,$=F===void 0?"currentColor":F,q=o.horizontal,K=q!==void 0&&q,k=o.vertical,_=k!==void 0&&k,z=o.rotate,N=z===void 0?0:z,j=o.spin,x=j!==void 0&&j,X=o.style,g=X===void 0?{}:X,c=o.inStack,T=c!==void 0&&c,B=d(o,["path","id","title","description","size","color","horizontal","vertical","rotate","spin","style","inStack"]),P={},U=[];y!==null&&(T?U.push("scale("+y+")"):(g.width=typeof y=="string"?y:1.5*y+"rem",g.height=g.width)),K&&U.push("scaleX(-1)"),_&&U.push("scaleY(-1)"),N!==0&&U.push("rotate("+N+"deg)"),$!==null&&(P.fill=$);var E=L.createElement("path",A({d:Z,style:P},T?B:{})),b=E;U.length>0&&(g.transform=U.join(" "),g.transformOrigin="center",T&&(b=L.createElement("g",{style:g},E,L.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var G,Q=b,Y=x===!0||typeof x!="number"?2:x,H1=!T&&(K||_);if(Y<0&&(H1=!H1),x&&(Q=L.createElement("g",{style:{animation:"spin"+(H1?"-inverse":"")+" linear "+Math.abs(Y)+"s infinite",transformOrigin:"center"}},b,!(K||_||N!==0)&&L.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),T)return Q;var R,S1="icon_labelledby_"+h,F1="icon_describedby_"+h;if(w)G=O?S1+" "+F1:S1;else if(R="presentation",O)throw new Error("title attribute required when description is set");return L.createElement("svg",A({ref:u,viewBox:"0 0 24 24",style:g,role:R,"aria-labelledby":G},B),w&&L.createElement("title",{id:S1},w),O&&L.createElement("desc",{id:F1},O),!T&&x&&(H1?L.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):L.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),Q)}));v.displayName="Icon",v.propTypes={path:M.string.isRequired,size:M.oneOfType([M.number,M.string]),color:M.string,horizontal:M.bool,vertical:M.bool,rotate:M.number,spin:M.oneOfType([M.bool,M.number]),style:M.object,inStack:M.bool,className:M.string},v.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},C.default=v}])),e5}var wt2=yt2();const kt2=Q0(wt2),e1=({className:H,path:C,placeholder:V=!1,size:L=.9,...M})=>{const e=()=>{const a=St2;return C&&a[C]?a[C]:a.mdiHelpCircleOutline};return r.jsx(kt2,{"aria-hidden":"true",className:s({"text-gray-1200":!V,"text-transparent":V},H),"data-ox-slot":"icon","data-testid":"icon",path:e(),size:L,...M})},O2=({data:H,level:C})=>{const[V,L]=m.useState(C>2),M=" ".repeat(C);if(H===null)return r.jsx("span",{className:"text-gray-1000",children:"null"});if(H===void 0)return r.jsx("span",{className:"text-gray-1000",children:"undefined"});if(typeof H=="string")return r.jsxs("span",{className:a1.green.text,children:['"',H,'"']});if(typeof H=="number")return r.jsx("span",{className:a1.blue.text,children:H});if(typeof H=="boolean")return r.jsx("span",{className:a1.amber.text,children:H.toString()});if(Array.isArray(H))return H.length===0?r.jsx("span",{className:a1.gray.text,children:"[]"}):r.jsxs("div",{className:"inline","data-ox-slot":"json-array",children:[r.jsxs("button",{className:"ox-violet-outset-focus text-gray-1100 hover:text-gray-1200","data-ox-state":V?"collapsed":"expanded",onClick:()=>L(!V),children:[r.jsx("span",{className:"text-gray-1200",children:"["}),V?r.jsxs("span",{className:"ml-1 text-gray-900",children:[H.length," item",H.length!==1?"s":""]}):null]}),V?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"ml-4",children:H.map((e,a)=>r.jsxs("div",{className:"block",children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsx(O2,{data:e,level:C+1}),a<H.length-1&&r.jsx("span",{className:"text-gray-1100",children:","})]},a))}),r.jsxs("div",{children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsx("span",{className:"text-gray-1200",children:"]"})]})]}),V&&r.jsx("span",{className:"text-gray-1200",children:"]"})]});if(typeof H=="object"){const e=Object.keys(H);return e.length===0?r.jsx("span",{className:"text-gray-1100",children:"{}"}):r.jsxs("div",{className:"inline",children:[r.jsxs("button",{className:"ox-violet-outset-focus text-gray-1100 hover:text-gray-1200","data-ox-state":V?"collapsed":"expanded",onClick:()=>L(!V),children:[r.jsx("span",{className:"text-gray-1200",children:"{"}),V?r.jsxs("span",{className:"text-gray-1100 ml-1",children:[e.length," key",e.length!==1?"s":""]}):null]}),V?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"ml-4",children:e.map((a,i)=>r.jsxs("div",{className:"block",children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsxs("span",{className:"text-gray-1200",children:['"',a,'"']}),r.jsx("span",{className:"text-gray-1100",children:": "}),r.jsx(O2,{data:H[a],level:C+1}),i<e.length-1&&r.jsx("span",{className:"text-gray-1100",children:","})]},a))}),r.jsxs("div",{children:[r.jsx("span",{className:"text-gray-600",children:M}),r.jsx("span",{className:"text-gray-1200",children:"}"})]})]}),V&&r.jsx("span",{className:"text-gray-1200",children:"}"})]})}return r.jsx("span",{className:"text-gray-1100",children:String(H)})},Tt2=({className:H,value:C,...V})=>{const[L,M]=m.useState(!1),{error:e,isValid:a,parsedData:i}=m.useMemo(()=>{if(C==null)return{parsedData:null,isValid:!0,error:null};if(typeof C=="object")return{parsedData:C,isValid:!0,error:null};if(typeof C=="string")try{return{parsedData:JSON.parse(C),isValid:!0,error:null}}catch(n){return{parsedData:null,isValid:!1,error:n instanceof Error?n.message:"Invalid JSON"}}return{parsedData:C,isValid:!0,error:null}},[C]),t=async()=>{const n=typeof C=="string"?C:JSON.stringify(i,null,2);try{await navigator.clipboard.writeText(n),M(!0),setTimeout(()=>M(!1),2e3)}catch(A){console.error("Failed to copy:",A)}};return r.jsxs("div",{className:s("ox-gray-border relative w-full overflow-auto rounded-lg bg-gray-50 p-4 font-mono text-sm",H),"data-ox-slot":"json-field",...V,"data-ox-state":a?L?"copied":"default":"error",children:[r.jsx(m1,{"aria-label":"Copy JSON to clipboard",className:"absolute right-1 top-1",size:"sm",variant:"ghost",onClick:t,children:r.jsx(m1.Icon,{path:L?"mdiCheck":"mdiContentCopy"})}),r.jsx("div",{className:"text-gray-1200 pr-8",children:a?r.jsx(O2,{data:i,level:0}):r.jsxs("div",{className:"text-rose-400",children:[r.jsx("div",{className:"font-medium",children:"Invalid JSON:"}),r.jsx("div",{className:"mt-1 text-xs text-gray-900",children:e}),r.jsx("div",{className:"text-gray-1100 mt-2",children:r.jsx("pre",{className:"whitespace-pre-wrap",children:C})})]})})]})},d0=Tt2;d0.Node=O2;const Pt2={primary:"border border-violet-700 bg-gradient-to-br from-violet-700 from-20% to-rose-500",secondary:"ox-gray-border bg-transparent",ghost:"border border-transparent bg-transparent",link:"border border-transparent bg-transparent",danger:"border border-rose-700 bg-rose-700/80"},Bt2={primary:"ox-violet-outset-focus",secondary:"ox-gray-outset-focus",ghost:"ox-gray-outset-focus",link:"ox-gray-outset-focus",danger:"ox-rose-outset-focus"},Rt2={primary:"hover:brightness-120",secondary:"hover:bg-gray-300",ghost:"hover:bg-gray-300",link:"underline-offset-4 decoration-violet-700 hover:underline",danger:"hover:bg-rose-700"},Ft2={sm:`px-1.5 min-w-8 ${i1.sm} ${u1.sm}`,md:`px-2 min-w-10 ${i1.md} ${u1.md}`},Et2=({children:H,className:C,disabled:V,href:L,size:M="sm",variant:e="link",...a})=>r.jsx("a",{"aria-disabled":V,className:s("inline-flex items-center rounded-lg font-medium transition-colors",Ft2[M],Pt2[e],{[Rt2[e]]:!V,[Bt2[e]]:!V,"ox-default-disabled cursor-not-allowed":V},C),"data-ox-slot":"link",href:V?void 0:L,tabIndex:V?-1:void 0,onClick:V?i=>i.preventDefault():void 0,...a,children:H}),l0=m.createContext(null),Dt2={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"},Nt2=({children:H,className:C,closeOnOutsideClick:V=!0,isOpen:L,onClose:M,persistent:e=!1,showCloseButton:a=!0,size:i="sm",...t})=>{const n=m.useId(),A=m.useId(),d=m.useRef(null),[l,v]=m.useState(!1),[o,u]=C1.useControllableState({value:L,onChange:f=>f?void 0:M?.(),defaultValue:!1,name:"OxDialog"});C1.useFocus({containerRef:d,options:{enabled:l&&o,restoreFocus:!0,trapFocus:!0,autoFocus:!0}});const Z={onClose:()=>u(!1),titleId:n,bodyId:A,persistent:e,showCloseButton:a},S=f=>{f.target===d.current&&!o&&l&&(v(!1),d.current?.close())},h=m.useCallback(()=>{e&&o?d.current?.showModal():e||u(!1)},[e,o,u]);return m.useEffect(()=>{o&&v(!0)},[o]),m.useEffect(()=>{const f=d.current;if(!(!f||!l))return o&&(document.body.classList.add("overflow-hidden"),f.showModal()),()=>{document.body.classList.remove("overflow-hidden")}},[o,l]),m.useEffect(()=>{const f=d.current;if(!f||!l)return;const w=D=>{D.key==="Escape"&&e&&(D.preventDefault(),D.stopPropagation())},p=D=>{D.preventDefault(),h()},O=D=>{V&&D.target===f&&h()};return document.addEventListener("keydown",w),f.addEventListener("cancel",p),f.addEventListener("click",O),f.addEventListener("close",h),()=>{document.removeEventListener("keydown",w),f.removeEventListener("cancel",p),f.removeEventListener("click",O),f.removeEventListener("close",h)}},[l,V,h,e]),l?r2.createPortal(r.jsx("dialog",{"aria-describedby":A,"aria-labelledby":n,className:s("ox-gray-border fixed inset-0 m-auto h-fit w-full rounded-lg bg-gray-50","ox-dialog-animation ox-dialog-backdrop",Dt2[i],C),"data-ox-slot":"dialog",ref:d,role:"dialog",onAnimationEnd:S,...t,"data-ox-state":o?"open":"closing",children:r.jsx(l0.Provider,{value:Z,children:H})}),document.body):null},m0=()=>{const H=m.useContext(l0);if(!H)throw new Error("Dialog sub-components must be used within OxDialog");return H},jt2=({children:H,className:C,...V})=>{const{bodyId:L}=m0();return r.jsx("div",{id:L,className:s("text-gray-1200 p-4 text-sm",C),"data-ox-slot":"dialog-body",...V,children:H})},It2=({children:H,className:C,...V})=>r.jsx("div",{className:s("mx-4 flex justify-end gap-3 border-t border-gray-400 py-4",C),"data-ox-slot":"dialog-footer",...V,children:H}),Wt2=({children:H,className:C,...V})=>{const{onClose:L,persistent:M,showCloseButton:e,titleId:a}=m0(),i=e&&!M;return r.jsxs("div",{id:a,className:s("text-gray-1200 mx-4 box-content flex h-8 items-center justify-between border-b border-gray-400 py-4",C),"data-ox-slot":"dialog-header",...V,children:[r.jsx("div",{className:"flex-1",children:H}),i?r.jsx(m1,{"aria-label":"Close Dialog",size:"sm",variant:"ghost",onClick:L,children:r.jsx(m1.Icon,{path:"mdiClose"})}):null]})},T2=Nt2;T2.Body=jt2;T2.Footer=It2;T2.Header=Wt2;const L2=m.createContext(null),P2=()=>{const H=m.useContext(L2);if(!H)throw new Error("useNotificationsContext must be used within a NotificationsContext.Provider");return H},s0=({children:H,className:C,icon:V,img:L,message:M,timestamp:e,title:a,type:i="default",unread:t=!1,...n})=>{const{isMobile:A,onItemClick:d,setOpen:l}=P2(),v=f1[i],o=()=>{const Z={id:crypto.randomUUID(),icon:V,img:L,message:M,read:!t,timestamp:e||new Date,title:a||"",type:i};d?.(Z),A&&l(!1)},u=H||r.jsxs(r.Fragment,{children:[r.jsx("div",{className:s("mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",v.background),"data-ox-slot":"notifications-icon",children:L?r.jsx(b2,{alt:"User avatar",fallback:"NA",size:"md",src:L}):r.jsx(e1,{className:v.text,path:V??v.icon,size:.75})}),r.jsxs("div",{className:"min-w-0 flex-1","data-ox-slot":"notifications-content",children:[a&&r.jsx("h5",{className:"text-gray-1200 mb-1 text-pretty text-sm font-semibold leading-tight",children:a}),M&&r.jsx("p",{className:"mb-1 text-xs leading-4",children:M}),e&&r.jsx("p",{className:"text-gray-1000 text-xs",children:u5(e)})]}),t&&r.jsx("div",{className:"mt-1.5 h-2 w-2 flex-shrink-0 rounded-full bg-rose-500","data-ox-slot":"notifications-unread"})]});return r.jsx("li",{className:"contents",children:r.jsx("button",{className:s("col-span-3 grid cursor-pointer grid-cols-subgrid items-start gap-3 px-3 py-3 text-left","ox-gray-inset-focus hover:bg-gray-400",{"bg-gray-300/80":t},C),"data-ox-slot":"notifications-button",...n,"data-ox-state":t?"unread":"read",onClick:o,children:u})})},s3=s("grid min-h-0 flex-1 auto-rows-min grid-cols-[auto_1fr_auto] overflow-y-auto",'[&_[data-ox-slot="notifications-icon"]]:justify-self-center [&_[data-ox-slot="notifications-icon"]]:[grid-column-start:var(--ox-menu-icon-col)]','[&_[data-ox-slot="notifications-content"]]:[grid-column-start:var(--ox-menu-label-col)]','[&_[data-ox-slot="notifications-unread"]]:justify-self-end [&_[data-ox-slot="notifications-unread"]]:[grid-column-start:var(--ox-menu-shortcut-col)]'),Z2=({children:H,className:C,...V})=>{const{emptyMessage:L,isMobile:M,items:e,onMarkAllRead:a,setOpen:i,unreadCount:t}=P2(),n=e.length>0,A=t>0,d=()=>{a?.(),M&&i(!1)},l=H||r.jsx(r.Fragment,{children:n?e.map((v,o)=>r.jsx(s0,{className:s({"border-t border-gray-400":o>0}),icon:v.icon,img:v.img,message:v.message,timestamp:v.timestamp,title:v.title,type:v.type,unread:!v.read},v.id)):r.jsxs("li",{className:"col-span-3 px-3 py-8 text-center",role:"status",children:[r.jsx(e1,{className:"mx-auto mb-2 opacity-50",path:"mdiBellOffOutline",size:2}),r.jsx("p",{className:"text-sm opacity-50",children:L})]})});return M?r.jsxs(w1.Content,{closeOnOutsideClick:!0,side:"right",children:[r.jsxs("div",{className:"h-15 flex items-center justify-between border-b border-gray-400 px-4",children:[r.jsx(m1,{"aria-label":"Close notifications",size:"md",variant:"ghost",onClick:()=>i(!1),children:r.jsx(m1.Icon,{path:"mdiClose"})}),r.jsx("h5",{className:"text-gray-1200 text-sm font-semibold",children:"Notifications"}),r.jsx("div",{className:"flex items-center gap-2",children:A&&a&&r.jsx("button",{className:"text-gray-1000 hover:text-gray-1200 cursor-pointer text-xs transition-colors",onClick:d,children:"Mark all read"})})]}),r.jsx("ul",{"aria-orientation":"vertical",className:s(s3,C),"data-ox-slot":"notifications-body",...V,children:l})]}):r.jsxs(r.Fragment,{children:[r.jsx(Z1.Header,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h5",{className:"text-gray-1200 text-sm font-semibold",children:"Notifications"}),A&&a&&r.jsx("button",{className:"ox-gray-outset-focus text-gray-1000 hover:text-gray-1200 cursor-pointer rounded-lg p-1 text-xs transition-colors",onClick:a,children:"Mark all read"})]})}),r.jsx("ul",{"aria-orientation":"vertical",className:s("w-85",s3,C),"data-ox-slot":"notifications-body",...V,children:l})]})},S2=({children:H,className:C,customIcon:V,unreadCount:L,...M})=>{const{disabled:e,isMobile:a,open:i,setOpen:t,unreadCount:n}=P2(),A=L??n,d=A>99?"99+":A.toString(),l=A>0,v=V??"mdiBellOutline",o=`Notifications${l?` (${A} unread)`:""}`,u=l&&r.jsx("div",{className:s("absolute -right-2 -top-2",{"opacity-50":e}),children:r.jsx(f2,{className:"min-w-[1.25rem] justify-center px-1",color:"violet",size:"sm",children:d})}),Z=H||u;return a?r.jsxs(m1,{"aria-label":o,className:s("relative",C),"data-ox-slot":"notifications-trigger",disabled:e,size:"md",variant:"ghost",...M,"data-ox-state":i?"open":"closed",onClick:()=>t(!0),children:[r.jsx(m1.Icon,{path:v}),Z]}):r.jsxs(Z1.Trigger,{"aria-label":o,className:s("relative flex h-10 min-w-10 items-center justify-center rounded-lg border border-transparent bg-transparent px-2 text-sm","ox-gray-outset-focus enabled:text-gray-1200 disabled:ox-default-disabled enabled:cursor-pointer enabled:hover:bg-gray-300",{"bg-gray-300":i},C),"data-ox-slot":"notifications-trigger",disabled:e,hideIcon:!0,...M,"data-ox-state":i?"open":"closed",children:[r.jsx(e1,{path:v}),Z]})},_t2=({children:H,disabled:C=!1,emptyMessage:V="No notifications",items:L=[],onItemClick:M,onMarkAllRead:e,unreadCount:a=0,...i})=>{const[t,n]=m.useState(!1),[A,d]=m.useState(!1);m.useEffect(()=>{const v=()=>{d(window.innerWidth<j3)};return v(),window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v)}},[]);const l=m.useMemo(()=>({disabled:C,emptyMessage:V,isMobile:A,items:L,open:t,setOpen:n,unreadCount:a,onItemClick:M,onMarkAllRead:e}),[C,V,A,L,t,a,M,e]);if(H){const v=m.Children.toArray(H).find(u=>m.isValidElement(u)&&u.type===S2),o=m.Children.toArray(H).find(u=>m.isValidElement(u)&&u.type===Z2);return A?r.jsx(L2.Provider,{value:l,children:r.jsxs("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"mobile",children:[v,r.jsx(w1,{open:t,onOpenChange:n,children:o})]})}):r.jsx(L2.Provider,{value:l,children:r.jsx("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"desktop",children:r.jsxs(Z1,{align:"end",className:"p-0",disabled:C,open:t,side:"bottom",onOpenChange:n,children:[v,o]})})})}return A?r.jsx(L2.Provider,{value:l,children:r.jsxs("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"mobile",children:[r.jsx(S2,{}),r.jsx(w1,{open:t,onOpenChange:n,children:r.jsx(Z2,{})})]})}):r.jsx(L2.Provider,{value:l,children:r.jsx("div",{"data-ox-slot":"notifications",...i,"data-ox-state":"desktop",children:r.jsxs(Z1,{align:"end",className:"p-0",disabled:C,open:t,side:"bottom",onOpenChange:n,children:[r.jsx(S2,{}),r.jsx(Z2,{})]})})})},zt2=({children:H,className:C,href:V,icon:L,img:M,message:e,timestamp:a,title:i,type:t="default",unread:n=!1,...A})=>{const{isMobile:d,onItemClick:l,setOpen:v}=P2(),o=f1[t],u=()=>{const S={id:crypto.randomUUID(),icon:L,img:M,message:e,read:!n,timestamp:a||new Date,title:i||"",type:t};l?.(S),d&&v(!1)},Z=H||r.jsxs(r.Fragment,{children:[r.jsx("div",{className:s("mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",o.background),"data-ox-slot":"notifications-icon",children:M?r.jsx(b2,{alt:"User avatar",fallback:"NA",size:"md",src:M}):r.jsx(e1,{className:o.text,path:L??o.icon,size:.75})}),r.jsxs("div",{className:"min-w-0 flex-1","data-ox-slot":"notifications-content",children:[i&&r.jsx("h5",{className:"text-gray-1200 mb-1 text-pretty text-sm font-semibold leading-tight",children:i}),e&&r.jsx("p",{className:"mb-1 text-xs leading-4",children:e}),a&&r.jsx("p",{className:"text-gray-1000 text-xs",children:u5(a)})]}),n&&r.jsx("div",{className:"mt-1.5 h-2 w-2 flex-shrink-0 rounded-full bg-rose-500","data-ox-slot":"notifications-unread"})]});return r.jsx("li",{className:"contents",children:r.jsx("a",{className:s("col-span-3 grid cursor-pointer grid-cols-subgrid items-start gap-3 px-3 py-3 text-left","ox-gray-inset-focus hover:bg-gray-400",{"bg-gray-300/80":n},C),"data-ox-slot":"notifications-link",href:V,...A,"data-ox-state":n?"unread":"read",onClick:u,children:Z})})},j1=_t2;j1.Body=Z2;j1.Button=s0;j1.Link=zt2;j1.Trigger=S2;const Gt2=({children:H,className:C,...V})=>r.jsx("nav",{"aria-label":"Pagination",className:s("flex justify-center",C),"data-ox-slot":"pagination",role:"navigation",...V,children:r.jsx("ul",{className:"flex items-center gap-1",children:H})}),B2={sm:`px-2 ${i1.sm}`,md:`px-2.5 ${i1.md}`},Ut2=({className:H,size:C="sm",...V})=>r.jsx("li",{children:r.jsx("span",{"aria-hidden":"true",className:s("flex items-center justify-center text-gray-900",B2[C],a2[C],H),"data-ox-slot":"pagination-ellipsis",...V,children:r.jsx(e1,{path:"mdiDotsHorizontal",size:c1[C]})})}),Qt2=({className:H,disabled:C=!1,isActive:V=!1,onClick:L,page:M,size:e="sm",...a})=>{const i=()=>{C||L(M)};return r.jsx("li",{children:r.jsx("button",{"aria-current":V?"page":void 0,"aria-label":`Go to page ${M}`,className:s("ox-gray-outset-focus ox-pagination-button",B2[e],a2[e],{"enabled:text-gray-1200 bg-gray-300":V},H),"data-ox-slot":"pagination-link",disabled:C,type:"button",onClick:i,...a,children:M})})},$t2=({className:H,disabled:C=!1,onClick:V,short:L=!1,size:M="sm",...e})=>{const a=()=>{C||V()};return r.jsx("li",{children:r.jsxs("button",{"aria-label":"Go to next page",className:s("ox-gray-outset-focus ox-pagination-button",B2[M],{[`gap-1 ${a2[M]}`]:L,[u1[M]]:!L},H),"data-ox-slot":"pagination-next",disabled:C,type:"button",onClick:a,...e,children:[L?null:"Next",r.jsx(e1,{path:"mdiChevronRight",size:c1[M]})]})})},Yt2=({className:H,disabled:C=!1,onClick:V,short:L=!1,size:M="sm",...e})=>{const a=()=>{C||V()};return r.jsx("li",{children:r.jsxs("button",{"aria-label":"Go to previous page",className:s("ox-gray-outset-focus ox-pagination-button gap-1",B2[M],{[`gap-1 ${a2[M]}`]:L,[u1[M]]:!L},H),"data-ox-slot":"pagination-previous",disabled:C,type:"button",onClick:a,...e,children:[r.jsx(e1,{path:"mdiChevronLeft",size:c1[M]}),L?null:"Previous"]})})},i2=Gt2;i2.Ellipsis=Ut2;i2.Link=Qt2;i2.Next=$t2;i2.Previous=Yt2;const v0=m.createContext(void 0),u0=()=>{const H=m.useContext(v0);if(H===void 0)throw new Error("usePopoverContext must be used within a PopoverProvider");return H},m5=({children:H,...C})=>{const{disabled:V}=u0();return r.jsx("div",{"data-ox-slot":"popover-trigger",...C,...V&&{"data-ox-disabled":""},children:H})},qt2=({align:H="center",children:C,defaultOpen:V=!1,disabled:L=!1,onOpenChange:M,open:e,side:a="bottom",...i})=>{const[t,n]=m.useState(V),A=e!==void 0,d=A?e:t,l=S=>{L||(A||n(S),M?.(S))},v={open:d,setOpen:l,disabled:L},o=m.Children.toArray(C).find(S=>m.isValidElement(S)&&S.type===m5),u=m.Children.toArray(C).filter(S=>!(m.isValidElement(S)&&S.type===m5)),Z=r.jsx("div",{...i,children:u});return r.jsx(v0.Provider,{value:v,children:r.jsx("div",{className:"inline-block","data-ox-slot":"popover",children:r.jsx(q1,{align:H,animationDuration:100,content:Z,contentClassName:"ox-popover-animate",disabled:L,open:d,portal:!0,position:a,trigger:"click",onOpenChange:l,children:o})})})},Kt2=({children:H,className:C,showCloseButton:V=!0,...L})=>{const{open:M,setOpen:e}=u0();return r.jsxs("div",{className:s("ox-gray-border relative min-w-[16rem] max-w-sm rounded-lg bg-gray-200 p-4 shadow-lg",C),"data-ox-slot":"popover-content","data-ox-state":M?"open":"closing",...L,children:[V&&r.jsx("div",{className:"absolute right-2 top-2",children:r.jsx(m1,{"aria-label":"Close popover",size:"sm",variant:"ghost",onClick:()=>e(!1),children:r.jsx(m1.Icon,{path:"mdiClose"})})}),r.jsx("div",{className:s({"pr-8":V}),children:H})]})},x5=qt2;x5.Content=Kt2;x5.Trigger=m5;const Xt2={purple:"bg-purple-500/30",lime:"bg-lime-400/30",red:"bg-red-500/30",yellow:"bg-yellow-500/30",green:"bg-green-500/30",blue:"bg-blue-500/30",indigo:"bg-indigo-500/30",pink:"bg-pink-500/30",amber:"bg-amber-500/30",emerald:"bg-emerald-500/30",teal:"bg-teal-500/30",cyan:"bg-cyan-500/30",sky:"bg-sky-500/30",violet:"bg-violet-500/30",fuchsia:"bg-fuchsia-500/30",orange:"bg-orange-500/30",rose:"bg-rose-500/30",gray:"bg-gray-1100/30"},Jt2=({buffer:H,className:C,max:V=100,value:L=0,variant:M="violet",...e})=>{const a=Math.max(0,Math.min(L,V)),i=H?Math.max(0,Math.min(H,V)):0,t=a1[M];return r.jsxs("div",{className:s("relative h-2 overflow-hidden rounded-full bg-gray-300",C),"data-ox-slot":"progress",role:"progressbar",...e,children:[H!==void 0?r.jsx("div",{className:s("absolute inset-y-0 left-0 rounded-full transition-all duration-300",Xt2[M]),style:{width:`${i/V*100}%`}}):null,r.jsx("div",{className:s("absolute inset-y-0 left-0 rounded-full transition-all duration-300",t.backgroundSolid),style:{width:`${a/V*100}%`}})]})},CA2={sm:40,md:48},HA2=({className:H,max:C=100,showPercentage:V=!1,size:L="sm",value:M=0,variant:e="violet",...a})=>{const i=Math.max(0,Math.min(M,C)),t=Math.round(i/C*100),n=CA2[L],A=a1[e],d=(n-4)/2,l=2*Math.PI*d,v=l-i/C*l;return r.jsx("div",{className:s("inline-flex items-center justify-center",H),"data-ox-slot":"progress",...a,children:r.jsxs("div",{className:"relative",children:[r.jsx("svg",{className:"-rotate-90 transform",height:n,width:n,children:r.jsx("circle",{className:s("transition-all duration-300 ease-in-out",A.stroke),cx:n/2,cy:n/2,fill:"none",r:d,strokeLinecap:"round",strokeWidth:"4",style:{strokeDasharray:l,strokeDashoffset:v}})}),V&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsxs("span",{className:s("text-gray-1200 font-medium",{"text-xxs":L==="sm","text-xs":L==="md"}),children:[t,"%"]})})]})})},c0=Jt2;c0.Circular=HA2;const b5=({className:H,decorative:C=!0,orientation:V="horizontal",...L})=>r.jsx("div",{"aria-orientation":C?void 0:V,className:s("shrink-0 bg-gray-400",V==="horizontal"?"h-0.25 w-full":"w-0.25 h-full",H),"data-ox-slot":"separator",role:C?"none":"separator",...L}),VA2={rectangle:"rounded-lg",circle:"rounded-full"},R2=({animate:H=!0,className:C,color:V="gray",fullWidth:L=!1,height:M,shape:e="rectangle",width:a,...i})=>{const t={height:typeof M=="number"?`${M}px`:M,width:typeof a=="number"?`${a}px`:a};return r.jsx("div",{"aria-busy":"true","aria-label":"Loading...",className:s("relative overflow-hidden",a1[V].background,VA2[e],{"animate-pulse":H,"w-full":L},C),"data-ox-slot":"skeleton",role:"status",style:t,...i})},LA2=({animate:H=!0,className:C,color:V="gray",fullWidth:L=!1,height:M=20,lines:e=1,width:a,...i})=>{const t=n=>{if(!L){if(a!==void 0&&!Array.isArray(a))return typeof a=="number"?`${a}px`:a;if(Array.isArray(a)&&a.length>0){const A=a[n%a.length];return typeof A=="number"?`${A}px`:A}return"100px"}};return r.jsx("div",{className:s("flex flex-col space-y-2",C),...i,children:Array.from({length:e}).map((n,A)=>r.jsx(R2,{animate:H,color:V,"data-ox-slot":"skeleton-text",fullWidth:L,height:M,width:t(A)},A))})},MA2={sm:{track:"h-1",handle:"size-4",text:"text-xs"},md:{track:"h-2",handle:"size-5",text:"text-sm"}},v3=(H,C,V)=>{if(Array.isArray(H))return[Math.max(C,Math.min(V,H[0])),Math.max(C,Math.min(V,H[1]))];const L=Math.max(C,Math.min(V,H));return[L,L]},u3=(H,C,V)=>(H-C)/(V-C)*100,eA2=(H,C,V,L)=>{const M=C+H/100*(V-C),e=Math.round(M/L)*L;return Math.max(C,Math.min(V,e))},rA2=({"aria-label":H,"aria-labelledby":C,className:V,defaultValue:L=0,disabled:M=!1,max:e=100,min:a=0,onChange:i,onChangeCommitted:t,orientation:n="horizontal",showValue:A=!1,size:d="md",step:l=1,value:v,...o})=>{const u=m.useRef(null),Z=m.useRef(!1),S=m.useRef(0),h=v!==void 0,f=Array.isArray(L)||Array.isArray(v),[w,p]=m.useState(v3(v||L,a,e)),O=h?v3(v,a,e):w,D=m.useCallback(j=>{if(M)return;const x=f?j:j[0];h||p(j),i?.(x)},[M,f,h,i]),y=m.useCallback(j=>{if(!u.current)return a;const x=u.current.getBoundingClientRect(),X=n==="horizontal"?(j.clientX-x.left)/x.width*100:(x.bottom-j.clientY)/x.height*100;return eA2(Math.max(0,Math.min(100,X)),a,e,l)},[a,e,l,n]),F=m.useCallback((j,x)=>{if(M)return;j.preventDefault(),Z.current=!0,S.current=x||0;const X=y(j);if(f&&x!==void 0){const g=[...O];g[x]=X,x===0&&g[0]>g[1]?g[1]=g[0]:x===1&&g[1]<g[0]&&(g[0]=g[1]),D(g)}else D([X,X])},[M,y,f,O,D]),$=m.useCallback(j=>{if(M||Z.current)return;const x=y(j);if(f){const[X,g]=O,c=Math.abs(x-X),T=Math.abs(x-g),B=c<=T?0:1,P=[...O];P[B]=x,D(P)}else D([x,x])},[M,y,f,O,D]),q=m.useCallback((j,x)=>{if(M)return;let X=0;switch(j.key){case"ArrowRight":case"ArrowUp":X=l;break;case"ArrowLeft":case"ArrowDown":X=-l;break;case"PageUp":X=(e-a)*.1;break;case"PageDown":X=-(e-a)*.1;break;case"Home":X=a-O[x];break;case"End":X=e-O[x];break;default:return}j.preventDefault();const g=[...O];g[x]=Math.max(a,Math.min(e,O[x]+X)),f&&(x===0&&g[0]>g[1]?g[1]=g[0]:x===1&&g[1]<g[0]&&(g[0]=g[1])),D(g)},[M,l,e,a,O,f,D]);m.useEffect(()=>{const j=X=>{if(!Z.current)return;const g=y(X);if(f){const c=[...O];c[S.current]=g,S.current===0&&c[0]>c[1]?c[1]=c[0]:S.current===1&&c[1]<c[0]&&(c[0]=c[1]),D(c)}else D([g,g])},x=()=>{Z.current&&(Z.current=!1,t?.(f?O:O[0]))};return Z.current&&(document.addEventListener("mousemove",j),document.addEventListener("mouseup",x)),()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",x)}},[y,f,O,D,t]);const K=MA2[d],[k,_]=O,z=u3(k,a,e),N=u3(_,a,e);return r.jsx("div",{className:s("w-full py-3",V),"data-ox-slot":"slider",...o,children:r.jsxs("div",{className:"relative py-3",children:[r.jsxs("div",{className:s("relative w-full cursor-pointer rounded-full bg-gray-300",K.track,{"ox-default-disabled":M}),ref:u,onClick:$,children:[r.jsx("div",{className:"absolute h-full rounded-full bg-violet-700",style:{left:`${f?z:0}%`,width:`${f?N-z:z}%`}}),r.jsx("div",{"aria-label":f?`${H} minimum`:H,"aria-labelledby":C,"aria-orientation":n,"aria-valuemax":e,"aria-valuemin":a,"aria-valuenow":k,"aria-valuetext":String(k),className:s("ox-violet-outset-focus absolute top-1/2 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-violet-700 bg-gray-50 active:cursor-grabbing",K.handle,{"cursor-not-allowed":M}),role:"slider",style:{left:`${z}%`},tabIndex:M?-1:0,onKeyDown:j=>q(j,0),onMouseDown:j=>F(j,0)}),f?r.jsx("div",{"aria-label":f?`${H} maximum`:H,"aria-labelledby":C,"aria-orientation":n,"aria-valuemax":e,"aria-valuemin":a,"aria-valuenow":_,"aria-valuetext":String(_),className:s("ox-violet-outset-focus absolute top-1/2 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-violet-700 bg-gray-50 active:cursor-grabbing",K.handle,{"cursor-not-allowed":M}),role:"slider",style:{left:`${N}%`},tabIndex:M?-1:0,onKeyDown:j=>q(j,1),onMouseDown:j=>F(j,1)}):null]}),A&&r.jsxs("div",{className:s("text-gray-1000 mt-2 flex justify-between text-xs"),children:[r.jsx("span",{children:f?`${k} - ${_}`:k}),r.jsxs("span",{children:[a," - ",e]})]})]})})},aA2={sm:.8,md:1.2},iA2=({className:H,size:C="md",variant:V="violet",...L})=>{const M=C1.isString(C)?aA2[C]:C,e=a1[V];return r.jsx("div",{className:s("inline-flex items-center justify-center",H),"data-ox-slot":"spinner",...L,children:r.jsx(e1,{className:s("animate-spin",e.text),path:"mdiLoading",size:M})})},tA2={loading:{title:"Loading...",message:"Good things take time",icon:"mdiLoading",showAction:!1},empty:{title:"Nothing here",message:"It's so empty... like my soul",icon:"mdiPackageVariant",showAction:!1},offline:{title:"You're offline",message:"Did you forget to pay the internet bill?",icon:"mdiWifiOff",showAction:!0},success:{title:"Success!",message:"Everything went perfectly as planned",icon:"mdiCheckCircle",showAction:!1},warning:{title:"Heads up!",message:"Something needs your attention",icon:"mdiAlertCircle",showAction:!1},info:{title:"Just so you know",message:"Here's some helpful information",icon:"mdiInformationCircle",showAction:!1},401:{title:"Please log in",message:"You need to authenticate to access this page",showAction:!0},403:{title:"Access denied",message:"You don't have permission to view this content",showAction:!0},404:{title:"Page not found",message:"Nothing to see here... just... go away... now.",showAction:!0},408:{title:"Request timeout",message:"Taking too long? Try refreshing the page",showAction:!0},429:{title:"Slow down there!",message:"Too many requests. Take a coffee break",showAction:!0},500:{title:"Oops! We broke something",message:"Don't worry, it's not your fault... probably",showAction:!0},502:{title:"Bad gateway",message:"The server is having an existential crisis",showAction:!0},503:{title:"Taking a quick nap",message:"Service will be back after coffee break",showAction:!0},504:{title:"Server timeout",message:"Server is slower than a Windows 95 boot",showAction:!0}},AA2={sm:{container:"max-w-sm space-y-4",spacing:"space-y-1",title:"text-lg",message:i1.sm,numberText:"text-3xl"},md:{container:"max-w-md space-y-6",spacing:"space-y-2",title:"text-xl",message:"text-base",numberText:"text-4xl"}},nA2=H=>H==="success"?f1.success:H==="warning"?f1.warning:H==="info"?f1.info:typeof H=="number"?f1.error:{text:"text-violet-700"},oA2=({action:H,children:C,className:V,inline:L=!1,message:M,onBack:e,size:a="sm",title:i,type:t,...n})=>{if(C)return r.jsx("div",{className:s("min-h-screen w-full",V),children:C});const A=tA2[t],d=i||A.title,l=M||A.message,v=()=>{e?e():window.history.back()},o=()=>H!==void 0?H:A.showAction?r.jsx(m1,{size:a,variant:"secondary",onClick:v,children:"Back"}):null,u=AA2[a],Z=nA2(t);return r.jsx("div",{"aria-live":typeof t=="number"?"assertive":"polite",className:s("flex w-full items-center justify-center",{"min-h-screen bg-gray-50":!L,"h-full":L},V),"data-ox-slot":"status-display",role:typeof t=="number"?"alert":"status",...n,children:r.jsxs("div",{className:s("flex flex-col items-center text-center",u.container),children:[r.jsx("div",{className:"flex items-center space-x-4",children:A.icon?r.jsx(e1,{className:s(Z.text,{"animate-spin":t==="loading"}),path:A.icon,size:a==="md"?1.75:1.25}):typeof t=="number"?r.jsx("div",{className:s("bg-gradient-to-br from-violet-700 from-20% to-rose-500 bg-clip-text font-bold text-transparent",u.numberText),children:t}):null}),r.jsxs("div",{className:u.spacing,children:[r.jsx("h1",{id:"status-title","aria-describedby":"status-message",className:s("text-gray-1200 font-bold",u.title),children:d}),r.jsx("p",{id:"status-message",className:s("text-gray-1000",u.message),children:l})]}),o()]})})},Z0=m.createContext(null),y5=()=>{const H=m.useContext(Z0);if(!H)throw new Error("OxStepperItem must be used within OxStepper");return H},S0=({children:H,className:C,...V})=>{const{orientation:L}=y5();return r.jsx("div",{className:s("mt-2 p-4",{"border-t border-gray-400":L==="vertical"},C),"data-ox-slot":"stepper-actions",...V,children:H})},dA2=(H,C,V)=>H==="error"?f1.error.icon:H==="warning"?f1.warning.icon:C||(V?f1.success.icon:null),f0=(H,C)=>H==="error"?f1.error:H==="warning"?f1.warning:a1[C],c3=(H,C)=>H==="error"||H==="warning"?C.text:"text-gray-1200",p0=({className:H,state:C,stepIndex:V,...L})=>{const{color:M,currentStep:e,orientation:a}=y5(),i=e>V,n=f0(C||(i?"completed":"current"),M);return r.jsx("div",{className:s("flex-1 border transition-colors duration-300",{"mx-4 mt-[19px]":a==="horizontal","my-2 min-h-6":a==="vertical","border-gray-400":!i,[n.border]:i},H),"data-ox-slot":"stepper-connector",...L})},e2=({children:H,className:C,disabled:V=!1,...L})=>r.jsx("div",{className:s("text-gray-1100 text-pretty text-xs leading-relaxed",{"ox-default-disabled":V},C),"data-ox-slot":"description",...L,children:H}),lA2=({children:H,className:C,icon:V="mdiAlertCircleOutline",...L})=>H?r.jsxs("div",{className:s("grid grid-cols-[auto_1fr] items-center gap-1 text-pretty text-xs text-rose-400",C),"data-ox-slot":"error",role:"alert",...L,children:[V?r.jsx(e1,{className:"shrink-0 text-current",path:V,size:c1.md}):null,H]}):null,mA2={1:"text-2xl font-bold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold",6:"text-sm font-medium",7:"text-sm"},sA2=({as:H="h2",children:C,className:V,level:L,...M})=>{const e=L??(H!=="div"?parseInt(H.slice(1)):2),a=C1.clamp(e,1,7),i={className:s("text-gray-1200",mA2[a],V),"data-ox-slot":"heading",...M,...H==="div"&&{role:"heading","aria-level":e}};return m.createElement(H,i,C)},vA2=({children:H,className:C,disabled:V=!1,htmlFor:L,required:M=!1,...e})=>r.jsxs("label",{className:s("block text-sm font-medium",{"text-gray-1200":!V,"ox-default-disabled":V},C),"data-ox-slot":"label",htmlFor:L,...e,children:[H,M&&r.jsx("span",{className:"ml-1 text-rose-400",children:"*"})]}),uA2=({children:H,className:C,disabled:V=!1,required:L=!1,...M})=>r.jsxs("legend",{className:s("block text-base font-semibold",{"text-gray-1200":!V,"ox-default-disabled":V},C),"data-ox-slot":"legend",...M,children:[H,L&&r.jsx("span",{className:"ml-1 text-rose-400",children:"*"})]}),cA2={completed:"check",error:"close",warning:"warning",current:"current step",upcoming:"upcoming step"},h0=({children:H,className:C,description:V,icon:L,state:M,stepIndex:e=0,title:a,...i})=>{const{color:t,currentStep:n,onStepChange:A,orientation:d,totalSteps:l,type:v}=y5(),o=n===e,u=n>e,Z=M||(e<n?"completed":e===n?"current":"upcoming"),S=v==="non-linear"||u||o,h=dA2(Z,L,u),f=f0(Z,t),w=()=>{S&&A&&A(e)},p=()=>r.jsx("button",{"aria-current":o?"step":void 0,"aria-describedby":V?`step-${e}-desc`:void 0,"aria-label":`${a} - ${cA2[Z]} (${e+1} of ${l})`,className:s("flex items-center justify-center rounded-lg transition-colors","enabled:cursor-pointer",Z==="error"?"ox-rose-outset-focus":"ox-violet-outset-focus",{"cursor-pointer":S,"opacity-50":Z==="upcoming"}),disabled:!S,type:"button",onClick:w,children:r.jsx("div",{className:s("flex size-10 flex-shrink-0 items-center justify-center rounded-lg border",f.border,f.background),children:h?r.jsx(e1,{className:f.text,path:h}):r.jsx("span",{className:s("text-base font-medium text-current"),children:e+1})})});return d==="horizontal"?r.jsxs("div",{className:s("flex flex-col items-center text-center",C),"data-ox-slot":"stepper-item",...i,children:[p(),r.jsxs("div",{className:"mt-2",children:[r.jsx("h6",{className:s("text-sm font-medium",c3(Z,f)),children:a}),V?r.jsx(e2,{id:`step-${e}-desc`,children:V}):null]})]}):r.jsxs("div",{className:s("flex gap-3",C),"data-ox-slot":"stepper-item",...i,children:[r.jsxs("div",{className:"flex flex-col items-center",children:[p(),e<l-1?r.jsx(p0,{state:M,stepIndex:e}):null]}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("h6",{className:s("text-sm font-medium",c3(Z,f)),children:a}),V?r.jsx(e2,{id:`step-${e}-desc`,children:V}):null]}),o&&H?r.jsx("div",{className:"ox-gray-border mb-4 rounded-lg bg-gray-50 p-4",children:H}):null]})]})},ZA2=({children:H,className:C,color:V="violet",currentStep:L=0,onStepChange:M,orientation:e="vertical",type:a="linear",...i})=>{const t=m.Children.toArray(H).filter(l=>m.isValidElement(l)&&l.type===h0),n=m.Children.toArray(H).find(l=>m.isValidElement(l)&&l.type===S0),A=t.map((l,v)=>m.cloneElement(l,{stepIndex:v,key:v})),d={color:V,currentStep:L,onStepChange:M,orientation:e,totalSteps:t.length,type:a};return r.jsx(Z0.Provider,{value:d,children:r.jsxs("div",{"aria-label":"Step-by-step progress","aria-valuemax":t.length,"aria-valuenow":L+1,className:s("w-full",C),"data-ox-slot":"stepper",role:"navigation",...i,children:[e==="horizontal"?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex w-full items-start",children:A.map((l,v)=>r.jsxs(m.Fragment,{children:[m.cloneElement(l,{className:s("min-w-0 flex-1",l.props.className)}),v<t.length-1?r.jsx(p0,{state:t[v].props.state,stepIndex:v}):null]},v))}),t[L]?.props.children?r.jsx("div",{className:"ox-gray-border mt-6 rounded-lg bg-gray-50 p-4",children:t[L].props.children}):null]}):A,n]})})},w5=ZA2;w5.Actions=S0;w5.Item=h0;const g0=m.createContext(void 0),SA2=({allRowIds:H=[],children:C,className:V,onSelectionChange:L,selectable:M=!1,selectedRows:e=[],...a})=>{const i=m.useMemo(()=>{const t=H.length>0&&e.length===H.length,n=e.length>0&&e.length<H.length;return{allRowIds:H,selectable:M,selectedRows:e,onSelectionChange:L,isSelected:A=>e.includes(A),toggleSelection:A=>{if(!L)return;const d=e.includes(A);L(d?e.filter(l=>l!==A):[...e,A])},toggleAll:()=>{L&&L(t?[]:[...H])},isAllSelected:t,isIndeterminate:n}},[H,M,e,L]);return r.jsx(g0.Provider,{value:i,children:r.jsx("div",{className:"ox-gray-border overflow-hidden rounded-lg bg-gray-50",children:r.jsx("table",{className:s("w-full table-auto",V),"data-ox-slot":"table",...a,children:C})})})},fA2=({children:H,className:C,...V})=>r.jsx("tbody",{className:C,"data-ox-slot":"table-body",...V,children:H}),pA2=({children:H,className:C,...V})=>r.jsx("td",{className:s("text-gray-1200 px-3 py-2 text-sm",C),"data-ox-slot":"table-cell",...V,children:H}),hA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("mb-4 flex items-center justify-between gap-4",C),"data-ox-slot":"table-controls",...V,children:H}),gA2=({children:H,className:C,...V})=>r.jsx("tfoot",{className:s("border-t border-gray-400 bg-gray-100 font-semibold",C),"data-ox-slot":"table-footer",...V,children:H}),O0=m.createContext(void 0),OA2=()=>m.useContext(O0),xA2={sm:"size-4.5",md:"size-5.5"},bA2=({checked:H,className:C,defaultChecked:V,disabled:L=!1,error:M=!1,id:e,indeterminate:a=!1,name:i,onChange:t,onCheckedChange:n,required:A=!1,size:d,value:l,...v})=>{const o=m.useId(),u=OA2(),Z=m.useRef(null),h=`${e||o}-checkbox`,f=d||u?.size||"sm",w=L||u?.disabled||!1,p=i||u?.name,O=H!==void 0||u&&l!==void 0;let D;u&&l!==void 0?D=u.value?.includes(l)||!1:D=H,m.useEffect(()=>{Z.current&&(Z.current.indeterminate=a)},[a]);const y=a?"mixed":D===!0?"true":"false",F=q=>{const K=q.target.checked;if(u&&l!==void 0){const k=u.value,_=K?[...k,l]:k.filter(z=>z!==l);u.onChange?.(_)}else t?.(q),n?.(K)},$=a?"mdiMinus":"mdiCheck";return r.jsxs("div",{className:"relative inline-flex shrink-0",children:[r.jsx("input",{id:h,"aria-checked":y,"aria-invalid":M,"aria-required":A,"data-ox-slot":"checkbox",ref:Z,...O?{checked:D}:{defaultChecked:V},className:s("peer cursor-pointer appearance-none rounded-sm bg-gray-50",xA2[f],"ox-violet-outset-focus checked:bg-violet-700 disabled:cursor-not-allowed disabled:opacity-50",{"ox-rose-border":M,"ox-gray-border":!M},C),disabled:w,name:p,required:A,type:"checkbox",value:l,onChange:F,...v,"data-ox-state":w?"disabled":a?"indeterminate":D?"checked":"unchecked"}),r.jsx(e1,{className:s("text-gray-1200 pointer-events-none absolute inset-0 m-auto",{"opacity-80":a,"peer-checked:opacity-80":!a,"opacity-0":!a}),path:$,size:c1[f]})]})},yA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-1","input:data-[ox-slot=checkbox]:[grid-column-start:var(--ox-field-control-col)] input:data-[ox-slot=checkbox]:[grid-row-start:var(--ox-field-control-row)]","*:data-[ox-slot=label]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=label]:[grid-row-start:var(--ox-field-label-row)]","*:data-[ox-slot=description]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=description]:[grid-row-start:var(--ox-field-desc-row)]",C),...V,children:H}),wA2=({children:H,className:C,disabled:V=!1,name:L,onChange:M,size:e="sm",value:a=[],...i})=>r.jsx(O0.Provider,{value:{value:a,onChange:M,name:L,size:e,disabled:V},children:r.jsx("div",{className:s("space-y-2",C),"data-ox-slot":"checkbox-group",role:"group",...i,children:H})}),t2=bA2;t2.Group=wA2;t2.Field=yA2;const x0=m.createContext(null),Z3=H=>{const C={B:1,KB:1024,MB:1048576,GB:1073741824},V=H.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!V)throw new Error(`Invalid size format: ${H}. Use format like "5MB", "1.5GB", etc.`);const[,L,M]=V;return parseFloat(L)*C[M.toUpperCase()]},kA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),TA2=(H,C)=>C.some(V=>V.includes("/")?V.endsWith("/*")?H.type.startsWith(V.slice(0,-1)):H.type===V:H.name.toLowerCase().endsWith(`.${V.toLowerCase()}`)),PA2=({accept:H=[],children:C,className:V,disabled:L=!1,maxFiles:M,maxSize:e,minSize:a,multiple:i=!1,onError:t,onFileSelect:n,...A})=>{const[d,l]=m.useState([]),[v,o]=m.useState(!1),[u,Z]=m.useState(),S=m.useCallback(F=>{if(!i&&F.length>1)return"Only single file selection is allowed";if(M&&F.length>M)return`Maximum ${M} file${M===1?"":"s"} allowed`;if(F.length===0)return null;if(H.length>0&&F.filter(q=>!TA2(q,H)).length>0)return`Invalid file type. Accepted formats: ${H.join(", ")}`;if(e){const $=Z3(e);if(F.filter(K=>K.size>$).length>0)return`File size must not exceed ${e}`}if(a){const $=Z3(a);if(F.filter(K=>K.size<$).length>0)return`File size must be at least ${a}`}return null},[H,M,e,a,i]),h=m.useCallback(F=>{const $=S(F);if($){Z($),t?.($);return}Z(void 0),l(F),n?.(F)},[S,t,n]),f=m.useCallback(()=>{l([]),Z(void 0)},[]),w=m.useMemo(()=>({accept:H,clearFiles:f,disabled:L,error:u,files:d,isDragActive:v,maxFiles:M,maxSize:e,minSize:a,multiple:i,onError:t,onFileSelect:n,selectFiles:h,validateFiles:S}),[H,f,L,u,d,v,M,e,a,i,t,n,h,S]),p=m.useCallback(F=>{F.preventDefault(),F.stopPropagation(),L||o(!0)},[L]),O=m.useCallback(F=>{F.preventDefault(),F.stopPropagation(),!L&&!F.currentTarget.contains(F.relatedTarget)&&o(!1)},[L]),D=m.useCallback(F=>{F.preventDefault(),F.stopPropagation()},[]),y=m.useCallback(F=>{if(F.preventDefault(),F.stopPropagation(),L)return;o(!1);const $=Array.from(F.dataTransfer.files);h($)},[L,h]);return r.jsx(x0.Provider,{value:w,children:r.jsxs("div",{className:s("relative",V),"data-ox-slot":"file-upload",...A,"data-ox-state":v?"drag-active":"idle",onDragEnter:p,onDragLeave:O,onDragOver:D,onDrop:y,children:[C,r.jsx("input",{accept:H.length>0?kA2(H):void 0,className:"hidden","data-ox-slot":"file-upload-input",disabled:L,multiple:i,style:{display:"none"},type:"file"})]})})},k5=()=>{const H=m.useContext(x0);if(!H)throw new Error("useFileUploadContext must be used within a FileUploadContext.Provider");return H},BA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),RA2=({children:H,className:C,...V})=>{const L=m.useRef(null),{accept:M,disabled:e,error:a,isDragActive:i,multiple:t,selectFiles:n}=k5(),A=()=>{!e&&L.current&&L.current.click()},d=l=>{const v=Array.from(l.target.files||[]);v.length>0&&n(v),l.target.value=""};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:s("rounded-lg border-2 border-dashed p-6 transition-all duration-200",{"border-gray-400 bg-gray-50":!i&&!a,"border-violet-500 bg-gray-50":i,"border-rose-500 bg-gray-50":a,"cursor-pointer hover:border-violet-500 focus:border-violet-500 focus:outline-none":!a&&!e,"ox-default-disabled":e},C),"data-ox-slot":"file-upload-area",role:"button",tabIndex:e?-1:0,...V,"data-ox-state":a?"error":i?"drag-active":e?"disabled":"idle",onClick:A,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&!e&&(l.preventDefault(),A())},children:[H,a&&r.jsx("div",{className:"mt-2 text-center text-sm text-rose-500",children:a})]}),r.jsx("input",{accept:M.length>0?BA2(M):void 0,className:"hidden","data-ox-slot":"file-upload-area-input",disabled:e,multiple:t,ref:L,style:{display:"none"},type:"file",onChange:d})]})},FA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),EA2=({children:H,className:C,size:V="sm",variant:L="primary",...M})=>{const e=m.useRef(null),{accept:a,disabled:i,multiple:t,selectFiles:n}=k5(),A=()=>{!i&&e.current&&e.current.click()},d=l=>{const v=Array.from(l.target.files||[]);v.length>0&&n(v),l.target.value=""};return r.jsxs(r.Fragment,{children:[r.jsx(m1,{className:s("cursor-pointer",C),"data-ox-slot":"file-upload-button",disabled:i,size:V,type:"button",variant:L,...M,onClick:A,children:H}),r.jsx("input",{accept:a.length>0?FA2(a):void 0,className:"hidden","data-ox-slot":"file-upload-button-input",disabled:i,multiple:t,ref:e,style:{display:"none"},type:"file",onChange:d})]})},DA2=H=>H.map(C=>C.includes("/")?C:`.${C}`).join(","),NA2=({children:H,className:C,...V})=>{const L=m.useRef(null),[M,e]=m.useState(!1),{accept:a,disabled:i,isDragActive:t,multiple:n,selectFiles:A}=k5(),d=()=>{!i&&L.current&&L.current.click()},l=o=>{const u=Array.from(o.target.files||[]);u.length>0&&A(u),o.target.value=""},v=(M||t)&&!i;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:s("ox-backdrop-blur-parent group relative w-fit cursor-pointer overflow-hidden rounded-lg","ox-violet-outset-focus",{"cursor-not-allowed opacity-50":i},C),"data-ox-slot":"file-upload-overlay",role:"button",tabIndex:i?-1:0,...V,"data-ox-state":t?"drag-active":M?"hovered":i?"disabled":"idle",onClick:d,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&!i&&(o.preventDefault(),d())},onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[H,r.jsx("div",{className:s("absolute inset-0 flex w-full items-center justify-center transition-all duration-200","bg-gray-50/50 backdrop-blur-[2px]",{"pointer-events-none opacity-0":!v,"opacity-100":v,"bg-violet-700/60":t}),"data-ox-slot":"file-upload-overlay-backdrop",children:r.jsx("div",{className:s("flex flex-col items-center gap-2 text-white transition-transform duration-200",{"scale-90":!v,"scale-100":v,"scale-110":t}),children:r.jsx(e1,{className:"drop-shadow-sm",path:t?"mdiCloudUpload":"mdiUpload",size:1.5})})})]}),r.jsx("input",{accept:a.length>0?DA2(a):void 0,className:"hidden","data-ox-slot":"file-upload-overlay-input",disabled:i,multiple:n,ref:L,style:{display:"none"},type:"file",onChange:l})]})},F2=PA2;F2.Area=RA2;F2.Button=EA2;F2.Overlay=NA2;const jA2=({children:H,className:C,fullWidth:V=!1,noValidate:L=!0,...M})=>r.jsx("form",{className:s({"w-full":V},C),"data-ox-slot":"form",noValidate:L,...M,children:H}),IA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("space-y-1",C),"data-ox-slot":"form-field",...V,children:H}),WA2=({children:H,className:C,...V})=>r.jsx("div",{className:s("space-y-6",C),"data-ox-slot":"form-fields",...V,children:H}),_A2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid gap-6 lg:grid-cols-[1fr_2fr] lg:gap-8",C),"data-ox-slot":"form-group",...V,children:H}),E2=jA2;E2.Group=_A2;E2.Fields=WA2;E2.Field=IA2;const A2=m.createContext(null),k1=()=>{const H=m.useContext(A2);if(!H)throw new Error("useBaseInputContext must be used within a BaseInput component");return H},T1=({children:H,className:C,path:V,...L})=>{const{disabled:M,size:e}=k1();return r.jsx("button",{className:s("enabled:cursor-pointer","disabled:ox-default-disabled",{[i1[e]]:!V},C),"data-ox-slot":"input-button",disabled:M,tabIndex:-1,type:"button",...L,children:V?r.jsx(e1,{path:V,size:c1[e]}):H})},zA2=H=>r.jsx(T1,{...H}),D2=({children:H,className:C,...V})=>{const{error:L,showValidation:M,size:e,validationMessage:a}=k1();return r.jsx(U0,{content:a,open:M,position:"bottom",trigger:"click",variant:"error",children:r.jsx("div",{className:s("flex w-full items-center gap-1.5 rounded-lg bg-gray-50 p-1.5","ox-violet-outset-within-focus",u1[e],{"ox-gray-border":!L,"ox-rose-border":L},C),"data-ox-slot":"input-container",...V,children:H})})},b0=m.createContext(null),GA2=({defaultValue:H,onChange:C,value:V})=>{const[L,M]=C1.useControllableState({value:V,defaultValue:H??"",onChange:o=>C?.(o??"")}),e=o=>{if(!o)return{day:"",month:"",year:""};const[u="",Z="",S=""]=o.split("-");return{day:S,month:Z,year:u}},a=(o,u,Z)=>{if(!o&&!u&&!Z)return"";const S=o?o.padStart(2,"0"):"",h=u?u.padStart(2,"0"):"";return`${Z?Z.padStart(4,"0"):""}-${h}-${S}`},{day:i,month:t,year:n}=e(L);return{day:i,month:t,year:n,setValue:o=>{const u=o.day??i,Z=o.month??t,S=o.year??n,h=a(u,Z,S);M(h)},dateValue:L,setDateValue:M,isValidCompleteDate:(o,u,Z)=>{if(!o||!u||!Z||Z.length<4)return!1;const S=a(o,u,Z),h=E6(S,"yyyy-MM-dd",new Date);return $3(h)},getMaxDayForMonth:(o,u)=>{if(!o)return 31;const Z=parseInt(o,10);if(Z<1||Z>12)return 31;const S=u&&u.length===4?parseInt(u,10):new Date().getFullYear(),h=new Date(S,Z-1,1);return j9(h)},autoCompleteYear:o=>o.length===2?parseInt(o,10)<50?`20${o}`:`19${o}`:o}},UA2=({children:H,className:C,customValidationMessage:V,defaultValue:L="",disabled:M=!1,error:e=!1,onChange:a,pickOnly:i=!1,readOnly:t=!1,required:n=!1,showValidation:A=!1,showValidationTooltip:d=!1,size:l="sm",value:v,...o})=>{const u=t||i,{autoCompleteYear:Z,day:S,getMaxDayForMonth:h,isValidCompleteDate:f,month:w,setValue:p,year:O}=GA2({value:v,defaultValue:L,onChange:a}),[D,y]=m.useState(""),[F,$]=m.useState(A),[q,K]=m.useState(!1),k=S&&w&&O&&O.length===4?`${O}-${w.padStart(2,"0")}-${S.padStart(2,"0")}`:void 0,_=N=>{const[j,x,X]=N.split("-");p({day:X,month:x,year:j}),K(!1)},z=r.jsx("div",{className:"ox-gray-border z-50 rounded-lg bg-gray-200 p-4",children:r.jsx(e0,{value:k,onChange:_})});return r.jsx(q1,{align:"start",content:z,open:q,portal:!0,position:"bottom",trigger:"click",onOpenChange:K,children:r.jsx(A2.Provider,{value:{disabled:M,error:e,showValidation:F,showValidationTooltip:d,required:n,size:l,validationMessage:V||D,setShowValidation:$,setValidationMessage:y},children:r.jsx(b0.Provider,{value:{day:S,month:w,year:O,setValue:p,isValidCompleteDate:f,getMaxDayForMonth:h,autoCompleteYear:Z,readOnly:u,pickOnly:i,isCalendarOpen:q,setIsCalendarOpen:K},children:r.jsx(D2,{className:s("w-fit",C),"data-ox-slot":"input-date-container",...o,children:H})})})})},N2=({children:H,className:C,path:V,...L})=>{const{disabled:M,size:e}=k1();return r.jsx("span",{className:s("enabled:cursor-pointer",{"ox-default-disabled":M},C),"data-ox-slot":"input-icon",tabIndex:-1,...L,children:V?r.jsx(e1,{path:V,size:c1[e]}):H})},QA2=H=>r.jsx(N2,{...H}),N1=({className:H,id:C,...V})=>{const L=m.useId(),{customValidationMessage:M,disabled:e,error:a,required:i,setShowValidation:t,setValidationMessage:n,showValidationTooltip:A,size:d}=k1(),l=o=>{o.preventDefault(),A&&(n(M||o.currentTarget.validationMessage),t(!0))},v=C||L;return r.jsx("input",{id:v,"aria-invalid":a,"aria-required":i,className:s("enabled:text-gray-1200 w-full min-w-10 appearance-none bg-transparent outline-none","disabled:ox-default-disabled placeholder:text-gray-900",i1[d],H),disabled:e,required:i,onInput:()=>t(!1),onInvalid:l,...V})},y0=()=>{const H=m.useContext(b0);if(!H)throw new Error("useDateContext must be used within a DateInput component");return H},$A2=()=>{const{autoCompleteYear:H,day:C,getMaxDayForMonth:V,isValidCompleteDate:L,month:M,pickOnly:e,readOnly:a,setIsCalendarOpen:i,setValue:t,year:n}=y0(),{disabled:A,setValidationMessage:d,size:l}=k1(),v=m.useRef(null),o=m.useRef(null),u=m.useRef(null),Z=k=>{const _=V(M,n),z=C?parseInt(C,10):k===1?0:_+1,N=k===1?z>=_?1:z+1:z<=1?_:z-1;t({day:String(N)})},S=k=>{const _=M?parseInt(M,10):k===1?0:13,z=k===1?_>=12?1:_+1:_<=1?12:_-1,N=V(String(z),n);(C?parseInt(C,10):0)>N?t({day:String(N),month:String(z)}):t({month:String(z)})},h=k=>{const _=k.target.value,z=V(M,n);(_===""||/^\d{1,2}$/.test(_)&&parseInt(_,10)<=z)&&t({day:_})},f=k=>{const _=k.target.value;(_===""||/^\d{1,2}$/.test(_)&&parseInt(_,10)<=12)&&t({month:_})},w=k=>{const _=k.target.value;(_===""||/^\d{1,4}$/.test(_)&&parseInt(_,10)<=2100)&&t({year:_})},p=k=>{k.key==="ArrowUp"?(k.preventDefault(),Z(1)):k.key==="ArrowDown"?(k.preventDefault(),Z(-1)):(k.key==="Tab"&&!k.shiftKey||k.key==="Enter"||k.key==="-")&&(k.preventDefault(),o.current?.focus())},O=k=>{k.key==="ArrowUp"?(k.preventDefault(),S(1)):k.key==="ArrowDown"?(k.preventDefault(),S(-1)):k.key==="Tab"&&k.shiftKey?(k.preventDefault(),v.current?.focus()):k.key==="Tab"&&!k.shiftKey||k.key==="Enter"||k.key==="-"?(k.preventDefault(),u.current?.focus()):k.key==="Backspace"&&M===""&&v.current?.focus()},D=k=>{k.key==="Tab"&&k.shiftKey?(k.preventDefault(),o.current?.focus()):k.key==="Backspace"&&n===""&&o.current?.focus()},y=()=>{C&&M&&n?L(C,M,n)?d(""):d("Invalid date"):d("")},F=()=>{y()},$=()=>{y()},q=()=>{if(n.length===2){const k=H(n);t({year:k})}y()},K=()=>{e&&i(!0)};return r.jsxs("div",{className:s("flex items-center bg-transparent",{"cursor-pointer":e&&!A}),"data-ox-slot":"input-date",onClick:K,children:[r.jsx(N1,{"aria-label":"Day",autoComplete:"off",className:s("w-6 min-w-6 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"enabled:cursor-pointer":e}),inputMode:"numeric",max:"31",min:"0",pattern:"[0-9]*",placeholder:"dd",readOnly:a,ref:v,type:"number",value:C,onBlur:F,onChange:h,onKeyDown:p}),r.jsx("span",{className:s(i1[l],{"text-gray-1000":!A,"ox-default-disabled":A}),children:"-"}),r.jsx(N1,{"aria-label":"Month",autoComplete:"off",className:s("w-6 min-w-6 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"enabled:cursor-pointer":e}),inputMode:"numeric",max:"12",min:"0",pattern:"[0-9]*",placeholder:"mm",readOnly:a,ref:o,type:"number",value:M,onBlur:$,onChange:f,onKeyDown:O}),r.jsx("span",{className:s(i1[l],{"text-gray-1000":!A,"ox-default-disabled":A}),children:"-"}),r.jsx(N1,{"aria-label":"Year",autoComplete:"off",className:s("w-10 min-w-10 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"enabled:cursor-pointer":e}),inputMode:"numeric",max:"2100",min:"0",pattern:"[0-9]*",placeholder:"yyyy",readOnly:a,ref:u,type:"number",value:n,onBlur:q,onChange:w,onKeyDown:D})]})},YA2=({children:H,...C})=>{const{isCalendarOpen:V,setIsCalendarOpen:L}=y0();return r.jsx(T1,{...C,path:"mdiCalendar",onClick:()=>L(!V),children:H})},n2=$A2;n2.Container=UA2;n2.Icon=QA2;n2.Button=zA2;n2.PickerButton=YA2;const qA2=H=>r.jsx(T1,{...H}),w0=m.createContext(null),KA2=({children:H,defaultValue:C,disabled:V=!1,error:L=!1,locale:M="en-US",max:e,maximumFractionDigits:a,min:i,minimumFractionDigits:t,onChange:n,required:A=!1,showValidationTooltip:d=!1,size:l="sm",steps:v=1,useGrouping:o=!0,value:u,...Z})=>{const S=m.useRef(null),h=m.useMemo(()=>new Intl.NumberFormat(M,{useGrouping:o!==!1,minimumFractionDigits:t,maximumFractionDigits:a}),[M,o,t,a]),[f,w]=C1.useControllableState({value:u,onChange:n,defaultValue:C,name:"OxNumberInput"}),[p,O]=m.useState(f!==void 0?h.format(f):""),[D,y]=m.useState(""),[F,$]=m.useState(!1),q=m.useCallback(N=>{if(!N.trim())return;const j=N.replace(/[^\d.-]/g,""),x=parseFloat(j);return!isNaN(x)&&isFinite(x)?x:void 0},[]),K=m.useCallback(N=>C1.clamp(N,i??-1/0,e??1/0),[i,e]),k=N=>{let j=q(p);j===void 0&&(j=f!==void 0?f:0);const x=K(j),X=K(x+N);w(X),O(h.format(X))},_=()=>k(v),z=()=>k(-v);return r.jsx(A2.Provider,{value:{disabled:V,error:L,showValidation:F,showValidationTooltip:d,required:A,size:l,validationMessage:D,setShowValidation:$,setValidationMessage:y},children:r.jsx(w0.Provider,{value:{internalValue:f,setInternalValue:w,max:e,min:i,steps:v,handleIncrement:_,handleDecrement:z,displayValue:p,setDisplayValue:O,formatter:h,parse:q,clampValue:K,inputRef:S},children:r.jsx(D2,{"data-ox-slot":"input-number-container",...Z,children:H})})})},T5=()=>{const H=m.useContext(w0);if(!H)throw new Error("useNumberContext must be used within a Number component");return H},XA2=()=>{const{size:H}=k1(),{handleDecrement:C,inputRef:V}=T5();return r.jsx(T1,{"aria-controls":V.current?.id,"aria-label":"Decrease value","data-ox-slot":"input-number-decrement",onClick:C,children:r.jsx(e1,{path:"mdiMinus",size:c1[H]})})},JA2=H=>r.jsx(N2,{...H}),Cn2=()=>{const{size:H}=k1(),{handleIncrement:C,inputRef:V}=T5();return r.jsx(T1,{"aria-controls":V.current?.id,"aria-label":"Increase value","data-slot":"input-number-increment",onClick:C,children:r.jsx(e1,{path:"mdiPlus",size:c1[H]})})},Hn2=({"aria-label":H,"aria-labelledby":C,className:V,...L})=>{const{clampValue:M,displayValue:e,formatter:a,handleDecrement:i,handleIncrement:t,inputRef:n,internalValue:A,max:d,min:l,parse:v,setDisplayValue:o,setInternalValue:u}=T5(),[Z,S]=m.useState(!1),h=O=>{o(O.target.value)},f=O=>{const D=O.nativeEvent,y=O.target,F=y.value.slice(0,y.selectionStart??void 0)+(D.data??"")+y.value.slice(y.selectionEnd??void 0);!/^-?[\d.,]*$/.test(F)&&F!==""&&O.preventDefault()},w=()=>{const O=v(e);if(O!==void 0){const D=M(O);u(D),o(a.format(D))}else u(void 0),o("")},p=O=>{const D=O.clipboardData.getData("text"),y=v(D);y!==void 0&&(O.preventDefault(),o(a.format(y)),u(y))};return C1.useKeyboard({onArrowDown:i,onArrowUp:t,onEnter:w,enabled:Z,allowRepeat:!0}),r.jsx(N1,{"aria-label":H,"aria-labelledby":C,"aria-valuemax":d,"aria-valuemin":l,"aria-valuenow":A,autoComplete:"off",className:s("text-center",V),"data-ox-slot":"input-number",inputMode:"decimal",ref:n,role:"spinbutton",type:"text",value:e,onBeforeInput:f,onBlur:()=>{S(!1),w()},onChange:h,onFocus:()=>S(!0),onPaste:p,...L})},K1=Hn2;K1.Button=qA2;K1.Container=KA2;K1.DecrementButton=XA2;K1.Icon=JA2;K1.IncrementButton=Cn2;const Vn2={sm:"size-8 text-sm",md:"size-9 text-sm"},Ln2={sm:"gap-1",md:"gap-2"},Mn2=H=>{switch(H){case"numeric":return{inputMode:"numeric",pattern:"[0-9]*"};case"alphanumeric":return{inputMode:"text",pattern:"[A-Z0-9]*"};case"text":default:return{inputMode:"text"}}},en2=(H,C)=>{switch(C){case"numeric":return H.replace(/[^0-9]/g,"");case"alphanumeric":return H.replace(/[^A-Z0-9]/gi,"").toUpperCase();default:return H}},rn2=({className:H,disabled:C=!1,error:V=!1,length:L=6,onComplete:M,onValueChange:e,placeholder:a="",size:i="md",type:t="numeric"})=>{const n=m.useId(),[A,d]=m.useState(()=>new Array(L).fill("")),l=m.useRef([]),v=Mn2(t);l.current=l.current.slice(0,L);const o=h=>r2.flushSync(()=>{d(h)}),u=(h,f)=>{const w=en2(f,t),p=[...A];p[h]=w[0]||"";const O=p[h]&&h<L-1?h+1:void 0;o(p),O!==void 0&&l.current[O]?.focus();const D=p.filter(F=>F!==""),y=D.join("");e?.(y),D.length===L&&M?.(y)},Z=(h,f)=>{const w=[...A];if(f.key==="Backspace"){if(A[h]){w[h]="",o(w);const p=w.filter(O=>O!=="");e?.(p.join(""))}else if(h>0){w[h-1]="",o(w),l.current[h-1]?.focus();const p=w.filter(O=>O!=="");e?.(p.join(""))}}f.key==="ArrowLeft"&&h>0&&l.current[h-1]?.focus(),f.key==="ArrowRight"&&h<L-1&&l.current[h+1]?.focus()},S=h=>{l.current[h]?.select()};return r.jsx("div",{className:s("inline-flex",Ln2[i],H),"data-ox-slot":"otp-input",children:Array.from({length:L},(h,f)=>{const w=f===0||A.slice(0,f).every(O=>O!==""),p=C||!w;return r.jsx("input",{id:`${n}-digit-${f}`,"aria-label":`Digit ${f+1} of ${L}`,autoComplete:"one-time-code",className:s("rounded-lg border bg-gray-50 text-center font-mono transition-all duration-200","ox-violet-outset-focus",Vn2[i],{"ox-gray-border":!V,"ox-rose-border":V,"ox-default-disabled":C}),"data-ox-slot":"otp-digit",disabled:p,maxLength:1,placeholder:a,ref:O=>{l.current[f]=O},type:"text",value:A[f],onChange:O=>u(f,O.target.value),onFocus:()=>S(f),onKeyDown:O=>Z(f,O),onPaste:O=>O.preventDefault(),...v},f)})})},an2=H=>r.jsx(T1,{...H}),k0=m.createContext(null),P5=()=>{const H=m.useContext(k0);if(!H)throw new Error("useTextContext must be used within a Text component");return H},in2=()=>{const{handleClear:H,internalValue:C}=P5();return r.jsx(T1,{"aria-label":"Clear input",className:s("",{invisible:!C}),"data-ox-slot":"input-text-clear",path:"mdiClose",onClick:H})},tn2=({children:H,className:C,customValidationMessage:V,defaultValue:L,disabled:M=!1,error:e=!1,onChange:a,required:i=!1,showValidation:t=!1,showValidationTooltip:n=!1,size:A="sm",type:d="text",value:l,...v})=>{const o=m.useRef(null),[u,Z]=C1.useControllableState({value:l,onChange:q=>{a?.(q??"")},defaultValue:L,name:"OxTextInput"}),S=u??"",h=q=>Z(q),[f,w]=m.useState(d),[p,O]=m.useState(""),[D,y]=m.useState(t),F=()=>{h(""),o.current?.focus()},$=()=>{f==="password"?w("text"):f==="text"&&w("password")};return r.jsx(A2.Provider,{value:{disabled:M,error:e,showValidation:D,showValidationTooltip:n,required:i,size:A,validationMessage:V||p,setShowValidation:y,setValidationMessage:O},children:r.jsx(k0.Provider,{value:{handleClear:F,handleTypeToggle:$,inputRef:o,internalValue:S,setInternalValue:h,type:f},children:r.jsx(D2,{className:s("[&_[data-ox-slot='input-text']:only-child]:px-2",C),"data-ox-slot":"input-text-container",...v,children:H})})})},An2=({className:H,currentLength:C=0,disabled:V=!1,maxLength:L,size:M="sm",...e})=>r.jsxs("div",{className:s("text-gray-1000 mt-1 text-right tabular-nums",i1[M],{"ox-default-disabled":V},H),"data-ox-slot":"input-counter",...e,children:[C,"/",L]}),nn2=H=>r.jsx(An2,{...H}),on2=H=>r.jsx(N2,{...H}),dn2=({autoComplete:H,className:C,id:V,maxLength:L,placeholder:M,spellCheck:e=!1,...a})=>{const{disabled:i,error:t,required:n}=k1(),{inputRef:A,internalValue:d,setInternalValue:l,type:v}=P5(),o=u=>{l(u.target.value)};return r.jsx(N1,{id:V,"aria-invalid":t,"aria-required":n,autoComplete:H,className:C,"data-ox-slot":"input-text",disabled:i,maxLength:L,placeholder:M,ref:A,required:n,spellCheck:e,type:v,value:d,onChange:o,...a})},ln2=()=>{const{handleTypeToggle:H,type:C}=P5(),V=C==="text";return r.jsx(T1,{"aria-label":V?"Hide password":"Show password","data-ox-slot":"input-text-toggle",path:V?"mdiEyeOff":"mdiEye",onClick:H})},I1=dn2;I1.Button=an2;I1.ClearButton=in2;I1.Container=tn2;I1.Counter=nn2;I1.Icon=on2;I1.VisibilityButton=ln2;const mn2=H=>r.jsx(T1,{...H}),T0=m.createContext(null),sn2=({defaultValue:H,onChange:C,value:V})=>{const[L,M]=C1.useControllableState({value:V,defaultValue:H??"",onChange:d=>C?.(d??"")}),e=d=>{if(!d)return{hours:"",minutes:""};const[l="",v=""]=d.split(":");return{hours:l,minutes:v}},a=(d,l)=>{if(!d&&!l)return"";const v=d?d.padStart(2,"0"):"",o=l?l.padStart(2,"0"):"";return`${v}:${o}`},{hours:i,minutes:t}=e(L);return{hours:i,minutes:t,setHours:d=>{const l=a(d,t);M(l)},setMinutes:d=>{const l=a(i,d);M(l)},timeValue:L,setTimeValue:M}},vn2=({children:H,className:C,customValidationMessage:V,defaultValue:L="",disabled:M=!1,error:e=!1,onChange:a,required:i=!1,showValidation:t=!1,showValidationTooltip:n=!1,size:A="sm",value:d,...l})=>{const{hours:v,minutes:o,setHours:u,setMinutes:Z}=sn2({value:d,defaultValue:L,onChange:a}),[S,h]=m.useState(""),[f,w]=m.useState(t);return r.jsx(A2.Provider,{value:{disabled:M,error:e,showValidation:f,showValidationTooltip:n,required:i,size:A,validationMessage:V||S,setShowValidation:w,setValidationMessage:h},children:r.jsx(T0.Provider,{value:{hours:v,minutes:o,setHours:u,setMinutes:Z},children:r.jsx(D2,{className:s("w-fit [&_[data-ox-slot='input-time']:only-child]:px-2",C),"data-ox-slot":"input-time-container",...l,children:H})})})},un2=H=>r.jsx(N2,{...H}),cn2=()=>{const H=m.useContext(T0);if(!H)throw new Error("useTimeContext must be used within a TimeInput component");return H},Zn2=()=>{const{hours:H,minutes:C,setHours:V,setMinutes:L}=cn2(),{disabled:M,size:e}=k1(),a=m.useRef(null),i=m.useRef(null),t=l=>{const v=l.target.value;(v===""||/^\d{1,2}$/.test(v)&&parseInt(v,10)<=23)&&V(v)},n=l=>{const v=l.target.value;(v===""||/^\d{1,2}$/.test(v)&&parseInt(v,10)<=59)&&L(v)},A=l=>{(l.key==="Tab"||l.key==="Enter"||l.key===":")&&(l.preventDefault(),i.current?.focus())},d=l=>{l.key==="Backspace"&&C===""&&a.current?.focus()};return r.jsxs("div",{className:"flex items-center gap-1 bg-transparent px-2","data-ox-slot":"input-time",children:[r.jsx(N1,{autoComplete:"off",className:s("w-8 min-w-8 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"),max:"23",min:"0",placeholder:"hh",ref:a,type:"number",value:H,onChange:t,onKeyDown:A}),r.jsx("span",{className:s(i1[e],{"text-gray-1000":!M,"ox-default-disabled":M}),children:":"}),r.jsx(N1,{autoComplete:"off",className:s("w-8 min-w-8 text-center","[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"),max:"59",min:"0",placeholder:"mm",ref:i,type:"number",value:C,onChange:n,onKeyDown:d})]})},j2=Zn2;j2.Container=vn2;j2.Icon=un2;j2.Button=mn2;const P0=m.createContext(void 0),Sn2=()=>{const H=m.useContext(P0);if(!H)throw new Error("OxRadio must be used within OxRadioGroup");return H},fn2={sm:"size-4.5",md:"size-5.5"},pn2=({checked:H,className:C,defaultChecked:V,disabled:L=!1,error:M=!1,id:e,name:a,onChange:i,onCheckedChange:t,required:n=!1,size:A,value:d,...l})=>{const v=m.useId(),o=Sn2(),u=m.useRef(null),S=`${e||v}-radio`,h=A||o.size,f=L||o.disabled,w=a||o?.name,p=H!==void 0||o&&d!==void 0&&o.value!==void 0;let O;o&&d!==void 0&&o.value!==void 0?O=o.value===d:O=H;const D=y=>{const F=y.target.checked;o&&d!==void 0&&o.onChange?.(d),i?.(y),t?.(F)};return r.jsxs("div",{className:"relative inline-flex shrink-0",children:[r.jsx("input",{id:S,"aria-invalid":M,"aria-required":n,"data-ox-slot":"radio",ref:u,...p?{checked:O}:{defaultChecked:V},className:s("peer cursor-pointer appearance-none rounded-full bg-gray-50",fn2[h],"ox-violet-outset-focus checked:bg-violet-700 disabled:cursor-not-allowed disabled:opacity-50",{"ox-rose-border":M,"ox-gray-border":!M},C),disabled:f,name:w,required:n,type:"radio",value:d,onChange:D,...l,"data-ox-state":O?"checked":"unchecked"}),r.jsx("div",{className:s("bg-gray-1200 pointer-events-none absolute inset-0 m-auto size-2 rounded-full opacity-0 peer-checked:opacity-100",{"bg-gray-800 opacity-50":f})})]})},hn2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-1","input:data-[ox-slot=radio]:[grid-column-start:var(--ox-field-control-col)] input:data-[ox-slot=radio]:[grid-row-start:var(--ox-field-control-row)]","*:data-[ox-slot=label]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=label]:[grid-row-start:var(--ox-field-label-row)]","*:data-[ox-slot=description]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=description]:[grid-row-start:var(--ox-field-desc-row)]",C),"data-ox-slot":"radio-field",...V,children:H}),gn2=({children:H,className:C,disabled:V=!1,name:L,onChange:M,size:e="sm",value:a,...i})=>r.jsx(P0.Provider,{value:{value:a,onChange:M,name:L,size:e,disabled:V},children:r.jsx("div",{className:s("contents space-y-2",C),"data-ox-slot":"radio-group",role:"radiogroup",...i,children:H})}),B5=pn2;B5.Group=gn2;B5.Field=hn2;const B0=m.createContext(void 0),R0=({children:H,className:C,...V})=>r.jsx("span",{className:s("overflow-hidden text-ellipsis",C),"data-ox-slot":"select-label",...V,children:H}),o2=()=>{const H=m.useContext(B0);if(!H)throw new Error("Select components must be used within an OxSelect");return H},On2={sm:`px-2 ${i1.sm} ${u1.sm}`,md:`px-2.5 ${i1.md} ${u1.md}`},F0=({children:H,className:C,disabled:V=!1,value:L,...M})=>{const{closeDropdown:e,onSelect:a,registerOption:i,selectedValue:t,size:n}=o2();m.useLayoutEffect(()=>{i(L,H)},[L,H,i]);const A=()=>{a({value:L,label:H})},d=v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),a({value:L,label:H})),v.key==="Escape"&&e()},l=t.includes(L);return r.jsx("li",{className:"contents",role:"none",children:r.jsxs("button",{"aria-selected":l,className:s("text-gray-1200 group col-span-3 grid grid-cols-subgrid items-center rounded-sm text-left",On2[n],"ox-violet-inset-focus enabled:cursor-pointer enabled:hover:bg-gray-400","disabled:ox-default-disabled",{"bg-gray-400":l},C),"data-ox-slot":"select-option",disabled:V,role:"option",tabIndex:V?-1:0,onClick:A,onKeyDown:d,...M,children:[H,l&&!V?r.jsx(e1,{className:"justify-self-center text-violet-700","data-ox-slot":"select-check-icon",path:"mdiCheck",size:c1[n]}):null]})})},xn2=H=>{const C=new Map,V=L=>{if(!m.isValidElement(L))return;if(L.type===F0){const{children:a,value:i}=L.props,t=m.Children.toArray(a).find(A=>m.isValidElement(A)&&(A.type===R0||G1(A,"select-label"))),n=t&&m.isValidElement(t)?t.props.children:a;C.set(i,n);return}const M=L.props,{children:e}=M;e&&m.Children.forEach(e,V)};return H.forEach(V),C},bn2={sm:`px-1.25 ${i1.sm} ${u1.sm}`,md:`px-1.75 ${i1.md} ${u1.md}`},s5=({badgeColor:H="purple",className:C,displayAsBadges:V=!1,placeholder:L="Select an option",size:M="sm",...e})=>{const{buttonRef:a,disabled:i,error:t,handleResize:n,isOpen:A,multiple:d,overflowAmount:l,required:v,selectId:o,selectedOptions:u,size:Z}=o2(),S=M||Z,h=l>0;return r.jsxs("button",{id:o,"aria-controls":`${o}-listbox`,"aria-disabled":i,"aria-expanded":A,"aria-haspopup":"listbox","aria-invalid":t,"aria-label":u.length>0?`Selected: ${u.map(f=>f.label).join(", ")}`:L,"aria-required":v,className:s("enabled:text-gray-1200 relative flex w-full items-center gap-x-2 rounded-lg bg-gray-50 pe-9 ps-3 text-start enabled:cursor-pointer","ox-violet-outset-focus disabled:ox-default-disabled",bn2[S],{"ox-rose-border":t,"ox-gray-border":!t,"default-active-border":A},C),"data-ox-slot":"select-trigger",disabled:i,ref:a,role:"combobox",type:"button",...e,"data-ox-state":A?"open":"closed",children:[u.length>0?r.jsxs("div",{className:s("flex w-full items-center overflow-hidden","[&_[data-ox-slot=select-icon]]:hidden",{"opacity-50":i&&V}),children:[r.jsx("div",{className:s("overflow-hidden text-ellipsis whitespace-nowrap",{"flex gap-1":V&&d}),ref:n,children:V&&d?u.map(f=>r.jsx(f2,{color:H,"data-ox-state":"selected",size:S,children:f.label},String(f.value))):u.map((f,w,p)=>{const O=p.length-l,D=w===O-1;return r.jsxs("span",{"data-ox-state":"selected",children:[f.label,w<p.length-1&&!D&&", "]},String(f.value))})}),h&&d?r.jsxs(f2,{className:"ml-1",color:H,size:S,children:["+",l]}):null]}):r.jsx("span",{className:"w-full overflow-hidden text-ellipsis whitespace-nowrap",children:L}),r.jsx("div",{className:"absolute end-3 top-1/2 -translate-y-1/2",children:r.jsx(e1,{className:s("text-current transition-transform duration-300 ease-in-out",{"rotate-180":A}),path:"mdiChevronDown",size:c1[S]})})]})},S3=H=>H==null?[]:Array.isArray(H)?H:[H],yn2=({children:H,className:C,defaultValue:V=null,disabled:L=!1,error:M=!1,id:e,isLoading:a=!1,multiple:i=!1,onChange:t,required:n=!1,size:A="sm",value:d,wrapperClassName:l})=>{if(a)return r.jsx("div",{className:s("flex w-full flex-col",l),children:r.jsx(R2,{className:s("rounded-lg",u1[A],{"ox-rose-border":M,"ox-gray-border":!M}),fullWidth:!0})});const v=m.useId(),o=m.useRef(null),{checkOverflow:u,handleResize:Z,overflowAmount:S}=C1.useOverflowDetection(),h=m.Children.toArray(H).find(N=>m.isValidElement(N)&&(N.type===s5||G1(N,"select-trigger"))),f=m.Children.toArray(H).filter(N=>!(m.isValidElement(N)&&(N.type===s5||G1(N,"select-trigger")))),[w,p]=C1.useControllableState({value:void 0,defaultValue:!1,name:"OxSelect-open"}),[O,D]=C1.useControllableState({value:d?new Set(S3(d)):void 0,defaultValue:new Set(S3(V)),onChange:N=>{if(!N)return;const j=i?Array.from(N):N.size>0?Array.from(N)[0]:null;t?.(j)},name:"OxSelect"}),[y,F]=C1.useControllableState({value:void 0,defaultValue:m.useMemo(()=>xn2(f),[f]),name:"OxSelect-itemsMap"}),$=m.useMemo(()=>Array.from(O??new Set).map(N=>({value:N,label:y?.get(N)??N})),[O,y]),K=`${e||v}-select`,k=m.useCallback(N=>{const{label:j,value:x}=N;F(X=>new Map(X).set(x,j)),D(X=>{const g=new Set(X);return i?g.has(x)?g.delete(x):g.add(x):(g.clear(),g.add(x),p(!1)),g})},[i,D,p,F]),_=m.useCallback((N,j)=>{F(x=>(x??new Map).has(N)?x:new Map(x??new Map).set(N,j))},[F]),z=m.useCallback(()=>p(!1),[p]);return m.useLayoutEffect(()=>{u()},[O,u]),r.jsx(B0.Provider,{value:m.useMemo(()=>({selectedValue:Array.from(O??new Set),onSelect:k,closeDropdown:z,multiple:i,size:A,disabled:L,error:M,isOpen:w??!1,selectedOptions:$,registerOption:_,required:n,handleResize:Z,overflowAmount:S,selectId:K,buttonRef:o}),[O,k,z,i,A,L,M,w,$,_,n,Z,S,K,o]),children:r.jsx("div",{className:s("flex w-full flex-col",l),children:r.jsx(q1,{align:"start",animationDuration:100,content:f,contentClassName:s("ox-gray-border ox-select-animate rounded-lg bg-gray-200 p-1",C),contentStyle:{minWidth:`${o.current?.offsetWidth||200}px`},disabled:L,open:w,position:"bottom",trigger:"click",onOpenChange:p,children:h})})})},wn2=({children:H,className:C,...V})=>{const{multiple:L,selectId:M}=o2();return r.jsx("ul",{id:`${M}-listbox`,"aria-multiselectable":L,className:s("grid max-h-72 grid-cols-[auto_1fr_auto] gap-y-0.5 overflow-hidden overflow-y-auto",'[&_[data-ox-slot="select-icon"]]:justify-self-center [&_[data-ox-slot="select-icon"]]:[grid-column-start:var(--ox-menu-icon-col)]','[&_[data-ox-slot="select-label"]]:[grid-column-start:var(--ox-menu-label-col)]','[&_[data-ox-slot="select-check-icon"]]:justify-self-end [&_[data-ox-slot="select-check-icon"]]:[grid-column-start:var(--ox-menu-shortcut-col)]',C),"data-ox-slot":"select-listbox",role:"listbox",...V,children:H})},kn2=({className:H,path:C,...V})=>{const{size:L}=o2();return r.jsx(e1,{className:s("mr-2 shrink-0 text-current",H),"data-ox-slot":"select-icon",path:C,size:c1[L],...V})},Tn2=({children:H,className:C,label:V,...L})=>{const{size:M}=o2();return r.jsxs("div",{className:"contents [&_[data-ox-slot=select-option]]:pl-4",children:[r.jsx("div",{className:s("text-gray-1000 col-span-full px-2 py-1 font-semibold",i1[M],C),"data-ox-slot":"select-option-group",...L,children:V}),H]})},W1=yn2;W1.Content=wn2;W1.Icon=kn2;W1.Label=R0;W1.Option=F0;W1.OptionGroup=Tn2;W1.Trigger=s5;const Pn2={sm:{container:"h-4.5 w-9",thumb:"size-3.75",translate:"translate-x-4.25"},md:{container:"h-5.5 w-11",thumb:"size-4.75",translate:"translate-x-5.25"}},Bn2=({checked:H=!1,className:C,disabled:V=!1,error:L=!1,id:M,onChange:e,required:a=!1,size:i="sm",...t})=>{const n=m.useId(),d=`${M||n}-switch`,l=Pn2[i],v=()=>{e?.(!H)};return r.jsx("button",{id:d,"aria-checked":H,"aria-invalid":L,"aria-required":a,className:s("ox-violet-outset-focus relative inline-flex shrink-0 items-center rounded-full border-2 transition-colors duration-200 ease-in-out","enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",l.container,{"bg-violet-700":H,"bg-gray-400":!H,"ox-rose-border":L,"border-transparent":!L},C),"data-ox-slot":"switch",disabled:V,role:"switch",type:"button",onClick:v,...t,"data-ox-state":H?"checked":"unchecked",children:r.jsx("span",{className:s("bg-gray-1200 inline-block transform rounded-full shadow-sm","transition-transform duration-200 ease-in-out",l.thumb,{[l.translate]:H})})})},Rn2=({children:H,className:C,...V})=>r.jsx("div",{className:s("grid grid-cols-[1fr_auto] items-center gap-x-3 gap-y-1","[--ox-field-control-col:2] [--ox-field-control-row:1] [--ox-field-desc-row:2] [--ox-field-label-col:1] [--ox-field-label-row:1]","button:data-[ox-slot=control]:[grid-column-start:var(--ox-field-control-col)] button:data-[ox-slot=control]:[grid-row-start:var(--ox-field-control-row)]","*:data-[ox-slot=label]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=label]:[grid-row-start:var(--ox-field-label-row)]","*:data-[ox-slot=description]:[grid-column-start:var(--ox-field-label-col)] *:data-[ox-slot=description]:[grid-row-start:var(--ox-field-desc-row)]",C),"data-ox-slot":"switch-field",...V,children:H}),E0=Bn2;E0.Field=Rn2;const Fn2={sm:`${i1.sm} min-${u1.sm}`,md:`${i1.md} min-${u1.md}`},En2=({className:H,disabled:C=!1,error:V=!1,id:L,name:M,onChange:e,placeholder:a="Enter text...",required:i=!1,rows:t=3,showMaxLength:n=!1,size:A="sm",value:d,...l})=>{const v=m.useId(),[o,u]=m.useState(typeof d=="string"?d.length:0),S=`${L||v}-textarea`,h=l.maxLength;m.useEffect(()=>{typeof d=="string"&&u(d.length)},[d]);const f=w=>{const p=w.target.value.length;u(p),e?.(w)};return r.jsxs("div",{className:"flex w-full flex-col",children:[r.jsx("textarea",{id:S,"aria-invalid":V,"aria-required":i,className:s("enabled:text-gray-1200 flex w-full resize-y rounded-lg bg-gray-50 px-2 py-2","ox-violet-outset-focus disabled:ox-default-disabled placeholder:text-gray-900",Fn2[A],{"ox-rose-border":V,"ox-gray-border":!V},H),"data-ox-slot":"textarea",disabled:C,name:M,placeholder:a,required:i,rows:t,value:d,onChange:f,...l}),n&&typeof h=="number"?r.jsxs("div",{className:"text-gray-1000 pointer-events-none mt-1 text-right text-xs",children:[o,"/",h]}):null]})},D0=()=>m.useContext(g0),Dn2=({children:H,className:C,...V})=>{const L=D0(),M=L?.selectable&&(H==null||typeof H=="string"&&H.trim()===""),e=()=>{L?.toggleAll()};return r.jsx("th",{className:s("text-gray-1200 border-b border-gray-400 bg-gray-100 px-3 py-2 text-left text-sm font-semibold",C),"data-ox-slot":"table-head",...V,children:M?r.jsxs("div",{className:"flex items-center justify-center",children:[r.jsx("span",{className:"sr-only",children:"Select all rows"}),r.jsx(t2,{"aria-label":"Select all rows",checked:L.isAllSelected,indeterminate:L.isIndeterminate,onCheckedChange:e})]}):H})},Nn2=({children:H,className:C,...V})=>r.jsx("thead",{className:C,"data-ox-slot":"table-header",...V,children:H}),jn2=({children:H,className:C,rowId:V,...L})=>{const M=D0(),e=()=>{V&&M?.selectable&&M.toggleSelection(V)};return r.jsxs("tr",{className:s("border-b border-gray-400 last:border-b-0","in-[tfoot]:hover:bg-transparent in-[thead]:hover:bg-transparent",{"bg-gray-300":M?.selectable&&V&&M.isSelected(V)},C),"data-ox-slot":"table-row",...L,children:[M?.selectable&&V?r.jsx("td",{className:"px-3 py-2",children:r.jsx("div",{className:"flex items-center justify-center",children:r.jsx(t2,{"aria-label":`Select row ${V}`,checked:M.isSelected(V),onCheckedChange:e})})}):null,H]})},R1=SA2;R1.Body=fA2;R1.Cell=pA2;R1.Controls=hA2;R1.Footer=gA2;R1.Head=Dn2;R1.Header=Nn2;R1.Row=jn2;const N0=m.createContext(null),In2=({children:H,className:C,defaultValue:V,onValueChange:L,value:M,...e})=>{const[a,i]=m.useState(V||""),t=M!==void 0,d={value:t?M:a,onValueChange:l=>{t||i(l),L?.(l)}};return r.jsx(N0.Provider,{value:d,children:r.jsx("div",{className:s("w-full",C),"data-ox-slot":"tabs",...e,children:H})})},j0=()=>{const H=m.useContext(N0);if(!H)throw new Error("Tabs components must be used within OxTabs");return H},Wn2=({children:H,className:C,value:V,...L})=>{const{value:M}=j0();return M===V?r.jsx("div",{"aria-labelledby":`tab-${V}`,className:s("text-gray-1200 pt-4",C),"data-ox-slot":"tabs-content",role:"tabpanel",...L,children:H}):null},_n2=({children:H,className:C,...V})=>r.jsx("div",{className:s("flex border-b border-gray-400",C),"data-ox-slot":"tabs-list",role:"tablist",...V,children:H}),zn2=({children:H,className:C,disabled:V=!1,value:L,...M})=>{const{onValueChange:e,value:a}=j0(),i=a===L,t=()=>{V||e(L)},n=A=>{(A.key==="Enter"||A.key==="Space")&&(A.preventDefault(),t())};return r.jsx("button",{"aria-selected":i,className:s("relative rounded-t-lg border-l border-r border-t border-transparent px-4 py-2 text-sm font-medium transition-colors enabled:cursor-pointer","ox-violet-outset-focus enabled:hover:text-gray-1200 enabled:hover:bg-gray-300","disabled:ox-default-disabled",{"text-gray-1200 border-gray-400":i,"text-gray-1100":!i},C),"data-ox-slot":"tabs-trigger",disabled:V,role:"tab",onClick:t,onKeyDown:n,...M,"data-ox-state":i?"active":"inactive",children:H})},I2=In2;I2.List=_n2;I2.Trigger=zn2;I2.Content=Wn2;const Gn2=({children:H,className:C,...V})=>r.jsx("ol",{"aria-label":"Timeline",className:s("grid grid-cols-[1fr_auto_1fr] items-start gap-4",C),"data-ox-slot":"timeline",role:"list",...V,children:H}),Un2=({align:H="left",children:C,className:V,color:L="purple",description:M,icon:e,label:a,showSeparator:i=!1,timestamp:t,...n})=>{const A=C||M;return r.jsxs("li",{className:s("col-span-3 grid grid-cols-subgrid",V),"data-ox-slot":"timeline-item",role:"listitem",...n,children:[r.jsx("div",{children:H==="left"&&r.jsxs("div",{className:"space-y-1 text-right",children:[r.jsx("h6",{className:s("text-sm font-medium leading-tight",a1[L].text),children:a}),A&&r.jsx(e2,{children:A}),t&&r.jsx("span",{className:"text-gray-1000 text-xs",children:t})]})}),r.jsxs("div",{className:"grid shrink-0 grid-rows-[auto_1fr] gap-4",children:[r.jsx("div",{className:s("flex items-center justify-center rounded-lg",a2.md,a1[L].background,a1[L].border),children:r.jsx(e1,{className:s("text-gray-1200",a1[L].text),path:e||"mdiCircle",size:c1.md})}),i?r.jsx(b5,{className:"mx-auto",orientation:"vertical"}):null]}),r.jsx("div",{children:H==="right"&&r.jsxs("div",{className:"space-y-1 text-left",children:[r.jsx("h6",{className:s("text-sm font-medium leading-tight",a1[L].text),children:a}),A&&r.jsx(e2,{children:A}),t&&r.jsx("span",{className:"text-gray-1000 text-xs",children:t})]})})]})},I0=Gn2;I0.Item=Un2;const Qn2=({index:H,onRemove:C,position:V,toast:L})=>{const M=L.icon??f1[L.type].icon,e=L.color?a1[L.color]:f1[L.type],[a,i]=m.useState(!0);m.useEffect(()=>{const d=setTimeout(()=>i(!1),50);return()=>clearTimeout(d)},[]);const t=H*8,n=1-H*.05,A=()=>{const d=a?V==="top"?-16:16:0;return V==="top"?{top:`${t+d}px`,transform:`scale(${n})`,zIndex:30-H,opacity:L.isRemoving||a?0:1}:{top:`${-t+d}px`,transform:`scale(${n})`,zIndex:30-H,opacity:L.isRemoving||a?0:1}};return L.customContent?r.jsx("div",{className:"ox-gray-border pointer-events-auto absolute w-full cursor-pointer rounded-lg bg-gray-200 transition-all duration-300 ease-out md:w-80","data-ox-slot":"toast-item",role:"status",style:A(),onClick:()=>C(L.id),children:L.customContent}):r.jsxs("div",{"aria-describedby":L.description?`${L.id}-desc`:void 0,className:"ox-gray-border pointer-events-auto absolute flex w-full cursor-pointer items-center gap-3 rounded-lg bg-gray-200 p-4 transition-all duration-300 ease-out md:w-80","data-ox-slot":"toast-item",role:L.type==="error"||L.type==="warning"?"alert":"status",style:A(),onClick:()=>C(L.id),children:[r.jsxs("span",{className:"sr-only",children:[L.type," notification:"]}),r.jsx("div",{className:s("mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",e.background),children:r.jsx(e1,{className:e.text,path:M,size:.7})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-gray-1200 text-xs font-medium",children:L.title}),L.description?r.jsx("p",{id:`${L.id}-desc`,className:"mt-1 text-xs",children:L.description}):null]})]})},$n2={left:"left-1/2 -translate-x-1/2 md:translate-none md:left-4",center:"left-1/2 -translate-x-1/2",right:"left-1/2 -translate-x-1/2 md:translate-none md:left-auto md:right-4"},Yn2={top:"top-4",bottom:"bottom-24"},W0=({align:H,onRemove:C,position:V,toasts:L})=>r2.createPortal(r.jsx("div",{"aria-atomic":"false","aria-label":"Notifications","aria-live":"polite",className:s("pointer-events-none fixed z-50 w-11/12 md:w-80",$n2[H],Yn2[V]),"data-ox-slot":"toast-container",role:"region",children:L.map((M,e)=>r.jsx(Qn2,{index:e,position:V,toast:M,onRemove:C},M.id))}),document.body),_0=m.createContext(null),qn2=({align:H="right",children:C,maxToasts:V=3,position:L="top"})=>{const[M,e]=m.useState([]),a=m.useCallback(A=>{e(d=>d.map(l=>l.id===A?{...l,isRemoving:!0}:l)),setTimeout(()=>{e(d=>C1.reject(d,l=>l.id===A))},200)},[]),i=m.useCallback((A,d,l,v)=>{const o=C1.uniqueId(),u=l?.duration??5e3,Z={id:o,title:A,type:d,duration:u,description:l?.description,icon:l?.icon,color:l?.color,customContent:v};return e(S=>C1.take([Z,...S],V)),u>0&&setTimeout(()=>{a(o)},u),o},[a,V]),t=m.useCallback(A=>{A?a(A):e([])},[a]),n=Object.assign((A,d)=>i(A,"default",d),{success:(A,d)=>i(A,"success",d),error:(A,d)=>i(A,"error",d),warning:(A,d)=>i(A,"warning",d),info:(A,d)=>i(A,"info",d),custom:(A,d)=>i("","default",{duration:d?.duration},A),dismiss:t});return r.jsxs(_0.Provider,{value:n,children:[C,r.jsx(W0,{align:H,position:L,toasts:M,onRemove:a})]})},Kn2=()=>{const H=m.useContext(_0);if(!H)throw new Error("useOxToast must be used within a ToastProvider");return H},z0=m.createContext(null),Xn2=()=>m.useContext(z0),Jn2={sm:`px-3 ${u1.sm} ${i1.sm}`,md:`px-4 ${u1.md} ${i1.md}`},Co2=({children:H,className:C,disabled:V,id:L,onPressedChange:M,pressed:e,size:a,value:i,...t})=>{const n=m.useId(),A=Xn2(),l=`${L||n}-toggle`,v=A!==null,o=a||A?.size||"sm",u=V||A?.disabled||!1;let Z,S;return v&&i!==void 0?(A.type==="single"?Z=A.value===i:Z=(A.value||[]).includes(i),S=()=>{!u&&A.onToggle&&A.onToggle(i)}):(Z=e||!1,S=()=>{!u&&M&&M(!Z)}),r.jsx("button",{id:l,"aria-pressed":Z,className:s("inline-flex items-center gap-2 rounded-md border transition-colors duration-200","ox-gray-outset-focus disabled:ox-default-disabled enabled:cursor-pointer",Jn2[o],{"text-gray-1200 border-gray-400 bg-gray-300 enabled:hover:bg-gray-500":Z,"text-gray-1000 border-gray-400 bg-gray-50 enabled:hover:bg-gray-300":!Z},C),"data-ox-slot":"toggle",disabled:u,role:"button",type:"button",onClick:S,...t,children:H})},Ho2=({children:H,className:C,disabled:V=!1,name:L,onValueChange:M,size:e="sm",type:a="single",value:i,...t})=>{const n=A=>{if(M)if(a==="single")M(i===A?"":A);else{const d=i||[],l=d.includes(A)?d.filter(v=>v!==A):[...d,A];M(l)}};return r.jsx(z0.Provider,{value:{value:i,onToggle:n,name:L,size:e,disabled:V,type:a},children:r.jsx("div",{className:s("flex flex-wrap gap-2",C),"data-ox-slot":"toggle-group",role:"group",...t,children:H})})},G0=Co2;G0.Group=Ho2;const Vo2={default:"ox-gray-border text-gray-1200 bg-gray-200",error:s(...Object.values(C1.pick(a1.rose,["background","border","text"]))),warning:s(...Object.values(C1.pick(a1.amber,["background","border","text"]))),info:s(...Object.values(C1.pick(a1.blue,["background","border","text"]))),success:s(...Object.values(C1.pick(a1.green,["background","border","text"])))},U0=({align:H="center",children:C,className:V,content:L,disabled:M=!1,hoverDelay:e=500,id:a,onOpenChange:i,open:t,position:n="top",trigger:A="hover",variant:d="default"})=>{const l=r.jsx("div",{className:s("max-w-xs break-words rounded-md border px-2 py-1 text-xs",Vo2[d],V),"data-ox-slot":"tooltip-content",children:L});return r.jsx(q1,{id:a,align:H,animationDuration:100,asChild:!0,content:l,contentClassName:"ox-tooltip-animate backdrop-blur-sm rounded-md",contentRole:"tooltip",disabled:M,hoverDelay:e,offset:8,open:t,position:n,trigger:A,useAriaControls:!1,onOpenChange:i,children:C})};exports.COLOR_STYLES=a1;exports.MOBILE_BREAKPOINT=j3;exports.OxAccordion=x2;exports.OxAlert=I3;exports.OxAvatar=b2;exports.OxBadge=f2;exports.OxBreadcrumb=y2;exports.OxButton=m1;exports.OxCalendar=e0;exports.OxCard=w2;exports.OxCheckbox=t2;exports.OxDateInput=n2;exports.OxDescription=e2;exports.OxDescriptionList=h5;exports.OxDialog=T2;exports.OxDrawer=w1;exports.OxDropdown=Z1;exports.OxError=lA2;exports.OxFileUpload=F2;exports.OxFloating=q1;exports.OxForm=E2;exports.OxHeading=sA2;exports.OxIcon=e1;exports.OxJsonField=d0;exports.OxLabel=vA2;exports.OxLegend=uA2;exports.OxLink=Et2;exports.OxNotifications=j1;exports.OxNumberInput=K1;exports.OxOtpInput=rn2;exports.OxPagination=i2;exports.OxPopover=x5;exports.OxProgress=c0;exports.OxRadio=B5;exports.OxSelect=W1;exports.OxSeparator=b5;exports.OxSkeleton=R2;exports.OxSkeletonText=LA2;exports.OxSlider=rA2;exports.OxSpinner=iA2;exports.OxStatusDisplay=oA2;exports.OxStepper=w5;exports.OxSwitch=E0;exports.OxTable=R1;exports.OxTabs=I2;exports.OxTextInput=I1;exports.OxTextarea=En2;exports.OxTimeInput=j2;exports.OxTimeline=I0;exports.OxToast=W0;exports.OxToastProvider=qn2;exports.OxToggle=G0;exports.OxTooltip=U0;exports.buildMailTo=X0;exports.buildUrl=K0;exports.cn=s;exports.copyToClipboard=B7;exports.createId=N7;exports.formatBytes=I7;exports.formatCurrency=W7;exports.formatDate=_7;exports.formatNumber=z7;exports.formatTimestamp=u5;exports.generateRandomString=P3;exports.handleFormErrors=R3;exports.handleGraphQLFormErrors=j7;exports.hasDataSlot=G1;exports.jsxRuntimeExports=r;exports.parseGraphQLErrors=B3;exports.scrollToElement=G7;exports.useOxToast=Kn2;exports.validateEmail=X7;exports.validatePhone=H4;exports.validateUrl=J7;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../chunks/ui-WTrU_DUw.js"),m=require("../chunks/query-BhvXa-m6.js"),E=require("../chunks/useAuth-DxoDe3YA.js"),h=require("../chunks/hooks-DiKvsNs-.js"),u=require("react");function A({adminRole:s="admin",children:r,getCurrentUserQuery:n=m.DEFAULT_GET_CURRENT_USER,options:o={},pollInterval:l=300*1e3}){const{data:a,error:O,loading:f,refetch:e}=h.useQuery(n,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",errorPolicy:"all",pollInterval:l,...o}),t=!!a?.me,i=a?.me?.role===s;return c.jsxRuntimeExports.jsx(E.OxAuthContext.Provider,{value:{user:a?.me||null,loading:f,error:O??null,isLoggedIn:t,isAdmin:i,refreshUser:e},children:r})}const g=h.gql`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../chunks/ui-DRaffjpU.js"),m=require("../chunks/query-D4FW3HN6.js"),E=require("../chunks/useAuth-DxoDe3YA.js"),h=require("../chunks/hooks-DB942JYB.js"),u=require("react");function A({adminRole:s="admin",children:r,getCurrentUserQuery:n=m.DEFAULT_GET_CURRENT_USER,options:o={},pollInterval:l=300*1e3}){const{data:a,error:O,loading:f,refetch:e}=h.useQuery(n,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",errorPolicy:"all",pollInterval:l,...o}),t=!!a?.me,i=a?.me?.role===s;return c.jsxRuntimeExports.jsx(E.OxAuthContext.Provider,{value:{user:a?.me||null,loading:f,error:O??null,isLoggedIn:t,isAdmin:i,refreshUser:e},children:r})}const g=h.gql`
2
2
  query getFeatures {
3
3
  features
4
4
  }
@@ -1,8 +1,8 @@
1
- import { _ as d, $ as h, o as D } from "../chunks/ui-BgyYCO2P.js";
2
- import { D as E } from "../chunks/query-iDn3qBGF.js";
1
+ import { _ as d, $ as h, o as D } from "../chunks/ui-CWzo2o31.js";
2
+ import { D as E } from "../chunks/query-v272k9Fk.js";
3
3
  import { O as F } from "../chunks/useAuth-BFgXzu6Q.js";
4
4
  import { u as H } from "../chunks/useAuth-BFgXzu6Q.js";
5
- import { v as p, n as P, w as y, r as j, k as A } from "../chunks/hooks-bJFfbTks.js";
5
+ import { v as p, n as P, w as y, r as j, k as A } from "../chunks/hooks-BswtWYGK.js";
6
6
  import { createContext as O, useContext as g, useState as C, useEffect as T, useCallback as x } from "react";
7
7
  function S({
8
8
  adminRole: t = "admin",