@vikukumar/propvault 0.1.5 → 0.1.6
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/(website)/[...slug]/page/server-reference-manifest.json +4 -4
- package/.next/server/app/(website)/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(website)/blog/[slug]/page/server-reference-manifest.json +1 -1
- package/.next/server/app/(website)/blog/[slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(website)/contact/page/server-reference-manifest.json +1 -1
- package/.next/server/app/(website)/contact/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(website)/page/server-reference-manifest.json +5 -5
- package/.next/server/app/(website)/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(website)/projects/[slug]/page/server-reference-manifest.json +1 -1
- package/.next/server/app/(website)/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/admin/cms/email-templates/page/server-reference-manifest.json +2 -2
- package/.next/server/app/admin/cms/email-templates/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/cms/menus/page/server-reference-manifest.json +3 -3
- package/.next/server/app/admin/cms/menus/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/cms/pages/[id]/edit/page/server-reference-manifest.json +6 -6
- package/.next/server/app/admin/cms/pages/[id]/edit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/cms/pages/new/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/cms/pages/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/cms/pages/page/server-reference-manifest.json +2 -2
- package/.next/server/app/admin/cms/pages/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/cms/redirects/page/server-reference-manifest.json +3 -3
- package/.next/server/app/admin/cms/redirects/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/leads/[id]/page/server-reference-manifest.json +2 -2
- package/.next/server/app/admin/leads/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/page/server-reference-manifest.json +3 -3
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/plugins/page/server-reference-manifest.json +5 -5
- package/.next/server/app/admin/plugins/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/profile/page/server-reference-manifest.json +2 -2
- package/.next/server/app/admin/profile/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/projects/edit/[id]/page/server-reference-manifest.json +2 -2
- package/.next/server/app/admin/projects/edit/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/projects/new/page/server-reference-manifest.json +2 -2
- package/.next/server/app/admin/projects/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/analytics/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/settings/analytics/page.js.nft.json +1 -1
- package/.next/server/app/admin/settings/analytics/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/api-keys/page/server-reference-manifest.json +102 -102
- package/.next/server/app/admin/settings/api-keys/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/branding/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/settings/branding/page.js.nft.json +1 -1
- package/.next/server/app/admin/settings/branding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/general/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/settings/general/page.js.nft.json +1 -1
- package/.next/server/app/admin/settings/general/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/security/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/settings/security/page.js.nft.json +1 -1
- package/.next/server/app/admin/settings/security/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/seo/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/settings/seo/page.js.nft.json +1 -1
- package/.next/server/app/admin/settings/seo/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/smtp/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/settings/smtp/page.js.nft.json +1 -1
- package/.next/server/app/admin/settings/smtp/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/settings/storage/page/server-reference-manifest.json +1 -1
- package/.next/server/app/admin/settings/storage/page.js.nft.json +1 -1
- package/.next/server/app/admin/settings/storage/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/theme/page/server-reference-manifest.json +5 -5
- package/.next/server/app/admin/theme/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/upload/route.js.nft.json +1 -1
- package/.next/server/app/contact.html +2 -2
- package/.next/server/app/contact.rsc +2 -2
- package/.next/server/app/contact.segments/!KHdlYnNpdGUp/contact/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/contact.segments/!KHdlYnNpdGUp/contact.segment.rsc +1 -1
- package/.next/server/app/contact.segments/!KHdlYnNpdGUp.segment.rsc +1 -1
- package/.next/server/app/contact.segments/_full.segment.rsc +2 -2
- package/.next/server/app/contact.segments/_head.segment.rsc +1 -1
- package/.next/server/app/contact.segments/_index.segment.rsc +1 -1
- package/.next/server/app/contact.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +11 -11
- package/.next/server/app/index.segments/!KHdlYnNpdGUp/__PAGE__.segment.rsc +11 -11
- package/.next/server/app/index.segments/!KHdlYnNpdGUp.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +11 -11
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +1 -1
- package/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/setup/page/server-reference-manifest.json +15 -15
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup.html +2 -2
- package/.next/server/app/setup.rsc +2 -2
- package/.next/server/app/setup.segments/_full.segment.rsc +2 -2
- package/.next/server/app/setup.segments/_head.segment.rsc +1 -1
- package/.next/server/app/setup.segments/_index.segment.rsc +1 -1
- package/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/setup.segments/setup.segment.rsc +1 -1
- package/.next/server/app/sitemap.xml.body +9 -9
- package/.next/server/chunks/[root-of-the-server]__0ikpexd._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__03m3xqu._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__05px_h7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__08s00s8._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0_x-0vh._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0ae1ufj._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0b0jtbx._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0d95wm4._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0d_wuy_._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0frxadd._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0owpb-h._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1--m0t_._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__11c23n7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__12yzdf7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1_5z9ae._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1ijsxgu._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1mh1dn4._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1nrl0j-._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1qronyg._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1rjv73_._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1ybv0-1._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__203pgu_._.js +1 -1
- package/.next/server/chunks/ssr/_01ovwyq._.js +1 -1
- package/.next/server/chunks/ssr/_05jzsu5._.js +1 -1
- package/.next/server/chunks/ssr/_06ljqk-._.js +1 -1
- package/.next/server/chunks/ssr/_06rh1hs._.js +1 -1
- package/.next/server/chunks/ssr/_08mru_6._.js +1 -1
- package/.next/server/chunks/ssr/_09o1npz._.js +1 -1
- package/.next/server/chunks/ssr/{_1zm01h0._.js → _0d9dhlq._.js} +2 -2
- package/.next/server/chunks/ssr/_0h33iks._.js +1 -1
- package/.next/server/chunks/ssr/_0ju3jec._.js +1 -1
- package/.next/server/chunks/ssr/_0kdtd1g._.js +1 -1
- package/.next/server/chunks/ssr/_0m0s15u._.js +1 -1
- package/.next/server/chunks/ssr/_0qdyrxm._.js +1 -1
- package/.next/server/chunks/ssr/_0untlx2._.js +1 -1
- package/.next/server/chunks/ssr/{_1hb_oxg._.js → _0v1z0z-._.js} +2 -2
- package/.next/server/chunks/ssr/_0vu77cg._.js +1 -1
- package/.next/server/chunks/ssr/_0xki9b-._.js +1 -1
- package/.next/server/chunks/ssr/_1-wcqf6._.js +1 -1
- package/.next/server/chunks/ssr/_10imd--._.js +1 -1
- package/.next/server/chunks/ssr/_122ck8v._.js +1 -1
- package/.next/server/chunks/ssr/_17z_x3y._.js +1 -1
- package/.next/server/chunks/ssr/_18r74av._.js +1 -1
- package/.next/server/chunks/ssr/_1agt3s0._.js +1 -1
- package/.next/server/chunks/ssr/_1ijzz5f._.js +1 -1
- package/.next/server/chunks/ssr/_1l22w_w._.js +1 -1
- package/.next/server/chunks/ssr/_1lhtejs._.js +1 -1
- package/.next/server/chunks/ssr/_1pulrwl._.js +1 -1
- package/.next/server/chunks/ssr/_1pvmkr2._.js +1 -1
- package/.next/server/chunks/ssr/_1sseqap._.js +1 -1
- package/.next/server/chunks/ssr/_212t7ar._.js +1 -1
- package/.next/server/chunks/ssr/src_actions_cms_ts_0_rm7-x._.js +1 -1
- package/.next/server/chunks/ssr/src_app_admin_cms_pages_[id]_edit_page-editor-client_tsx_0hbosvr._.js +1 -1
- package/.next/server/chunks/ssr/src_components_admin_branding_icon-generator_tsx_0-p-crb._.js +1 -1
- package/.next/server/chunks/ssr/src_components_admin_projects_project-form_tsx_0ynt29x._.js +1 -1
- package/.next/server/chunks/ssr/src_components_admin_theme_theme-editor_tsx_0ec47ja._.js +1 -1
- package/.next/server/chunks/ssr/src_components_setup_setup-wizard_tsx_17wfyof._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +120 -120
- package/.next/static/chunks/{2d9me2ckcnr7h.js → 04j81u4sdpfu2.js} +1 -1
- package/.next/static/chunks/{0zqog_yngqq7z.js → 0ah0kpd7ekuw1.js} +1 -1
- package/.next/static/chunks/{1q0w9ewl3z_h6.js → 0auy0r9a1q2tn.js} +1 -1
- package/.next/static/chunks/{1tbfriywhx1pb.js → 0ggovh07wwyy8.js} +1 -1
- package/.next/static/chunks/{38rdy0o7-0ox6.js → 0lis8frknimvp.js} +1 -1
- package/.next/static/chunks/{263r2j2npbofi.js → 0nsus-669a8ey.js} +1 -1
- package/.next/static/chunks/{3me6cr4hl9rom.js → 0rf2sac4cv9to.js} +1 -1
- package/.next/static/chunks/{36-tbikyofe31.js → 0xpdqt-hymrf7.js} +1 -1
- package/.next/static/chunks/{1ck9hpq1413sl.js → 1bowvtenaqsj6.js} +1 -1
- package/.next/static/chunks/{3f49air8y0adp.js → 1cjpbb6-vptf4.js} +4 -4
- package/.next/static/chunks/{20lykhw4m0xj7.js → 1hk1y1sg8lhbw.js} +1 -1
- package/.next/static/chunks/{32ewdom11wcw5.js → 1nrpg3ex2_sv_.js} +1 -1
- package/.next/static/chunks/{2kw34i4gw2ajr.js → 1sf7ew5fumaxp.js} +3 -3
- package/.next/static/chunks/{2xln3s9fcx9bl.js → 1u3legaue49ub.js} +1 -1
- package/.next/static/chunks/{2fyzgog8nf5lt.js → 1wy2lokd1l1lp.js} +1 -1
- package/.next/static/chunks/{0y4lkzby6pn69.js → 2-v2c7pmrytbo.js} +1 -1
- package/.next/static/chunks/{11pcx9jz6m8mh.js → 24pptltdm6on5.js} +1 -1
- package/.next/static/chunks/{0pwgm534jn6iw.js → 262zw0y5-stbe.js} +1 -1
- package/.next/static/chunks/{1pwy0ti-uue8r.js → 2hdi4miihh5xo.js} +1 -1
- package/.next/static/chunks/{1902bgggagxq9.js → 2mkfi4f-v_--2.js} +2 -2
- package/.next/static/chunks/{1hame1c35m1cl.js → 2uc63cmx05kds.js} +1 -1
- package/.next/static/chunks/{30qbmzgby_p2-.js → 2y63g12thk4t0.js} +1 -1
- package/.next/static/chunks/{3ibw_8tcpt3lm.js → 2zqss-359c2pk.js} +1 -1
- package/.next/static/chunks/{3ussphcvkyzyx.js → 3i5hcquiom8c0.js} +1 -1
- package/.next/static/chunks/{3kghfbcpnl0zl.js → 3xtvxy_mnp_8w.js} +1 -1
- package/.next/static/chunks/{3en21d5viwrkl.js → 41e2p0bvp89ut.js} +1 -1
- package/README.md +6 -6
- package/package.json +5 -5
- /package/.next/static/{81gZJnh1KWfMhrvOF9la3 → Q2_R7URofsFGUQNefVZtd}/_buildManifest.js +0 -0
- /package/.next/static/{81gZJnh1KWfMhrvOF9la3 → Q2_R7URofsFGUQNefVZtd}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{81gZJnh1KWfMhrvOF9la3 → Q2_R7URofsFGUQNefVZtd}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9306,e=>{"use strict";let r=(0,e.i(456420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",0,r])},573474,e=>{"use strict";var r=e.i(9306);e.s(["Trash2",()=>r.default])},77834,e=>{"use strict";let r=(0,e.i(456420).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["default",0,r])},725981,e=>{"use strict";var r=e.i(77834);e.s(["Upload",()=>r.default])},793479,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(975157);let a=t.forwardRef(({className:e,type:t,...a},i)=>(0,r.jsx)("input",{type:t,className:(0,s.cn)("flex h-10 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:i,...a}));a.displayName="Input",e.s(["Input",0,a])},519455,225913,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(991918),a=e.i(207670);let i=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,o=a.clsx,n=(e,r)=>t=>{var s;if((null==r?void 0:r.variants)==null)return o(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:a,defaultVariants:n}=r,l=Object.keys(a).map(e=>{let r=null==t?void 0:t[e],s=null==n?void 0:n[e];if(null===r)return null;let o=i(r)||i(s);return a[e][o]}),d=t&&Object.entries(t).reduce((e,r)=>{let[t,s]=r;return void 0===s||(e[t]=s),e},{});return o(e,l,null==r||null==(s=r.compoundVariants)?void 0:s.reduce((e,r)=>{let{class:t,className:s,...a}=r;return Object.entries(a).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...n,...d}[r]):({...n,...d})[r]===t})?[...e,t,s]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)};e.s(["cva",0,n],225913);var l=e.i(975157);let d=n("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent hover:bg-secondary/50 hover:text-foreground text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-secondary/50 hover:text-foreground text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",gold:"bg-gradient-to-r from-[hsl(36,82%,47%)] to-[hsl(42,88%,65%)] text-[hsl(240,20%,7%)] font-semibold hover:opacity-90 active:scale-[0.98] shadow-[0_4px_14px_0_hsl(36,82%,47%,0.4)]","gold-outline":"border border-[hsl(36,82%,47%,0.5)] text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)] hover:border-[hsl(36,82%,47%)]","gold-ghost":"text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)]"},size:{default:"h-10 px-5 py-2",xs:"h-7 px-3 text-xs rounded-lg",sm:"h-9 px-4 text-sm",lg:"h-12 px-8 text-base",xl:"h-14 px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),c=t.forwardRef(({className:e,variant:t,size:a,asChild:i=!1,...o},n)=>{let c=i?s.Slot:"button";return(0,r.jsx)(c,{className:(0,l.cn)(d({variant:t,size:a,className:e})),ref:n,...o})});c.displayName="Button",e.s(["Button",0,c],519455)},632781,758379,e=>{"use strict";let r=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,r],758379),e.s(["Loader2",0,r],632781)},95187,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={callServer:function(){return i.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let i=e.r(132120),o=e.r(92245),n=e.r(235326)},110204,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(248425),a=t.forwardRef((e,t)=>(0,r.jsx)(s.Primitive.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));a.displayName="Label";var i=e.i(975157);let o=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)(a,{ref:s,className:(0,i.cn)("text-sm font-medium text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));o.displayName=a.displayName,e.s(["Label",0,o],110204)},624687,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(975157);let a=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-colors",e),ref:a,...t}));a.displayName="Textarea",e.s(["Textarea",0,a])},85291,e=>{"use strict";var r=e.i(681307);r.z.string().uuid();let t=r.z.string().min(1).max(255).regex(/^[a-z0-9-]+$/,"Slug can only contain lowercase letters, numbers, and hyphens");r.z.object({page:r.z.coerce.number().int().positive().default(1),per_page:r.z.coerce.number().int().positive().max(100).default(12),sort_by:r.z.string().optional(),sort_dir:r.z.enum(["asc","desc"]).default("desc"),q:r.z.string().optional()}),r.z.object({email:r.z.string().email("Invalid email address"),password:r.z.string().min(8,"Password must be at least 8 characters"),remember_me:r.z.boolean().optional().default(!1)}),r.z.object({name:r.z.string().min(2,"Name must be at least 2 characters").max(100),email:r.z.string().email("Invalid email address"),password:r.z.string().min(8,"Password must be at least 8 characters").max(100).regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[0-9]/,"Password must contain at least one number"),confirm_password:r.z.string(),phone:r.z.string().regex(/^\+?[1-9]\d{9,14}$/,"Invalid phone number").optional()}).refine(e=>e.password===e.confirm_password,{message:"Passwords do not match",path:["confirm_password"]}),r.z.object({email:r.z.string().email("Invalid email address")}),r.z.object({token:r.z.string().min(1),password:r.z.string().min(8,"Password must be at least 8 characters").max(100),confirm_password:r.z.string()}).refine(e=>e.password===e.confirm_password,{message:"Passwords do not match",path:["confirm_password"]});let s=r.z.object({name:r.z.string().min(2,"Name is required").max(100),email:r.z.string().email("Invalid email address").optional().or(r.z.literal("")),phone:r.z.string().min(10,"Valid phone number is required").regex(/^\+?[0-9\s-]{10,15}$/,"Invalid phone number"),message:r.z.string().max(1e3).optional(),project_id:r.z.string().optional(),source:r.z.string().optional().default("website"),budget_min:r.z.coerce.number().optional(),budget_max:r.z.coerce.number().optional(),property_type:r.z.string().optional(),utm_source:r.z.string().optional(),utm_medium:r.z.string().optional(),utm_campaign:r.z.string().optional()}),a=r.z.object({name:r.z.string().min(2,"Name is required").max(100),email:r.z.string().email("Invalid email address"),phone:r.z.string().regex(/^\+?[0-9\s-]{10,15}$/,"Invalid phone number").optional().or(r.z.literal("")),subject:r.z.string().min(3,"Subject is required").max(200),message:r.z.string().min(10,"Message must be at least 10 characters").max(2e3)});r.z.object({email:r.z.string().email("Invalid email address"),name:r.z.string().max(100).optional()});let i=r.z.object({name:r.z.string().min(2).max(255),slug:t.optional(),tagline:r.z.string().max(500).optional(),description:r.z.string().min(20,"Description must be at least 20 characters"),short_description:r.z.string().max(500).optional(),status:r.z.enum(["upcoming","ongoing","completed","on_hold"]),category:r.z.enum(["luxury","residential","commercial","rental","villa","plot"]),possession_status:r.z.enum(["ready_to_move","under_construction","nearing_possession"]),is_featured:r.z.boolean().default(!1),is_luxury:r.z.boolean().default(!1),is_new_launch:r.z.boolean().default(!1),is_rera_registered:r.z.boolean().default(!1),publish_status:r.z.enum(["draft","published","archived"]).default("draft"),price_min:r.z.coerce.number().positive("Price must be positive"),price_max:r.z.coerce.number().positive("Price must be positive"),price_per_sqft:r.z.coerce.number().optional(),currency:r.z.string().default("INR"),address:r.z.string().min(5,"Address is required"),landmark:r.z.string().optional(),location_id:r.z.string().optional(),city_id:r.z.string().min(1,"City is required"),state_id:r.z.string().min(1,"State is required"),country_id:r.z.string().optional().default("IN"),pincode:r.z.string().optional(),latitude:r.z.coerce.number().optional(),longitude:r.z.coerce.number().optional(),google_maps_url:r.z.string().url().optional().or(r.z.literal("")),total_units:r.z.coerce.number().int().optional(),total_floors:r.z.coerce.number().int().optional(),total_towers:r.z.coerce.number().int().optional(),total_area_acres:r.z.coerce.number().optional(),open_space_percent:r.z.coerce.number().min(0).max(100).optional(),possession_date:r.z.string().optional(),launch_date:r.z.string().optional(),builder_id:r.z.string().min(1,"Builder is required"),property_type_id:r.z.string().optional(),cover_image:r.z.string().optional(),brochure_url:r.z.string().optional(),video_url:r.z.string().optional(),virtual_tour_url:r.z.string().url().optional().or(r.z.literal("")),rera_number:r.z.string().optional(),rera_expiry_date:r.z.string().optional(),inquiry_email:r.z.string().email().optional().or(r.z.literal("")),inquiry_phone:r.z.string().optional(),whatsapp_number:r.z.string().optional(),meta_title:r.z.string().max(60).optional(),meta_description:r.z.string().max(160).optional(),og_image:r.z.string().optional()});r.z.object({title:r.z.string().min(5).max(255),slug:t.optional(),subtitle:r.z.string().max(500).optional(),content:r.z.string().min(100,"Content must be at least 100 characters"),excerpt:r.z.string().max(500).optional(),cover_image:r.z.string().optional(),category:r.z.string().min(1,"Category is required"),tags:r.z.string().optional(),publish_status:r.z.enum(["draft","published","archived"]).default("draft"),published_at:r.z.string().optional(),is_featured:r.z.boolean().default(!1),meta_title:r.z.string().max(60).optional(),meta_description:r.z.string().max(160).optional()}),r.z.object({status:r.z.enum(["new","contacted","qualified","site_visit","negotiating","closed_won","closed_lost","junk"]).optional(),assigned_to:r.z.string().optional(),next_follow_up:r.z.string().optional(),is_qualified:r.z.boolean().optional(),is_site_visit_done:r.z.boolean().optional()}),r.z.object({content:r.z.string().min(1,"Note content is required").max(5e3),type:r.z.enum(["note","call","email","whatsapp","site_visit","meeting"]).default("note"),is_private:r.z.boolean().default(!1)}),r.z.record(r.z.string(),r.z.string()),r.z.object({name:r.z.string().min(2).max(100),email:r.z.string().email(),phone:r.z.string().optional(),is_active:r.z.boolean().default(!0),role_ids:r.z.array(r.z.string()).optional()}),r.z.object({name:r.z.string().min(2).max(255),slug:t.optional(),logo:r.z.string().optional(),description:r.z.string().optional(),short_description:r.z.string().max(500).optional(),founded_year:r.z.coerce.number().int().min(1900).max(2030).optional(),website:r.z.string().url().optional().or(r.z.literal("")),email:r.z.string().email().optional().or(r.z.literal("")),phone:r.z.string().optional(),address:r.z.string().optional(),city_id:r.z.string().optional(),state_id:r.z.string().optional(),is_featured:r.z.boolean().default(!1),is_verified:r.z.boolean().default(!1),is_active:r.z.boolean().default(!0),meta_title:r.z.string().max(60).optional(),meta_description:r.z.string().max(160).optional()}),r.z.object({author_name:r.z.string().min(2).max(100),author_designation:r.z.string().optional(),author_company:r.z.string().optional(),author_avatar:r.z.string().optional(),content:r.z.string().min(10).max(2e3),rating:r.z.coerce.number().int().min(1).max(5),project_id:r.z.string().optional(),city:r.z.string().optional(),is_featured:r.z.boolean().default(!1),is_active:r.z.boolean().default(!0),video_url:r.z.string().optional()}),r.z.object({question:r.z.string().min(5).max(500),answer:r.z.string().min(10).max(5e3),category:r.z.string().default("general"),sort_order:r.z.coerce.number().int().default(0),is_active:r.z.boolean().default(!0),project_id:r.z.string().optional()}),e.s(["contactSchema",0,a,"enquirySchema",0,s,"projectSchema",0,i])},188873,e=>{"use strict";let r=(0,e.i(456420).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["default",0,r])},503290,e=>{"use strict";let r=(0,e.i(456420).default)("indian-rupee",[["path",{d:"M6 3h12",key:"ggurg9"}],["path",{d:"M6 8h12",key:"6g4wlu"}],["path",{d:"m6 13 8.5 8",key:"u1kupk"}],["path",{d:"M6 13h3",key:"wdp6ag"}],["path",{d:"M9 13c6.667 0 6.667-10 0-10",key:"1nkvk2"}]]);e.s(["default",0,r])},142687,e=>{"use strict";var r=e.i(843476),t=e.i(618566),s=e.i(271645),a=e.i(653145),i=e.i(994814),o=e.i(632781),n=e.i(725981),l=e.i(573474),d=e.i(188873),d=d,c=e.i(146387),u=e.i(503290),u=u,m=e.i(846696),p=e.i(519455),g=e.i(793479),x=e.i(110204),h=e.i(624687),b=e.i(85291),f=e.i(95187);let v=(0,f.createServerReference)("4048bdacd6cb6db19e90db9cde971fffbf7a54b455",f.callServer,void 0,f.findSourceMapURL,"createProject"),_=(0,f.createServerReference)("6030a31c304a035ed675b9e21ea205fb50690737f1",f.callServer,void 0,f.findSourceMapURL,"updateProject");e.s(["ProjectForm",0,function({initialData:e,builders:f,cities:j,states:z,countries:y}){let N=(0,t.useRouter)(),[w,S]=(0,s.useState)(!1),[k,P]=(0,s.useState)(!1),[L,R]=(0,s.useState)(e?.cover_image??null),{register:M,handleSubmit:I,setValue:F,formState:{errors:q}}=(0,a.useForm)({resolver:(0,i.zodResolver)(b.projectSchema),defaultValues:e?{...e,price_min:Number(e.price_min),price_max:Number(e.price_max),price_per_sqft:e.price_per_sqft?Number(e.price_per_sqft):void 0,latitude:e.latitude?Number(e.latitude):void 0,longitude:e.longitude?Number(e.longitude):void 0,total_units:e.total_units?Number(e.total_units):void 0,total_floors:e.total_floors?Number(e.total_floors):void 0,total_towers:e.total_towers?Number(e.total_towers):void 0,total_area_acres:e.total_area_acres?Number(e.total_area_acres):void 0,open_space_percent:e.open_space_percent?Number(e.open_space_percent):void 0,is_featured:"1"===String(e.is_featured)||!0===e.is_featured,is_luxury:"1"===String(e.is_luxury)||!0===e.is_luxury,is_new_launch:"1"===String(e.is_new_launch)||!0===e.is_new_launch,is_rera_registered:"1"===String(e.is_rera_registered)||!0===e.is_rera_registered}:{status:"upcoming",category:"residential",possession_status:"under_construction",is_featured:!1,is_luxury:!1,is_new_launch:!1,is_rera_registered:!1,publish_status:"draft",currency:"INR",country_id:y[0]?.id??"IN"}}),C=async e=>{let r=e.target.files?.[0];if(!r)return;P(!0);let t=new FormData;t.append("file",r);try{let e=await fetch("/api/upload",{method:"POST",body:t}),r=await e.json();r.url?(R(r.url),F("cover_image",r.url),m.toast.success("Image uploaded successfully!")):m.toast.error(r.error??"Failed to upload image")}catch{m.toast.error("Upload failed")}finally{P(!1)}},B=async r=>{S(!0);try{if(e){let t=await _(e.id,r);t.success?(m.toast.success("Project updated successfully!"),N.push("/admin/projects"),N.refresh()):m.toast.error(t.error??"Failed to update project")}else{let e=await v(r);e.success?(m.toast.success("Project created successfully!"),N.push("/admin/projects"),N.refresh()):m.toast.error(e.error??"Failed to create project")}}catch{m.toast.error("An error occurred. Please try again.")}finally{S(!1)}};return(0,r.jsxs)("form",{onSubmit:I(B),className:"space-y-8 max-w-5xl",children:[(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl",children:[(0,r.jsx)("h3",{className:"text-base font-semibold text-foreground mb-4",children:"Cover Image"}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row items-center gap-6",children:[(0,r.jsx)("div",{className:"relative w-full md:w-64 h-36 bg-secondary/30 rounded-xl overflow-hidden border border-border flex items-center justify-center",children:L?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:L,alt:"Cover Preview",className:"w-full h-full object-cover"}),(0,r.jsx)("button",{type:"button",onClick:()=>{R(null),F("cover_image","")},className:"absolute top-2 right-2 p-1.5 bg-background/80 hover:bg-background text-destructive rounded-lg border border-border transition-colors",children:(0,r.jsx)(l.Trash2,{className:"w-4 h-4"})})]}):(0,r.jsx)(c.Building2,{className:"w-10 h-10 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex-1 w-full text-center md:text-left",children:[(0,r.jsxs)(x.Label,{htmlFor:"cover-file-upload",className:"w-fit cursor-pointer",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 px-4 py-2 border border-border hover:bg-secondary/50 rounded-xl transition-colors font-medium text-sm text-foreground",children:[(0,r.jsx)(n.Upload,{className:"w-4 h-4"}),k?"Uploading...":"Upload Cover Image"]}),(0,r.jsx)("input",{id:"cover-file-upload",type:"file",accept:"image/*",className:"hidden",onChange:C,disabled:k})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: WebP or JPG, 16:9 ratio, under 2MB."})]})]})]}),(0,r.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl space-y-4",children:[(0,r.jsxs)("h3",{className:"text-base font-semibold text-foreground mb-4 flex items-center gap-2",children:[(0,r.jsx)(d.default,{className:"w-4 h-4 text-primary"})," Basic Information"]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-name",children:"Project Name *"}),(0,r.jsx)(g.Input,{id:"proj-name",...M("name"),placeholder:"e.g. PropVault Premium Heights"}),q.name&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.name.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-tagline",children:"Tagline"}),(0,r.jsx)(g.Input,{id:"proj-tagline",...M("tagline"),placeholder:"e.g. Ultra-Luxury Living in South Mumbai"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Builder *"}),(0,r.jsxs)("select",{...M("builder_id"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"",children:"Select Builder"}),f.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),q.builder_id&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.builder_id.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Category *"}),(0,r.jsxs)("select",{...M("category"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"luxury",children:"Luxury"}),(0,r.jsx)("option",{value:"residential",children:"Residential"}),(0,r.jsx)("option",{value:"commercial",children:"Commercial"}),(0,r.jsx)("option",{value:"rental",children:"Rental"}),(0,r.jsx)("option",{value:"villa",children:"Villa"}),(0,r.jsx)("option",{value:"plot",children:"Plot"})]})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-desc",children:"Detailed Description *"}),(0,r.jsx)(h.Textarea,{id:"proj-desc",...M("description"),placeholder:"Provide a comprehensive description of features, materials, amenities, etc.",className:"min-h-[120px]"}),q.description&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.description.message})]})]}),(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl space-y-4",children:[(0,r.jsxs)("h3",{className:"text-base font-semibold text-foreground mb-4 flex items-center gap-2",children:[(0,r.jsx)(u.default,{className:"w-4 h-4 text-primary"})," Pricing & Location"]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"price-min",children:"Min Price (₹) *"}),(0,r.jsx)(g.Input,{id:"price-min",type:"number",...M("price_min"),placeholder:"e.g. 15000000"}),q.price_min&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.price_min.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"price-max",children:"Max Price (₹) *"}),(0,r.jsx)(g.Input,{id:"price-max",type:"number",...M("price_max"),placeholder:"e.g. 45000000"}),q.price_max&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.price_max.message})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"City *"}),(0,r.jsxs)("select",{...M("city_id"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"",children:"Select City"}),j.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),q.city_id&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.city_id.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"State *"}),(0,r.jsxs)("select",{...M("state_id"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"",children:"Select State"}),z.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),q.state_id&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.state_id.message})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-address",children:"Address *"}),(0,r.jsx)(g.Input,{id:"proj-address",...M("address"),placeholder:"e.g. Sector 15, BKC, Bandra East"}),q.address&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.address.message})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Status"}),(0,r.jsxs)("select",{...M("status"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"upcoming",children:"Upcoming"}),(0,r.jsx)("option",{value:"ongoing",children:"Ongoing"}),(0,r.jsx)("option",{value:"completed",children:"Completed"}),(0,r.jsx)("option",{value:"on_hold",children:"On Hold"})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Possession Status"}),(0,r.jsxs)("select",{...M("possession_status"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"ready_to_move",children:"Ready to Move"}),(0,r.jsx)("option",{value:"under_construction",children:"Under Construction"}),(0,r.jsx)("option",{value:"nearing_possession",children:"Nearing Possession"})]})]})]})]})]}),(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl space-y-4",children:[(0,r.jsxs)("h3",{className:"text-base font-semibold text-foreground mb-4 flex items-center gap-2",children:[(0,r.jsx)(c.Building2,{className:"w-4 h-4 text-primary"})," Specifications & Certifications"]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-featured",...M("is_featured"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-featured",className:"cursor-pointer select-none",children:"Featured Listing"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-luxury",...M("is_luxury"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-luxury",className:"cursor-pointer select-none",children:"Luxury Tag"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-launch",...M("is_new_launch"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-launch",className:"cursor-pointer select-none",children:"New Launch"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-rera",...M("is_rera_registered"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-rera",className:"cursor-pointer select-none",children:"RERA Registered"})]})]}),(0,r.jsxs)("div",{className:"grid md:grid-cols-3 gap-6 pt-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"rera-num",children:"RERA Number"}),(0,r.jsx)(g.Input,{id:"rera-num",...M("rera_number"),placeholder:"e.g. P51800012345"})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"brochure-url",children:"Brochure URL"}),(0,r.jsx)(g.Input,{id:"brochure-url",...M("brochure_url"),placeholder:"PDF download link"})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"video-url",children:"Video / YouTube URL"}),(0,r.jsx)(g.Input,{id:"video-url",...M("video_url"),placeholder:"e.g. YouTube promo video link"})]})]})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-4",children:[(0,r.jsx)(p.Button,{type:"button",variant:"outline",onClick:()=>N.push("/admin/projects"),children:"Cancel"}),(0,r.jsx)(p.Button,{type:"submit",variant:"gold",disabled:w,children:w?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):"Save Project"})]})]})}],142687)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9306,e=>{"use strict";let r=(0,e.i(456420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",0,r])},573474,e=>{"use strict";var r=e.i(9306);e.s(["Trash2",()=>r.default])},77834,e=>{"use strict";let r=(0,e.i(456420).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["default",0,r])},725981,e=>{"use strict";var r=e.i(77834);e.s(["Upload",()=>r.default])},793479,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(975157);let a=t.forwardRef(({className:e,type:t,...a},i)=>(0,r.jsx)("input",{type:t,className:(0,s.cn)("flex h-10 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:i,...a}));a.displayName="Input",e.s(["Input",0,a])},519455,225913,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(991918),a=e.i(207670);let i=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,o=a.clsx,n=(e,r)=>t=>{var s;if((null==r?void 0:r.variants)==null)return o(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:a,defaultVariants:n}=r,l=Object.keys(a).map(e=>{let r=null==t?void 0:t[e],s=null==n?void 0:n[e];if(null===r)return null;let o=i(r)||i(s);return a[e][o]}),d=t&&Object.entries(t).reduce((e,r)=>{let[t,s]=r;return void 0===s||(e[t]=s),e},{});return o(e,l,null==r||null==(s=r.compoundVariants)?void 0:s.reduce((e,r)=>{let{class:t,className:s,...a}=r;return Object.entries(a).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...n,...d}[r]):({...n,...d})[r]===t})?[...e,t,s]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)};e.s(["cva",0,n],225913);var l=e.i(975157);let d=n("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent hover:bg-secondary/50 hover:text-foreground text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-secondary/50 hover:text-foreground text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",gold:"bg-gradient-to-r from-[hsl(36,82%,47%)] to-[hsl(42,88%,65%)] text-[hsl(240,20%,7%)] font-semibold hover:opacity-90 active:scale-[0.98] shadow-[0_4px_14px_0_hsl(36,82%,47%,0.4)]","gold-outline":"border border-[hsl(36,82%,47%,0.5)] text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)] hover:border-[hsl(36,82%,47%)]","gold-ghost":"text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)]"},size:{default:"h-10 px-5 py-2",xs:"h-7 px-3 text-xs rounded-lg",sm:"h-9 px-4 text-sm",lg:"h-12 px-8 text-base",xl:"h-14 px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),c=t.forwardRef(({className:e,variant:t,size:a,asChild:i=!1,...o},n)=>{let c=i?s.Slot:"button";return(0,r.jsx)(c,{className:(0,l.cn)(d({variant:t,size:a,className:e})),ref:n,...o})});c.displayName="Button",e.s(["Button",0,c],519455)},632781,758379,e=>{"use strict";let r=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,r],758379),e.s(["Loader2",0,r],632781)},95187,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={callServer:function(){return i.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let i=e.r(132120),o=e.r(92245),n=e.r(235326)},110204,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(248425),a=t.forwardRef((e,t)=>(0,r.jsx)(s.Primitive.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));a.displayName="Label";var i=e.i(975157);let o=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)(a,{ref:s,className:(0,i.cn)("text-sm font-medium text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));o.displayName=a.displayName,e.s(["Label",0,o],110204)},624687,e=>{"use strict";var r=e.i(843476),t=e.i(271645),s=e.i(975157);let a=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-colors",e),ref:a,...t}));a.displayName="Textarea",e.s(["Textarea",0,a])},85291,e=>{"use strict";var r=e.i(681307);r.z.string().uuid();let t=r.z.string().min(1).max(255).regex(/^[a-z0-9-]+$/,"Slug can only contain lowercase letters, numbers, and hyphens");r.z.object({page:r.z.coerce.number().int().positive().default(1),per_page:r.z.coerce.number().int().positive().max(100).default(12),sort_by:r.z.string().optional(),sort_dir:r.z.enum(["asc","desc"]).default("desc"),q:r.z.string().optional()}),r.z.object({email:r.z.string().email("Invalid email address"),password:r.z.string().min(8,"Password must be at least 8 characters"),remember_me:r.z.boolean().optional().default(!1)}),r.z.object({name:r.z.string().min(2,"Name must be at least 2 characters").max(100),email:r.z.string().email("Invalid email address"),password:r.z.string().min(8,"Password must be at least 8 characters").max(100).regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[0-9]/,"Password must contain at least one number"),confirm_password:r.z.string(),phone:r.z.string().regex(/^\+?[1-9]\d{9,14}$/,"Invalid phone number").optional()}).refine(e=>e.password===e.confirm_password,{message:"Passwords do not match",path:["confirm_password"]}),r.z.object({email:r.z.string().email("Invalid email address")}),r.z.object({token:r.z.string().min(1),password:r.z.string().min(8,"Password must be at least 8 characters").max(100),confirm_password:r.z.string()}).refine(e=>e.password===e.confirm_password,{message:"Passwords do not match",path:["confirm_password"]});let s=r.z.object({name:r.z.string().min(2,"Name is required").max(100),email:r.z.string().email("Invalid email address").optional().or(r.z.literal("")),phone:r.z.string().min(10,"Valid phone number is required").regex(/^\+?[0-9\s-]{10,15}$/,"Invalid phone number"),message:r.z.string().max(1e3).optional(),project_id:r.z.string().optional(),source:r.z.string().optional().default("website"),budget_min:r.z.coerce.number().optional(),budget_max:r.z.coerce.number().optional(),property_type:r.z.string().optional(),utm_source:r.z.string().optional(),utm_medium:r.z.string().optional(),utm_campaign:r.z.string().optional()}),a=r.z.object({name:r.z.string().min(2,"Name is required").max(100),email:r.z.string().email("Invalid email address"),phone:r.z.string().regex(/^\+?[0-9\s-]{10,15}$/,"Invalid phone number").optional().or(r.z.literal("")),subject:r.z.string().min(3,"Subject is required").max(200),message:r.z.string().min(10,"Message must be at least 10 characters").max(2e3)});r.z.object({email:r.z.string().email("Invalid email address"),name:r.z.string().max(100).optional()});let i=r.z.object({name:r.z.string().min(2).max(255),slug:t.optional(),tagline:r.z.string().max(500).optional(),description:r.z.string().min(20,"Description must be at least 20 characters"),short_description:r.z.string().max(500).optional(),status:r.z.enum(["upcoming","ongoing","completed","on_hold"]),category:r.z.enum(["luxury","residential","commercial","rental","villa","plot"]),possession_status:r.z.enum(["ready_to_move","under_construction","nearing_possession"]),is_featured:r.z.boolean().default(!1),is_luxury:r.z.boolean().default(!1),is_new_launch:r.z.boolean().default(!1),is_rera_registered:r.z.boolean().default(!1),publish_status:r.z.enum(["draft","published","archived"]).default("draft"),price_min:r.z.coerce.number().positive("Price must be positive"),price_max:r.z.coerce.number().positive("Price must be positive"),price_per_sqft:r.z.coerce.number().optional(),currency:r.z.string().default("INR"),address:r.z.string().min(5,"Address is required"),landmark:r.z.string().optional(),location_id:r.z.string().optional(),city_id:r.z.string().min(1,"City is required"),state_id:r.z.string().min(1,"State is required"),country_id:r.z.string().optional().default("IN"),pincode:r.z.string().optional(),latitude:r.z.coerce.number().optional(),longitude:r.z.coerce.number().optional(),google_maps_url:r.z.string().url().optional().or(r.z.literal("")),total_units:r.z.coerce.number().int().optional(),total_floors:r.z.coerce.number().int().optional(),total_towers:r.z.coerce.number().int().optional(),total_area_acres:r.z.coerce.number().optional(),open_space_percent:r.z.coerce.number().min(0).max(100).optional(),possession_date:r.z.string().optional(),launch_date:r.z.string().optional(),builder_id:r.z.string().min(1,"Builder is required"),property_type_id:r.z.string().optional(),cover_image:r.z.string().optional(),brochure_url:r.z.string().optional(),video_url:r.z.string().optional(),virtual_tour_url:r.z.string().url().optional().or(r.z.literal("")),rera_number:r.z.string().optional(),rera_expiry_date:r.z.string().optional(),inquiry_email:r.z.string().email().optional().or(r.z.literal("")),inquiry_phone:r.z.string().optional(),whatsapp_number:r.z.string().optional(),meta_title:r.z.string().max(60).optional(),meta_description:r.z.string().max(160).optional(),og_image:r.z.string().optional()});r.z.object({title:r.z.string().min(5).max(255),slug:t.optional(),subtitle:r.z.string().max(500).optional(),content:r.z.string().min(100,"Content must be at least 100 characters"),excerpt:r.z.string().max(500).optional(),cover_image:r.z.string().optional(),category:r.z.string().min(1,"Category is required"),tags:r.z.string().optional(),publish_status:r.z.enum(["draft","published","archived"]).default("draft"),published_at:r.z.string().optional(),is_featured:r.z.boolean().default(!1),meta_title:r.z.string().max(60).optional(),meta_description:r.z.string().max(160).optional()}),r.z.object({status:r.z.enum(["new","contacted","qualified","site_visit","negotiating","closed_won","closed_lost","junk"]).optional(),assigned_to:r.z.string().optional(),next_follow_up:r.z.string().optional(),is_qualified:r.z.boolean().optional(),is_site_visit_done:r.z.boolean().optional()}),r.z.object({content:r.z.string().min(1,"Note content is required").max(5e3),type:r.z.enum(["note","call","email","whatsapp","site_visit","meeting"]).default("note"),is_private:r.z.boolean().default(!1)}),r.z.record(r.z.string(),r.z.string()),r.z.object({name:r.z.string().min(2).max(100),email:r.z.string().email(),phone:r.z.string().optional(),is_active:r.z.boolean().default(!0),role_ids:r.z.array(r.z.string()).optional()}),r.z.object({name:r.z.string().min(2).max(255),slug:t.optional(),logo:r.z.string().optional(),description:r.z.string().optional(),short_description:r.z.string().max(500).optional(),founded_year:r.z.coerce.number().int().min(1900).max(2030).optional(),website:r.z.string().url().optional().or(r.z.literal("")),email:r.z.string().email().optional().or(r.z.literal("")),phone:r.z.string().optional(),address:r.z.string().optional(),city_id:r.z.string().optional(),state_id:r.z.string().optional(),is_featured:r.z.boolean().default(!1),is_verified:r.z.boolean().default(!1),is_active:r.z.boolean().default(!0),meta_title:r.z.string().max(60).optional(),meta_description:r.z.string().max(160).optional()}),r.z.object({author_name:r.z.string().min(2).max(100),author_designation:r.z.string().optional(),author_company:r.z.string().optional(),author_avatar:r.z.string().optional(),content:r.z.string().min(10).max(2e3),rating:r.z.coerce.number().int().min(1).max(5),project_id:r.z.string().optional(),city:r.z.string().optional(),is_featured:r.z.boolean().default(!1),is_active:r.z.boolean().default(!0),video_url:r.z.string().optional()}),r.z.object({question:r.z.string().min(5).max(500),answer:r.z.string().min(10).max(5e3),category:r.z.string().default("general"),sort_order:r.z.coerce.number().int().default(0),is_active:r.z.boolean().default(!0),project_id:r.z.string().optional()}),e.s(["contactSchema",0,a,"enquirySchema",0,s,"projectSchema",0,i])},188873,e=>{"use strict";let r=(0,e.i(456420).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["default",0,r])},503290,e=>{"use strict";let r=(0,e.i(456420).default)("indian-rupee",[["path",{d:"M6 3h12",key:"ggurg9"}],["path",{d:"M6 8h12",key:"6g4wlu"}],["path",{d:"m6 13 8.5 8",key:"u1kupk"}],["path",{d:"M6 13h3",key:"wdp6ag"}],["path",{d:"M9 13c6.667 0 6.667-10 0-10",key:"1nkvk2"}]]);e.s(["default",0,r])},142687,e=>{"use strict";var r=e.i(843476),t=e.i(618566),s=e.i(271645),a=e.i(653145),i=e.i(994814),o=e.i(632781),n=e.i(725981),l=e.i(573474),d=e.i(188873),d=d,c=e.i(146387),u=e.i(503290),u=u,m=e.i(846696),p=e.i(519455),g=e.i(793479),x=e.i(110204),h=e.i(624687),b=e.i(85291),f=e.i(95187);let v=(0,f.createServerReference)("4042d86dbff3f9c9710cf552864d5ad6ee02381634",f.callServer,void 0,f.findSourceMapURL,"createProject"),_=(0,f.createServerReference)("60ce41ffa54cdf6bc8f12befc7a1aac2679b13fdfc",f.callServer,void 0,f.findSourceMapURL,"updateProject");e.s(["ProjectForm",0,function({initialData:e,builders:f,cities:j,states:z,countries:y}){let N=(0,t.useRouter)(),[w,S]=(0,s.useState)(!1),[k,P]=(0,s.useState)(!1),[L,R]=(0,s.useState)(e?.cover_image??null),{register:M,handleSubmit:I,setValue:F,formState:{errors:q}}=(0,a.useForm)({resolver:(0,i.zodResolver)(b.projectSchema),defaultValues:e?{...e,price_min:Number(e.price_min),price_max:Number(e.price_max),price_per_sqft:e.price_per_sqft?Number(e.price_per_sqft):void 0,latitude:e.latitude?Number(e.latitude):void 0,longitude:e.longitude?Number(e.longitude):void 0,total_units:e.total_units?Number(e.total_units):void 0,total_floors:e.total_floors?Number(e.total_floors):void 0,total_towers:e.total_towers?Number(e.total_towers):void 0,total_area_acres:e.total_area_acres?Number(e.total_area_acres):void 0,open_space_percent:e.open_space_percent?Number(e.open_space_percent):void 0,is_featured:"1"===String(e.is_featured)||!0===e.is_featured,is_luxury:"1"===String(e.is_luxury)||!0===e.is_luxury,is_new_launch:"1"===String(e.is_new_launch)||!0===e.is_new_launch,is_rera_registered:"1"===String(e.is_rera_registered)||!0===e.is_rera_registered}:{status:"upcoming",category:"residential",possession_status:"under_construction",is_featured:!1,is_luxury:!1,is_new_launch:!1,is_rera_registered:!1,publish_status:"draft",currency:"INR",country_id:y[0]?.id??"IN"}}),C=async e=>{let r=e.target.files?.[0];if(!r)return;P(!0);let t=new FormData;t.append("file",r);try{let e=await fetch("/api/upload",{method:"POST",body:t}),r=await e.json();r.url?(R(r.url),F("cover_image",r.url),m.toast.success("Image uploaded successfully!")):m.toast.error(r.error??"Failed to upload image")}catch{m.toast.error("Upload failed")}finally{P(!1)}},B=async r=>{S(!0);try{if(e){let t=await _(e.id,r);t.success?(m.toast.success("Project updated successfully!"),N.push("/admin/projects"),N.refresh()):m.toast.error(t.error??"Failed to update project")}else{let e=await v(r);e.success?(m.toast.success("Project created successfully!"),N.push("/admin/projects"),N.refresh()):m.toast.error(e.error??"Failed to create project")}}catch{m.toast.error("An error occurred. Please try again.")}finally{S(!1)}};return(0,r.jsxs)("form",{onSubmit:I(B),className:"space-y-8 max-w-5xl",children:[(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl",children:[(0,r.jsx)("h3",{className:"text-base font-semibold text-foreground mb-4",children:"Cover Image"}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row items-center gap-6",children:[(0,r.jsx)("div",{className:"relative w-full md:w-64 h-36 bg-secondary/30 rounded-xl overflow-hidden border border-border flex items-center justify-center",children:L?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:L,alt:"Cover Preview",className:"w-full h-full object-cover"}),(0,r.jsx)("button",{type:"button",onClick:()=>{R(null),F("cover_image","")},className:"absolute top-2 right-2 p-1.5 bg-background/80 hover:bg-background text-destructive rounded-lg border border-border transition-colors",children:(0,r.jsx)(l.Trash2,{className:"w-4 h-4"})})]}):(0,r.jsx)(c.Building2,{className:"w-10 h-10 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex-1 w-full text-center md:text-left",children:[(0,r.jsxs)(x.Label,{htmlFor:"cover-file-upload",className:"w-fit cursor-pointer",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 px-4 py-2 border border-border hover:bg-secondary/50 rounded-xl transition-colors font-medium text-sm text-foreground",children:[(0,r.jsx)(n.Upload,{className:"w-4 h-4"}),k?"Uploading...":"Upload Cover Image"]}),(0,r.jsx)("input",{id:"cover-file-upload",type:"file",accept:"image/*",className:"hidden",onChange:C,disabled:k})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: WebP or JPG, 16:9 ratio, under 2MB."})]})]})]}),(0,r.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl space-y-4",children:[(0,r.jsxs)("h3",{className:"text-base font-semibold text-foreground mb-4 flex items-center gap-2",children:[(0,r.jsx)(d.default,{className:"w-4 h-4 text-primary"})," Basic Information"]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-name",children:"Project Name *"}),(0,r.jsx)(g.Input,{id:"proj-name",...M("name"),placeholder:"e.g. PropVault Premium Heights"}),q.name&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.name.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-tagline",children:"Tagline"}),(0,r.jsx)(g.Input,{id:"proj-tagline",...M("tagline"),placeholder:"e.g. Ultra-Luxury Living in South Mumbai"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Builder *"}),(0,r.jsxs)("select",{...M("builder_id"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"",children:"Select Builder"}),f.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),q.builder_id&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.builder_id.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Category *"}),(0,r.jsxs)("select",{...M("category"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"luxury",children:"Luxury"}),(0,r.jsx)("option",{value:"residential",children:"Residential"}),(0,r.jsx)("option",{value:"commercial",children:"Commercial"}),(0,r.jsx)("option",{value:"rental",children:"Rental"}),(0,r.jsx)("option",{value:"villa",children:"Villa"}),(0,r.jsx)("option",{value:"plot",children:"Plot"})]})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-desc",children:"Detailed Description *"}),(0,r.jsx)(h.Textarea,{id:"proj-desc",...M("description"),placeholder:"Provide a comprehensive description of features, materials, amenities, etc.",className:"min-h-[120px]"}),q.description&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.description.message})]})]}),(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl space-y-4",children:[(0,r.jsxs)("h3",{className:"text-base font-semibold text-foreground mb-4 flex items-center gap-2",children:[(0,r.jsx)(u.default,{className:"w-4 h-4 text-primary"})," Pricing & Location"]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"price-min",children:"Min Price (₹) *"}),(0,r.jsx)(g.Input,{id:"price-min",type:"number",...M("price_min"),placeholder:"e.g. 15000000"}),q.price_min&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.price_min.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"price-max",children:"Max Price (₹) *"}),(0,r.jsx)(g.Input,{id:"price-max",type:"number",...M("price_max"),placeholder:"e.g. 45000000"}),q.price_max&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.price_max.message})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"City *"}),(0,r.jsxs)("select",{...M("city_id"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"",children:"Select City"}),j.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),q.city_id&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.city_id.message})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"State *"}),(0,r.jsxs)("select",{...M("state_id"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"",children:"Select State"}),z.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),q.state_id&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.state_id.message})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"proj-address",children:"Address *"}),(0,r.jsx)(g.Input,{id:"proj-address",...M("address"),placeholder:"e.g. Sector 15, BKC, Bandra East"}),q.address&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:q.address.message})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Status"}),(0,r.jsxs)("select",{...M("status"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"upcoming",children:"Upcoming"}),(0,r.jsx)("option",{value:"ongoing",children:"Ongoing"}),(0,r.jsx)("option",{value:"completed",children:"Completed"}),(0,r.jsx)("option",{value:"on_hold",children:"On Hold"})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{children:"Possession Status"}),(0,r.jsxs)("select",{...M("possession_status"),className:"h-10 w-full px-3 rounded-xl border border-border bg-card text-sm text-foreground focus:outline-none",children:[(0,r.jsx)("option",{value:"ready_to_move",children:"Ready to Move"}),(0,r.jsx)("option",{value:"under_construction",children:"Under Construction"}),(0,r.jsx)("option",{value:"nearing_possession",children:"Nearing Possession"})]})]})]})]})]}),(0,r.jsxs)("div",{className:"glass-card p-6 rounded-2xl space-y-4",children:[(0,r.jsxs)("h3",{className:"text-base font-semibold text-foreground mb-4 flex items-center gap-2",children:[(0,r.jsx)(c.Building2,{className:"w-4 h-4 text-primary"})," Specifications & Certifications"]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-featured",...M("is_featured"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-featured",className:"cursor-pointer select-none",children:"Featured Listing"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-luxury",...M("is_luxury"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-luxury",className:"cursor-pointer select-none",children:"Luxury Tag"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-launch",...M("is_new_launch"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-launch",className:"cursor-pointer select-none",children:"New Launch"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-secondary/10 rounded-xl",children:[(0,r.jsx)("input",{type:"checkbox",id:"flag-rera",...M("is_rera_registered"),className:"w-4 h-4 rounded text-primary"}),(0,r.jsx)(x.Label,{htmlFor:"flag-rera",className:"cursor-pointer select-none",children:"RERA Registered"})]})]}),(0,r.jsxs)("div",{className:"grid md:grid-cols-3 gap-6 pt-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"rera-num",children:"RERA Number"}),(0,r.jsx)(g.Input,{id:"rera-num",...M("rera_number"),placeholder:"e.g. P51800012345"})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"brochure-url",children:"Brochure URL"}),(0,r.jsx)(g.Input,{id:"brochure-url",...M("brochure_url"),placeholder:"PDF download link"})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(x.Label,{htmlFor:"video-url",children:"Video / YouTube URL"}),(0,r.jsx)(g.Input,{id:"video-url",...M("video_url"),placeholder:"e.g. YouTube promo video link"})]})]})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-4",children:[(0,r.jsx)(p.Button,{type:"button",variant:"outline",onClick:()=>N.push("/admin/projects"),children:"Cancel"}),(0,r.jsx)(p.Button,{type:"submit",variant:"gold",disabled:w,children:w?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):"Save Project"})]})]})}],142687)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,793479,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(975157);let a=r.forwardRef(({className:e,type:r,...a},i)=>(0,t.jsx)("input",{type:r,className:(0,s.cn)("flex h-10 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:i,...a}));a.displayName="Input",e.s(["Input",0,a])},519455,225913,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(991918),a=e.i(207670);let i=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=a.clsx,n=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return l(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:a,defaultVariants:n}=t,o=Object.keys(a).map(e=>{let t=null==r?void 0:r[e],s=null==n?void 0:n[e];if(null===t)return null;let l=i(t)||i(s);return a[e][l]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return l(e,o,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:s,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...d}[t]):({...n,...d})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)};e.s(["cva",0,n],225913);var o=e.i(975157);let d=n("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent hover:bg-secondary/50 hover:text-foreground text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-secondary/50 hover:text-foreground text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",gold:"bg-gradient-to-r from-[hsl(36,82%,47%)] to-[hsl(42,88%,65%)] text-[hsl(240,20%,7%)] font-semibold hover:opacity-90 active:scale-[0.98] shadow-[0_4px_14px_0_hsl(36,82%,47%,0.4)]","gold-outline":"border border-[hsl(36,82%,47%,0.5)] text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)] hover:border-[hsl(36,82%,47%)]","gold-ghost":"text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)]"},size:{default:"h-10 px-5 py-2",xs:"h-7 px-3 text-xs rounded-lg",sm:"h-9 px-4 text-sm",lg:"h-12 px-8 text-base",xl:"h-14 px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),c=r.forwardRef(({className:e,variant:r,size:a,asChild:i=!1,...l},n)=>{let c=i?s.Slot:"button";return(0,t.jsx)(c,{className:(0,o.cn)(d({variant:r,size:a,className:e})),ref:n,...l})});c.displayName="Button",e.s(["Button",0,c],519455)},632781,758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t],758379),e.s(["Loader2",0,t],632781)},95187,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={callServer:function(){return i.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let i=e.r(132120),l=e.r(92245),n=e.r(235326)},110204,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(248425),a=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));a.displayName="Label";var i=e.i(975157);let l=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(a,{ref:s,className:(0,i.cn)("text-sm font-medium text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r}));l.displayName=a.displayName,e.s(["Label",0,l],110204)},624687,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(975157);let a=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-colors",e),ref:a,...r}));a.displayName="Textarea",e.s(["Textarea",0,a])},999682,e=>{"use strict";var t=e.i(271645);e.s(["usePrevious",0,function(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}])},699375,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(981140),a=e.i(820783),i=e.i(30030),l=e.i(369340),n=e.i(999682),o=e.i(635804),d=e.i(248425),c="Switch",[u,p]=(0,i.createContextScope)(c),[x,f]=u(c);function m(e){let{__scopeSwitch:s,checked:a,children:i,defaultChecked:n,disabled:o,form:d,name:u,onCheckedChange:p,required:f,value:m="on",internal_do_not_use_render:h}=e,[g,v]=(0,l.useControllableState)({prop:a,defaultProp:n??!1,onChange:p,caller:c}),[b,y]=r.useState(null),[j,N]=r.useState(null),w=r.useRef(!1),S=!b||!!d||!!b.closest("form"),k={checked:g,setChecked:v,disabled:o,control:b,setControl:y,name:u,form:d,value:m,hasConsumerStoppedPropagationRef:w,required:f,defaultChecked:n,isFormControl:S,bubbleInput:j,setBubbleInput:N};return(0,t.jsx)(x,{scope:s,...k,children:"function"==typeof h?h(k):i})}var h="SwitchTrigger",g=r.forwardRef(({__scopeSwitch:e,onClick:i,...l},n)=>{let{control:o,form:c,value:u,disabled:p,checked:x,required:m,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:b,isFormControl:y,bubbleInput:j}=f(h,e),N=(0,a.useComposedRefs)(n,g),S=r.useRef(x);return r.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let t=()=>v(S.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,c,v]),(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":x,"aria-required":m,"data-state":w(x),"data-disabled":p?"":void 0,disabled:p,value:u,...l,ref:N,onClick:(0,s.composeEventHandlers)(i,e=>{v(e=>!e),j&&y&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})});g.displayName=h;var v=r.forwardRef((e,r)=>{let{__scopeSwitch:s,name:a,checked:i,defaultChecked:l,required:n,disabled:o,value:d,onCheckedChange:c,form:u,...p}=e;return(0,t.jsx)(m,{__scopeSwitch:s,checked:i,defaultChecked:l,disabled:o,required:n,onCheckedChange:c,name:a,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{...p,ref:r,__scopeSwitch:s}),e&&(0,t.jsx)(N,{__scopeSwitch:s})]})})});v.displayName=c;var b="SwitchThumb",y=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...a}=e,i=f(b,s);return(0,t.jsx)(d.Primitive.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})});y.displayName=b;var j="SwitchBubbleInput",N=r.forwardRef(({__scopeSwitch:e,...s},i)=>{let{control:l,hasConsumerStoppedPropagationRef:c,checked:u,defaultChecked:p,required:x,disabled:m,name:h,value:g,form:v,bubbleInput:b,setBubbleInput:y}=f(j,e),N=(0,a.useComposedRefs)(i,y),w=(0,n.usePrevious)(u),S=(0,o.useSize)(l);r.useEffect(()=>{if(!b)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!c.current;if(w!==u&&e){let r=new Event("click",{bubbles:t});e.call(b,u),b.dispatchEvent(r)}},[b,w,u,c]);let k=r.useRef(u);return(0,t.jsx)(d.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:p??k.current,required:x,disabled:m,name:h,value:g,form:v,...s,tabIndex:-1,ref:N,style:{...s.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function w(e){return e?"checked":"unchecked"}N.displayName=j;var S=e.i(975157);let k=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(v,{className:(0,S.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-secondary",e),...r,ref:s,children:(0,t.jsx)(y,{className:(0,S.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));k.displayName=v.displayName,e.s(["Switch",0,k],699375)},773219,e=>{"use strict";let t=(0,e.i(456420).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);e.s(["default",0,t])},714513,e=>{"use strict";var t=e.i(773219);e.s(["Layout",()=>t.default])},690958,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(618566),a=e.i(846696),i=e.i(632781),l=e.i(226091),n=e.i(91511),o=e.i(714513),d=e.i(166794),c=e.i(519455),u=e.i(793479),p=e.i(110204),x=e.i(624687),f=e.i(699375),m=e.i(95187);let h=(0,m.createServerReference)("400d7c5de8c911aa1451b3417694804211d835ba5b",m.callServer,void 0,m.findSourceMapURL,"createPage"),g=[{value:"default",label:"Default",description:"Standard page with header and footer",icon:l.FileText},{value:"full_width",label:"Full Width",description:"No container constraints",icon:n.Globe},{value:"sidebar",label:"With Sidebar",description:"Page with right sidebar",icon:o.Layout}];e.s(["default",0,function(){let e=(0,s.useRouter)(),[l,n]=(0,r.useTransition)(),[o,m]=(0,r.useState)({title:"",slug:"",excerpt:"",template:"default",meta_title:"",meta_description:"",og_image:"",publish_status:"draft"}),[v,b]=(0,r.useState)(!0);return(0,t.jsxs)("div",{className:"max-w-2xl mx-auto px-6 py-10 space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Create New Page"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Fill in the basic details, then use the visual builder to add content."})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(p.Label,{children:"Page Title"}),(0,t.jsx)(u.Input,{value:o.title,onChange:e=>{var t;return t=e.target.value,void m(e=>({...e,title:t,slug:v?t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""):e.slug}))},placeholder:"e.g. About Us",className:"text-base"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(p.Label,{children:"URL Slug"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Auto-generate"}),(0,t.jsx)(f.Switch,{checked:v,onCheckedChange:b})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground px-3 py-2.5 bg-secondary rounded-xl border border-border",children:"propvault.vikshro.in/"}),(0,t.jsx)(u.Input,{value:o.slug,onChange:e=>{b(!1),m(t=>({...t,slug:e.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")}))},placeholder:"about-us",className:"flex-1",disabled:v})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(p.Label,{children:["Excerpt ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),(0,t.jsx)(x.Textarea,{value:o.excerpt,onChange:e=>m(t=>({...t,excerpt:e.target.value})),placeholder:"Brief description of this page…",className:"resize-none min-h-[80px]"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(p.Label,{children:"Page Template"}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-3",children:g.map(({value:e,label:r,description:s,icon:a})=>(0,t.jsxs)("button",{type:"button",onClick:()=>m(t=>({...t,template:e})),className:`p-4 rounded-xl border text-left transition-all ${o.template===e?"border-primary/60 bg-primary/8 ring-2 ring-primary/20":"border-border hover:border-primary/30"}`,children:[(0,t.jsx)(a,{className:`h-5 w-5 mb-2 ${o.template===e?"text-primary":"text-muted-foreground"}`}),(0,t.jsx)("p",{className:"text-xs font-semibold text-foreground",children:r}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-snug",children:s})]},e))})]}),(0,t.jsxs)("div",{className:"space-y-4 p-4 rounded-xl border border-border bg-card/40",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Settings,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-semibold",children:"SEO Settings"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(p.Label,{className:"text-xs",children:["Meta Title ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),(0,t.jsx)(u.Input,{value:o.meta_title,onChange:e=>m(t=>({...t,meta_title:e.target.value})),className:"mt-1.5",placeholder:o.title})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(p.Label,{className:"text-xs",children:["Meta Description ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),(0,t.jsx)(x.Textarea,{value:o.meta_description,onChange:e=>m(t=>({...t,meta_description:e.target.value})),className:"mt-1.5 resize-none min-h-[60px]",placeholder:"Search engine description…"})]})]})]}),(0,t.jsx)(c.Button,{onClick:()=>{o.title.trim()?o.slug.trim()?n(async()=>{let t=await h(o);t.success&&t.data?(a.toast.success("Page created! Opening editor…"),e.push(`/admin/cms/pages/${t.data.id}/edit`)):a.toast.error(t.error??"Failed to create page")}):a.toast.error("Slug is required"):a.toast.error("Title is required")},disabled:l,className:"btn-gold w-full h-11",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin"})," Creating Page…"]}):"Create & Open Builder"})]})]})}],690958)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,793479,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(975157);let a=r.forwardRef(({className:e,type:r,...a},i)=>(0,t.jsx)("input",{type:r,className:(0,s.cn)("flex h-10 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:i,...a}));a.displayName="Input",e.s(["Input",0,a])},519455,225913,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(991918),a=e.i(207670);let i=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=a.clsx,n=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return l(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:a,defaultVariants:n}=t,o=Object.keys(a).map(e=>{let t=null==r?void 0:r[e],s=null==n?void 0:n[e];if(null===t)return null;let l=i(t)||i(s);return a[e][l]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return l(e,o,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:s,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...d}[t]):({...n,...d})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)};e.s(["cva",0,n],225913);var o=e.i(975157);let d=n("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent hover:bg-secondary/50 hover:text-foreground text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-secondary/50 hover:text-foreground text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",gold:"bg-gradient-to-r from-[hsl(36,82%,47%)] to-[hsl(42,88%,65%)] text-[hsl(240,20%,7%)] font-semibold hover:opacity-90 active:scale-[0.98] shadow-[0_4px_14px_0_hsl(36,82%,47%,0.4)]","gold-outline":"border border-[hsl(36,82%,47%,0.5)] text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)] hover:border-[hsl(36,82%,47%)]","gold-ghost":"text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)]"},size:{default:"h-10 px-5 py-2",xs:"h-7 px-3 text-xs rounded-lg",sm:"h-9 px-4 text-sm",lg:"h-12 px-8 text-base",xl:"h-14 px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),c=r.forwardRef(({className:e,variant:r,size:a,asChild:i=!1,...l},n)=>{let c=i?s.Slot:"button";return(0,t.jsx)(c,{className:(0,o.cn)(d({variant:r,size:a,className:e})),ref:n,...l})});c.displayName="Button",e.s(["Button",0,c],519455)},632781,758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t],758379),e.s(["Loader2",0,t],632781)},95187,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={callServer:function(){return i.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let i=e.r(132120),l=e.r(92245),n=e.r(235326)},110204,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(248425),a=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));a.displayName="Label";var i=e.i(975157);let l=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(a,{ref:s,className:(0,i.cn)("text-sm font-medium text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r}));l.displayName=a.displayName,e.s(["Label",0,l],110204)},624687,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(975157);let a=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-colors",e),ref:a,...r}));a.displayName="Textarea",e.s(["Textarea",0,a])},999682,e=>{"use strict";var t=e.i(271645);e.s(["usePrevious",0,function(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}])},699375,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(981140),a=e.i(820783),i=e.i(30030),l=e.i(369340),n=e.i(999682),o=e.i(635804),d=e.i(248425),c="Switch",[u,p]=(0,i.createContextScope)(c),[f,x]=u(c);function m(e){let{__scopeSwitch:s,checked:a,children:i,defaultChecked:n,disabled:o,form:d,name:u,onCheckedChange:p,required:x,value:m="on",internal_do_not_use_render:h}=e,[g,v]=(0,l.useControllableState)({prop:a,defaultProp:n??!1,onChange:p,caller:c}),[b,y]=r.useState(null),[j,N]=r.useState(null),w=r.useRef(!1),S=!b||!!d||!!b.closest("form"),k={checked:g,setChecked:v,disabled:o,control:b,setControl:y,name:u,form:d,value:m,hasConsumerStoppedPropagationRef:w,required:x,defaultChecked:n,isFormControl:S,bubbleInput:j,setBubbleInput:N};return(0,t.jsx)(f,{scope:s,...k,children:"function"==typeof h?h(k):i})}var h="SwitchTrigger",g=r.forwardRef(({__scopeSwitch:e,onClick:i,...l},n)=>{let{control:o,form:c,value:u,disabled:p,checked:f,required:m,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:b,isFormControl:y,bubbleInput:j}=x(h,e),N=(0,a.useComposedRefs)(n,g),S=r.useRef(f);return r.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let t=()=>v(S.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,c,v]),(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":f,"aria-required":m,"data-state":w(f),"data-disabled":p?"":void 0,disabled:p,value:u,...l,ref:N,onClick:(0,s.composeEventHandlers)(i,e=>{v(e=>!e),j&&y&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})});g.displayName=h;var v=r.forwardRef((e,r)=>{let{__scopeSwitch:s,name:a,checked:i,defaultChecked:l,required:n,disabled:o,value:d,onCheckedChange:c,form:u,...p}=e;return(0,t.jsx)(m,{__scopeSwitch:s,checked:i,defaultChecked:l,disabled:o,required:n,onCheckedChange:c,name:a,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{...p,ref:r,__scopeSwitch:s}),e&&(0,t.jsx)(N,{__scopeSwitch:s})]})})});v.displayName=c;var b="SwitchThumb",y=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...a}=e,i=x(b,s);return(0,t.jsx)(d.Primitive.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})});y.displayName=b;var j="SwitchBubbleInput",N=r.forwardRef(({__scopeSwitch:e,...s},i)=>{let{control:l,hasConsumerStoppedPropagationRef:c,checked:u,defaultChecked:p,required:f,disabled:m,name:h,value:g,form:v,bubbleInput:b,setBubbleInput:y}=x(j,e),N=(0,a.useComposedRefs)(i,y),w=(0,n.usePrevious)(u),S=(0,o.useSize)(l);r.useEffect(()=>{if(!b)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!c.current;if(w!==u&&e){let r=new Event("click",{bubbles:t});e.call(b,u),b.dispatchEvent(r)}},[b,w,u,c]);let k=r.useRef(u);return(0,t.jsx)(d.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:p??k.current,required:f,disabled:m,name:h,value:g,form:v,...s,tabIndex:-1,ref:N,style:{...s.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function w(e){return e?"checked":"unchecked"}N.displayName=j;var S=e.i(975157);let k=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(v,{className:(0,S.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-secondary",e),...r,ref:s,children:(0,t.jsx)(y,{className:(0,S.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));k.displayName=v.displayName,e.s(["Switch",0,k],699375)},773219,e=>{"use strict";let t=(0,e.i(456420).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);e.s(["default",0,t])},714513,e=>{"use strict";var t=e.i(773219);e.s(["Layout",()=>t.default])},690958,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(618566),a=e.i(846696),i=e.i(632781),l=e.i(226091),n=e.i(91511),o=e.i(714513),d=e.i(166794),c=e.i(519455),u=e.i(793479),p=e.i(110204),f=e.i(624687),x=e.i(699375),m=e.i(95187);let h=(0,m.createServerReference)("405e7d47de2440cd12ddc65af1ae5ffc0a6c2122a4",m.callServer,void 0,m.findSourceMapURL,"createPage"),g=[{value:"default",label:"Default",description:"Standard page with header and footer",icon:l.FileText},{value:"full_width",label:"Full Width",description:"No container constraints",icon:n.Globe},{value:"sidebar",label:"With Sidebar",description:"Page with right sidebar",icon:o.Layout}];e.s(["default",0,function(){let e=(0,s.useRouter)(),[l,n]=(0,r.useTransition)(),[o,m]=(0,r.useState)({title:"",slug:"",excerpt:"",template:"default",meta_title:"",meta_description:"",og_image:"",publish_status:"draft"}),[v,b]=(0,r.useState)(!0);return(0,t.jsxs)("div",{className:"max-w-2xl mx-auto px-6 py-10 space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Create New Page"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Fill in the basic details, then use the visual builder to add content."})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(p.Label,{children:"Page Title"}),(0,t.jsx)(u.Input,{value:o.title,onChange:e=>{var t;return t=e.target.value,void m(e=>({...e,title:t,slug:v?t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""):e.slug}))},placeholder:"e.g. About Us",className:"text-base"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(p.Label,{children:"URL Slug"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Auto-generate"}),(0,t.jsx)(x.Switch,{checked:v,onCheckedChange:b})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground px-3 py-2.5 bg-secondary rounded-xl border border-border",children:"propvault.vikshro.in/"}),(0,t.jsx)(u.Input,{value:o.slug,onChange:e=>{b(!1),m(t=>({...t,slug:e.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")}))},placeholder:"about-us",className:"flex-1",disabled:v})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(p.Label,{children:["Excerpt ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),(0,t.jsx)(f.Textarea,{value:o.excerpt,onChange:e=>m(t=>({...t,excerpt:e.target.value})),placeholder:"Brief description of this page…",className:"resize-none min-h-[80px]"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(p.Label,{children:"Page Template"}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-3",children:g.map(({value:e,label:r,description:s,icon:a})=>(0,t.jsxs)("button",{type:"button",onClick:()=>m(t=>({...t,template:e})),className:`p-4 rounded-xl border text-left transition-all ${o.template===e?"border-primary/60 bg-primary/8 ring-2 ring-primary/20":"border-border hover:border-primary/30"}`,children:[(0,t.jsx)(a,{className:`h-5 w-5 mb-2 ${o.template===e?"text-primary":"text-muted-foreground"}`}),(0,t.jsx)("p",{className:"text-xs font-semibold text-foreground",children:r}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-snug",children:s})]},e))})]}),(0,t.jsxs)("div",{className:"space-y-4 p-4 rounded-xl border border-border bg-card/40",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Settings,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-semibold",children:"SEO Settings"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(p.Label,{className:"text-xs",children:["Meta Title ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),(0,t.jsx)(u.Input,{value:o.meta_title,onChange:e=>m(t=>({...t,meta_title:e.target.value})),className:"mt-1.5",placeholder:o.title})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(p.Label,{className:"text-xs",children:["Meta Description ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),(0,t.jsx)(f.Textarea,{value:o.meta_description,onChange:e=>m(t=>({...t,meta_description:e.target.value})),className:"mt-1.5 resize-none min-h-[60px]",placeholder:"Search engine description…"})]})]})]}),(0,t.jsx)(c.Button,{onClick:()=>{o.title.trim()?o.slug.trim()?n(async()=>{let t=await h(o);t.success&&t.data?(a.toast.success("Page created! Opening editor…"),e.push(`/admin/cms/pages/${t.data.id}/edit`)):a.toast.error(t.error??"Failed to create page")}):a.toast.error("Slug is required"):a.toast.error("Title is required")},disabled:l,className:"btn-gold w-full h-11",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin"})," Creating Page…"]}):"Create & Open Builder"})]})]})}],690958)}]);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9306,e=>{"use strict";let t=(0,e.i(456420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",0,t])},573474,e=>{"use strict";var t=e.i(9306);e.s(["Trash2",()=>t.default])},793479,e=>{"use strict";var t=e.i(843476),r=e.i(271645),
|
|
2
|
-
[data-motion-pop-id="${
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9306,e=>{"use strict";let t=(0,e.i(456420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",0,t])},573474,e=>{"use strict";var t=e.i(9306);e.s(["Trash2",()=>t.default])},793479,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(975157);let s=r.forwardRef(({className:e,type:r,...s},o)=>(0,t.jsx)("input",{type:r,className:(0,a.cn)("flex h-10 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:o,...s}));s.displayName="Input",e.s(["Input",0,s])},519455,225913,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(991918),s=e.i(207670);let o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=s.clsx,n=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return l(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:s,defaultVariants:n}=t,i=Object.keys(s).map(e=>{let t=null==r?void 0:r[e],a=null==n?void 0:n[e];if(null===t)return null;let l=o(t)||o(a);return s[e][l]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return l(e,i,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:a,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...d}[t]):({...n,...d})[t]===r})?[...e,r,a]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)};e.s(["cva",0,n],225913);var i=e.i(975157);let d=n("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent hover:bg-secondary/50 hover:text-foreground text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-secondary/50 hover:text-foreground text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",gold:"bg-gradient-to-r from-[hsl(36,82%,47%)] to-[hsl(42,88%,65%)] text-[hsl(240,20%,7%)] font-semibold hover:opacity-90 active:scale-[0.98] shadow-[0_4px_14px_0_hsl(36,82%,47%,0.4)]","gold-outline":"border border-[hsl(36,82%,47%,0.5)] text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)] hover:border-[hsl(36,82%,47%)]","gold-ghost":"text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)]"},size:{default:"h-10 px-5 py-2",xs:"h-7 px-3 text-xs rounded-lg",sm:"h-9 px-4 text-sm",lg:"h-12 px-8 text-base",xl:"h-14 px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),c=r.forwardRef(({className:e,variant:r,size:s,asChild:o=!1,...l},n)=>{let c=o?a.Slot:"button";return(0,t.jsx)(c,{className:(0,i.cn)(d({variant:r,size:s,className:e})),ref:n,...l})});c.displayName="Button",e.s(["Button",0,c],519455)},632781,758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t],758379),e.s(["Loader2",0,t],632781)},95187,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={callServer:function(){return o.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let o=e.r(132120),l=e.r(92245),n=e.r(235326)},110204,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(248425),s=r.forwardRef((e,r)=>(0,t.jsx)(a.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));s.displayName="Label";var o=e.i(975157);let l=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(s,{ref:a,className:(0,o.cn)("text-sm font-medium text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r}));l.displayName=s.displayName,e.s(["Label",0,l],110204)},869860,e=>{"use strict";let t=(0,e.i(456420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["default",0,t])},856522,e=>{"use strict";var t=e.i(869860);e.s(["Save",()=>t.default])},77834,e=>{"use strict";let t=(0,e.i(456420).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["default",0,t])},725981,e=>{"use strict";var t=e.i(77834);e.s(["Upload",()=>t.default])},88653,e=>{"use strict";e.i(247167);var t=e.i(843476),r=e.i(271645),a=e.i(231178),s=e.i(947414),o=e.i(674008),l=e.i(821476),n=e.i(772846),i=r,d=e.i(369110);function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class u extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if((0,n.isHTMLElement)(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,r=(0,n.isHTMLElement)(e)&&e.offsetWidth||0,a=(0,n.isHTMLElement)(e)&&e.offsetHeight||0,s=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(s.height),o.width=parseFloat(s.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left,o.bottom=a-o.height-o.top,o.direction=s.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function p({children:e,isPresent:a,anchorX:s,anchorY:o,root:l,pop:n}){let f=(0,i.useId)(),m=(0,i.useRef)(null),h=(0,i.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:x}=(0,i.useContext)(d.MotionConfigContext),g=function(...e){return r.useCallback(function(...e){return t=>{let r=!1,a=e.map(e=>{let a=c(e,t);return r||"function"!=typeof a||(r=!0),a});if(r)return()=>{for(let t=0;t<a.length;t++){let r=a[t];"function"==typeof r?r():c(e[t],null)}}}}(...e),e)}(m,e.props?.ref??e?.ref);return(0,i.useInsertionEffect)(()=>{let{width:e,height:t,top:r,left:i,right:d,bottom:c,direction:u}=h.current;if(a||!1===n||!m.current||!e||!t)return;let p="rtl"===u,g="left"===s?p?`right: ${d}`:`left: ${i}`:p?`left: ${i}`:`right: ${d}`,y="bottom"===o?`bottom: ${c}`:`top: ${r}`;m.current.dataset.motionPopId=f;let b=document.createElement("style");x&&(b.nonce=x);let v=l??document.head;return v.appendChild(b),b.sheet&&b.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${f}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
4
|
width: ${e}px !important;
|
|
5
5
|
height: ${t}px !important;
|
|
6
6
|
${g}px !important;
|
|
7
7
|
${y}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{f.current?.removeAttribute("data-motion-pop-id"),v.contains(b)&&v.removeChild(b)}},[s]),(0,t.jsx)(u,{isPresent:s,childRef:f,sizeRef:h,pop:n,children:!1===n?e:i.cloneElement(e,{ref:g})})}let m=({children:e,initial:s,isPresent:n,onExitComplete:i,custom:d,presenceAffectsLayout:c,mode:u,anchorX:m,anchorY:h,root:x})=>{let g=(0,a.useConstant)(f),y=(0,r.useId)(),b=(0,r.useRef)(n),v=(0,r.useRef)(i);(0,o.useIsomorphicLayoutEffect)(()=>{b.current=n,v.current=i});let j=!0,k=(0,r.useMemo)(()=>(j=!1,{id:y,initial:s,isPresent:n,custom:d,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;i&&i()},register:e=>(g.set(e,!1),()=>{g.delete(e),b.current||g.size||v.current?.()})}),[n,g,i]);return c&&j&&(k={...k}),(0,r.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[n]),r.useEffect(()=>{n||g.size||!i||i()},[n]),e=(0,t.jsx)(p,{pop:"popLayout"===u,isPresent:n,anchorX:m,anchorY:h,root:x,children:e}),(0,t.jsx)(l.PresenceContext.Provider,{value:k,children:e})};function f(){return new Map}var h=e.i(464978);let x=e=>e.key||"";function g(e){let t=[];return r.Children.forEach(e,e=>{(0,r.isValidElement)(e)&&t.push(e)}),t}e.s(["AnimatePresence",0,({children:e,custom:l,initial:n=!0,onExitComplete:i,presenceAffectsLayout:d=!0,mode:c="sync",propagate:u=!1,anchorX:p="left",anchorY:f="top",root:y})=>{let[b,v]=(0,h.usePresence)(u),j=(0,r.useMemo)(()=>g(e),[e]),k=u&&!b?[]:j.map(x),N=(0,r.useRef)(!0),w=(0,r.useRef)(j),S=(0,a.useConstant)(()=>new Map),M=(0,r.useRef)(new Set),[C,$]=(0,r.useState)(j),[L,F]=(0,r.useState)(j);(0,o.useIsomorphicLayoutEffect)(()=>{N.current=!1,w.current=j;for(let e=0;e<L.length;e++){let t=x(L[e]);k.includes(t)?(S.delete(t),M.current.delete(t)):!0!==S.get(t)&&S.set(t,!1)}},[L,k.length,k.join("-")]);let T=[];if(j!==C){let e=[...j];for(let t=0;t<L.length;t++){let r=L[t],s=x(r);k.includes(s)||(e.splice(t,0,r),T.push(r))}return"wait"===c&&T.length&&(e=T),F(g(e)),$(j),null}let{forceRender:R}=(0,r.useContext)(s.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:L.map(e=>{let r=x(e),s=(!u||!!b)&&(j===L||k.includes(r));return(0,t.jsx)(m,{isPresent:s,initial:(!N.current||!!n)&&void 0,custom:l,presenceAffectsLayout:d,mode:c,root:y,onExitComplete:s?void 0:()=>{if(M.current.has(r)||!S.has(r))return;M.current.add(r),S.set(r,!0);let e=!0;S.forEach(t=>{t||(e=!1)}),e&&(R?.(),F(w.current),u&&v?.(),i&&i())},anchorX:p,anchorY:f,children:e},r)})})}],88653)},755566,e=>{"use strict";let t=(0,e.i(456420).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},343420,e=>{"use strict";let t=(0,e.i(456420).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},352627,e=>{"use strict";let t=(0,e.i(456420).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",0,t])},277464,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(846932),a=e.i(88653),o=e.i(755566),o=o,l=e.i(343420),l=l,n=e.i(352627),n=n,i=e.i(975157),d=e.i(519455);function c({open:e,title:u,description:p,confirmLabel:m="Confirm",cancelLabel:f="Cancel",variant:h="danger",onConfirm:x,onCancel:g,isLoading:y=!1}){let b=(0,r.useRef)(null);(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&g()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,g]);let v={danger:(0,t.jsx)(n.default,{className:"h-10 w-10 text-destructive"}),warning:(0,t.jsx)(o.default,{className:"h-10 w-10 text-amber-500"}),info:(0,t.jsx)(l.default,{className:"h-10 w-10 text-primary"})};return(0,t.jsx)(a.AnimatePresence,{children:e&&(0,t.jsx)(s.motion.div,{ref:b,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},onClick:e=>{e.target===b.current&&g()},children:(0,t.jsx)(s.motion.div,{initial:{scale:.92,opacity:0,y:16},animate:{scale:1,opacity:1,y:0},exit:{scale:.92,opacity:0,y:16},transition:{type:"spring",stiffness:400,damping:30},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[v[h],(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:u}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-muted-foreground leading-relaxed",children:p})]}),(0,t.jsxs)("div",{className:"flex w-full gap-3 mt-2",children:[(0,t.jsx)(d.Button,{variant:"outline",className:"flex-1",onClick:g,disabled:y,children:f}),(0,t.jsx)(d.Button,{variant:{danger:"destructive",warning:"default",info:"default"}[h],className:(0,i.cn)("flex-1","info"===h&&"btn-gold"),onClick:x,disabled:y,children:y?(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),"Processing…"]}):m})]})]})})})})}e.s(["DeleteDialog",0,function({open:e,entityName:r,entityType:s="item",onConfirm:a,onCancel:o,isLoading:l=!1}){return(0,t.jsx)(c,{open:e,title:`Delete ${s}`,description:`Are you absolutely sure you want to delete "${r}"? This action cannot be undone and all associated data will be permanently removed.`,confirmLabel:"Delete Permanently",cancelLabel:"Keep it",variant:"danger",onConfirm:a,onCancel:o,isLoading:l})},"ProgressDialog",0,function({open:e,title:r,description:o,progress:l,status:n}){return(0,t.jsx)(a.AnimatePresence,{children:e&&(0,t.jsx)(s.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},children:(0,t.jsxs)(s.motion.div,{initial:{scale:.92,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.92,opacity:0},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-1",children:r}),o&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-5",children:o}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:n??"Processing…"}),(0,t.jsxs)("span",{children:[Math.round(l),"%"]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-secondary overflow-hidden",children:(0,t.jsx)(s.motion.div,{className:"h-full rounded-full bg-primary",initial:{width:0},animate:{width:`${l}%`},transition:{duration:.3}})})]})]})})})}],277464)},566595,630299,e=>{"use strict";let t=(0,e.i(456420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,t],630299),e.s(["Search",0,t],566595)},484479,e=>{"use strict";let t=(0,e.i(456420).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",0,t])},526347,e=>{"use strict";let t=(0,e.i(456420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["default",0,t])},844071,e=>{"use strict";let t=(0,e.i(456420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["default",0,t])},906815,e=>{"use strict";let t=(0,e.i(456420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["default",0,t])},773219,e=>{"use strict";let t=(0,e.i(456420).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);e.s(["default",0,t])},890714,e=>{"use strict";let t=(0,e.i(456420).default)("droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);e.s(["default",0,t])},85604,e=>{"use strict";let t=(0,e.i(456420).default)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]);e.s(["default",0,t])},217878,e=>{"use strict";let t=(0,e.i(456420).default)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);e.s(["default",0,t])},824694,e=>{"use strict";let t=(0,e.i(456420).default)("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);e.s(["default",0,t])},756679,e=>{"use strict";let t=(0,e.i(456420).default)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);e.s(["default",0,t])},762368,e=>{"use strict";var t=e.i(484479);e.s(["Download",()=>t.default])},508734,e=>{"use strict";var t=e.i(526347);e.s(["Copy",()=>t.default])},196699,e=>{"use strict";var t=e.i(844071);e.s(["Moon",()=>t.default])},235965,e=>{"use strict";var t=e.i(906815);e.s(["Sun",()=>t.default])},714513,e=>{"use strict";var t=e.i(773219);e.s(["Layout",()=>t.default])},435184,e=>{"use strict";var t=e.i(85604);e.s(["Type",()=>t.default])},436150,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(846696),a=e.i(618566),o=e.i(950786),l=e.i(762368),n=e.i(725981),i=e.i(632781),d=e.i(856522),c=e.i(890714),c=c,u=e.i(435184),p=e.i(714513),m=e.i(508734),f=e.i(573474),h=e.i(566595),x=e.i(786563),g=e.i(217878),g=g,y=e.i(824694),y=y,b=e.i(756679),b=b,v=e.i(196699),j=e.i(235965),k=e.i(519455),N=e.i(793479),w=e.i(110204),S=e.i(975157);function M(){return{colors:{background:"240 20% 7%",foreground:"240 5% 96%",primary:"36 82% 47%",primaryForeground:"240 20% 7%",secondary:"240 12% 18%",secondaryForeground:"240 5% 96%",accent:"36 82% 47%",accentForeground:"240 20% 7%",muted:"240 10% 15%",mutedForeground:"240 5% 55%",card:"240 15% 11%",cardForeground:"240 5% 96%",border:"240 10% 18%",input:"240 10% 14%",ring:"36 82% 47%",destructive:"0 72% 51%",destructiveForeground:"0 0% 98%"},typography:{fontSans:"Inter, sans-serif",fontSerif:"Playfair Display, serif",fontMono:"JetBrains Mono, monospace",baseFontSize:"16px",lineHeight:"1.6"},spacing:{radius:"0.75rem",containerMaxWidth:"80rem"},custom:{}}}function C(e){let t=M();try{let r=JSON.parse(e);return{colors:{...t.colors,...r.colors||{}},lightColors:r.lightColors?{...t.colors,...r.lightColors}:void 0,darkColors:r.darkColors?{...t.colors,...r.darkColors}:void 0,typography:{...t.typography,...r.typography||{}},spacing:{...t.spacing,...r.spacing||{}},custom:r.custom||{}}}catch{return t}}var $=e.i(95187);let L=(0,$.createServerReference)("40fc8287535c514744bf050f489c80b78f2b517bae",$.callServer,void 0,$.findSourceMapURL,"saveTheme"),F=(0,$.createServerReference)("4064e41cc0857f390c46374824dbb2a0c8a69d3c01",$.callServer,void 0,$.findSourceMapURL,"activateTheme"),T=(0,$.createServerReference)("40bf86678b28d2d4e1b00d380d586ee4e2a013925e",$.callServer,void 0,$.findSourceMapURL,"importTheme"),R=(0,$.createServerReference)("40b723ed39b83027664342440f714dc651726d3c23",$.callServer,void 0,$.findSourceMapURL,"duplicateTheme"),P=(0,$.createServerReference)("406a081c58cd1c8fc33d4e319bc2c608934e1ba9b0",$.callServer,void 0,$.findSourceMapURL,"deleteTheme");var I=e.i(277464);let z=[{key:"background",label:"Background"},{key:"foreground",label:"Foreground"},{key:"primary",label:"Primary (Brand)"},{key:"primaryForeground",label:"Primary Foreground"},{key:"secondary",label:"Secondary"},{key:"secondaryForeground",label:"Secondary Foreground"},{key:"accent",label:"Accent"},{key:"accentForeground",label:"Accent Foreground"},{key:"muted",label:"Muted"},{key:"mutedForeground",label:"Muted Foreground"},{key:"card",label:"Card Background"},{key:"cardForeground",label:"Card Text"},{key:"border",label:"Border"},{key:"input",label:"Input Background"},{key:"destructive",label:"Destructive"}],E=["Inter","Playfair Display","Montserrat","Outfit","Roboto","Poppins","Lora","Merriweather","Lato","Oswald"];e.s(["default",0,function({themes:e,activeThemeId:$}){let D=(0,a.useRouter)(),[B,A]=(0,r.useState)(e),[O,U]=(0,r.useState)($),[H,_]=(0,r.useState)(M()),[V,J]=(0,r.useState)("My Custom Theme"),[W,q]=(0,r.useState)("my-custom-theme"),[G,K]=(0,r.useState)("colors"),[X,Y]=(0,r.useState)(""),[Q,Z]=(0,r.useTransition)(),[ee,et]=(0,r.useState)(""),[er,es]=(0,r.useState)(null),[ea,eo]=(0,r.useState)(!1),[el,en]=(0,r.useState)("light"),[ei,ed]=(0,r.useState)(""),[ec,eu]=(0,r.useState)(["Inter","Playfair Display"]),[ep,em]=(0,r.useState)("desktop");(0,r.useEffect)(()=>{A(e);let t=e.find(e=>e.id===O||"1"===String(e.is_active)||!0===e.is_active);t&&(_(C(t.tokens)),J(t.name),q(t.slug))},[e,O]),(0,r.useEffect)(()=>{let e,t,r,s,a,o,l,n,i;Y((e=H.colors||{},t=H.lightColors||e,r=H.darkColors||e,s=H.typography||{},a=H.spacing||{},o=H.custom||{},n=[...(l=e=>[`--background: ${e.background};`,`--foreground: ${e.foreground};`,`--primary: ${e.primary};`,`--primary-foreground: ${e.primaryForeground};`,`--secondary: ${e.secondary};`,`--secondary-foreground: ${e.secondaryForeground};`,`--accent: ${e.accent};`,`--accent-foreground: ${e.accentForeground};`,`--muted: ${e.muted};`,`--muted-foreground: ${e.mutedForeground};`,`--card: ${e.card};`,`--card-foreground: ${e.cardForeground};`,`--popover: ${e.card};`,`--popover-foreground: ${e.cardForeground};`,`--border: ${e.border};`,`--input: ${e.input};`,`--ring: ${e.ring};`,`--destructive: ${e.destructive};`,`--destructive-foreground: ${e.destructiveForeground};`,`--gold: ${e.primary};`,`--gold-light: ${e.accent};`,"--whatsapp: 142 70% 45%;","--whatsapp-hover: 142 70% 35%;"])(t),`--radius: ${a.radius};`,`--font-sans: ${s.fontSans};`,`--font-serif: ${s.fontSerif};`,`--font-mono: ${s.fontMono};`,`--container-max-width: ${a.containerMaxWidth};`,...Object.entries(o).map(([e,t])=>`--${e}: ${t};`)],i=l(r),`:root {
|
|
9
|
+
`),()=>{m.current?.removeAttribute("data-motion-pop-id"),v.contains(b)&&v.removeChild(b)}},[a]),(0,t.jsx)(u,{isPresent:a,childRef:m,sizeRef:h,pop:n,children:!1===n?e:i.cloneElement(e,{ref:g})})}let f=({children:e,initial:a,isPresent:n,onExitComplete:i,custom:d,presenceAffectsLayout:c,mode:u,anchorX:f,anchorY:h,root:x})=>{let g=(0,s.useConstant)(m),y=(0,r.useId)(),b=(0,r.useRef)(n),v=(0,r.useRef)(i);(0,o.useIsomorphicLayoutEffect)(()=>{b.current=n,v.current=i});let j=!0,k=(0,r.useMemo)(()=>(j=!1,{id:y,initial:a,isPresent:n,custom:d,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;i&&i()},register:e=>(g.set(e,!1),()=>{g.delete(e),b.current||g.size||v.current?.()})}),[n,g,i]);return c&&j&&(k={...k}),(0,r.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[n]),r.useEffect(()=>{n||g.size||!i||i()},[n]),e=(0,t.jsx)(p,{pop:"popLayout"===u,isPresent:n,anchorX:f,anchorY:h,root:x,children:e}),(0,t.jsx)(l.PresenceContext.Provider,{value:k,children:e})};function m(){return new Map}var h=e.i(464978);let x=e=>e.key||"";function g(e){let t=[];return r.Children.forEach(e,e=>{(0,r.isValidElement)(e)&&t.push(e)}),t}e.s(["AnimatePresence",0,({children:e,custom:l,initial:n=!0,onExitComplete:i,presenceAffectsLayout:d=!0,mode:c="sync",propagate:u=!1,anchorX:p="left",anchorY:m="top",root:y})=>{let[b,v]=(0,h.usePresence)(u),j=(0,r.useMemo)(()=>g(e),[e]),k=u&&!b?[]:j.map(x),N=(0,r.useRef)(!0),w=(0,r.useRef)(j),S=(0,s.useConstant)(()=>new Map),M=(0,r.useRef)(new Set),[C,$]=(0,r.useState)(j),[L,F]=(0,r.useState)(j);(0,o.useIsomorphicLayoutEffect)(()=>{N.current=!1,w.current=j;for(let e=0;e<L.length;e++){let t=x(L[e]);k.includes(t)?(S.delete(t),M.current.delete(t)):!0!==S.get(t)&&S.set(t,!1)}},[L,k.length,k.join("-")]);let T=[];if(j!==C){let e=[...j];for(let t=0;t<L.length;t++){let r=L[t],a=x(r);k.includes(a)||(e.splice(t,0,r),T.push(r))}return"wait"===c&&T.length&&(e=T),F(g(e)),$(j),null}let{forceRender:R}=(0,r.useContext)(a.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:L.map(e=>{let r=x(e),a=(!u||!!b)&&(j===L||k.includes(r));return(0,t.jsx)(f,{isPresent:a,initial:(!N.current||!!n)&&void 0,custom:l,presenceAffectsLayout:d,mode:c,root:y,onExitComplete:a?void 0:()=>{if(M.current.has(r)||!S.has(r))return;M.current.add(r),S.set(r,!0);let e=!0;S.forEach(t=>{t||(e=!1)}),e&&(R?.(),F(w.current),u&&v?.(),i&&i())},anchorX:p,anchorY:m,children:e},r)})})}],88653)},755566,e=>{"use strict";let t=(0,e.i(456420).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},343420,e=>{"use strict";let t=(0,e.i(456420).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},352627,e=>{"use strict";let t=(0,e.i(456420).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",0,t])},277464,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(846932),s=e.i(88653),o=e.i(755566),o=o,l=e.i(343420),l=l,n=e.i(352627),n=n,i=e.i(975157),d=e.i(519455);function c({open:e,title:u,description:p,confirmLabel:f="Confirm",cancelLabel:m="Cancel",variant:h="danger",onConfirm:x,onCancel:g,isLoading:y=!1}){let b=(0,r.useRef)(null);(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&g()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,g]);let v={danger:(0,t.jsx)(n.default,{className:"h-10 w-10 text-destructive"}),warning:(0,t.jsx)(o.default,{className:"h-10 w-10 text-amber-500"}),info:(0,t.jsx)(l.default,{className:"h-10 w-10 text-primary"})};return(0,t.jsx)(s.AnimatePresence,{children:e&&(0,t.jsx)(a.motion.div,{ref:b,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},onClick:e=>{e.target===b.current&&g()},children:(0,t.jsx)(a.motion.div,{initial:{scale:.92,opacity:0,y:16},animate:{scale:1,opacity:1,y:0},exit:{scale:.92,opacity:0,y:16},transition:{type:"spring",stiffness:400,damping:30},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[v[h],(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:u}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-muted-foreground leading-relaxed",children:p})]}),(0,t.jsxs)("div",{className:"flex w-full gap-3 mt-2",children:[(0,t.jsx)(d.Button,{variant:"outline",className:"flex-1",onClick:g,disabled:y,children:m}),(0,t.jsx)(d.Button,{variant:{danger:"destructive",warning:"default",info:"default"}[h],className:(0,i.cn)("flex-1","info"===h&&"btn-gold"),onClick:x,disabled:y,children:y?(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),"Processing…"]}):f})]})]})})})})}e.s(["DeleteDialog",0,function({open:e,entityName:r,entityType:a="item",onConfirm:s,onCancel:o,isLoading:l=!1}){return(0,t.jsx)(c,{open:e,title:`Delete ${a}`,description:`Are you absolutely sure you want to delete "${r}"? This action cannot be undone and all associated data will be permanently removed.`,confirmLabel:"Delete Permanently",cancelLabel:"Keep it",variant:"danger",onConfirm:s,onCancel:o,isLoading:l})},"ProgressDialog",0,function({open:e,title:r,description:o,progress:l,status:n}){return(0,t.jsx)(s.AnimatePresence,{children:e&&(0,t.jsx)(a.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},children:(0,t.jsxs)(a.motion.div,{initial:{scale:.92,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.92,opacity:0},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-1",children:r}),o&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-5",children:o}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:n??"Processing…"}),(0,t.jsxs)("span",{children:[Math.round(l),"%"]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-secondary overflow-hidden",children:(0,t.jsx)(a.motion.div,{className:"h-full rounded-full bg-primary",initial:{width:0},animate:{width:`${l}%`},transition:{duration:.3}})})]})]})})})}],277464)},566595,630299,e=>{"use strict";let t=(0,e.i(456420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,t],630299),e.s(["Search",0,t],566595)},484479,e=>{"use strict";let t=(0,e.i(456420).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",0,t])},526347,e=>{"use strict";let t=(0,e.i(456420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["default",0,t])},844071,e=>{"use strict";let t=(0,e.i(456420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["default",0,t])},906815,e=>{"use strict";let t=(0,e.i(456420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["default",0,t])},773219,e=>{"use strict";let t=(0,e.i(456420).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);e.s(["default",0,t])},890714,e=>{"use strict";let t=(0,e.i(456420).default)("droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);e.s(["default",0,t])},85604,e=>{"use strict";let t=(0,e.i(456420).default)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]);e.s(["default",0,t])},217878,e=>{"use strict";let t=(0,e.i(456420).default)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);e.s(["default",0,t])},824694,e=>{"use strict";let t=(0,e.i(456420).default)("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);e.s(["default",0,t])},756679,e=>{"use strict";let t=(0,e.i(456420).default)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);e.s(["default",0,t])},762368,e=>{"use strict";var t=e.i(484479);e.s(["Download",()=>t.default])},508734,e=>{"use strict";var t=e.i(526347);e.s(["Copy",()=>t.default])},196699,e=>{"use strict";var t=e.i(844071);e.s(["Moon",()=>t.default])},235965,e=>{"use strict";var t=e.i(906815);e.s(["Sun",()=>t.default])},714513,e=>{"use strict";var t=e.i(773219);e.s(["Layout",()=>t.default])},435184,e=>{"use strict";var t=e.i(85604);e.s(["Type",()=>t.default])},436150,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(846696),s=e.i(618566),o=e.i(950786),l=e.i(762368),n=e.i(725981),i=e.i(632781),d=e.i(856522),c=e.i(890714),c=c,u=e.i(435184),p=e.i(714513),f=e.i(508734),m=e.i(573474),h=e.i(566595),x=e.i(786563),g=e.i(217878),g=g,y=e.i(824694),y=y,b=e.i(756679),b=b,v=e.i(196699),j=e.i(235965),k=e.i(519455),N=e.i(793479),w=e.i(110204),S=e.i(975157);function M(){return{colors:{background:"240 20% 7%",foreground:"240 5% 96%",primary:"36 82% 47%",primaryForeground:"240 20% 7%",secondary:"240 12% 18%",secondaryForeground:"240 5% 96%",accent:"36 82% 47%",accentForeground:"240 20% 7%",muted:"240 10% 15%",mutedForeground:"240 5% 55%",card:"240 15% 11%",cardForeground:"240 5% 96%",border:"240 10% 18%",input:"240 10% 14%",ring:"36 82% 47%",destructive:"0 72% 51%",destructiveForeground:"0 0% 98%"},typography:{fontSans:"Inter, sans-serif",fontSerif:"Playfair Display, serif",fontMono:"JetBrains Mono, monospace",baseFontSize:"16px",lineHeight:"1.6"},spacing:{radius:"0.75rem",containerMaxWidth:"80rem"},custom:{}}}function C(e){let t=M();try{let r=JSON.parse(e);return{colors:{...t.colors,...r.colors||{}},lightColors:r.lightColors?{...t.colors,...r.lightColors}:void 0,darkColors:r.darkColors?{...t.colors,...r.darkColors}:void 0,typography:{...t.typography,...r.typography||{}},spacing:{...t.spacing,...r.spacing||{}},custom:r.custom||{}}}catch{return t}}var $=e.i(95187);let L=(0,$.createServerReference)("40c7f9ce9f9f66174ff0ebc3af96bbd73bf75e22e5",$.callServer,void 0,$.findSourceMapURL,"saveTheme"),F=(0,$.createServerReference)("40684e26f1f57404931991a6db47c96dd6d2ad9159",$.callServer,void 0,$.findSourceMapURL,"activateTheme"),T=(0,$.createServerReference)("40430f0a1f096d5e662f37dff5ac62db2fd0956d35",$.callServer,void 0,$.findSourceMapURL,"importTheme"),R=(0,$.createServerReference)("4076bff9e18505081df3bf9a381be6f5afcf4f81c5",$.callServer,void 0,$.findSourceMapURL,"duplicateTheme"),P=(0,$.createServerReference)("40db76e57f0ba5e9fdbc949d502bc19e2d9b028e14",$.callServer,void 0,$.findSourceMapURL,"deleteTheme");var I=e.i(277464);let z=[{key:"background",label:"Background"},{key:"foreground",label:"Foreground"},{key:"primary",label:"Primary (Brand)"},{key:"primaryForeground",label:"Primary Foreground"},{key:"secondary",label:"Secondary"},{key:"secondaryForeground",label:"Secondary Foreground"},{key:"accent",label:"Accent"},{key:"accentForeground",label:"Accent Foreground"},{key:"muted",label:"Muted"},{key:"mutedForeground",label:"Muted Foreground"},{key:"card",label:"Card Background"},{key:"cardForeground",label:"Card Text"},{key:"border",label:"Border"},{key:"input",label:"Input Background"},{key:"destructive",label:"Destructive"}],E=["Inter","Playfair Display","Montserrat","Outfit","Roboto","Poppins","Lora","Merriweather","Lato","Oswald"];e.s(["default",0,function({themes:e,activeThemeId:$}){let D=(0,s.useRouter)(),[B,A]=(0,r.useState)(e),[O,U]=(0,r.useState)($),[H,_]=(0,r.useState)(M()),[V,J]=(0,r.useState)("My Custom Theme"),[W,q]=(0,r.useState)("my-custom-theme"),[G,K]=(0,r.useState)("colors"),[X,Y]=(0,r.useState)(""),[Q,Z]=(0,r.useTransition)(),[ee,et]=(0,r.useState)(""),[er,ea]=(0,r.useState)(null),[es,eo]=(0,r.useState)(!1),[el,en]=(0,r.useState)("light"),[ei,ed]=(0,r.useState)(""),[ec,eu]=(0,r.useState)(["Inter","Playfair Display"]),[ep,ef]=(0,r.useState)("desktop");(0,r.useEffect)(()=>{A(e);let t=e.find(e=>e.id===O||"1"===String(e.is_active)||!0===e.is_active);t&&(_(C(t.tokens)),J(t.name),q(t.slug))},[e,O]),(0,r.useEffect)(()=>{let e,t,r,a,s,o,l,n,i;Y((e=H.colors||{},t=H.lightColors||e,r=H.darkColors||e,a=H.typography||{},s=H.spacing||{},o=H.custom||{},n=[...(l=e=>[`--background: ${e.background};`,`--foreground: ${e.foreground};`,`--primary: ${e.primary};`,`--primary-foreground: ${e.primaryForeground};`,`--secondary: ${e.secondary};`,`--secondary-foreground: ${e.secondaryForeground};`,`--accent: ${e.accent};`,`--accent-foreground: ${e.accentForeground};`,`--muted: ${e.muted};`,`--muted-foreground: ${e.mutedForeground};`,`--card: ${e.card};`,`--card-foreground: ${e.cardForeground};`,`--popover: ${e.card};`,`--popover-foreground: ${e.cardForeground};`,`--border: ${e.border};`,`--input: ${e.input};`,`--ring: ${e.ring};`,`--destructive: ${e.destructive};`,`--destructive-foreground: ${e.destructiveForeground};`,`--gold: ${e.primary};`,`--gold-light: ${e.accent};`,"--whatsapp: 142 70% 45%;","--whatsapp-hover: 142 70% 35%;"])(t),`--radius: ${s.radius};`,`--font-sans: ${a.fontSans};`,`--font-serif: ${a.fontSerif};`,`--font-mono: ${a.fontMono};`,`--container-max-width: ${s.containerMaxWidth};`,...Object.entries(o).map(([e,t])=>`--${e}: ${t};`)],i=l(r),`:root {
|
|
10
10
|
${n.join("\n ")}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.dark {
|
|
14
14
|
${i.join("\n ")}
|
|
15
|
-
}`))},[H]);let ef=(e,t)=>{_(r=>{let s="light"===el?"lightColors":"darkColors",a=r[s]||{...r.colors};return{...r,colors:"light"===el?{...r.colors,[e]:t}:r.colors,[s]:{...a,[e]:t}}})},eh=(e,t)=>{_(r=>({...r,typography:{...r.typography,[e]:t}}))},ex=async e=>{let t=e.target.files?.[0];if(!t)return;let r=await t.text();et(""),Z(async()=>{let e=await T(r);if(e.success){s.toast.success("Theme imported");try{let e=JSON.parse(r);_({...M(),...e.tokens}),J(e.name),q(e.slug)}catch{}D.refresh()}else et(e.error??"Import failed"),s.toast.error(e.error??"Import failed")}),e.target.value=""},eg=async()=>{if(er){eo(!0);try{let e=await P(er.id);e.success?(s.toast.success("Theme deleted successfully"),es(null),D.refresh()):s.toast.error(e.error||"Failed to delete theme")}catch(e){s.toast.error(e.message||"An error occurred")}finally{eo(!1)}}},ey=e=>{eu(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eb=E.filter(e=>e.toLowerCase().includes(ei.toLowerCase())),ev="light"===el?H.lightColors||H.colors:H.darkColors||H.colors;return(0,t.jsxs)("div",{className:"flex h-[calc(100vh-64px)] overflow-hidden",children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:X}}),(0,t.jsxs)("div",{className:"w-80 border-r border-border bg-card/60 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-border",children:[(0,t.jsxs)("h2",{className:"text-sm font-bold text-foreground flex items-center gap-2",children:[(0,t.jsx)(o.Palette,{className:"h-4 w-4 text-primary"}),"Theme Builder"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Design tokens with Light/Dark support"})]}),(0,t.jsxs)("div",{className:"p-4 border-b border-border space-y-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:"Theme Name"}),(0,t.jsx)("input",{value:V,onChange:e=>{J(e.target.value),q(e.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-"))},className:"w-full px-3 py-2 text-sm bg-secondary/60 border border-border rounded-xl focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),(0,t.jsx)("div",{className:"flex border-b border-border",children:[{id:"colors",icon:c.default,label:"Colors"},{id:"typography",icon:u.Type,label:"Typography"},{id:"spacing",icon:p.Layout,label:"Space"}].map(({id:e,icon:r,label:s})=>(0,t.jsxs)("button",{onClick:()=>K(e),className:(0,S.cn)("flex-1 flex flex-col items-center gap-1 py-3 text-[10px] font-semibold uppercase tracking-wide transition-colors",G===e?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),s]},e))}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:["colors"===G&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex border border-border bg-secondary/30 rounded-xl p-0.5 mb-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>en("light"),className:(0,S.cn)("flex-1 py-1 text-[10px] font-bold rounded-lg uppercase flex items-center justify-center gap-1.5","light"===el?"bg-primary text-primary-foreground":"text-muted-foreground"),children:[(0,t.jsx)(j.Sun,{className:"w-3.5 h-3.5"})," Light Variant"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>en("dark"),className:(0,S.cn)("flex-1 py-1 text-[10px] font-bold rounded-lg uppercase flex items-center justify-center gap-1.5","dark"===el?"bg-primary text-primary-foreground":"text-muted-foreground"),children:[(0,t.jsx)(v.Moon,{className:"w-3.5 h-3.5"})," Dark Variant"]})]}),z.map(({key:e,label:r})=>{let s=function(e){if(!e)return"#000000";let t=e.trim().replace(/%/g,"").split(/\s+/),r=parseInt(t[0]||"0",10)/360,s=parseInt(t[1]||"0",10)/100,a=parseInt(t[2]||"0",10)/100,o=a,l=a,n=a;if(0!==s){let e=(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e,t=a<.5?a*(1+s):a+s-a*s,i=2*a-t;o=e(i,t,r+1/3),l=e(i,t,r),n=e(i,t,r-1/3)}let i=e=>{let t=Math.round(255*e).toString(16);return 1===t.length?"0"+t:t};return`#${i(o)}${i(l)}${i(n)}`}(ev[e]||H.colors[e]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] font-semibold uppercase tracking-wide text-muted-foreground mb-1",children:r}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"color",value:s,onChange:t=>ef(e,function(e){let t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,s=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,s),o=Math.min(t,r,s),l=0,n=0,i=(a+o)/2;if(a!==o){let e=a-o;switch(n=i>.5?e/(2-a-o):e/(a+o),a){case t:l=(r-s)/e+6*(r<s);break;case r:l=(s-t)/e+2;break;case s:l=(t-r)/e+4}l/=6}return`${Math.round(360*l)} ${Math.round(100*n)}% ${Math.round(100*i)}%`}(t.target.value)),className:"h-8 w-8 rounded-lg cursor-pointer border-0 bg-transparent shrink-0"}),(0,t.jsx)("input",{value:ev[e]||"",onChange:t=>ef(e,t.target.value),placeholder:"240 20% 7%",className:"flex-1 px-2 py-1.5 text-xs bg-secondary/60 border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-primary/30 font-mono"})]})]},e)})]}),"typography"===G&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex border border-border bg-secondary/30 rounded-xl p-0.5 mb-2",children:[{mode:"desktop",icon:y.default},{mode:"tablet",icon:b.default},{mode:"mobile",icon:g.default}].map(({mode:e,icon:r})=>(0,t.jsxs)("button",{type:"button",onClick:()=>em(e),className:(0,S.cn)("flex-1 py-1 text-[10px] font-bold rounded-lg uppercase flex items-center justify-center gap-1",ep===e?"bg-primary text-primary-foreground":"text-muted-foreground"),children:[(0,t.jsx)(r,{className:"w-3 h-3"})," ",e]},e))}),(0,t.jsxs)("div",{children:[(0,t.jsx)(w.Label,{className:"text-[10px] font-bold uppercase text-muted-foreground block mb-1",children:"Search Google Fonts"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(h.Search,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)(N.Input,{placeholder:"Search Google Fonts...",value:ei,onChange:e=>ed(e.target.value),className:"h-8 text-xs pl-8 bg-secondary/30 border border-border"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(w.Label,{className:"text-[10px] font-bold uppercase text-muted-foreground block",children:"Starred Fonts"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ec.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-primary/10 border border-primary/20 text-[10px] text-primary",children:[e,(0,t.jsx)(x.Star,{className:"w-3 h-3 fill-primary text-primary cursor-pointer",onClick:()=>ey(e)})]},e))})]}),(0,t.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto border border-border rounded-xl p-2 bg-secondary/15",children:eb.map(e=>{let r=ec.includes(e);return(0,t.jsxs)("div",{className:"flex items-center justify-between p-1 hover:bg-secondary/40 rounded",children:[(0,t.jsx)("span",{onClick:()=>eh("fontSans",`${e}, sans-serif`),style:{fontFamily:e},className:"text-xs cursor-pointer text-foreground",children:e}),(0,t.jsx)("button",{onClick:()=>ey(e),children:(0,t.jsx)(x.Star,{className:(0,S.cn)("w-3 h-3",r?"fill-primary text-primary":"text-muted-foreground")})})]},e)})}),[{key:"fontSans",label:"Sans Serif Font"},{key:"fontSerif",label:"Serif Font"},{key:"fontMono",label:"Monospace Font"},{key:"baseFontSize",label:"Base Font Size"},{key:"lineHeight",label:"Line Height"}].map(({key:e,label:r})=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"block text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:r}),(0,t.jsx)("input",{value:H.typography[e]||"",onChange:t=>eh(e,t.target.value),className:"w-full px-3 py-2 text-xs bg-secondary/60 border border-border rounded-xl focus:outline-none focus:ring-1 focus:ring-primary/30"})]},e))]}),"spacing"===G&&(0,t.jsx)(t.Fragment,{children:[{key:"radius",label:"Border Radius"},{key:"containerMaxWidth",label:"Max Container Width"}].map(({key:e,label:r})=>(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:r}),(0,t.jsx)("input",{value:H.spacing[e]||"",onChange:t=>{var r;return r=t.target.value,void _(t=>({...t,spacing:{...t.spacing,[e]:r}}))},className:"w-full px-3 py-2 text-xs bg-secondary/60 border border-border rounded-xl focus:outline-none focus:ring-1 focus:ring-primary/30"})]},e))})]}),(0,t.jsxs)("div",{className:"p-4 border-t border-border space-y-2",children:[(0,t.jsxs)(k.Button,{onClick:()=>{Z(async()=>{let e=await L({id:O,name:V,slug:W,tokens:JSON.stringify(H)});e.success?(s.toast.success("Theme saved successfully!"),D.refresh()):s.toast.error(e.error??"Save failed")})},disabled:Q,className:"btn-gold w-full gap-2",children:[Q?(0,t.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(d.Save,{className:"h-4 w-4"}),"Save Theme Tokens"]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(k.Button,{onClick:()=>{let e=new Blob([JSON.stringify({name:V,slug:W,tokens:H,version:"1.0",exportedAt:new Date().toISOString()},null,2)],{type:"application/json"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`theme-${W}.json`,r.click(),URL.revokeObjectURL(t),s.toast.success("Theme exported")},variant:"outline",size:"sm",className:"flex-1 gap-2",children:[(0,t.jsx)(l.Download,{className:"h-3.5 w-3.5"}),"Export"]}),(0,t.jsxs)("label",{className:"flex-1",children:[(0,t.jsx)("input",{type:"file",accept:".json",className:"sr-only",onChange:ex}),(0,t.jsxs)("span",{className:"flex items-center justify-center gap-2 px-3 py-2 text-xs font-medium rounded-lg border border-border hover:bg-secondary cursor-pointer transition-colors",children:[(0,t.jsx)(n.Upload,{className:"h-3.5 w-3.5"}),"Import"]})]})]}),ee&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:ee})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-6 space-y-8 bg-muted/10",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-muted-foreground mb-4",children:"Preset Themes"}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-4",children:B.filter(e=>e.is_system||"luxury-dark-gold"===e.slug).map(e=>{let r=C(e.tokens);return(0,t.jsxs)("button",{onClick:()=>{var t;let r;return t=e.slug,void(!(r=B.find(e=>e.slug===t))||(_(C(r.tokens)),J(r.name),q(r.slug),s.toast.success(`Loaded "${r.name}" preset`)))},className:"group relative flex flex-col gap-3 p-4 rounded-2xl border border-border hover:border-primary/45 transition-all text-left bg-card/45 hover:bg-card shadow",children:[(0,t.jsx)("div",{className:"flex gap-1 h-6 w-full",children:["background","primary","secondary","accent"].map(e=>(0,t.jsx)("div",{className:"flex-1 rounded-sm border border-border/20",style:{background:`hsl(${r.colors[e]})`}},e))}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-foreground",children:e.name}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-snug",children:e.description})]}),(0,t.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)("span",{className:"text-[10px] text-primary font-medium",children:"Load →"})})]},e.slug)})})]}),B.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-muted-foreground mb-4",children:"Installed Themes & Activation"}),(0,t.jsx)("div",{className:"space-y-3",children:B.map(e=>(0,t.jsxs)("div",{className:(0,S.cn)("flex items-center gap-4 p-4 rounded-2xl border transition-all",e.id===O?"border-primary/50 bg-primary/5 shadow-md":"border-border bg-card/40 hover:bg-card/65"),children:[(0,t.jsx)("div",{className:"flex gap-1 shrink-0",children:["background","primary","accent"].map(r=>{let s=C(e.tokens);return(0,t.jsx)("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{background:`hsl(${s.colors[r]})`}},r)})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:e.name}),e.id===O&&(0,t.jsx)("span",{className:"text-[9px] bg-emerald-500/10 text-emerald-400 border border-emerald-500/25 px-1.5 py-0.5 rounded-full font-bold uppercase tracking-wider",children:"Active"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description||`Theme slug: ${e.slug}`})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>{var t;return t=e.id,void Z(async()=>{let e=await R(t);e.success?(s.toast.success("Theme duplicated successfully"),D.refresh()):s.toast.error(e.error||"Failed to duplicate theme")})},disabled:Q,className:"p-1.5 rounded-lg hover:bg-secondary text-muted-foreground hover:text-foreground transition-colors",title:"Duplicate Theme",children:(0,t.jsx)(m.Copy,{className:"h-4 w-4"})}),e.id!==O&&(0,t.jsx)(k.Button,{onClick:()=>{var t;return t=e.id,void Z(async()=>{let e=await F(t);if(e.success){U(t),s.toast.success("Theme activated! Changes are live.");try{localStorage.setItem("propvault-active-theme-id",t),localStorage.setItem("propvault-active-theme-tokens",JSON.stringify(H)),window.dispatchEvent(new CustomEvent("propvault-theme-changed",{detail:{themeId:t}})),new BroadcastChannel("propvault-theme").postMessage({type:"theme-changed",themeId:t,tokens:H})}catch(e){console.error("Failed to trigger theme sync events:",e)}D.refresh()}else s.toast.error(e.error??"Failed to activate")})},size:"sm",variant:"gold-outline",className:"h-8 text-xs font-semibold",children:"Activate Theme"}),!e.is_system&&e.id!==O&&(0,t.jsx)("button",{onClick:()=>es(e),className:"p-1.5 rounded-lg hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",title:"Delete Theme",children:(0,t.jsx)(f.Trash2,{className:"h-4 w-4"})})]})]},e.id))})]})]}),er&&(0,t.jsx)(I.DeleteDialog,{open:!0,entityName:er.name,entityType:"Theme Preset",onConfirm:eg,onCancel:()=>es(null),isLoading:ea})]})}],436150)}]);
|
|
15
|
+
}`))},[H]);let em=(e,t)=>{_(r=>{let a="light"===el?"lightColors":"darkColors",s=r[a]||{...r.colors};return{...r,colors:"light"===el?{...r.colors,[e]:t}:r.colors,[a]:{...s,[e]:t}}})},eh=(e,t)=>{_(r=>({...r,typography:{...r.typography,[e]:t}}))},ex=async e=>{let t=e.target.files?.[0];if(!t)return;let r=await t.text();et(""),Z(async()=>{let e=await T(r);if(e.success){a.toast.success("Theme imported");try{let e=JSON.parse(r);_({...M(),...e.tokens}),J(e.name),q(e.slug)}catch{}D.refresh()}else et(e.error??"Import failed"),a.toast.error(e.error??"Import failed")}),e.target.value=""},eg=async()=>{if(er){eo(!0);try{let e=await P(er.id);e.success?(a.toast.success("Theme deleted successfully"),ea(null),D.refresh()):a.toast.error(e.error||"Failed to delete theme")}catch(e){a.toast.error(e.message||"An error occurred")}finally{eo(!1)}}},ey=e=>{eu(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eb=E.filter(e=>e.toLowerCase().includes(ei.toLowerCase())),ev="light"===el?H.lightColors||H.colors:H.darkColors||H.colors;return(0,t.jsxs)("div",{className:"flex h-[calc(100vh-64px)] overflow-hidden",children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:X}}),(0,t.jsxs)("div",{className:"w-80 border-r border-border bg-card/60 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-border",children:[(0,t.jsxs)("h2",{className:"text-sm font-bold text-foreground flex items-center gap-2",children:[(0,t.jsx)(o.Palette,{className:"h-4 w-4 text-primary"}),"Theme Builder"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Design tokens with Light/Dark support"})]}),(0,t.jsxs)("div",{className:"p-4 border-b border-border space-y-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:"Theme Name"}),(0,t.jsx)("input",{value:V,onChange:e=>{J(e.target.value),q(e.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-"))},className:"w-full px-3 py-2 text-sm bg-secondary/60 border border-border rounded-xl focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),(0,t.jsx)("div",{className:"flex border-b border-border",children:[{id:"colors",icon:c.default,label:"Colors"},{id:"typography",icon:u.Type,label:"Typography"},{id:"spacing",icon:p.Layout,label:"Space"}].map(({id:e,icon:r,label:a})=>(0,t.jsxs)("button",{onClick:()=>K(e),className:(0,S.cn)("flex-1 flex flex-col items-center gap-1 py-3 text-[10px] font-semibold uppercase tracking-wide transition-colors",G===e?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),a]},e))}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:["colors"===G&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex border border-border bg-secondary/30 rounded-xl p-0.5 mb-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>en("light"),className:(0,S.cn)("flex-1 py-1 text-[10px] font-bold rounded-lg uppercase flex items-center justify-center gap-1.5","light"===el?"bg-primary text-primary-foreground":"text-muted-foreground"),children:[(0,t.jsx)(j.Sun,{className:"w-3.5 h-3.5"})," Light Variant"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>en("dark"),className:(0,S.cn)("flex-1 py-1 text-[10px] font-bold rounded-lg uppercase flex items-center justify-center gap-1.5","dark"===el?"bg-primary text-primary-foreground":"text-muted-foreground"),children:[(0,t.jsx)(v.Moon,{className:"w-3.5 h-3.5"})," Dark Variant"]})]}),z.map(({key:e,label:r})=>{let a=function(e){if(!e)return"#000000";let t=e.trim().replace(/%/g,"").split(/\s+/),r=parseInt(t[0]||"0",10)/360,a=parseInt(t[1]||"0",10)/100,s=parseInt(t[2]||"0",10)/100,o=s,l=s,n=s;if(0!==a){let e=(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e,t=s<.5?s*(1+a):s+a-s*a,i=2*s-t;o=e(i,t,r+1/3),l=e(i,t,r),n=e(i,t,r-1/3)}let i=e=>{let t=Math.round(255*e).toString(16);return 1===t.length?"0"+t:t};return`#${i(o)}${i(l)}${i(n)}`}(ev[e]||H.colors[e]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] font-semibold uppercase tracking-wide text-muted-foreground mb-1",children:r}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"color",value:a,onChange:t=>em(e,function(e){let t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,s=Math.max(t,r,a),o=Math.min(t,r,a),l=0,n=0,i=(s+o)/2;if(s!==o){let e=s-o;switch(n=i>.5?e/(2-s-o):e/(s+o),s){case t:l=(r-a)/e+6*(r<a);break;case r:l=(a-t)/e+2;break;case a:l=(t-r)/e+4}l/=6}return`${Math.round(360*l)} ${Math.round(100*n)}% ${Math.round(100*i)}%`}(t.target.value)),className:"h-8 w-8 rounded-lg cursor-pointer border-0 bg-transparent shrink-0"}),(0,t.jsx)("input",{value:ev[e]||"",onChange:t=>em(e,t.target.value),placeholder:"240 20% 7%",className:"flex-1 px-2 py-1.5 text-xs bg-secondary/60 border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-primary/30 font-mono"})]})]},e)})]}),"typography"===G&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex border border-border bg-secondary/30 rounded-xl p-0.5 mb-2",children:[{mode:"desktop",icon:y.default},{mode:"tablet",icon:b.default},{mode:"mobile",icon:g.default}].map(({mode:e,icon:r})=>(0,t.jsxs)("button",{type:"button",onClick:()=>ef(e),className:(0,S.cn)("flex-1 py-1 text-[10px] font-bold rounded-lg uppercase flex items-center justify-center gap-1",ep===e?"bg-primary text-primary-foreground":"text-muted-foreground"),children:[(0,t.jsx)(r,{className:"w-3 h-3"})," ",e]},e))}),(0,t.jsxs)("div",{children:[(0,t.jsx)(w.Label,{className:"text-[10px] font-bold uppercase text-muted-foreground block mb-1",children:"Search Google Fonts"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(h.Search,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)(N.Input,{placeholder:"Search Google Fonts...",value:ei,onChange:e=>ed(e.target.value),className:"h-8 text-xs pl-8 bg-secondary/30 border border-border"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(w.Label,{className:"text-[10px] font-bold uppercase text-muted-foreground block",children:"Starred Fonts"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ec.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-primary/10 border border-primary/20 text-[10px] text-primary",children:[e,(0,t.jsx)(x.Star,{className:"w-3 h-3 fill-primary text-primary cursor-pointer",onClick:()=>ey(e)})]},e))})]}),(0,t.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto border border-border rounded-xl p-2 bg-secondary/15",children:eb.map(e=>{let r=ec.includes(e);return(0,t.jsxs)("div",{className:"flex items-center justify-between p-1 hover:bg-secondary/40 rounded",children:[(0,t.jsx)("span",{onClick:()=>eh("fontSans",`${e}, sans-serif`),style:{fontFamily:e},className:"text-xs cursor-pointer text-foreground",children:e}),(0,t.jsx)("button",{onClick:()=>ey(e),children:(0,t.jsx)(x.Star,{className:(0,S.cn)("w-3 h-3",r?"fill-primary text-primary":"text-muted-foreground")})})]},e)})}),[{key:"fontSans",label:"Sans Serif Font"},{key:"fontSerif",label:"Serif Font"},{key:"fontMono",label:"Monospace Font"},{key:"baseFontSize",label:"Base Font Size"},{key:"lineHeight",label:"Line Height"}].map(({key:e,label:r})=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"block text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:r}),(0,t.jsx)("input",{value:H.typography[e]||"",onChange:t=>eh(e,t.target.value),className:"w-full px-3 py-2 text-xs bg-secondary/60 border border-border rounded-xl focus:outline-none focus:ring-1 focus:ring-primary/30"})]},e))]}),"spacing"===G&&(0,t.jsx)(t.Fragment,{children:[{key:"radius",label:"Border Radius"},{key:"containerMaxWidth",label:"Max Container Width"}].map(({key:e,label:r})=>(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:r}),(0,t.jsx)("input",{value:H.spacing[e]||"",onChange:t=>{var r;return r=t.target.value,void _(t=>({...t,spacing:{...t.spacing,[e]:r}}))},className:"w-full px-3 py-2 text-xs bg-secondary/60 border border-border rounded-xl focus:outline-none focus:ring-1 focus:ring-primary/30"})]},e))})]}),(0,t.jsxs)("div",{className:"p-4 border-t border-border space-y-2",children:[(0,t.jsxs)(k.Button,{onClick:()=>{Z(async()=>{let e=await L({id:O,name:V,slug:W,tokens:JSON.stringify(H)});e.success?(a.toast.success("Theme saved successfully!"),D.refresh()):a.toast.error(e.error??"Save failed")})},disabled:Q,className:"btn-gold w-full gap-2",children:[Q?(0,t.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(d.Save,{className:"h-4 w-4"}),"Save Theme Tokens"]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(k.Button,{onClick:()=>{let e=new Blob([JSON.stringify({name:V,slug:W,tokens:H,version:"1.0",exportedAt:new Date().toISOString()},null,2)],{type:"application/json"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`theme-${W}.json`,r.click(),URL.revokeObjectURL(t),a.toast.success("Theme exported")},variant:"outline",size:"sm",className:"flex-1 gap-2",children:[(0,t.jsx)(l.Download,{className:"h-3.5 w-3.5"}),"Export"]}),(0,t.jsxs)("label",{className:"flex-1",children:[(0,t.jsx)("input",{type:"file",accept:".json",className:"sr-only",onChange:ex}),(0,t.jsxs)("span",{className:"flex items-center justify-center gap-2 px-3 py-2 text-xs font-medium rounded-lg border border-border hover:bg-secondary cursor-pointer transition-colors",children:[(0,t.jsx)(n.Upload,{className:"h-3.5 w-3.5"}),"Import"]})]})]}),ee&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:ee})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-6 space-y-8 bg-muted/10",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-muted-foreground mb-4",children:"Preset Themes"}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-4",children:B.filter(e=>e.is_system||"luxury-dark-gold"===e.slug).map(e=>{let r=C(e.tokens);return(0,t.jsxs)("button",{onClick:()=>{var t;let r;return t=e.slug,void(!(r=B.find(e=>e.slug===t))||(_(C(r.tokens)),J(r.name),q(r.slug),a.toast.success(`Loaded "${r.name}" preset`)))},className:"group relative flex flex-col gap-3 p-4 rounded-2xl border border-border hover:border-primary/45 transition-all text-left bg-card/45 hover:bg-card shadow",children:[(0,t.jsx)("div",{className:"flex gap-1 h-6 w-full",children:["background","primary","secondary","accent"].map(e=>(0,t.jsx)("div",{className:"flex-1 rounded-sm border border-border/20",style:{background:`hsl(${r.colors[e]})`}},e))}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-foreground",children:e.name}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-snug",children:e.description})]}),(0,t.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)("span",{className:"text-[10px] text-primary font-medium",children:"Load →"})})]},e.slug)})})]}),B.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-muted-foreground mb-4",children:"Installed Themes & Activation"}),(0,t.jsx)("div",{className:"space-y-3",children:B.map(e=>(0,t.jsxs)("div",{className:(0,S.cn)("flex items-center gap-4 p-4 rounded-2xl border transition-all",e.id===O?"border-primary/50 bg-primary/5 shadow-md":"border-border bg-card/40 hover:bg-card/65"),children:[(0,t.jsx)("div",{className:"flex gap-1 shrink-0",children:["background","primary","accent"].map(r=>{let a=C(e.tokens);return(0,t.jsx)("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{background:`hsl(${a.colors[r]})`}},r)})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:e.name}),e.id===O&&(0,t.jsx)("span",{className:"text-[9px] bg-emerald-500/10 text-emerald-400 border border-emerald-500/25 px-1.5 py-0.5 rounded-full font-bold uppercase tracking-wider",children:"Active"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description||`Theme slug: ${e.slug}`})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>{var t;return t=e.id,void Z(async()=>{let e=await R(t);e.success?(a.toast.success("Theme duplicated successfully"),D.refresh()):a.toast.error(e.error||"Failed to duplicate theme")})},disabled:Q,className:"p-1.5 rounded-lg hover:bg-secondary text-muted-foreground hover:text-foreground transition-colors",title:"Duplicate Theme",children:(0,t.jsx)(f.Copy,{className:"h-4 w-4"})}),e.id!==O&&(0,t.jsx)(k.Button,{onClick:()=>{var t;return t=e.id,void Z(async()=>{let e=await F(t);if(e.success){U(t),a.toast.success("Theme activated! Changes are live.");try{localStorage.setItem("propvault-active-theme-id",t),localStorage.setItem("propvault-active-theme-tokens",JSON.stringify(H)),window.dispatchEvent(new CustomEvent("propvault-theme-changed",{detail:{themeId:t}})),new BroadcastChannel("propvault-theme").postMessage({type:"theme-changed",themeId:t,tokens:H})}catch(e){console.error("Failed to trigger theme sync events:",e)}D.refresh()}else a.toast.error(e.error??"Failed to activate")})},size:"sm",variant:"gold-outline",className:"h-8 text-xs font-semibold",children:"Activate Theme"}),!e.is_system&&e.id!==O&&(0,t.jsx)("button",{onClick:()=>ea(e),className:"p-1.5 rounded-lg hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",title:"Delete Theme",children:(0,t.jsx)(m.Trash2,{className:"h-4 w-4"})})]})]},e.id))})]})]}),er&&(0,t.jsx)(I.DeleteDialog,{open:!0,entityName:er.name,entityType:"Theme Preset",onConfirm:eg,onCancel:()=>ea(null),isLoading:es})]})}],436150)}]);
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
${g}px !important;
|
|
7
7
|
${v}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{h.current?.removeAttribute("data-motion-pop-id"),b.contains(y)&&b.removeChild(y)}},[n]),(0,t.jsx)(u,{isPresent:n,childRef:h,sizeRef:m,pop:o,children:!1===o?e:l.cloneElement(e,{ref:g})})}let p=({children:e,initial:n,isPresent:o,onExitComplete:l,custom:c,presenceAffectsLayout:d,mode:u,anchorX:p,anchorY:m,root:x})=>{let g=(0,i.useConstant)(h),v=(0,r.useId)(),y=(0,r.useRef)(o),b=(0,r.useRef)(l);(0,s.useIsomorphicLayoutEffect)(()=>{y.current=o,b.current=l});let j=!0,w=(0,r.useMemo)(()=>(j=!1,{id:v,initial:n,isPresent:o,custom:c,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;l&&l()},register:e=>(g.set(e,!1),()=>{g.delete(e),y.current||g.size||b.current?.()})}),[o,g,l]);return d&&j&&(w={...w}),(0,r.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[o]),r.useEffect(()=>{o||g.size||!l||l()},[o]),e=(0,t.jsx)(f,{pop:"popLayout"===u,isPresent:o,anchorX:p,anchorY:m,root:x,children:e}),(0,t.jsx)(a.PresenceContext.Provider,{value:w,children:e})};function h(){return new Map}var m=e.i(464978);let x=e=>e.key||"";function g(e){let t=[];return r.Children.forEach(e,e=>{(0,r.isValidElement)(e)&&t.push(e)}),t}e.s(["AnimatePresence",0,({children:e,custom:a,initial:o=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1,anchorX:f="left",anchorY:h="top",root:v})=>{let[y,b]=(0,m.usePresence)(u),j=(0,r.useMemo)(()=>g(e),[e]),w=u&&!y?[]:j.map(x),k=(0,r.useRef)(!0),N=(0,r.useRef)(j),C=(0,i.useConstant)(()=>new Map),P=(0,r.useRef)(new Set),[M,R]=(0,r.useState)(j),[L,S]=(0,r.useState)(j);(0,s.useIsomorphicLayoutEffect)(()=>{k.current=!1,N.current=j;for(let e=0;e<L.length;e++){let t=x(L[e]);w.includes(t)?(C.delete(t),P.current.delete(t)):!0!==C.get(t)&&C.set(t,!1)}},[L,w.length,w.join("-")]);let E=[];if(j!==M){let e=[...j];for(let t=0;t<L.length;t++){let r=L[t],n=x(r);w.includes(n)||(e.splice(t,0,r),E.push(r))}return"wait"===d&&E.length&&(e=E),S(g(e)),R(j),null}let{forceRender:$}=(0,r.useContext)(n.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:L.map(e=>{let r=x(e),n=(!u||!!y)&&(j===L||w.includes(r));return(0,t.jsx)(p,{isPresent:n,initial:(!k.current||!!o)&&void 0,custom:a,presenceAffectsLayout:c,mode:d,root:v,onExitComplete:n?void 0:()=>{if(P.current.has(r)||!C.has(r))return;P.current.add(r),C.set(r,!0);let e=!0;C.forEach(t=>{t||(e=!1)}),e&&($?.(),S(N.current),u&&b?.(),l&&l())},anchorX:f,anchorY:h,children:e},r)})})}],88653)},755566,e=>{"use strict";let t=(0,e.i(456420).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},343420,e=>{"use strict";let t=(0,e.i(456420).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},352627,e=>{"use strict";let t=(0,e.i(456420).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",0,t])},277464,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(846932),i=e.i(88653),s=e.i(755566),s=s,a=e.i(343420),a=a,o=e.i(352627),o=o,l=e.i(975157),c=e.i(519455);function d({open:e,title:u,description:f,confirmLabel:p="Confirm",cancelLabel:h="Cancel",variant:m="danger",onConfirm:x,onCancel:g,isLoading:v=!1}){let y=(0,r.useRef)(null);(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&g()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,g]);let b={danger:(0,t.jsx)(o.default,{className:"h-10 w-10 text-destructive"}),warning:(0,t.jsx)(s.default,{className:"h-10 w-10 text-amber-500"}),info:(0,t.jsx)(a.default,{className:"h-10 w-10 text-primary"})};return(0,t.jsx)(i.AnimatePresence,{children:e&&(0,t.jsx)(n.motion.div,{ref:y,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},onClick:e=>{e.target===y.current&&g()},children:(0,t.jsx)(n.motion.div,{initial:{scale:.92,opacity:0,y:16},animate:{scale:1,opacity:1,y:0},exit:{scale:.92,opacity:0,y:16},transition:{type:"spring",stiffness:400,damping:30},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[b[m],(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:u}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-muted-foreground leading-relaxed",children:f})]}),(0,t.jsxs)("div",{className:"flex w-full gap-3 mt-2",children:[(0,t.jsx)(c.Button,{variant:"outline",className:"flex-1",onClick:g,disabled:v,children:h}),(0,t.jsx)(c.Button,{variant:{danger:"destructive",warning:"default",info:"default"}[m],className:(0,l.cn)("flex-1","info"===m&&"btn-gold"),onClick:x,disabled:v,children:v?(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),"Processing…"]}):p})]})]})})})})}e.s(["DeleteDialog",0,function({open:e,entityName:r,entityType:n="item",onConfirm:i,onCancel:s,isLoading:a=!1}){return(0,t.jsx)(d,{open:e,title:`Delete ${n}`,description:`Are you absolutely sure you want to delete "${r}"? This action cannot be undone and all associated data will be permanently removed.`,confirmLabel:"Delete Permanently",cancelLabel:"Keep it",variant:"danger",onConfirm:i,onCancel:s,isLoading:a})},"ProgressDialog",0,function({open:e,title:r,description:s,progress:a,status:o}){return(0,t.jsx)(i.AnimatePresence,{children:e&&(0,t.jsx)(n.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},children:(0,t.jsxs)(n.motion.div,{initial:{scale:.92,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.92,opacity:0},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-1",children:r}),s&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-5",children:s}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:o??"Processing…"}),(0,t.jsxs)("span",{children:[Math.round(a),"%"]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-secondary overflow-hidden",children:(0,t.jsx)(n.motion.div,{className:"h-full rounded-full bg-primary",initial:{width:0},animate:{width:`${a}%`},transition:{duration:.3}})})]})]})})})}],277464)},507310,e=>{"use strict";var t=e.i(843476),r=e.i(573474),n=e.i(632781),i=e.i(271645),s=e.i(618566),a=e.i(846696),o=e.i(95187);let l=(0,o.createServerReference)("
|
|
9
|
+
`),()=>{h.current?.removeAttribute("data-motion-pop-id"),b.contains(y)&&b.removeChild(y)}},[n]),(0,t.jsx)(u,{isPresent:n,childRef:h,sizeRef:m,pop:o,children:!1===o?e:l.cloneElement(e,{ref:g})})}let p=({children:e,initial:n,isPresent:o,onExitComplete:l,custom:c,presenceAffectsLayout:d,mode:u,anchorX:p,anchorY:m,root:x})=>{let g=(0,i.useConstant)(h),v=(0,r.useId)(),y=(0,r.useRef)(o),b=(0,r.useRef)(l);(0,s.useIsomorphicLayoutEffect)(()=>{y.current=o,b.current=l});let j=!0,w=(0,r.useMemo)(()=>(j=!1,{id:v,initial:n,isPresent:o,custom:c,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;l&&l()},register:e=>(g.set(e,!1),()=>{g.delete(e),y.current||g.size||b.current?.()})}),[o,g,l]);return d&&j&&(w={...w}),(0,r.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[o]),r.useEffect(()=>{o||g.size||!l||l()},[o]),e=(0,t.jsx)(f,{pop:"popLayout"===u,isPresent:o,anchorX:p,anchorY:m,root:x,children:e}),(0,t.jsx)(a.PresenceContext.Provider,{value:w,children:e})};function h(){return new Map}var m=e.i(464978);let x=e=>e.key||"";function g(e){let t=[];return r.Children.forEach(e,e=>{(0,r.isValidElement)(e)&&t.push(e)}),t}e.s(["AnimatePresence",0,({children:e,custom:a,initial:o=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1,anchorX:f="left",anchorY:h="top",root:v})=>{let[y,b]=(0,m.usePresence)(u),j=(0,r.useMemo)(()=>g(e),[e]),w=u&&!y?[]:j.map(x),k=(0,r.useRef)(!0),N=(0,r.useRef)(j),C=(0,i.useConstant)(()=>new Map),P=(0,r.useRef)(new Set),[M,R]=(0,r.useState)(j),[L,S]=(0,r.useState)(j);(0,s.useIsomorphicLayoutEffect)(()=>{k.current=!1,N.current=j;for(let e=0;e<L.length;e++){let t=x(L[e]);w.includes(t)?(C.delete(t),P.current.delete(t)):!0!==C.get(t)&&C.set(t,!1)}},[L,w.length,w.join("-")]);let E=[];if(j!==M){let e=[...j];for(let t=0;t<L.length;t++){let r=L[t],n=x(r);w.includes(n)||(e.splice(t,0,r),E.push(r))}return"wait"===d&&E.length&&(e=E),S(g(e)),R(j),null}let{forceRender:$}=(0,r.useContext)(n.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:L.map(e=>{let r=x(e),n=(!u||!!y)&&(j===L||w.includes(r));return(0,t.jsx)(p,{isPresent:n,initial:(!k.current||!!o)&&void 0,custom:a,presenceAffectsLayout:c,mode:d,root:v,onExitComplete:n?void 0:()=>{if(P.current.has(r)||!C.has(r))return;P.current.add(r),C.set(r,!0);let e=!0;C.forEach(t=>{t||(e=!1)}),e&&($?.(),S(N.current),u&&b?.(),l&&l())},anchorX:f,anchorY:h,children:e},r)})})}],88653)},755566,e=>{"use strict";let t=(0,e.i(456420).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},343420,e=>{"use strict";let t=(0,e.i(456420).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},352627,e=>{"use strict";let t=(0,e.i(456420).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",0,t])},277464,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(846932),i=e.i(88653),s=e.i(755566),s=s,a=e.i(343420),a=a,o=e.i(352627),o=o,l=e.i(975157),c=e.i(519455);function d({open:e,title:u,description:f,confirmLabel:p="Confirm",cancelLabel:h="Cancel",variant:m="danger",onConfirm:x,onCancel:g,isLoading:v=!1}){let y=(0,r.useRef)(null);(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&g()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,g]);let b={danger:(0,t.jsx)(o.default,{className:"h-10 w-10 text-destructive"}),warning:(0,t.jsx)(s.default,{className:"h-10 w-10 text-amber-500"}),info:(0,t.jsx)(a.default,{className:"h-10 w-10 text-primary"})};return(0,t.jsx)(i.AnimatePresence,{children:e&&(0,t.jsx)(n.motion.div,{ref:y,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},onClick:e=>{e.target===y.current&&g()},children:(0,t.jsx)(n.motion.div,{initial:{scale:.92,opacity:0,y:16},animate:{scale:1,opacity:1,y:0},exit:{scale:.92,opacity:0,y:16},transition:{type:"spring",stiffness:400,damping:30},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[b[m],(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:u}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-muted-foreground leading-relaxed",children:f})]}),(0,t.jsxs)("div",{className:"flex w-full gap-3 mt-2",children:[(0,t.jsx)(c.Button,{variant:"outline",className:"flex-1",onClick:g,disabled:v,children:h}),(0,t.jsx)(c.Button,{variant:{danger:"destructive",warning:"default",info:"default"}[m],className:(0,l.cn)("flex-1","info"===m&&"btn-gold"),onClick:x,disabled:v,children:v?(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),"Processing…"]}):p})]})]})})})})}e.s(["DeleteDialog",0,function({open:e,entityName:r,entityType:n="item",onConfirm:i,onCancel:s,isLoading:a=!1}){return(0,t.jsx)(d,{open:e,title:`Delete ${n}`,description:`Are you absolutely sure you want to delete "${r}"? This action cannot be undone and all associated data will be permanently removed.`,confirmLabel:"Delete Permanently",cancelLabel:"Keep it",variant:"danger",onConfirm:i,onCancel:s,isLoading:a})},"ProgressDialog",0,function({open:e,title:r,description:s,progress:a,status:o}){return(0,t.jsx)(i.AnimatePresence,{children:e&&(0,t.jsx)(n.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},children:(0,t.jsxs)(n.motion.div,{initial:{scale:.92,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.92,opacity:0},className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-2xl",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-1",children:r}),s&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-5",children:s}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:o??"Processing…"}),(0,t.jsxs)("span",{children:[Math.round(a),"%"]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-secondary overflow-hidden",children:(0,t.jsx)(n.motion.div,{className:"h-full rounded-full bg-primary",initial:{width:0},animate:{width:`${a}%`},transition:{duration:.3}})})]})]})})})}],277464)},507310,e=>{"use strict";var t=e.i(843476),r=e.i(573474),n=e.i(632781),i=e.i(271645),s=e.i(618566),a=e.i(846696),o=e.i(95187);let l=(0,o.createServerReference)("40e50956a159cfbe0e9aba415579f05efc61bda66a",o.callServer,void 0,o.findSourceMapURL,"deletePage"),c=(0,o.createServerReference)("4006e6f11f76d02f219834540fcb997a0792370a6e",o.callServer,void 0,o.findSourceMapURL,"restorePage");var d=e.i(277464);e.s(["DeletePageButton",0,function({pageId:e,pageTitle:o}){let[u,f]=(0,i.useState)(!1),[p,h]=(0,i.useState)(!1),m=(0,s.useRouter)(),x=async()=>{f(!0),h(!1);try{let t=await l(e);if(t.success){let e=t.data;a.toast.success("Page deleted successfully",{duration:6e3,action:{label:"Undo",onClick:async()=>{try{let t=await c(e);t.success?(a.toast.success("Page restored successfully"),m.refresh()):a.toast.error(t.error||"Failed to restore page")}catch(e){a.toast.error(e.message||"Failed to restore page")}}}}),m.refresh()}else a.toast.error(t.error||"Failed to delete page")}catch(e){a.toast.error(e.message||"Failed to delete page")}finally{f(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>h(!0),disabled:u,className:"h-7 w-7 rounded-lg hover:bg-destructive/10 flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors disabled:opacity-50",title:"Delete Page",children:u?(0,t.jsx)(n.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(r.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(d.DeleteDialog,{open:p,entityName:o,entityType:"page",onConfirm:x,onCancel:()=>h(!1),isLoading:u})]})}],507310)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,793479,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(975157);let r=a.forwardRef(({className:e,type:a,...r},l)=>(0,t.jsx)("input",{type:a,className:(0,s.cn)("flex h-10 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:l,...r}));r.displayName="Input",e.s(["Input",0,r])},519455,225913,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(991918),r=e.i(207670);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=r.clsx,d=(e,t)=>a=>{var s;if((null==t?void 0:t.variants)==null)return i(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:r,defaultVariants:d}=t,o=Object.keys(r).map(e=>{let t=null==a?void 0:a[e],s=null==d?void 0:d[e];if(null===t)return null;let i=l(t)||l(s);return r[e][i]}),n=a&&Object.entries(a).reduce((e,t)=>{let[a,s]=t;return void 0===s||(e[a]=s),e},{});return i(e,o,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:a,className:s,...r}=t;return Object.entries(r).every(e=>{let[t,a]=e;return Array.isArray(a)?a.includes({...d,...n}[t]):({...d,...n})[t]===a})?[...e,a,s]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)};e.s(["cva",0,d],225913);var o=e.i(975157);let n=d("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent hover:bg-secondary/50 hover:text-foreground text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-secondary/50 hover:text-foreground text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",gold:"bg-gradient-to-r from-[hsl(36,82%,47%)] to-[hsl(42,88%,65%)] text-[hsl(240,20%,7%)] font-semibold hover:opacity-90 active:scale-[0.98] shadow-[0_4px_14px_0_hsl(36,82%,47%,0.4)]","gold-outline":"border border-[hsl(36,82%,47%,0.5)] text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)] hover:border-[hsl(36,82%,47%)]","gold-ghost":"text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)]"},size:{default:"h-10 px-5 py-2",xs:"h-7 px-3 text-xs rounded-lg",sm:"h-9 px-4 text-sm",lg:"h-12 px-8 text-base",xl:"h-14 px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),c=a.forwardRef(({className:e,variant:a,size:r,asChild:l=!1,...i},d)=>{let c=l?s.Slot:"button";return(0,t.jsx)(c,{className:(0,o.cn)(n({variant:a,size:r,className:e})),ref:d,...i})});c.displayName="Button",e.s(["Button",0,c],519455)},632781,758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t],758379),e.s(["Loader2",0,t],632781)},95187,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var s={callServer:function(){return l.callServer},createServerReference:function(){return d.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var r in s)Object.defineProperty(a,r,{enumerable:!0,get:s[r]});let l=e.r(132120),i=e.r(92245),d=e.r(235326)},110204,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(248425),r=a.forwardRef((e,a)=>(0,t.jsx)(s.Primitive.label,{...e,ref:a,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));r.displayName="Label";var l=e.i(975157);let i=a.forwardRef(({className:e,...a},s)=>(0,t.jsx)(r,{ref:s,className:(0,l.cn)("text-sm font-medium text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...a}));i.displayName=r.displayName,e.s(["Label",0,i],110204)},624687,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(975157);let r=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-colors",e),ref:r,...a}));r.displayName="Textarea",e.s(["Textarea",0,r])},96315,290135,e=>{"use strict";let t=(0,e.i(456420).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["default",0,t],290135),e.s(["Mail",0,t],96315)},869860,e=>{"use strict";let t=(0,e.i(456420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["default",0,t])},856522,e=>{"use strict";var t=e.i(869860);e.s(["Save",()=>t.default])},127012,e=>{"use strict";let t=(0,e.i(456420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["default",0,t])},77071,e=>{"use strict";var t=e.i(127012);e.s(["Plus",()=>t.default])},19955,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(846696),r=e.i(96315),l=e.i(77071),i=e.i(632781),d=e.i(856522),o=e.i(519455),n=e.i(793479),c=e.i(110204),u=e.i(624687),m=e.i(95187);let x=(0,m.createServerReference)("00b10623c9f2dd5239eade6c2618ccadc046f08a1f",m.callServer,void 0,m.findSourceMapURL,"getEmailTemplates"),p=(0,m.createServerReference)("40366c16402ef1d69b9b2c0657421e97fe0dfbdbd8",m.callServer,void 0,m.findSourceMapURL,"saveEmailTemplate");e.s(["default",0,function(){let[e,m]=(0,a.useState)([]),[f,v]=(0,a.useState)(!0),[h,b]=(0,a.useState)(null),[g,y]=(0,a.useTransition)(),j=async()=>{try{let e=await x();e.success&&e.data&&(m(e.data),e.data.length>0&&!h&&b(e.data[0]))}finally{v(!1)}};return(0,a.useEffect)(()=>{j()},[]),(0,t.jsxs)("div",{className:"p-6 lg:p-8 space-y-6 max-w-6xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h1",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[(0,t.jsx)(r.Mail,{className:"h-6 w-6 text-primary"}),"Email Templates"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Configure and customize automated email notifications."})]}),(0,t.jsxs)(o.Button,{onClick:()=>{b({id:"",name:"New Email Template",slug:"new-email-template",subject:"Welcome to PropVault",html_body:"<h1>Welcome!</h1><p>We are glad to have you.</p>",text_body:"Welcome! We are glad to have you.",variables:"user_name, company_name",description:"Sent to new users when they register",is_active:!0})},className:"btn-gold gap-2",children:[(0,t.jsx)(l.Plus,{className:"h-4 w-4"}),"Add Template"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Templates"}),f?(0,t.jsx)("div",{className:"h-24 shimmer rounded-xl"}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsx)("button",{onClick:()=>b(e),className:`w-full flex items-center justify-between p-3.5 rounded-xl border text-left transition-all ${h?.id===e.id?"border-primary/50 bg-primary/5 text-foreground":"border-border hover:border-primary/20 bg-card/40 hover:bg-card text-muted-foreground hover:text-foreground"}`,children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-semibold",children:e.name}),(0,t.jsxs)("p",{className:"text-[10px] opacity-70 mt-0.5",children:["Slug: ",e.slug]})]})},e.id))})]}),(0,t.jsx)("div",{className:"md:col-span-2 space-y-4",children:h?(0,t.jsxs)("div",{className:"p-6 rounded-2xl border border-border bg-card/40 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"font-semibold text-foreground",children:h.id?"Edit Template":"New Template"}),(0,t.jsxs)(o.Button,{onClick:()=>{if(h){if(!h.name.trim()||!h.slug.trim())return void s.toast.error("Name and Slug are required");y(async()=>{let e=await p({...h,is_active:"1"===h.is_active||1===h.is_active||!0===h.is_active});e.success?(s.toast.success("Email template saved successfully"),j()):s.toast.error(e.error??"Failed to save template")})}},disabled:g,className:"btn-gold gap-2 h-9",children:[g?(0,t.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(d.Save,{className:"h-4 w-4"}),"Save Template"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Name"}),(0,t.jsx)(n.Input,{value:h.name,onChange:e=>b(t=>t&&{...t,name:e.target.value})})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Slug"}),(0,t.jsx)(n.Input,{value:h.slug,onChange:e=>b(t=>t&&{...t,slug:e.target.value})})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Email Subject"}),(0,t.jsx)(n.Input,{value:h.subject,onChange:e=>b(t=>t&&{...t,subject:e.target.value})})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsxs)(c.Label,{children:["Variables ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(comma-separated)"})]}),(0,t.jsx)(n.Input,{value:h.variables,onChange:e=>b(t=>t&&{...t,variables:e.target.value}),placeholder:"user_name, reset_url"})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"HTML Body"}),(0,t.jsx)(u.Textarea,{value:h.html_body,onChange:e=>b(t=>t&&{...t,html_body:e.target.value}),className:"font-mono text-xs min-h-[160px] resize-y"})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Plain Text Body"}),(0,t.jsx)(u.Textarea,{value:h.text_body,onChange:e=>b(t=>t&&{...t,text_body:e.target.value}),className:"text-xs min-h-[100px] resize-y"})]})]})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center p-12 border border-border rounded-2xl bg-card/10 text-center",children:[(0,t.jsx)(r.Mail,{className:"h-10 w-10 text-muted-foreground mb-3"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:'Select a template or click "Add Template" to create one.'})]})})]})]})}],19955)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,793479,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(975157);let r=a.forwardRef(({className:e,type:a,...r},l)=>(0,t.jsx)("input",{type:a,className:(0,s.cn)("flex h-10 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:l,...r}));r.displayName="Input",e.s(["Input",0,r])},519455,225913,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(991918),r=e.i(207670);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=r.clsx,o=(e,t)=>a=>{var s;if((null==t?void 0:t.variants)==null)return i(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:r,defaultVariants:o}=t,n=Object.keys(r).map(e=>{let t=null==a?void 0:a[e],s=null==o?void 0:o[e];if(null===t)return null;let i=l(t)||l(s);return r[e][i]}),d=a&&Object.entries(a).reduce((e,t)=>{let[a,s]=t;return void 0===s||(e[a]=s),e},{});return i(e,n,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:a,className:s,...r}=t;return Object.entries(r).every(e=>{let[t,a]=e;return Array.isArray(a)?a.includes({...o,...d}[t]):({...o,...d})[t]===a})?[...e,a,s]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)};e.s(["cva",0,o],225913);var n=e.i(975157);let d=o("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent hover:bg-secondary/50 hover:text-foreground text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-secondary/50 hover:text-foreground text-muted-foreground",link:"text-primary underline-offset-4 hover:underline",gold:"bg-gradient-to-r from-[hsl(36,82%,47%)] to-[hsl(42,88%,65%)] text-[hsl(240,20%,7%)] font-semibold hover:opacity-90 active:scale-[0.98] shadow-[0_4px_14px_0_hsl(36,82%,47%,0.4)]","gold-outline":"border border-[hsl(36,82%,47%,0.5)] text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)] hover:border-[hsl(36,82%,47%)]","gold-ghost":"text-[hsl(36,82%,47%)] bg-transparent hover:bg-[hsl(36,82%,47%,0.1)]"},size:{default:"h-10 px-5 py-2",xs:"h-7 px-3 text-xs rounded-lg",sm:"h-9 px-4 text-sm",lg:"h-12 px-8 text-base",xl:"h-14 px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-9 w-9","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),c=a.forwardRef(({className:e,variant:a,size:r,asChild:l=!1,...i},o)=>{let c=l?s.Slot:"button";return(0,t.jsx)(c,{className:(0,n.cn)(d({variant:a,size:r,className:e})),ref:o,...i})});c.displayName="Button",e.s(["Button",0,c],519455)},632781,758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t],758379),e.s(["Loader2",0,t],632781)},95187,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var s={callServer:function(){return l.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var r in s)Object.defineProperty(a,r,{enumerable:!0,get:s[r]});let l=e.r(132120),i=e.r(92245),o=e.r(235326)},110204,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(248425),r=a.forwardRef((e,a)=>(0,t.jsx)(s.Primitive.label,{...e,ref:a,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));r.displayName="Label";var l=e.i(975157);let i=a.forwardRef(({className:e,...a},s)=>(0,t.jsx)(r,{ref:s,className:(0,l.cn)("text-sm font-medium text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...a}));i.displayName=r.displayName,e.s(["Label",0,i],110204)},624687,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(975157);let r=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 resize-none transition-colors",e),ref:r,...a}));r.displayName="Textarea",e.s(["Textarea",0,r])},96315,290135,e=>{"use strict";let t=(0,e.i(456420).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["default",0,t],290135),e.s(["Mail",0,t],96315)},869860,e=>{"use strict";let t=(0,e.i(456420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["default",0,t])},856522,e=>{"use strict";var t=e.i(869860);e.s(["Save",()=>t.default])},127012,e=>{"use strict";let t=(0,e.i(456420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["default",0,t])},77071,e=>{"use strict";var t=e.i(127012);e.s(["Plus",()=>t.default])},19955,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(846696),r=e.i(96315),l=e.i(77071),i=e.i(632781),o=e.i(856522),n=e.i(519455),d=e.i(793479),c=e.i(110204),u=e.i(624687),m=e.i(95187);let x=(0,m.createServerReference)("00114fe810594e9aa29b06992aaee6e03ed2e7e0ea",m.callServer,void 0,m.findSourceMapURL,"getEmailTemplates"),p=(0,m.createServerReference)("40fcd155bc44aac31fd33539b9523032b00d4189e5",m.callServer,void 0,m.findSourceMapURL,"saveEmailTemplate");e.s(["default",0,function(){let[e,m]=(0,a.useState)([]),[v,f]=(0,a.useState)(!0),[h,b]=(0,a.useState)(null),[g,y]=(0,a.useTransition)(),j=async()=>{try{let e=await x();e.success&&e.data&&(m(e.data),e.data.length>0&&!h&&b(e.data[0]))}finally{f(!1)}};return(0,a.useEffect)(()=>{j()},[]),(0,t.jsxs)("div",{className:"p-6 lg:p-8 space-y-6 max-w-6xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h1",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[(0,t.jsx)(r.Mail,{className:"h-6 w-6 text-primary"}),"Email Templates"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Configure and customize automated email notifications."})]}),(0,t.jsxs)(n.Button,{onClick:()=>{b({id:"",name:"New Email Template",slug:"new-email-template",subject:"Welcome to PropVault",html_body:"<h1>Welcome!</h1><p>We are glad to have you.</p>",text_body:"Welcome! We are glad to have you.",variables:"user_name, company_name",description:"Sent to new users when they register",is_active:!0})},className:"btn-gold gap-2",children:[(0,t.jsx)(l.Plus,{className:"h-4 w-4"}),"Add Template"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Templates"}),v?(0,t.jsx)("div",{className:"h-24 shimmer rounded-xl"}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsx)("button",{onClick:()=>b(e),className:`w-full flex items-center justify-between p-3.5 rounded-xl border text-left transition-all ${h?.id===e.id?"border-primary/50 bg-primary/5 text-foreground":"border-border hover:border-primary/20 bg-card/40 hover:bg-card text-muted-foreground hover:text-foreground"}`,children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-semibold",children:e.name}),(0,t.jsxs)("p",{className:"text-[10px] opacity-70 mt-0.5",children:["Slug: ",e.slug]})]})},e.id))})]}),(0,t.jsx)("div",{className:"md:col-span-2 space-y-4",children:h?(0,t.jsxs)("div",{className:"p-6 rounded-2xl border border-border bg-card/40 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"font-semibold text-foreground",children:h.id?"Edit Template":"New Template"}),(0,t.jsxs)(n.Button,{onClick:()=>{if(h){if(!h.name.trim()||!h.slug.trim())return void s.toast.error("Name and Slug are required");y(async()=>{let e=await p({...h,is_active:"1"===h.is_active||1===h.is_active||!0===h.is_active});e.success?(s.toast.success("Email template saved successfully"),j()):s.toast.error(e.error??"Failed to save template")})}},disabled:g,className:"btn-gold gap-2 h-9",children:[g?(0,t.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(o.Save,{className:"h-4 w-4"}),"Save Template"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Name"}),(0,t.jsx)(d.Input,{value:h.name,onChange:e=>b(t=>t&&{...t,name:e.target.value})})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Slug"}),(0,t.jsx)(d.Input,{value:h.slug,onChange:e=>b(t=>t&&{...t,slug:e.target.value})})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Email Subject"}),(0,t.jsx)(d.Input,{value:h.subject,onChange:e=>b(t=>t&&{...t,subject:e.target.value})})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsxs)(c.Label,{children:["Variables ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"(comma-separated)"})]}),(0,t.jsx)(d.Input,{value:h.variables,onChange:e=>b(t=>t&&{...t,variables:e.target.value}),placeholder:"user_name, reset_url"})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"HTML Body"}),(0,t.jsx)(u.Textarea,{value:h.html_body,onChange:e=>b(t=>t&&{...t,html_body:e.target.value}),className:"font-mono text-xs min-h-[160px] resize-y"})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 space-y-1.5",children:[(0,t.jsx)(c.Label,{children:"Plain Text Body"}),(0,t.jsx)(u.Textarea,{value:h.text_body,onChange:e=>b(t=>t&&{...t,text_body:e.target.value}),className:"text-xs min-h-[100px] resize-y"})]})]})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center p-12 border border-border rounded-2xl bg-card/10 text-center",children:[(0,t.jsx)(r.Mail,{className:"h-10 w-10 text-muted-foreground mb-3"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:'Select a template or click "Add Template" to create one.'})]})})]})]})}],19955)}]);
|