popsite-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.jsx +95 -0
- package/README.md +92 -0
- package/components/layout/PortalHeader.jsx +18 -0
- package/components/layout/SystemSidebar.jsx +33 -0
- package/components/modules/AnalyticsDashboardModule.jsx +17 -0
- package/components/modules/ChatMessagingModule.jsx +17 -0
- package/components/modules/EcommerceStoreModule.jsx +17 -0
- package/components/modules/EventTicketBookingModule.jsx +17 -0
- package/components/modules/FlightBookingModule.jsx +17 -0
- package/components/modules/FoodOrderingModule.jsx +17 -0
- package/components/modules/HospitalAppointmentModule.jsx +17 -0
- package/components/modules/HotelBookingModule.jsx +17 -0
- package/components/modules/InvoiceBillingModule.jsx +17 -0
- package/components/modules/LibraryManagementModule.jsx +17 -0
- package/components/modules/ModuleContentDeck.jsx +44 -0
- package/components/modules/MovieBookingModule.jsx +17 -0
- package/components/modules/QuizExamModule.jsx +17 -0
- package/components/modules/StudentRegistrationModule.jsx +17 -0
- package/components/modules/SystemModuleRenderer.jsx +19 -0
- package/components/modules/SystemModuleTemplate.jsx +62 -0
- package/components/modules/SystemVisualWidget.jsx +123 -0
- package/components/modules/moduleContentMap.js +238 -0
- package/components/modules/moduleEnhancementsMap.js +439 -0
- package/components/modules/systemModuleMap.js +31 -0
- package/components/system/DynamicSystemForm.jsx +154 -0
- package/components/system/SystemHero.jsx +21 -0
- package/components/system/SystemSummaryCard.jsx +53 -0
- package/data/systems/analyticsDashboard.js +48 -0
- package/data/systems/chatMessaging.js +43 -0
- package/data/systems/ecommerceStore.js +50 -0
- package/data/systems/eventTicketBooking.js +50 -0
- package/data/systems/flightBooking.js +38 -0
- package/data/systems/foodOrdering.js +48 -0
- package/data/systems/hospitalAppointment.js +50 -0
- package/data/systems/hotelBooking.js +38 -0
- package/data/systems/index.js +31 -0
- package/data/systems/invoiceBilling.js +50 -0
- package/data/systems/libraryManagement.js +43 -0
- package/data/systems/movieBooking.js +48 -0
- package/data/systems/quizExam.js +38 -0
- package/data/systems/studentRegistration.js +43 -0
- package/dist/popsite-ui.es.js +4368 -0
- package/dist/popsite-ui.umd.js +60 -0
- package/dist/style.css +1 -0
- package/index.html +13 -0
- package/library/index.js +20 -0
- package/main.jsx +15 -0
- package/package.json +40 -0
- package/src/App.jsx +12 -0
- package/src/components/modules/AnalyticsDashboardModule.jsx +224 -0
- package/src/components/modules/ChatMessagingModule.jsx +294 -0
- package/src/components/modules/EcommerceStoreModule.jsx +405 -0
- package/src/components/modules/EventTicketBookingModule.jsx +253 -0
- package/src/components/modules/FlightBookingModule.jsx +399 -0
- package/src/components/modules/FoodOrderingModule.jsx +316 -0
- package/src/components/modules/HospitalAppointmentModule.jsx +267 -0
- package/src/components/modules/HotelBookingModule.jsx +317 -0
- package/src/components/modules/InvoiceBillingModule.jsx +302 -0
- package/src/components/modules/LandingPageModule.jsx +185 -0
- package/src/components/modules/LibraryManagementModule.jsx +189 -0
- package/src/components/modules/MovieBookingModule.jsx +337 -0
- package/src/components/modules/QuizExamModule.jsx +255 -0
- package/src/components/modules/StudentRegistrationModule.jsx +292 -0
- package/src/components/system/SystemHero.jsx +44 -0
- package/src/components/system/SystemSummaryCard.jsx +29 -0
- package/src/components/system/Toast.jsx +69 -0
- package/src/data/systems/analyticsDashboard.js +32 -0
- package/src/data/systems/chatMessaging.js +59 -0
- package/src/data/systems/ecommerceStore.js +84 -0
- package/src/data/systems/eventBooking.js +33 -0
- package/src/data/systems/flightBooking.js +59 -0
- package/src/data/systems/foodOrdering.js +48 -0
- package/src/data/systems/hospitalAppointment.js +48 -0
- package/src/data/systems/hotelBooking.js +59 -0
- package/src/data/systems/invoiceBilling.js +19 -0
- package/src/data/systems/landingPage.js +29 -0
- package/src/data/systems/libraryManagement.js +17 -0
- package/src/data/systems/movieBooking.js +49 -0
- package/src/data/systems/quizExam.js +31 -0
- package/src/data/systems/studentRegistration.js +9 -0
- package/src/index.js +22 -0
- package/src/main.jsx +10 -0
- package/src/styles.css +296 -0
- package/styles.css +820 -0
- package/utils/systemEngine.js +128 -0
- package/vite.config.js +8 -0
- package/vite.lib.config.js +27 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
(function(V,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(V=typeof globalThis<"u"?globalThis:V||self,l(V.PopSiteUI={},V.React))})(this,function(V,l){"use strict";var ke={exports:{}},re={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ie;function tt(){if(Ie)return re;Ie=1;var m=l,d=Symbol.for("react.element"),n=Symbol.for("react.fragment"),j=Object.prototype.hasOwnProperty,x=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,N={key:!0,ref:!0,__self:!0,__source:!0};function h(A,o,T){var u,f={},g=null,M=null;T!==void 0&&(g=""+T),o.key!==void 0&&(g=""+o.key),o.ref!==void 0&&(M=o.ref);for(u in o)j.call(o,u)&&!N.hasOwnProperty(u)&&(f[u]=o[u]);if(A&&A.defaultProps)for(u in o=A.defaultProps,o)f[u]===void 0&&(f[u]=o[u]);return{$$typeof:d,type:A,key:g,ref:M,props:f,_owner:x.current}}return re.Fragment=n,re.jsx=h,re.jsxs=h,re}var ne={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ae;function st(){return Ae||(Ae=1,process.env.NODE_ENV!=="production"&&function(){var m=l,d=Symbol.for("react.element"),n=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),A=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),y=Symbol.iterator,S="@@iterator";function B(s){if(s===null||typeof s!="object")return null;var p=y&&s[y]||s[S];return typeof p=="function"?p:null}var D=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(s){{for(var p=arguments.length,v=new Array(p>1?p-1:0),E=1;E<p;E++)v[E-1]=arguments[E];C("error",s,v)}}function C(s,p,v){{var E=D.ReactDebugCurrentFrame,z=E.getStackAddendum();z!==""&&(p+="%s",v=v.concat([z]));var L=v.map(function(_){return String(_)});L.unshift("Warning: "+p),Function.prototype.apply.call(console[s],console,L)}}var c=!1,b=!1,W=!1,I=!1,r=!1,t;t=Symbol.for("react.module.reference");function a(s){return!!(typeof s=="string"||typeof s=="function"||s===j||s===N||r||s===x||s===T||s===u||I||s===M||c||b||W||typeof s=="object"&&s!==null&&(s.$$typeof===g||s.$$typeof===f||s.$$typeof===h||s.$$typeof===A||s.$$typeof===o||s.$$typeof===t||s.getModuleId!==void 0))}function i(s,p,v){var E=s.displayName;if(E)return E;var z=p.displayName||p.name||"";return z!==""?v+"("+z+")":v}function k(s){return s.displayName||"Context"}function F(s){if(s==null)return null;if(typeof s.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case j:return"Fragment";case n:return"Portal";case N:return"Profiler";case x:return"StrictMode";case T:return"Suspense";case u:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case A:var p=s;return k(p)+".Consumer";case h:var v=s;return k(v._context)+".Provider";case o:return i(s,s.render,"ForwardRef");case f:var E=s.displayName||null;return E!==null?E:F(s.type)||"Memo";case g:{var z=s,L=z._payload,_=z._init;try{return F(_(L))}catch{return null}}}return null}var w=Object.assign,R=0,H,me,he,ue,Me,We,Oe;function _e(){}_e.__reactDisabledLog=!0;function ft(){{if(R===0){H=console.log,me=console.info,he=console.warn,ue=console.error,Me=console.group,We=console.groupCollapsed,Oe=console.groupEnd;var s={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}R++}}function kt(){{if(R--,R===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:w({},s,{value:H}),info:w({},s,{value:me}),warn:w({},s,{value:he}),error:w({},s,{value:ue}),group:w({},s,{value:Me}),groupCollapsed:w({},s,{value:We}),groupEnd:w({},s,{value:Oe})})}R<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ne=D.ReactCurrentDispatcher,we;function xe(s,p,v){{if(we===void 0)try{throw Error()}catch(z){var E=z.stack.trim().match(/\n( *(at )?)/);we=E&&E[1]||""}return`
|
|
18
|
+
`+we+s}}var Se=!1,ge;{var vt=typeof WeakMap=="function"?WeakMap:Map;ge=new vt}function ze(s,p){if(!s||Se)return"";{var v=ge.get(s);if(v!==void 0)return v}var E;Se=!0;var z=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var L;L=Ne.current,Ne.current=null,ft();try{if(p){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(Q){E=Q}Reflect.construct(s,[],_)}else{try{_.call()}catch(Q){E=Q}s.call(_.prototype)}}else{try{throw Error()}catch(Q){E=Q}s()}}catch(Q){if(Q&&E&&typeof Q.stack=="string"){for(var O=Q.stack.split(`
|
|
19
|
+
`),G=E.stack.split(`
|
|
20
|
+
`),Y=O.length-1,U=G.length-1;Y>=1&&U>=0&&O[Y]!==G[U];)U--;for(;Y>=1&&U>=0;Y--,U--)if(O[Y]!==G[U]){if(Y!==1||U!==1)do if(Y--,U--,U<0||O[Y]!==G[U]){var K=`
|
|
21
|
+
`+O[Y].replace(" at new "," at ");return s.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",s.displayName)),typeof s=="function"&&ge.set(s,K),K}while(Y>=1&&U>=0);break}}}finally{Se=!1,Ne.current=L,kt(),Error.prepareStackTrace=z}var ie=s?s.displayName||s.name:"",se=ie?xe(ie):"";return typeof s=="function"&&ge.set(s,se),se}function bt(s,p,v){return ze(s,!1)}function jt(s){var p=s.prototype;return!!(p&&p.isReactComponent)}function ye(s,p,v){if(s==null)return"";if(typeof s=="function")return ze(s,jt(s));if(typeof s=="string")return xe(s);switch(s){case T:return xe("Suspense");case u:return xe("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case o:return bt(s.render);case f:return ye(s.type,p,v);case g:{var E=s,z=E._payload,L=E._init;try{return ye(L(z),p,v)}catch{}}}return""}var oe=Object.prototype.hasOwnProperty,Le={},Ve=D.ReactDebugCurrentFrame;function fe(s){if(s){var p=s._owner,v=ye(s.type,s._source,p?p.type:null);Ve.setExtraStackFrame(v)}else Ve.setExtraStackFrame(null)}function Nt(s,p,v,E,z){{var L=Function.call.bind(oe);for(var _ in s)if(L(s,_)){var O=void 0;try{if(typeof s[_]!="function"){var G=Error((E||"React class")+": "+v+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw G.name="Invariant Violation",G}O=s[_](p,_,E,v,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){O=Y}O&&!(O instanceof Error)&&(fe(z),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",v,_,typeof O),fe(null)),O instanceof Error&&!(O.message in Le)&&(Le[O.message]=!0,fe(z),P("Failed %s type: %s",v,O.message),fe(null))}}}var wt=Array.isArray;function Ce(s){return wt(s)}function St(s){{var p=typeof Symbol=="function"&&Symbol.toStringTag,v=p&&s[Symbol.toStringTag]||s.constructor.name||"Object";return v}}function Ct(s){try{return He(s),!1}catch{return!0}}function He(s){return""+s}function Ye(s){if(Ct(s))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",St(s)),He(s)}var Ue=D.ReactCurrentOwner,Tt={key:!0,ref:!0,__self:!0,__source:!0},Ge,Je;function Bt(s){if(oe.call(s,"ref")){var p=Object.getOwnPropertyDescriptor(s,"ref").get;if(p&&p.isReactWarning)return!1}return s.ref!==void 0}function Rt(s){if(oe.call(s,"key")){var p=Object.getOwnPropertyDescriptor(s,"key").get;if(p&&p.isReactWarning)return!1}return s.key!==void 0}function Dt(s,p){typeof s.ref=="string"&&Ue.current}function It(s,p){{var v=function(){Ge||(Ge=!0,P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",p))};v.isReactWarning=!0,Object.defineProperty(s,"key",{get:v,configurable:!0})}}function At(s,p){{var v=function(){Je||(Je=!0,P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",p))};v.isReactWarning=!0,Object.defineProperty(s,"ref",{get:v,configurable:!0})}}var Pt=function(s,p,v,E,z,L,_){var O={$$typeof:d,type:s,key:p,ref:v,props:_,_owner:L};return O._store={},Object.defineProperty(O._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(O,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(O,"_source",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.freeze&&(Object.freeze(O.props),Object.freeze(O)),O};function Et(s,p,v,E,z){{var L,_={},O=null,G=null;v!==void 0&&(Ye(v),O=""+v),Rt(p)&&(Ye(p.key),O=""+p.key),Bt(p)&&(G=p.ref,Dt(p,z));for(L in p)oe.call(p,L)&&!Tt.hasOwnProperty(L)&&(_[L]=p[L]);if(s&&s.defaultProps){var Y=s.defaultProps;for(L in Y)_[L]===void 0&&(_[L]=Y[L])}if(O||G){var U=typeof s=="function"?s.displayName||s.name||"Unknown":s;O&&It(_,U),G&&At(_,U)}return Pt(s,O,G,z,E,Ue.current,_)}}var Te=D.ReactCurrentOwner,Qe=D.ReactDebugCurrentFrame;function ae(s){if(s){var p=s._owner,v=ye(s.type,s._source,p?p.type:null);Qe.setExtraStackFrame(v)}else Qe.setExtraStackFrame(null)}var Be;Be=!1;function Re(s){return typeof s=="object"&&s!==null&&s.$$typeof===d}function Xe(){{if(Te.current){var s=F(Te.current.type);if(s)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+s+"`."}return""}}function Ft(s){return""}var Ke={};function Mt(s){{var p=Xe();if(!p){var v=typeof s=="string"?s:s.displayName||s.name;v&&(p=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+v+">.")}return p}}function Ze(s,p){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var v=Mt(p);if(Ke[v])return;Ke[v]=!0;var E="";s&&s._owner&&s._owner!==Te.current&&(E=" It was passed a child from "+F(s._owner.type)+"."),ae(s),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',v,E),ae(null)}}function qe(s,p){{if(typeof s!="object")return;if(Ce(s))for(var v=0;v<s.length;v++){var E=s[v];Re(E)&&Ze(E,p)}else if(Re(s))s._store&&(s._store.validated=!0);else if(s){var z=B(s);if(typeof z=="function"&&z!==s.entries)for(var L=z.call(s),_;!(_=L.next()).done;)Re(_.value)&&Ze(_.value,p)}}}function Wt(s){{var p=s.type;if(p==null||typeof p=="string")return;var v;if(typeof p=="function")v=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===o||p.$$typeof===f))v=p.propTypes;else return;if(v){var E=F(p);Nt(v,s.props,"prop",E,s)}else if(p.PropTypes!==void 0&&!Be){Be=!0;var z=F(p);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",z||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ot(s){{for(var p=Object.keys(s.props),v=0;v<p.length;v++){var E=p[v];if(E!=="children"&&E!=="key"){ae(s),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),ae(null);break}}s.ref!==null&&(ae(s),P("Invalid attribute `ref` supplied to `React.Fragment`."),ae(null))}}var $e={};function et(s,p,v,E,z,L){{var _=a(s);if(!_){var O="";(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(O+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var G=Ft();G?O+=G:O+=Xe();var Y;s===null?Y="null":Ce(s)?Y="array":s!==void 0&&s.$$typeof===d?(Y="<"+(F(s.type)||"Unknown")+" />",O=" Did you accidentally export a JSX literal instead of a component?"):Y=typeof s,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Y,O)}var U=Et(s,p,v,z,L);if(U==null)return U;if(_){var K=p.children;if(K!==void 0)if(E)if(Ce(K)){for(var ie=0;ie<K.length;ie++)qe(K[ie],s);Object.freeze&&Object.freeze(K)}else P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else qe(K,s)}if(oe.call(p,"key")){var se=F(s),Q=Object.keys(p).filter(function(Yt){return Yt!=="key"}),De=Q.length>0?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[se+De]){var Ht=Q.length>0?"{"+Q.join(": ..., ")+": ...}":"{}";P(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,De,se,Ht,se),$e[se+De]=!0}}return s===j?Ot(U):Wt(U),U}}function _t(s,p,v){return et(s,p,v,!0)}function zt(s,p,v){return et(s,p,v,!1)}var Lt=zt,Vt=_t;ne.Fragment=j,ne.jsx=Lt,ne.jsxs=Vt}()),ne}process.env.NODE_ENV==="production"?ke.exports=tt():ke.exports=st();var e=ke.exports;const de={storeName:"PopSite Originals",categories:["All","Apparel","Accessories","Footwear","Tech"],products:[{id:"p1",name:"Prismatic Hoodie",price:89.99,category:"Apparel",image:"https://images.unsplash.com/photo-1556821840-3a63f95609a7?auto=format&fit=crop&w=800&q=80",description:"Premium cotton hoodie featuring a subtle iridescent logo. Perfect for chilly evenings and casual flexes.",sizes:["S","M","L","XL"],colors:["Black","Heather Grey","Lavender"],inStock:!0,rating:4.8,reviews:124},{id:"p2",name:"Aerodynamic Runners",price:145,category:"Footwear",image:"https://images.unsplash.com/photo-1542291026-7eec264c27ff?auto=format&fit=crop&w=800&q=80",description:"Ultralight sneakers designed for maximum comfort. Carbon-infused sole brings explosive returns.",sizes:["8","9","10","11","12"],colors:["Neon Red","Obsidian"],inStock:!0,rating:4.9,reviews:89},{id:"p3",name:"Minimalist Chronograph",price:210,category:"Accessories",image:"https://images.unsplash.com/photo-1523275335684-37898b6baf30?auto=format&fit=crop&w=800&q=80",description:"Matte black stainless steel with a sleek sapphire crystal face. Water resistant to 50 meters.",sizes:["One Size"],colors:["Matte Black"],inStock:!1,rating:4.7,reviews:56},{id:"p4",name:"Noise-Cancelling Pods Pro",price:199.99,category:"Tech",image:"https://images.unsplash.com/photo-1606220588913-b3aecb2ac201?auto=format&fit=crop&w=800&q=80",description:"Immersive audio experience with active noise cancellation and 24-hour battery life.",sizes:[],colors:["White","Space Gray"],inStock:!0,rating:4.5,reviews:210},{id:"p5",name:"Urban Backpack",price:75,category:"Accessories",image:"https://images.unsplash.com/photo-1553062407-98eeb64c6a62?auto=format&fit=crop&w=800&q=80",description:"Water-resistant commuter backpack with padded laptop sleeve and hidden anti-theft pockets.",sizes:["One Size"],colors:["Charcoal","Olive Drab"],inStock:!0,rating:4.6,reviews:178},{id:"p6",name:"Graphic Tee - The Wave",price:35,category:"Apparel",image:"https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?auto=format&fit=crop&w=800&q=80",description:"Heavyweight boxy organic cotton tee with a retro wave graphic.",sizes:["S","M","L"],colors:["White","Sand"],inStock:!0,rating:4.3,reviews:45}]};function Pe({message:m,type:d="success",onClose:n,duration:j=3e3}){const[x,N]=l.useState(!0);return l.useEffect(()=>{const h=setTimeout(()=>{N(!1),setTimeout(()=>{n&&n()},300)},j);return()=>clearTimeout(h)},[j,n]),!x&&!n?null:e.jsxs("div",{className:`pk-toast ${d} ${x?"":"pk-fade-out"}`,style:{opacity:x?1:0,transition:"opacity 0.3s ease-out"},children:[e.jsx("div",{style:{fontSize:"1.25rem"},children:d==="success"?"✅":d==="error"?"❌":"ℹ️"}),e.jsxs("div",{style:{flex:1},children:[e.jsx("p",{className:"pk-label",style:{margin:0,textTransform:"capitalize"},children:d}),e.jsx("p",{className:"pk-text-sm",style:{margin:0},children:m})]}),e.jsx("button",{onClick:()=>{N(!1),n&&setTimeout(n,300)},style:{background:"none",border:"none",cursor:"pointer",fontSize:"1.25rem",color:"var(--pk-text-muted)"},children:"×"})]})}function J(){const[m,d]=l.useState([]),n=(N,h="success")=>{const A=Date.now();d(o=>[...o,{id:A,message:N,type:h}])},j=N=>{d(h=>h.filter(A=>A.id!==N))};return{showToast:n,ToastContainer:()=>e.jsx("div",{className:"pk-toast-container",children:m.map(N=>e.jsx(Pe,{message:N.message,type:N.type,onClose:()=>j(N.id)},N.id))})}}function at(){const[m,d]=l.useState("grid"),[n,j]=l.useState(null),[x,N]=l.useState([]),[h,A]=l.useState(""),[o,T]=l.useState("All"),[u,f]=l.useState(!1),{showToast:g,ToastContainer:M}=J();l.useEffect(()=>{const t=localStorage.getItem("popsite_cart");if(t)try{N(JSON.parse(t))}catch{console.error("Failed to parse cart")}},[]),l.useEffect(()=>{localStorage.setItem("popsite_cart",JSON.stringify(x))},[x]);const y=(t,a=1500)=>{f(!0),setTimeout(()=>{f(!1),t()},a)},S=t=>{window.scrollTo({top:0,behavior:"smooth"}),j({...t,selectedSize:t.sizes[0]||null,selectedColor:t.colors[0]||null}),d("details")},B=()=>{if(!n.inStock){g("Product is currently out of stock","error");return}const t=x.findIndex(i=>i.id===n.id&&i.selectedSize===n.selectedSize&&i.selectedColor===n.selectedColor),a=[...x];t>=0?a[t].quantity+=1:a.push({...n,quantity:1}),N(a),g(`${n.name} added to cart!`,"success")},D=t=>{const a=[...x];a.splice(t,1),N(a),g("Item removed from cart","info")},P=()=>{if(x.length===0){g("Your cart is empty","error");return}y(()=>{d("success"),N([]),g("Order placed successfully!","success")})},C=()=>{const t=`ID,Name,Category,Price,InStock,Rating
|
|
31
|
+
`,a=de.products.map(w=>`${w.id},"${w.name}","${w.category}",${w.price},${w.inStock},${w.rating}`).join(`
|
|
32
|
+
`),i=new Blob([t+a],{type:"text/csv"}),k=URL.createObjectURL(i),F=document.createElement("a");F.href=k,F.download=`products_export_${Date.now()}.csv`,F.click(),g("Catalog exported to CSV","success")},c=x.reduce((t,a)=>t+a.price*a.quantity,0),b=()=>{const t=de.products.filter(a=>{const i=a.name.toLowerCase().includes(h.toLowerCase()),k=o==="All"||a.category===o;return i&&k});return e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginBottom:"2rem",flexWrap:"wrap",gap:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"pk-heading-lg",style:{marginBottom:"0.5rem"},children:de.storeName}),e.jsx("p",{className:"pk-text-body",children:"Discover premium gear for modern living."})]}),e.jsxs("div",{className:"pk-flex pk-items-center",style:{gap:"1rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:C,children:"⬇️ Export CSV"}),e.jsxs("button",{className:"pk-btn pk-btn-primary",onClick:()=>d("checkout"),children:["🛒 Cart (",x.length,")"]})]})]}),e.jsxs("div",{className:"pk-card pk-glass",style:{padding:"1.5rem",marginBottom:"2rem",display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"center"},children:[e.jsx("div",{className:"pk-input-group",style:{margin:0,flex:1,minWidth:"250px"},children:e.jsx("input",{type:"text",className:"pk-input",placeholder:"Search products...",value:h,onChange:a=>A(a.target.value)})}),e.jsx("div",{className:"pk-flex",style:{gap:"0.5rem",overflowX:"auto",paddingBottom:"4px"},children:de.categories.map(a=>e.jsx("button",{className:o===a?"pk-badge":"pk-btn pk-btn-outline",style:o!==a?{padding:"0.25rem 0.75rem",borderRadius:"var(--pk-radius-full)",border:"1px solid var(--pk-border)"}:{cursor:"pointer"},onClick:()=>T(a),children:a},a))})]}),t.length===0?e.jsxs("div",{className:"pk-empty-state",children:[e.jsx("div",{className:"pk-empty-icon",children:"🏜️"}),e.jsx("h3",{className:"pk-heading-md",children:"No products found"}),e.jsx("p",{className:"pk-text-body",children:"Try adjusting your filters or search query."}),e.jsx("button",{className:"pk-btn pk-btn-secondary",style:{marginTop:"1rem"},onClick:()=>{A(""),T("All")},children:"Clear Filters"})]}):e.jsx("div",{className:"pk-grid pk-grid-responsive",children:t.map(a=>e.jsxs("div",{className:"pk-card pk-card-interactive",onClick:()=>S(a),style:{cursor:"pointer",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{height:"250px",width:"100%",overflow:"hidden",backgroundColor:"var(--pk-primary-light)"},children:[e.jsx("img",{src:a.image,alt:a.name,className:"pk-object-cover pk-w-full pk-h-full",style:{transition:"transform 0.5s"},onError:i=>{i.target.style.display="none",i.target.nextSibling.style.display="flex"}}),e.jsx("div",{style:{display:"none",width:"100%",height:"100%",background:"linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))",color:"white",alignItems:"center",justifyContent:"center",fontSize:"2rem",fontWeight:"bold"},children:a.name.substring(0,2).toUpperCase()})]}),e.jsxs("div",{className:"pk-card-body",style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginBottom:"0.5rem"},children:[e.jsx("span",{className:"pk-badge",children:a.category}),e.jsxs("span",{style:{fontSize:"0.875rem",color:"#f59e0b",fontWeight:600},children:["★ ",a.rating]})]}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"0.5rem"},children:a.name}),e.jsx("div",{className:"pk-text-body",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",marginBottom:"1rem",flex:1},children:a.description}),e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginTop:"auto"},children:[e.jsxs("span",{className:"pk-heading-md",style:{color:"var(--pk-primary)"},children:["$",a.price.toFixed(2)]}),!a.inStock&&e.jsx("span",{className:"pk-text-sm",style:{color:"var(--pk-danger)"},children:"Out of Stock"})]})]})]},a.id))})]})},W=()=>{if(!n)return null;const t=n;return e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{marginBottom:"2rem"},onClick:()=>d("grid"),children:"← Back to Catalog"}),e.jsxs("div",{className:"pk-card",style:{display:"flex",flexWrap:"wrap"},children:[e.jsxs("div",{style:{flex:"1 1 400px",height:"500px",backgroundColor:"var(--pk-primary-light)",padding:"2rem"},children:[e.jsx("img",{src:t.image,alt:t.name,className:"pk-object-cover pk-w-full pk-h-full",style:{borderRadius:"var(--pk-radius-lg)",boxShadow:"var(--pk-shadow-lg)"},onError:a=>{a.target.style.display="none",a.target.nextSibling.style.display="flex"}}),e.jsx("div",{style:{display:"none",width:"100%",height:"100%",background:"linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))",color:"white",alignItems:"center",justifyContent:"center",fontSize:"4rem",fontWeight:"bold",borderRadius:"var(--pk-radius-lg)",boxShadow:"var(--pk-shadow-lg)"},children:t.name.substring(0,2).toUpperCase()})]}),e.jsxs("div",{style:{flex:"1 1 400px",padding:"3rem"},children:[e.jsxs("div",{className:"pk-flex pk-items-center",style:{gap:"1rem",marginBottom:"1rem"},children:[e.jsx("span",{className:"pk-badge",children:t.category}),e.jsxs("span",{style:{fontSize:"1rem",color:"#f59e0b",fontWeight:600},children:["★ ",t.rating," (",t.reviews," reviews)"]})]}),e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:t.name}),e.jsxs("p",{className:"pk-heading-lg",style:{color:"var(--pk-primary)",marginBottom:"1.5rem"},children:["$",t.price.toFixed(2)]}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.125rem",marginBottom:"2rem"},children:t.description}),t.sizes&&t.sizes.length>0&&e.jsxs("div",{style:{marginBottom:"1.5rem"},children:[e.jsx("h4",{className:"pk-label",style:{marginBottom:"0.5rem"},children:"Select Size"}),e.jsx("div",{className:"pk-flex",style:{gap:"0.5rem",flexWrap:"wrap"},children:t.sizes.map(a=>e.jsx("button",{className:t.selectedSize===a?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",style:{padding:"0.5rem 1rem"},onClick:()=>j({...t,selectedSize:a}),children:a},a))})]}),t.colors&&t.colors.length>0&&e.jsxs("div",{style:{marginBottom:"2.5rem"},children:[e.jsx("h4",{className:"pk-label",style:{marginBottom:"0.5rem"},children:"Select Color"}),e.jsx("div",{className:"pk-flex",style:{gap:"0.5rem",flexWrap:"wrap"},children:t.colors.map(a=>e.jsx("button",{className:t.selectedColor===a?"pk-btn pk-btn-secondary":"pk-btn pk-btn-outline",onClick:()=>j({...t,selectedColor:a}),children:a},a))})]}),e.jsx("button",{className:`pk-btn pk-btn-primary pk-w-full ${t.inStock?"":"pk-btn-outline"}`,style:{fontSize:"1.25rem",padding:"1rem"},disabled:!t.inStock,onClick:B,children:t.inStock?"🛒 Add to Cart":"Out of Stock"})]})]})]})},I=()=>e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginBottom:"2rem"},children:[e.jsx("h1",{className:"pk-heading-lg",children:"Your Cart"}),e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>d("grid"),children:"Keep Shopping"})]}),x.length===0?e.jsxs("div",{className:"pk-empty-state",children:[e.jsx("div",{className:"pk-empty-icon",children:"🛍️"}),e.jsx("h3",{className:"pk-heading-md",children:"Your cart is empty"}),e.jsx("p",{className:"pk-text-body",style:{marginBottom:"2rem"},children:"Looks like you haven't added anything yet."}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>d("grid"),children:"Start Shopping"})]}):e.jsxs("div",{className:"pk-grid",style:{gridTemplateColumns:"minmax(300px, 2fr) minmax(300px, 1fr)"},children:[e.jsx("div",{className:"pk-flex pk-flex-col pk-gap-4",children:x.map((t,a)=>e.jsxs("div",{className:"pk-card pk-flex pk-items-center",style:{padding:"1rem",gap:"1.5rem"},children:[e.jsx("div",{style:{width:"100px",height:"100px",borderRadius:"var(--pk-radius-md)",overflow:"hidden",background:"var(--pk-primary-light)"},children:e.jsx("img",{src:t.image,alt:t.name,className:"pk-object-cover pk-w-full pk-h-full"})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h3",{className:"pk-heading-md",style:{fontSize:"1.25rem",marginBottom:"0.25rem"},children:t.name}),e.jsxs("p",{className:"pk-text-sm",children:[t.selectedColor&&`Color: ${t.selectedColor}`,t.selectedColor&&t.selectedSize&&" | ",t.selectedSize&&`Size: ${t.selectedSize}`]}),e.jsxs("p",{className:"pk-text-body",style:{fontWeight:600,marginTop:"0.5rem"},children:["Qty: ",t.quantity]})]}),e.jsxs("div",{className:"pk-flex pk-flex-col pk-items-center",style:{gap:"1rem",minWidth:"80px",alignItems:"flex-end"},children:[e.jsxs("span",{className:"pk-heading-md",children:["$",(t.price*t.quantity).toFixed(2)]}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{padding:"0.25rem 0.5rem",color:"var(--pk-danger)",border:"none",background:"var(--pk-danger-light)"},onClick:()=>D(a),children:"Remove"})]})]},a))}),e.jsx("div",{children:e.jsxs("div",{className:"pk-card",style:{position:"sticky",top:"100px"},children:[e.jsx("div",{className:"pk-card-header",children:e.jsx("h3",{className:"pk-heading-md",children:"Order Summary"})}),e.jsxs("div",{className:"pk-card-body pk-flex pk-flex-col pk-gap-4",children:[e.jsxs("div",{className:"pk-flex pk-justify-between",children:[e.jsx("span",{className:"pk-text-body",children:"Subtotal"}),e.jsxs("span",{style:{fontWeight:600},children:["$",c.toFixed(2)]})]}),e.jsxs("div",{className:"pk-flex pk-justify-between",children:[e.jsx("span",{className:"pk-text-body",children:"Shipping"}),e.jsx("span",{style:{fontWeight:600},children:"Free"})]}),e.jsxs("div",{className:"pk-flex pk-justify-between",children:[e.jsx("span",{className:"pk-text-body",children:"Tax (Estimated)"}),e.jsxs("span",{style:{fontWeight:600},children:["$",(c*.08).toFixed(2)]})]}),e.jsx("hr",{style:{border:0,borderTop:"1px solid var(--pk-border)",margin:"0.5rem 0"}}),e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",children:[e.jsx("span",{className:"pk-heading-md",children:"Total"}),e.jsxs("span",{className:"pk-heading-lg",style:{color:"var(--pk-primary)"},children:["$",(c*1.08).toFixed(2)]})]}),e.jsx("button",{className:"pk-btn pk-btn-primary pk-w-full",style:{marginTop:"1rem",fontSize:"1.25rem",padding:"1rem"},onClick:P,children:"Proceed to Payment"})]})]})})]})]}),r=()=>e.jsx("div",{className:"pk-container animate-fade-in",style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60vh"},children:e.jsxs("div",{className:"pk-card pk-text-center",style:{padding:"4rem 2rem",maxWidth:"600px"},children:[e.jsx("div",{style:{fontSize:"5rem",marginBottom:"1rem"},children:"🎉"}),e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:"Order Confirmed!"}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem",marginBottom:"2rem"},children:"Thank you for your purchase. We've sent a receipt to your email and your items will ship shortly."}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>d("grid"),children:"Return to Store"})]})});return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)"},children:[u&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.7)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Processing..."})]}),e.jsx("style",{children:`
|
|
33
|
+
.animate-fade-in { animation: popsiteFadeIn 0.4s ease-out; }
|
|
34
|
+
@keyframes popsiteFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
|
35
|
+
`}),m==="grid"&&b(),m==="details"&&W(),m==="checkout"&&I(),m==="success"&&r(),e.jsx(M,{})]})}const ee={cinemaName:"Starlight Cinemas",movies:[{id:"m1",title:"Neon Horizon",genre:"Sci-Fi / Cyberpunk",runtime:"2h 15m",rating:"PG-13",image:"https://images.unsplash.com/photo-1536440136628-849c177e76a1?auto=format&fit=crop&w=800&q=80",synopsis:"In a dystopian cyberpunk future, a rogue hacker discovers a code that could alter reality itself.",showtimes:["14:00","17:30","20:00","22:45"]},{id:"m2",title:"The Silent Peak",genre:"Thriller / Mystery",runtime:"1h 50m",rating:"R",image:"https://images.unsplash.com/photo-1478720568477-152d9b164e26?auto=format&fit=crop&w=800&q=80",synopsis:"A group of mountaineers gets trapped during a blizzard, only to realize they are not alone on the mountain.",showtimes:["15:15","18:45","21:30"]},{id:"m3",title:"Echoes of Eternity",genre:"Romance / Drama",runtime:"2h 05m",rating:"PG",image:"https://images.unsplash.com/photo-1485846234645-a62644f84728?auto=format&fit=crop&w=800&q=80",synopsis:"Two lovers from different centuries communicate through an ancient artifact, fighting time to be together.",showtimes:["13:00","16:00","19:00"]},{id:"m4",title:"Galactic Drift",genre:"Action / Adventure",runtime:"2h 30m",rating:"PG-13",image:"https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=800&q=80",synopsis:"An epic space opera following a band of smugglers trying to outrun a massive intergalactic empire.",showtimes:["12:00","16:30","20:15","23:00"]}],pricing:{standard:12,vip:25}};function it(){const[m,d]=l.useState("grid"),[n,j]=l.useState(null),[x,N]=l.useState(""),[h,A]=l.useState([]),[o,T]=l.useState([]),[u,f]=l.useState(""),[g,M]=l.useState(!1),{showToast:y,ToastContainer:S}=J();l.useEffect(()=>{const t=localStorage.getItem("popsite_movie_tickets");if(t)try{T(JSON.parse(t))}catch{}},[]),l.useEffect(()=>{o.length>0&&localStorage.setItem("popsite_movie_tickets",JSON.stringify(o))},[o]);const B=(t,a=1500)=>{M(!0),setTimeout(()=>{M(!1),t()},a)},D=t=>{window.scrollTo({top:0,behavior:"smooth"}),j(t),N(""),A([]),d("details")},P=t=>{A(a=>a.includes(t)?a.filter(i=>i!==t):[...a,t])},C=()=>h.reduce((t,a)=>{const i=a.startsWith("V");return t+(i?ee.pricing.vip:ee.pricing.standard)},0),c=()=>{if(h.length===0){y("Please select at least one seat","error");return}B(()=>{const t={id:`TK-${Math.floor(Math.random()*1e5)}`,movie:n,showtime:x,seats:h,total:C()};T(a=>[...a,t]),y("Payment successful! Enjoy the movie.","success"),d("ticket")})},b=()=>{const t=ee.movies.filter(a=>a.title.toLowerCase().includes(u.toLowerCase())||a.genre.toLowerCase().includes(u.toLowerCase()));return e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginBottom:"2rem"},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"pk-heading-lg",style:{marginBottom:"0.5rem"},children:ee.cinemaName}),e.jsx("p",{className:"pk-text-body",children:"Experience the magic of cinema."})]}),e.jsxs("button",{className:"pk-btn pk-btn-outline",onClick:()=>{o.length>0?d("ticket"):y("No tickets booked yet.","info")},children:["🎫 My Tickets (",o.length,")"]})]}),e.jsx("div",{className:"pk-card pk-glass",style:{padding:"1.5rem",marginBottom:"2rem"},children:e.jsx("input",{type:"text",className:"pk-input pk-w-full",placeholder:"Search movies by title or genre...",value:u,onChange:a=>f(a.target.value)})}),t.length===0?e.jsxs("div",{className:"pk-empty-state",children:[e.jsx("div",{className:"pk-empty-icon",children:"🍿"}),e.jsx("h3",{className:"pk-heading-md",children:"No movies found"})]}):e.jsx("div",{className:"pk-grid pk-grid-responsive",children:t.map(a=>e.jsxs("div",{className:"pk-card pk-card-interactive",onClick:()=>D(a),style:{cursor:"pointer"},children:[e.jsxs("div",{style:{height:"350px",background:"var(--pk-primary-light)"},children:[e.jsx("img",{src:a.image,alt:a.title,className:"pk-w-full pk-h-full pk-object-cover",onError:i=>{i.target.style.display="none",i.target.nextSibling.style.display="flex"}}),e.jsx("div",{style:{display:"none",width:"100%",height:"100%",background:"linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))",color:"white",alignItems:"center",justifyContent:"center",fontSize:"2rem",fontWeight:"bold"},children:a.title[0]})]}),e.jsxs("div",{className:"pk-card-body",children:[e.jsx("span",{className:"pk-badge",style:{marginBottom:"0.5rem",display:"inline-block"},children:a.rating}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"0.25rem"},children:a.title}),e.jsxs("p",{className:"pk-text-sm",style:{marginBottom:"0.5rem"},children:[a.genre," • ",a.runtime]})]})]},a.id))})]})},W=()=>e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{marginBottom:"2rem"},onClick:()=>d("grid"),children:"← Back"}),e.jsxs("div",{className:"pk-card pk-flex",style:{overflow:"hidden",flexWrap:"wrap"},children:[e.jsx("div",{style:{flex:"1 1 300px",minHeight:"400px"},children:e.jsx("img",{src:n.image,alt:n.title,className:"pk-w-full pk-h-full pk-object-cover"})}),e.jsxs("div",{style:{flex:"2 1 400px",padding:"3rem"},children:[e.jsxs("div",{className:"pk-flex pk-items-center pk-gap-4",style:{marginBottom:"1rem"},children:[e.jsx("span",{className:"pk-badge",children:n.rating}),e.jsxs("span",{className:"pk-text-sm",children:[n.genre," • ",n.runtime]})]}),e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:n.title}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.125rem",marginBottom:"2rem"},children:n.synopsis}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:"Select Showtime"}),e.jsx("div",{className:"pk-flex",style:{gap:"1rem",flexWrap:"wrap",marginBottom:"2rem"},children:n.showtimes.map(t=>e.jsx("button",{className:x===t?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>N(t),children:t},t))}),e.jsx("button",{className:"pk-btn pk-btn-primary",style:{fontSize:"1.25rem",padding:"1rem 2rem"},disabled:!x,onClick:()=>d("selector"),children:"Continue to Seat Selection"})]})]})]}),I=()=>{const t=["A","B","C","D","E","V1","V2"],a=[1,2,3,4,5,6,7,8,9,10];return e.jsxs("div",{className:"pk-container animate-fade-in pk-flex pk-flex-col pk-items-center",children:[e.jsxs("div",{className:"pk-w-full pk-flex pk-justify-between",style:{marginBottom:"2rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>d("details"),children:"← Back"}),e.jsxs("h2",{className:"pk-heading-md",children:[n.title," - ",x]})]}),e.jsxs("div",{className:"pk-card",style:{padding:"3rem",width:"100%",maxWidth:"800px"},children:[e.jsx("div",{style:{borderBottom:"6px solid var(--pk-primary-light)",paddingBottom:"1rem",textAlign:"center",marginBottom:"3rem",borderRadius:"50% 50% 0 0 / 20px 20px 0 0"},children:e.jsx("span",{className:"pk-text-muted",style:{letterSpacing:"0.5em",textTransform:"uppercase"},children:"Screen"})}),e.jsx("div",{className:"pk-flex pk-flex-col pk-items-center pk-gap-4",children:t.map(i=>e.jsxs("div",{className:"pk-flex pk-items-center",style:{gap:"0.5rem"},children:[e.jsx("span",{style:{width:"30px",textAlign:"center",fontWeight:"bold",color:"var(--pk-text-muted)"},children:i}),e.jsx("div",{className:"pk-flex",style:{gap:"0.5rem"},children:a.map(k=>{const F=`${i}${k}`,w=h.includes(F),R=i.startsWith("V"),H=(i.charCodeAt(0)+k)%7===0;return e.jsx("button",{disabled:H,style:{width:"40px",height:"40px",borderRadius:"8px 8px 4px 4px",border:"none",cursor:H?"not-allowed":"pointer",background:H?"var(--pk-border)":w?"var(--pk-primary)":R?"#f59e0b":"var(--pk-primary-light)",color:w?"white":"transparent",transition:"all 0.2s"},onClick:()=>P(F),children:w?"✓":""},F)})}),e.jsx("span",{style:{width:"30px"}})]},i))}),e.jsxs("div",{className:"pk-flex pk-justify-center",style:{marginTop:"3rem",gap:"2rem"},children:[e.jsxs("div",{className:"pk-flex pk-items-center pk-gap-4",children:[e.jsx("div",{style:{width:20,height:20,background:"var(--pk-border)",borderRadius:"4px"}})," Unavailable"]}),e.jsxs("div",{className:"pk-flex pk-items-center pk-gap-4",style:{gap:"0.5rem"},children:[e.jsx("div",{style:{width:20,height:20,background:"var(--pk-primary-light)",borderRadius:"4px"}})," Standard ($",ee.pricing.standard,")"]}),e.jsxs("div",{className:"pk-flex pk-items-center pk-gap-4",style:{gap:"0.5rem"},children:[e.jsx("div",{style:{width:20,height:20,background:"#f59e0b",borderRadius:"4px"}})," VIP ($",ee.pricing.vip,")"]})]})]}),h.length>0&&e.jsxs("div",{className:"pk-card",style:{position:"fixed",bottom:"2rem",width:"calc(100% - 4rem)",maxWidth:"800px",zIndex:10,padding:"1.5rem",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{children:[e.jsxs("div",{className:"pk-text-sm",children:["Selected Seats: ",e.jsx("span",{style:{fontWeight:600},children:h.join(", ")})]}),e.jsxs("div",{className:"pk-heading-md",style:{color:"var(--pk-primary)"},children:["Total: $",C().toFixed(2)]})]}),e.jsx("button",{className:"pk-btn pk-btn-primary",style:{padding:"1rem 2rem",fontSize:"1.125rem"},onClick:c,children:"Pay Now"})]})]})},r=()=>{const t=o[o.length-1];return t?e.jsx("div",{className:"pk-container animate-fade-in pk-flex pk-justify-center pk-items-center",style:{minHeight:"80vh"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"600px",overflow:"hidden"},children:[e.jsxs("div",{className:"pk-card-header",style:{background:"linear-gradient(135deg, var(--pk-primary), var(--pk-secondary))",color:"white",padding:"3rem 2rem",textAlign:"center"},children:[e.jsx("h1",{className:"pk-heading-lg",style:{marginBottom:"0.5rem"},children:ee.cinemaName}),e.jsxs("p",{className:"pk-text-body",style:{color:"rgba(255,255,255,0.8)"},children:["Admit ",t.seats.length]})]}),e.jsxs("div",{className:"pk-card-body",style:{padding:"3rem 2rem"},children:[e.jsx("h2",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:t.movie.title}),e.jsxs("div",{className:"pk-grid",style:{gridTemplateColumns:"1fr 1fr",gap:"2rem",marginBottom:"2rem"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Date & Time"}),e.jsxs("p",{className:"pk-heading-md",children:["Today, ",t.showtime]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Seats"}),e.jsx("p",{className:"pk-heading-md",style:{color:"var(--pk-primary)"},children:t.seats.join(", ")})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Screen"}),e.jsx("p",{className:"pk-heading-md",children:"IMAX 3"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Booking ID"}),e.jsx("p",{className:"pk-heading-md",children:t.id})]})]}),e.jsx("div",{style:{borderTop:"2px dashed var(--pk-border)",paddingTop:"2rem",display:"flex",justifyContent:"center"},children:e.jsx("div",{style:{height:"60px",width:"80%",background:"linear-gradient(90deg, black 0%, black 5%, transparent 5%, transparent 10%, black 10%, black 20%, transparent 20%, transparent 25%, black 25%, black 40%, transparent 40%, transparent 45%, black 45%, black 50%, transparent 50%, transparent 60%, black 60%, black 75%, transparent 75%, transparent 80%, black 80%, black 95%, transparent 95%, transparent 100%)"}})})]}),e.jsxs("div",{className:"pk-card-footer pk-flex pk-justify-between",children:[e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>d("grid"),children:"Home"}),e.jsx("button",{className:"pk-btn pk-btn-secondary",onClick:()=>window.print(),children:"Print Ticket"})]})]})}):null};return e.jsxs("div",{style:{position:"relative",minHeight:"100vh"},children:[g&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.7)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Processing..."})]}),m==="grid"&&b(),m==="details"&&W(),m==="selector"&&I(),m==="ticket"&&r(),e.jsx(S,{})]})}const $={currentUser:{id:"me",name:"Alex Designer",avatar:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=150&q=80"},conversations:[{id:"c1",contact:{id:"u1",name:"Sarah Engineering",avatar:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=150&q=80",status:"online"},messages:[{id:"m1",senderId:"u1",text:"Hey! Did you get a chance to look at the new PopSite UI designs?",timestamp:"10:05 AM"},{id:"m2",senderId:"me",text:"Yes! They look absolutely stunning. The glassmorphism is on point.",timestamp:"10:12 AM"},{id:"m3",senderId:"u1",text:"Awesome! We should deploy the new modules by tomorrow.",timestamp:"10:14 AM"}],unread:0},{id:"c2",contact:{id:"u2",name:"PopSite AI Assistant",avatar:"https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?auto=format&fit=crop&w=150&q=80",status:"online"},messages:[{id:"m1",senderId:"u2",text:"Hello! I'm your virtual UI assistant. How can I help you today?",timestamp:"09:00 AM"}],unread:1},{id:"c3",contact:{id:"u3",name:"Marketing Team",avatar:"https://images.unsplash.com/photo-1522071820081-009f0129c71c?auto=format&fit=crop&w=150&q=80",status:"offline"},messages:[{id:"m1",senderId:"u3",text:"The new campaign numbers are looking good.",timestamp:"Yesterday"}],unread:0}],autoReplies:["That sounds great!","I completely agree. Let's make it happen.","Could you clarify that a bit more?","Fascinating! The possibilities are endless.","I've updated the system parameters accordingly.","Let me think about that for a second..."]};function rt(){var I;const[m,d]=l.useState($.conversations),[n,j]=l.useState(((I=$.conversations[0])==null?void 0:I.id)||null),[x,N]=l.useState(""),[h,A]=l.useState(""),[o,T]=l.useState(!1),[u,f]=l.useState(!1),[g,M]=l.useState(!1),y=l.useRef(null),{showToast:S,ToastContainer:B}=J(),D=m.find(r=>r.id===n);l.useEffect(()=>{const r=localStorage.getItem("popsite_chats");if(r)try{d(JSON.parse(r))}catch{}},[]),l.useEffect(()=>{localStorage.setItem("popsite_chats",JSON.stringify(m))},[m]),l.useEffect(()=>{y.current&&y.current.scrollIntoView({behavior:"smooth"})},[D==null?void 0:D.messages,o]);const P=(r,t=1500)=>{M(!0),setTimeout(()=>{M(!1),r()},t)},C=r=>{if(r.preventDefault(),!x.trim()||!D)return;const t={id:`msg-${Date.now()}`,senderId:$.currentUser.id,text:x.trim(),timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},a=m.map(i=>i.id===n?{...i,messages:[...i.messages,t],unread:0}:i);d(a),N(""),T(!0),setTimeout(()=>{T(!1);const i=$.autoReplies,k=i[Math.floor(Math.random()*i.length)],F={id:`msg-bot-${Date.now()}`,senderId:D.contact.id,text:k,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};d(w=>w.map(R=>R.id===n?{...R,messages:[...R.messages,F]}:R)),Math.random()>.5&&S(`New message from ${D.contact.name}`,"info")},2e3)},c=r=>{d(t=>t.map(a=>a.id===r?{...a,unread:0}:a)),j(r),f(!1)},b=()=>{P(()=>{S("Profile updated successfully","success"),f(!1)})},W=m.filter(r=>r.contact.name.toLowerCase().includes(h.toLowerCase()));return e.jsxs("div",{className:"pk-flex animate-fade-in",style:{height:"100vh",backgroundColor:"var(--pk-bg-main)",overflow:"hidden"},children:[g&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.7)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Processing..."})]}),e.jsxs("div",{className:"pk-card",style:{width:"350px",height:"100%",borderRadius:0,borderRight:"1px solid var(--pk-border)",display:"flex",flexDirection:"column",zIndex:10},children:[e.jsxs("div",{className:"pk-card-header pk-flex pk-justify-between pk-items-center",style:{padding:"1.5rem",background:"var(--pk-bg-glass)",backdropFilter:"blur(10px)"},children:[e.jsxs("div",{className:"pk-flex pk-items-center pk-gap-4",style:{cursor:"pointer"},onClick:()=>f(!0),children:[e.jsx("img",{src:$.currentUser.avatar,alt:"Me",style:{width:"40px",height:"40px",borderRadius:"50%",objectFit:"cover"},onError:r=>{r.target.style.display="none",r.target.nextSibling.style.display="flex"}}),e.jsx("div",{style:{display:"none",width:"40px",height:"40px",background:"var(--pk-primary)",color:"white",alignItems:"center",justifyContent:"center",borderRadius:"50%",fontWeight:"bold"},children:"ME"}),e.jsxs("div",{children:[e.jsx("h3",{className:"pk-label",children:$.currentUser.name}),e.jsx("span",{className:"pk-text-sm",style:{color:"var(--pk-success)"},children:"● Online"})]})]}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{padding:"0.5rem",borderRadius:"50%"},children:"+ 💬"})]}),e.jsx("div",{style:{padding:"1rem"},children:e.jsx("input",{type:"text",className:"pk-input pk-w-full",placeholder:"Search conversations...",value:h,onChange:r=>A(r.target.value)})}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:W.length===0?e.jsx("div",{className:"pk-empty-state",style:{padding:"2rem",border:"none"},children:e.jsx("div",{className:"pk-text-sm",children:"No chats found."})}):W.map(r=>{var t;return e.jsxs("div",{className:`pk-flex pk-items-center pk-gap-4 ${n===r.id?"pk-bg-glass":""}`,style:{padding:"1rem 1.5rem",cursor:"pointer",borderBottom:"1px solid var(--pk-border)",transition:"background 0.2s",background:n===r.id?"var(--pk-primary-light)":"transparent"},onClick:()=>c(r.id),children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("img",{src:r.contact.avatar,alt:"",style:{width:"50px",height:"50px",borderRadius:"50%",objectFit:"cover"},onError:a=>{a.target.style.display="none",a.target.nextSibling.style.display="flex"}}),e.jsx("div",{style:{display:"none",width:"50px",height:"50px",background:"var(--pk-secondary)",color:"white",alignItems:"center",justifyContent:"center",borderRadius:"50%",fontWeight:"bold"},children:r.contact.name[0]}),e.jsx("div",{style:{position:"absolute",bottom:2,right:2,width:12,height:12,borderRadius:"50%",background:r.contact.status==="online"?"var(--pk-success)":"var(--pk-text-muted)",border:"2px solid white"}})]}),e.jsxs("div",{style:{flex:1,overflow:"hidden"},children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",children:[e.jsx("h4",{className:"pk-label",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.contact.name}),r.messages.length>0&&e.jsx("span",{className:"pk-text-sm",style:{fontSize:"0.75rem"},children:r.messages[r.messages.length-1].timestamp})]}),e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",children:[e.jsx("p",{className:"pk-text-sm",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:r.unread>0?600:400,color:r.unread>0?"var(--pk-text-main)":"var(--pk-text-muted)"},children:((t=r.messages[r.messages.length-1])==null?void 0:t.text)||"No messages yet."}),r.unread>0&&e.jsx("span",{className:"pk-badge",style:{background:"var(--pk-primary)",color:"white",minWidth:"20px",textAlign:"center"},children:r.unread})]})]})]},r.id)})})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"var(--pk-bg-main)",position:"relative"},children:u?e.jsx("div",{className:"pk-container",style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"500px",padding:"3rem"},children:[e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"2rem",textAlign:"center"},children:"My Profile"}),e.jsx("div",{className:"pk-flex pk-justify-center",style:{marginBottom:"2rem"},children:e.jsx("img",{src:$.currentUser.avatar,alt:"Profile",style:{width:"120px",height:"120px",borderRadius:"50%",boxShadow:"var(--pk-shadow-md)"}})}),e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Display Name"}),e.jsx("input",{type:"text",className:"pk-input",defaultValue:$.currentUser.name})]}),e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Status Message"}),e.jsx("input",{type:"text",className:"pk-input",defaultValue:"Building great UIs! 💻"})]}),e.jsxs("div",{className:"pk-flex pk-justify-between",style:{marginTop:"2rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>f(!1),children:"Cancel"}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:b,children:"Save Changes"})]})]})}):D?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pk-card",style:{borderRadius:0,padding:"1rem 2rem",display:"flex",alignItems:"center",gap:"1rem",borderBottom:"1px solid var(--pk-border)",zIndex:5},children:[e.jsx("img",{src:D.contact.avatar,alt:"",style:{width:"40px",height:"40px",borderRadius:"50%"}}),e.jsxs("div",{children:[e.jsx("h3",{className:"pk-heading-md",style:{fontSize:"1.25rem"},children:D.contact.name}),e.jsx("span",{className:"pk-text-sm",children:D.contact.status==="online"?"Active Now":"Offline"})]})]}),e.jsxs("div",{style:{flex:1,padding:"2rem",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1.5rem",background:'linear-gradient(rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.9)), url("https://www.transparenttextures.com/patterns/cubes.png")'},children:[D.messages.length===0&&e.jsx("div",{className:"pk-empty-state",style:{margin:"auto",border:"none",background:"transparent"},children:"Say Hello 👋"}),D.messages.map(r=>{const t=r.senderId===$.currentUser.id;return e.jsxs("div",{className:"pk-flex",style:{justifyContent:t?"flex-end":"flex-start"},children:[!t&&e.jsx("img",{src:D.contact.avatar,alt:"",style:{width:"32px",height:"32px",borderRadius:"50%",marginRight:"0.75rem",alignSelf:"flex-end"}}),e.jsxs("div",{style:{maxWidth:"70%"},children:[e.jsx("div",{style:{padding:"1rem 1.25rem",background:t?"linear-gradient(135deg, var(--pk-primary), var(--pk-primary-hover))":"var(--pk-bg-card)",color:t?"white":"var(--pk-text-main)",borderRadius:t?"16px 16px 4px 16px":"16px 16px 16px 4px",boxShadow:"var(--pk-shadow-md)"},children:r.text}),e.jsx("div",{className:"pk-text-sm",style:{marginTop:"0.25rem",textAlign:t?"right":"left",fontSize:"0.75rem"},children:r.timestamp})]})]},r.id)}),o&&e.jsxs("div",{className:"pk-flex",style:{justifyContent:"flex-start"},children:[e.jsx("img",{src:D.contact.avatar,alt:"",style:{width:"32px",height:"32px",borderRadius:"50%",marginRight:"0.75rem",alignSelf:"flex-end"}}),e.jsxs("div",{style:{padding:"1rem",background:"var(--pk-bg-card)",borderRadius:"16px 16px 16px 4px",boxShadow:"var(--pk-shadow-sm)",display:"flex",gap:"4px"},children:[e.jsx("span",{className:"typing-dot"}),e.jsx("span",{className:"typing-dot",style:{animationDelay:"0.2s"}}),e.jsx("span",{className:"typing-dot",style:{animationDelay:"0.4s"}})]})]}),e.jsx("div",{ref:y})]}),e.jsx("div",{className:"pk-card",style:{borderRadius:0,padding:"1.5rem",borderTop:"1px solid var(--pk-border)"},children:e.jsxs("form",{onSubmit:C,className:"pk-flex pk-gap-4 pk-items-center",children:[e.jsx("button",{type:"button",className:"pk-btn pk-btn-outline",style:{borderRadius:"50%",padding:"0.75rem"},children:"📎"}),e.jsx("input",{type:"text",className:"pk-input",style:{flex:1,borderRadius:"var(--pk-radius-full)",padding:"1rem 1.5rem"},placeholder:"Type your message...",value:x,onChange:r=>N(r.target.value)}),e.jsx("button",{type:"submit",className:"pk-btn pk-btn-primary",style:{borderRadius:"50%",padding:"0.75rem",aspectRatio:"1",width:"50px"},children:"➤"})]})})]}):e.jsx("div",{className:"pk-flex pk-items-center pk-justify-center",style:{flex:1},children:e.jsxs("div",{className:"pk-empty-state",style:{border:"none",background:"transparent"},children:[e.jsx("div",{className:"pk-empty-icon",style:{fontSize:"5rem"},children:"💬"}),e.jsx("h3",{className:"pk-heading-md",children:"Welcome to PopSite Messages"}),e.jsx("p",{className:"pk-text-body",children:"Select a conversation from the sidebar to begin."})]})})}),e.jsx("style",{children:`
|
|
36
|
+
.typing-dot { width: 8px; height: 8px; background-color: var(--pk-text-muted); border-radius: 50%; opacity: 0.5; animation: typingBounce 1.4s infinite ease-in-out; }
|
|
37
|
+
@keyframes typingBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
|
|
38
|
+
`}),e.jsx(B,{})]})}const Z={airlineName:"Skyward Wings",airports:["JFK (New York)","LAX (Los Angeles)","LHR (London)","HND (Tokyo)","SYD (Sydney)","DXB (Dubai)"],flights:[{id:"f1",flightNumber:"SW-402",from:"JFK (New York)",to:"LHR (London)",departureTime:"08:00 AM",arrivalTime:"08:00 PM",duration:"7h 00m",price:450,businessPrice:1200,image:"https://images.unsplash.com/photo-1436491865332-7a61a109cc05?auto=format&fit=crop&w=800&q=80"},{id:"f2",flightNumber:"SW-819",from:"LAX (Los Angeles)",to:"HND (Tokyo)",departureTime:"11:30 AM",arrivalTime:"03:15 PM (+1)",duration:"11h 45m",price:780,businessPrice:2100,image:"https://images.unsplash.com/photo-1542296332-2e4473faf563?auto=format&fit=crop&w=800&q=80"},{id:"f3",flightNumber:"SW-211",from:"LHR (London)",to:"DXB (Dubai)",departureTime:"10:15 PM",arrivalTime:"08:10 AM (+1)",duration:"6h 55m",price:320,businessPrice:850,image:"https://images.unsplash.com/photo-1512453979798-5ea266f8880c?auto=format&fit=crop&w=800&q=80"},{id:"f4",flightNumber:"SW-505",from:"JFK (New York)",to:"LAX (Los Angeles)",departureTime:"06:00 AM",arrivalTime:"09:15 AM",duration:"6h 15m",price:199,businessPrice:600,image:"https://images.unsplash.com/photo-1499591934245-40b55745b905?auto=format&fit=crop&w=800&q=80"}],addOns:{checkedBag:50}};function nt(){const[m,d]=l.useState("search"),[n,j]=l.useState({from:Z.airports[0],to:Z.airports[1],date:new Date().toISOString().split("T")[0],passengers:1}),[x,N]=l.useState(null),[h,A]=l.useState("economy"),[o,T]=l.useState(0),[u,f]=l.useState({firstName:"",lastName:"",passport:""}),[g,M]=l.useState(null),[y,S]=l.useState(!1),{showToast:B,ToastContainer:D}=J();l.useEffect(()=>{const i=localStorage.getItem("popsite_flight");if(i)try{M(JSON.parse(i))}catch{}},[]),l.useEffect(()=>{g&&localStorage.setItem("popsite_flight",JSON.stringify(g))},[g]);const P=(i,k=1500)=>{S(!0),setTimeout(()=>{S(!1),i()},k)},C=i=>{if(i.preventDefault(),n.from===n.to){B("Destination cannot be the same as origin","error");return}P(()=>{d("results"),B("Flights loaded successfully","success")})},c=i=>{N(i),d("passenger")},b=()=>{if(!x)return 0;const i=h==="business"?x.businessPrice:x.price,k=o*Z.addOns.checkedBag;return i*n.passengers+k},W=i=>{if(i.preventDefault(),!u.firstName||!u.lastName||!u.passport){B("Please fill out all passenger details","error");return}P(()=>{const k={bookingRef:`PNR${Math.random().toString(36).substring(2,8).toUpperCase()}`,flight:x,seatClass:h,baggage:o,passenger:u,date:n.date,total:b()};M(k),d("pass"),B("Booking confirmed!","success")},2e3)},I=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"80vh"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"3rem"},children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:Z.airlineName}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem"},children:"Where will your next adventure take you?"})]}),e.jsx("div",{className:"pk-card pk-glass",style:{width:"100%",maxWidth:"900px",padding:"3rem"},children:e.jsxs("form",{onSubmit:C,className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"1.5rem",alignItems:"end"},children:[e.jsxs("div",{className:"pk-input-group",style:{margin:0},children:[e.jsx("label",{className:"pk-label",children:"From"}),e.jsx("select",{className:"pk-input",value:n.from,onChange:i=>j({...n,from:i.target.value}),children:Z.airports.map(i=>e.jsx("option",{value:i,children:i},i))})]}),e.jsxs("div",{className:"pk-input-group",style:{margin:0},children:[e.jsx("label",{className:"pk-label",children:"To"}),e.jsx("select",{className:"pk-input",value:n.to,onChange:i=>j({...n,to:i.target.value}),children:Z.airports.map(i=>e.jsx("option",{value:i,children:i},i))})]}),e.jsxs("div",{className:"pk-input-group",style:{margin:0},children:[e.jsx("label",{className:"pk-label",children:"Departure Date"}),e.jsx("input",{type:"date",className:"pk-input",value:n.date,onChange:i=>j({...n,date:i.target.value})})]}),e.jsxs("div",{className:"pk-input-group",style:{margin:0},children:[e.jsx("label",{className:"pk-label",children:"Passengers"}),e.jsx("input",{type:"number",min:"1",max:"9",className:"pk-input",value:n.passengers,onChange:i=>j({...n,passengers:parseInt(i.target.value)||1})})]}),e.jsx("button",{type:"submit",className:"pk-btn pk-btn-primary",style:{padding:"1.25rem",height:"100%"},children:"Search Flights"})]})}),g&&e.jsxs("button",{className:"pk-btn pk-btn-outline",style:{marginTop:"2rem"},onClick:()=>d("pass"),children:["View Upcoming Trip (",g.bookingRef,")"]})]}),r=()=>{const i=Z.flights.filter(k=>k.from.includes(n.from.split(" ")[0])||k.to.includes(n.to.split(" ")[0])||!0);return e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginBottom:"2rem"},children:[e.jsxs("div",{children:[e.jsx("h2",{className:"pk-heading-lg",children:"Select Departure Flight"}),e.jsxs("p",{className:"pk-text-body",children:[n.from," → ",n.to," | ",n.date," | ",n.passengers," Passenger(s)"]})]}),e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>d("search"),children:"Edit Search"})]}),e.jsx("div",{className:"pk-flex pk-flex-col pk-gap-6",children:i.map(k=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{padding:"2rem",display:"flex",flexWrap:"wrap",gap:"2rem",alignItems:"center"},children:[e.jsxs("div",{style:{flex:"1 1 300px"},children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginBottom:"1rem"},children:[e.jsx("span",{className:"pk-badge",children:k.flightNumber}),e.jsx("span",{className:"pk-text-sm",style:{color:"var(--pk-primary)",fontWeight:600},children:k.duration})]}),e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",children:[e.jsxs("div",{className:"pk-text-center",children:[e.jsx("h3",{className:"pk-heading-md",children:k.departureTime}),e.jsx("p",{className:"pk-text-muted",children:k.from.split(" ")[0]})]}),e.jsxs("div",{style:{flex:1,margin:"0 1rem",display:"flex",alignItems:"center",justifyItems:"center"},children:[e.jsx("div",{style:{height:"2px",background:"var(--pk-border)",flex:1}}),e.jsx("span",{style:{margin:"0 1rem",fontSize:"1.5rem",opacity:.5},children:"✈️"}),e.jsx("div",{style:{height:"2px",background:"var(--pk-border)",flex:1}})]}),e.jsxs("div",{className:"pk-text-center",children:[e.jsx("h3",{className:"pk-heading-md",children:k.arrivalTime}),e.jsx("p",{className:"pk-text-muted",children:k.to.split(" ")[0]})]})]})]}),e.jsx("div",{style:{width:"1px",background:"var(--pk-border)",height:"100px",alignSelf:"stretch"},className:"pk-hidden-mobile"}),e.jsxs("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",gap:"1rem",minWidth:"150px"},children:[e.jsxs("div",{className:"pk-text-center",children:[e.jsx("span",{className:"pk-text-sm pk-text-muted",children:"Economy from"}),e.jsxs("h3",{className:"pk-heading-lg",style:{color:"var(--pk-secondary)"},children:["$",k.price]})]}),e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>{A("economy"),c(k)},children:"Select Economy"})]}),e.jsxs("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",gap:"1rem",minWidth:"150px"},children:[e.jsxs("div",{className:"pk-text-center",children:[e.jsx("span",{className:"pk-text-sm pk-text-muted",children:"Business from"}),e.jsxs("h3",{className:"pk-heading-lg",style:{color:"var(--pk-primary)"},children:["$",k.businessPrice]})]}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>{A("business"),c(k)},children:"Select Business"})]})]},k.id))})]})},t=()=>e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{marginBottom:"2rem"},onClick:()=>d("results"),children:"← Back to Flights"}),e.jsxs("div",{className:"pk-grid",style:{gridTemplateColumns:"minmax(300px, 2fr) minmax(300px, 1fr)"},children:[e.jsxs("div",{className:"pk-flex pk-flex-col pk-gap-6",children:[e.jsxs("div",{className:"pk-card",style:{padding:"2rem"},children:[e.jsx("h2",{className:"pk-heading-md",style:{marginBottom:"1.5rem",borderBottom:"1px solid var(--pk-border)",paddingBottom:"0.5rem"},children:"Primary Passenger"}),e.jsxs("form",{onSubmit:W,id:"booking-form",children:[e.jsxs("div",{className:"pk-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"First Name"}),e.jsx("input",{type:"text",className:"pk-input",value:u.firstName,onChange:i=>f({...u,firstName:i.target.value}),required:!0})]}),e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Last Name"}),e.jsx("input",{type:"text",className:"pk-input",value:u.lastName,onChange:i=>f({...u,lastName:i.target.value}),required:!0})]})]}),e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Passport Number"}),e.jsx("input",{type:"text",className:"pk-input",value:u.passport,onChange:i=>f({...u,passport:i.target.value}),required:!0})]})]})]}),e.jsxs("div",{className:"pk-card",style:{padding:"2rem"},children:[e.jsx("h2",{className:"pk-heading-md",style:{marginBottom:"1.5rem",borderBottom:"1px solid var(--pk-border)",paddingBottom:"0.5rem"},children:"Customize Your Trip"}),e.jsxs("div",{className:"pk-flex pk-items-center pk-justify-between",style:{padding:"1rem",background:"var(--pk-bg-main)",borderRadius:"var(--pk-radius-md)",marginBottom:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h4",{className:"pk-label",children:"Checked Baggage"}),e.jsxs("p",{className:"pk-text-sm",children:["Up to 23kg per bag ($",Z.addOns.checkedBag," each)"]})]}),e.jsxs("div",{className:"pk-flex pk-items-center pk-gap-4",children:[e.jsx("button",{type:"button",className:"pk-btn pk-btn-outline",style:{padding:"0.5rem",borderRadius:"50%",width:40,height:40},onClick:()=>T(Math.max(0,o-1)),children:"-"}),e.jsx("span",{className:"pk-heading-md",children:o}),e.jsx("button",{type:"button",className:"pk-btn pk-btn-outline",style:{padding:"0.5rem",borderRadius:"50%",width:40,height:40},onClick:()=>T(o+1),children:"+"})]})]})]})]}),e.jsx("div",{children:e.jsxs("div",{className:"pk-card",style:{position:"sticky",top:"100px"},children:[e.jsxs("div",{className:"pk-card-header bg-gradient",style:{background:"linear-gradient(135deg, var(--pk-bg-main), var(--pk-primary-light))",padding:"2rem"},children:[e.jsx("span",{className:"pk-badge",style:{marginBottom:"1rem",display:"inline-block"},children:h.toUpperCase()}),e.jsxs("h3",{className:"pk-heading-md",children:[x.from.split(" ")[0]," ✈ ",x.to.split(" ")[0]]}),e.jsx("p",{className:"pk-text-sm",children:n.date})]}),e.jsxs("div",{className:"pk-card-body pk-flex pk-flex-col pk-gap-4",children:[e.jsxs("div",{className:"pk-flex pk-justify-between",children:[e.jsx("span",{className:"pk-text-body",children:"1x Ticket"}),e.jsxs("span",{style:{fontWeight:600},children:["$",h==="business"?x.businessPrice:x.price]})]}),o>0&&e.jsxs("div",{className:"pk-flex pk-justify-between",children:[e.jsxs("span",{className:"pk-text-body",children:[o,"x Checked Bag"]}),e.jsxs("span",{style:{fontWeight:600},children:["$",o*Z.addOns.checkedBag]})]}),e.jsx("hr",{style:{border:0,borderTop:"1px solid var(--pk-border)"}}),e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",children:[e.jsx("span",{className:"pk-heading-md",children:"Total"}),e.jsxs("span",{className:"pk-heading-lg",style:{color:"var(--pk-primary)"},children:["$",b()]})]}),e.jsx("button",{type:"submit",form:"booking-form",className:"pk-btn pk-btn-primary pk-w-full",style:{marginTop:"1rem",padding:"1.25rem"},children:"Confirm & Pay"})]})]})})]})]}),a=()=>g?e.jsx("div",{className:"pk-container animate-fade-in pk-flex pk-justify-center pk-items-center",style:{minHeight:"80vh"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"400px",overflow:"hidden",boxShadow:"var(--pk-shadow-xl)"},children:[e.jsxs("div",{style:{background:"var(--pk-primary)",color:"white",padding:"2rem",textAlign:"center",position:"relative"},children:[e.jsx("h2",{className:"pk-heading-md",style:{opacity:.9},children:Z.airlineName}),e.jsx("h1",{className:"pk-heading-xl",style:{margin:"1rem 0"},children:"BOARDING"}),e.jsx("p",{style:{letterSpacing:"2px",opacity:.8},children:"PASS"}),e.jsx("div",{style:{position:"absolute",bottom:"-10px",left:"-10px",width:"20px",height:"20px",background:"var(--pk-bg-main)",borderRadius:"50%"}}),e.jsx("div",{style:{position:"absolute",bottom:"-10px",right:"-10px",width:"20px",height:"20px",background:"var(--pk-bg-main)",borderRadius:"50%"}})]}),e.jsxs("div",{className:"pk-card-body",style:{padding:"2rem",position:"relative"},children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",style:{marginBottom:"2rem",borderBottom:"1px solid var(--pk-border)",paddingBottom:"1rem"},children:[e.jsxs("div",{className:"pk-text-center",children:[e.jsx("h2",{className:"pk-heading-xl",style:{color:"var(--pk-text-main)"},children:g.flight.from.split(" ")[0]}),e.jsx("p",{className:"pk-text-sm pk-text-muted",children:g.flight.departureTime})]}),e.jsx("span",{style:{fontSize:"2rem",color:"var(--pk-primary)"},children:"✈️"}),e.jsxs("div",{className:"pk-text-center",children:[e.jsx("h2",{className:"pk-heading-xl",style:{color:"var(--pk-text-main)"},children:g.flight.to.split(" ")[0]}),e.jsx("p",{className:"pk-text-sm pk-text-muted",children:g.flight.arrivalTime})]})]}),e.jsxs("div",{className:"pk-grid",style:{gridTemplateColumns:"1fr 1fr",gap:"1.5rem",marginBottom:"2rem"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Passenger"}),e.jsxs("p",{className:"pk-heading-sm",style:{fontWeight:600},children:[g.passenger.firstName," ",g.passenger.lastName]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Flight"}),e.jsx("p",{className:"pk-heading-sm",style:{fontWeight:600},children:g.flight.flightNumber})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Date"}),e.jsx("p",{className:"pk-heading-sm",style:{fontWeight:600},children:g.date})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Class"}),e.jsx("p",{className:"pk-heading-sm",style:{fontWeight:600,textTransform:"capitalize"},children:g.seatClass})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Seat"}),e.jsx("p",{className:"pk-heading-sm",style:{fontWeight:800,color:"var(--pk-primary)",fontSize:"1.5rem"},children:"12A"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Gate"}),e.jsx("p",{className:"pk-heading-sm",style:{fontWeight:800,fontSize:"1.5rem"},children:"G4"})]})]}),e.jsxs("div",{style:{textAlign:"center",marginTop:"2rem"},children:[e.jsx("div",{style:{display:"inline-block",padding:"10px",border:"2px solid var(--pk-border)",borderRadius:"12px"},children:e.jsx("div",{style:{width:"120px",height:"120px",background:"repeating-linear-gradient(45deg, #000, #000 10px, transparent 10px, transparent 20px), repeating-linear-gradient(135deg, #000, #000 10px, transparent 10px, transparent 20px)"}})}),e.jsx("p",{className:"pk-text-sm",style:{marginTop:"0.5rem",letterSpacing:"4px",fontFamily:"monospace"},children:g.bookingRef})]})]}),e.jsx("div",{className:"pk-card-footer pk-flex pk-justify-center",style:{gap:"1rem",background:"var(--pk-primary-light)"},children:e.jsx("button",{className:"pk-btn pk-btn-outline",style:{background:"white"},onClick:()=>d("search"),children:"New Booking"})})]})}):null;return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)"},children:[y&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.7)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Searching Global Skies..."})]}),m==="search"&&I(),m==="results"&&r(),m==="passenger"&&t(),m==="pass"&&a(),e.jsx(D,{})]})}const te={organizationName:"Global Tech Solutions",kpis:{revenue:{value:"$124,500",trend:12.5},users:{value:"14,245",trend:8.2},conversionRate:{value:"4.8%",trend:-1.2},bounceRate:{value:"32.1%",trend:-5.4}},financialReports:[{id:"RPT-001",period:"Q1 2026",revenue:124500,expenses:84e3,net:40500,status:"Finalized"},{id:"RPT-002",period:"Q4 2025",revenue:118e3,expenses:82e3,net:36e3,status:"Finalized"},{id:"RPT-003",period:"Q3 2025",revenue:105e3,expenses:76e3,net:29e3,status:"Finalized"},{id:"RPT-004",period:"Q2 2025",revenue:98e3,expenses:71e3,net:27e3,status:"Finalized"}],systemLogs:[{id:"log1",timestamp:"2026-04-08 10:15:00",level:"INFO",message:"User array successfully synchronized.",service:"AuthService"},{id:"log2",timestamp:"2026-04-08 10:12:45",level:"WARN",message:"API rate limit approaching for endpoint /v2/data.",service:"APIGateway"},{id:"log3",timestamp:"2026-04-08 10:05:12",level:"ERROR",message:"Database connection timeout after 3000ms.",service:"DBService"},{id:"log4",timestamp:"2026-04-08 09:45:00",level:"INFO",message:"Daily backup completed successfully.",service:"BackupAgent"},{id:"log5",timestamp:"2026-04-08 09:30:22",level:"INFO",message:"New deployment v4.5.1 rolled out.",service:"CI/CD"},{id:"log6",timestamp:"2026-04-08 09:15:00",level:"WARN",message:"High memory trace detected in worker node 4.",service:"ComputeEngine"}],chartData:[{label:"Mon",value:30},{label:"Tue",value:45},{label:"Wed",value:25},{label:"Thu",value:60},{label:"Fri",value:85},{label:"Sat",value:40},{label:"Sun",value:50}]};function le({title:m,value:d,icon:n,trend:j,trendLabel:x}){const N=j&&j>0,h=j&&j<0;return e.jsxs("div",{className:"pk-card pk-card-interactive",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsxs("div",{className:"pk-flex pk-justify-between pk-items-center",children:[e.jsx("h3",{className:"pk-label",style:{color:"var(--pk-text-muted)"},children:m}),e.jsx("span",{style:{fontSize:"1.5rem",opacity:.8},children:n})]}),e.jsxs("div",{children:[e.jsx("div",{className:"pk-heading-md",style:{marginBottom:"0.5rem"},children:d}),j!==void 0&&e.jsxs("div",{className:"pk-flex pk-items-center",style:{gap:"0.5rem",fontSize:"0.875rem"},children:[e.jsxs("span",{style:{fontWeight:600,color:N?"var(--pk-success)":h?"var(--pk-danger)":"var(--pk-text-muted)"},children:[N?"↑":h?"↓":"-"," ",Math.abs(j),"%"]}),e.jsx("span",{style:{color:"var(--pk-text-muted)"},children:x||"vs last month"})]})]})]})}function lt(){const[m,d]=l.useState("summary"),[n,j]=l.useState(""),[x,N]=l.useState(!1),{showToast:h,ToastContainer:A}=J(),o=(y,S=1e3)=>{N(!0),setTimeout(()=>{N(!1),y()},S)},T=(y,S)=>{o(()=>{if(!y||y.length===0){h("No data to export","error");return}const B=Object.keys(y[0]).join(","),D=y.map(b=>Object.values(b).map(W=>typeof W=="string"?`"${W}"`:W).join(",")).join(`
|
|
39
|
+
`),P=new Blob([`${B}
|
|
40
|
+
${D}`],{type:"text/csv"}),C=URL.createObjectURL(P),c=document.createElement("a");c.href=C,c.download=`${S}_${Date.now()}.csv`,c.click(),h("Export successful","success")})},u=()=>e.jsxs("div",{className:"pk-card",style:{marginBottom:"2rem",padding:"1rem",display:"flex",gap:"1rem",overflowX:"auto"},children:[e.jsx("button",{className:m==="summary"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("summary"),children:"Executive Summary"}),e.jsx("button",{className:m==="financial"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("financial"),children:"Financial Reports"}),e.jsx("button",{className:m==="logs"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("logs"),children:"System Logs"})]}),f=()=>{const y=te.kpis,S=Math.max(...te.chartData.map(B=>B.value));return e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"2rem"},children:"Executive Overview"}),e.jsxs("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(250px, 1fr))",marginBottom:"2rem"},children:[e.jsx(le,{title:"Total Revenue",value:y.revenue.value,trend:y.revenue.trend,icon:"💰"}),e.jsx(le,{title:"Active Users",value:y.users.value,trend:y.users.trend,icon:"👥"}),e.jsx(le,{title:"Conversion Rate",value:y.conversionRate.value,trend:y.conversionRate.trend,icon:"🔥"}),e.jsx(le,{title:"Bounce Rate",value:y.bounceRate.value,trend:y.bounceRate.trend,icon:"📉"})]}),e.jsxs("div",{className:"pk-card",style:{padding:"2rem"},children:[e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"2rem"},children:"Weekly Traffic Activity"}),e.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:"250px",gap:"2%",paddingBottom:"2rem",borderBottom:"1px solid var(--pk-border)"},children:te.chartData.map((B,D)=>{const P=B.value/S*100;return e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",height:"100%",justifyContent:"flex-end"},children:[e.jsxs("div",{style:{opacity:0,transition:"opacity 0.2s",fontSize:"0.75rem",marginBottom:"0.25rem"},className:"chart-tooltip",children:[B.value,"k"]}),e.jsx("div",{style:{width:"100%",height:`${P}%`,background:"linear-gradient(to top, var(--pk-primary), var(--pk-secondary))",borderRadius:"4px 4px 0 0",transition:"height 1s cubic-bezier(0.1, 0.8, 0.2, 1)"},className:"chart-bar"}),e.jsx("span",{style:{marginTop:"1rem",fontSize:"0.875rem",color:"var(--pk-text-muted)"},children:B.label})]},D)})})]}),e.jsx("style",{children:`
|
|
41
|
+
.chart-bar:hover { filter: brightness(1.2); cursor: pointer; }
|
|
42
|
+
.chart-bar:hover + span { font-weight: bold; color: var(--pk-text-main); }
|
|
43
|
+
.chart-bar:hover ~ .chart-tooltip, .chart-tooltip:focus { opacity: 1 !important; }
|
|
44
|
+
`})]})},g=()=>e.jsxs("div",{className:"animate-fade-in",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"Financial Reports"}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>T(te.financialReports,"Financial_Report"),children:"⬇️ Export CSV"})]}),e.jsx("div",{className:"pk-card",style:{overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left"},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{background:"var(--pk-bg-main)",borderBottom:"1px solid var(--pk-border)"},children:[e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)",fontWeight:600},children:"Period"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)",fontWeight:600},children:"Revenue"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)",fontWeight:600},children:"Expenses"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)",fontWeight:600},children:"Net Profit"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)",fontWeight:600},children:"Status"})]})}),e.jsx("tbody",{children:te.financialReports.map((y,S)=>e.jsxs("tr",{style:{borderBottom:"1px solid var(--pk-border)",transition:"background 0.2s"},children:[e.jsx("td",{style:{padding:"1rem 1.5rem",fontWeight:600},children:y.period}),e.jsxs("td",{style:{padding:"1rem 1.5rem",color:"var(--pk-success)"},children:["+$",y.revenue.toLocaleString()]}),e.jsxs("td",{style:{padding:"1rem 1.5rem",color:"var(--pk-danger)"},children:["-$",y.expenses.toLocaleString()]}),e.jsxs("td",{style:{padding:"1rem 1.5rem",fontWeight:"bold"},children:["$",y.net.toLocaleString()]}),e.jsx("td",{style:{padding:"1rem 1.5rem"},children:e.jsx("span",{className:"pk-badge",children:y.status})})]},S))})]})})]}),M=()=>{const y=te.systemLogs.filter(S=>S.message.toLowerCase().includes(n.toLowerCase())||S.service.toLowerCase().includes(n.toLowerCase()));return e.jsxs("div",{className:"animate-fade-in",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem",flexWrap:"wrap",gap:"1rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"System Logs"}),e.jsxs("div",{style:{display:"flex",gap:"1rem"},children:[e.jsx("input",{type:"text",className:"pk-input",placeholder:"Search logs...",value:n,onChange:S=>j(S.target.value)}),e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>T(y,"System_Logs"),children:"⬇️ Export"})]})]}),e.jsx("div",{className:"pk-card",style:{background:"#0f172a",color:"#e2e8f0",padding:"1rem",fontFamily:"monospace",borderRadius:"var(--pk-radius-lg)",overflowX:"auto",maxHeight:"600px",overflowY:"auto"},children:y.length===0?e.jsx("div",{style:{padding:"2rem",textAlign:"center"},children:"No logs found matching query."}):y.map(S=>{const B=S.level==="ERROR"?"#ef4444":S.level==="WARN"?"#f59e0b":"#38bdf8";return e.jsxs("div",{style:{display:"flex",gap:"1rem",padding:"0.75rem",borderBottom:"1px solid #1e293b"},children:[e.jsxs("span",{style:{color:"#64748b",whiteSpace:"nowrap"},children:["[",S.timestamp,"]"]}),e.jsx("span",{style:{color:B,fontWeight:"bold",width:"60px"},children:S.level}),e.jsxs("span",{style:{color:"#cbd5e1",width:"120px"},children:["[",S.service,"]"]}),e.jsx("span",{style:{flex:1},children:S.message})]},S.id)})})]})};return e.jsxs("div",{className:"pk-container",style:{minHeight:"100vh"},children:[x&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.8)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Processing Data..."})]}),e.jsxs("div",{style:{marginBottom:"2rem"},children:[e.jsxs("h1",{className:"pk-heading-xl",children:[te.organizationName," Engine"]}),e.jsx("p",{className:"pk-text-body",children:"Real-time metrics and system health monitoring."})]}),u(),e.jsxs("div",{style:{position:"relative",minHeight:"500px"},children:[m==="summary"&&f(),m==="financial"&&g(),m==="logs"&&M()]}),e.jsx(A,{})]})}const q={companyInfo:{name:"PopSite Agency",address:"123 Creative Blvd, Tech District",email:"billing@popsite.com",taxRate:8.5},clients:[{id:"cli_1",name:"Acme Corp",email:"finance@acme.inc",phone:"+1 555-0100"},{id:"cli_2",name:"Stark Industries",email:"accounts@stark.com",phone:"+1 555-0101"},{id:"cli_3",name:"Wayne Enterprises",email:"billing@wayne.ent",phone:"+1 555-0102"},{id:"cli_4",name:"Umbrella Corp",email:"finance@umbrella.com",phone:"+1 555-0103"}],recentInvoices:[{id:"INV-2026-001",client:"Acme Corp",date:"2026-04-01",amount:4500,status:"Paid"},{id:"INV-2026-002",client:"Stark Industries",date:"2026-04-05",amount:12500,status:"Pending"},{id:"INV-2026-003",client:"Wayne Enterprises",date:"2026-04-07",amount:8e3,status:"Overdue"}]};function ot(){const[m,d]=l.useState("dashboard"),[n,j]=l.useState(q.recentInvoices),[x,N]=l.useState(""),[h,A]=l.useState(""),[o,T]=l.useState(q.companyInfo.taxRate),[u,f]=l.useState([{id:1,description:"Website Redesign",qty:1,rate:2500},{id:2,description:"Hosting (Annual)",qty:1,rate:150}]),{showToast:g,ToastContainer:M}=J();l.useEffect(()=>{const t=localStorage.getItem("popsite_invoices");if(t)try{j(JSON.parse(t))}catch{}},[]),l.useEffect(()=>{localStorage.setItem("popsite_invoices",JSON.stringify(n))},[n]);const y=u.reduce((t,a)=>t+a.qty*a.rate,0),S=y*(o/100),B=y+S,D=()=>{f([...u,{id:Date.now(),description:"",qty:1,rate:0}])},P=t=>{f(u.filter(a=>a.id!==t))},C=(t,a,i)=>{f(u.map(k=>k.id===t?{...k,[a]:i}:k))},c=()=>{var a;if(!h){g("Please select a client","error");return}const t={id:`INV-${new Date().getFullYear()}-${Math.floor(Math.random()*1e3)}`,client:((a=q.clients.find(i=>i.id===h))==null?void 0:a.name)||"Unknown",date:new Date().toISOString().split("T")[0],amount:B,status:"Pending"};j([t,...n]),g(`Invoice ${t.id} generated!`,"success"),d("dashboard")},b=()=>e.jsxs("div",{className:"pk-card no-print",style:{marginBottom:"2rem",padding:"1rem",display:"flex",gap:"1rem",overflowX:"auto"},children:[e.jsx("button",{className:m==="dashboard"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("dashboard"),children:"Overview"}),e.jsx("button",{className:m==="creator"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("creator"),children:"Create Invoice"}),e.jsx("button",{className:m==="clients"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("clients"),children:"Client Directory"})]}),W=()=>e.jsxs("div",{className:"animate-fade-in no-print",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"Recent Invoices"}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>d("creator"),children:"+ New Invoice"})]}),e.jsx("div",{className:"pk-card",style:{overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left"},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{background:"var(--pk-bg-main)",borderBottom:"1px solid var(--pk-border)"},children:[e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)"},children:"Invoice ID"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)"},children:"Client"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)"},children:"Date"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)"},children:"Amount"}),e.jsx("th",{style:{padding:"1rem 1.5rem",color:"var(--pk-text-muted)"},children:"Status"})]})}),e.jsx("tbody",{children:n.map((t,a)=>e.jsxs("tr",{style:{borderBottom:"1px solid var(--pk-border)"},children:[e.jsx("td",{style:{padding:"1rem 1.5rem",fontWeight:600},children:t.id}),e.jsx("td",{style:{padding:"1rem 1.5rem"},children:t.client}),e.jsx("td",{style:{padding:"1rem 1.5rem"},children:t.date}),e.jsxs("td",{style:{padding:"1rem 1.5rem",fontWeight:"bold"},children:["$",t.amount.toLocaleString(void 0,{minimumFractionDigits:2})]}),e.jsx("td",{style:{padding:"1rem 1.5rem"},children:e.jsx("span",{className:"pk-badge",style:{background:t.status==="Paid"?"var(--pk-success)":t.status==="Overdue"?"var(--pk-danger)":"var(--pk-warning)",color:"white"},children:t.status})})]},a))})]})})]}),I=()=>{const t=q.clients.filter(a=>a.name.toLowerCase().includes(x.toLowerCase()));return e.jsxs("div",{className:"animate-fade-in no-print",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"Client Directory"}),e.jsx("input",{type:"text",className:"pk-input",placeholder:"Search clients...",value:x,onChange:a=>N(a.target.value)})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:t.map(a=>e.jsxs("div",{className:"pk-card",style:{padding:"1.5rem"},children:[e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:a.name}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[e.jsxs("a",{href:`mailto:${a.email}`,className:"pk-text-body",style:{color:"var(--pk-primary)",textDecoration:"none"},children:["✉️ ",a.email]}),e.jsxs("a",{href:`tel:${a.phone}`,className:"pk-text-body",style:{color:"var(--pk-text-main)",textDecoration:"none"},children:["📞 ",a.phone]})]}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{width:"100%",marginTop:"1.5rem"},onClick:()=>{A(a.id),d("creator")},children:"Invoice Client"})]},a.id))})]})},r=()=>{var t,a;return e.jsxs("div",{className:"animate-fade-in print-container",style:{background:"white",padding:"2rem",borderRadius:"var(--pk-radius-lg)",boxShadow:"var(--pk-shadow-lg)"},children:[e.jsx("style",{children:`
|
|
45
|
+
@media print {
|
|
46
|
+
body * { visibility: hidden; }
|
|
47
|
+
.print-container, .print-container * { visibility: visible; }
|
|
48
|
+
.print-container { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; padding: 0; }
|
|
49
|
+
.no-print { display: none !important; }
|
|
50
|
+
.pk-container { padding: 0 !important; max-width: 100% !important; margin: 0 !important; }
|
|
51
|
+
@page { margin: 1cm; }
|
|
52
|
+
}
|
|
53
|
+
`}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"3rem",borderBottom:"2px solid var(--pk-border)",paddingBottom:"2rem"},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"pk-heading-xl",style:{color:"var(--pk-primary)",marginBottom:"0.5rem"},children:"INVOICE"}),e.jsx("p",{className:"pk-text-body",children:"ID: INV-DRAFT"}),e.jsxs("p",{className:"pk-text-body",children:["Date: ",new Date().toISOString().split("T")[0]]})]}),e.jsxs("div",{style:{textAlign:"right"},children:[e.jsx("h3",{className:"pk-heading-md",children:q.companyInfo.name}),e.jsx("p",{className:"pk-text-body",style:{whiteSpace:"pre-line"},children:q.companyInfo.address}),e.jsx("p",{className:"pk-text-body",children:q.companyInfo.email})]})]}),e.jsx("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"3rem"},children:e.jsxs("div",{style:{flex:1},children:[e.jsx("h4",{className:"pk-label",style:{marginBottom:"0.5rem",color:"var(--pk-text-muted)"},children:"Bill To:"}),e.jsxs("select",{className:"pk-input no-print",value:h,onChange:i=>A(i.target.value),style:{width:"100%",maxWidth:"300px",marginBottom:"0.5rem"},children:[e.jsx("option",{value:"",children:"-- Select Client --"}),q.clients.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]}),e.jsxs("div",{style:{display:"none",display:h?"block":"none"},children:[e.jsx("h3",{className:"pk-heading-md",children:(t=q.clients.find(i=>i.id===h))==null?void 0:t.name}),e.jsx("p",{className:"pk-text-body",children:(a=q.clients.find(i=>i.id===h))==null?void 0:a.email})]}),!h&&e.jsx("div",{style:{display:"none"},children:"_____________"})]})}),e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",marginBottom:"2rem"},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{background:"var(--pk-primary-light)",color:"var(--pk-primary)"},children:[e.jsx("th",{style:{padding:"1rem",textAlign:"left"},children:"Description"}),e.jsx("th",{style:{padding:"1rem",textAlign:"center",width:"100px"},children:"Qty"}),e.jsx("th",{style:{padding:"1rem",textAlign:"right",width:"150px"},children:"Rate"}),e.jsx("th",{style:{padding:"1rem",textAlign:"right",width:"150px"},children:"Total"}),e.jsx("th",{className:"no-print",style:{width:"50px"}})]})}),e.jsx("tbody",{children:u.map((i,k)=>e.jsxs("tr",{style:{borderBottom:"1px solid var(--pk-border)"},children:[e.jsx("td",{style:{padding:"1rem"},children:e.jsx("input",{type:"text",className:"pk-input",style:{width:"100%",border:"none",background:"transparent"},value:i.description,onChange:F=>C(i.id,"description",F.target.value),placeholder:"Item description"})}),e.jsx("td",{style:{padding:"1rem",textAlign:"center"},children:e.jsx("input",{type:"number",className:"pk-input",style:{width:"60px",textAlign:"center"},value:i.qty,onChange:F=>C(i.id,"qty",parseFloat(F.target.value)||0)})}),e.jsx("td",{style:{padding:"1rem",textAlign:"right"},children:e.jsx("input",{type:"number",className:"pk-input",style:{width:"100px",textAlign:"right"},value:i.rate,onChange:F=>C(i.id,"rate",parseFloat(F.target.value)||0)})}),e.jsxs("td",{style:{padding:"1rem",textAlign:"right",fontWeight:600},children:["$",(i.qty*i.rate).toFixed(2)]}),e.jsx("td",{className:"no-print",style:{padding:"1rem",textAlign:"center"},children:e.jsx("button",{className:"pk-btn pk-btn-outline",style:{padding:"0.25rem 0.5rem",color:"var(--pk-danger)",border:"none"},onClick:()=>P(i.id),children:"×"})})]},i.id))})]}),e.jsx("button",{className:"pk-btn pk-btn-outline no-print",onClick:D,style:{marginBottom:"2rem"},children:"+ Add Line Item"}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:e.jsxs("div",{style:{width:"300px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem"},children:[e.jsx("span",{className:"pk-text-body",children:"Subtotal"}),e.jsxs("span",{children:["$",y.toFixed(2)]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[e.jsx("span",{className:"pk-text-body",children:"Tax Rate (%)"}),e.jsx("input",{type:"number",className:"pk-input no-print",style:{width:"80px",textAlign:"right"},value:o,onChange:i=>T(parseFloat(i.target.value)||0)}),e.jsxs("span",{style:{display:"none"},children:[o,"%"]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem",color:"var(--pk-text-muted)"},children:[e.jsx("span",{className:"pk-text-body",children:"Tax Amount"}),e.jsxs("span",{children:["$",S.toFixed(2)]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"1rem",borderTop:"2px solid var(--pk-border)",paddingTop:"1rem"},children:[e.jsx("span",{className:"pk-heading-md",children:"Total Due"}),e.jsxs("span",{className:"pk-heading-lg",style:{color:"var(--pk-primary)"},children:["$",B.toFixed(2)]})]})]})}),e.jsxs("div",{className:"no-print",style:{display:"flex",justifyContent:"flex-end",gap:"1rem",marginTop:"3rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-secondary",onClick:()=>window.print(),children:"🖨️ Print to PDF"}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:c,children:"✅ Save Invoice"})]})]})};return e.jsxs("div",{className:"pk-container",style:{minHeight:"100vh"},children:[e.jsxs("div",{className:"no-print",style:{marginBottom:"2rem"},children:[e.jsx("h1",{className:"pk-heading-xl",children:"Billing & Invoicing"}),e.jsx("p",{className:"pk-text-body",children:"Manage clients and generate dynamic invoices."})]}),b(),e.jsxs("div",{style:{position:"relative"},children:[m==="dashboard"&&W(),m==="clients"&&I(),m==="creator"&&r()]}),e.jsx(M,{})]})}const ve={platformName:"PopBites Delivery",categories:["All","Pizza","Sushi","Healthy","Burgers","Vegan"],restaurants:[{id:"r1",name:"Truffle & Crust",category:"Pizza",rating:4.8,deliveryTime:"25-40 min",deliveryFee:2.99,image:"https://images.unsplash.com/photo-1513104890138-7c749659a591?auto=format&fit=crop&w=800&q=80",menu:[{id:"m1",name:"Margherita Truffle",description:"Fresh mozzarella, truffle oil, basil.",price:18,dietary:["Vegetarian"]},{id:"m2",name:"Spicy Soppressata",description:"Hot honey, chili flakes, cured meats.",price:21,dietary:[]},{id:"m3",name:"Garlic Knots",description:"Oven-baked with pesto dip.",price:6.5,dietary:["Vegetarian"]}]},{id:"r2",name:"Ocean Zen",category:"Sushi",rating:4.9,deliveryTime:"30-45 min",deliveryFee:4.99,image:"https://images.unsplash.com/photo-1579871494447-9811cf80d66c?auto=format&fit=crop&w=800&q=80",menu:[{id:"m4",name:"Spicy Tuna Roll",description:"Fresh tuna, spicy mayo, crispy tempura bits.",price:14,dietary:["Pescatarian","Gluten-Free"]},{id:"m5",name:"Dragon Roll",description:"Eel, cucumber, topped with avocado.",price:16,dietary:[]},{id:"m6",name:"Edamame",description:"Steamed soybeans with sea salt.",price:5,dietary:["Vegan","Gluten-Free"]}]},{id:"r3",name:"Green Machine",category:"Vegan",rating:4.6,deliveryTime:"15-25 min",deliveryFee:1.99,image:"https://images.unsplash.com/photo-1512621776951-a57141f2eefd?auto=format&fit=crop&w=800&q=80",menu:[{id:"m7",name:"Buddha Bowl",description:"Quinoa, roasted sweet potato, kale, tahini.",price:15,dietary:["Vegan","Gluten-Free"]},{id:"m8",name:"Beyond Burger",description:"Plant-based patty with vegan cheddar.",price:16,dietary:["Vegan"]},{id:"m9",name:"Acai Smoothie",description:"Mixed berries, banana, oat milk.",price:8,dietary:["Vegan","Gluten-Free"]}]}]};function dt(){const[m,d]=l.useState("directory"),[n,j]=l.useState(null),[x,N]=l.useState("All"),[h,A]=l.useState(""),[o,T]=l.useState([]),[u,f]=l.useState(0),[g,M]=l.useState(null),{showToast:y,ToastContainer:S}=J();l.useEffect(()=>{const I=localStorage.getItem("popsite_food_cart");if(I)try{T(JSON.parse(I))}catch{}},[]),l.useEffect(()=>{localStorage.setItem("popsite_food_cart",JSON.stringify(o))},[o]);const B=I=>{const r=o.find(t=>t.item.id===I.id);T(r?o.map(t=>t.item.id===I.id?{...t,qty:t.qty+1}:t):[...o,{item:I,qty:1}]),y(`Added ${I.name} to cart`,"success")},D=(I,r)=>{T(o.map(t=>t.item.id===I?{...t,qty:Math.max(0,t.qty+r)}:t).filter(t=>t.qty>0))},P=()=>{if(o.length===0)return;const I=o.reduce((r,t)=>r+t.item.price*t.qty,0)+n.deliveryFee;M({id:`ORD-${Math.floor(Math.random()*1e4)}`,restaurant:n,items:[...o],total:I}),T([]),f(0),d("tracker"),y("Order confirmed!","success"),setTimeout(()=>{f(1),y("Your order is out for delivery!","info"),setTimeout(()=>{f(2),y("Your order has arrived. Enjoy!","success")},5e3)},4e3)},C=()=>{if(!n)return null;const I=o.reduce((t,a)=>t+a.item.price*a.qty,0),r=I+n.deliveryFee;return e.jsxs("div",{className:"pk-card",style:{position:"sticky",top:"20px",display:"flex",flexDirection:"column",height:"calc(100vh - 40px)"},children:[e.jsxs("div",{className:"pk-card-header",style:{paddingBottom:"1rem",borderBottom:"1px solid var(--pk-border)"},children:[e.jsx("h3",{className:"pk-heading-md",children:"Your Order"}),e.jsx("p",{className:"pk-text-sm",children:n.name})]}),e.jsx("div",{className:"pk-card-body",style:{flex:1,overflowY:"auto",padding:"1rem"},children:o.length===0?e.jsxs("div",{className:"pk-empty-state",style:{padding:"2rem 1rem",border:"none"},children:[e.jsx("div",{style:{fontSize:"3rem",opacity:.5,marginBottom:"1rem"},children:"🛒"}),e.jsx("p",{className:"pk-text-body",children:"Cart is empty."})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:o.map((t,a)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("p",{className:"pk-label",style:{marginBottom:"0.25rem"},children:t.item.name}),e.jsxs("p",{className:"pk-text-sm",children:["$",(t.item.price*t.qty).toFixed(2)]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",background:"var(--pk-bg-main)",borderRadius:"var(--pk-radius-full)",padding:"0.25rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{borderRadius:"50%",width:28,height:28,padding:0,display:"flex",alignItems:"center",justifyItems:"center",justifyContent:"center"},onClick:()=>D(t.item.id,-1),children:"-"}),e.jsx("span",{style:{width:"20px",textAlign:"center",fontWeight:"bold"},children:t.qty}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{borderRadius:"50%",width:28,height:28,padding:0,display:"flex",alignItems:"center",justifyItems:"center",justifyContent:"center"},onClick:()=>D(t.item.id,1),children:"+"})]})]},a))})}),e.jsxs("div",{className:"pk-card-footer",style:{padding:"1.5rem",background:"var(--pk-bg-main)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[e.jsx("span",{className:"pk-text-body",children:"Subtotal"}),e.jsxs("span",{children:["$",I.toFixed(2)]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem"},children:[e.jsx("span",{className:"pk-text-body",children:"Delivery Fee"}),e.jsxs("span",{children:["$",n.deliveryFee.toFixed(2)]})]}),e.jsxs("button",{className:"pk-btn pk-btn-primary",style:{width:"100%",padding:"1rem",fontSize:"1.125rem"},disabled:o.length===0,onClick:P,children:["Checkout • $",r.toFixed(2)]})]})]})},c=()=>{const I=ve.restaurants.filter(r=>{const t=x==="All"||r.category===x,a=r.name.toLowerCase().includes(h.toLowerCase());return t&&a});return e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsxs("div",{style:{marginBottom:"2rem"},children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"0.5rem"},children:ve.platformName}),e.jsx("p",{className:"pk-text-body",children:"Cravings delivered to your door."})]}),e.jsxs("div",{className:"pk-card pk-glass",style:{padding:"1.5rem",marginBottom:"2rem",display:"flex",flexDirection:"column",gap:"1.5rem"},children:[e.jsx("input",{type:"text",className:"pk-input",placeholder:"Search restaurants...",style:{width:"100%",maxWidth:"500px"},value:h,onChange:r=>A(r.target.value)}),e.jsx("div",{style:{display:"flex",gap:"0.75rem",overflowX:"auto",paddingBottom:"0.5rem"},children:ve.categories.map(r=>e.jsx("button",{className:x===r?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",style:{borderRadius:"var(--pk-radius-full)",padding:"0.5rem 1.25rem",whiteSpace:"nowrap"},onClick:()=>N(r),children:r},r))})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))"},children:I.map(r=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{cursor:"pointer",display:"flex",flexDirection:"column"},onClick:()=>{j(r),d("menu")},children:[e.jsxs("div",{style:{height:"200px",width:"100%"},children:[e.jsx("img",{src:r.image,alt:r.name,style:{width:"100%",height:"100%",objectFit:"cover"},onError:t=>{t.target.style.display="none",t.target.nextSibling.style.display="flex"}}),e.jsx("div",{style:{display:"none",width:"100%",height:"100%",background:"var(--pk-secondary)",color:"white",alignItems:"center",justifyContent:"center",fontSize:"2rem"},children:r.name[0]})]}),e.jsxs("div",{className:"pk-card-body",style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"0.5rem"},children:[e.jsx("h3",{className:"pk-heading-md",children:r.name}),e.jsxs("span",{style:{background:"#f59e0b",color:"white",padding:"0.25rem 0.5rem",borderRadius:"var(--pk-radius-sm)",fontWeight:"bold",fontSize:"0.875rem"},children:["★ ",r.rating]})]}),e.jsxs("p",{className:"pk-text-sm",style:{marginBottom:"1rem"},children:[r.category," • ",r.deliveryTime]}),e.jsxs("span",{className:"pk-badge",style:{background:"var(--pk-primary-light)",color:"var(--pk-primary)"},children:["Delivery: $",r.deliveryFee]})]})]},r.id))})]})},b=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{display:"flex",gap:"2rem",alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"2rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{alignSelf:"flex-start"},onClick:()=>d("directory"),children:"← Back"}),e.jsxs("div",{style:{height:"300px",width:"100%",borderRadius:"var(--pk-radius-lg)",overflow:"hidden",position:"relative"},children:[e.jsx("img",{src:n.image,alt:n.name,style:{width:"100%",height:"100%",objectFit:"cover"}}),e.jsxs("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",padding:"2rem",background:"linear-gradient(transparent, rgba(0,0,0,0.8))",color:"white"},children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"0.5rem"},children:n.name}),e.jsxs("p",{style:{fontSize:"1.125rem",opacity:.9},children:[n.category," • ",n.rating," Rating"]})]})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"1.5rem"},children:"Menu"}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:n.menu.map(I=>e.jsxs("div",{className:"pk-card",style:{padding:"1.5rem",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"0.5rem"},children:[e.jsx("h3",{className:"pk-heading-md",children:I.name}),e.jsxs("span",{className:"pk-heading-md",style:{color:"var(--pk-primary)"},children:["$",I.price.toFixed(2)]})]}),e.jsx("p",{className:"pk-text-body",style:{marginBottom:"1rem",flex:1},children:I.description}),e.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginBottom:"1.5rem"},children:I.dietary.map(r=>e.jsx("span",{className:"pk-badge",style:{background:"rgba(16, 185, 129, 0.1)",color:"var(--pk-success)"},children:r},r))}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{marginTop:"auto"},onClick:()=>B(I),children:"+ Add to Cart"})]},I.id))})]})]}),e.jsx("div",{style:{width:"350px",flexShrink:0},className:"pk-hidden-mobile",children:C()})]}),W=()=>{if(!g)return null;const I=u===0?33:u===1?66:100,r=["Preparing","Out for Delivery","Arrived"];return e.jsxs("div",{className:"pk-container animate-fade-in",style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"80vh"},children:[e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"600px",overflow:"hidden"},children:[e.jsxs("div",{style:{height:"250px",background:"linear-gradient(135deg, #e2e8f0, #cbd5e1)",position:"relative",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx("div",{style:{position:"absolute",width:"200%",height:"200%",background:"radial-gradient(circle, transparent 20%, rgba(255,255,255,0.4) 20%, rgba(255,255,255,0.4) 80%, transparent 80%, transparent) 0 0, radial-gradient(circle, transparent 20%, rgba(255,255,255,0.4) 20%, rgba(255,255,255,0.4) 80%, transparent 80%, transparent) 50px 50px",backgroundSize:"100px 100px",opacity:.5}}),e.jsx("div",{style:{position:"relative",fontSize:"4rem",filter:"drop-shadow(0 10px 10px rgba(0,0,0,0.2))",animation:u===1?"bounce 2s infinite":"none"},children:u===0?"🧑🍳":u===1?"🛵":"🎉"})]}),e.jsxs("div",{className:"pk-card-body",style:{padding:"3rem 2rem"},children:[e.jsxs("h2",{className:"pk-heading-xl",style:{textAlign:"center",marginBottom:"1rem"},children:["Order ",r[u]]}),e.jsxs("p",{className:"pk-text-body",style:{textAlign:"center",marginBottom:"3rem"},children:[g.id," • ",g.restaurant.name]}),e.jsxs("div",{style:{position:"relative",marginBottom:"3rem"},children:[e.jsx("div",{style:{position:"absolute",top:"50%",left:0,width:"100%",height:"4px",background:"var(--pk-bg-main)",transform:"translateY(-50%)",zIndex:0}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:0,width:`${I}%`,height:"4px",background:"var(--pk-primary)",transform:"translateY(-50%)",zIndex:1,transition:"width 1s cubic-bezier(0.4, 0, 0.2, 1)"}}),e.jsx("div",{style:{display:"flex",justifyContent:"space-between",position:"relative",zIndex:2},children:[0,1,2].map(t=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",width:"33.33%"},children:[e.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"50%",background:t<=u?"var(--pk-primary)":"var(--pk-bg-main)",border:`4px solid ${t<=u?"var(--pk-primary-light)":"var(--pk-border)"}`,transition:"all 0.5s"}}),e.jsx("span",{className:"pk-text-sm",style:{fontWeight:t===u?600:400,color:t<=u?"var(--pk-text-main)":"var(--pk-text-muted)"},children:r[t]})]},t))})]}),e.jsxs("div",{style:{background:"var(--pk-bg-main)",padding:"1.5rem",borderRadius:"var(--pk-radius-md)"},children:[e.jsx("h4",{className:"pk-label",style:{marginBottom:"1rem"},children:"Order Summary"}),g.items.map((t,a)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[e.jsxs("span",{className:"pk-text-sm",children:[t.qty,"x ",t.item.name]}),e.jsxs("span",{className:"pk-text-sm",children:["$",(t.item.price*t.qty).toFixed(2)]})]},a)),e.jsxs("div",{style:{borderTop:"1px solid var(--pk-border)",marginTop:"1rem",paddingTop:"1rem",display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{className:"pk-heading-md",children:"Total"}),e.jsxs("span",{className:"pk-heading-md",children:["$",g.total.toFixed(2)]})]})]})]}),u===2&&e.jsx("div",{className:"pk-card-footer",style:{display:"flex",justifyContent:"center"},children:e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>{M(null),d("directory")},children:"Back to Restaurants"})})]}),e.jsx("style",{children:`
|
|
54
|
+
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
|
|
55
|
+
`})]})};return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)"},children:[m==="directory"&&c(),m==="menu"&&b(),m==="tracker"&&W(),e.jsx(S,{})]})}const Ee={institutionName:"PopSite Academy",subjects:[{id:"sub_1",title:"Advanced React Patterns",duration:15,passingScore:70,icon:"⚛️",questions:[{id:"q1",text:"Which hook should be used to memoize an expensive calculation?",type:"multiple-choice",options:["useMemo","useCallback","useEffect","useState"],correct:"useMemo"},{id:"q2",text:"What is the primary purpose of useCallback?",type:"multiple-choice",options:["Memoizing a value","Memoizing a function","Managing side effects","Accessing DOM nodes"],correct:"Memoizing a function"},{id:"q3",text:"React components must return a single outer element.",type:"true-false",options:["True","False"],correct:"True"},{id:"q4",text:"Which method is completely forbidden in modern React 'State' arrays to avoid mutation?",type:"multiple-choice",options:["concat","filter","map","push"],correct:"push"},{id:"q5",text:"useEffect cleanup functions run BEFORE the component unmounts.",type:"true-false",options:["True","False"],correct:"True"}]},{id:"sub_2",title:"Modern CSS Mastery",duration:10,passingScore:80,icon:"🎨",questions:[{id:"q1",text:"What property is used to create glassmorphism?",type:"multiple-choice",options:["opacity","backdrop-filter","background-blend-mode","filter"],correct:"backdrop-filter"},{id:"q2",text:"Which display type enables a 2D layout matrix?",type:"multiple-choice",options:["flex","block","grid","inline-block"],correct:"grid"},{id:"q3",text:"Variables defined in :root have global scope.",type:"true-false",options:["True","False"],correct:"True"}]}]};function ct(){const[m,d]=l.useState("selection"),[n,j]=l.useState(null),[x,N]=l.useState(0),[h,A]=l.useState({}),[o,T]=l.useState(0),[u,f]=l.useState(0),[g,M]=l.useState(!1),[y,S]=l.useState(!1),{showToast:B,ToastContainer:D}=J(),P=(i,k=1e3)=>{S(!0),setTimeout(()=>{S(!1),i()},k)};l.useEffect(()=>{let i;return m==="exam"&&o>0?i=setInterval(()=>T(k=>k-1),1e3):m==="exam"&&o===0&&C(),()=>clearInterval(i)},[m,o]);const C=()=>{B("Time's up! Auto-submitting exam.","info"),b()},c=i=>{P(()=>{j(i),A({}),N(0),T(i.duration*60),d("exam"),B(`Started: ${i.title}`,"success")})},b=()=>{P(()=>{let i=0;n.questions.forEach(F=>{h[F.id]===F.correct&&i++});const k=i/n.questions.length*100;f(k),M(k>=n.passingScore),d("results"),B("Exam submitted successfully.","success")},2e3)},W=i=>{const k=Math.floor(i/60).toString().padStart(2,"0"),F=(i%60).toString().padStart(2,"0");return`${k}:${F}`},I=(i,k)=>{A(F=>({...F,[i]:k}))},r=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{minHeight:"80vh",display:"flex",flexDirection:"column",justifyContent:"center"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"3rem"},children:[e.jsxs("h1",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:[Ee.institutionName," Portal"]}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem"},children:"Select a subject to begin your assessment."})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))"},children:Ee.subjects.map(i=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{padding:"2rem",display:"flex",flexDirection:"column"},children:[e.jsx("div",{style:{fontSize:"3rem",marginBottom:"1rem",opacity:.9},children:i.icon}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"0.5rem"},children:i.title}),e.jsxs("div",{style:{marginBottom:"2rem",flex:1,display:"flex",flexDirection:"column",gap:"0.5rem"},children:[e.jsxs("p",{className:"pk-text-sm",children:["⏱️ Duration: ",e.jsxs("span",{style:{fontWeight:600},children:[i.duration," Minutes"]})]}),e.jsxs("p",{className:"pk-text-sm",children:["📝 Questions: ",e.jsx("span",{style:{fontWeight:600},children:i.questions.length})]}),e.jsxs("p",{className:"pk-text-sm",children:["🎯 Passing Score: ",e.jsxs("span",{style:{fontWeight:600},children:[i.passingScore,"%"]})]})]}),e.jsx("button",{className:"pk-btn pk-btn-primary pk-w-full",onClick:()=>c(i),children:"Start Exam"})]},i.id))})]}),t=()=>{const i=n.questions[x],k=x===n.questions.length-1,F=(x+1)/n.questions.length*100;return e.jsxs("div",{className:"pk-container animate-fade-in",style:{display:"flex",flexDirection:"column",alignItems:"center",paddingTop:"4rem"},children:[e.jsxs("div",{className:"pk-card pk-glass",style:{width:"100%",maxWidth:"800px",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1.5rem",marginBottom:"2rem",position:"sticky",top:"1rem",zIndex:10},children:[e.jsxs("div",{children:[e.jsx("h3",{className:"pk-heading-md",children:n.title}),e.jsxs("p",{className:"pk-text-sm",children:["Question ",x+1," of ",n.questions.length]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[e.jsx("span",{className:"pk-text-sm",children:"Time Remaining:"}),e.jsx("span",{className:"pk-badge",style:{fontSize:"1.5rem",background:o<120?"var(--pk-danger)":"var(--pk-primary)",color:"white",padding:"0.5rem 1rem"},children:W(o)})]})]}),e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"800px",padding:"3rem",minHeight:"400px",display:"flex",flexDirection:"column"},children:[e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"2.5rem"},children:i.text}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",flex:1},children:i.options.map((w,R)=>{const H=h[i.id]===w;return e.jsxs("button",{className:H?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",style:{justifyContent:"flex-start",padding:"1.5rem",fontSize:"1.125rem",textAlign:"left",border:H?"2px solid var(--pk-primary)":"2px solid var(--pk-border)"},onClick:()=>I(i.id,w),children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",borderRadius:"50%",marginRight:"1rem",background:H?"white":"transparent",color:H?"var(--pk-primary)":"var(--pk-text-muted)",border:H?"none":"2px solid var(--pk-border)",fontWeight:"bold",fontSize:"0.875rem"},children:String.fromCharCode(65+R)}),w]},R)})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"3rem",paddingTop:"2rem",borderTop:"1px solid var(--pk-border)"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",disabled:x===0,onClick:()=>N(w=>w-1),children:"← Previous"}),e.jsx("div",{style:{width:"150px",background:"var(--pk-bg-main)",height:"6px",borderRadius:"3px",position:"relative"},children:e.jsx("div",{style:{position:"absolute",top:0,left:0,height:"100%",background:"var(--pk-primary)",borderRadius:"3px",width:`${F}%`,transition:"width 0.3s"}})}),k?e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:b,children:"Submit Exam ✅"}):e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>N(w=>w+1),children:"Next →"})]})]})]})},a=()=>{const i=283-283*u/100,k=g?"var(--pk-success)":"var(--pk-danger)";return e.jsx("div",{className:"pk-container animate-fade-in",style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"80vh"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"600px",textAlign:"center",overflow:"hidden"},children:[e.jsxs("div",{style:{background:g?"var(--pk-success)":"var(--pk-danger)",color:"white",padding:"2rem"},children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"0.5rem"},children:g?"Congratulations!":"Exam Failed"}),e.jsx("p",{style:{fontSize:"1.25rem",opacity:.9},children:n.title})]}),e.jsxs("div",{className:"pk-card-body",style:{padding:"4rem 2rem",display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsxs("div",{style:{position:"relative",width:"160px",height:"160px",marginBottom:"2rem"},children:[e.jsxs("svg",{viewBox:"0 0 100 100",style:{width:"100%",height:"100%",transform:"rotate(-90deg)"},children:[e.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"var(--pk-border)",strokeWidth:"8"}),e.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:k,strokeWidth:"8",strokeDasharray:"283",strokeDashoffset:i,strokeLinecap:"round",style:{transition:"stroke-dashoffset 1.5s ease-out"}})]}),e.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e.jsxs("span",{className:"pk-heading-lg",style:{lineHeight:1},children:[Math.round(u),"%"]})})]}),e.jsxs("div",{style:{display:"flex",gap:"3rem",marginBottom:"2rem"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"pk-text-muted pk-label",children:"Passing Score"}),e.jsxs("p",{className:"pk-heading-md",children:[n.passingScore,"%"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-text-muted pk-label",children:"Time Spent"}),e.jsx("p",{className:"pk-heading-md",children:W(n.duration*60-o)})]})]})]}),e.jsx("div",{className:"pk-card-footer",style:{padding:"1.5rem",display:"flex",justifyContent:"center",gap:"1rem"},children:e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>d("selection"),children:"Return to Dashboard"})})]})})};return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)"},children:[y&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.8)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Processing..."})]}),m==="selection"&&r(),m==="exam"&&t(),m==="results"&&a(),e.jsx(D,{})]})}const ce={schoolName:"PopSite University",departments:["Computer Science","Design","Business Administration","Engineering"],enrolledStudents:[{id:"STU-2026-001",firstName:"Alice",lastName:"Johnson",email:"alice.j@popsite.edu",phone:"555-0101",department:"Computer Science",year:"Freshman",gpa:3.8},{id:"STU-2026-002",firstName:"Bob",lastName:"Smith",email:"bob.s@popsite.edu",phone:"555-0102",department:"Design",year:"Sophomore",gpa:3.5},{id:"STU-2026-003",firstName:"Charlie",lastName:"Brown",email:"charlie.b@popsite.edu",phone:"555-0103",department:"Engineering",year:"Senior",gpa:3.9}]};function pt(){const[m,d]=l.useState("roster"),[n,j]=l.useState(ce.enrolledStudents),[x,N]=l.useState(""),[h,A]=l.useState(1),[o,T]=l.useState({firstName:"",lastName:"",email:"",phone:"",department:"",year:""}),[u,f]=l.useState(null),{showToast:g,ToastContainer:M}=J();l.useEffect(()=>{const r=localStorage.getItem("popsite_students");if(r)try{j(JSON.parse(r))}catch{}},[]),l.useEffect(()=>{localStorage.setItem("popsite_students",JSON.stringify(n))},[n]);const y=r=>/^[0-9\-\+\s\(\)]{7,15}$/.test(r),S=r=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r),B=()=>{if(h===1){if(!o.firstName||!o.lastName||!o.email||!o.phone){g("All fields required","error");return}if(!S(o.email)){g("Invalid email format","error");return}if(!y(o.phone)){g("Invalid phone format","error");return}}else if(h===2&&(!o.department||!o.year)){g("Please select department and year","error");return}A(r=>r+1)},D=()=>{const r={...o,id:`STU-2026-${Math.floor(Math.random()*1e3).toString().padStart(3,"0")}`,gpa:0};j([...n,r]),g(`${o.firstName} registered successfully!`,"success"),d("roster")},P=()=>{j(r=>r.map(t=>t.id===u.id?u:t)),g("Profile updated!","success"),d("roster")},C=()=>{if(n.length===0)return;const r=Object.keys(n[0]),t=r.join(",")+`
|
|
56
|
+
`+n.map(F=>r.map(w=>`"${F[w]}"`).join(",")).join(`
|
|
57
|
+
`),a=new Blob([t],{type:"text/csv"}),i=URL.createObjectURL(a),k=document.createElement("a");k.href=i,k.download=`student_roster_${Date.now()}.csv`,k.click(),g("Roster Exported to CSV","success")},c=()=>{T({firstName:"",lastName:"",email:"",phone:"",department:"",year:""}),A(1),d("wizard")},b=()=>{const r=n.filter(t=>`${t.firstName} ${t.lastName}`.toLowerCase().includes(x.toLowerCase())||t.email.toLowerCase().includes(x.toLowerCase()));return e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"2rem",flexWrap:"wrap",gap:"1rem"},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"0.5rem"},children:ce.schoolName}),e.jsx("p",{className:"pk-text-body",children:"Admissions & Roster Management"})]}),e.jsxs("div",{style:{display:"flex",gap:"1rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:C,children:"⬇️ Export CSV"}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:c,children:"+ New Admission"})]})]}),e.jsx("div",{style:{marginBottom:"2rem"},children:e.jsx("input",{type:"text",className:"pk-input",style:{width:"100%",maxWidth:"400px"},placeholder:"Search students by name or email...",value:x,onChange:t=>N(t.target.value)})}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:r.map(t=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{padding:"1.5rem"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"1rem"},children:[e.jsx("span",{className:"pk-badge",children:t.id}),e.jsxs("span",{style:{fontWeight:"bold",color:t.gpa>=3.5?"var(--pk-success)":"var(--pk-text-main)"},children:["GPA: ",t.gpa.toFixed(1)]})]}),e.jsxs("h3",{className:"pk-heading-md",style:{marginBottom:"0.25rem"},children:[t.firstName," ",t.lastName]}),e.jsxs("p",{className:"pk-text-sm",style:{color:"var(--pk-primary)",marginBottom:"1rem"},children:[t.department," • ",t.year]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1.5rem"},children:[e.jsxs("span",{className:"pk-text-sm",children:["📧 ",t.email]}),e.jsxs("span",{className:"pk-text-sm",children:["📞 ",t.phone]})]}),e.jsx("button",{className:"pk-btn pk-btn-outline pk-w-full",onClick:()=>{f(t),d("edit")},children:"Edit Profile"})]},t.id))})]})},W=()=>e.jsx("div",{className:"pk-container animate-fade-in",style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"80vh"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"600px"},children:[e.jsxs("div",{className:"pk-card-header",style:{padding:"2rem",borderBottom:"1px solid var(--pk-border)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1.5rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"Admission Wizard"}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{border:"none"},onClick:()=>d("roster"),children:"✕ Cancel"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",position:"relative"},children:[e.jsx("div",{style:{position:"absolute",top:"50%",left:"0",width:"100%",height:"2px",background:"var(--pk-border)",zIndex:0,transform:"translateY(-50%)"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:"0",width:`${(h-1)/2*100}%`,height:"2px",background:"var(--pk-primary)",zIndex:1,transform:"translateY(-50%)",transition:"width 0.3s"}}),["Personal","Academic","Review"].map((r,t)=>e.jsxs("div",{style:{position:"relative",zIndex:2,display:"flex",flexDirection:"column",alignItems:"center",width:"40px"},children:[e.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"50%",background:h>t?"var(--pk-primary)":"var(--pk-bg-main)",border:`2px solid ${h>=t+1?"var(--pk-primary)":"var(--pk-border)"}`,color:"white",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px"},children:h>t?"✓":t+1}),e.jsx("span",{style:{position:"absolute",bottom:"-20px",fontSize:"0.75rem",color:h>=t+1?"var(--pk-text-main)":"var(--pk-text-muted)"},children:r})]},t))]})]}),e.jsxs("div",{className:"pk-card-body",style:{padding:"3rem 2rem"},children:[h===1&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[e.jsxs("div",{style:{display:"flex",gap:"1rem"},children:[e.jsxs("div",{className:"pk-input-group",style:{flex:1},children:[e.jsx("label",{className:"pk-label",children:"First Name *"}),e.jsx("input",{type:"text",className:"pk-input",value:o.firstName,onChange:r=>T({...o,firstName:r.target.value})})]}),e.jsxs("div",{className:"pk-input-group",style:{flex:1},children:[e.jsx("label",{className:"pk-label",children:"Last Name *"}),e.jsx("input",{type:"text",className:"pk-input",value:o.lastName,onChange:r=>T({...o,lastName:r.target.value})})]})]}),e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Email Address *"}),e.jsx("input",{type:"email",className:"pk-input",value:o.email,onChange:r=>T({...o,email:r.target.value}),placeholder:"student@example.com"})]}),e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Phone Number *"}),e.jsx("input",{type:"tel",className:"pk-input",value:o.phone,onChange:r=>T({...o,phone:r.target.value}),placeholder:"555-0100"})]})]}),h===2&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Target Department *"}),e.jsxs("select",{className:"pk-input",value:o.department,onChange:r=>T({...o,department:r.target.value}),children:[e.jsx("option",{value:"",children:"-- Select Department --"}),ce.departments.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Entry Year *"}),e.jsxs("select",{className:"pk-input",value:o.year,onChange:r=>T({...o,year:r.target.value}),children:[e.jsx("option",{value:"",children:"-- Select Level --"}),e.jsx("option",{value:"Freshman",children:"Freshman"}),e.jsx("option",{value:"Transfer",children:"Transfer"}),e.jsx("option",{value:"Graduate",children:"Graduate"})]})]})]}),h===3&&e.jsxs("div",{children:[e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1.5rem"},children:"Review Application"}),e.jsx("div",{style:{background:"var(--pk-bg-main)",padding:"1.5rem",borderRadius:"var(--pk-radius-md)"},children:e.jsx("table",{style:{width:"100%",textAlign:"left"},children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"0.5rem",color:"var(--pk-text-muted)"},children:"Name"}),e.jsxs("td",{style:{fontWeight:600},children:[o.firstName," ",o.lastName]})]}),e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"0.5rem",color:"var(--pk-text-muted)"},children:"Email"}),e.jsx("td",{style:{fontWeight:600},children:o.email})]}),e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"0.5rem",color:"var(--pk-text-muted)"},children:"Phone"}),e.jsx("td",{style:{fontWeight:600},children:o.phone})]}),e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"0.5rem",color:"var(--pk-text-muted)"},children:"Dept"}),e.jsx("td",{style:{fontWeight:600},children:o.department})]}),e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"0.5rem",color:"var(--pk-text-muted)"},children:"Year"}),e.jsx("td",{style:{fontWeight:600},children:o.year})]})]})})})]})]}),e.jsxs("div",{className:"pk-card-footer",style:{display:"flex",justifyContent:"space-between",padding:"1.5rem 2rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{visibility:h===1?"hidden":"visible"},onClick:()=>A(r=>r-1),children:"← Previous"}),h<3?e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:B,children:"Next Step →"}):e.jsx("button",{className:"pk-btn pk-btn-primary",style:{background:"var(--pk-success)"},onClick:D,children:"Confirm Admission ✅"})]})]})}),I=()=>u?e.jsx("div",{className:"pk-container animate-fade-in",style:{display:"flex",justifyContent:"center"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"600px",padding:"3rem"},children:[e.jsxs("h2",{className:"pk-heading-lg",style:{marginBottom:"2rem"},children:["Edit Profile: ",u.id]}),e.jsxs("div",{style:{display:"flex",gap:"1rem",marginBottom:"1rem"},children:[e.jsxs("div",{className:"pk-input-group",style:{flex:1},children:[e.jsx("label",{className:"pk-label",children:"First Name"}),e.jsx("input",{type:"text",className:"pk-input",value:u.firstName,onChange:r=>f({...u,firstName:r.target.value})})]}),e.jsxs("div",{className:"pk-input-group",style:{flex:1},children:[e.jsx("label",{className:"pk-label",children:"Last Name"}),e.jsx("input",{type:"text",className:"pk-input",value:u.lastName,onChange:r=>f({...u,lastName:r.target.value})})]})]}),e.jsxs("div",{className:"pk-input-group",style:{marginBottom:"1rem"},children:[e.jsx("label",{className:"pk-label",children:"Department"}),e.jsx("select",{className:"pk-input",value:u.department,onChange:r=>f({...u,department:r.target.value}),children:ce.departments.map(r=>e.jsx("option",{value:r,children:r},r))})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"1rem",marginTop:"3rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>d("roster"),children:"Cancel"}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:P,children:"Save Profile"})]})]})}):null;return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)"},children:[m==="roster"&&b(),m==="wizard"&&W(),m==="edit"&&I(),e.jsx(M,{})]})}const pe={hospitalName:"PopSite Medical Center",specialties:["All","Cardiology","Pediatrics","Neurology","Orthopedics","General Practice"],doctors:[{id:"dr1",name:"Dr. Sarah Chen",specialty:"Cardiology",rating:4.9,image:"https://images.unsplash.com/photo-1559839734-2b71ea197ec2?auto=format&fit=crop&w=300&q=80",availableTimeSlots:["09:00 AM","10:30 AM","01:00 PM","03:00 PM"]},{id:"dr2",name:"Dr. James Miller",specialty:"Pediatrics",rating:4.8,image:"https://images.unsplash.com/photo-1612349317150-e413f6a5b16d?auto=format&fit=crop&w=300&q=80",availableTimeSlots:["08:30 AM","09:00 AM","11:00 AM","02:15 PM","04:00 PM"]},{id:"dr3",name:"Dr. Elena Rodriguez",specialty:"Neurology",rating:4.7,image:"https://images.unsplash.com/photo-1594824432258-297ebce5b326?auto=format&fit=crop&w=300&q=80",availableTimeSlots:["10:00 AM","11:30 AM"]},{id:"dr4",name:"Dr. William Foster",specialty:"Orthopedics",rating:4.9,image:"https://images.unsplash.com/photo-1537368910025-7028a609b183?auto=format&fit=crop&w=300&q=80",availableTimeSlots:["01:00 PM","02:30 PM","04:45 PM"]}],patientHistory:[{id:"APT-882",doctorName:"Dr. Sarah Chen",date:"2025-11-15",time:"10:30 AM",status:"Completed",diagnosis:"Routine checkup. All healthy."}]};function mt(){const[m,d]=l.useState("directory"),[n,j]=l.useState(pe.doctors),[x,N]=l.useState(pe.patientHistory),[h,A]=l.useState(""),[o,T]=l.useState("All"),[u,f]=l.useState(null),[g,M]=l.useState(new Date().toISOString().split("T")[0]),[y,S]=l.useState(!1),{showToast:B,ToastContainer:D}=J();l.useEffect(()=>{const t=localStorage.getItem("popsite_hosp_docs"),a=localStorage.getItem("popsite_hosp_hist");if(t)try{j(JSON.parse(t))}catch{}if(a)try{N(JSON.parse(a))}catch{}},[]),l.useEffect(()=>{localStorage.setItem("popsite_hosp_docs",JSON.stringify(n)),localStorage.setItem("popsite_hosp_hist",JSON.stringify(x))},[n,x]);const P=(t,a=1e3)=>{S(!0),setTimeout(()=>{S(!1),t()},a)},C=t=>{P(()=>{const a={id:`APT-${Math.floor(Math.random()*1e4)}`,doctorName:u.name,doctorId:u.id,date:g,time:t,status:"Scheduled",diagnosis:"--"};N(i=>[a,...i]),j(i=>i.map(k=>k.id===u.id?{...k,availableTimeSlots:k.availableTimeSlots.filter(F=>F!==t)}:k)),B(`Appointment confirmed for ${t}`,"success"),d("history")},1500)},c=t=>{P(()=>{N(a=>a.map(i=>i.id===t.id?{...i,status:"Cancelled"}:i)),j(a=>a.map(i=>{if(i.id===t.doctorId){const k=[...i.availableTimeSlots,t.time].sort();return{...i,availableTimeSlots:k}}return i})),B(`Appointment ${t.id} cancelled successfully`,"info")})},b=()=>e.jsxs("div",{className:"pk-card",style:{marginBottom:"2rem",padding:"1rem",display:"flex",gap:"1rem",overflowX:"auto"},children:[e.jsx("button",{className:m==="directory"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("directory"),children:"Find a Doctor"}),e.jsx("button",{className:m==="history"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("history"),children:"My Appointments"})]}),W=()=>{const t=n.filter(a=>{const i=o==="All"||a.specialty===o,k=a.name.toLowerCase().includes(h.toLowerCase());return i&&k});return e.jsxs("div",{className:"animate-fade-in",children:[e.jsxs("div",{className:"pk-card pk-glass",style:{padding:"1.5rem",marginBottom:"2rem",display:"flex",flexDirection:"column",gap:"1.5rem"},children:[e.jsx("input",{type:"text",className:"pk-input",placeholder:"Search doctors by name...",style:{width:"100%",maxWidth:"500px"},value:h,onChange:a=>A(a.target.value)}),e.jsx("div",{style:{display:"flex",gap:"0.75rem",overflowX:"auto",paddingBottom:"0.5rem"},children:pe.specialties.map(a=>e.jsx("button",{className:o===a?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",style:{borderRadius:"var(--pk-radius-full)",padding:"0.5rem 1.25rem",whiteSpace:"nowrap"},onClick:()=>T(a),children:a},a))})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))"},children:t.map(a=>{var i;return e.jsxs("div",{className:"pk-card pk-card-interactive",style:{padding:"2rem",display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsx("img",{src:a.image,alt:a.name,style:{width:"120px",height:"120px",borderRadius:"50%",objectFit:"cover",marginBottom:"1.5rem",boxShadow:"var(--pk-shadow-md)"},onError:k=>{k.target.style.display="none",k.target.nextSibling.style.display="flex"}}),e.jsx("div",{style:{display:"none",width:"120px",height:"120px",borderRadius:"50%",background:"var(--pk-primary-light)",color:"var(--pk-primary)",alignItems:"center",justifyContent:"center",fontSize:"2rem",fontWeight:"bold",marginBottom:"1.5rem"},children:((i=a.name.split(" ")[1])==null?void 0:i[0])||"D"}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"0.5rem"},children:a.name}),e.jsx("span",{className:"pk-badge",style:{marginBottom:"1rem",background:"var(--pk-bg-main)",color:"var(--pk-text-muted)"},children:a.specialty}),e.jsxs("span",{style:{fontSize:"0.875rem",color:"#f59e0b",fontWeight:600,marginBottom:"1.5rem"},children:["★ ",a.rating," Rating"]}),e.jsx("button",{className:"pk-btn pk-btn-primary pk-w-full",onClick:()=>{f(a),d("booking")},children:"Book Appointment"})]},a.id)})})]})},I=()=>{if(!u)return null;const t=n.find(a=>a.id===u.id);return e.jsx("div",{className:"animate-fade-in",style:{display:"flex",justifyContent:"center"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"800px",padding:"3rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{marginBottom:"2rem"},onClick:()=>d("directory"),children:"← Back"}),e.jsxs("div",{style:{display:"flex",gap:"2rem",alignItems:"center",marginBottom:"3rem",borderBottom:"1px solid var(--pk-border)",paddingBottom:"2rem"},children:[e.jsx("img",{src:t.image,alt:"",style:{width:"100px",height:"100px",borderRadius:"50%",objectFit:"cover"},onError:a=>{a.target.style.display="none"}}),e.jsxs("div",{children:[e.jsx("h2",{className:"pk-heading-lg",children:t.name}),e.jsx("p",{className:"pk-text-body",children:t.specialty})]})]}),e.jsxs("div",{className:"pk-input-group",style:{marginBottom:"3rem",maxWidth:"300px"},children:[e.jsx("label",{className:"pk-label",children:"Select Date: "}),e.jsx("input",{type:"date",className:"pk-input",value:g,onChange:a=>M(a.target.value)})]}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1.5rem"},children:"Available Time Slots"}),t.availableTimeSlots.length===0?e.jsxs("div",{className:"pk-empty-state",style:{padding:"2rem",border:"1px solid var(--pk-border)"},children:[e.jsx("h4",{className:"pk-heading-md",children:"Fully Booked"}),e.jsx("p",{className:"pk-text-body",children:"No remaining slots available for this doctor."})]}):e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))"},children:t.availableTimeSlots.map(a=>e.jsx("button",{className:"pk-btn pk-btn-outline",style:{padding:"1rem",fontSize:"1.125rem"},onClick:()=>C(a),children:a},a))})]})})},r=()=>e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"2rem"},children:"Patient History"}),x.length===0?e.jsxs("div",{className:"pk-empty-state",children:[e.jsx("div",{className:"pk-empty-icon",style:{fontSize:"4rem"},children:"🏥"}),e.jsx("h3",{className:"pk-heading-md",children:"No Appointments Found"}),e.jsx("p",{className:"pk-text-body",children:"You have not scheduled any appointments yet."})]}):e.jsx("div",{className:"pk-grid pk-flex-col pk-gap-4",children:x.map(t=>e.jsxs("div",{className:"pk-card",style:{padding:"1.5rem",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"1rem",borderLeft:t.status==="Cancelled"?"4px solid var(--pk-danger)":t.status==="Completed"?"4px solid var(--pk-success)":"4px solid var(--pk-primary)"},children:[e.jsxs("div",{children:[e.jsx("h3",{className:"pk-heading-md",children:t.doctorName}),e.jsxs("p",{className:"pk-text-sm",style:{color:"var(--pk-primary)",fontWeight:600,marginBottom:"0.5rem"},children:[t.date," • ",t.time]}),e.jsxs("p",{className:"pk-text-sm",children:["ID: ",t.id]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"0.5rem"},children:[e.jsx("span",{className:"pk-badge",style:{background:t.status==="Scheduled"?"var(--pk-primary-light)":"var(--pk-bg-main)",color:t.status==="Cancelled"?"var(--pk-danger)":"var(--pk-text-main)"},children:t.status}),t.status==="Scheduled"&&e.jsx("button",{className:"pk-btn pk-btn-outline",style:{color:"var(--pk-danger)",border:"none",padding:"0.5rem 1rem"},onClick:()=>c(t),children:"Cancel Appointment"})]})]},t.id))})]});return e.jsxs("div",{className:"pk-container",style:{minHeight:"100vh"},children:[y&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.8)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Processing..."})]}),e.jsxs("div",{style:{marginBottom:"2rem"},children:[e.jsx("h1",{className:"pk-heading-xl",children:pe.hospitalName}),e.jsx("p",{className:"pk-text-body",children:"Patient portal and reservation network."})]}),b(),e.jsxs("div",{style:{position:"relative"},children:[m==="directory"&&W(),m==="booking"&&I(),m==="history"&&r()]}),e.jsx(D,{})]})}const X={hero:{title:"Build Faster, Ship Better.",subtitle:"The ultimate zero-config React component architecture designed for the future of the web.",cta1:"Get Started Free",cta2:"View Documentation"},stats:{users:15400,deployments:89e3,uptime:99.9},features:[{id:"f1",title:"Zero Configuration",description:"No complex webpack or babel setups. Just import and go.",icon:"⚡"},{id:"f2",title:"Vanilla CSS Engine",description:"Powered entirely by native CSS variables for maximum portability.",icon:"🎨"},{id:"f3",title:"State Perseverance",description:"Built-in localStorage binding keeps user sessions active instantly.",icon:"💾"},{id:"f4",title:"Glassmorphism UI",description:"Premium, frosted-glass aesthetics out of the box.",icon:"🔍"}],testimonials:[{id:"t1",name:"Sarah Jenkins",role:"Frontend Lead at Acme",avatar:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=150&q=80",text:"PopSite UI completely changed how we prototype apps. The modules are instantly plug-and-play."},{id:"t2",name:"David Chen",role:"Fullstack Developer",avatar:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=150&q=80",text:"I love the anti-Tailwind philosophy. The pure CSS approach feels so clean and blazing fast."},{id:"t3",name:"Elena Rostova",role:"Product Designer",avatar:"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?auto=format&fit=crop&w=150&q=80",text:"The default drop shadows and glass effects give it a distinct 2026 enterprise feel. Absolutely stunning."}],pricing:[{id:"p1",tier:"Hobby",price:"$0",features:["1 Project","Basic Modules","Community Discord"],cta:"Start Free"},{id:"p2",tier:"Pro",price:"$29/mo",featured:!0,features:["Unlimited Projects","All Pro Modules","Premium Support","Priority Updates"],cta:"Upgrade to Pro"},{id:"p3",tier:"Enterprise",price:"Custom",features:["Dedicated Account Manager","Custom SLA","Source Code Access"],cta:"Contact Sales"}]};function ht(){const[m,d]=l.useState("hero"),[n,j]=l.useState(0),[x,N]=l.useState(0);l.useEffect(()=>{if(m!=="hero")return;const f=2e3,g=60,M=X.stats.users/g,y=X.stats.deployments/g;let S=0;const B=setInterval(()=>{S++,S<=g?(j(Math.floor(M*S)),N(Math.floor(y*S))):(j(X.stats.users),N(X.stats.deployments),clearInterval(B))},f/g);return()=>clearInterval(B)},[m]);const h=()=>e.jsxs("nav",{className:"pk-nav pk-glass",children:[e.jsx("div",{className:"pk-heading-md pk-gradient-text",style:{cursor:"pointer"},onClick:()=>d("hero"),children:"PopSite"}),e.jsxs("div",{style:{display:"flex",gap:"1.5rem"},className:"pk-hidden-mobile",children:[e.jsx("button",{style:{background:"none",border:"none",cursor:"pointer",fontWeight:600,color:m==="hero"?"var(--pk-primary)":"var(--pk-text-main)"},onClick:()=>d("hero"),children:"Home"}),e.jsx("button",{style:{background:"none",border:"none",cursor:"pointer",fontWeight:600,color:m==="features"?"var(--pk-primary)":"var(--pk-text-main)"},onClick:()=>d("features"),children:"Features"}),e.jsx("button",{style:{background:"none",border:"none",cursor:"pointer",fontWeight:600,color:m==="testimonials"?"var(--pk-primary)":"var(--pk-text-main)"},onClick:()=>d("testimonials"),children:"Testimonials"}),e.jsx("button",{style:{background:"none",border:"none",cursor:"pointer",fontWeight:600,color:m==="pricing"?"var(--pk-primary)":"var(--pk-text-main)"},onClick:()=>d("pricing"),children:"Pricing"})]}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>d("pricing"),children:"Get Started"})]}),A=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"80vh",textAlign:"center"},children:[e.jsx("div",{style:{position:"absolute",top:"20%",left:"10%",width:"150px",height:"150px",background:"radial-gradient(circle, var(--pk-primary), transparent 70%)",opacity:.2,filter:"blur(20px)",animation:"floatA 6s infinite ease-in-out"}}),e.jsx("div",{style:{position:"absolute",bottom:"20%",right:"10%",width:"250px",height:"250px",background:"radial-gradient(circle, var(--pk-secondary), transparent 70%)",opacity:.15,filter:"blur(30px)",animation:"floatB 8s infinite ease-in-out reverse"}}),e.jsx("div",{className:"pk-badge",style:{marginBottom:"2rem",padding:"0.5rem 1rem",fontSize:"0.875rem"},children:"✨ v1.0 is now live"}),e.jsx("h1",{className:"pk-heading-xl",style:{fontSize:"4.5rem",marginBottom:"1.5rem",lineHeight:1.1},children:e.jsx("span",{className:"pk-gradient-text",children:X.hero.title})}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.5rem",maxWidth:"800px",marginBottom:"3rem"},children:X.hero.subtitle}),e.jsxs("div",{style:{display:"flex",gap:"1rem",marginBottom:"4rem"},children:[e.jsx("button",{className:"pk-btn pk-btn-primary",style:{fontSize:"1.125rem",padding:"1rem 2rem"},onClick:()=>d("pricing"),children:X.hero.cta1}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{fontSize:"1.125rem",padding:"1rem 2rem"},onClick:()=>d("features"),children:X.hero.cta2})]}),e.jsxs("div",{className:"pk-grid pk-glass",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:"4rem",padding:"2rem 4rem",borderRadius:"var(--pk-radius-lg)",background:"var(--pk-bg-glass)",display:"inline-grid"},children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"pk-heading-lg",style:{color:"var(--pk-primary)"},children:[n.toLocaleString(),"+"]}),e.jsx("p",{className:"pk-text-muted pk-label",children:"Developers"})]}),e.jsxs("div",{children:[e.jsxs("h2",{className:"pk-heading-lg",style:{color:"var(--pk-secondary)"},children:[x.toLocaleString(),"+"]}),e.jsx("p",{className:"pk-text-muted pk-label",children:"Deployments"})]}),e.jsxs("div",{children:[e.jsxs("h2",{className:"pk-heading-lg",style:{color:"var(--pk-success)"},children:[X.stats.uptime,"%"]}),e.jsx("p",{className:"pk-text-muted pk-label",children:"Uptime SLA"})]})]}),e.jsx("style",{children:`
|
|
58
|
+
@keyframes floatA { 0%, 100% { transform: translateY(0px) scale(1); } 50% { transform: translateY(-30px) scale(1.1); } }
|
|
59
|
+
@keyframes floatB { 0%, 100% { transform: translateY(0px) scale(1); } 50% { transform: translateY(40px) scale(0.9); } }
|
|
60
|
+
`})]}),o=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{padding:"4rem 2rem"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"4rem"},children:[e.jsx("h2",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:"Architected for Speed"}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem"},children:"Everything you need to build scalable interfaces without the bloat."})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(350px, 1fr))",gap:"3rem"},children:X.features.map(f=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{padding:"3rem 2rem",textAlign:"center",background:"var(--pk-bg-glass)",border:"1px solid rgba(255,255,255,0.4)",backdropFilter:"blur(10px)"},children:[e.jsx("div",{style:{fontSize:"3rem",marginBottom:"1.5rem",filter:"drop-shadow(0 10px 10px rgba(0,0,0,0.1))"},children:f.icon}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:f.title}),e.jsx("p",{className:"pk-text-body",children:f.description})]},f.id))})]}),T=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{padding:"4rem 2rem"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"4rem"},children:[e.jsx("h2",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:"Loved by Engineers"}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem"},children:"Here's what the community is saying."})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"2rem"},children:X.testimonials.map(f=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{padding:"2rem",display:"flex",flexDirection:"column",gap:"1.5rem"},children:[e.jsx("div",{style:{color:"#f59e0b",fontSize:"1.5rem",letterSpacing:"4px"},children:"★★★★★"}),e.jsxs("p",{className:"pk-text-body",style:{fontSize:"1.125rem",fontStyle:"italic",flex:1},children:['"',f.text,'"']}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[e.jsx("img",{src:f.avatar,alt:f.name,style:{width:"50px",height:"50px",borderRadius:"50%",objectFit:"cover"}}),e.jsxs("div",{children:[e.jsx("h4",{className:"pk-label",children:f.name}),e.jsx("p",{className:"pk-text-sm",style:{color:"var(--pk-primary)"},children:f.role})]})]})]},f.id))})]}),u=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{padding:"4rem 2rem"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"4rem"},children:[e.jsx("h2",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:"Simple, transparent pricing"}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem"},children:"No hidden fees. Absolute freedom."})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"2rem",alignItems:"center"},children:X.pricing.map(f=>e.jsxs("div",{className:"pk-card",style:{padding:"3rem 2rem",position:"relative",border:f.featured?"2px solid var(--pk-primary)":"1px solid var(--pk-border)",transform:f.featured?"scale(1.05)":"scale(1)",zIndex:f.featured?10:1},children:[f.featured&&e.jsx("div",{style:{position:"absolute",top:0,left:"50%",transform:"translate(-50%, -50%)",background:"var(--pk-primary)",color:"white",padding:"0.25rem 1rem",borderRadius:"var(--pk-radius-full)",fontWeight:600,fontSize:"0.875rem"},children:"Most Popular"}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"0.5rem",textAlign:"center"},children:f.tier}),e.jsx("div",{className:"pk-heading-xl pk-gradient-text",style:{textAlign:"center",marginBottom:"2rem"},children:f.price}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginBottom:"3rem"},children:f.features.map(g=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx("span",{style:{color:"var(--pk-success)"},children:"✓"}),e.jsx("span",{className:"pk-text-body",children:g})]},g))}),e.jsx("button",{className:`pk-btn pk-w-full ${f.featured?"pk-btn-primary":"pk-btn-outline"}`,style:{padding:"1rem"},children:f.cta})]},f.id))})]});return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)",overflow:"hidden"},children:[h(),m==="hero"&&A(),m==="features"&&o(),m==="testimonials"&&T(),m==="pricing"&&u()]})}const be={platformName:"Voyager Lodgings",amenities:["WiFi","Pool","Gym","Spa","Restaurant","Parking"],hotels:[{id:"h1",name:"The Obsidian Resort",destination:"Maldives",rating:5,pricePerNight:450,amenities:["WiFi","Pool","Spa","Restaurant"],image:"https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&w=800&q=80",description:"Experience luxury in crystal clear waters. Wake up to ocean views.",gallery:["https://images.unsplash.com/photo-1582719508461-905c673771fd?auto=format&fit=crop&w=800&q=80","https://images.unsplash.com/photo-1571896349842-33c89424de2d?auto=format&fit=crop&w=800&q=80"]},{id:"h2",name:"Alpine Retreat",destination:"Swiss Alps",rating:4,pricePerNight:280,amenities:["WiFi","Gym","Restaurant","Parking"],image:"https://images.unsplash.com/photo-1520250497591-112f2f40a3f4?auto=format&fit=crop&w=800&q=80",description:"Cozy cabin living with ski-in, ski-out access and a roaring fireplace.",gallery:["https://images.unsplash.com/photo-1621293954908-907159247fc8?auto=format&fit=crop&w=800&q=80"]},{id:"h3",name:"Neon Towers Hotel",destination:"Tokyo",rating:5,pricePerNight:350,amenities:["WiFi","Gym","Restaurant"],image:"https://images.unsplash.com/photo-1503899036084-c55cdd92da26?auto=format&fit=crop&w=800&q=80",description:"Ultra-modern rooms suspended above the neon-drenched city streets.",gallery:["https://images.unsplash.com/photo-1518548419970-58e3b4079ab2?auto=format&fit=crop&w=800&q=80"]},{id:"h4",name:"Hacienda Horizon",destination:"Tulum",rating:3,pricePerNight:120,amenities:["WiFi","Pool","Parking"],image:"https://images.unsplash.com/photo-1510798831971-661eb04b3739?auto=format&fit=crop&w=800&q=80",description:"Boutique eco-resort nestled deeply in the Mayan jungle.",gallery:["https://images.unsplash.com/photo-1590073844006-33379778ae09?auto=format&fit=crop&w=800&q=80"]}]};function ut(){const[m,d]=l.useState("search"),n=new Date().toISOString().split("T")[0],j=new Date(Date.now()+864e5*3).toISOString().split("T")[0],[x,N]=l.useState(""),[h,A]=l.useState(n),[o,T]=l.useState(j),[u,f]=l.useState(0),[g,M]=l.useState([]),[y,S]=l.useState(null),[B,D]=l.useState(3),[P,C]=l.useState(!1),{showToast:c,ToastContainer:b}=J();l.useEffect(()=>{const w=new Date(h),R=new Date(o),H=Math.ceil((R-w)/(1e3*60*60*24));H>0?D(H):D(0)},[h,o]);const W=(w,R=1500)=>{C(!0),setTimeout(()=>{C(!1),w()},R)},I=w=>{if(w.preventDefault(),B<=0){c("Check-out must be after Check-in","error");return}W(()=>{d("listing")})},r=w=>{g.includes(w)?M(R=>R.filter(H=>H!==w)):M(R=>[...R,w])},t=()=>{W(()=>{c(`Success! Your booking for ${y.name} is confirmed.`,"success"),d("search")},2e3)},a=()=>e.jsxs("div",{className:"pk-container animate-fade-in",style:{minHeight:"80vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"3rem"},children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:be.platformName}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem"},children:"Find your perfect escape anywhere in the world."})]}),e.jsx("div",{className:"pk-card pk-glass",style:{width:"100%",maxWidth:"800px",padding:"3rem"},children:e.jsxs("form",{onSubmit:I,style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[e.jsxs("div",{className:"pk-input-group",children:[e.jsx("label",{className:"pk-label",children:"Where are you going?"}),e.jsx("input",{type:"text",className:"pk-input",placeholder:"e.g. Tokyo, Swiss Alps, Maldives",value:x,onChange:w=>N(w.target.value),required:!0})]}),e.jsxs("div",{style:{display:"flex",gap:"1.5rem"},children:[e.jsxs("div",{className:"pk-input-group",style:{flex:1},children:[e.jsx("label",{className:"pk-label",children:"Check In"}),e.jsx("input",{type:"date",className:"pk-input",value:h,onChange:w=>A(w.target.value),required:!0})]}),e.jsxs("div",{className:"pk-input-group",style:{flex:1},children:[e.jsx("label",{className:"pk-label",children:"Check Out"}),e.jsx("input",{type:"date",className:"pk-input",value:o,onChange:w=>T(w.target.value),required:!0})]})]}),B>0&&e.jsxs("p",{className:"pk-text-sm pk-text-center",style:{color:"var(--pk-primary)"},children:["Duration: ",B," nights"]}),e.jsx("button",{type:"submit",className:"pk-btn pk-btn-primary pk-w-full",style:{padding:"1.25rem",fontSize:"1.125rem",marginTop:"1rem"},children:"Search Accommodations"})]})})]}),i=()=>{const w=be.hotels.filter(R=>{const H=!x||R.destination.toLowerCase().includes(x.toLowerCase()),me=u===0||R.rating>=u,he=g.every(ue=>R.amenities.includes(ue));return H&&me&&he});return e.jsxs("div",{className:"pk-container animate-fade-in",style:{display:"flex",gap:"2rem",alignItems:"flex-start"},children:[e.jsxs("div",{className:"pk-card pk-hidden-mobile",style:{width:"300px",padding:"1.5rem",flexShrink:0},children:[e.jsx("button",{className:"pk-btn pk-btn-outline pk-w-full",style:{marginBottom:"2rem"},onClick:()=>d("search"),children:"← Modifiy Search"}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:"Star Rating"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"2rem"},children:[[5,4,3].map(R=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsx("input",{type:"radio",name:"rating",checked:u===R,onChange:()=>f(R),style:{accentColor:"var(--pk-primary)"}}),e.jsx("span",{style:{color:"#f59e0b"},children:"★".repeat(R)}),e.jsx("span",{className:"pk-text-muted",children:"& up"})]},R)),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",marginTop:"0.5rem"},children:[e.jsx("input",{type:"radio",name:"rating",checked:u===0,onChange:()=>f(0),style:{accentColor:"var(--pk-primary)"}}),e.jsx("span",{className:"pk-text-main",children:"Show All"})]})]}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:"Amenities"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem"},children:be.amenities.map(R=>e.jsx("button",{className:g.includes(R)?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",style:{padding:"0.25rem 0.5rem",borderRadius:"4px",fontSize:"0.75rem"},onClick:()=>r(R),children:R},R))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"2rem"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("h2",{className:"pk-heading-lg",children:x||"All Destinations"}),e.jsxs("span",{className:"pk-text-muted",children:[w.length," properties found"]})]}),w.length===0?e.jsxs("div",{className:"pk-empty-state",children:[e.jsx("h3",{className:"pk-heading-md",children:"No properties found"}),e.jsx("p",{className:"pk-text-body",children:"Try removing some filters."})]}):w.map(R=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{display:"flex",flexWrap:"wrap",overflow:"hidden"},children:[e.jsx("div",{style:{flex:"1 1 300px",height:"250px"},children:e.jsx("img",{src:R.image,alt:R.name,style:{width:"100%",height:"100%",objectFit:"cover"}})}),e.jsxs("div",{style:{flex:"2 1 300px",padding:"2rem",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"0.5rem"},children:[e.jsxs("div",{children:[e.jsx("h3",{className:"pk-heading-lg",children:R.name}),e.jsxs("p",{className:"pk-text-sm",style:{color:"var(--pk-primary)",display:"flex",alignItems:"center",gap:"0.5rem"},children:["📍 ",R.destination]})]}),e.jsx("span",{style:{background:"#f59e0b",color:"white",padding:"0.25rem 0.5rem",borderRadius:"4px",fontWeight:"bold"},children:"★".repeat(R.rating)})]}),e.jsx("p",{className:"pk-text-body",style:{margin:"1rem 0",flex:1},children:R.description}),e.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginBottom:"1.5rem"},children:R.amenities.map(H=>e.jsx("span",{className:"pk-badge",children:H},H))}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",borderTop:"1px solid var(--pk-border)",paddingTop:"1rem"},children:[e.jsxs("div",{children:[e.jsxs("span",{className:"pk-heading-lg",style:{color:"var(--pk-primary)"},children:["$",R.pricePerNight]}),e.jsx("span",{className:"pk-text-muted",children:" / night"})]}),e.jsx("button",{className:"pk-btn pk-btn-primary",onClick:()=>{S(R),d("gallery")},children:"View Deal"})]})]})]},R.id))]})]})},k=()=>y?e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{marginBottom:"2rem"},onClick:()=>d("listing"),children:"← Back"}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",marginBottom:"2rem"},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"0.5rem"},children:y.name}),e.jsxs("p",{className:"pk-text-body",style:{fontSize:"1.125rem"},children:["📍 ",y.destination]})]}),e.jsxs("button",{className:"pk-btn pk-btn-primary",style:{padding:"1rem 2rem",fontSize:"1.25rem"},onClick:()=>d("summary"),children:["Reserve • $",y.pricePerNight*B," Total"]})]}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem"},children:[e.jsx("div",{style:{flex:"2 1 500px",height:"400px",borderRadius:"var(--pk-radius-lg)",overflow:"hidden"},children:e.jsx("img",{src:y.image,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),e.jsx("div",{style:{flex:"1 1 300px",display:"flex",flexDirection:"column",gap:"1rem"},children:y.gallery.map((w,R)=>e.jsx("div",{style:{flex:1,height:"192px",borderRadius:"var(--pk-radius-lg)",overflow:"hidden"},children:e.jsx("img",{src:w,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})},R))})]}),e.jsxs("div",{className:"pk-card",style:{marginTop:"2rem",padding:"2rem"},children:[e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:"About this property"}),e.jsx("p",{className:"pk-text-body",children:y.description}),e.jsx("h4",{className:"pk-label",style:{marginTop:"2rem",marginBottom:"1rem"},children:"Popular Amenities"}),e.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:y.amenities.map(w=>e.jsxs("span",{className:"pk-badge",style:{fontSize:"1rem",padding:"0.5rem 1rem"},children:["✓ ",w]},w))})]})]}):null,F=()=>{if(!y)return null;const w=y.pricePerNight*B;return e.jsx("div",{className:"pk-container animate-fade-in",style:{display:"flex",justifyContent:"center"},children:e.jsxs("div",{className:"pk-card",style:{width:"100%",maxWidth:"600px",padding:"3rem"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"Review Booking"}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{border:"none"},onClick:()=>d("gallery"),children:"Cancel"})]}),e.jsxs("div",{style:{display:"flex",gap:"1.5rem",marginBottom:"2rem",background:"var(--pk-bg-main)",padding:"1rem",borderRadius:"var(--pk-radius-md)"},children:[e.jsx("img",{src:y.image,alt:"",style:{width:"80px",height:"80px",borderRadius:"var(--pk-radius-sm)",objectFit:"cover"}}),e.jsxs("div",{children:[e.jsx("h3",{className:"pk-heading-md",children:y.name}),e.jsx("p",{className:"pk-text-sm",style:{color:"var(--pk-primary)"},children:y.destination})]})]}),e.jsxs("div",{style:{display:"flex",gap:"1rem",marginBottom:"2rem"},children:[e.jsxs("div",{className:"pk-card",style:{flex:1,padding:"1rem",textAlign:"center"},children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Check-In"}),e.jsx("p",{className:"pk-heading-sm",children:h})]}),e.jsxs("div",{className:"pk-card",style:{flex:1,padding:"1rem",textAlign:"center"},children:[e.jsx("p",{className:"pk-label pk-text-muted",children:"Check-Out"}),e.jsx("p",{className:"pk-heading-sm",children:o})]})]}),e.jsxs("div",{style:{borderTop:"1px solid var(--pk-border)",borderBottom:"1px solid var(--pk-border)",padding:"1.5rem 0",marginBottom:"2rem"},children:[e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:"Price Details"}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[e.jsxs("span",{className:"pk-text-body",children:["$",y.pricePerNight," x ",B," nights"]}),e.jsxs("span",{children:["$",w]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[e.jsx("span",{className:"pk-text-body",children:"Taxes and fees"}),e.jsxs("span",{children:["$",(w*.1).toFixed(0)]})]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem"},children:[e.jsx("span",{className:"pk-heading-lg",children:"Total (USD)"}),e.jsxs("span",{className:"pk-heading-xl",style:{color:"var(--pk-primary)"},children:["$",(w*1.1).toFixed(0)]})]}),e.jsx("button",{className:"pk-btn pk-btn-primary pk-w-full",style:{padding:"1.25rem",fontSize:"1.125rem"},onClick:t,children:"Confirm & Pay"})]})})};return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)"},children:[P&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.8)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Searching Global Availability..."})]}),m==="search"&&a(),m==="listing"&&i(),m==="gallery"&&k(),m==="summary"&&F(),e.jsx(b,{})]})}const je={libraryName:"PopSite Central Library",catalog:[{id:"b1",title:"The Pragmatic Programmer",author:"David Thomas",cover:"https://images.unsplash.com/photo-1544947950-fa07a98d237f?auto=format&fit=crop&w=400&q=80",genre:"Technology",available:!0},{id:"b2",title:"Clean Architecture",author:"Robert C. Martin",cover:"https://images.unsplash.com/photo-1589829085413-56de8ae18c73?auto=format&fit=crop&w=400&q=80",genre:"Technology",available:!0},{id:"b3",title:"Dune",author:"Frank Herbert",cover:"https://images.unsplash.com/photo-1616422285623-13ff0162193c?auto=format&fit=crop&w=400&q=80",genre:"Science Fiction",available:!1},{id:"b4",title:"The Martian",author:"Andy Weir",cover:"https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=400&q=80",genre:"Science Fiction",available:!0},{id:"b5",title:"Thinking, Fast and Slow",author:"Daniel Kahneman",cover:"https://images.unsplash.com/photo-1532012197267-da84d127e765?auto=format&fit=crop&w=400&q=80",genre:"Psychology",available:!0}],myBooks:[{book:{id:"bX",title:"1984",author:"George Orwell",cover:"https://images.unsplash.com/photo-1541963463532-d68292c34b19?auto=format&fit=crop&w=400&q=80",genre:"Dystopian"},borrowDate:"2026-03-01",dueDate:"2026-03-15"}]};function xt(){const[m,d]=l.useState("catalog"),[n,j]=l.useState(je.catalog),[x,N]=l.useState(je.myBooks),[h,A]=l.useState(""),[o,T]=l.useState(!1),{showToast:u,ToastContainer:f}=J();l.useEffect(()=>{const C=localStorage.getItem("popsite_library_cat"),c=localStorage.getItem("popsite_library_my");if(C)try{j(JSON.parse(C))}catch{}if(c)try{N(JSON.parse(c))}catch{}},[]),l.useEffect(()=>{localStorage.setItem("popsite_library_cat",JSON.stringify(n)),localStorage.setItem("popsite_library_my",JSON.stringify(x))},[n,x]);const g=(C,c=800)=>{T(!0),setTimeout(()=>{T(!1),C()},c)},M=C=>{g(()=>{const c=new Date;c.setDate(c.getDate()+14);const b={book:C,borrowDate:new Date().toISOString().split("T")[0],dueDate:c.toISOString().split("T")[0]};N([...x,b]),j(n.map(W=>W.id===C.id?{...W,available:!1}:W)),u(`You have borrowed "${C.title}"`,"success")})},y=C=>{g(()=>{N(x.filter(b=>b.book.id!==C.book.id));const c=n.find(b=>b.id===C.book.id);j(c?n.map(b=>b.id===C.book.id?{...b,available:!0}:b):[...n,{...C.book,available:!0}]),u(`Returned "${C.book.title}" successfully`,"info")})},S=C=>{const c=new Date(C);return new Date>c},B=()=>e.jsxs("div",{className:"pk-card",style:{marginBottom:"2rem",padding:"1rem",display:"flex",gap:"1rem"},children:[e.jsx("button",{className:m==="catalog"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("catalog"),children:"Public Catalog"}),e.jsxs("button",{className:m==="dashboard"?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",onClick:()=>d("dashboard"),children:["My Books (",x.length,")"]})]}),D=()=>{const C=n.filter(c=>c.title.toLowerCase().includes(h.toLowerCase())||c.author.toLowerCase().includes(h.toLowerCase()));return e.jsxs("div",{className:"animate-fade-in",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"Browse Collection"}),e.jsx("input",{type:"text",className:"pk-input",placeholder:"Search title or author...",value:h,onChange:c=>A(c.target.value)})]}),e.jsx("div",{className:"pk-grid",style:{gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))"},children:C.map(c=>e.jsxs("div",{className:"pk-card pk-card-interactive",style:{display:"flex",flexDirection:"column"},children:[e.jsx("div",{style:{height:"300px",width:"100%"},children:e.jsx("img",{src:c.cover,alt:c.title,style:{width:"100%",height:"100%",objectFit:"cover"},onError:b=>{b.target.style.display="none"}})}),e.jsxs("div",{className:"pk-card-body",style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsx("span",{className:"pk-badge",style:{alignSelf:"flex-start",marginBottom:"0.5rem",background:"var(--pk-bg-main)",color:"var(--pk-text-muted)"},children:c.genre}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"0.25rem"},children:c.title}),e.jsx("p",{className:"pk-text-sm",style:{marginBottom:"1rem",flex:1},children:c.author}),c.available?e.jsx("button",{className:"pk-btn pk-btn-primary pk-w-full",onClick:()=>M(c),children:"Borrow Book"}):e.jsx("button",{className:"pk-btn pk-btn-outline pk-w-full",disabled:!0,children:"Currently Rented"})]})]},c.id))})]})},P=()=>e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"2rem"},children:"My Bookshelf"}),x.length===0?e.jsxs("div",{className:"pk-empty-state",children:[e.jsx("div",{className:"pk-empty-icon",children:"📚"}),e.jsx("h3",{className:"pk-heading-md",children:"Your shelf is empty"}),e.jsx("p",{className:"pk-text-body",children:"Go to the catalog to borrow some books."})]}):e.jsx("div",{className:"pk-grid pk-flex-col pk-gap-4",children:x.map((C,c)=>{const b=S(C.dueDate);return e.jsxs("div",{className:"pk-card",style:{display:"flex",alignItems:"center",gap:"1.5rem",padding:"1rem",borderLeft:b?"4px solid var(--pk-danger)":"1px solid var(--pk-border)"},children:[e.jsx("div",{style:{width:"80px",height:"110px",borderRadius:"4px",overflow:"hidden"},children:e.jsx("img",{src:C.book.cover,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"0.25rem"},children:C.book.title}),e.jsx("p",{className:"pk-text-sm",style:{marginBottom:"1rem"},children:C.book.author}),e.jsxs("div",{style:{display:"flex",gap:"2rem"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",style:{fontSize:"0.75rem"},children:"Borrowed"}),e.jsx("p",{className:"pk-text-body",style:{fontWeight:600},children:C.borrowDate})]}),e.jsxs("div",{children:[e.jsx("p",{className:"pk-label pk-text-muted",style:{fontSize:"0.75rem"},children:"Due Date"}),e.jsx("p",{className:"pk-text-body",style:{fontWeight:600,color:b?"var(--pk-danger)":"var(--pk-text-main)"},children:C.dueDate})]}),b&&e.jsx("div",{style:{alignSelf:"flex-end",background:"var(--pk-danger)",color:"white",padding:"0.1rem 0.5rem",borderRadius:"var(--pk-radius-sm)",fontSize:"0.75rem",fontWeight:"bold"},children:"OVERDUE"})]})]}),e.jsx("button",{className:"pk-btn pk-btn-outline",onClick:()=>y(C),children:"Return Book"})]},c)})})]});return e.jsxs("div",{className:"pk-container",style:{minHeight:"100vh"},children:[o&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.7)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Syncing Library Database..."})]}),e.jsxs("div",{style:{marginBottom:"2rem"},children:[e.jsx("h1",{className:"pk-heading-xl",children:je.libraryName}),e.jsx("p",{className:"pk-text-body",children:"Your portal to infinite knowledge."})]}),B(),e.jsxs("div",{style:{position:"relative"},children:[m==="catalog"&&D(),m==="dashboard"&&P()]}),e.jsx(f,{})]})}const Fe={platformName:"PopSite Tickets",upcomingEvents:[{id:"ev1",title:"Global Tech Summit 2026",date:new Date(Date.now()+864e5*5).toISOString(),location:"San Francisco Convention Center",image:"https://images.unsplash.com/photo-1540575467063-178a50c2df87?auto=format&fit=crop&w=800&q=80",description:"The premier gathering of global tech leaders discussing AI, web architecture, and edge computing.",speakers:["Dr. Evelyn Stone (AI Lead, Acme)","Marcus Chen (Founder, WebCorp)"],agenda:["09:00 - Keynote","11:30 - The Future of Vanilla CSS","15:00 - Networking Mixer"],tiers:[{id:"t1",name:"General Admission",price:299,capacity:50},{id:"t2",name:"VIP Backstage",price:899,capacity:0}]},{id:"ev2",title:"Electronic Music Paradise",date:new Date(Date.now()+864e5*12).toISOString(),location:"Miami Beach Outdoor Arena",image:"https://images.unsplash.com/photo-1470229722913-7c090be5f524?auto=format&fit=crop&w=800&q=80",description:"A 3-day outdoor electronic music festival featuring top global DJs and immersive light shows.",speakers:["DJ Nova","The Synthetics"],agenda:["Day 1 - Opening Ceremony","Day 2 - Sunset Stage","Day 3 - Fireworks Finale"],tiers:[{id:"t3",name:"3-Day Pass",price:349,capacity:1500},{id:"t4",name:"VIP + Artist Meet",price:1200,capacity:15}]}]};function gt(){const[m,d]=l.useState("feed"),[n,j]=l.useState(null),[x,N]=l.useState(!1),[h,A]=l.useState(null),[o,T]=l.useState(!1),[u,f]=l.useState([]),{showToast:g,ToastContainer:M}=J();l.useEffect(()=>{const c=localStorage.getItem("popsite_events");if(c)try{f(JSON.parse(c))}catch{}},[]),l.useEffect(()=>{localStorage.setItem("popsite_events",JSON.stringify(u))},[u]);const y=c=>{const[b,W]=l.useState({days:0,hours:0,minutes:0,seconds:0});return l.useEffect(()=>{const I=new Date(c).getTime(),r=setInterval(()=>{const t=new Date().getTime(),a=I-t;a<=0?(clearInterval(r),W({days:0,hours:0,minutes:0,seconds:0})):W({days:Math.floor(a/(1e3*60*60*24)),hours:Math.floor(a%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(a%(1e3*60*60)/(1e3*60)),seconds:Math.floor(a%(1e3*60)/1e3)})},1e3);return()=>clearInterval(r)},[c]),b},S=(c,b=1500)=>{T(!0),setTimeout(()=>{T(!1),c()},b)},B=()=>{S(()=>{const c={eventId:n.id,ticketId:`TKT-${Math.floor(Math.random()*1e4)}-${Date.now().toString().slice(-4)}`,tier:h};f(b=>[...b,c]),N(!1),A(null),g("Payment successful! Your ticket is secured.","success")})},D=()=>e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"3rem"},children:[e.jsx("h1",{className:"pk-heading-xl",style:{marginBottom:"1rem"},children:Fe.platformName}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.25rem"},children:"Secure your spot at the world's most exclusive events."})]}),e.jsx("div",{className:"pk-grid pk-flex-col pk-gap-6",children:Fe.upcomingEvents.map(c=>{const b=new Date(c.date);return e.jsxs("div",{className:"pk-card pk-card-interactive",style:{display:"flex",flexWrap:"wrap"},children:[e.jsx("div",{style:{flex:"1 1 300px",height:"250px"},children:e.jsx("img",{src:c.image,alt:c.title,style:{width:"100%",height:"100%",objectFit:"cover"}})}),e.jsxs("div",{className:"pk-card-body",style:{flex:"2 1 400px",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[e.jsx("span",{className:"pk-badge",children:b.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}),u.find(W=>W.eventId===c.id)&&e.jsx("span",{style:{color:"var(--pk-success)",fontWeight:"bold"},children:"✓ Ticket Owned"})]}),e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"0.5rem"},children:c.title}),e.jsxs("p",{className:"pk-text-sm pk-text-muted",style:{marginBottom:"1rem"},children:["📍 ",c.location]}),e.jsx("p",{className:"pk-text-body",style:{flex:1},children:c.description}),e.jsx("button",{className:"pk-btn pk-btn-primary",style:{alignSelf:"flex-start",marginTop:"1.5rem"},onClick:()=>{j(c),d("details")},children:"View Details & Tickets"})]})]},c.id)})})]}),P=()=>n?e.jsxs("div",{className:"pk-container animate-fade-in",children:[e.jsx("button",{className:"pk-btn pk-btn-outline",style:{marginBottom:"2rem"},onClick:()=>d("feed"),children:"← Back to Events"}),e.jsxs("div",{style:{position:"relative",height:"400px",borderRadius:"var(--pk-radius-lg)",overflow:"hidden",marginBottom:"3rem"},children:[e.jsx("img",{src:n.image,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}),e.jsxs("div",{style:{position:"absolute",inset:0,background:"linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.8))",display:"flex",flexDirection:"column",justifyContent:"flex-end",padding:"3rem"},children:[e.jsx("h1",{className:"pk-heading-xl",style:{color:"white",marginBottom:"0.5rem"},children:n.title}),e.jsxs("p",{style:{color:"rgba(255,255,255,0.8)",fontSize:"1.25rem"},children:["📍 ",n.location]})]})]}),e.jsxs("div",{className:"pk-grid",style:{gridTemplateColumns:"minmax(300px, 2fr) minmax(300px, 1fr)"},children:[e.jsxs("div",{children:[e.jsx("h2",{className:"pk-heading-lg",style:{marginBottom:"1.5rem"},children:"About this Event"}),e.jsx("p",{className:"pk-text-body",style:{fontSize:"1.125rem",marginBottom:"3rem"},children:n.description}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:"Who's Speaking"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"3rem"},children:n.speakers.map((c,b)=>e.jsxs("div",{className:"pk-card",style:{padding:"1rem"},children:["👤 ",c]},b))}),e.jsx("h3",{className:"pk-heading-md",style:{marginBottom:"1rem"},children:"Agenda"}),e.jsx("div",{style:{borderLeft:"2px solid var(--pk-border)",paddingLeft:"1.5rem",display:"flex",flexDirection:"column",gap:"1rem"},children:n.agenda.map((c,b)=>e.jsxs("div",{style:{position:"relative"},children:[e.jsx("div",{style:{position:"absolute",left:"-1.5rem",top:"5px",transform:"translateX(-50%)",width:"12px",height:"12px",borderRadius:"50%",background:"var(--pk-primary)"}}),e.jsx("p",{className:"pk-text-body",style:{fontWeight:600},children:c})]},b))})]}),e.jsx("div",{children:e.jsxs("div",{className:"pk-card",style:{position:"sticky",top:"20px",padding:"2rem"},children:[e.jsx(C,{targetDate:n.date}),e.jsx("button",{className:"pk-btn pk-btn-primary pk-w-full",style:{padding:"1.25rem",fontSize:"1.125rem"},onClick:()=>N(!0),children:"Get Tickets"}),u.find(c=>c.eventId===n.id)&&e.jsx("p",{className:"pk-text-sm pk-text-center",style:{marginTop:"1rem",color:"var(--pk-success)",fontWeight:"bold"},children:"You have a ticket for this event!"})]})})]}),x&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(5px)"},children:e.jsxs("div",{className:"pk-card animate-fade-in",style:{width:"100%",maxWidth:"600px",padding:"2rem"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"2rem"},children:[e.jsx("h2",{className:"pk-heading-lg",children:"Select Tier"}),e.jsx("button",{className:"pk-btn pk-btn-outline",style:{border:"none"},onClick:()=>N(!1),children:"✕"})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginBottom:"2rem"},children:n.tiers.map(c=>{const b=c.capacity<=0;return e.jsxs("button",{disabled:b,className:(h==null?void 0:h.id)===c.id?"pk-btn pk-btn-primary":"pk-btn pk-btn-outline",style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1.5rem",textAlign:"left",opacity:b?.5:1},onClick:()=>A(c),children:[e.jsxs("div",{children:[e.jsx("h3",{className:"pk-heading-md",style:{color:(h==null?void 0:h.id)===c.id?"white":"var(--pk-text-main)"},children:c.name}),b?e.jsx("span",{style:{color:"var(--pk-danger)",fontWeight:"bold",fontSize:"0.875rem"},children:"SOLD OUT"}):e.jsx("span",{style:{fontSize:"0.875rem",opacity:.8},children:"Available"})]}),e.jsxs("span",{className:"pk-heading-lg",style:{color:(h==null?void 0:h.id)===c.id?"white":"var(--pk-primary)"},children:["$",c.price]})]},c.id)})}),e.jsx("button",{className:"pk-btn pk-btn-primary pk-w-full",style:{padding:"1.25rem"},disabled:!h,onClick:B,children:"Confirm Checkout"})]})})]}):null,C=({targetDate:c})=>{const b=y(c);return e.jsxs("div",{style:{textAlign:"center",marginBottom:"2rem"},children:[e.jsx("p",{className:"pk-text-muted pk-label",style:{marginBottom:"1rem"},children:"Event Starts In"}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:"0.5rem"},children:[e.jsxs("div",{style:{background:"var(--pk-bg-main)",padding:"0.75rem",borderRadius:"var(--pk-radius-md)",flex:1},children:[e.jsx("div",{className:"pk-heading-md",children:b.days}),e.jsx("div",{className:"pk-text-sm",children:"Days"})]}),e.jsxs("div",{style:{background:"var(--pk-bg-main)",padding:"0.75rem",borderRadius:"var(--pk-radius-md)",flex:1},children:[e.jsx("div",{className:"pk-heading-md",children:b.hours}),e.jsx("div",{className:"pk-text-sm",children:"Hrs"})]}),e.jsxs("div",{style:{background:"var(--pk-bg-main)",padding:"0.75rem",borderRadius:"var(--pk-radius-md)",flex:1},children:[e.jsx("div",{className:"pk-heading-md",children:b.minutes}),e.jsx("div",{className:"pk-text-sm",children:"Min"})]}),e.jsxs("div",{style:{background:"var(--pk-bg-main)",padding:"0.75rem",borderRadius:"var(--pk-radius-md)",flex:1},children:[e.jsx("div",{className:"pk-heading-md",children:b.seconds}),e.jsx("div",{className:"pk-text-sm",children:"Sec"})]})]})]})};return e.jsxs("div",{style:{position:"relative",minHeight:"100vh",backgroundColor:"var(--pk-bg-main)"},children:[o&&e.jsxs("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.8)",zIndex:100,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:[e.jsx("div",{className:"pk-skeleton",style:{width:"80px",height:"80px",borderRadius:"50%",marginBottom:"1rem"}}),e.jsx("h3",{className:"pk-heading-md",children:"Processing Reservation..."})]}),m==="feed"&&D(),m==="details"&&P(),e.jsx(M,{})]})}function yt({title:m,subtitle:d,bgImage:n,children:j}){return e.jsxs("div",{className:"pk-card pk-glass",style:{position:"relative",margin:"2rem 0",padding:"4rem 2rem",textAlign:"center",overflow:"hidden",background:n?`linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.6)), url(${n}) center/cover`:"var(--pk-bg-glass)",color:n?"white":"inherit"},children:[e.jsxs("div",{style:{position:"relative",zIndex:10},children:[e.jsx("h1",{className:n?"pk-heading-xl":"pk-heading-xl pk-gradient-text",style:{marginBottom:"1rem"},children:m}),e.jsx("p",{className:"pk-text-body",style:{color:n?"rgba(255,255,255,0.9)":"var(--pk-text-muted)",fontSize:"1.25rem",maxWidth:"600px",margin:"0 auto 2rem"},children:d}),e.jsx("div",{children:j})]}),!n&&e.jsx("div",{style:{position:"absolute",top:"-50%",left:"-10%",width:"500px",height:"500px",background:"radial-gradient(circle, var(--pk-primary-light) 0%, transparent 70%)",opacity:.5,zIndex:0,borderRadius:"50%",pointerEvents:"none"}})]})}V.AnalyticsDashboardModule=lt,V.ChatMessagingModule=rt,V.EcommerceStoreModule=at,V.EventTicketBookingModule=gt,V.FlightBookingModule=nt,V.FoodOrderingModule=dt,V.HospitalAppointmentModule=mt,V.HotelBookingModule=ut,V.InvoiceBillingModule=ot,V.LandingPageModule=ht,V.LibraryManagementModule=xt,V.MovieBookingModule=it,V.QuizExamModule=ct,V.StudentRegistrationModule=pt,V.SystemHero=yt,V.SystemSummaryCard=le,V.Toast=Pe,V.useToast=J,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|