reaxify 0.0.3 → 0.0.5

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.
@@ -0,0 +1,22 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),qe=require("axios"),Ye=require("lodash"),Ve=require("iconsax-react"),We=require("react-animate-height"),w=require("tailwind-merge"),me=require("react-transition-group"),Ge=require("react-dom");function Ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ue={exports:{}},G={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var je;function Je(){if(je)return G;je=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,i){var u=null;if(i!==void 0&&(u=""+i),a.key!==void 0&&(u=""+a.key),"key"in a){i={};for(var d in a)d!=="key"&&(i[d]=a[d])}else i=a;return a=i.ref,{$$typeof:e,type:n,key:u,ref:a!==void 0?a:null,props:i}}return G.Fragment=t,G.jsx=r,G.jsxs=r,G}var U={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ce;function Ke(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Z?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case v:return"Profiler";case m:return"StrictMode";case M:return"Suspense";case $:return"SuspenseList";case C:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case N:return"Portal";case S:return(s.displayName||"Context")+".Provider";case E:return(s._context.displayName||"Context")+".Consumer";case A:var x=s.render;return s=s.displayName,s||(s=x.displayName||x.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case I:return x=s.displayName||null,x!==null?x:e(s.type)||"Memo";case F:x=s._payload,s=s._init;try{return e(s(x))}catch{}}return null}function t(s){return""+s}function r(s){try{t(s);var x=!1}catch{x=!0}if(x){x=console;var T=x.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return T.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),t(s)}}function n(s){if(s===b)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===F)return"<...>";try{var x=e(s);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function a(){var s=se.A;return s===null?null:s.getOwner()}function i(){return Error("react-stack-top-frame")}function u(s){if(we.call(s,"key")){var x=Object.getOwnPropertyDescriptor(s,"key").get;if(x&&x.isReactWarning)return!1}return s.key!==void 0}function d(s,x){function T(){he||(he=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}T.isReactWarning=!0,Object.defineProperty(s,"key",{get:T,configurable:!0})}function f(){var s=e(this.type);return ye[s]||(ye[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function l(s,x,T,k,H,O,ie,ce){return T=O.ref,s={$$typeof:y,type:s,key:x,props:O,_owner:H},(T!==void 0?T:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:f}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ie}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function p(s,x,T,k,H,O,ie,ce){var R=x.children;if(R!==void 0)if(k)if(Fe(R)){for(k=0;k<R.length;k++)g(R[k]);Object.freeze&&Object.freeze(R)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(R);if(we.call(x,"key")){R=e(s);var Y=Object.keys(x).filter(function(Be){return Be!=="key"});k=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",Te[R+k]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,k,R,Y,R),Te[R+k]=!0)}if(R=null,T!==void 0&&(r(T),R=""+T),u(x)&&(r(x.key),R=""+x.key),"key"in x){T={};for(var le in x)le!=="key"&&(T[le]=x[le])}else T=x;return R&&d(T,typeof s=="function"?s.displayName||s.name||"Unknown":s),l(s,R,O,H,a(),T,ie,ce)}function g(s){typeof s=="object"&&s!==null&&s.$$typeof===y&&s._store&&(s._store.validated=1)}var h=o,y=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),S=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),se=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we=Object.prototype.hasOwnProperty,Fe=Array.isArray,ae=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(s){return s()}};var he,ye={},ve=h["react-stack-bottom-frame"].bind(h,i)(),Ee=ae(n(i)),Te={};U.Fragment=b,U.jsx=function(s,x,T,k,H){var O=1e4>se.recentlyCreatedOwnerStacks++;return p(s,x,T,!1,k,H,O?Error("react-stack-top-frame"):ve,O?ae(n(s)):Ee)},U.jsxs=function(s,x,T,k,H){var O=1e4>se.recentlyCreatedOwnerStacks++;return p(s,x,T,!0,k,H,O?Error("react-stack-top-frame"):ve,O?ae(n(s)):Ee)}}()),U}process.env.NODE_ENV==="production"?ue.exports=Je():ue.exports=Ke();var c=ue.exports;const ke=o.createContext({config:{},beforeRequest:[],afterResponse:[],afterError:[]});function Xe({config:e={},beforeRequest:t=[],afterResponse:r=[],afterError:n=[],children:a}){return c.jsx(ke.Provider,{value:{config:e,beforeRequest:t,afterResponse:r,afterError:n},children:a})}var Re={exports:{}},j=Re.exports={},_,D;function de(){throw new Error("setTimeout has not been defined")}function fe(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?_=setTimeout:_=de}catch{_=de}try{typeof clearTimeout=="function"?D=clearTimeout:D=fe}catch{D=fe}})();function Se(e){if(_===setTimeout)return setTimeout(e,0);if((_===de||!_)&&setTimeout)return _=setTimeout,setTimeout(e,0);try{return _(e,0)}catch{try{return _.call(null,e,0)}catch{return _.call(this,e,0)}}}function Ze(e){if(D===clearTimeout)return clearTimeout(e);if((D===fe||!D)&&clearTimeout)return D=clearTimeout,clearTimeout(e);try{return D(e)}catch{try{return D.call(null,e)}catch{return D.call(this,e)}}}var L=[],V=!1,B,Q=-1;function Qe(){!V||!B||(V=!1,B.length?L=B.concat(L):Q=-1,L.length&&Me())}function Me(){if(!V){var e=Se(Qe);V=!0;for(var t=L.length;t;){for(B=L,L=[];++Q<t;)B&&B[Q].run();Q=-1,t=L.length}B=null,V=!1,Ze(e)}}j.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];L.push(new Ne(e,t)),L.length===1&&!V&&Se(Me)};function Ne(e,t){this.fun=e,this.array=t}Ne.prototype.run=function(){this.fun.apply(null,this.array)};j.title="browser";j.browser=!0;j.env={};j.argv=[];j.version="";j.versions={};function z(){}j.on=z;j.addListener=z;j.once=z;j.off=z;j.removeListener=z;j.removeAllListeners=z;j.emit=z;j.prependListener=z;j.prependOnceListener=z;j.listeners=function(e){return[]};j.binding=function(e){throw new Error("process.binding is not supported")};j.cwd=function(){return"/"};j.chdir=function(e){throw new Error("process.chdir is not supported")};j.umask=function(){return 0};var et=Re.exports;const tt=Ue(et);function rt(e=null){const t=o.useContext(ke),r=o.useMemo(()=>new AbortController,[]),n=o.useMemo(()=>{const b={...t.config,...e==null?void 0:e.config};return qe.create(b)},[t.config,e==null?void 0:e.config]),[a,i]=o.useState([]),[u,d]=o.useState(null),f=o.useCallback(b=>{i(m=>{const v=Ye.cloneDeep(m);return b?v.push(""):v.pop(),v})},[]),l=o.useCallback(b=>{const m=[...t.beforeRequest,...(e==null?void 0:e.beforeRequest)??[]];return m.length?m.reduce(async(v,E)=>E(await v),Promise.resolve(b)):b},[t.beforeRequest,e==null?void 0:e.beforeRequest]),p=o.useCallback(b=>{const m=[...t.afterResponse,...(e==null?void 0:e.afterResponse)??[]];return m.length?m.reduce(async(v,E)=>E(await v),Promise.resolve(b)):b},[t.afterResponse,e==null?void 0:e.afterResponse]),g=o.useCallback(b=>{const m=[...t.afterError,...(e==null?void 0:e.afterError)??[]];return m.length?m.reduce(async(v,E)=>E(await v),Promise.resolve(b)):b},[t.afterError,e==null?void 0:e.afterError]),h=o.useCallback(async b=>(b.signal||(b.signal=r.signal),f(!0),d(null),await l(b)),[r,f,l]),y=o.useCallback(async b=>{const m=await p(b);return f(!1),d(null),m},[f,p]),N=o.useCallback(b=>(g(b),f(!1),d(b),Promise.reject(b)),[f,g]);return o.useLayoutEffect(()=>{const b=n.interceptors.request.use(h),m=n.interceptors.response.use(y,N);return()=>{n.interceptors.request.eject(b),n.interceptors.response.eject(m)}},[n.interceptors.request,n.interceptors.response,h,y,N]),o.useLayoutEffect(()=>()=>{!(tt.env.NODE_ENV!=="production")&&r.abort("Canceled.")},[]),[n,!!a.length,u]}function ee(...e){if(e.length)return e.filter(Boolean).join(" ")}async function nt(e){var r,n;return!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)?Promise.reject(!1):await((n=navigator==null?void 0:navigator.clipboard)==null?void 0:n.writeText(e).then(()=>!0).catch(()=>!1))}function ot(e){return Pe(e)||Ae(e)||Oe(e)||_e(e)}function Pe(e){return e==null}function Ae(e){return e===""}function Oe(e){return!Array.isArray(e)&&typeof e=="object"&&!Object.keys(e??{}).length}function _e(e){return Array.isArray(e)&&!e.length}function st(){return typeof window>"u"}function at(e,t=1){const r=[];let n,a;for(n=0,a=-1;n<e.length;n++)n%t===0&&(a++,r[a]=[]),r[a].push(e[n]);return r}function pe(){const e=[Math.random()*1e6,new Date().getTime()].map(Math.ceil).join("");return Number(e).toString(16)}function it(e){if(!e)return"";const t=/[^\d.-]/g;return e.replace(t,"")}function ct(e){if(!e)return"";const t=[/۰/g,/۱/g,/۲/g,/۳/g,/۴/g,/۵/g,/۶/g,/۷/g,/۸/g,/۹/g],r=[/٠/g,/١/g,/٢/g,/٣/g,/٤/g,/٥/g,/٦/g,/٧/g,/٨/g,/٩/g];for(let n=0;n<10;n++){const a=t[n],i=r[n],u=`${n}`;e=e.replace(a,u).replace(i,u)}return e}function lt(e){return e<10?`0${e}`:`${e}`}async function ut(e){return await new Promise(t=>{setTimeout(()=>{t(null)},e)})}const be=o.createContext({activeKey:null,onChange:()=>{}}),te=o.createContext({active:!1,eventKey:null});function W({activeKey:e=null,onChange:t=()=>{},children:r}){return c.jsx(be.Provider,{value:{activeKey:e,onChange:t},children:r})}function dt({as:e,eventKey:t=null,className:r,children:n,...a}){const{activeKey:i}=o.useContext(be),u=e||"div",d=o.useMemo(()=>pe(),[]),f=t||d,l=o.useMemo(()=>Array.isArray(i)?i.includes(f):f===i,[i,f]);return c.jsx(u,{className:w.twMerge("block w-full border border-[#e8eaee] rounded",r),...a,children:c.jsx(te.Provider,{value:{eventKey:f,active:l},children:n})})}function ft({type:e,className:t,children:r,onClick:n,...a}){const{eventKey:i}=o.useContext(te),{onChange:u}=o.useContext(be),d=f=>{i&&u(i),n==null||n(f)};return c.jsx("button",{type:e,className:w.twMerge("w-full flex items-center text-start text-base px-5 py-4 rounded-t cursor-pointer",t),onClick:d,...a,children:r})}function mt({className:e,...t}){const{active:r}=o.useContext(te);return c.jsx(Ve.ArrowDown2,{color:"currentColor",className:w.twMerge("size-5 transition-transform",r?"-rotate-180":"rotate-0",e),...t})}function pt({duration:e=300,children:t}){const{active:r}=o.useContext(te);return c.jsx(We,{duration:e,height:r?"auto":0,className:"w-full",animationStateClasses:{animating:"",animatingUp:"",animatingDown:"",static:"",animatingToHeightZero:"",animatingToHeightAuto:"",animatingToHeightSpecific:"",staticHeightZero:"",staticHeightAuto:"",staticHeightSpecific:""},children:t})}function bt({className:e,children:t,...r}){return c.jsx("div",{className:w.twMerge("w-full block px-5 py-4 rounded-b",e),...r,children:t})}W.Item=dt;W.Toggle=ft;W.Icon=mt;W.Collapse=pt;W.Body=bt;function gt({as:e,variant:t="solid",color:r=null,size:n="md",className:a,children:i,...u}){const d=e||"span",f=o.useMemo(()=>{var g;if(!r)return"border-transparent";const p={primary:{solid:"bg-primary text-white border-primary",outline:"bg-transparent text-primary border-primary",soft:"bg-primary/10 text-primary border-primary/10"},secondary:{solid:"bg-secondary text-white border-secondary",outline:"bg-transparent text-secondary border-secondary",soft:"bg-secondary/10 text-secondary border-secondary/10"},success:{solid:"bg-success text-white border-success",outline:"bg-transparent text-success border-success",soft:"bg-success/10 text-success border-success/10"},info:{solid:"bg-info text-white border-info",outline:"bg-transparent text-info border-info",soft:"bg-info/10 text-info border-info/10"},warning:{solid:"bg-warning text-white border-warning",outline:"bg-transparent text-warning border-warning",soft:"bg-warning/10 text-warning border-warning/10"},danger:{solid:"bg-danger text-white border-danger",outline:"bg-transparent text-danger border-danger",soft:"bg-danger/10 text-danger border-danger/10"},dark:{solid:"bg-dark text-white border-dark",outline:"bg-transparent text-dark border-dark",soft:"bg-dark/10 text-dark border-dark/10"},light:{solid:"bg-light text-dark border-light",outline:"bg-transparent text-dark border-light",soft:"bg-light/10 text-dark border-light/10"}};return((g=p==null?void 0:p[r])==null?void 0:g[t])??null},[r,t]),l=o.useMemo(()=>{if(!n)return null;const p={sm:"text-xs py-0.5 px-1.5",md:"text-sm py-[0.1875rem] px-2",lg:"text-base py-1 px-3"};return p==null?void 0:p[n]},[n]);return c.jsx(d,{className:w.twMerge("inline-flex border border-[#e8eaee] items-center text-center font-medium align-middle whitespace-nowrap rounded",f,l,a),...u,children:i})}function xt({as:e,...t}){const r=e||"div";return c.jsx(r,{...t})}function wt(e){const t=o.useRef(new AbortController);o.useEffect(()=>{var n,a;const r=t.current;return(a=(n=navigator==null?void 0:navigator.credentials)==null?void 0:n.get)==null||a.call(n,{otp:{transport:["sms"]},signal:r.signal}).then(i=>{const u=i;e((u==null?void 0:u.code)||null)}),()=>{r==null||r.abort("signal has been aborted.")}},[e])}function De(){return o.useCallback(t=>{const r=t.currentTarget.querySelector(".ripple-group")||t.currentTarget,n=r.getBoundingClientRect(),a=t.clientX-n.left,i=t.clientY-n.top,u=n.width,d=n.height,f=Math.max(u,d),l=20,p=Math.ceil(f/l)*2,g=document.createElement("span");g.className=["ripple","absolute","rounded-full","pointer-events-none","transition-[opacity,scale]","duration-500","bg-current","size-[var(--size)] top-[var(--top)] left-[var(--left)] scale-[var(--scale)] opacity-[var(--opacity)]"].join(" "),g.style.setProperty("--size",`${l}px`),g.style.setProperty("--top",`${i-l/2}px`),g.style.setProperty("--left",`${a-l/2}px`),g.style.setProperty("--scale","1"),g.style.setProperty("--opacity","0.2"),r.appendChild(g),setTimeout(()=>{g.style.setProperty("--scale",`${p}`),g.style.setProperty("--opacity","0")},0),setTimeout(()=>r.removeChild(g),500)},[])}function Le(){const e=o.useRef(null),t=o.useCallback(()=>{e.current&&clearTimeout(e.current)},[]),r=o.useCallback((n,a=1e3)=>{t(),e.current=setTimeout(n,a)},[t]);return o.useEffect(()=>()=>{t()},[t]),r}function ht(){const[e,t]=o.useState("visible"),r=e==="visible";return o.useEffect(()=>{const n=()=>{t(document.visibilityState)};return n(),document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),r}function yt(){const[e,t]=o.useState(!navigator.onLine);return o.useEffect(()=>{const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("offline",r),window.addEventListener("online",n),()=>{window.removeEventListener("offline",r),window.removeEventListener("online",n)}},[]),e}function vt(){const[e,t]=o.useState(null);return o.useEffect(()=>{const r=a=>{t(a.key)},n=()=>{t(null)};return window.addEventListener("keydown",r),window.addEventListener("keyup",n),window.addEventListener("blur",n),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",n),window.removeEventListener("blur",n)}},[]),e}function Et(){const[e,t]=o.useState([0,0]);return o.useEffect(()=>{const r=a=>{t([a.x,a.y])},n=a=>{const i=a.changedTouches[0];t([i.clientX,i.clientY])};return window.addEventListener("mousemove",r),window.addEventListener("touchmove",n),()=>{window.removeEventListener("mousemove",r),window.removeEventListener("touchmove",n)}},[]),e}function Tt(e,t){o.useEffect(()=>{if(!e)return;const n="current"in e?e.current:e;if(!n)return;const a=i=>{!n.contains(i.target)&&t(i)};return window.addEventListener("click",a),()=>{window.removeEventListener("click",a)}},[e,t])}function jt(e,t,r="localStorage"){const n=o.useCallback(f=>{try{window[r].setItem(e,JSON.stringify(f))}catch(l){console.error(l)}},[e,r]),a=o.useCallback(()=>{try{const f=window[r].getItem(e);return f?JSON.parse(f):void 0}catch(f){console.error(f)}},[e,r]),[i,u]=o.useState(()=>a()||t),d=()=>{u(t),n(t)};return o.useEffect(()=>{n(i)},[i,n]),[i,u,d]}function Ct(e=!1){const[t,r]=o.useState(e);return[t,()=>{r(i=>!i)},()=>{r(!1)}]}const J=o.createContext({active:null,onChange:()=>{},buttonGroupClasses:""});function re({active:e=null,onChange:t=()=>{},children:r}){return c.jsx(J.Provider,{value:{active:e,onChange:t,buttonGroupClasses:"relative flex items-center"},children:r})}function kt({className:e,...t}){const{active:r}=o.useContext(J),n=o.useRef(null),a=Le(),i=o.useCallback(()=>{const u=n.current,d=u==null?void 0:u.parentElement,l=d==null?void 0:d.querySelector("button[data-active='true']");if(!d||!l||!u)return;const p=(l==null?void 0:l.offsetLeft)??0,g=window.getComputedStyle(l).paddingInline,h=(l==null?void 0:l.getBoundingClientRect().width)??0,y=p,N=h;u.style.setProperty("left",`${y}px`),u.style.setProperty("width",`${N}px`),u.style.setProperty("padding",`0 ${g}`),l==null||l.scrollIntoView({inline:"center",block:"nearest",behavior:"smooth"})},[]);return o.useEffect(()=>{const d=()=>{a(()=>i(),100)};return window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[i,a]),o.useEffect(i,[i,r]),c.jsx("span",{ref:n,className:w.twMerge("absolute bottom-0 left-0 w-auto h-px transition-[width,left] overflow-hidden",e),...t,children:c.jsx("span",{className:"block size-full rounded-full bg-primary"})})}function Rt({eventKey:e,className:t,children:r,onClick:n,...a}){const{active:i,onChange:u}=o.useContext(J),d=e===i,f=l=>{!d&&u(e),n==null||n(l)};return c.jsx(Ie,{as:"button",type:"button","data-active":d,onClick:f,color:d?"primary":null,variant:"text",className:ee("shadow-none border-none",t),...a,children:r})}function St({eventKey:e,children:t}){const{active:r}=o.useContext(J);return r!==e?null:c.jsx(o.Fragment,{children:t})}re.Indicator=kt;re.Button=Rt;re.Item=St;const ze=o.createContext({});function Mt({as:e,variant:t,color:r,size:n,loading:a,orientation:i="horizontal",className:u,children:d,...f}){const l=e||"div",{buttonGroupClasses:p}=o.useContext(J),g=o.useMemo(()=>({horizontal:"flex-row",vertical:"flex-col"})[i],[i]),h=o.useMemo(()=>({horizontal:"rounded-none first-of-type:rounded-s last-of-type:rounded-e",vertical:"rounded-none first-of-type:rounded-t last-of-type:rounded-b"})[i],[i]);return c.jsx(l,{className:w.twMerge("w-fit flex items-stretch justify-center",g,p,u),...f,children:c.jsx(ze.Provider,{value:{variant:t,color:r,size:n,loading:a,buttonClasses:h},children:d})})}function P({as:e,className:t,children:r,...n}){const a=e||"div";return c.jsx(a,{className:w.twMerge("block w-full bg-white rounded shadow",t),...n,children:r})}function Nt({className:e,children:t,...r}){return c.jsx("div",{className:w.twMerge("w-full border-b border-[#e8eaee] p-4",e),...r,children:t})}function Pt({className:e,children:t,...r}){return c.jsx("div",{className:w.twMerge("w-full p-4",e),...r,children:t})}function At({className:e,children:t,...r}){return c.jsx("div",{className:w.twMerge("w-full border-t border-[#e8eaee] p-4",e),...r,children:t})}P.Header=Nt;P.Body=Pt;P.Footer=At;function ne({children:e}){const t=o.useMemo(()=>{const r=pe(),n=document.createElement("div");return n.id=r,document.body.appendChild(n),n},[]);return Ge.createPortal(e,t)}const ge=o.createContext({open:!1,onClose:()=>{},duration:300,anchor:"start",transitionState:"unmounted"});function K({as:e,open:t=!1,onClose:r=()=>{},duration:n=300,anchor:a="end",className:i="",children:u,...d}){const f=o.useRef(null),l=e||"div",p={entering:"active opacity-100 pointer-events-auto",entered:"active opacity-100 pointer-events-auto",exiting:"opacity-0 pointer-events-none",exited:"opacity-0 pointer-events-none",unmounted:""},g=o.useMemo(()=>({start:"flex-row-reverse",end:"flex-row",top:"flex-col-reverse",bottom:"flex-col"})[a],[a]);return c.jsx(ne,{children:c.jsx(me.Transition,{nodeRef:f,in:t,timeout:n,unmountOnExit:!0,children:h=>c.jsxs(l,{ref:f,style:{transitionDuration:`${n}ms`},className:w.twMerge("drawer fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",p[h],g,i),...d,children:[c.jsx("button",{type:"button",onClick:()=>r(),className:"h-full flex-1 opacity-0 cursor-default min-w-[5%]"}),c.jsx(ge.Provider,{value:{open:t,onClose:r,transitionState:h,duration:n,anchor:a},children:u})]})})})}function Ot({children:e,className:t="",...r}){const{anchor:n,duration:a,transitionState:i}=o.useContext(ge),u=o.useMemo(()=>({start:"w-[30rem] h-full max-w-[97.5%]",end:"w-[30rem] h-full max-w-[97.5%]",top:"w-full h-[30rem] max-h-[97.5%]",bottom:"w-full h-[30rem] max-h-[97.5%]"})[n],[n]),d=o.useMemo(()=>({start:"rounded-e",end:"rounded-s",top:"rounded-b",bottom:"rounded-t"})[n],[n]),f=o.useMemo(()=>({start:{entering:"translate-x-0",entered:"translate-x-0",exiting:"-translate-x-[calc(100%*var(--drawer-ratio))]",exited:"-translate-x-[calc(100%*var(--drawer-ratio))]",unmounted:""},end:{entering:"translate-x-0",entered:"translate-x-0",exiting:"translate-x-[calc(100%*var(--drawer-ratio))]",exited:"translate-x-[calc(100%*var(--drawer-ratio))]",unmounted:""},top:{entering:"translate-y-0",entered:"translate-y-0",exiting:"-translate-y-full",exited:"-translate-y-full",unmounted:""},bottom:{entering:"translate-y-0",entered:"translate-y-0",exiting:"translate-y-full",exited:"translate-y-full",unmounted:""}})[n],[n]);return c.jsx(P,{as:"div",style:{transitionDuration:`${a}ms`},className:w.twMerge("relative flex flex-col transition-[translate,width] rounded-none",u,f[i],d,t),...r,children:e})}function _t(e){return c.jsx(P.Header,{...e})}function Dt({className:e,...t}){return c.jsx(P.Body,{className:ee("flex-1 overflow-auto",e),...t})}function Lt(e){return c.jsx(P.Footer,{...e})}K.Menu=Ot;K.Header=_t;K.Body=Dt;K.Footer=Lt;const xe=o.createContext({size:"md",open:!1,onClose:()=>{},transitionState:"unmounted",duration:300});function X({as:e,size:t="md",open:r=!1,onClose:n=()=>{},duration:a=300,className:i,children:u,...d}){const f=o.useRef(null),l=e||"div",p={entering:"active opacity-100 pointer-events-auto",entered:"active opacity-100 pointer-events-auto",exiting:"opacity-0 pointer-events-none",exited:"opacity-0 pointer-events-none",unmounted:""};return c.jsx(ne,{children:c.jsx(me.Transition,{nodeRef:f,in:r,timeout:a,unmountOnExit:!0,children:g=>c.jsxs(l,{ref:f,style:{transitionDuration:`${a}ms`},className:w.twMerge("modal fixed size-full inset-0 flex flex-col z-10 bg-black/20 transition-opacity backdrop-blur p-4",p[g],i),...d,children:[c.jsx("button",{type:"button",onClick:()=>n(),className:"absolute inset-0 cursor-default opacity-0"}),c.jsx(xe.Provider,{value:{size:t,open:r,onClose:n,transitionState:g,duration:a},children:u})]})})})}function zt({className:e,children:t,...r}){const{size:n,transitionState:a,duration:i}=o.useContext(xe),u={entering:"scale-100",entered:"scale-100",exiting:"scale-75",exited:"scale-75",unmounted:""},d=o.useMemo(()=>n==="sm"?"min-[576px]:w-[300px]":n==="lg"?"min-[992px]:w-[800px]":"min-[576px]:w-[500px]",[n]);return c.jsx(P,{as:"div",style:{transitionDuration:`${i}ms`},className:w.twMerge("max-w-full max-h-full m-auto transition-transform",d,u[a],e),...r,children:t})}function It(e){return c.jsx(P.Header,{...e})}function Ht(e){return c.jsx(P.Body,{...e})}function $t(e){return c.jsx(P.Footer,{...e})}X.Dialog=zt;X.Header=It;X.Body=Ht;X.Footer=$t;function Ie({as:e,variant:t,color:r,size:n,loading:a,stopPropagation:i=!1,closeModal:u=!1,closeDrawer:d=!1,className:f,onClick:l,children:p,...g}){const h=o.useContext(ze),y=o.useContext(xe),N=o.useContext(ge),b=De(),m=e||"button",v=t??h.variant??"solid",E=o.useMemo(()=>r!==void 0?r:h.color!==void 0?h.color:"primary",[r,h.color]),S=n??h.size??"md",A=a??h.loading??!1,M=o.useMemo(()=>{var Z;if(!E)return"border-transparent";const C={primary:{solid:"bg-primary text-white border-primary",outline:"bg-transparent text-primary border-primary",text:"bg-transparent text-primary border-transparent"},secondary:{solid:"bg-secondary text-white border-secondary",outline:"bg-transparent text-secondary border-secondary",text:"bg-transparent text-secondary border-transparent"},success:{solid:"bg-success text-white border-success",outline:"bg-transparent text-success border-success",text:"bg-transparent text-success border-transparent"},info:{solid:"bg-info text-white border-info",outline:"bg-transparent text-info border-info",text:"bg-transparent text-info border-transparent"},warning:{solid:"bg-warning text-white border-warning",outline:"bg-transparent text-warning border-warning",text:"bg-transparent text-warning border-transparent"},danger:{solid:"bg-danger text-white border-danger",outline:"bg-transparent text-danger border-danger",text:"bg-transparent text-danger border-transparent"},dark:{solid:"bg-dark text-white border-dark",outline:"bg-transparent text-dark border-dark",text:"bg-transparent text-dark border-transparent"},light:{solid:"bg-light text-dark border-light",outline:"bg-transparent text-dark border-light",text:"bg-transparent text-dark border-transparent"}};return((Z=C==null?void 0:C[E])==null?void 0:Z[v])??null},[E,v]),$=o.useMemo(()=>M==null?void 0:M.split(" ").find(C=>C.startsWith("text-")),[M]),I=o.useMemo(()=>{if(!S)return null;const C={sm:"text-base py-1 px-3.5",md:"text-base py-1.5 px-4",lg:"text-lg py-2 px-5"};return C==null?void 0:C[S]},[S]),F=C=>{b(C),u&&y.onClose(),d&&N.onClose(),i&&C.stopPropagation(),l==null||l(C)};return c.jsxs(m,{className:w.twMerge("relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee] shadow cursor-pointer hover:shadow-md transition-[box-shadow,opacity,color,background-color,border-color]",M,I,A?"disabled:opacity-100 disabled:cursor-wait disabled:text-transparent":"disabled:opacity-75 disabled:cursor-not-allowed active:shadow-lg",h.buttonClasses,f),onClick:F,disabled:g.disabled||A,...g,children:[p,A&&c.jsx("span",{className:"absolute inset-0 size-full flex items-center justify-center bg-transparent p-2",children:c.jsx("span",{className:ee("h-full aspect-square rounded-full border-4 border-current border-l-transparent animate-spin",$)})}),c.jsx("span",{className:"ripple-group absolute size-full inset-0 overflow-hidden pointer-events-none"})]})}const Ft=o.createContext({});function Bt({disabled:e=!1,onSubmit:t,onError:r,children:n,...a}){const i=o.useRef({}),u=(l,p)=>{i.current[l]=p},d=l=>{delete i.current[l]},f=l=>{var v;l.preventDefault();const g=[...l.currentTarget.querySelectorAll("div[id]")].map(E=>{const S=E.id||null;if(!S)return{element:E,isValid:!0};const A=i.current[S],M=A==null?void 0:A();return{element:E,isValid:M}});if(g.every(E=>!!E.isValid))return t==null?void 0:t(l);const y=(v=g.find(E=>!E.isValid))==null?void 0:v.element,N=y==null?void 0:y.querySelector("input"),b=y==null?void 0:y.querySelector("textarea"),m=N||b;m==null||m.select(),y==null||y.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}),r==null||r(l)};return c.jsx("form",{...a,onSubmit:f,children:c.jsx(Ft.Provider,{value:{setFormControl:u,removeFormControl:d,formDisabled:e},children:n})})}const oe=o.createContext({open:!1,onClose:()=>{},transitionState:"unmounted",closeOnClick:!1});function He({as:e,open:t,onClose:r,closeOnClick:n=!1,anchorEl:a=null,className:i,children:u,...d}){const f=e||"div",l=16,p=o.useRef(null),g=o.useRef({left:l,right:l,top:l}),h={entering:"scale-100 opacity-100",entered:"scale-100 opacity-100",exiting:"scale-90 opacity-0",exited:"scale-90 opacity-0",unmounted:""},y=o.useCallback(m=>{g.current=m},[]),N=o.useCallback(m=>{var v,E,S;(v=p.current)==null||v.style.setProperty("--left",`${m.left}px`),(E=p.current)==null||E.style.setProperty("--right",`${m.right}px`),(S=p.current)==null||S.style.setProperty("--top",`${m.top}px`)},[]),b=o.useCallback(()=>{var F,C;if(!t||!a)return;const m=a.getBoundingClientRect(),v=window.innerWidth,E=window.innerHeight,S=((F=p.current)==null?void 0:F.offsetWidth)||150,A=((C=p.current)==null?void 0:C.offsetHeight)||200;let M=m.left,$=m.right,I=m.bottom;M=Math.min(Math.max(M,l),v-S-l),$=Math.min(Math.max(v-m.right,l),v-S-l),I=Math.min(Math.max(I,l),E-A-l),y({left:M,right:$,top:I}),N({left:M,right:$,top:I})},[t,a,y,N]);return o.useEffect(()=>{b()},[b,u]),o.useEffect(()=>{const m=()=>{b()};return window.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[b]),c.jsx(ne,{children:c.jsx(me.Transition,{nodeRef:p,in:t,timeout:300,unmountOnExit:!0,children:m=>c.jsx(oe.Provider,{value:{open:t,onClose:r,transitionState:m,closeOnClick:n},children:c.jsxs(qt,{children:[c.jsx(Yt,{}),c.jsx(f,{ref:p,className:w.twMerge("w-fit min-w-[12.5rem] bg-white shadow rounded p-2 transition-[scale,opacity] absolute top-[var(--top)] left-[var(--left)] right-auto origin-top-left rtl:left-auto rtl:right-[var(--right)] rtl:origin-top-right",h[m],i),...d,children:u})]})})})})}function qt({children:e}){const{transitionState:t}=o.useContext(oe),r={entering:"active pointer-events-auto",entered:"active pointer-events-auto",exiting:"pointer-events-none",exited:"pointer-events-none",unmounted:""};return c.jsx("div",{className:w.twMerge("menu fixed inset-0 size-full flex flex-col bg-transparent transition-opacity overflow-hidden z-10",r[t]),children:e})}function Yt(){const{onClose:e}=o.useContext(oe);return c.jsx("button",{type:"button",className:"w-full flex-1 opacity-0 cursor-default lg:absolute lg:size-full lg:inset-0",onClick:e})}function Vt({as:e,closeOnClick:t,type:r="button",className:n,children:a,onClick:i,...u}){const d=e||"div",{closeOnClick:f,onClose:l}=o.useContext(oe),p=t??f,g=h=>{p&&(l==null||l()),i==null||i(h)};return c.jsx(d,{type:r,className:w.twMerge("flex items-center px-3 py-2 w-full text-dark text-base font-normal rounded transition-colors hover:bg-dark hover:text-white",n),onClick:g,...u,children:a})}He.Item=Vt;function Wt({color:e="primary",value:t=0,className:r,...n}){const a=o.useMemo(()=>{if(!e)return"border-transparent";const i={primary:"bg-primary/15 text-primary",secondary:"bg-secondary/15 text-secondary",success:"bg-success/15 text-success",info:"bg-info/15 text-info",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",dark:"bg-dark/15 text-dark",light:"bg-light/15 text-light"};return(i==null?void 0:i[e])??null},[e]);return c.jsx("div",{className:w.twMerge("block w-full h-2.5 rounded-full overflow-hidden",a,r),...n,children:c.jsx("span",{style:{width:`${t}%`},className:"block h-full max-w-full bg-current rounded-[inherit] transition-[width]"})})}function Gt({className:e,children:t,...r}){return c.jsx("div",{className:w.twMerge("size-10 rounded bg-gray-200 text-gray-200 animate-pulse",e),...r,children:t})}function Ut({as:e,variant:t="horizontal",wrap:r=!1,className:n,children:a,...i}){const u=e||"div",d=o.useMemo(()=>({horizontal:"flex-row *:min-w-0",vertical:"flex-col *:min-h-0"})[t],[t]);return c.jsx(u,{className:w.twMerge("w-full flex",d,r&&"flex-wrap",n),...i,children:a})}const $e=o.createContext({striped:!1,bordered:!1,hover:!1});function Jt({className:e,children:t,...r}){return c.jsx("div",{className:w.twMerge("w-full overflow-auto",e),...r,children:t})}function q({striped:e=!1,bordered:t=!1,hover:r=!1,className:n,children:a,...i}){return c.jsx("table",{className:w.twMerge("min-w-full border-collapse border-spacing-0",n),...i,children:c.jsx($e.Provider,{value:{bordered:t,hover:r,striped:e},children:a})})}function Kt({sticky:e=!1,className:t,children:r,...n}){return c.jsx("thead",{className:w.twMerge(e&&"sticky top-0 left-0 right-0 z-[2]",t),...n,children:r})}function Xt({className:e,children:t,...r}){return c.jsx("tbody",{className:w.twMerge("",e),...r,children:t})}function Zt({className:e,children:t,...r}){const{bordered:n,hover:a,striped:i}=o.useContext($e),u=!!n,d=n==="dashed",f=n==="solid";return c.jsx("tr",{className:w.twMerge("bg-white",u&&"border-b border-solid",d&&"border-dashed",f&&"border-solid",a&&"transition-colors hover:bg-gray-200",i&&"even:bg-gray-100",e),...r,children:t})}function Qt({sticky:e=!1,className:t,children:r,...n}){return c.jsx("th",{className:w.twMerge("font-medium text-sm py-2 px-4 whitespace-nowrap text-center first:text-start last:text-end",e&&"bg-inherit sticky end-0 z-[1]",t),...n,children:r})}function er({sticky:e=!1,className:t,children:r,...n}){return c.jsx("td",{className:w.twMerge("font-normal text-sm py-2 px-4 whitespace-nowrap text-center first:text-start last:text-end",e&&"bg-inherit sticky end-0 z-[1]",t),...n,children:r})}q.Container=Jt;q.Header=Kt;q.Body=Xt;q.Row=Zt;q.HeaderCell=Qt;q.DataCell=er;function tr({as:e,variant:t="body-1",className:r,...n}){const a=o.useMemo(()=>e||{"heading-1":"h1","heading-2":"h2","heading-3":"h3","heading-4":"h4","heading-5":"h5","heading-6":"h6","body-1":"p","body-2":"p"}[t]||"p",[e,t]),i=o.useMemo(()=>({"heading-1":"text-5xl font-semibold","heading-2":"text-4xl font-semibold","heading-3":"text-3xl font-semibold","heading-4":"text-2xl font-semibold","heading-5":"text-xl font-medium","heading-6":"text-lg font-medium","body-1":"text-base font-normal","body-2":"text-sm font-normal"})[t],[t]);return c.jsx(a,{className:w.twMerge("",i,r),...n})}function rr({children:e}){return c.jsx(o.Fragment,{children:e})}exports.Accordion=W;exports.AxiosProvider=Xe;exports.Badge=gt;exports.Box=xt;exports.Button=Ie;exports.ButtonGroup=Mt;exports.Card=P;exports.Drawer=K;exports.Form=Bt;exports.Menu=He;exports.Modal=X;exports.Portal=ne;exports.Progress=Wt;exports.Skeleton=Gt;exports.Stack=Ut;exports.Table=q;exports.Tabs=re;exports.ThemeProvider=rr;exports.Typography=tr;exports.cn=ee;exports.copy=nt;exports.isEmpty=ot;exports.isEmptyArray=_e;exports.isEmptyObject=Oe;exports.isEmptyString=Ae;exports.isEmptyValue=Pe;exports.isServer=st;exports.matrixArray=at;exports.randomID=pe;exports.replaceNonDigits=it;exports.replacePersianNumbers=ct;exports.twoDigitNumber=lt;exports.useAutoFill=wt;exports.useAxios=rt;exports.useCreateRipple=De;exports.useDebounce=Le;exports.useDocumentVisible=ht;exports.useIsOffline=yt;exports.useKeyDown=vt;exports.useMouse=Et;exports.useOutsideClick=Tt;exports.usePersistedState=jt;exports.useToggle=Ct;exports.wait=ut;