1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/exceljs.min-DAfZ43pa.js","assets/index-CXb8-U_O.js","assets/index-CVUGjg-u.css"])))=>i.map(i=>d[i]); 2import{r as o,q as ue,R as bs,j as e,P as q,c as Q,d as J,i as pt,h as ee,g as Gt,t as Yt,A as Ns,k as H,v as Xt,D as Zt,w as ws,x as Ss,V as Cs,y as Qt,z as _s,E as Jt,F as ks,l as St,G as Es,X as er,s as De,L as Y,I as R,f as w,J as Rs,C as Oe,p as tr,n as Ts,K as he,T as rr,M as sr,S as At,U as nr,N as xt,O as Is,Q as Ps,_ as Ds}from"./index-CXb8-U_O.js";import{C as Me,B as E,I as F}from"./input-E8eIR3NO.js";import{B as U,U as As}from"./badge-CtmWlP2b.js";import{c as Os,b as ke,d as Ms,u as Ls,a as gt,C as Ye}from"./index-Cfo4Zu7u.js";import{C as Bs,a as Fs}from"./chevron-right-B3yC7kE0.js";import{T as $s}from"./triangle-alert-DLH-f40L.js";var zs="Portal",Ct=o.forwardRef((t,s)=>{var i;const{container:r,...a}=t,[n,c]=o.useState(!1);ue(()=>c(!0),[]);const l=r||n&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return l?bs.createPortal(e.jsx(q.div,{...a,ref:s}),l):null});Ct.displayName=zs;/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const Us=Q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 8 * @license lucide-react v0.462.0 - ISC 9 * 10 * This source code is licensed under the ISC license. 11 * See the LICENSE file in the root directory of this source tree. 12 */const Vs=Q("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 13 * @license lucide-react v0.462.0 - ISC 14 * 15 * This source code is licensed under the ISC license. 16 * See the LICENSE file in the root directory of this source tree. 17 */const Ws=Q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 18 * @license lucide-react v0.462.0 - ISC 19 * 20 * This source code is licensed under the ISC license. 21 * See the LICENSE file in the root directory of this source tree. 22 */const Hs=Q("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 23 * @license lucide-react v0.462.0 - ISC 24 * 25 * This source code is licensed under the ISC license. 26 * See the LICENSE file in the root directory of this source tree. 27 */const ar=Q("Hotel",[["path",{d:"M10 22v-6.57",key:"1wmca3"}],["path",{d:"M12 11h.01",key:"z322tv"}],["path",{d:"M12 7h.01",key:"1ivr5q"}],["path",{d:"M14 15.43V22",key:"1q2vjd"}],["path",{d:"M15 16a5 5 0 0 0-6 0",key:"o9wqvi"}],["path",{d:"M16 11h.01",key:"xkw8gn"}],["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 7h.01",key:"1vti4s"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]]);/** 28 * @license lucide-react v0.462.0 - ISC 29 * 30 * This source code is licensed under the ISC license. 31 * See the LICENSE file in the root directory of this source tree. 32 */const Ks=Q("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** 33 * @license lucide-react v0.462.0 - ISC 34 * 35 * This source code is licensed under the ISC license. 36 * See the LICENSE file in the root directory of this source tree. 37 */const qs=Q("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 38 * @license lucide-react v0.462.0 - ISC 39 * 40 * This source code is licensed under the ISC license. 41 * See the LICENSE file in the root directory of this source tree.
42 */const Gs=Q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 43 * @license lucide-react v0.462.0 - ISC 44 * 45 * This source code is licensed under the ISC license. 46 * See the LICENSE file in the root directory of this source tree. 47 */const Ys=Q("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 48 * @license lucide-react v0.462.0 - ISC 49 * 50 * This source code is licensed under the ISC license. 51 * See the LICENSE file in the root directory of this source tree. 52 */const Xs=Q("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 53 * @license lucide-react v0.462.0 - ISC 54 * 55 * This source code is licensed under the ISC license. 56 * See the LICENSE file in the root directory of this source tree. 57 */const or=Q("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 58 * @license lucide-react v0.462.0 - ISC 59 * 60 * This source code is licensed under the ISC license. 61 * See the LICENSE file in the root directory of this source tree. 62 */const Zs=Q("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/** 63 * @license lucide-react v0.462.0 - ISC 64 * 65 * This source code is licensed under the ISC license. 66 * See the LICENSE file in the root directory of this source tree. 67 */const Qs=Q("ToggleRight",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]);/** 68 * @license lucide-react v0.462.0 - ISC 69 * 70 * This source code is licensed under the ISC license. 71 * See the LICENSE file in the root directory of this source tree. 72 */const _t=Q("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 73 * @license lucide-react v0.462.0 - ISC 74 * 75 * This source code is licensed under the ISC license. 76 * See the LICENSE file in the root directory of this source tree. 77 */const Js=Q("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);/** 78 * @license lucide-react v0.462.0 - ISC 79 * 80 * This source code is licensed under the ISC license. 81 * See the LICENSE file in the root directory of this source tree. 82 */const en=Q("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),Xe=o.forwardRef(({className:t,...s},r)=>e.jsx("textarea",{className:J("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
82ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...s}));Xe.displayName="Textarea";function Ot(t,[s,r]){return Math.min(r,Math.max(s,t))}var ot=0;function lr(){o.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Mt()),document.body.insertAdjacentElement("beforeend",t[1]??Mt()),ot++,()=>{ot===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(s=>s.remove()),ot--}},[])}function Mt(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var lt="focusScope.autoFocusOnMount",it="focusScope.autoFocusOnUnmount",Lt={bubbles:!1,cancelable:!0},tn="FocusScope",kt=o.forwardRef((t,s)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:n,onUnmountAutoFocus:c,...l}
vendor: 4,066 bytes, line 82
82=t,[i,u]=o.useState(null),p=pt(n),b=pt(c),h=o.useRef(null),g=ee(s,d=>u(d)),N=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let d=function(f){if(N.paused||!i)return;const C=f.target;i.contains(C)?h.current=C:me(h.current,{select:!0})},x=function(f){if(N.paused||!i)return;const C=f.relatedTarget;C!==null&&(i.contains(C)||me(h.current,{select:!0}))},j=function(f){if(document.activeElement===document.body)for(const k of f)k.removedNodes.length>0&&me(i)};document.addEventListener("focusin",d),document.addEventListener("focusout",x);const v=new MutationObserver(j);return i&&v.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",x),v.disconnect()}}},[a,i,N.paused]),o.useEffect(()=>{if(i){Ft.add(N);const d=document.activeElement;if(!i.contains(d)){const j=new CustomEvent(lt,Lt);i.addEventListener(lt,p),i.dispatchEvent(j),j.defaultPrevented||(rn(ln(ir(i)),{select:!0}),document.activeElement===d&&me(i))}return()=>{i.removeEventListener(lt,p),setTimeout(()=>{const j=new CustomEvent(it,Lt);i.addEventListener(it,b),i.dispatchEvent(j),j.defaultPrevented||me(d??document.body,{select:!0}),i.removeEventListener(it,b),Ft.remove(N)},0)}}},[i,p,b,N]);const S=o.useCallback(d=>{if(!r&&!a||N.paused)return;const x=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,j=document.activeElement;if(x&&j){const v=d.currentTarget,[f,C]=sn(v);f&&C?!d.shiftKey&&j===C?(d.preventDefault(),r&&me(f,{select:!0})):d.shiftKey&&j===f&&(d.preventDefault(),r&&me(C,{select:!0})):j===v&&d.preventDefault()}},[r,a,N.paused]);return e.jsx(q.div,{tabIndex:-1,...l,ref:g,onKeyDown:S})});kt.displayName=tn;function rn(t,{select:s=!1}={}){const r=document.activeElement;for(const a of t)if(me(a,{select:s}),document.activeElement!==r)return}function sn(t){const s=ir(t),r=Bt(s,t),a=Bt(s.reverse(),t);return[r,a]}function ir(t){const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)s.push(r.currentNode);return s}function Bt(t,s){for(const r of t)if(!nn(r,{upTo:s}))return r}function nn(t,{upTo:s}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(s!==void 0&&t===s)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function an(t){return t instanceof HTMLInputElement&&"select"in t}function me(t,{select:s=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&an(t)&&s&&t.select()}}var Ft=on();function on(){let t=[];return{add(s){const r=t[0];s!==r&&(r==null||r.pause()),t=$t(t,s),t.unshift(s)},remove(s){var r;t=$t(t,s),(r=t[0])==null||r.resume()}}}function $t(t,s){const r=[...t],a=r.indexOf(s);return a!==-1&&r.splice(a,1),r}function ln(t){return t.filter(s=>s.tagName!=="A")}var cn=function(t){if(typeof document>"u")return null;var s=Array.isArray(t)?t[0]:t;return s.ownerDocument.body},we=new WeakMap,$e=new WeakMap,ze={},ct=0,cr=function(t){return t&&(t.host||cr(t.parentNode))},dn=function(t,s){return s.map(function(r){if(t.contains(r))return r;var a=cr(r);return a&&t.contains(a)?a:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},un=function(t,s,r,a){var n=dn(s,Array.isArray(t)?t:[t]);ze[r]||(ze[r]=new WeakMap);var c=ze[r],l=[],i=new Set,u=new Set(n),p=function(h){!h||i.has(h)||(i.add(h),p(h.parentNode))};n.forEach(p);var b=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(g){if(i.has(g))b(g);else try{var N=g.getAttribute(a),S=N!==null&&N!=="false",d=(we.get(g)||0)+1,x=(c.get(g)||0)+1;we.set(g,d),c.set(g,x),l.push(g),d===1&&S&&$e.set(g,!0),x===1&&g.setAttribute(r,"true"),S||g.setAttribute(a,"true")}catch(j){console.error("aria-hidden: cannot operate on ",g,j)}})};return b(s),i.clear(),ct++,function(){l.forEach(function(h){var g=we.get(h)-1,N=c.get(h)-1;
vendor: 4,233 bytes, line 82
82we.set(h,g),c.set(h,N),g||($e.has(h)||h.removeAttribute(a),$e.delete(h)),N||h.removeAttribute(r)}),ct--,ct||(we=new WeakMap,we=new WeakMap,$e=new WeakMap,ze={})}},dr=function(t,s,r){r===void 0&&(r="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),n=cn(t);return n?(a.push.apply(a,Array.from(n.querySelectorAll("[aria-live]"))),un(a,n,r,"aria-hidden")):function(){return null}},ae=function(){return ae=Object.assign||function(s){for(var r,a=1,n=arguments.length;a<n;a++){r=arguments[a];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(s[c]=r[c])}return s},ae.apply(this,arguments)};function ur(t,s){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&s.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)s.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r}function mn(t,s,r){if(r||arguments.length===2)for(var a=0,n=s.length,c;a<n;a++)(c||!(a in s))&&(c||(c=Array.prototype.slice.call(s,0,a)),c[a]=s[a]);return t.concat(c||Array.prototype.slice.call(s))}var He="right-scroll-bar-position",Ke="width-before-scroll-bar",hn="with-scroll-bars-hidden",fn="--removed-body-scroll-bar-size";function dt(t,s){return typeof t=="function"?t(s):t&&(t.current=s),t}function pn(t,s){var r=o.useState(function(){return{value:t,callback:s,facade:{get current(){return r.value},set current(a){var n=r.value;n!==a&&(r.value=a,r.callback(a,n))}}}})[0];return r.callback=s,r.facade}var xn=typeof window<"u"?o.useLayoutEffect:o.useEffect,zt=new WeakMap;function gn(t,s){var r=pn(null,function(a){return t.forEach(function(n){return dt(n,a)})});return xn(function(){var a=zt.get(r);if(a){var n=new Set(a),c=new Set(t),l=r.current;n.forEach(function(i){c.has(i)||dt(i,null)}),c.forEach(function(i){n.has(i)||dt(i,l)})}zt.set(r,t)},[t]),r}function vn(t){return t}function yn(t,s){s===void 0&&(s=vn);var r=[],a=!1,n={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(c){var l=s(c,a);return r.push(l),function(){r=r.filter(function(i){return i!==l})}},assignSyncMedium:function(c){for(a=!0;r.length;){var l=r;r=[],l.forEach(c)}r={push:function(i){return c(i)},filter:function(){return r}}},assignMedium:function(c){a=!0;var l=[];if(r.length){var i=r;r=[],i.forEach(c),l=r}var u=function(){var b=l;l=[],b.forEach(c)},p=function(){return Promise.resolve().then(u)};p(),r={push:function(b){l.push(b),p()},filter:function(b){return l=l.filter(b),r}}}};return n}function jn(t){t===void 0&&(t={});var s=yn(null);return s.options=ae({async:!0,ssr:!1},t),s}var mr=function(t){var s=t.sideCar,r=ur(t,["sideCar"]);if(!s)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=s.read();if(!a)throw new Error("Sidecar medium not found");return o.createElement(a,ae({},r))};mr.isSideCarExport=!0;function bn(t,s){return t.useMedium(s),mr}var hr=jn(),ut=function(){},Ze=o.forwardRef(function(t,s){var r=o.useRef(null),a=o.useState({onScrollCapture:ut,onWheelCapture:ut,onTouchMoveCapture:ut}),n=a[0],c=a[1],l=t.forwardProps,i=t.children,u=t.className,p=t.removeScrollBar,b=t.enabled,h=t.shards,g=t.sideCar,N=t.noRelative,S=t.noIsolation,d=t.inert,x=t.allowPinchZoom,j=t.as,v=j===void 0?"div":j,f=t.gapMode,C=ur(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=g,P=gn([r,s]),D=ae(ae({},C),n);return o.createElement(o.Fragment,null,b&&o.createElement(k,{sideCar:hr,removeScrollBar:p,shards:h,noRelative:N,noIsolation:S,inert:d,setCallbacks:c,allowPinchZoom:!!x,lockRef:r,gapMode:f}),l?o.cloneElement(o.Children.only(i),ae(ae({},D),{ref:P})):o.createElement(v,ae({},D,{className:u,ref:P}),i))});Ze.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ze.classNames={fullWidth:Ke,zeroRight:He};var Nn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wn(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var s=Nn();return s&&t.setAttribute("nonce",s),t}
vendor: 8,703 bytes, lines 82-122
82function Sn(t,s){t.styleSheet?t.styleSheet.cssText=s:t.appendChild(document.createTextNode(s))}function Cn(t){var s=document.head||document.getElementsByTagName("head")[0];s.appendChild(t)}var _n=function(){var t=0,s=null;return{add:function(r){t==0&&(s=wn())&&(Sn(s,r),Cn(s)),t++},remove:function(){t--,!t&&s&&(s.parentNode&&s.parentNode.removeChild(s),s=null)}}},kn=function(){var t=_n();return function(s,r){o.useEffect(function(){return t.add(s),function(){t.remove()}},[s&&r])}},fr=function(){var t=kn(),s=function(r){var a=r.styles,n=r.dynamic;return t(a,n),null};return s},En={left:0,top:0,right:0,gap:0},mt=function(t){return parseInt(t||"",10)||0},Rn=function(t){var s=window.getComputedStyle(document.body),r=s[t==="padding"?"paddingLeft":"marginLeft"],a=s[t==="padding"?"paddingTop":"marginTop"],n=s[t==="padding"?"paddingRight":"marginRight"];return[mt(r),mt(a),mt(n)]},Tn=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return En;var s=Rn(t),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:s[0],top:s[1],right:s[2],gap:Math.max(0,a-r+s[2]-s[0])}},In=fr(),Ee="data-scroll-locked",Pn=function(t,s,r,a){var n=t.left,c=t.top,l=t.right,i=t.gap;return r===void 0&&(r="margin"),` 83 .`.concat(hn,` { 84 overflow: hidden `).concat(a,`; 85 padding-right: `).concat(i,"px ").concat(a,`; 86 } 87 body[`).concat(Ee,`] { 88 overflow: hidden `).concat(a,`; 89 overscroll-behavior: contain; 90 `).concat([s&&"position: relative ".concat(a,";"),r==="margin"&&` 91 padding-left: `.concat(n,`px; 92 padding-top: `).concat(c,`px; 93 padding-right: `).concat(l,`px; 94 margin-left:0; 95 margin-top:0; 96 margin-right: `).concat(i,"px ").concat(a,`; 97 `),r==="padding"&&"padding-right: ".concat(i,"px ").concat(a,";")].filter(Boolean).join(""),` 98 } 99 100 .`).concat(He,` { 101 right: `).concat(i,"px ").concat(a,`; 102 } 103 104 .`).concat(Ke,` { 105 margin-right: `).concat(i,"px ").concat(a,`; 106 } 107 108 .`).concat(He," .").concat(He,` { 109 right: 0 `).concat(a,`; 110 } 111 112 .`).concat(Ke," .").concat(Ke,` { 113 margin-right: 0 `).concat(a,`; 114 } 115 116 body[`).concat(Ee,`] { 117 `).concat(fn,": ").concat(i,`px; 118 } 119`)},Ut=function(){var t=parseInt(document.body.getAttribute(Ee)||"0",10);return isFinite(t)?t:0},Dn=function(){o.useEffect(function(){return document.body.setAttribute(Ee,(Ut()+1).toString()),function(){var t=Ut()-1;t<=0?document.body.removeAttribute(Ee):document.body.setAttribute(Ee,t.toString())}},[])},An=function(t){var s=t.noRelative,r=t.noImportant,a=t.gapMode,n=a===void 0?"margin":a;Dn();var c=o.useMemo(function(){return Tn(n)},[n]);return o.createElement(In,{styles:Pn(c,!s,n,r?"":"!important")})},vt=!1;if(typeof window<"u")try{var Ue=Object.defineProperty({},"passive",{get:function(){return vt=!0,!0}});window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch{vt=!1}var Se=vt?{passive:!1}:!1,On=function(t){return t.tagName==="TEXTAREA"},pr=function(t,s){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[s]!=="hidden"&&!(r.overflowY===r.overflowX&&!On(t)&&r[s]==="visible")},Mn=function(t){return pr(t,"overflowY")},Ln=function(t){return pr(t,"overflowX")},Vt=function(t,s){var r=s.ownerDocument,a=s;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var n=xr(t,a);if(n){var c=gr(t,a),l=c[1],i=c[2];if(l>i)return!0}a=a.parentNode}while(a&&a!==r.body);return!1},Bn=function(t){var s=t.scrollTop,r=t.scrollHeight,a=t.clientHeight;return[s,r,a]},Fn=function(t){var s=t.scrollLeft,r=t.scrollWidth,a=t.clientWidth;return[s,r,a]},xr=function(t,s){return t==="v"?Mn(s):Ln(s)},gr=function(t,s){return t==="v"?Bn(s):Fn(s)},$n=function(t,s){return t==="h"&&s==="rtl"?-1:1},zn=function(t,s,r,a,n){var c=$n(t,window.getComputedStyle(s).direction),l=c*a,i=r.target,u=s.contains(i),p=!1,b=l>0,h=0,g=0;do{if(!i)break;var N=gr(t,i),S=N[0],d=N[1],x=N[2],j=d-x-c*S;(S||j)&&xr(t,i)&&(h+=j,g+=S);var v=i.parentNode;i=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!u&&i!==document.body||u&&(s.contains(i)||s===i));return(b&&(Math.abs(h)<1||!n)||!b&&(Math.abs(g)<1||!n))&&(p=!0),p},Ve=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Wt=function(t){return[t.deltaX,t.deltaY]},Ht=function(t){return t&&"current"in t?t.current:t},Un=function(t,s){return t[0]===s[0]&&t[1]===s[1]},Vn=function(t){return` 120 .block-interactivity-`.concat(t,` {pointer-events: none;} 121 .allow-interactivity-`).concat(t,` {pointer-events: all;} 122`)},Wn=0,Ce=[];function Hn(t){var s=o.useRef([]),r=o.useRef([0,0]),a=o.useRef(),n=o.useState(Wn++)[0],c=o.useState(fr)[0],l=o.useRef(t);o.useEffect(function(){l.current=t},[t]),o.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(n));var d=mn([t.lockRef.current],(t.shards||[]).map(Ht),!0).filter(Boolean);return d.forEach(function(x){return x.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),d.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(n))})}}},[t.inert,t.lockRef.current,t.shards]);var i=o.useCallback(function(d,x){if("touches"in d&&d.touches.length===2||d.type==="wheel"&&d.ctrlKey)return!l.current.allowPinchZoom;var j=Ve(d),v=r.current,f="deltaX"in d?d.deltaX:v[0]-j[0],C="deltaY"in d?d.deltaY:v[1]-j[1],k,P=d.target,D=Math.abs(f)>Math.abs(C)?"h":"v";if("touches"in d&&D==="h"&&P.type==="range")return!1;var y=Vt(D,P);if(!y)return!0;if(y?k=D:(k=D==="v"?"h":"v",y=Vt(D,P)),!y)return!1;if(!a.current&&"changedTouches"in d&&(f||C)&&(a.current=k),!k)return!0;var _=a.current||k;return zn(_,x,d,_==="h"?f:C,!0)},[]),u=o.useCallback(function(d){var x=d;if(!(!Ce.length||Ce[Ce.length-1]!==c)){var j="deltaY"in x?Wt(x):Ve(x),v=s.current.filter(function(k){return k.name===x.type&&(k.target===x.target||x.target===k.shadowParent)&&Un(k.delta,j)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var f=(l.current.shards||[]).map(Ht).filter(Boolean).filter(function(k){return k.contains(x.target)}),C=f.length>0?i(x,f[0]):!l.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),p=o.useCallback(function(d,x,j,v){var f={name:d,delta:x,target:j,should:v,shadowParent:Kn(j)};s.current.push(f),setTimeout(function(){s.current=s.current.filter(function(C){return C!==f})},1)},[]),b=o.useCallback(function(d){r.current=Ve(d),a.current=void 0},[]),h=o.useCallback(function(d){p(d.type,Wt(d),d.target,i(d,t.lockRef.current))},[]),g=o.useCallback(function(d){p(d.type,Ve(d),d.target,i(d,t.lockRef.current))},[]);o.useEffect(function(){return Ce.push(c),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Se),document.addEventListener("touchmove",u,Se),document.addEventListener("touchstart",b,Se),function(){Ce=Ce.filter(function(d){return d!==c}),document.removeEventListener("wheel",u,Se),document.removeEventListener("touchmove",u,Se),document.removeEventListener("touchstart",b,Se)}},[]);var N=t.removeScrollBar,S=t.inert;return o.createElement(o.Fragment,null,S?o.createElement(c,{styles:Vn(n)}):null,N?o.createElement(An,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Kn(t){for(var s=null;t!==null;)t instanceof ShadowRoot&&(s=t.host,t=t.host),t=t.parentNode;return s}const qn=bn(hr,Hn);var Et=o.forwardRef(function(t,s){return o.createElement(Ze,ae({},t,{ref:s,sideCar:qn}))});Et.classNames=Ze.classNames;var Gn=[" ","Enter","ArrowUp","ArrowDown"],Yn=[" ","Enter"],ye="Select",[Qe,Je,Xn]=Os(ye),[Ie,so]=Gt(ye,[Xn,Yt]),et=Yt(),[Zn,pe]=Ie(ye),[Qn,Jn]=Ie(ye),vr=t=>{const{__scopeSelect:s,children:r,open:a,defaultOpen:n,onOpenChange:c,value:l,defaultValue:i,onValueChange:u,dir:p,name:b,autoComplete:h,disabled:g,required:N,form:S}=t,d=et(s),[x,j]=o.useState(null),[v,f]=o.useState(null),[C,k]=o.useState(!1),P=Ls(p),[D,y]=gt({prop:a,defaultProp:n??!1,onChange:c,caller:ye}),[_,A]=gt({prop:l,defaultProp:i,onChange:u,caller:ye}),L=o.useRef(null),O=x?S||!!x.closest("form"):!0,[K,G]=o.useState(new Set),X=Array.from(K).map(B=>B.props.value).join(";");return e.jsx(_s,{...d,children:e.jsxs(Zn,{required:N,scope:s,trigger:x,onTriggerChange:j,valueNode:v,onValueNodeChange:f,valueNodeHasChildren:C,onValueNodeHasChildrenChange:k,contentId:ke(),value:_,onValueChange:A,open:D,onOpenChange:y,dir:P,triggerPointerDownPosRef:L,disabled:g,children:[e.jsx(Qe.Provider,{scope:s,children:e.jsx(Qn,{scope:t.__scopeSelect,onNativeOptionAdd:o.useCallback(B=>{G(m=>new Set(m).add(B))},[]),onNativeOptionRemove:o.useCallback(B=>{G(m=>{const T=new Set(m);return T.delete(B),T})},[]),children:r})}),O?e.jsxs(Ur,{"aria-hidden":!0,required:N,tabIndex:-1,name:b,autoComplete:h,value:_,onCh
vendor: 16,899 bytes, line 122
122ange:B=>A(B.target.value),disabled:g,form:S,children:[_===void 0?e.jsx("option",{value:""}):null,Array.from(K)]},X):null]})})};vr.displayName=ye;var yr="SelectTrigger",jr=o.forwardRef((t,s)=>{const{__scopeSelect:r,disabled:a=!1,...n}=t,c=et(r),l=pe(yr,r),i=l.disabled||a,u=ee(s,l.onTriggerChange),p=Je(r),b=o.useRef("touch"),[h,g,N]=Wr(d=>{const x=p().filter(f=>!f.disabled),j=x.find(f=>f.value===l.value),v=Hr(x,d,j);v!==void 0&&l.onValueChange(v.value)}),S=d=>{i||(l.onOpenChange(!0),N()),d&&(l.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return e.jsx(Ns,{asChild:!0,...c,children:e.jsx(q.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Vr(l.value)?"":void 0,...n,ref:u,onClick:H(n.onClick,d=>{d.currentTarget.focus(),b.current!=="mouse"&&S(d)}),onPointerDown:H(n.onPointerDown,d=>{b.current=d.pointerType;const x=d.target;x.hasPointerCapture(d.pointerId)&&x.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(S(d),d.preventDefault())}),onKeyDown:H(n.onKeyDown,d=>{const x=h.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&g(d.key),!(x&&d.key===" ")&&Gn.includes(d.key)&&(S(),d.preventDefault())})})})});jr.displayName=yr;var br="SelectValue",Nr=o.forwardRef((t,s)=>{const{__scopeSelect:r,className:a,style:n,children:c,placeholder:l="",...i}=t,u=pe(br,r),{onValueNodeHasChildrenChange:p}=u,b=c!==void 0,h=ee(s,u.onValueNodeChange);return ue(()=>{p(b)},[p,b]),e.jsx(q.span,{...i,ref:h,style:{pointerEvents:"none"},children:Vr(u.value)?e.jsx(e.Fragment,{children:l}):c})});Nr.displayName=br;var ea="SelectIcon",wr=o.forwardRef((t,s)=>{const{__scopeSelect:r,children:a,...n}=t;return e.jsx(q.span,{"aria-hidden":!0,...n,ref:s,children:a||"â¼"})});wr.displayName=ea;var ta="SelectPortal",Sr=t=>e.jsx(Ct,{asChild:!0,...t});Sr.displayName=ta;var je="SelectContent",Cr=o.forwardRef((t,s)=>{const r=pe(je,t.__scopeSelect),[a,n]=o.useState();if(ue(()=>{n(new DocumentFragment)},[]),!r.open){const c=a;return c?Xt.createPortal(e.jsx(_r,{scope:t.__scopeSelect,children:e.jsx(Qe.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),c):null}return e.jsx(kr,{...t,ref:s})});Cr.displayName=je;var re=10,[_r,xe]=Ie(je),ra="SelectContentImpl",sa=Qt("SelectContent.RemoveScroll"),kr=o.forwardRef((t,s)=>{const{__scopeSelect:r,position:a="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:l,side:i,sideOffset:u,align:p,alignOffset:b,arrowPadding:h,collisionBoundary:g,collisionPadding:N,sticky:S,hideWhenDetached:d,avoidCollisions:x,...j}=t,v=pe(je,r),[f,C]=o.useState(null),[k,P]=o.useState(null),D=ee(s,I=>C(I)),[y,_]=o.useState(null),[A,L]=o.useState(null),O=Je(r),[K,G]=o.useState(!1),X=o.useRef(!1);o.useEffect(()=>{if(f)return dr(f)},[f]),lr();const B=o.useCallback(I=>{const[W,...te]=O().map(z=>z.ref.current),[V]=te.slice(-1),$=document.activeElement;for(const z of I)if(z===$||(z==null||z.scrollIntoView({block:"nearest"}),z===W&&k&&(k.scrollTop=0),z===V&&k&&(k.scrollTop=k.scrollHeight),z==null||z.focus(),document.activeElement!==$))return},[O,k]),m=o.useCallback(()=>B([y,f]),[B,y,f]);o.useEffect(()=>{K&&m()},[K,m]);const{onOpenChange:T,triggerPointerDownPosRef:M}=v;o.useEffect(()=>{if(f){let I={x:0,y:0};const W=V=>{var $,z;I={x:Math.abs(Math.round(V.pageX)-((($=M.current)==null?void 0:$.x)??0)),y:Math.abs(Math.round(V.pageY)-(((z=M.current)==null?void 0:z.y)??0))}},te=V=>{I.x<=10&&I.y<=10?V.preventDefault():f.contains(V.target)||T(!1),document.removeEventListener("pointermove",W),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",te,{capture:!0})}}},[f,T,M]),o.useEffect(()=>{const I=()=>T(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[T]);const[Z,ne]=Wr(I=>{const W=O().filter($=>!$.disabled),te=W.find($=>$.ref.current===document.activeElement),V=Hr(W,I,te);V&&setTimeout(()=>V.ref.current.focus())}),ce=o.useCallback((I,W,te)=>{const V=!X.current&&!te;(v.value!==void 0&&v.value===W||V)&&(_(I),V&&(X.current=!0))},[v.value]),rt=o.useCallback(()=>f==null?void 0:f.focus(),[f]),Ne=o.useCallback((I,W,te)=>{const V=!X.current&&!te;(v.value!==void 0&&v.value===W||V)&&L(I)},[v.value]),Fe=a==="popper"?yt:Er,Pe=Fe===yt?{side:i,sideOffset:u,align:p,alignOffset:b,arrowPadding:h,collisionBoundary:g,collisionPadding:N,sticky:S,hideWhenDetached:d,avoidCollisions:x}:{};return e.jsx(_r,{scope:r,content:f,viewport:k,onViewportChange:P,itemRefCallback:ce,selectedItem:y,onItemLeave:rt,itemTextRefCallback:Ne,focusSelectedItem:m,selectedItemText:A,position:a,isPositioned:K,searchRef:Z,children:e.jsx(Et,{as:sa,allowPinchZoom:!0,children:e.jsx(kt,{asChild:!0,trapped:v.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:H(n,I=>{var W;(W=v.trigger)==null||W.focus({preventScroll:!0}),I.preventDefault()}),children:e.jsx(Zt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:e.jsx(Fe,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:I=>I.preventDefault(),...j,...Pe,onPlaced:()=>G(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:H(j.onKeyDown,I=>{const W=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!W&&I.key.length===1&&ne(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let V=O().filter($=>!$.disabled).map($=>$.ref.current);if(["ArrowUp","End"].includes(I.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const $=I.target,z=V.indexOf($);V=V.slice(z+1)}setTimeout(()=>B(V)),I.preventDefault()}})})})})})})});kr.displayName=ra;var na="SelectItemAlignedPosition",Er=o.forwardRef((t,s)=>{const{__scopeSelect:r,onPlaced:a,...n}=t,c=pe(je,r),l=xe(je,r),[i,u]=o.useState(null),[p,b]=o.useState(null),h=ee(s,D=>b(D)),g=Je(r),N=o.useRef(!1),S=o.useRef(!0),{viewport:d,selectedItem:x,selectedItemText:j,focusSelectedItem:v}=l,f=o.useCallback(()=>{if(c.trigger&&c.valueNode&&i&&p&&d&&x&&j){const D=c.trigger.getBoundingClientRect(),y=p.getBoundingClientRect(),_=c.valueNode.getBoundingClientRect(),A=j.getBoundingClientRect();if(c.dir!=="rtl"){const $=A.left-y.left,z=_.left-$,ge=D.left-z,ve=D.width+ge,st=Math.max(ve,y.width),nt=window.innerWidth-re,at=Ot(z,[re,Math.max(re,nt-st)]);i.style.minWidth=ve+"px",i.style.left=at+"px"}else{const $=y.right-A.right,z=window.innerWidth-_.right-$,ge=window.innerWidth-D.right-z,ve=D.width+ge,st=Math.max(ve,y.width),nt=window.innerWidth-re,at=Ot(z,[re,Math.max(re,nt-st)]);i.style.minWidth=ve+"px",i.style.right=at+"px"}const L=g(),O=window.innerHeight-re*2,K=d.scrollHeight,G=window.getComputedStyle(p),X=parseInt(G.borderTopWidth,10),B=parseInt(G.paddingTop,10),m=parseInt(G.borderBottomWidth,10),T=parseInt(G.paddingBottom,10),M=X+B+K+T+m,Z=Math.min(x.offsetHeight*5,M),ne=window.getComputedStyle(d),ce=parseInt(ne.paddingTop,10),rt=parseInt(ne.paddingBottom,10),Ne=D.top+D.height/2-re,Fe=O-Ne,Pe=x.offsetHeight/2,I=x.offsetTop+Pe,W=X+B+I,te=M-W;if(W<=Ne){const $=L.length>0&&x===L[L.length-1].ref.current;i.style.bottom="0px";const z=p.clientHeight-d.offsetTop-d.offsetHeight,ge=Math.max(Fe,Pe+($?rt:0)+z+m),ve=W+ge;i.style.height=ve+"px"}else{const $=L.length>0&&x===L[0].ref.current;i.style.top="0px";const ge=Math.max(Ne,X+d.offsetTop+($?ce:0)+Pe)+te;i.style.height=ge+"px",d.scrollTop=W-Ne+d.offsetTop}i.style.margin=`${re}px 0`,i.style.minHeight=Z+"px",i.style.maxHeight=O+"px",a==null||a(),requestAnimationFrame(()=>N.current=!0)}},[g,c.trigger,c.valueNode,i,p,d,x,j,c.dir,a]);ue(()=>f(),[f]);const[C,k]=o.useState();ue(()=>{p&&k(window.getComputedStyle(p).zIndex)},[p]);const P=o.useCallback(D=>{D&&S.current===!0&&(f(),v==null||v(),S.current=!1)},[f,v]);return e.jsx(oa,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:N,onScrollButtonChange:P,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:e.jsx(q.div,{...n,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Er.displayName=na;var aa="SelectPopperPosition",yt=o.forwardRef((t,s)=>{const{__scopeSelect:r,align:a="start",collisionPadding:n=re,...c}=t,l=et(r);return e.jsx(ws,{...l,...c,ref:s,align:a,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});yt.displayName=aa;var[oa,Rt]=Ie(je,{}),jt="SelectViewport",Rr=o.forwardRef((t,s)=>{const{__scopeSelect:r,nonce:a,...n}=t,c=xe(jt,r),l=Rt(jt,r),i=ee(s,c.onViewportChange),u=o.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),e.jsx(Qe.Slot,{scope:r,children:e.jsx(q.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:H(n.onScroll,p=>{const b=p.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&h){const N=Math.abs(u.current-b.scrollTop);if(N>0){const S=window.innerHeight-re*2,d=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),j=Math.max(d,x);if(j<S){const v=j+N,f=Math.min(S,v),C=v-f;h.style.height=f+"px",h.style.bottom==="0px"&&(b.scrollTop=C>0?C:0,h.style.justifyContent="flex-end")}}}u.current=b.scrollTop})})})]})});Rr.displayName=jt;var Tr="SelectGroup",[la,ia]=Ie(Tr),ca=o.forwardRef((t,s)=>{const{__scopeSelect:r,...a}=t,n=ke();return e.jsx(la,{scope:r,id:n,children:e.jsx(q.div,{role:"group","aria-labelledby":n,...a,ref:s})})});ca.displayName=Tr;var Ir="SelectLabel",Pr=o.forwardRef((t,s)=>{const{__scopeSelect:r,...a}=t,n=ia(Ir,r);return e.jsx(q.div,{id:n.id,...a,ref:s})});Pr.displayName=Ir;var qe="SelectItem",[da,Dr]=Ie(qe),Ar=o.forwardRef((t,s)=>{const{__scopeSelect:r,value:a,disabled:n=!1,textValue:c,...l}=t,i=pe(qe,r),u=xe(qe,r),p=i.value===a,[b,h]=o.useState(c??""),[g,N]=o.useState(!1),S=ee(s,v=>{var f;return(f=u.itemRefCallback)==null?void 0:f.call(u,v,a,n)}),d=ke(),x=o.useRef("touch"),j=()=>{n||(i.onValueChange(a),i.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(da,{scope:r,value:a,disabled:n,textId:d,isSelected:p,onItemTextChange:o.useCallback(v=>{h(f=>f||((v==null?void 0:v.textContent)??"").trim())},[]),children:e.jsx(Qe.ItemSlot,{scope:r,value:a,disabled:n,textValue:b,children:e.jsx(q.div,{role:"option","aria-labelledby":d,"data-highlighted":g?"":void 0,"aria-selected":p&&g,"data-state":p?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...l,ref:S,onFocus:H(l.onFocus,()=>N(!0)),onBlur:H(l.onBlur,()=>N(!1)),onClick:H(l.onClick,()=>{x.current!=="mouse"&&j()}),onPointerUp:H(l.onPointerUp,()=>{x.current==="mouse"&&j()}),onPointerDown:H(l.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:H(l.onPointerMove,v=>{var f;x.current=v.pointerType,n?(f=u.onItemLeave)==null||f.call(u):x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(l.onPointerLeave,v=>{var f;v.currentTarget===document.activeElement&&((f=u.onItemLeave)==null||f.call(u))}),onKeyDown:H(l.onKeyDown,v=>{var C;((C=u.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(Yn.includes(v.key)&&j(),v.key===" "&&v.preventDefault())})})})})});Ar.displayName=qe;var Ae="SelectItemText",Or=o.forwardRef((t,s)=>{const{__scopeSelect:r,className:a,style:n,...c}=t,l=pe(Ae,r),i=xe(Ae,r),u=Dr(Ae,r),p=Jn(Ae,r),[b,h]=o.useState(null),g=ee(s,j=>h(j),u.onItemTextChange,j=>{var v;return(v=i.itemTextRefCallback)==null?void 0:v.call(i,j,u.value,u.disabled)}),N=b==null?void 0:b.textContent,S=o.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:N},u.value),[u.disabled,u.value,N]),{onNativeOptionAdd:d,onNativeOptionRemove:x}=p;return ue(()=>(d(S),()=>x(S)),[d,x,S]),e.jsxs(e.Fragment,{children:[e.jsx(q.span,{id:u.textId,...c,ref:g}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Xt.createPortal(c.children,l.valueNode):null]})});Or.displayName=Ae;var Mr="SelectItemIndicator",Lr=o.forwardRef((t,s)=>{const{__scopeSelect:r,...a}=t;return Dr(Mr,r).isSelected?e.jsx(q.span,{"aria-hidden":!0,...a,ref:s}):null});Lr.displayName=Mr;var bt="SelectScrollUpButton",Br=o.forwardRef((t,s)=>{const r=xe(bt,t.__scopeSelect),a=Rt(bt,t.__scopeSelect),[n,c]=o.useState(!1),l=ee(s,a.onScrollButtonChange);return ue(()=>{if(r.viewport&&r.isPositioned){let i=function(){const p=u.scrollTop>0;c(p)};const u=r.viewport;return i(),u.addEventListener("scroll",i),()=>u.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),n?e.jsx($r,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:u}=r;i&&u&&(i.scrollTop=i.scrollTop-u.offsetHeight)}}):null});Br.displayName=bt;var Nt="SelectScrollDownButton",Fr=o.forwardRef((t,s)=>{const r=xe(Nt,t.__scopeSelect),a=Rt(Nt,t.__scopeSelect),[n,c]=o.useState(!1),l=ee(s,a.onScrollButtonChange);return ue(()=>{if(r.viewport&&r.isPositioned){let i=function(){const p=u.scrollHeight-u.clientHeight,b=Math.ceil(u.scrollTop)<p;c(b)};const u=r.viewport;return i(),u.addEventListener("scroll",i),()=>u.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),n?e.jsx($r,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:u}=r;i&&u&&(i.scrollTop=i.scrollTop+u.offsetHeight)}}):null});Fr.displayName=Nt;var $r=o.forwardRef((t,s)=>{const{__scopeSelect:r,onAutoScroll:a,...n}=t,c=xe("SelectScrollButton",r),l=o.useRef(null),i=Je(r),u=o.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return o.useEffect(()=>()=>u(),[u]),ue(()=>{var b;const p=i().find(h=>h.ref.current===document.activeElement);(b=p==null?void 0:p.ref.current)==null||b.scrollIntoView({block:"nearest"})},[i]),e.jsx(q.div,{"aria-hidden":!0,...n,ref:s,style:{flexShrink:0,...n.style},onPointerDown:H(n.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(a,50))}),onPointerMove:H(n.onPointerMove,()=>{var p;(p=c.onItemLeave)==null||p.call(c),l.current===null&&(l.current=window.setInterval(a,50))}),onPointerLeave:H(n.onPointerLeave,()=>{u()})})}),ua="SelectSeparator",zr=o.forwardRef((t,s)=>{const{__scopeSelect:r,...a}=t;return e.jsx(q.div,{"aria-hidden":!0,...a,ref:s})});zr.displayName=ua;var wt="SelectArrow",ma=o.forwardRef((t,s)=>{const{__scopeSelect:r,...a}=t,n=et(r),c=pe(wt,r),l=xe(wt,r);return c.open&&l.position==="popper"?e.jsx(Ss,{...n,...a,ref:s}):null});ma.displayName=wt;var ha="SelectBubbleInput",Ur=o.forwardRef(({__scopeSelect:t,value:s,...r},a)=>{const n=o.useRef(null),c=ee(a,n),l=Ms(s);return o.useEffect(()=>{const i=n.current;if(!i)return;const u=window.HTMLSelectElement.prototype,b=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==s&&b){const h=new Event("change",{bubbles:!0});b.call(i,s),i.dispatchEvent(h)}},[l,s]),e.jsx(q.select,{...r,style:{...Cs,...r.style},ref:c,defaultValue:s})});Ur.displayName=ha;function Vr(t){return t===""||t===void 0}function Wr(t){const s=pt(t),r=o.useRef(""),a=o.useRef(0),n=o.useCallback(l=>{const i=r.current+l;s(i),function u(p){r.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>u(""),1e3))}(i)},[s]),c=o.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,n,c]}function Hr(t,s,r){const n=s.length>1&&Array.from(s).every(p=>p===s[0])?s[0]:s,c=r?t.indexOf(r):-1;let l=fa(t,Math.max(c,0));n.length===1&&(l=l.filter(p=>p!==r));const u=l.find(p=>p.textValue.toLowerCase().startsWith(n.toLowerCase()));return u!==r?u:void 0}function fa(t,s){return t.map((r,a)=>t[(s+a)%t.length])}var pa=vr,Kr=jr,xa=Nr,ga=wr,va=Sr,qr=Cr,ya=Rr,Gr=Pr,Yr=Ar,ja=Or,ba=Lr,Xr=Br,Zr=Fr,Qr=zr;const Le=pa,Be=xa,Re=o.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Kr,{ref:a,className:J("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
122ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[s,e.jsx(ga,{asChild:!0,children:e.jsx(Jt,{className:"h-4 w-4 opacity-50"})})]}));Re.displayName=Kr.displayName;const Jr=o.forwardRef(({className:t,...s},r)=>e.jsx(Xr,{ref:r,className:J("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(ks,{className:"h-4 w-4"})}));Jr.displayName=Xr.displayName;const es=o.forwardRef(({className:t,...s},r)=>e.jsx(Zr,{ref:r,className:J("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Jt,{className:"h-4 w-4"})}));es.displayName=Zr.displayName;const Te=o.forwardRef(({className:t,children:s,position:r="popper",...a},n)=>e.jsx(va,{children:e.jsxs(qr,{ref:n,className:J("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...a,children:[e.jsx(Jr,{}),e.jsx(ya,{className:J("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(es,{})]})}));Te.displayName=qr.displayName;const Na=o.forwardRef(({className:t,...s},r)=>e.jsx(Gr,{ref:r,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...s}));Na.displayName=Gr.displayName;const fe=o.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Yr,{ref:a,className:J("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ba,{children:e.jsx(Us,{className:"h-4 w-4"})})}),e.jsx(ja,{children:s})]}));fe.displayName=Yr.displayName;const wa=o.forwardRef(({className:t,...s},r)=>e.jsx(Qr,{ref:r,className:J("-mx-1 my-1 h-px bg-muted",t),...s}));wa.displayName=Qr.displayName;var tt="Dialog",[ts,no]=Gt(tt),[Sa,se]=ts(tt),rs=t=>{const{__scopeDialog:s,children:r,open:a,defaultOpen:n,onOpenChange:c,modal:l=!0}=t,i=o.useRef(null),u=o.useRef(null),[p,b]=gt({prop:a,defaultProp:n??!1,onChange:c,caller:tt});return e.jsx(Sa,{scope:s,triggerRef:i,contentRef:u,contentId:ke(),titleId:ke(),descriptionId:ke(),open:p,onOpenChange:b,onOpenToggle:o.useCallback(()=>b(h=>!h),[b]),modal:l,children:r})};rs.displayName=tt;var ss="DialogTrigger",Ca=o.forwardRef((t,s)=>{const{__scopeDialog:r,...a}=t,n=se(ss,r),c=ee(s,n.triggerRef);return e.jsx(q.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Pt(n.open),...a,ref:c,onClick:H(t.onClick,n.onOpenToggle)})});Ca.displayName=ss;var Tt="DialogPortal",[_a,ns]=ts(Tt,{forceMount:void 0}),as=t=>{const{__scopeDialog:s,forceMount:r,children:a,container:n}=t,c=se(Tt,s);return e.jsx(_a,{scope:s,forceMount:r,children:o.Children.map(a,l=>e.jsx(St,{present:r||c.open,children:e.jsx(Ct,{asChild:!0,container:n,children:l})}))})};as.displayName=Tt;var Ge="DialogOverlay",os=o.forwardRef((t,s)=>{const r=ns(Ge,t.__scopeDialog),{forceMount:a=r.forceMount,...n}=t,c=se(Ge,t.__scopeDialog);return c.modal?e.jsx(St,{present:a||c.open,children:e.jsx(Ea,{...n,ref:s})}):null});os.displayName=Ge;var ka=Qt("DialogOverlay.RemoveScroll"),Ea=o.forwardRef((t,s)=>{const{__scopeDialog:r,...a}=t,n=se(Ge,r);return e.jsx(Et,{as:ka,allowPinchZoom:!0,shards:[n.contentRef],children:e.jsx(q.div,{"data-state":Pt(n.open),...a,ref:s,style:{pointerEvents:"auto",...a.style}})})}),be="DialogContent",ls=o.forwardRef((t,s)=>{const r=ns(be,t.__scopeDialog),{forceMount:a=r.forceMount,...n}=t,c=se(be,t.__scopeDialog);return e.jsx(St,{present:a||c.open,children:c.modal?e.jsx(Ra,{...n,ref:s}):e.jsx(Ta,{...n,ref:s})})});ls.displayName=be;var Ra=o.forwardRef((t,s)=>{const r=se(be,t.__scopeDialog),a=o.useRef(null),n=ee(s,r.contentRef,a);return o.useEffect(()=>{const c=a.current;if(c)return dr(c)},[]),e.jsx(is,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(t.onCloseAutoFocus,c=>{var l;c.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:H(t.onPointerDownOutside,c=>{const l=c.detail.originalEvent,i=l.button===0&&l.ctrlKey===!0;(l.button===2||i)&&c.preventDefault()}),onFocusOutside:H(t.onFocusOutside,c=>c.preventDefault())})}),Ta=o.forwardRef((t,s)=>{const r=se(be,t.__scopeDialog),a=o.useRef(!1),n=o.useRef(!1);return e.jsx(is,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var l,i;(l=t.onCloseAutoFocus)==null||l.call(t,c),c.defaultPrevented||(a.current||(i=r.triggerRef.current)==null||i.focus(),c.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:c=>{var u,p;(u=t.onInteractOutside)==null||u.call(t,c),c.defaultPrevented||(a.current=!0,
vendor: 3,221 bytes, lines 122-126
122c.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=c.target;((p=r.triggerRef.current)==null?void 0:p.contains(l))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&n.current&&c.preventDefault()}})}),is=o.forwardRef((t,s)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:c,...l}=t,i=se(be,r),u=o.useRef(null),p=ee(s,u);return lr(),e.jsxs(e.Fragment,{children:[e.jsx(kt,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:c,children:e.jsx(Zt,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Pt(i.open),...l,ref:p,onDismiss:()=>i.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Ia,{titleId:i.titleId}),e.jsx(Da,{contentRef:u,descriptionId:i.descriptionId})]})]})}),It="DialogTitle",cs=o.forwardRef((t,s)=>{const{__scopeDialog:r,...a}=t,n=se(It,r);return e.jsx(q.h2,{id:n.titleId,...a,ref:s})});cs.displayName=It;var ds="DialogDescription",us=o.forwardRef((t,s)=>{const{__scopeDialog:r,...a}=t,n=se(ds,r);return e.jsx(q.p,{id:n.descriptionId,...a,ref:s})});us.displayName=ds;var ms="DialogClose",hs=o.forwardRef((t,s)=>{const{__scopeDialog:r,...a}=t,n=se(ms,r);return e.jsx(q.button,{type:"button",...a,ref:s,onClick:H(t.onClick,()=>n.onOpenChange(!1))})});hs.displayName=ms;function Pt(t){return t?"open":"closed"}var fs="DialogTitleWarning",[ao,ps]=Es(fs,{contentName:be,titleName:It,docsSlug:"dialog"}),Ia=({titleId:t})=>{const s=ps(fs),r=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users. 123 124If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component. 125 126For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return o.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},Pa="DialogDescriptionWarning",Da=({contentRef:t,descriptionId:s})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ps(Pa).contentName}}.`;return o.useEffect(()=>{var c;const n=(c=t.current)==null?void 0:c.getAttribute("aria-describedby");s&&n&&(document.getElementById(s)||console.warn(a))},[a,t,s]),null},Aa=rs,Oa=as,xs=os,gs=ls,vs=cs,ys=us,Ma=hs;const de=Aa,La=Oa,js=o.forwardRef(({className:t,...s},r)=>e.jsx(xs,{ref:r,className:J("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s}));js.displayName=xs.displayName;const oe=o.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(La,{children:[e.jsx(js,{}),e.jsxs(gs,{ref:a,className:J("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[s,e.jsxs(Ma,{className:"absolute right-4 top-4 roun
126ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(er,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));oe.displayName=gs.displayName;const le=({className:t,...s})=>e.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});le.displayName="DialogHeader";const ie=o.forwardRef(({className:t,...s},r)=>e.jsx(vs,{ref:r,className:J("text-lg font-semibold leading-none tracking-tight",t),...s}));ie.displayName=vs.displayName;const Ba=o.forwardRef(({className:t,...s},r)=>e.jsx(ys,{ref:r,className:J("text-sm text-muted-foreground",t),...s}));Ba.displayName=ys.displayName;const _e={super_admin:"Ù
Ø¯ÙØ± عاÙ
",admin:"Ù
سؤÙÙ",moderator:"Ù
شرÙ",booking_manager:"Ù
Ø¯ÙØ± ØØ¬Ùزات",pricing_manager:"Ù
Ø¯ÙØ± أسعار",viewer:"Ù
Ø´Ø§ÙØ¯",user:"Ù
ستخدÙ
"},ht={super_admin:"bg-purple-100 text-purple-800",admin:"bg-blue-100 text-blue-800",moderator:"bg-cyan-100 text-cyan-800",booking_manager:"bg-green-100 text-green-800",pricing_manager:"bg-orange-100 text-orange-800",viewer:"bg-gray-100 text-gray-800",user:"bg-gray-100 text-gray-500"},We={pending:"ÙÙØ¯ Ø§ÙØ§Ùتظار",confirmed:"Ù
Ø¤ÙØ¯",rejected:"Ù
رÙÙØ¶",cancelled:"Ù
ÙØºÙ",completed:"Ù
ÙØªÙ
Ù"},Kt={pending:"bg-yellow-100 text-yellow-800",confirmed:"bg-green-100 text-green-800",rejected:"bg-red-100 text-red-800",cancelled:"bg-gray-100 text-gray-800",completed:"bg-blue-100 text-blue-800"},ft={unpaid:"ÙÙ
ÙØ¯Ùع",receipt_uploaded:"Ø¨Ø§ÙØªØ¸Ø§Ø± Ø§ÙØªØÙÙ",verified:"تÙ
Ø§ÙØªØÙÙ",rejected:"Ø¥ÙØµØ§Ù Ù
رÙÙØ¶"},qt={unpaid:"bg-gray-100 text-gray-800",receipt_uploaded:"bg-orange-100 text-orange-800",verified:"bg-green-100 text-green-800",rejected:"bg-red-100 text-red-800"},Dt={large:"ÙØ¨Ùر",small:"ØµØºÙØ±"},Fa={weekday:"Ø£ÙØ§Ù
Ø§ÙØ£Ø³Ø¨Ùع",weekend:"ÙÙØ§ÙØ© Ø§ÙØ£Ø³Ø¨Ùع"};function $a({onLoggedIn:t}){const[s,r]=o.useState(""),[a,n]=o.useState(""),[c,l]=o.useState(!1),[i,u]=o.useState("login"),[p,b]=o.useState(""),h=async N=>{N.preventDefault(),l(!0);const{error:S}=await De.auth.signInWithPassword({email:s,password:a});S?w.error("Ø¨ÙØ§Ùات Ø§ÙØ¯Ø®ÙÙ ØºÙØ± صØÙØØ©"):t(),l(!1)},g=async N=>{if(N.preventDefault(),a.length<6){w.error("ÙÙÙ
Ø© اÙÙ
Ø±ÙØ± ÙØ¬Ø¨ أ٠تÙÙÙ 6 Ø£ØØ±Ù عÙÙ Ø§ÙØ£ÙÙ");return}l(!0);try{await Ps(s,a,p),w.success("تÙ
Ø¥ÙØ´Ø§Ø¡ ØØ³Ø§Ø¨ Ø§ÙØ£Ø¯Ù
Ù Ø¨ÙØ¬Ø§Ø! سج٠دخÙÙÙ Ø§ÙØ¢Ù"),u("login")}catch(S){w.error(S instanceof Error?S.message:"ÙØ´Ù Ø¥ÙØ´Ø§Ø¡ Ø§ÙØØ³Ø§Ø¨")}l(!1)};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",dir:"rtl",children:e.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-lg border border-border w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx(Gs,{className:"w-12 h-12 text-primary mx-auto mb-3"}),e.jsx("h1",{className:"text-2xl font-black text-foreground",children:"ÙÙØØ© Ø§ÙØªØÙÙ
"}),e.jsx("p",{className:"text-muted-foreground",children:i==="login"?"سج٠دخÙÙÙ ÙÙÙ
تابعة":"Ø¥ÙØ´Ø§Ø¡ ØØ³Ø§Ø¨ أدÙ
Ù Ø¬Ø¯ÙØ¯"})]}),i==="login"?e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsx(F,{type:"email",placeholder:"Ø§ÙØ¨Ø±Ùد Ø§ÙØ¥ÙÙØªØ±ÙÙÙ",value:s,onChange:N=>r(N.target.value),dir:"ltr",required:!0}),e.jsx(F,{type:"password",placeholder:"ÙÙÙ
Ø© اÙÙ
Ø±ÙØ±",value:a,onChange:N=>n(N.target.value),dir:"ltr",required:!0}),e.jsx(E,{type:"submit",className:"w-full",disabled:c,children:c?e.jsx(Y,{className:"w-4 h-4 animate-spin"}):"تسجÙÙ Ø§ÙØ¯Ø®ÙÙ"}),e.jsx("button",{type:"button",className:"w-full text-sm text-muted-foreground hover:text-primary",onClick:()=>u("setup"),children:"Ø¥ÙØ´Ø§Ø¡ ØØ³Ø§Ø¨ أدÙ
Ù Ø¬Ø¯ÙØ¯"})]}):e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsx(F,{type:"email",placeholder:"Ø§ÙØ¨Ø±Ùد Ø§ÙØ¥ÙÙØªØ±ÙÙÙ",value:s,onChange:N=>r(N.target.value),dir:"ltr",required:!0}),e.jsx(F,{type:"password",placeholder:"ÙÙÙ
Ø© اÙÙ
Ø±ÙØ± (6 Ø£ØØ±Ù عÙÙ Ø§ÙØ£ÙÙ)",value:a,onChange:N=>n(N.target.value),dir:"ltr",required:!0,minLength:6}),e.jsx(F,{type:"password",placeholder:"Ù
ÙØªØ§Ø Ø§ÙØ¥Ø¹Ø¯Ø§Ø¯",value:p,onChange:N=>b(N.target.value),dir:"ltr",required:!0}
126),e.jsx(E,{type:"submit",className:"w-full",disabled:c,children:c?e.jsx(Y,{className:"w-4 h-4 animate-spin"}):"Ø¥ÙØ´Ø§Ø¡ Ø§ÙØØ³Ø§Ø¨"}),e.jsx("button",{type:"button",className:"w-full text-sm text-muted-foreground hover:text-primary",onClick:()=>u("login"),children:"Ø§ÙØ¹Ùدة ÙØªØ³Ø¬ÙÙ Ø§ÙØ¯Ø®ÙÙ"})]})]})})}function za(){const[t,s]=o.useState(null),[r,a]=o.useState(!0);if(o.useEffect(()=>{R("dashboard-stats").then(s).catch(()=>w.error("ÙØ´Ù تØÙ
ÙÙ Ø§ÙØ¥ØØµØ§Ø¦Ùات")).finally(()=>a(!1))},[]),r)return e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})});if(!t)return e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"ÙØ§ ØªÙØ¬Ø¯ Ø¨ÙØ§Ùات"});const n=[{label:"إجÙ
اÙÙ Ø§ÙØØ¬ÙØ²Ø§Øª",value:t.total_bookings,icon:Ye,color:"text-blue-500"},{label:"ÙÙØ¯ Ø§ÙØ§Ùتظار",value:t.pending,icon:Rs,color:"text-yellow-500"},{label:"Ù
Ø¤ÙØ¯Ø©",value:t.confirmed,icon:Oe,color:"text-green-500"},{label:"Ø§ÙØ¥Ùرادات",value:`${t.total_revenue.toLocaleString()} ر.س`,icon:_t,color:"text-primary"}];return e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:n.map(c=>e.jsxs("div",{className:"bg-card rounded-xl p-5 border border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(c.icon,{className:`w-5 h-5 ${c.color}`}),e.jsx("span",{className:"text-sm text-muted-foreground",children:c.label})]}),e.jsx("p",{className:"text-2xl font-bold text-foreground",children:c.value})]},c.label))})}function Ua(){var D;const[t,s]=o.useState([]),[r,a]=o.useState(!0),[n,c]=o.useState(null),[l,i]=o.useState("all"),[u,p]=o.useState(""),[b,h]=o.use
126State(null),[g,N]=o.useState(!1),[S,d]=o.useState(""),x=o.useCallback(()=>{a(!0),R("list-bookings").then(y=>s(y.data||[])).catch(()=>w.error("ÙØ´Ù Ø§ÙØªØÙ ÙÙ")).finally(()=>a(!1))},[]);o.useEffect(()=>{x()},[x]);const j=t.filter(y=>{var _,A,L;if(l!=="all"&&y.booking_status!==l)return!1;if(u.trim()){const O=u.trim().toLowerCase();return((_=y.booking_reference)==null?void 0:_.toLowerCase().includes(O))||((A=y.customer_name)==null?void 0:A.toLowerCase().includes(O))||((L=y.customer_phone)==null?void 0:L.includes(O))}return!0}),v=()=>{Ds(()=>import("./exceljs.min-DAfZ43pa.js").then(y=>y.e),__vite__mapDeps([0,1,2])).then(async({default:y})=>{const _=j.map(m=>{var T,M;return{"رÙ٠اÙ٠رجع":m.booking_reference,Ø§ÙØ¹Ù ÙÙ:m.customer_name,اÙÙØ§ØªÙ:m.customer_phone,Ø§ÙØ¨Ø±Ùد:m.customer_email||"",Ø§ÙØ´Ø§ÙÙÙ:((T=m.chalets)==null?void 0:T.name)||"",Ø§ÙØ¯Ø®ÙÙ:m.check_in_date,Ø§ÙØ®Ø±Ùج:m.check_out_date,اÙÙÙØ§ÙÙ:m.nights_count,"اÙÙ Ø¨ÙØº Ø§ÙØ¥Ø¬Ù اÙÙ":Number(m.final_price),"Ø®ÙØ§Ø± Ø§ÙØ¯Ùع":m.payment_option==="deposit"?"عربÙÙ":"ÙØ§Ù Ù","اÙÙ Ø¨ÙØº اÙ٠دÙÙØ¹":Number(m.paid_amount),"اÙÙ Ø¨ÙØº اÙ٠تبÙÙ":Number(m.remaining_amount),"ØØ§ÙØ© Ø§ÙØØ¬Ø²":We[m.booking_status]||m.booking_status,"ØØ§ÙØ© Ø§ÙØ¯Ùع":ft[m.payment_status]||m.payment_status,"ØªØ§Ø±ÙØ® Ø§ÙØ¥Ùشاء":((M=m.created_at)==null?void 0:M.split("T")[0])||""}}),A=new y.Workbook,L=A.addWorksheet("Ø§ÙØØ¬ÙØ²Ø§Øª",{views:[{rightToLeft:!0}]}),O=Object.keys(_[0]||{});L.columns=O.map(m=>({header:m,key:m,width:18})),_.forEach(m=>L.addRow(m));const K=await A.xlsx.writeBuffer(),G=new Blob([K],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),X=URL.createObjectURL(G),B=document.createElement("a");B.href=X,B.download=`ØØ¬Ùزات-${new Date().toISOString().split("T")[0]}.xlsx`,B.click(),URL.revokeObjectURL(X),w.success("ØªÙ ØªØµØ¯ÙØ± اÙÙ ÙÙ")})},f=async y=>{N(!0),h(null);try{const{url:_}=await R("get-receipt-url",{path:y});h(_)}catch{w.error("ÙØ´Ù تØÙ ÙÙ Ø§ÙØ¥ÙصاÙ")}finally{N(!1)}},C=y=>{c(y),d(""),h(null),y.receipt_file_url&&f(y.receipt_file_url)},k=(y,_,A)=>{var M;const L=y.customer_phone.replace(/^0/,"966"),O=((M=y.chalets)==null?void 0:M.name)||"Ø§ÙØ´Ø§ÙÙÙ",K=Number(y.paid_amount||y.final_price),G=Number(y.remaining_amount||0),B=(y.payment_option||"full")==="deposit"?`ð° Ø§ÙÙ Ø¨ÙØº اÙ٠دÙÙØ¹: ${K.toLocaleString()} ر.س (عربÙÙ) 127ð³ Ø§ÙÙ Ø¨ÙØº اÙ٠تبÙÙ: ${G.toLocaleString()} ر.س 128â ï¸ ÙØ±Ø¬Ù سداد اÙ٠تبÙÙ ÙØ¨Ù Ø§ÙØ¯Ø®ÙÙ`:`ð° Ø§ÙÙ Ø¨ÙØº: ${Number(y.final_price).toLocaleString()} ر.س`,T={confirm:`â ØªØ£ÙÙØ¯ Ø§ÙØØ¬Ø² 129 130Ø§ÙØ³Ùا٠عÙÙÙÙ ${y.customer_name} 131ت٠تأÙÙØ¯ ØØ¬Ø²ÙÙ Ø¨ÙØ¬Ø§Ø. 132 133ð Ø±ÙÙ Ø§ÙØØ¬Ø²: ${y.booking_reference} 134ð Ø§ÙØ´Ø§ÙÙÙ: ${O} 135ð Ø§ÙØ¯Ø®ÙÙ: ${y.check_in_date} 136ð Ø§ÙØ®Ø±Ùج: ${y.check_out_date} 137${B} 138 139ð ÙÙØª Ø§ÙØ¯Ø®ÙÙ: 5:00 ٠ساء٠140ð ÙÙØª Ø§ÙØ®Ø±Ùج: 1:00 Ø¸ÙØ±Ø§Ù 141 142ÙØªÙ ÙÙ ÙÙÙ Ø¥ÙØ§Ù Ø© Ø³Ø¹ÙØ¯Ø© ð´ 143شاÙÙÙØ§Øª ÙÙÙØ¯Ù رست`,reject:`â Ø§Ø¹ØªØ°Ø§Ø± Ø¹Ù Ø§ÙØØ¬Ø² 144 145Ø§ÙØ³Ùا٠عÙÙÙÙ ${y.customer_name} 146ÙØ¹ØªØ°Ø±Ø ØªÙ Ø±ÙØ¶ ØØ¬Ø²Ù٠رÙÙ ${y.booking_reference}. 147${A?`Ø§ÙØ³Ø¨Ø¨: ${A} 148`:""} 149ÙÙ ÙÙÙÙ Ø§ÙØªÙØ§ØµÙ Ù Ø¹ÙØ§ ÙØ£Ù Ø§Ø³ØªÙØ³Ø§Ø±. 150شاÙÙÙØ§Øª ÙÙÙØ¯Ù رست`,reminder:`ⰠتذÙÙØ± Ø¨Ø§ÙØ¯Ùع 151 152Ø§ÙØ³Ùا٠عÙÙÙÙ ${y.customer_name} 153ÙØ°ÙرÙ٠بتØÙÙÙ Ù Ø¨ÙØº Ø§ÙØØ¬Ø² رÙÙ ${y.booking_reference} 154${B} 155 156ÙØ±Ø¬Ù Ø±ÙØ¹ Ø¥ÙØµØ§Ù Ø§ÙØªØÙÙÙ ÙÙ Ø£ÙØ±Ø¨ ÙÙØª ÙØªØ£ÙÙØ¯ Ø§ÙØØ¬Ø². 157شاÙÙÙØ§Øª ÙÙÙØ¯Ù رست`,deposit_reminder:`ⰠتذÙÙØ± باÙÙ Ø¨ÙØº اÙ٠تبÙÙ 158 159Ø§ÙØ³Ùا٠عÙÙÙÙ ${y.customer_name} 160ÙØ°ÙرÙ٠بسداد اÙÙ Ø¨ÙØº اÙ٠تبÙÙ ÙØØ¬Ø²Ù٠رÙÙ ${y.booking_reference} 161 162ð Ø§ÙØ´Ø§ÙÙÙ: ${O} 163ð Ø§ÙØ¯Ø®ÙÙ: ${y.check_in_date} 164ð³ Ø§ÙÙ Ø¨ÙØº اÙ٠تبÙÙ: ${G.toLocaleString()} ر.س 165 166ÙØ±Ø¬Ù Ø§ÙØªØÙÙÙ ÙØ¨Ù Ù ÙØ¹Ø¯ Ø§ÙØ¯Ø®ÙÙ. 167شاÙÙÙØ§Øª ÙÙÙØ¯Ù رست`,welcome:`ð´ Ù Ø±ØØ¨Ø§Ù بÙÙ 168 169Ø§ÙØ³Ùا٠عÙÙÙÙ ${y.customer_name} 170ÙØ±ØØ¨ بÙÙ ÙÙ ${O} 171 172ð Ø±ÙÙ Ø§ÙØØ¬Ø²: ${y.booking_reference} 173ð ÙÙØª Ø§ÙØ¯Ø®ÙÙ: 5:00 ٠ساء٠174 175ÙØªÙ ÙÙ ÙÙÙ Ø¥ÙØ§Ù Ø© ٠٠تعة! 176شاÙÙÙØ§Øª ÙÙÙØ¯Ù رست`,thanks:`ð Ø´ÙØ±Ø§Ù ÙØ²ÙارتÙÙ 177 178Ø§ÙØ³Ùا٠عÙÙÙÙ ${y.customer_name} 179ÙØ´ÙرÙ٠عÙÙ Ø²ÙØ§Ø±ØªÙÙ ÙÙ ${O} 180ÙØªÙ Ù٠أ٠تÙÙÙ Ø§ÙØ¥Ùا٠ة ÙØ¯ ÙØ§Ùت إعجابÙÙ . 181 182ÙØ³Ø¹Ø¯Ùا خد٠تÙ٠٠رة أخرÙ! 183شاÙÙÙØ§Øª ÙÙÙØ¯Ù رست`,review:`â ÙÙØ¯Ùر رأÙÙÙ 184 185Ø§ÙØ³Ùا٠عÙÙÙÙ ${y.customer_name} 186ÙØªÙ Ù٠أ٠تÙÙÙ Ø¥ÙØ§Ù تÙÙ ÙÙ ${O} ÙØ¯ أعجبتÙÙ . 187 188ÙØ³Ø¹Ø¯Ùا تÙÙÙÙ Ù٠عÙÙ ÙÙÙ٠٠اب: 189https://maps.app.goo.gl/HsxC4Xb5o3A3LKEm9 190 191Ø´ÙØ±Ø§Ù ÙÙÙ ð 192شاÙÙÙØ§Øª ÙÙÙØ¯Ù رست`}[_];window.open(`https://wa.me/${encodeURIComponent(L)}?text=${encodeURIComponent(T)}`,"_blank")},P=async(y,_,A,L)=>{try{await R("update-booking-status",{id:y,booking_status:_,payment_status:A,admin_notes:L}),w.success("ØªÙ Ø§ÙØªØØ¯ÙØ«");const O=t.find(K=>K.id===y);O&&(_==="confirmed"||_==="rejected")&&k(O,_==="confirmed"?"confirm":"reject",L),x(),c(null)}catch{w.error("ÙØ´Ù Ø§ÙØªØØ¯ÙØ«")}};return r?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-2 mb-4 flex-wrap items-center",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(tr,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(F,{placeholder:"Ø¨ØØ« Ø¨Ø§ÙØ§Ø³Ù Ø Ø§ÙÙØ§ØªÙØ Ø±Ù٠اÙ٠رجع...",value:u,onChange:y=>p(y.target.value),className:"pr-9"})]}),e.jsxs(E,{variant:"outline",size:"sm",onClick:v,disabled:j.length===0,children:[e.jsx(Ws,{className:"w-4 h-4 ml-1"})," ØªØµØ¯ÙØ± Excel"]})]}),e.jsxs("div",{className:"flex gap-2 mb-4 flex-wrap",children:[["all","pending","confirmed","rejected","cancelled","completed"].map(y=>e.jsxs(E,{variant:l===y?"default":"outline",size:"sm",onClick:()=>i(y),children:[y==="all"?"اÙÙÙ":We[y]," ",y!=="all"&&`(${t.filter(_=>_.booking_status===y).length})`]},y)),e.jsxs("span",{className:"text-sm text-muted-foreground self-center mr-auto",children:[j.length," ÙØªÙجة"]})]}),j.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(Ye,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground font-bold",children:"ÙØ§ ØªÙØ¬Ø¯ ØØ¬Ùزات"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"جرب تغÙÙØ± اÙÙÙØªØ± Ø£Ù Ù ØµØ·ÙØ Ø§ÙØ¨ØØ«"})]}):e.jsx("div",{className:"space-y-3",children:j.map(y=>{var _;return e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border
192cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>C(y),children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-foreground",children:y.booking_reference}),e.jsxs("span",{className:"text-sm text-muted-foreground mr-2",children:["â ",y.customer_name]})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(U,{className:Kt[y.booking_status],children:We[y.booking_status]}),e.jsx(U,{className:qt[y.payment_status],children:ft[y.payment_status]})]})]}),e.jsxs("div",{className:"flex gap-4 mt-2 text-sm text-muted-foreground flex-wrap",children:[e.jsx("span",{children:((_=y.chalets)==null?void 0:_.name)||"شاÙÙÙ"}),e.jsxs("span",{children:[y.check_in_date," â ",y.check_out_date]}),e.jsxs("span",{className:"font-semibold text-foreground",children:[Number(y.final_price).toLocaleString()," ر.س"]}),y.payment_option==="deposit"&&e.jsx(U,{className:"bg-amber-100 text-amber-800",children:"عربÙÙ"})]})]},y.id)})}),e.jsx(de,{open:!!n,onOpenChange:()=>c(null),children:e.jsxs(oe,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",dir:"rtl",children:[e.jsx(le,{children:e.jsxs(ie,{children:["ØªÙØ§ØµÙÙ Ø§ÙØØ¬Ø² ",n==null?void 0:n.booking_reference]})}),n&&e.jsxs("div",{className:"space-y-4 text-sm",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2 bg-secondary/50 rounded-xl p-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Ø§ÙØ¹Ù
ÙÙ:"})," ",n.customer_name]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"اÙÙØ§ØªÙ:"})," ",e.jsx("a",{href:`tel:${n.customer_phone}`,className:"text-primary",children:n.customer_phone})]}),n.customer_email&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Ø§ÙØ¨Ø±Ùد:"})," ",n.customer_email]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Ø§ÙØ´Ø§ÙÙÙ:"})," ",(D=n.chalets)==null?void 0:D.name]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"اÙÙÙØ¹:"})," ",Dt[n.chalet_type_snapshot]]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Ø§ÙØ¯Ø®ÙÙ:"})," ",n.check_in_date]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Ø§ÙØ®Ø±Ùج:"})," ",n.check_out_date]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"اÙÙÙØ§ÙÙ:"})," ",n.nights_count]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"اÙÙ
Ø¨ÙØº Ø§ÙØ¥Ø¬Ù
اÙÙ:"})," ",e.jsxs("span",{className:"font-bold text-primary",children:[Number(n.final_price).toLocaleString()," ر.س"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Ø®ÙØ§Ø± Ø§ÙØ¯Ùع:"})," ",e.jsx("span",{className:"font-bold",children:n.payment_option==="deposit"?"عربÙÙ 200 ر.س":"Ø¯ÙØ¹ ÙØ§Ù
Ù"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"اÙÙ
Ø¨ÙØº اÙÙ
دÙÙØ¹:"})," ",e.jsxs("span",{className:"font-bold text-green-600",children:[Number(n.paid_amount||n.final_price).toLocaleString()," ر.س"]})]}),Number(n.remaining_amount||0)>0&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"اÙÙ
Ø¨ÙØº اÙÙ
تبÙÙ:"})," ",e.jsxs("span",{className:"font-bold text-destructive",children:[Number(n.remaining_amount).toLocaleString()," ر.س"]})]})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("span",{className:"text-muted-foreground",children:"ØØ§ÙØ© Ø§ÙØØ¬Ø²:"}),e.jsx(U,{className:Kt[n.booking_status],children:We[n.booking_status]}),e.jsx("span",{className:"text-muted-foreground mr-2",children:"Ø§ÙØ¯Ùع:"}),e.jsx(U,{className:qt[n.payment_status],children:ft[n.payment_status]})]}),e.jsxs("div",{className:"border border-border rounded-xl p-4",children:[e.jsxs("h3",{className:"font-bold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(As,{className:"w-4 h-4"})," Ø¥ÙØµØ§Ù Ø§ÙØ¯Ùع"]}),n.receipt_file_url?e.jsxs("div",{className:"space-y-3",children:[g?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(Y,{className:"w-6 h-6 animate-spin text-primary"})}):b?e.jsxs("div",{className:"space-y-2",children:[n.receipt_file_url.match(/\.(jpg|jpeg|png|webp)$/i)?e.jsx("img",{src:b,alt:"Ø¥ÙØµØ§Ù Ø§ÙØ¯Ùع",className:"w-full max-h-80 object-contain rounded-lg border border-border bg-muted"}):e.jsxs("div",{className:"bg-muted rounded-lg p-6 text-center",children:[e.jsx("p",{className:"text-muted-foreground mb-2",children:"Ù
ÙÙ PDF"}),e.jsxs(E,{variant:"outline",size:"sm",onClick:()=>window.open(b,"_blank"),children:[e.jsx(Hs,{className:"w-4 h-4 ml-1"})," ÙØªØ اÙÙ
ÙÙ"]})]}),e.jsx(E,{variant:"ghost",size:"sm",onClick:()=>window.open(b,"_blank"),children:"ÙØªØ ÙÙ ÙØ§Ùذة Ø¬Ø¯ÙØ¯Ø©"})]}):e.jsx("p",{className:"text-muted-foreground",children:"ÙØ´Ù تØÙ
ÙÙ Ø§ÙØ¥ÙصاÙ"}),n.payment_status==="receipt_uploaded"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border",children:[e.jsxs(E,{size:"sm",variant:"default",onClick:()=>P(n.id,void 0,"verified"),children:[e.jsx(Oe,{className:"w-4 h-4 ml-1"})," تأÙÙØ¯ Ø§ÙØ¥ÙصاÙ"]}),e.jsxs(E,{size:"sm",variant:"destructive",onClick:()=>
192{if(!S.trim()){w.error("ÙØ±Ø¬Ù ÙØªØ§Ø¨Ø© سبب Ø§ÙØ±Ùض");return}P(n.id,void 0,"rejected",S)},children:[e.jsx(Me,{className:"w-4 h-4 ml-1"})," Ø±ÙØ¶ Ø§ÙØ¥ÙصاÙ"]})]}),e.jsx(Xe,{placeholder:"سبب Ø±ÙØ¶ Ø§ÙØ¥Ùصا٠(Ù
Ø·ÙÙØ¨ Ø¹ÙØ¯ Ø§ÙØ±Ùض)...",value:S,onChange:y=>d(y.target.value),className:"mt-2"})]})]}):e.jsx("p",{className:"text-muted-foreground py-4 text-center",children:"ÙÙ
ÙØªÙ
Ø±ÙØ¹ Ø¥ÙØµØ§Ù"})]}),n.admin_notes&&e.jsxs("div",{className:"bg-muted rounded-xl p-3",children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"Ù
ÙØ§ØØ¸Ø§Øª Ø§ÙØ¥Ø¯Ø§Ø±Ø©:"}),e.jsx("p",{className:"text-foreground mt-1",children:n.admin_notes})]}),e.jsxs("div",{className:"flex gap-2 pt-2 flex-wrap border-t border-border",children:[n.booking_status==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(E,{size:"sm",onClick:()=>P(n.id,"confirmed","verified"),children:[e.jsx(Oe,{className:"w-4 h-4 ml-1"})," تأÙÙØ¯ Ø§ÙØØ¬Ø²"]}),e.jsxs(E,{size:"sm",variant:"destructive",onClick:()=>P(n.id,"rejected","rejected",S||void 0),children:[e.jsx(Me,{className:"w-4 h-4 ml-1"})," Ø±ÙØ¶ Ø§ÙØØ¬Ø²"]})]}),n.booking_status==="confirmed"&&e.jsxs(E,{size:"sm",onClick:()=>P(n.id,"completed"),children:[e.jsx(Oe,{className:"w-4 h-4 ml-1"})," Ø¥ÙÙ
اÙ"]}),(n.booking_status==="pending"||n.booking_status==="confirmed")&&e.jsx(E,{size:"sm",variant:"outline",onClick:()=>P(n.id,"cancelled"),children:"Ø¥ÙØºØ§Ø¡ Ø§ÙØØ¬Ø²"})]}),e.jsxs("div",{className:"border border-border rounded-xl p-4",children:[e.jsxs("h3",{className:"font-bold text-foreground mb-3 flex items-center gap-2 text-sm",children:[e.jsx(Ts,{className:"w-4 h-4"})," ÙÙØ§Ùب ÙØ§ØªØ³Ø§Ø¨"]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(E,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>k(n,"reminder"),children:"ⰠتذÙÙØ± Ø¨Ø§ÙØ¯Ùع"}),n.payment_option==="deposit"&&Number(n.remaining_amount||0)>0&&e.jsx(E,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>k(n,"deposit_reminder"),children:"ð³ ØªØ°ÙÙØ± باÙÙ
تبÙÙ"}),e.jsx(E,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>k(n,"welcome"),children:"ð´ ØªØ±ØÙب"}),e.jsx(E,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>k(n,"thanks"),children:"ð Ø´ÙØ±"}),e.jsx(E,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>k(n,"review"),children:"â Ø·Ùب تÙÙÙÙ
"})]})]})]})]})})]})}function Va(){const[t,s]=o.useState([]),[r,a]=o.useState(!0),[n,c]=o.useState(null),[l,i]=o.useState(null),[u,p]=o.useState(!1),[b,h]=o.use
192State(null),g=()=>{a(!0),R("list-chalets").then(f=>s(f.data||[])).catch(()=>w.error("ÙØ´Ù Ø§ÙØªØÙ
ÙÙ")).finally(()=>a(!1))};o.useEffect(g,[]);const N=async()=>{if(n)try{await R("update-chalet",{id:n.id,updates:{name:n.name,description:n.description,guest_capacity:n.guest_capacity,bedrooms:n.bedrooms,bathrooms:n.bathrooms,status:n.status}}),w.success("تÙ
Ø§ÙØÙØ¸"),c(null),g()}catch{w.error("ÙØ´Ù Ø§ÙØÙØ¸")}},S=async(f,C)=>{if(C.size>5*1024*1024){w.error("Ø§ÙØØ¯ Ø§ÙØ£Ùص٠5 Ù
ÙØ¬Ø§Ø¨Ø§Ùت");return}if(!C.type.startsWith("image/")){w.error("ÙØ±Ø¬Ù Ø§Ø®ØªÙØ§Ø± ØµÙØ±Ø©");return}p(!0);try{const k=new FileReader;k.onload=async()=>{const P=k.result.split(",")[1];await R("add-chalet-image",{chalet_id:f,base64:P,contentType:C.type,fileName:C.name}),w.success("تÙ
Ø±ÙØ¹ Ø§ÙØµÙرة"),g();const y=((await R("list-chalets")).data||[]).find(_=>_.id===f);y&&i(y)},k.readAsDataURL(C)}catch{w.error("ÙØ´Ù Ø±ÙØ¹ Ø§ÙØµÙرة")}finally{setTimeout(()=>p(!1),1500)}},d=async(f,C)=>{if(confirm("ÙÙ Ø£ÙØª Ù
ØªØ£ÙØ¯ Ù
Ù ØØ°Ù ÙØ°Ù Ø§ÙØµÙرةØ"))try{await R("delete-chalet-image",{image_id:f,chalet_id:C}),w.success("تÙ
ØØ°Ù Ø§ÙØµÙرة"),g();const P=((await R("list-chalets")).data||[]).find(D=>D.id===C);P&&i(P)}catch{w.error("ÙØ´Ù ØØ°Ù Ø§ÙØµÙرة")}},x=f=>h(f),j=(f,C)=>{if(f.preventDefault(),b===null||b===C||!l)return;const k=[...l.chalet_images||[]],[P]=k.splice(b,1);k.splice(C,0,P),i({...l,chalet_images:k}),h(C)},v=async()=>{if(!l)return;const f=l.chalet_images||[];try{await R("reorder-chalet-images",{images:f.map(C=>({id:C.id}))}),w.success("تÙ
ØªØØ¯ÙØ« Ø§ÙØªØ±ØªÙب"),g()}catch{w.error("ÙØ´Ù ØªØØ¯ÙØ« Ø§ÙØªØ±ØªÙب")}h(null)};return r?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})}):t.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(ar,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground font-bold",children:"ÙØ§ ØªÙØ¬Ø¯ شاÙÙÙØ§Øª"})]}):e.jsxs("div",{className:"space-y-3",children:[t.map(f=>e.jsx("div",{className:"bg-card rounded-xl p-4 border border-border",children:e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[f.cover_image_url&&e.jsx("img",{src:f.cover_image_url,alt:f.name,className:"w-14 h-14 rounded-lg object-cover"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-foreground",children:f.name}),e.jsx(U,{variant:"outline",className:"mr-2",children:Dt[f.type]}),e.jsx(U,{variant:f.status==="active"?"default":"secondary",children:f.status==="active"?"ÙØ´Ø·":"Ù
عطÙ"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[f.bedrooms," غر٠· ",f.bathrooms," ØÙ
اÙ
ات · ",f.guest_capacity," ضÙÙ٠· ",(f.chalet_images||[]).length," ØµÙØ±"]})]})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(E,{variant:"outline",size:"sm",onClick:()=>i(f),children:[e.jsx(he,{className:"w-4 h-4 ml-1"})," Ø§ÙØµÙر"]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>c({...f}),children:"تعدÙÙ"})]})]})},f.id)),e.jsx(de,{open:!!n,onOpenChange:()=>c(null),children:e.jsxs(oe,{dir:"rtl",children:[e.jsx(le,{children:e.jsx(ie,{children:"تعدÙÙ Ø§ÙØ´Ø§ÙÙÙ"})}),n&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(F,{value:n.name,onChange:f=>c({...n,name:f.target.value}),placeholder:"Ø§ÙØ§Ø³Ù
"}),e.jsx(Xe,{value:n.description||"",onChange:f=>c({...n,description:f.target.value}),placeholder:"اÙÙØµÙ"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(F,{type:"number",value:n.guest_capacity,onChange:f=>c({...n,guest_capacity:+f.target.value}),placeholder:"Ø§ÙØ³Ø¹Ø©"}),e.jsx(F,{type:"number",value:n.bedrooms,onChange:f=>c({...n,bedrooms:+f.target.value}),placeholder:"غرÙ"}),e.jsx(F,{type:"number",value:n.bathrooms,onChange:f=>c({...n,bathrooms:+f.target.value}),placeholder:"ØÙ
اÙ
ات"})]}),e.jsxs(Le,{value:n.status,onValueChange:f=>c({...n,status:f}),children:[e.jsx(Re,{children:e.jsx(Be,{})}),e.jsxs(Te,{children:[e.jsx(fe,{value:"active",children:"ÙØ´Ø·"}),e.jsx(fe,{value:"inactive",children:"Ù
عطÙ"})]})]}),e.jsx(E,{onClick:N,className:"w-full",children:"ØÙظ Ø§ÙØªØ¹Ø¯ÙÙØ§Øª"})]})]})}),e.jsx(de,{open:!!l,onOpenChange:()=>i(null),children:e.jsxs(oe,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",dir:"rtl",children:[e.jsx(le,{children:e.jsxs(ie,{children:["إدارة ØµÙØ± - ",l==null?void 0:l.name]})}),l&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-2 border-dashed border-border rounded-xl p-6 text-center",children:[e.jsx(he,{className:"w-10 h-10 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Ø§Ø³ØØ¨ Ø§ÙØµÙر ÙÙØ§ أ٠اضغط ÙØ§Ø®ØªÙار Ù
ÙÙ"}),e.jsx("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",id:"img-upload",onChange:f=>{const C=f.target.files;
192C&&Array.from(C).forEach(k=>S(l.id,k)),f.target.value=""}}),e.jsxs(E,{variant:"outline",size:"sm",disabled:u,onClick:()=>{var f;return(f=document.getElementById("img-upload"))==null?void 0:f.click()},children:[u?e.jsx(Y,{className:"w-4 h-4 animate-spin ml-1"}):e.jsx(he,{className:"w-4 h-4 ml-1"}),u?"Ø¬Ø§Ø±Ù Ø§ÙØ±Ùع...":"اختر ØµÙØ±"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Ø§ÙØØ¯ Ø§ÙØ£Ùص٠5 Ù
ÙØ¬Ø§Ø¨Ø§Ùت ÙÙÙ ØµÙØ±Ø©"})]}),(l.chalet_images||[]).length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(he,{className:"w-10 h-10 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-muted-foreground",children:"ÙØ§ ØªÙØ¬Ø¯ ØµÙØ± - Ø£Ø¶Ù ØµÙØ±Ø§Ù ÙÙØ´Ø§ÙÙÙ"})]}):e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[...l.chalet_images||[]].sort((f,C)=>f.sort_order-C.sort_order).map((f,C)=>e.jsxs("div",{className:"relative group rounded-xl overflow-hidden border border-border bg-card",draggable:!0,onDragStart:()=>x(C),onDragOver:k=>j(k,C),onDragEnd:v,children:[e.jsx("img",{src:f.image_url,alt:"",className:"w-full h-32 object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-all flex items-center justify-center opacity-0 group-hover:opacity-100",children:e.jsx("button",{onClick:()=>d(f.id,l.id),className:"bg-destructive text-destructive-foreground p-2 rounded-full hover:opacity-90",children:e.jsx(rr,{className:"w-4 h-4"})})}),e.jsx("div",{className:"absolute top-2 start-2 cursor-grab active:cursor-grabbing",children:e.jsx(sr,{className:"w-4 h-4 text-white drop-shadow-lg op
192acity-0 group-hover:opacity-100 transition-opacity"})}),C===0&&e.jsx("span",{className:"absolute top-2 end-2 bg-primary text-primary-foreground text-xs px-2 py-0.5 rounded-full font-bold",children:"Ø§ÙØºÙاÙ"})]},f.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ð¡ Ø§Ø³ØØ¨ Ø§ÙØµÙر ÙØªØºÙÙØ± ØªØ±ØªÙØ¨Ùا. Ø§ÙØµÙرة Ø§ÙØ£ÙÙÙ ØªØ¸ÙØ± ÙØºÙاÙ."})]})]})})]})}function Wa(){const[t,s]=o.useState("hero"),[r,a]=o.useState([]),[n,c]=o.useState(!0),[l,i]=o.useState(!1),[u,p]=o.useState(null),b=()=>{c(!0),R("list-site-images",{section:t}).then(x=>a(x.data||[])).catch(()=>w.error("ÙØ´Ù Ø§ÙØªØÙ
ÙÙ")).finally(()=>c(!1))};o.useEffect(b,[t]);const h=async x=>{if(x.size>5*1024*1024){w.error("Ø§ÙØØ¯ Ø§ÙØ£Ùص٠5 Ù
ÙØ¬Ø§Ø¨Ø§Ùت");return}if(!x.type.startsWith("image/")){w.error("ÙØ±Ø¬Ù Ø§Ø®ØªÙØ§Ø± ØµÙØ±Ø©");return}i(!0);try{const j=new FileReader;j.onload=async()=>{const v=j.result.split(",")[1];await R("add-site-image",{section:t,base64:v,contentType:x.type,fileName:x.name}),w.success("تÙ
Ø±ÙØ¹ Ø§ÙØµÙرة"),b()},j.readAsDataURL(x)}catch{w.error("ÙØ´Ù Ø±ÙØ¹ Ø§ÙØµÙرة")}finally{setTimeout(()=>i(!1),1500)}},g=async x=>{if(confirm("ÙÙ Ø£ÙØª Ù
ØªØ£ÙØ¯ Ù
Ù ØØ°Ù ÙØ°Ù Ø§ÙØµÙرةØ"))try{await R("delete-site-image",{image_id:x}),w.success("تÙ
ØØ°Ù Ø§ÙØµÙرة"),b()}catch{w.error("ÙØ´Ù Ø§ÙØØ°Ù")}},N=x=>p(x),S=(x,j)=>{if(x.preventDefault(),u===null||u===j)return;const v=[...r],[f]=v.splice(u,1);v.splice(j,0,f),a(v),p(j)},d=async()=>{try{await R("reorder-site-images",{images:r.map(x=>({id:x.id}))}),w.success("تÙ
ØªØØ¯ÙØ« Ø§ÙØªØ±ØªÙب")}catch{w.error("ÙØ´Ù ØªØØ¯ÙØ« Ø§ÙØªØ±ØªÙب")}p(null)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(E,{variant:t==="hero"?"default":"outline",size:"sm",onClick:()=>s("hero"),children:"ØµÙØ± أعÙÙ Ø§ÙØµÙØØ© (Hero)"}),e.jsx(E,{variant:t==="gallery"?"default":"outline",size:"sm",onClick:()=>s("gallery"),children:"Ù
عرض Ø§ÙØµÙر"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t==="hero"?"Ø§ÙØµÙر Ø§ÙØªÙ ØªØ¸ÙØ± بشÙÙ Ù
تتابع Ù٠أعÙÙ Ø§ÙØµÙØØ© Ø§ÙØ±Ø¦ÙØ³ÙØ© (ÙÙØ¶Ù Ù£ ØµÙØ± Ø£ÙÙÙØ© عاÙÙØ© Ø§ÙØ¬Ùدة).":"ØµÙØ± Ù
عرض اÙÙ
ÙÙØ¹ ÙÙ Ø§ÙØµÙØØ© Ø§ÙØ±Ø¦ÙØ³ÙØ©. إذا ÙÙ
ØªÙØ¶Ù ØµÙØ± ÙÙØ§ ÙØ³ÙتÙ
عرض ØµÙØ± Ø§ÙØ´Ø§ÙÙÙØ§Øª تÙÙØ§Ø¦ÙاÙ."})]}),e.jsxs("div",{className:"border-2 border-dashed border-border rounded-xl p-6 text-center bg-card",children:[e.jsx(he,{className:"w-10 h-10 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"اختر ØµÙØ±Ø© Ø£Ù Ø£ÙØ«Ø± ÙÙØ±Ùع"}),e.jsx("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",id:"site-img-upload",onChange:x=>{const j=x.target.files;j&&Array.from(j).forEach(v=>h(v)),x.target.value=""}}),e.jsxs(E,{variant:"outline",size:"sm",disabled:l,onClick:()=>{var x;return(x=document.getElementById("site-img-upload"))==null?void 0:x.click()},children:[l?e.jsx(Y,{className:"w-4 h-4 animate-spin ml-1"}):e.jsx(he,{className:"w-4 h-4 ml-1"}),l?"Ø¬Ø§Ø±Ù Ø§ÙØ±Ùع...":"اختر ØµÙØ±"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Ø§ÙØØ¯ Ø§ÙØ£Ùص٠5 Ù
ÙØ¬Ø§Ø¨Ø§Ùت ÙÙÙ ØµÙØ±Ø©"})]}),n?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})}):r.length===0?e.jsxs("div",{className:"text-center py-8 bg-card rounded-xl border border-border",children:[e.jsx(he,{className:"w-10 h-10 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-muted-foreground",children:"ÙØ§ ØªÙØ¬Ø¯ ØµÙØ± ÙÙ ÙØ°Ø§ اÙÙØ³Ù
"})]}):e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:r.map((x,j)=>e.jsxs("div",{className:"relative group rounded-xl overflow-hidden border border-border bg-card",draggable:!0,onDragStart:()=>N(j),onDragOver:v=>S(v,j),onDragEnd:d,children:[e.jsx("img",{src:x.image_url,alt:"",className:"w-full h-32 object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-all flex items-center justify-center opacity-0 group-hover:opacity-100",children:e.jsx("button",{onClick:()=>g(x.id),className:"bg-destructive text-destructive-foreground p-2 rounded-full hover:opacity-90",children:e.jsx(rr,{className:"w-4 h-4"})})}),e.jsx("div",{className:"absolute top-2 start-2",children:e.jsx(sr,{className:"w-4 h-4 text-white drop-shadow-lg op
192acity-0 group-hover:opacity-100 transition-opacity cursor-grab"})}),e.jsxs("span",{className:"absolute top-2 end-2 bg-primary/90 text-primary-foreground text-xs px-2 py-0.5 rounded-full font-bold",children:["#",j+1]})]},x.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ð¡ Ø§Ø³ØØ¨ Ø§ÙØµÙر ÙØªØºÙÙØ± ØªØ±ØªÙØ¨Ùا."})]})}function Ha(){const[t,s]=o.useState([]),[r,a]=o.useState([]),[n,c]=o.useState(!0),[l,i]=o.useState(null),u=()=>{c(!0),Promise.all([R("list-pricing-rules"),R("list-seasonal-periods")]).then(([g,N])=>{s(g.data||[]),a(N.data||[])}).catch(()=>w.error("ÙØ´Ù Ø§ÙØªØÙ
ÙÙ")).finally(()=>c(!1))};o.useEffect(u,[]);const p=async(g,N)=>{try{await R("update-pricing-rule",{id:g,base_price:N}),w.success("تÙ
Ø§ÙØªØØ¯ÙØ«"),u()}catch{w.error("ÙØ´Ù Ø§ÙØªØØ¯ÙØ«")}},b=async()=>{if(l){if(!l.name||!l.start_date||!l.end_date){w.error("ÙØ±Ø¬Ù تعبئة جÙ
ÙØ¹ Ø§ÙØÙÙÙ");return}try{await R("upsert-seasonal-period",l),w.success("تÙ
Ø§ÙØÙØ¸"),i(null),u()}catch{w.error("ÙØ´Ù Ø§ÙØÙØ¸")}}},h=async g=>{if(confirm("ÙÙ Ø£ÙØª Ù
ØªØ£ÙØ¯ Ù
Ù Ø§ÙØØ°ÙØ"))try{await R("delete-seasonal-period",{id:g}),w.success("تÙ
Ø§ÙØØ°Ù"),u()}catch{w.error("ÙØ´Ù Ø§ÙØØ°Ù")}};return n?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-foreground mb-3",children:"Ø§ÙØ£Ø³Ø¹Ø§Ø± Ø§ÙØ£Ø³Ø§Ø³ÙØ©"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:t.map(g=>e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border",children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[Dt[g.chalet_type]," â ",Fa[g.day_type]]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{type:"number",defaultValue:g.base_price,className:"w-32",onBlur:N=>{const S=Number(N.target.value);S>0&&S!==g.base_price&&p(g.id,S)}}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"ر.س"})]})]},g.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:"اÙÙ
ÙØ§Ø³Ù
"}),e.jsx(E,{size:"sm",onClick:()=>i({name:"",start_date:"",end_date:"",season_type:"peak",price_multiplier:1.5}),children:"+ Ø¥Ø¶Ø§ÙØ© Ù
ÙØ³Ù
"})]}),r.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ye,{className:"w-10 h-10 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-muted-foreground",children:"ÙØ§ ØªÙØ¬Ø¯ Ù
ÙØ§Ø³Ù
"})]}):e.jsx("div",{className:"space-y-2",children:r.map(g=>e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-foreground",children:g.name}),e.jsxs("span",{className:"text-sm text-muted-foreground mr-2",children:[g.start_date," â ",g.end_date]}),e.jsxs(U,{variant:"outline",children:["Ã",g.price_multiplier]})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(E,{variant:"outline",size:"sm",onClick:()=>i({...g}),children:"تعدÙÙ"}),e.jsx(E,{variant:"destructive",size:"sm",onClick:()=>
192h(g.id),children:"ØØ°Ù"})]})]},g.id))})]}),e.jsx(de,{open:!!l,onOpenChange:()=>i(null),children:e.jsxs(oe,{dir:"rtl",children:[e.jsx(le,{children:e.jsx(ie,{children:l!=null&&l.id?"تعدÙ٠اÙÙ
ÙØ³Ù
":"Ø¥Ø¶Ø§ÙØ© Ù
ÙØ³Ù
"})}),l&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(F,{value:l.name,onChange:g=>i({...l,name:g.target.value}),placeholder:"اسÙ
اÙÙ
ÙØ³Ù
"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(F,{type:"date",value:l.start_date,onChange:g=>i({...l,start_date:g.target.value})}),e.jsx(F,{type:"date",value:l.end_date,onChange:g=>i({...l,end_date:g.target.value})})]}),e.jsx(F,{type:"number",step:"0.1",value:l.price_multiplier,onChange:g=>i({...l,price_multiplier:+g.target.value}),placeholder:"Ù
عاÙ
Ù Ø§ÙØ³Ø¹Ø±"}),e.jsx(E,{onClick:b,className:"w-full",children:"ØÙظ"})]})]})})]})}function Ka(){const[t,s]=o.useState([]),[r,a]=o.useState(!0),[n,c]=o.useState(null),l=()=>{a(!0),R("list-demand-rules").then(p=>s(p.data||[])).catch(()=>w.error("ÙØ´Ù Ø§ÙØªØÙ
ÙÙ")).finally(()=>a(!1))};o.useEffect(l,[]);const i=async()=>{if(n){if(!n.name.trim()){w.error("ÙØ±Ø¬Ù إدخا٠اسÙ
اÙÙØ§Ø¹Ø¯Ø©");return}try{await R("upsert-demand-rule",n),w.success("تÙ
Ø§ÙØÙØ¸"),c(null),l()}catch{w.error("ÙØ´Ù Ø§ÙØÙØ¸")}}},u=async p=>{if(confirm("ÙÙ Ø£ÙØª Ù
ØªØ£ÙØ¯ Ù
Ù Ø§ÙØØ°ÙØ"))try{await R("delete-demand-rule",{id:p}),w.success("تÙ
Ø§ÙØØ°Ù"),l()}catch{w.error("ÙØ´Ù Ø§ÙØØ°Ù")}};return r?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:"ÙÙØ§Ø¹Ø¯ Ø§ÙØªØ³Ø¹Ùر ØØ³Ø¨ Ø§ÙØ·Ùب"}),e.jsx(E,{size:"sm",onClick:()=>c({name:"",occupancy_threshold:.8,price_multiplier:1.2,active:!0}),children:"+ Ø¥Ø¶Ø§ÙØ© ÙØ§Ø¹Ø¯Ø©"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Ø¹ÙØ¯ ØªØ¬Ø§ÙØ² ÙØ³Ø¨Ø© Ø§ÙØ¥Ø´ØºØ§Ù ÙÙØØ¯ اÙÙ
ØØ¯Ø¯Ø ÙØªÙ
تطبÙÙ Ù
Ø¶Ø§Ø¹Ù Ø§ÙØ³Ø¹Ø± تÙÙØ§Ø¦ÙاÙ"}),t.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(_t,{className:"w-10 h-10 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-muted-foreground",children:"ÙØ§ ØªÙØ¬Ø¯ ÙÙØ§Ø¹Ø¯ Ø·ÙØ¨"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Ø£Ø¶Ù ÙØ§Ø¹Ø¯Ø© ÙØªÙعÙÙ Ø§ÙØªØ³Ø¹Ùر Ø§ÙØ¯ÙÙØ§Ù
ÙÙÙ"})]}):e.jsx("div",{className:"space-y-2",children:t.map(p=>e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-foreground",children:p.name}),e.jsxs(U,{variant:"outline",className:"mr-2",children:["عتبة: ",Math.round(p.occupancy_threshold*100),"%"]}),e.jsxs(U,{variant:"outline",children:["Ã",p.price_multiplier]}),e.jsx(U,{variant:p.active?"default":"secondary",className:"mr-2",children:p.active?"Ù
ÙØ¹ÙÙ":"Ù
عطÙÙ"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(E,{variant:"outline",size:"sm",onClick:()=>c({...p}),children:"تعدÙÙ"}),e.jsx(E,{variant:"destructive",size:"sm",onClick:()=>u(p.id),children:"ØØ°Ù"})]})]},p.id))}),e.jsx(de,{open:!!n,onOpenChange:()=>c(null),children:e.jsxs(oe,{dir:"rtl",children:[e.jsx(le,{children:e.jsx(ie,{children:n!=null&&n.id?"تعدÙ٠اÙÙØ§Ø¹Ø¯Ø©":"Ø¥Ø¶Ø§ÙØ© ÙØ§Ø¹Ø¯Ø© Ø·ÙØ¨"})}),n&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(F,{value:n.name,onChange:p=>c({...n,name:p.target.value}),placeholder:"اسÙ
اÙÙØ§Ø¹Ø¯Ø© (Ù
ثاÙ: Ø·ÙØ¨ Ù
Ø±ØªÙØ¹)"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-muted-foreground mb-1 block",children:"عتبة Ø§ÙØ¥Ø´ØºØ§Ù (%)"}),e.jsx(F,{type:"number",min:"0",max:"100",value:Math.round(n.occupancy_threshold*100),onChange:p=>c({...n,occupancy_threshold:+p.target.value/100})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-muted-foreground mb-1 block",children:"Ù
Ø¶Ø§Ø¹Ù Ø§ÙØ³Ø¹Ø±"}),e.jsx(F,{type:"number",step:"0.05",min:"1",value:n.price_multiplier,onCh
192ange:p=>c({...n,price_multiplier:+p.target.value})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:n.active,onChange:p=>c({...n,active:p.target.checked}),id:"dr-active"}),e.jsx("label",{htmlFor:"dr-active",className:"text-sm text-foreground",children:"Ù
ÙØ¹ÙÙ"})]}),e.jsx(E,{onClick:i,className:"w-full",children:"ØÙظ"})]})]})})]})}function qa(){const[t,s]=o.useState([]),[r,a]=o.useState(""),[n,c]=o.useState([]),[l,i]=o.useState(()=>{const _=new Date;return`${_.getFullYear()}-${String(_.getMonth()+1).padStart(2,"0")}`}),[u,p]=o.useState([]),[b,h]=o.useState(!0);o.useEffect(()=>{R("list-chalets").then(_=>{const A=_.data||[];s(A),A.length>0&&a(A[0].id)}).catch(()=>w.error("ÙØ´Ù Ø§ÙØªØÙ
ÙÙ")).finally(()=>h(!1))},[]);const g=o.useCallback(()=>{r&&R("list-availability",{chalet_id:r,month:l}).then(_=>c(_.data||[])).catch(()=>{})},[r,l]);o.useEffect(()=>{g()},[g]);const N=_=>{p(A=>A.includes(_)?A.filter(L=>L!==_):[...A,_])},S=async()=>{if(u.length!==0)try{await R("set-availability",{chalet_id:r,dates:u,status:"blocked"}),w.success("تÙ
Ø§ÙØØ¸Ø±"),p([]),g()}catch{w.error("ÙØ´Ù")}},d=async()=>{if(u.length!==0)try{await R("clear-availability",{chalet_id:r,dates:u}),w.success("تÙ
Ø¥ÙØºØ§Ø¡ Ø§ÙØØ¸Ø±"),p([]),g()}catch{w.error("ÙØ´Ù")}},x=_=>{const[A,L]=l.split("-").map(Number),O=new Date(A,L-1+_,1);i(`${O.getFullYear()}-${String(O.getMonth()+1).padStart(2,"0")}`)},[j,v]=l.split("-").map(Number),f=new Date(j,v-1,1),C=new Date(j,v,0).getDate(),k=f.getDay(),P=["Ø£ØØ¯","اثÙÙÙ","Ø«ÙØ§Ø«Ø§Ø¡","أربعاء","Ø®Ù
ÙØ³","جÙ
عة","سبت"],D=["ÙÙØ§Ùر","ÙØ¨Ø±Ø§Ùر","Ù
ارس","أبرÙÙ","Ù
اÙÙ","ÙÙÙÙÙ","ÙÙÙÙÙ","أغسطس","سبتÙ
بر","Ø£ÙØªÙبر","ÙÙÙÙ
بر","Ø¯ÙØ³Ù
بر"],y=new Map(n.map(_=>[_.date,_.status]));return b?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs(Le,{value:r,onValueChange:_=>{a(_),p([])},children:[e.jsx(Re,{children:e.jsx(Be,{placeholder:"اختر Ø§ÙØ´Ø§ÙÙÙ"})}),e.jsx(Te,{children:t.map(_=>e.jsx(fe,{value:_.id,children:_.name},_.id))})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(E,{variant:"outline",size:"sm",onClick:()=>x(-1),children:e.jsx(Bs,{className:"w-4 h-4"})}),e.jsxs("span",{className:"font-bold text-foreground",children:[D[v-1]," ",j]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>x(1),children:e.jsx(Fs,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[P.map(_=>e.jsx("div",{className:"text-center text-xs text-muted-foreground font-bold py-1",children:_},_)),Array.from({length:k}).map((_,A)=>e.jsx("div",{},`e-${A}`)),Array.from({length:C}).map((_,A)=>{const L=A+1,O=`${j}-${String(v).padStart(2,"0")}-${String(L).padStart(2,"0")}`,K=y.get(O),G=u.includes(O),X=K==="blocked"||K==="maintenance",B=K==="booked";let m="bg-card hover:bg-accent";return B?m="bg-red-100 text-red-800":X&&(m="bg-yellow-100 text-yellow-800"),G&&(m="bg-primary text-primary-foreground"),e.jsx("button",{className:`${m} rounded-lg p-2 text-center text-sm border border-border transition-colors`,onClick:()=>!B&&N(O),disabled:B,children:L},L)})]}),e.jsxs("div",{className:"flex gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-red-100 border"})," Ù
ØØ¬Ùز"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-yellow-100 border"})," Ù
ØØ¸Ùر"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-3 h-3 rounded bg-primary border"})," Ù
ØØ¯Ø¯"]})]}),u.length>0&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(E,{size:"sm",onClick:S,children:["ØØ¸Ø± (",u.length,")"]}),e.jsxs(E,{size:"sm",variant:"outline",onClick:d,children:["Ø¥ÙØºØ§Ø¡ Ø§ÙØØ¸Ø± (",u.length,")"]}),e.jsx(E,{size:"sm",variant:"ghost",onClick:()=>p([]),children:"Ø¥ÙØºØ§Ø¡ Ø§ÙØªØØ¯Ùد"})]})]})}
192function Ga(){const[t,s]=o.useState([]),[r,a]=o.useState([]),[n,c]=o.useState(!0),[l,i]=o.useState(null),u=()=>{c(!0),Promise.all([R("list-reviews"),R("list-chalets")]).then(([h,g])=>{s(h.data||[]),a(g.data||[])}).catch(()=>w.error("ÙØ´Ù Ø§ÙØªØÙ
ÙÙ")).finally(()=>c(!1))};o.useEffect(u,[]);const p=async()=>{if(l){if(!l.customer_name.trim()){w.error("ÙØ±Ø¬Ù إدخا٠اسÙ
Ø§ÙØ¹Ù
ÙÙ");return}try{await R("upsert-review",l),w.success("تÙ
Ø§ÙØÙØ¸"),i(null),u()}catch{w.error("ÙØ´Ù Ø§ÙØÙØ¸")}}},b=async h=>{if(confirm("ÙÙ Ø£ÙØª Ù
ØªØ£ÙØ¯ Ù
Ù Ø§ÙØØ°ÙØ"))try{await R("delete-review",{id:h}),w.success("تÙ
Ø§ÙØØ°Ù"),u()}catch{w.error("ÙØ´Ù Ø§ÙØØ°Ù")}};return n?e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:"إدارة Ø§ÙØªÙÙÙÙ
ات"}),e.jsx(E,{size:"sm",onClick:()=>i({customer_name:"",rating:5,comment:"",chalet_id:null,approved:!0,featured:!1}),children:"+ Ø¥Ø¶Ø§ÙØ© تÙÙÙÙ
"})]}),t.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(or,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground font-bold",children:"ÙØ§ ØªÙØ¬Ø¯ تÙÙÙÙ
ات"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"أض٠تÙÙÙÙ
ات Ø§ÙØ¹Ù
ÙØ§Ø¡ ÙØ¹Ø±Ø¶Ùا ÙÙ Ø§ÙØµÙØØ© Ø§ÙØ±Ø¦ÙØ³ÙØ©"})]}):e.jsx("div",{className:"space-y-2",children:t.map(h=>e.jsxs("div",{className:"bg-card rounded-xl p-4 border border-border flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-bold text-foreground",children:h.customer_name}),e.jsx("div",{className:"flex gap-0.5",children:Array.from({length:5}).map((g,N)=>e.jsx(At,{className:`w-3 h-3 ${N<h.rating?"text-amber-400 fill-amber-400":"text-muted-foreground/30"}`},N))}),e.jsx(U,{variant:h.approved?"default":"secondary",children:h.approved?"Ù
عتÙ
د":"Ù
Ø®ÙÙ"}),h.featured&&e.jsx(U,{className:"bg-amber-100 text-amber-800",children:"Ù
Ù
ÙØ²"})]}),h.comment&&e.jsx("p",{className:"text-sm text-muted-foreground",children:h.comment})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(E,{variant:"outline",size:"sm",onClick:()=>i({...h}),children:"تعدÙÙ"}),e.jsx(E,{variant:"destructive",size:"sm",onClick:()=>b(h.id),children:"ØØ°Ù"})]})]},h.id))}),e.jsx(de,{open:!!l,onOpenChange:()=>i(null),children:e.jsxs(oe,{dir:"rtl",children:[e.jsx(le,{children:e.jsx(ie,{children:l!=null&&l.id?"تعدÙÙ Ø§ÙØªÙÙÙÙ
":"Ø¥Ø¶Ø§ÙØ© تÙÙÙÙ
"})}),l&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(F,{value:l.customer_name,onChange:h=>i({...l,customer_name:h.target.value}),placeholder:"اسÙ
Ø§ÙØ¹Ù
ÙÙ"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-muted-foreground mb-1 block",children:"Ø§ÙØªÙÙÙÙ
"}),e.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(h=>e.jsx("button",{onClick:()=>i({...l,rating:h}),className:"p-1",children:e.jsx(At,{className:`w-6 h-6 ${h<=l.rating?"text-amber-400 fill-amber-400":"text-muted-foreground/30"}`})},h))})]}),e.jsx(Xe,{value:l.comment||"",onChange:h=>i({...l,comment:h.target.value}),placeholder:"تعÙÙÙ Ø§ÙØ¹Ù
ÙÙ",rows:3}),e.jsxs(Le,{value:l.chalet_id||"none",onValueChange:h=>i({...l,chalet_id:h==="none"?null:h}),children:[e.jsx(Re,{children:e.jsx(Be,{placeholder:"Ø§ÙØ´Ø§ÙÙÙ (Ø§Ø®ØªÙØ§Ø±Ù)"})}),e.jsxs(Te,{children:[e.jsx(fe,{value:"none",children:"بدÙ٠شاÙÙÙ Ù
ØØ¯Ø¯"}),r.map(h=>e.jsx(fe,{value:h.id,children:h.name},h.id))]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[e.jsx("input",{type:"checkbox",checked:l.approved,onChange:h=>i({...l,approved:h.target.checked})}),"Ù
عتÙ
د (ÙØ¸Ùر Ù٠اÙÙ
ÙÙØ¹)"]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[e.jsx("input",{type:"checkbox",checked:l.featured,onChange:h=>i({...l,featured:h.target.checked})}),"Ù
Ù
ÙØ²"]})]}),e.jsx(E,{onClick:p,className:"w-full",children:"ØÙظ"})]})]})})]})}
192function Ya(){const[t,s]=o.useState([]),[r,a]=o.useState([]),[n,c]=o.useState([]),[l,i]=o.useState([]),[u,p]=o.useState(!0),[b,h]=o.useState(""),[g,N]=o.useState(!1),[S,d]=o.useState(null),[x,j]=o.useState(null),[v,f]=o.useState({email:"",password:"",full_name:"",phone:"",role:"viewer"}),[C,k]=o.useState(!1),P=o.useCallback(()=>{p(!0),Promise.all([R("list-users"),R("list-permissions")]).then(([m,T])=>{s(m.data||[]),a(T.permissions||[]),c(T.role_permissions||[]),i(T.overrides||[])}).catch(()=>w.error("ÙØ´Ù تØÙ
Ù٠اÙÙ
ستخدÙ
ÙÙ")).finally(()=>p(!1))},[]);o.useEffect(()=>{P()},[P]);const D=t.filter(m=>{var M,Z,ne;if(!b.trim())return!0;const T=b.toLowerCase();return((M=m.email)==null?void 0:M.toLowerCase().includes(T))||((Z=m.full_name)==null?void 0:Z.toLowerCase().includes(T))||((ne=m.phone)==null?void 0:ne.includes(T))}),y=async()=>{if(!v.email||!v.password){w.error("Ø§ÙØ¨Ø±Ùد ÙÙÙÙ
Ø© اÙÙ
Ø±ÙØ± Ù
Ø·ÙÙØ¨Ø§Ù");return}if(v.password.length<6){w.error("ÙÙÙ
Ø© اÙÙ
Ø±ÙØ± ÙØ¬Ø¨ أ٠تÙÙÙ 6 Ø£ØØ±Ù عÙÙ Ø§ÙØ£ÙÙ");return}k(!0);try{await R("create-user",v),w.success("تÙ
Ø¥ÙØ´Ø§Ø¡ اÙÙ
ستخدÙ
Ø¨ÙØ¬Ø§Ø"),N(!1),f({email:"",password:"",full_name:"",phone:"",role:"viewer"}),P()}catch(m){w.error(m instanceof Error?m.message:"ÙØ´Ù Ø¥ÙØ´Ø§Ø¡ اÙÙ
ستخدÙ
")}finally{k(!1)}},_=async()=>{if(S){k(!0);try{await R("update-user",{user_id:S.id,full_name:S.full_name,phone:S.phone,email:S.email}),w.success("تÙ
ØªØØ¯ÙØ« اÙÙ
ستخدÙ
"),d(null),P()}catch(m){w.error(m instanceof Error?m.message:"ÙØ´Ù Ø§ÙØªØØ¯ÙØ«")}finally{k(!1)}}},A=async m=>{try{await R("toggle-user-status",{user_id:m.id,is_active:!m.is_active}),w.success(m.is_active?"تÙ
تعطÙÙ Ø§ÙØØ³Ø§Ø¨":"تÙ
ØªÙØ¹ÙÙ Ø§ÙØØ³Ø§Ø¨"),P()}catch(T){w.error(T instanceof Error?T.message:"ÙØ´Ù")}},L=async(m,T)=>{try{await R("assign-role",{user_id:m,role:T}),w.success("تÙ
تعÙÙÙ Ø§ÙØ¯Ùر"),P()}catch(M){w.error(M instanceof Error?M.message:"ÙØ´Ù تعÙÙÙ Ø§ÙØ¯Ùر")}},O=async(m,T)=>{if(confirm(`ÙÙ Ø£ÙØª Ù
ØªØ£ÙØ¯ Ù
Ù Ø¥Ø²Ø§ÙØ© Ø¯ÙØ± "${_e[T]}"Ø`))try{await R("remove-role",{user_id:m,role:T}),w.success("تÙ
Ø¥Ø²Ø§ÙØ© Ø§ÙØ¯Ùر"),P()}catch(M){w.error(M instanceof Error?M.message:"ÙØ´Ù Ø¥Ø²Ø§ÙØ© Ø§ÙØ¯Ùر")}},K=async(m,T,M)=>{try{await R("set-permission-override",{user_id:m,permission_key:T,allowed:M}),w.success("تÙ
ØªØØ¯ÙØ« Ø§ÙØ§Ø³ØªØ«Ùاء"),P()}catch(Z){w.error(Z instanceof Error?Z.message:"ÙØ´Ù")}},G=async(m,T)=>{try{await R("remove-permission-override",{user_id:m,permission_key:T}),w.success("تÙ
Ø¥Ø²Ø§ÙØ© Ø§ÙØ§Ø³ØªØ«Ùاء"),P()}catch(M){w.error(M instanceof Error?M.message:"ÙØ´Ù")}},X=(m,T)=>r.map(M=>{const Z=l.find(ce=>ce.user_id===m&&ce.permission_id===M.id),ne=n.some(ce=>T.includes(ce.role)&&ce.permission_id===M.id);return{...M,hasOverride:!!Z,overrideAllowed:Z==null?void 0:Z.allowed,fromRole:ne,effective:Z?Z.allowed:ne}});if(u)return e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})});const B=["super_admin","admin","booking_manager","pricing_manager","viewer"];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:"إدارة اÙÙ
ستخدÙ
ÙÙ"}),e.jsxs(E,{size:"sm",onClick:()=>N(!0),children:[e.jsx(en,{className:"w-4 h-4 ml-1"})," Ø¥Ø¶Ø§ÙØ© Ù
ستخدÙ
"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(tr,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(F,{placeholder:"Ø¨ØØ« Ø¨Ø§ÙØ§Ø³Ù
Ø Ø§ÙØ¨Ø±ÙØ¯Ø Ø§ÙÙØ§ØªÙ...",value:b,onChange:m=>h(m.target.value),className:"pr-9"})]}),D.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(nr,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground font-bold",children:"ÙØ§ ÙÙØ¬Ø¯ Ù
ستخدÙ
ÙÙ"})]}):e.jsx("div",{className:"space-y-3",children:D.map(m=>e.jsx("div",{className:"bg-card rounded-xl p-4 border border-border",children:e.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-bold text-foreground",children:m.full_name||m.email}),!m.is_active&&e.jsx(U,{variant:"destructive",children:"Ù
عطÙ"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",dir:"ltr",children:m.email}),m.phone&&e.jsx("p",{className:"text-sm text-muted-foreground",dir:"ltr",children:m.phone}),e.jsxs("div",{className:"flex gap-1 mt-2 flex-wrap",children:[m.roles.map(T=>e.jsx(U,{className:ht[T]||"bg-gray-100 text-gray-800",children:_e[T]||T},T)),m.roles.length===0&&e.jsx(U,{variant:"secondary",children:"بدÙÙ Ø¯ÙØ±"})]})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(E,{variant:"outline",size:"sm",onClick:()=>j(m),title:"Ø§ÙØµÙاØÙات",children:e.jsx(Ks,{className:"w-4 h-4"})}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>d({...m}),title:"تعدÙÙ",children:e.jsx(Js,{className:"w-4 h-4"})}),e.jsx(E,{variant:m.is_active?"outline":"default",size:"sm",onClick:()=>A(m),title:m.is_active?"تعطÙÙ":"ØªÙØ¹ÙÙ",children:m.is_active?e.jsx(Qs,{className:"w-4 h-4"}):e.jsx(Zs,{className:"w-4 h-4"})})]})]})},m.id))}),e.jsx(de,{open:g,onOpenChange:()=>N(!1),children:e.jsxs(oe,{dir:"rtl",children:[e.jsx(le,{children:e.jsx(ie,{children:"Ø¥Ø¶Ø§ÙØ© Ù
ستخدÙ
Ø¬Ø¯ÙØ¯"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(F,{value:v.full_name,onChange:m=>f({...v,full_name:m.target.value}),placeholder:"Ø§ÙØ§Ø³Ù
اÙÙØ§Ù
Ù"}),e.jsx(F,{type:"email",value:v.email,onChange:m=>f({...v,email:m.target.value}),placeholder:"Ø§ÙØ¨Ø±Ùد Ø§ÙØ¥ÙÙØªØ±ÙÙÙ",dir:"ltr",required:!0}),e.jsx(F,{type:"password",value:v.password,onChange:m=>f({...v,password:m.target.value}),placeholder:"ÙÙÙ
Ø© اÙÙ
Ø±ÙØ± (6 Ø£ØØ±Ù عÙÙ Ø§ÙØ£ÙÙ)",dir:"ltr",required:!0,minLength:6}),e.jsx(F,{value:v.phone,onChange:m=>f({...v,phone:m.target.value}),placeholder:"رÙÙ
اÙÙØ§ØªÙ",dir:"ltr"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-muted-foreground mb-1 block",children:"Ø§ÙØ¯Ùر"}),e.jsxs(Le,{value:v.role,onValueChange:m=>f({...v,role:m}),children:[e.jsx(Re,{children:e.jsx(Be,{})}),e.jsx(Te,{children:B.map(m=>e.jsx(fe,{value:m,children:_e[m]},m))})]})]}),e.jsx(E,{onClick:y,className:"w-full",disabled:C,children:C?e.jsx(Y,{className:"w-4 h-4 animate-spin"}):"Ø¥ÙØ´Ø§Ø¡ اÙÙ
ستخدÙ
"})]})]})}),e.jsx(de,{open:!!S,onOpenChange:()=>d(null),children:e.jsxs(oe,{dir:"rtl",children:[e.jsx(le,{children:e.jsx(ie,{children:"تعدÙ٠اÙÙ
ستخدÙ
"})}),S&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(F,{value:S.full_name,onChange:m=>d({...S,full_name:m.target.value}),placeholder:"Ø§ÙØ§Ø³Ù
اÙÙØ§Ù
Ù"}),e.jsx(F,{type:"email",value:S.email,onChange:m=>d({...S,email:m.target.value}),placeholder:"Ø§ÙØ¨Ø±Ùد Ø§ÙØ¥ÙÙØªØ±ÙÙÙ",dir:"ltr"}),e.jsx(F,{value:S.phone,onChange:m=>d({...S,phone:m.target.value}),placeholder:"رÙÙ
اÙÙØ§ØªÙ",dir:"ltr"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-muted-foreground mb-2 block",children:"Ø§ÙØ£Ø¯Ùار"}),e.jsx("div",{className:"flex gap-1 flex-wrap mb-2",children:S.roles.map(m=>e.jsxs(U,{className:`${ht[m]} cursor-pointer`,onClick:()=>O(S.id,m),children:[_e[m]||m," â"]},m))}),e.jsxs(Le,{onValueChange:m=>L(S.id,m),children:[e.jsx(Re,{children:e.jsx(Be,{placeholder:"Ø¥Ø¶Ø§ÙØ© Ø¯ÙØ±..."})}),e.jsx(Te,{children:B.filter(m=>!S.roles.includes(m)).map(m=>e.jsx(fe,{value:m,children:_e[m]},m))})]})]}),e.jsx(E,{onClick:_,className:"w-full",disabled:C,children:C?e.jsx(Y,{className:"w-4 h-4 animate-spin"}):"ØÙظ Ø§ÙØªØ¹Ø¯ÙÙØ§Øª"})]})]})}),e.jsx(de,{open:!!x,onOpenChange:()=>j(null),children:e.jsxs(oe,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",dir:"rtl",children:[e.jsx(le,{children:e.jsxs(ie,{children:["ØµÙØ§ØÙات ",(x==null?void 0:x.full_name)||(x==null?void 0:x.email)]})}),x&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1 flex-wrap",children:x.roles.map(m=>e.jsx(U,{className:ht[m],children:_e[m]||m},m))}),e.jsx("div",{className:"bg-secondary/30 rounded-xl overflow-hidden border border-border",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-secondary/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 text-right text-muted-foreground font-medium",children:"Ø§ÙØµÙاØÙØ©"}),e.jsx("th",{className:"p-3 text-center text-muted-foreground font-medium",children:"Ù
Ù Ø§ÙØ¯Ùر"}),e.jsx("th",{className:"p-3 text-center text-muted-foreground font-medium",children:"Ø§Ø³ØªØ«ÙØ§Ø¡"}),e.jsx("th",{className:"p-3 text-center text-muted-foreground font-medium",children:"اÙÙØªÙجة"}),e.jsx("th",{className:"p-3 text-center text-muted-foreground font-medium",children:"إجراء"})]})}),e.jsx("tbody",{children:X(x.id,x.roles).map(m=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsxs("td",{className:"p-3",children:[e.jsx("span",{className:"font-medium text-foreground",children:m.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:m.description})]}),e.jsx("td",{className:"p-3 text-center",children:m.fromRole?e.jsx(Oe,{className:"w-4 h-4 text-green-500 mx-auto"}
192):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground/30 mx-auto"})}),e.jsx("td",{className:"p-3 text-center",children:m.hasOverride?e.jsx(U,{variant:m.overrideAllowed?"default":"destructive",className:"text-xs",children:m.overrideAllowed?"Ù
سÙ
ÙØ":"Ù
Ù
ÙÙØ¹"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"â"})}),e.jsx("td",{className:"p-3 text-center",children:m.effective?e.jsx(U,{className:"bg-green-100 text-green-800 text-xs",children:"Ù
ÙØ¹ÙÙ"}):e.jsx(U,{variant:"secondary",className:"text-xs",children:"Ù
عطÙ"})}),e.jsx("td",{className:"p-3 text-center",children:e.jsx("div",{className:"flex gap-1 justify-center",children:m.hasOverride?e.jsx(E,{size:"sm",variant:"ghost",className:"text-xs h-7 px-2",onClick:()=>G(x.id,m.key),children:"Ø¥Ø²Ø§ÙØ©"}):e.jsxs(e.Fragment,{children:[!m.fromRole&&e.jsx(E,{size:"sm",variant:"ghost",className:"text-xs h-7 px-2 text-green-600",onClick:()=>K(x.id,m.key,!0),children:"سÙ
اØ"}),m.fromRole&&e.jsx(E,{size:"sm",variant:"ghost",className:"text-xs h-7 px-2 text-destructive",onClick:()=>K(x.id,m.key,!1),children:"Ù
ÙØ¹"})]})})})]},m.id))})]})})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ð¡ Ø§ÙØ§Ø³ØªØ«ÙØ§Ø¡Ø§Øª ØªØªØ¬Ø§ÙØ² Ø§ÙØµÙاØÙات اÙÙ
ÙØªØ³Ø¨Ø© Ù
Ù Ø§ÙØ¯Ùر. ÙÙ
ÙÙÙ Ù
ÙØ ØµÙØ§ØÙØ© إضاÙÙØ© Ø£Ù Ù
ÙØ¹ ØµÙØ§ØÙØ© Ù
ÙØ¬Ùدة ÙÙ
ستخدÙ
Ù
ØØ¯Ø¯."})]})]})})]})}function Xa(){var i,u,p,b;const[t,s]=o.useState(null),[r,a]=o.useState(!0),n=o.useCallback(()=>{a(!0),R("rate-limit-stats").then(s).catch(()=>w.error("ÙØ´Ù تØÙ
ÙÙ Ø¨ÙØ§Ùات Ø§ÙØ£Ù
اÙ")).finally(()=>a(!1))},[]);o.useEffect(()=>{n()},[n]);const c=async()=>{try{await R("cleanup-rate-limit-events"),w.success("تÙ
ØªÙØ¸ÙÙ Ø§ÙØ³Ø¬Ùات اÙÙØ¯ÙÙ
Ø©"),n()}catch{w.error("ÙØ´Ù Ø§ÙØªÙظÙÙ")}};if(r)return e.jsx("div",{className:"flex justify-center p-8",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})});const l={rate_limit_exceeded:"ØªØ¬Ø§ÙØ² Ø§ÙØØ¯",admin_rate_limit_exceeded:"ØªØ¬Ø§ÙØ² ØØ¯ Ø§ÙØ¥Ø¯Ø§Ø±Ø©",setup_admin_failed:"Ù
ØØ§ÙÙØ© إعداد ÙØ§Ø´ÙØ©",setup_admin_lockout:"ÙÙÙ ØØ³Ø§Ø¨ إعداد",setup_admin_success:"إعداد ÙØ§Ø¬Ø"};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-card rounded-xl p-5 border border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(xt,{className:"w-5 h-5 text-primary"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Ø£ØØ¯Ø§Ø« آخر 24 ساعة"})]}),e.jsx("p",{className:"text-2xl font-bold text-foreground",children:(t==null?void 0:t.total_events_24h)||0})]}),e.jsxs("div",{className:"bg-card rounded-xl p-5 border border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx($s,{className:"w-5 h-5 text-destructive"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Ù
ØØ§ÙÙØ§Øª دخÙÙ ÙØ§Ø´ÙØ©"})]}),e.jsx("p",{className:"text-2xl font-bold text-foreground",children:(((i=t==null?void 0:t.by_type)==null?void 0:i.setup_admin_failed)||0)+(((u=t==null?void 0:t.by_type)==null?void 0:u.setup_admin_lockout)||0)})]}),e.jsxs("div",{className:"bg-card rounded-xl p-5 border border-border",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Me,{className:"w-5 h-5 text-yellow-500"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Ø·ÙØ¨Ø§Øª Ù
ØØ¸Ùرة"})]}),e.jsx("p",{className:"text-2xl font-bold text-foreground",children:(((p=t==null?void 0:t.by_type)==null?void 0:p.rate_limit_exceeded)||0)+(((b=t==null?void 0:t.by_type)==null?void 0:b.admin_rate_limit_exceeded)||0)})]})]}),(t==null?void 0:t.top_ips)&&t.top_ips.length>0&&e.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:[e.jsx("div",{className:"p-4 border-b border-border",children:e.jsx("h3",{className:"font-bold text-foreground",children:"Ø£ÙØ«Ø± Ø§ÙØ¹ÙاÙÙÙ ÙØ´Ø§Ø·Ø§Ù (IP)"})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-secondary/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 text-right text-muted-foreground font-medium",children:"Ø§ÙØ¹ÙÙØ§Ù"}),e.jsx("th",{className:"p-3 text-right text-muted-foreground font-medium",children:"عدد Ø§ÙØ£ØØ¯Ø§Ø«"})]})}),e.jsx("tbody",{children:t.top_ips.map((h,g)=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsx("td",{className:"p-3 font-mono text-xs text-foreground",children:h.ip}),e.jsx("td",{className:"p-3",children:e.jsx(U,{variant:h.count>10?"destructive":"secondary",children:h.count})})]},g))})]})})]}),(t==null?void 0:t.by_endpoint)&&Object.keys(t.by_endpoint).length>0&&e.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:[e.jsx("div",{className:"p-4 border-b border-border",children:e.jsx("h3",{className:"font-bold text-foreground",children:"ØªÙØ²Ùع ØØ³Ø¨ اÙÙÙØ·Ø©"})}),e.jsx("div",{className:"p-4 space-y-2",children:Object.entries(t.by_endpoint).sort((h,g)=>g[1]-h[1]).map(([h,g])=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:h}),e.jsx(U,{variant:"outline",children:g})]},h))})]}),e.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[e.jsx("h3",{className:"font-bold text-foreground",children:"آخر Ø§ÙØ£ØØ¯Ø§Ø«"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(E,{size:"sm",variant:"outline",onClick:n,children:"ØªØØ¯ÙØ«"}),e.jsx(E,{size:"sm",variant:"destructive",onClick:c,children:"ØªÙØ¸Ù٠اÙÙØ¯ÙÙ
"})]})]}),!(t!=null&&t.recent)||t.recent.length===0?e.jsxs("div",{className:"p-8 text-center text-muted-foreground",children:[e.jsx(xt,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),e.jsx("p",{children:"ÙØ§ ØªÙØ¬Ø¯ Ø£ØØ¯Ø§Ø« Ø£Ù
ÙÙØ© Ù
Ø³Ø¬ÙØ©"}),e.jsx("p",{className:"text-xs mt-1",children:"ÙØ°Ø§ ÙØ¹Ù٠أ٠اÙÙØ¸Ø§Ù
ÙØ¹Ù
٠بشÙÙ Ø·Ø¨ÙØ¹Ù"})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-secondary/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 text-right text-muted-foreground font-medium",children:"اÙÙÙØ¹"}),e.jsx("th",{className:"p-3 text-right text-muted-foreground font-medium",children:"Ø§ÙØ¹ÙÙØ§Ù"}),e.jsx("th",{className:"p-3 text-right text-muted-foreground font-medium",children:"اÙÙÙØ·Ø©"}),e.jsx("th",{className:"p-3 text-right text-muted-foreground font-medium",children:"اÙÙÙØª"})]})}),e.jsx("tbody",{children:t.recent.map(h=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsx("td",{className:"p-3",children:e.jsx(U,{variant:h.event_type.includes("lockout")?"destructive":"secondary",children:l[h.event_type]||h.event_type})}),e.jsx("td",{className:"p-3 font-mono text-xs text-foreground",children:h.ip_address}),e.jsx("td",{className:"p-3 text-xs text-muted-foreground",children:h.endpoint}),e.jsx("td",{className:"p-3 text-xs text-muted-foreground",dir:"ltr",children:new Date(h.created_at).toLocaleStr
192ing("ar-SA")})]},h.id))})]})})]})]})}const oo=()=>{const[t,s]=o.useState(null),[r,a]=o.useState(!0),[n,c]=o.useState(!1),[l,i]=o.useState([]),[u,p]=o.useState("dashboard"),[b,h]=o.useState(!1);o.useEffect(()=>{const{data:{subscription:d}}=De.auth.onAuthStateChange((x,j)=>{s(j),a(!1)});return De.auth.getSession().then(({data:x})=>{s(x.session),a(!1)}),()=>d.unsubscribe()},[]),o.useEffect(()=>{if(!(t!=null&&t.user)){c(!1),i([]);return}De.from("user_roles").select("role").eq("user_id",t.user.id).then(({data:d})=>{const x=(d||[]).map(j=>j.role);i(x),c(x.length>0)})},[t]);const g=async()=>{await De.auth.signOut(),s(null),c(!1),i([])};if(r)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(Y,{className:"w-8 h-8 animate-spin text-primary"})});if(!t)return e.jsx($a,{onLoggedIn:()=>{}});if(!n)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",dir:"rtl",children:e.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-lg border border-border text-center",children:[e.jsx(Me,{className:"w-12 h-12 text-destructive mx-auto mb-3"}),e.jsx("h1",{className:"text-xl font-bold text-foreground mb-2",children:"ÙÙØ³ ÙØ¯ÙÙ ØµÙØ§ØÙات"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"ÙØ°Ø§ Ø§ÙØØ³Ø§Ø¨ ÙÙØ³ Ù
سؤÙÙØ§Ù"}),e.jsx(E,{onClick:g,children:"تسجÙÙ Ø§ÙØ®Ø±Ùج"})]})});const N=l.includes("super_admin")||l.includes("admin"),S=[{id:"dashboard",label:"ÙÙØØ© اÙÙ
ؤشرات",icon:qs},{id:"bookings",label:"Ø§ÙØØ¬ÙØ²Ø§Øª",icon:Ye},{id:"chalets",label:"Ø§ÙØ´Ø§ÙÙÙØ§Øª",icon:ar},{id:"site-images",label:"ØµÙØ± اÙÙ
ÙÙØ¹",icon:he},{id:"pricing",label:"Ø§ÙØ£Ø³Ø¹Ø§Ø±",icon:Vs},{id:"demand",label:"ÙÙØ§Ø¹Ø¯ Ø§ÙØ·Ùب",icon:_t},{id:"availability",label:"Ø§ÙØªÙÙØ±",icon:Is},{id:"reviews",label:"Ø§ÙØªÙÙÙÙ
ات",icon:or},...N?[{id:"users",label:"اÙÙ
ستخدÙ
ÙÙ",icon:nr}]:[],{id:"security",label:"Ø§ÙØ£Ù
اÙ",icon:xt}];return e.jsxs("div",{className:"min-h-screen bg-background",dir:"rtl",children:[e.jsx("header",{className:"bg-card border-b border-border sticky top-0 z-50",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>h(!b),className:"lg:hidden p-1.5 rounded-lg hover:bg-secondary transition-colors",children:e.jsx(Xs,{className:"w-5 h-5 text-foreground"})}),e.jsx("h1",{className:"text-lg font-black text-foreground",children:"ÙÙØØ© Ø§ÙØªØÙÙ
"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground hidden sm:block",children:t.user.email}),e.jsx(E,{variant:"outline",size:"sm",onClick:g,children:e.jsx(Ys,{className:"w-4 h-4"})})]})]})}),e.jsxs("div",{className:"flex",children:[e.jsx("aside",{className:"hidden lg:block w-56 border-e border-border bg-card min-h-[calc(100vh-57px)] sticky top-[57px]",children:e.jsx("nav",{className:"p-3 space-y-1",children:S.map(d=>e.jsxs("button",{onClick:()=>p(d.id),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm font-medium transition-colors ${u===d.id?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,children:[e.jsx(d.icon,{className:"w-4 h-4"}),d.label]},d.id))})}),b&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:()=>h(!1)}),e.jsxs("aside",{className:"fixed top-0 start-0 h-full w-64 bg-card border-e border-border z-50 lg:hidden shadow-2xl",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsx("h2",{className:"font-bold text-foreground",children:"اÙÙØ§Ø¦Ù
Ø©"}),e.jsx("button",{onClick:()=>h(!1),className:"p-1.5 rounded-lg hover:bg-secondary",children:e.jsx(er,{className:"w-5 h-5 text-foreground"})})]}),e.jsx("nav",{className:"p-3 space-y-1",children:S.map(d=>e.jsxs("button",{onClick:()=>{p(d.id),h(!1)},className:`w-full flex items-center gap-3 px-3 py-3 rounded-xl text-sm font-medium transition-colors ${u===d.id?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,children:[e.jsx(d.icon,{className:"w-5 h-5"}),d.label]},d.id))})]})]}),e.jsxs("main",{className:"flex-1 max-w-7xl p-4",children:[u==="dashboard"&&e.jsx(za,{}),u==="bookings"&&e.jsx(Ua,{}),u==="chalets"&&e.jsx(Va,{}),u==="site-images"&&e.jsx(Wa,{}),u==="pricing"&&e.jsx(Ha,{}),u==="demand"&&e.jsx(Ka,{}),u==="availability"&&e.jsx(qa,{}),u==="reviews"&&e.jsx(Ga,{}),u==="users"&&e.jsx(Ya,{}),u==="security"&&e.jsx(Xa,{})]})]})]})};export{oo as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.