PageSourceSearch

https://empiretherapy.net/assets/index-_GvzuZdo.js

js empiretherapy.net collected 2026-10-07 03:06:23 UTC 6,191 bytes, 11 lines download raw bytes

1import{a as i,j as e}from"./query-YQf5_TCb.js";import{f as b,l as z,u as A,n as f,F as g}from"./index-oGxM1WZq.js";import{B as l}from"./button-BoJFaSM5.js";import{I as S}from"./input-Cjf0cD3M.js";import{B as C}from"./badge-H6Pm4Z-0.js";import{S as I}from"./skeleton-ujht-kmt.js";import{t as c}from"./index-BXi58NoQ.js";import{P as j}from"./plus-Dd8FVPmc.js";import{S as T}from"./search-PxgsHbwY.js";import{C as $}from"./clock-SXLyP5J6.js";import{S as E}from"./square-pen-CqwKgFI1.js";import{T as F}from"./trash-2-DoyAYDm9.js";import"./radix-ui-jHlGqCL3.js";import"./index-BBBx8TSb.js";/**
2 * @license lucide-react v0.454.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const P=b("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
7 * @license lucide-react v0.454.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const D=b("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);function K(a){const s=a.match(/PT(?:(\d+)H)?(?:(\d+)M)?/);if(!s)return"—";const n=parseInt(s[1]??"0",10),r=parseInt(s[2]??"0",10);return n&&r?`${n}h ${r}m`:n?`${n}h`:r?`${r}m`:"None"}function L(a){const s=parseFloat(a);return Number.isFinite(s)?`$${s.toFixed(2)}`:"—"}function Z(){const{token:a}=z(),s=A(),[n,r]=i.useState([]),[v,h]=i.useState(!0),[d,N]=i.useState(""),[y,u]=i.useState(null),m=i.useCallback(async()=>{try{h(!0);const t=await f("/api/appointments/admin/addons",a);if(!t.ok){c.error("Failed to load add-ons");return}const x=await t.json();r(x.addons)}catch(t){c.error("Error loading add-ons"),console.error(t)}finally{h(!1)}},[a]);i.useEffect(()=>{m()},[m]);async function k(t,x){if(confirm(`Are you sure you want to delete add-on "${x}"?`))try{u(t);const o=await f(`/api/appointments/admin/addons/${t}`,a,{method:"DELETE"});if(o.ok)c.success("Add-on deleted successfully"),await m();else{const w=await o.json().catch(()=>({}));c.error(w.message??"Failed to delete add-on")}}catch(o){c.error("Error deleting add-on"),console.error(o)}finally{u(null)}}const p=n.filter(t=>t.title.toLowerCase().includes(d.toLowerCase()));return e.jsxs("div",{className:"container mx-auto max-w-7xl px-4 py-6",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-zinc-900 dark:text-zinc-100",children:"Add-ons"}),e.jsx("p",{className:"mt-1 text-sm text-zinc-500 dark:text-zinc-400",children:"Manage optional paid extras you can attach to services"})]}),e.jsxs(l,{onClick:()=>{s("/admin/addons/new")},className:"gap-2",children:[e.jsx(j,{className:"h-4 w-4"}),"Create Add-on"]})]}),e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"relative",children:[e.jsx(T,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-400"}),e.jsx(S,{type:"text",placeholder:"Search add-ons by name...",value:d,onChange:t=>N(t.target.value),className:"pl-10"})]})}),v?e.jsx("div",{className:"space-y-4",children:["s1","s2","s3"].map(t=>e.jsx(I,{className:"h-28 w-full"},t))}):p.length===0?e.jsxs("div",{className:"rounded-xl border border-zinc-200 bg-white p-12 text-center dark:border-zinc-800 dark:bg-zinc-900",children:[e.jsx(D,{className:"mx-auto mb-4 h-12 w-12 text-zinc-400"}),e.jsx("h3",{className:"mb-2 text-lg font-medium text-zinc-900 dark:text-zinc-100",children:e.jsx(g,{devId:"57e6d3",guard:{file:"src/pages/admin/addons/index.tsx",tagName:"h3",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionHash:"sha256:a2b6206b5b45495ee829d61867ff10b943218c127d2723ad087cbd9847d481bd"},children:d?"No add-ons found":"No add-ons yet"})}),e.jsx("p",{className:"mb-4 text-sm text-zinc-500 dark:text-zinc-400",children:e.jsx(g,{devId:"d43e48",guard:{file:"src/pages/admin/addons/index.tsx",tagName:"p",sourceKind:"bound-expression",contentKey:null,contentKeyTemplate:null,expressionH
11ash:"sha256:cc6e1b8115a622000dceb2ed92936d5439dd706040fa167650bbf3019f178fa2"},children:d?"Try adjusting your search":"Create your first add-on, then assign it to a service"})}),!d&&e.jsxs(l,{onClick:()=>{s("/admin/addons/new")},children:[e.jsx(j,{className:"mr-2 h-4 w-4"}),"Create Add-on"]})]}):e.jsx("div",{className:"space-y-4",children:p.map(t=>e.jsx("div",{className:"rounded-xl border border-zinc-200 bg-white p-6 transition-shadow hover:shadow-md dark:border-zinc-800 dark:bg-zinc-900",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-3",children:[e.jsx("h3",{className:"truncate text-xl font-bold text-zinc-900 dark:text-zinc-100",children:t.title}),e.jsx(C,{variant:t.active?"default":"secondary",className:t.active?"bg-green-100 text-green-700 dark:bg-green-950 dark:text-green-400":"",children:t.active?"Active":"Inactive"})]}),t.description&&e.jsx("p",{className:"mb-3 line-clamp-2 text-sm text-zinc-500 dark:text-zinc-400",children:t.description}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-zinc-700 dark:text-zinc-300",children:[e.jsx(P,{className:"h-4 w-4 text-zinc-400"}),L(t.price)]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-zinc-700 dark:text-zinc-300",children:[e.jsx($,{className:"h-4 w-4 text-zinc-400"}),K(t.duration)]})]})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsx(l,{variant:"ghost",size:"icon",onClick:()=>{s(`/admin/addons/${t.id}`)},children:e.jsx(E,{className:"h-4 w-4"})}),e.jsx(l,{variant:"ghost",size:"icon",onClick:()=>{k(t.id,t.title)},disabled:y===t.id,children:e.jsx(F,{className:"h-4 w-4 text-red-600"})})]})]})},t.id))})]})}export{Z as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.