PageSourceSearch

https://hiveminded.ai/_next/static/chunks/03-net~d7ndi8.js

js hiveminded.ai collected 2026-10-05 14:00:00 UTC 92,869 bytes, 6 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9fae5934-1e74-5d6d-8578-3067a3e1e39d")}catch(e){}}();
3(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,444443,e=>{"use strict";var t=e.i(373985),r=e.i(969912);e.s(["Skeleton",0,function({className:e,label:a="Loading...",...n}){return(0,t.jsx)("div",{role:"status","aria-busy":"true","aria-label":a,className:(0,r.cn)("rounded-lg bg-muted skeleton-shimmer",e),...n})}])},231664,e=>{"use strict";var t=e.i(373985),r=e.i(444443),a=e.i(969912);function n({className:e,children:s}){return s?(0,t.jsx)("div",{className:(0,a.cn)("border border-border rounded-lg p-6 space-y-4",e),children:s}):(0,t.jsxs)("div",{className:(0,a.cn)("border border-border rounded-lg p-6 space-y-4",e),children:[(0,t.jsx)(r.Skeleton,{className:"h-5 w-3/4"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-5/6"}),(0,t.jsxs)("div",{className:"flex gap-2 pt-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-8 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-8 w-20"})]})]})}function s({showAvatar:e=!1,className:n}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex items-center gap-4 p-4 border-b border-border",n),children:[e&&(0,t.jsx)(r.Skeleton,{className:"h-10 w-10 rounded-full"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-3/4"}),(0,t.jsx)(r.Skeleton,{className:"h-3 w-1/2"})]}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-16"})]})}function o({columns:e=4,className:n}){return(0,t.jsx)("tr",{className:(0,a.cn)("border-b border-border",n),children:Array.from({length:e}).map((e,a)=>(0,t.jsx)("td",{className:"p-4",children:(0,t.jsx)(r.Skeleton,{className:"h-4 w-full"})},a))})}function i({className:e}){return(0,t.jsxs)("div",{className:(0,a.cn)("border border-border rounded-lg p-6 space-y-3",e),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-4 rounded"})]}),(0,t.jsx)(r.Skeleton,{className:"h-8 w-16"}),(0,t.jsx)(r.Skeleton,{className:"h-3 w-32"})]})}function l({className:e}){return(0,t.jsxs)("div",{className:(0,a.cn)("space-y-2",e),children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-10 w-full rounded-lg"})]})}function c({showHeader:e=!0,showActions:s=!0,className:o}){return(0,t.jsxs)("div",{className:(0,a.cn)("space-y-6",o),children:[e&&(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(r.Skeleton,{className:"h-8 w-48"}),s&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-10 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-10 w-24"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array.from({length:6}).map((e,r)=>(0,t.jsx)(n,{},r))})]})}function d({className:e}){return(0,t.jsx)("div",{className:(0,a.cn)("border border-border rounded-lg p-6 space-y-4",e),children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-20 w-20 rounded-lg flex-shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-5 w-48"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-16 rounded-full"})]}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-3/4"}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-16"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-24"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-6 w-20 rounded-full"}),(0,t.jsx)(r.Skeleton,{className:"h-6 w-24 rounded-full"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-8 w-16"}),(0,t.jsx)(r.Skeleton,{className:"h-8 w-8"})]})]})]})})}function u({className:e}){return(0,t.jsx)("div",{className:(0,a.cn)("border border-border rounded-lg p-6 space-y-4",e),children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-20 w-20 rounded-lg flex-shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-5 w-56"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-20 rounded-full"}),(0,t.jsx)(r.Skeleton,{className:"h-5 w-24 rounded-full"})]}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-full"}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-28"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-16"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-8 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-8 w-14"}),(0,t.jsx)(r.Skeleton,{className:"h-8 w-18"})]}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-32"})]})]})})}function p({showSidebar:e=!0,className:n}
3){return(0,t.jsxs)("div",{className:(0,a.cn)("space-y-8",n),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-8 w-64"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-40"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-10 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-10 w-24"})]})]}),(0,t.jsxs)("div",{className:(0,a.cn)("grid gap-8",e?"grid-cols-1 lg:grid-cols-3":"grid-cols-1"),children:[(0,t.jsxs)("div",{className:(0,a.cn)("space-y-6",e&&"lg:col-span-2"),children:[(0,t.jsxs)("div",{className:"border border-border rounded-lg p-6 space-y-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-6 w-40"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-3/4"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-5/6"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-32"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-32"})]})]})]}),(0,t.jsx)(r.Skeleton,{className:"h-96 w-full rounded-lg"})]}),e&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"border border-border rounded-lg p-6 space-y-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-5 w-28"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-20"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-16"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)(r.Skeleton,{className:"h-4 w-24"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-20"})]})]})]}),(0,t.jsxs)("div",{className:"border border-border rounded-lg p-6 space-y-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-5 w-32"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(r.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(r.Skeleton,{className:"h-10 w-full"})]})]})]})]})]})}function m({height:e=300,className:n}){return(0,t.jsxs)("div",{className:(0,a.cn)("border border-border rounded-lg p-6 space-y-4",n),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(r.Skeleton,{className:"h-6 w-40"}),(0,t.jsx)(r.Skeleton,{className:"h-8 w-24"})]}),(0,t.jsx)(r.Skeleton,{className:"w-full rounded",style:{height:e}})]})}function f({className:e}){return(0,t.jsx)("div",{className:(0,a.cn)("border border-border rounded-lg p-4",e),children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(r.Skeleton,{className:"h-10 flex-1"}),(0,t.jsx)(r.Skeleton,{className:"h-10 w-32"})]})})}function g({columns:e=3,count:r=6,className:s}){return(0,t.jsx)("div",{className:(0,a.cn)("grid gap-4",{1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}[e]||"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",s),children:Array.from({length:r}).map((e,r)=>(0,t.jsx)(n,{},r))})}e.s(["CardSkeleton",0,n,"ChartSkeleton",0,m,"DetailPageSkeleton",0,p,"FormFieldSkeleton",0,l,"GridCardSkeleton",0,g,"ListItemSkeleton",0,s,"ListingCardSkeleton",0,u,"MetricCardSkeleton",0,i,"PageSkeleton",0,c,"ProductCardSkeleton",0,d,"SearchBarSkeleton",0,f,"StandardSkeleton",0,function({variant:e="card",className:r,columns:a,count:h,showAvatar:y,showHeader:v,showActions:b,showSidebar:x,height:w}
3){switch(e){case"list":return(0,t.jsx)(s,{showAvatar:y,className:r});case"table":return(0,t.jsx)(o,{columns:a,className:r});case"metric":return(0,t.jsx)(i,{className:r});case"form":return(0,t.jsx)(l,{className:r});case"page":return(0,t.jsx)(c,{showHeader:v,showActions:b,className:r});case"product":return(0,t.jsx)(d,{className:r});case"listing":return(0,t.jsx)(u,{className:r});case"detail":return(0,t.jsx)(p,{showSidebar:x,className:r});case"chart":return(0,t.jsx)(m,{height:w,className:r});case"search":return(0,t.jsx)(f,{className:r});case"grid":return(0,t.jsx)(g,{columns:a,count:h,className:r});default:return(0,t.jsx)(n,{className:r})}},"TableRowSkeleton",0,o])},653614,e=>{"use strict";let t=(0,e.i(182233).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],653614)},969912,e=>{"use strict";var t=e.i(505780),r=e.i(457287);function a(e,t={year:"numeric",month:"short",day:"numeric"},r){let n="string"==typeof e?new Date(e):e;return new Intl.DateTimeFormat(r,t).format(n)}function n(e){return"number"==typeof e&&Number.isFinite(e)}e.s(["cn",0,function(...e){return(0,r.twMerge)((0,t.clsx)(e))},"formatCurrency",0,function(e,t="USD",r){return new Intl.NumberFormat(r,{style:"currency",currency:t}).format(e)},"formatDate",0,a,"formatOptionalNumber",0,function(e,t,r){return n(e)?e.toFixed(t):r},"formatRelativeTime",0,function(e,t){let r="string"==typeof e?new Date(e):e,n=new Date().getTime()-r.getTime(),s=Math.floor(n/6e4),o=Math.floor(n/36e5),i=Math.floor(n/864e5);return s<1?"Just now":s<60?`${s} ${1===s?"minute":"minutes"} ago`:o<24?`${o} ${1===o?"hour":"hours"} ago`:i<7?`${i} ${1===i?"day":"days"} ago`:a(r,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},t)},"isFiniteNumber",0,n])},353463,848340,e=>{"use strict";var t=e.i(505780),r=e.i(457287);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx,s=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],n=null==i?void 0:i[e];if(null===t)return null;let s=a(t)||a(n);return o[e][s]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return n(e,l,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:a,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...c}[t]):({...i,...c})[t]===r})?[...e,r,a]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)};e.s(["cva",0,s],848340);var o=e.i(623955);function i(...e){return(0,r.twMerge)((0,t.clsx)(e))}var l=null,c=null,d=!1;function u(e,t="polite"){var r;if(!e.trim())return;let a="u">typeof document?document.activeElement:null,n=(r=t,"u"<typeof document?null:(!d&&"u">typeof document&&((l=document.createElement("div")).setAttribute("aria-live","polite"),l.setAttribute("aria-atomic","true"),l.className="sr-only absolute -left-[10000px] w-[1px] h-[1px] overflow-hidden",l.id="aria-live-polite-persistent",document.body.appendChild(l),(c=document.createElement("div")).setAttribute("aria-live","assertive"),c.setAttribute("aria-atomic","true"),c.className="sr-only absolute -left-[10000px] w-[1px] h-[1px] overflow-hidden",c.id="aria-live-assertive-persistent",document.body.appendChild(c),d=!0),"polite"===r?l:c));n&&(n.textContent="",setTimeout(()=>{if(n.textContent=e,"u">typeof document&&a&&document.activeElement!==a)try{a.focus()}catch{}},100))}var p=s("relative inline-flex items-center justify-center font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:cursor-not-allowed ring-offset-background active:scale-[0.98] group",{variants:{variant:{default:"bg-gradient-to-r from-primary-600 to-primary-500 text-primary-foreground shadow-md hover:shadow-lg hover:shadow-primary/25 hover:from-primary-700 hover:to-primary-600 border border-primary-700/20",primary:"bg-gradient-to-r from-primary-600 to-primary-500 text-primary-foreground shadow-md hover:shadow-lg hover:shadow-
3primary/25 hover:from-primary-700 hover:to-primary-600 border border-primary-700/20",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:shadow-md hover:bg-secondary/80 border border-border/50",outline:"border-2 border-primary/50 hover:bg-primary/10 hover:border-primary hover:text-primary-700 shadow-sm hover:shadow-md",ghost:"hover:bg-accent hover:text-accent-foreground hover:shadow-sm",link:"text-primary underline-offset-4 hover:underline hover:text-primary-600",destructive:"bg-gradient-to-r from-destructive to-red-500 text-destructive-foreground shadow-md hover:shadow-lg hover:shadow-destructive/25 hover:from-red-600 hover:to-destructive focus-visible:ring-destructive",gradient:"bg-gradient-to-r from-gradient-from via-gradient-via to-gradient-to text-white shadow-lg hover:shadow-xl hover:shadow-primary/30 border border-white/20 before:absolute before:inset-0 before:bg-gradient-to-r before:from-white/0 before:via-white/20 before:to-white/0 before:translate-x-[-200%] hover:before:translate-x-[200%] before:transition-transform before:duration-700 overflow-hidden",glass:"bg-white/10 backdrop-blur-md border border-white/20 hover:bg-white/20 hover:border-white/30 text-foreground shadow-lg"},size:{xs:"h-7 px-2.5 text-xs rounded-md gap-1",sm:"h-8 px-3 text-sm rounded-lg gap-1.5",md:"h-10 px-4 py-2 text-sm rounded-lg gap-2",lg:"h-12 px-6 text-base rounded-xl gap-2.5",xl:"h-14 px-8 text-lg rounded-xl gap-3",icon:"h-10 w-10 p-0 rounded-lg"},glow:{true:"shadow-glow hover:shadow-glow-lg",false:""}},defaultVariants:{variant:"default",size:"md",glow:!1}}),m=o.default.forwardRef(({className:e,variant:t,size:r,glow:a,loading:n,icon:s,iconPosition:l="left",loadingText:c,successText:d,ariaDescription:m,destructive:f=!1,announceStateChanges:g=!0,children:h,disabled:y,onClick:v,onKeyDown:b,"aria-label":x,"aria-describedby":w,...S},T)=>{let k=(0,o.useRef)(n),E=(0,o.useRef)(null),N=(0,o.useRef)(null);(0,o.useEffect)(()=>{g&&(n&&!k.current&&c&&u(c,"polite"),k.current=n)},[n,c,g]);let C=y||n,j=f&&"default"===t?"destructive":t,A={"aria-label":x,"aria-describedby":m?`${S.id||"button"}-description`:w,"aria-disabled":C?"true":"false","aria-busy":n?"true":"false",...f&&{"aria-description":"This action cannot be undone"}};return o.default.createElement(o.default.Fragment,null,o.default.createElement("button",{ref:e=>{E.current=e,"function"==typeof T?T(e):T&&(T.current=e)},type:S.type||"button",className:i(p({variant:j,size:r,glow:a}),n&&"cursor-wait",e),disabled:C,onMouseDown:()=>{"u">typeof document&&(N.current=document.activeElement)},onClick:e=>{let t=N.current||("u">typeof document?document.activeElement:null);if(!n&&!y&&(v?.(e),g&&d&&setTimeout(()=>{u(d,"polite")},500),t instanceof HTMLElement)){let e=t.tagName.toLowerCase();if("input"===e||"textarea"===e)try{t.focus()}catch{}}},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||n||y||(e.preventDefault(),E.current?.click()),b?.(e)},...A,...S},n&&o.default.createElement("span",{className:"absolute inset-0 flex items-center justify-center"},o.default.createElement("span",{className:"loading-spinner"})),o.default.createElement("span",{className:i("inline-flex items-center gap-2",n&&"invisible")},s&&"left"===l&&o.default.createElement("span",{className:"shrink-0 transition-transform duration-200 group-hover:scale-110","aria-hidden":"true"},s),h,s&&"right"===l&&o.default.createElement("span",{className:"shrink-0 transition-transform duration-200 group-hover:scale-110","aria-hidden":"true"},s))),m&&o.default.createElement("span",{id:`${S.id||"button"}-description`,className:"sr-only"},m))});m.displayName="Button";var f=s("relative overflow-hidden bg-card text-card-foreground transition-all duration-300",{variants:{variant:{default:"rounded-2xl border border-primary/20 shadow-lg hover:shadow-xl hover:-translate-y-1",glass:"rounded-2xl bg-card/80 backdrop-blur-md border border-primary/20 shadow-lg",gradient:"rounded-2xl bg-gradient-to-br from-card via-card to-accent/5 border border-primary/20 shadow-lg hover:shadow-xl hover:border-primary/30",elevated:"rounded-2xl bg-card shadow-xl hover:shadow-2xl border border-primary/10",outline:"rounded-2xl bg-transparent border-2 border-primary/30 hover:border-primary/50 hover:bg-card/50"},padding:{none:"",sm:"p-4",md:"p-6",lg:"p-8"},interactive:{true:"cursor-pointer active:scale-[0.99]",false:""}},defaultVariants:{variant:"default",padding:"none",interactive:!1}}),g=o.default.forwardRef(({className:e,variant:t,padding:r,interactive:a,hover:n,...s},l)=>o.default.createElement("div",{ref:l,className:i(f({variant:t,padding:r,interactive:a}),n&&"group",e),...s}));
3g.displayName="Card";var h=o.default.forwardRef(({className:e,...t},r)=>o.default.createElement("div",{ref:r,className:i("flex flex-col space-y-1.5 p-6",e),...t}));h.displayName="CardHeader";var y=o.default.forwardRef(({className:e,...t},r)=>o.default.createElement("h3",{ref:r,className:i("text-2xl font-semibold leading-none tracking-tight",e),...t}));y.displayName="CardTitle";var v=o.default.forwardRef(({className:e,...t},r)=>o.default.createElement("p",{ref:r,className:i("text-sm text-muted-foreground",e),...t}));v.displayName="CardDescription";var b=o.default.forwardRef(({className:e,...t},r)=>o.default.createElement("div",{ref:r,className:i("p-6 pt-0",e),...t}));b.displayName="CardContent";var x=o.default.forwardRef(({className:e,...t},r)=>o.default.createElement("div",{ref:r,className:i("flex items-center p-6 pt-0",e),...t}));x.displayName="CardFooter";var w=s("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800 hover:bg-green-200",warning:"border-transparent bg-yellow-100 text-yellow-800 hover:bg-yellow-200",info:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-200"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:t,...r}){return o.createElement("div",{className:i(w({variant:t}),e),...r})},"Button",0,m,"Card",0,g,"CardContent",0,b,"CardDescription",0,v,"CardFooter",0,x,"CardHeader",0,h,"CardTitle",0,y,"announceToScreenReader",0,u,"badgeVariants",0,w,"buttonVariants",0,p,"cn",0,i],353463)},453575,e=>{"use strict";let t=new class{isDevelopment=!1;isTest=!1;info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}debug(e,t){(this.isDevelopment||this.isTest)&&this.log("debug",e,t)}performance(e,t){this.isDevelopment&&this.log("info",`[Performance] ${e}`,t)}log(e,t,r){let a={level:e,message:t,data:r,timestamp:new Date};if(this.isDevelopment||this.isTest){let a="debug"===e?"log":e;console[a](`[${e.toUpperCase()}] ${t}`,r??"")}"error"!==e||this.isDevelopment||this.isTest||this.trackError(a)}trackError(e){let t=window;t.Sentry&&t.Sentry.captureException(Error(e.message),{extra:e.data,tags:{level:e.level}})}};e.s(["logger",0,t])},182233,e=>{"use strict";var t=e.i(623955);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:i="",children:l,iconNode:c,...d},u)=>(0,t.createElement)("svg",{ref:u,...n,width:r,height:r,stroke:e,strokeWidth:o?24*Number(s)/Number(r):s,className:a("lucide",i),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["default",0,(e,n)=>{let o=(0,t.forwardRef)(({className:o,...i},l)=>(0,t.createElement)(s,{ref:l,iconNode:n,className:a(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...i}));return o.displayName=r(e),o}],182233)},256781,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return n}});let a=e.r(623955);function n(e,t){let r=(0,a.useRef)(null),n=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=s(e,a)),t&&(n.current=s(t,a))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
3dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},752596,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},977027,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return y},useLinkStatus:function(){return b}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=e.r(889779),o=e.r(373985),i=s._(e.r(623955)),l=e.r(958330),c=e.r(721088),d=e.r(256781),u=e.r(51428),p=e.r(588481);e.r(581257);let m=e.r(588498),f=e.r(485842),g=e.r(115073),h=e.r(339028);function y(t){var r,a;let n,s,y,[b,x]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),w=(0,i.useRef)(null),{href:S,as:T,children:k,prefetch:E=null,passHref:N,replace:C,shallow:j,scroll:A,onClick:R,onMouseEnter:I,onTouchStart:L,legacyBehavior:P=!1,onNavigate:D,transitionTypes:F,ref:_,unstable_dynamicOnHover:M,...B}=t;n=k,P&&("string"==typeof n||"number"==typeof n)&&(n=(0,o.jsx)("a",{children:n}));let U=i.default.useContext(c.AppRouterContext),O=!1!==E,V=!1!==E?null===(a=E)||"auto"===a?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,W="string"==typeof(r=T||S)?r:(0,l.formatUrl)(r);if(P){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=i.default.Children.only(n)}let G=P?s&&"object"==typeof s&&s.ref:_,z=i.default.useCallback(e=>(null!==U&&(w.current=(0,f.mountLinkInstance)(e,W,U,V,O,x)),()=>{w.current&&((0,f.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,f.unmountPrefetchableInstance)(e)}),[O,W,U,V,x]),q={ref:(0,d.useMergedRef)(z,G),onClick(t){P||"function"!=typeof R||R(t),P&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!U||t.defaultPrevented||function(t,r,a,n,s,o,l){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){n&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(971341);i.default.startTransition(()=>{u(r,n?"replace":"push",!1===s?m.ScrollBehavior.NoScroll:m.ScrollBehavior.Default,a.current,l)})}}(t,W,w,C,A,D,F)},onMouseEnter(e){P||"function"!=typeof I||I(e),P&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),U&&O&&(0,f.onNavigationIntent)(e.currentTarget,!0===M)},onTouchStart:function(e){P||"function"!=typeof L||L(e),P&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),U&&O&&(0,f.onNavigationIntent)(e.currentTarget,!0===M)}};return(0,u.isAbsoluteUrl)(W)?q.href=W:P&&!N&&("a"!==s.type||"href"in s.props)||(q.href=(0,p.addBasePath)(W)),y=P?i.default.cloneElement(s,q):(0,o.jsx)("a",{...B,...q,children:n}),(0,o.jsx)(v.Provider,{value:b,children:y})}e.r(752596);let v=(0,i.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,i.useContext)(v);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},12724,e=>{"use strict";var t=e.i(373985),r=e.i(623955),a=e.i(653614),n=e.i(969912);let s={default:"bg-primary-500 hover:bg-primary-600 text-primary-foreground",secondary:"bg-secondary hover:bg-secondary/80 text-secondary-foreground",outline:"border border-border bg-background hover:bg-muted text-foreground",destructive:"bg-danger-600 hover:bg-danger-700 text-white",ghost:"hover:bg-muted text-foreground",link:"text-primary-600 hover:text-primary-700 underline-offset-4 hover:underline"},o={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-base",lg:"h-12 px-6 text-lg",icon:"h-10 w-10"},i={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5",icon:"w-4 h-4"},l=r.default.forwardRef(({className:e,variant:l="default",size:c="md",asChild:d,isLoading:u=!1,loadingText:p,leftIcon:m,rightIcon:f,disabled:g,children:h,...y},v)=>{let b=g||u,x=(0,n.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2","active:scale-[0.98]","disabled:opacity-50 disabled:pointer-events-none disabled:cursor-not-allowed",s[l],o[c],e);return d&&r.default.isValidElement(h)?r.default.cloneElement(h,{className:(0,n.cn)(x,h.props.className),ref:v}):(0,t.jsx)("button",{ref:v,"data-slot":"button",className:x,disabled:b,"aria-busy":u,"aria-disabled":b,...y,children:u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Loader2,{className:(0,n.cn)(i[c],"animate-spin"),"aria-hidden":"true"}),p||h]}):(0,t.jsxs)(t.Fragment,{children:[m&&(0,t.jsx)("span",{className:"inline-flex shrink-0","aria-hidden":"true",children:m}),h,f&&(0,t.jsx)("span",{className:"inline-flex shrink-0","aria-hidden":"true",children:f})]})})});l.displayName="Button";let c=r.default.forwardRef(({isSubmitting:e=!1,submittingText:r="Saving...",children:a="Save",...n},s)=>
3(0,t.jsx)(l,{ref:s,type:"submit",isLoading:e,loadingText:r,...n,children:a}));c.displayName="SubmitButton";let d=r.default.forwardRef(({isDeleting:e=!1,deletingText:r="Deleting...",children:a="Delete",...n},s)=>(0,t.jsx)(l,{ref:s,variant:"destructive",isLoading:e,loadingText:r,...n,children:a}));d.displayName="DeleteButton",e.s(["Button",0,l,"DeleteButton",0,d,"SubmitButton",0,c,"buttonVariants",0,({variant:e="default",size:t="md",className:r=""}={})=>(0,n.cn)("inline-flex items-center justify-center gap-2 rounded-lg font-medium","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2","active:scale-[0.98]","disabled:opacity-50 disabled:pointer-events-none disabled:cursor-not-allowed",s[e||"default"],o[t||"md"],r)])},280530,e=>{"use strict";let t=(0,e.i(182233).default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["default",0,t])},252262,e=>{"use strict";var t=e.i(280530);e.s(["Home",()=>t.default])},955669,e=>{"use strict";let t=e=>{let t,r=new Set,a=(e,a)=>{let n="function"==typeof e?e(t):e;if(!Object.is(n,t)){let e=t;t=(null!=a?a:"object"!=typeof n||null===n)?n:Object.assign({},t,n),r.forEach(r=>r(t,e))}},n=()=>t,s={setState:a,getState:n,getInitialState:()=>o,subscribe:e=>(r.add(e),()=>r.delete(e))},o=t=e(a,n,s);return s};e.s(["createStore",0,e=>e?t(e):t])},23880,e=>{"use strict";var t=e.i(623955),r=e.i(955669);let a=e=>{let a=(0,r.createStore)(e),n=e=>(function(e,r=e=>e){let a=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>r(e.getState()),[e,r]),t.default.useCallback(()=>r(e.getInitialState()),[e,r]));return t.default.useDebugValue(a),a})(a,e);return Object.assign(n,a),n};e.s(["create",0,e=>e?a(e):a])},465418,e=>{"use strict";let t=(0,e.i(182233).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(["AlertTriangle",0,t],465418)},803613,e=>{"use strict";let t=(0,e.i(182233).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],803613)},616048,e=>{"use strict";var t=e.i(23880);let r={logo_url:void 0,primary_color:"#FF6B35",secondary_color:"#FFB84D",font_family:"Satoshi, system-ui, sans-serif"},a=(0,t.create)((e,t)=>({isWhitelabeled:!1,brandingConfig:r,isLoading:!1,error:null,_refreshCallback:null,setBrandingFromApi:(t,a,n)=>{let s=t?.branding_config||r;e({isWhitelabeled:t?.is_whitelabeled||!1,brandingConfig:s,isLoading:a,error:n?n instanceof Error?n.message:"Failed to load branding":null}),a||function(e){if("u"<typeof document)return;let t=document.documentElement;e.primary_color&&t.style.setProperty("--brand-primary",e.primary_color),e.secondary_color&&t.style.setProperty("--brand-secondary",e.secondary_color),e.font_family&&t.style.setProperty("--brand-font-family",e.font_family),e.logo_url&&t.style.setProperty("--brand-logo-url",`url(${e.logo_url})`)}(s)},setRefreshCallback:t=>{e({_refreshCallback:t})},refresh:async()=>{let e=t()._refreshCallback;e&&await e()}}));e.s(["useBranding",0,function(){let e=a(e=>e.isWhitelabeled),t=a(e=>e.brandingConfig),r=a(e=>e.isLoading);return{isWhitelabeled:e,brandingConfig:t,isLoading:r,error:a(e=>e.error),refresh:a(e=>e.refresh)}},"useBrandingStore",0,a])},19871,e=>{"use strict";var t=e.i(623955),r=e.i(338277),a=e.i(715028),n=e.i(954878),s=e.i(806985),o=e.i(658468),i=e.i(99955),l=e.i(601819),c=e.i(887438),d=e.i(175088);e.s(["useAccessControl",0,function(){let e=(0,r.usePathname)(),{isAuthenticated:u,user:p,isLoading:m}=(0,a.useAuth)(),{level:f,hydrated:g}=(0,n.useComplexity)(),{subscription:h,isLoading:y}
3=(0,s.useSubscription)(),{isAdmin:v}=(0,o.useRole)(),{disabledFeatures:b}=(0,l.useFeaturePreferencesContext)(),{isEnabled:x,isLoading:w}=(0,c.useFeatureFlags)();return(0,t.useMemo)(()=>{let t=(0,i.getRouteAccessConfig)(e),r=m||y||!g||w;if(r)return{canAccess:!1,isAuthenticated:!1,hasTierAccess:!1,hasComplexityAccess:!1,hasRoleAccess:!1,hasUserTypeAccess:!1,hasPermissionAccess:!1,hasAddOnAccess:!1,config:t,isLoading:!0};if(t.requiresAuth&&!u)return{canAccess:!1,isAuthenticated:!1,hasTierAccess:!1,hasComplexityAccess:!1,hasRoleAccess:!1,hasUserTypeAccess:!1,hasPermissionAccess:!1,hasAddOnAccess:!1,config:t,deniedReason:"auth",isLoading:!1,redirectTo:"/auth/login"};if(!(0,c.areFeatureFlagsEnabled)(t.featureFlag,x))return{canAccess:!1,isAuthenticated:u,hasTierAccess:!1,hasComplexityAccess:!1,hasRoleAccess:!1,hasUserTypeAccess:!1,hasPermissionAccess:!1,hasAddOnAccess:!1,config:t,deniedReason:"feature_disabled",disabledFeatureId:Array.isArray(t.featureFlag)?t.featureFlag.join(","):t.featureFlag,isLoading:r,redirectTo:"/dashboard"};let a=(0,i.meetsTierRequirement)(h.tier,t.minTier,v),n=(0,i.meetsAddOnRequirement)(h.addOns,t.addOnUnlock);if(t.requiresAddOn&&!v&&!n)return{canAccess:!1,isAuthenticated:u,hasTierAccess:a,hasComplexityAccess:!0,hasRoleAccess:!0,hasUserTypeAccess:!0,hasPermissionAccess:!0,hasAddOnAccess:!1,config:t,deniedReason:"addon",requiredTier:t.minTier,addOnUnlock:t.addOnUnlock,isLoading:r,redirectTo:"/settings?tab=subscription"};if(!a&&!n)return{canAccess:!1,isAuthenticated:u,hasTierAccess:!1,hasComplexityAccess:!0,hasRoleAccess:!0,hasUserTypeAccess:!0,hasPermissionAccess:!0,hasAddOnAccess:!1,config:t,deniedReason:"tier",requiredTier:t.minTier,addOnUnlock:t.addOnUnlock,isLoading:r,redirectTo:"/settings?tab=subscription"};if(!(0,i.meetsComplexityRequirement)(f,t.minComplexity))return{canAccess:!1,isAuthenticated:u,hasTierAccess:a||n,hasComplexityAccess:!1,hasRoleAccess:!0,hasUserTypeAccess:!0,hasPermissionAccess:!0,hasAddOnAccess:n,config:t,deniedReason:"complexity",requiredComplexity:t.minComplexity,isLoading:r,redirectTo:"/settings?tab=preferences"};if(!(0,i.meetsRoleRequirement)(p?.role,t.allowedRoles))return{canAccess:!1,isAuthenticated:u,hasTierAccess:a||n,hasComplexityAccess:!0,hasRoleAccess:!1,hasUserTypeAccess:!0,hasPermissionAccess:!0,hasAddOnAccess:n,config:t,deniedReason:"role",requiredRoles:t.allowedRoles,isLoading:r,redirectTo:"/dashboard"};if(!(0,i.meetsUserTypeRequirement)(p?.userTypes,t.allowedUserTypes))return{canAccess:!1,isAuthenticated:u,hasTierAccess:a||n,hasComplexityAccess:!0,hasRoleAccess:!0,hasUserTypeAccess:!1,hasPermissionAccess:!0,hasAddOnAccess:n,config:t,deniedReason:"user_type",requiredUserTypes:t.allowedUserTypes,isLoading:r,redirectTo:"/settings?tab=account"};if(!(0,i.meetsPermissionRequirement)(p?.scopes,t.requiredPermission))return{canAccess:!1,isAuthenticated:u,hasTierAccess:a||n,hasComplexityAccess:!0,hasRoleAccess:!0,hasUserTypeAccess:!0,hasPermissionAccess:!1,hasAddOnAccess:n,config:t,deniedReason:"permission",requiredPermission:t.requiredPermission,isLoading:r,redirectTo:"/dashboard"};let s=(0,d.getFeatureForRoute)(e);return s&&b.includes(s)?{canAccess:!1,isAuthenticated:u,hasTierAccess:a||n,hasComplexityAccess:!0,hasRoleAccess:!0,hasUserTypeAccess:!0,hasPermissionAccess:!0,hasAddOnAccess:n,config:t,deniedReason:"feature_disabled",disabledFeatureId:s,isLoading:r,redirectTo:"/settings?tab=features"}:t.redirectTo?{canAccess:!0,isAuthenticated:u,hasTierAccess:a||n,hasComplexityAccess:!0,hasRoleAccess:!0,hasUserTypeAccess:!0,hasPermissionAccess:!0,hasAddOnAccess:n,config:t,isLoading:r,redirectTo:t.redirectTo}:{canAccess:!0,isAuthenticated:u,hasTierAccess:a||n,hasComplexityAccess:!0,hasRoleAccess:!0,hasUserTypeAccess:!0,hasPermissionAccess:!0,hasAddOnAccess:n,config:t,isLoading:r}},[e,u,p?.role,p?.userTypes,p?.scopes,f,g,h.tier,h.addOns,m,y,v,b,x,w])},"useCanAccess",0,function(e){let{isAuthenticated:r,user:d}=(0,a.useAuth)(),{level:u}=(0,n.useComplexity)(),{subscription:p}=(0,s.useSubscription)(),{isAdmin:m}=(0,o.useRole)(),{disabledNavHrefs:f}=(0,l.useFeaturePreferencesContext)(),{isEnabled:g}=(0,c.useFeatureFlags)();return(0,t.useMemo)(()=>{let t=(0,i.getRouteAccessConfig)(e);if(t.requiresAuth&&!r||f.has(e)||!(0,c.areFeatureFlagsEnabled)(t.featureFlag,g))return!1;let a=(0,i.meetsTierRequirement)(p.tier,t.minTier,m),n=(0,i.meetsAddOnRequirement)(p.addOns,t.addOnUnlock);return(!t.requiresAddOn||!!m||!!n)&&(!!a||!!n)&&!!(0,i.meetsComplexityRequirement)(u,t.minComplexity)&&!!(0,i.meetsRoleRequirement)(d?.role,t.allowedRoles)&&!!(0,i.meetsUserTypeRequirement)(d?.userTypes,t.allowedUserTypes)&&!!(0,i.meetsPermissionRequirement)(d?.scopes,t.requiredPermission)&&!0},[e,r,d?.role,d?.userTypes,d?.scopes,u,p.tier,p.addOns,m,f,g])},"useHasAddOn",0,function(e){let{subscription:t}
3=(0,s.useSubscription)();return t.addOns?.[e]??!1}])},909568,e=>{"use strict";var t=e.i(392526),r=e.i(92880),a=e.i(828894),n=e.i(311938),s=e.i(362093),o=e.i(630864),i=e.i(196696),l=e.i(971776),c=e.i(76292),d=e.i(62952),u=e.i(668339),p=e.i(353463),m=e.i(839340);e.s(["Accordion",()=>t.Accordion,"ActivityWidget",()=>t.ActivityWidget,"AdminRoute",()=>t.AdminRoute,"AdvancedFormField",()=>t.AdvancedFormField,"Alert",()=>t.Alert,"AlertDescription",()=>t.AlertDescription,"AlertTitle",()=>t.AlertTitle,"AnalyticsErrorBoundary",()=>t.AnalyticsErrorBoundary,"AuditLogViewer",()=>t.AuditLogViewer,"AuthProvider",()=>t.AuthProvider,"BackendStatusIndicator",()=>t.BackendStatusIndicator,"BackgroundSyncService",()=>t.BackgroundSyncService,"Badge",()=>p.Badge,"BasicFormExample",()=>t.BasicFormExample,"BorderedCollapsibleSection",()=>t.BorderedCollapsibleSection,"Button",()=>p.Button,"Calendar",()=>r.Calendar,"Card",()=>p.Card,"CardContent",()=>p.CardContent,"CardDescription",()=>p.CardDescription,"CardFooter",()=>p.CardFooter,"CardHeader",()=>p.CardHeader,"CardLoadingState",()=>t.CardLoadingState,"CardSkeleton",()=>t.CardSkeleton,"CardTitle",()=>p.CardTitle,"Checkbox",()=>l.Checkbox,"CheckboxExample",()=>t.CheckboxExample,"Code",()=>t.Code,"Collapsible",()=>t.Collapsible,"CollapsibleContent",()=>t.CollapsibleContent,"CollapsibleSection",()=>t.CollapsibleSection,"CollapsibleTrigger",()=>t.CollapsibleTrigger,"CommandPalette",()=>t.CommandPalette,"ComplexFormExample",()=>t.ComplexFormExample,"ComponentErrorBoundary",()=>t.ComponentErrorBoundary,"ComponentGallery",()=>t.ComponentGallery,"CompressionService",()=>t.CompressionService,"ContextualHelpSystem",()=>t.ContextualHelpSystem,"DASHBOARD_PRESETS",()=>s.DASHBOARD_PRESETS,"DashboardBuilder",()=>t.DashboardBuilder,"DashboardErrorBoundary",()=>t.DashboardErrorBoundary,"DashboardLayout",()=>t.DashboardLayout,"DataGrid",()=>t.DataGrid,"DataTable",()=>t.DataTable,"DataTableLegacy",()=>t.DataTableLegacy,"DataTableMigrationUtils",()=>t.DataTableMigrationUtils,"DataTableTanStack",()=>t.DataTableTanStack,"DateRangePicker",()=>r.DateRangePicker,"Dialog",()=>r.Dialog,"DialogClose",()=>r.DialogClose,"DialogContent",()=>r.DialogContent,"DialogDescription",()=>r.DialogDescription,"DialogFooter",()=>r.DialogFooter,"DialogHeader",()=>r.DialogHeader,"DialogOverlay",()=>r.DialogOverlay,"DialogPortal",()=>r.DialogPortal,"DialogTitle",()=>r.DialogTitle,"DialogTrigger",()=>r.DialogTrigger,"DropdownMenu",()=>r.DropdownMenu,"DropdownMenuCheckboxItem",()=>r.DropdownMenuCheckboxItem,"DropdownMenuContent",()=>r.DropdownMenuContent,"DropdownMenuGroup",()=>r.DropdownMenuGroup,"DropdownMenuItem",()=>r.DropdownMenuItem,"DropdownMenuLabel",()=>r.DropdownMenuLabel,"DropdownMenuPortal",()=>r.DropdownMenuPortal,"DropdownMenuRadioGroup",()=>r.DropdownMenuRadioGroup,"DropdownMenuRadioItem",()=>r.DropdownMenuRadioItem,"DropdownMenuSeparator",()=>r.DropdownMenuSeparator,"DropdownMenuShortcut",()=>r.DropdownMenuShortcut,"DropdownMenuSub",()=>r.DropdownMenuSub,"DropdownMenuSubContent",()=>r.DropdownMenuSubContent,"DropdownMenuSubTrigger",()=>r.DropdownMenuSubTrigger,"DropdownMenuTrigger",()=>r.DropdownMenuTrigger,"EmptyState",()=>t.EmptyState,"EnhancedInputExample",()=>t.EnhancedInputExample,"ErrorBoundary",()=>t.ErrorBoundary,"ErrorState",()=>t.ErrorState,"FeatureErrorBoundary",()=>t.FeatureErrorBoundary,"FieldCamera",()=>t.FieldCamera,"FieldContainer",()=>t.FieldContainer,"FieldDeviceControls",()=>t.FieldDeviceControls,"FieldForm",()=>t.FieldForm,"FieldLocation",()=>t.FieldLocation,"FieldNetworkStatus",()=>t.FieldNetworkStatus,"FieldOfflineIndicator",()=>t.FieldOfflineIndicator,"FieldSync",()=>t.FieldSync,"FieldTaskQueue",()=>t.FieldTaskQueue,"FieldVoiceInput",()=>t.FieldVoiceInput,"FilledCollapsibleSection",()=>t.FilledCollapsibleSection,"FormCheckbox",()=>t.FormCheckbox,"FormComponentsDemo",()=>t.FormComponentsDemo,"FormError",()=>t.FormError,"FormField",()=>t.FormField,"FormHelperText",()=>t.FormHelperText,"FormInput",()=>t.FormInput,"FormLabel",()=>t.FormLabel,"FormLoadingState",()=>t.FormLoadingState,"FormRadioGroup",()=>t.FormRadioGroup,"FormSelect",()=>t.FormSelect,"FormTextarea",()=>t.FormTextarea,"GlobalErrorBoundary",()=>t.GlobalErrorBoundary,"HTTPErrorState",()=>t.HTTPErrorState,"Header",()=>t.Header,"IndexedDBManager",()=>t.IndexedDBManager,"Input",()=>d.Input,"Label",()=>a.Label,"LazyWrapper",()=>t.LazyWrapper,"LegacyLoadingButton",()=>t.LegacyLoadingButton,"LegacyLoadingOverlay",()=>t.LegacyLoadingOverlay,"Loading",()=>t.Loading,"LoadingButton",()=>t.LoadingButton,"LoadingDots",()=>t.LoadingDots,"LoadingProgress",()=>t.LoadingProgress,"LoadingSpinner",()=>t.LoadingSpinner,"LoadingState",()=>t.LoadingState,"LoginContainer",()=>t.LoginContainer,"LoginForm",()=>t.LoginForm,"MetricWidget",()=>t.MetricWidget,"Modal",()=>t.Modal,"MonitoringExpandableSection",()=>
3t.MonitoringExpandableSection,"NavMenu",()=>t.NavMenu,"OfflineManager",()=>t.OfflineManager,"OnboardingTourSystem",()=>t.OnboardingTourSystem,"PERFORMANCE_THRESHOLDS",()=>t.PERFORMANCE_THRESHOLDS,"PWAManager",()=>t.PWAManager,"Pagination",()=>t.Pagination,"PaginationInfo",()=>t.PaginationInfo,"PaymentErrorBoundary",()=>t.PaymentErrorBoundary,"PerformanceMonitor",()=>t.PerformanceMonitor,"Popover",()=>l.Popover,"PopoverContent",()=>l.PopoverContent,"PopoverTrigger",()=>l.PopoverTrigger,"PresetLibrary",()=>t.PresetLibrary,"Progress",()=>n.Progress,"ProtectedRoute",()=>t.ProtectedRoute,"Radio",()=>t.Radio,"RadioGroup",()=>t.RadioGroup,"RadioGroupExample",()=>t.RadioGroupExample,"RadioGroupItem",()=>t.RadioGroupItem,"RefreshButton",()=>t.RefreshButton,"RememberMeCheckbox",()=>t.RememberMeCheckbox,"RouteErrorBoundary",()=>t.RouteErrorBoundary,"ScrollArea",()=>d.ScrollArea,"SearchInput",()=>t.SearchInput,"Select",()=>c.Select,"SelectContent",()=>c.SelectContent,"SelectExample",()=>t.SelectExample,"SelectField",()=>t.SelectField,"SelectGroup",()=>c.SelectGroup,"SelectItem",()=>c.SelectItem,"SelectLabel",()=>c.SelectLabel,"SelectScrollDownButton",()=>c.SelectScrollDownButton,"SelectScrollUpButton",()=>c.SelectScrollUpButton,"SelectSeparator",()=>c.SelectSeparator,"SelectTrigger",()=>c.SelectTrigger,"SelectValue",()=>c.SelectValue,"Separator",()=>t.Separator,"Sidebar",()=>t.Sidebar,"SidebarContent",()=>t.SidebarContent,"SidebarFooter",()=>t.SidebarFooter,"SidebarGroup",()=>t.SidebarGroup,"SidebarGroupLabel",()=>t.SidebarGroupLabel,"SidebarHeader",()=>t.SidebarHeader,"SidebarMenu",()=>t.SidebarMenu,"SidebarMenuButton",()=>t.SidebarMenuButton,"SidebarMenuItem",()=>t.SidebarMenuItem,"SidebarProvider",()=>t.SidebarProvider,"Skeleton",()=>t.Skeleton,"SkeletonAvatar",()=>t.SkeletonAvatar,"SkeletonCard",()=>t.SkeletonCard,"SkeletonText",()=>t.SkeletonText,"SkipLink",()=>t.SkipLink,"SkipLinks",()=>t.SkipLinks,"Slider",()=>t.Slider,"SonnerToaster",()=>m.Toaster,"Spinner",()=>t.Spinner,"StatusBadge",()=>t.StatusBadge,"StatusIndicator",()=>t.StatusIndicator,"StatusWidget",()=>t.StatusWidget,"SummaryCard",()=>t.SummaryCard,"SuperAdminRoute",()=>t.SuperAdminRoute,"Switch",()=>o.Switch,"SyncManager",()=>t.SyncManager,"Table",()=>t.Table,"TableBody",()=>t.TableBody,"TableCaption",()=>t.TableCaption,"TableCell",()=>t.TableCell,"TableHead",()=>t.TableHead,"TableHeader",()=>t.TableHeader,"TableLoadingState",()=>t.TableLoadingState,"TableRow",()=>t.TableRow,"TableSkeleton",()=>t.TableSkeleton,"TableWidget",()=>t.TableWidget,"Tabs",()=>i.Tabs,"TabsContent",()=>i.TabsContent,"TabsList",()=>i.TabsList,"TabsTrigger",()=>i.TabsTrigger,"TenantAdminRoute",()=>t.TenantAdminRoute,"TenantErrorBoundary",()=>t.TenantErrorBoundary,"TextField",()=>t.TextField,"Textarea",()=>t.Textarea,"TextareaExample",()=>t.TextareaExample,"ThemeBuilder",()=>t.ThemeBuilder,"Toast",()=>t.Toast,"ToastAction",()=>t.ToastAction,"ToastClose",()=>t.ToastClose,"ToastDescription",()=>t.ToastDescription,"ToastProvider",()=>t.ToastProvider,"ToastTitle",()=>t.ToastTitle,"ToastViewport",()=>t.ToastViewport,"Toaster",()=>t.Toaster,"Tooltip",()=>t.Tooltip,"TooltipContent",()=>t.TooltipContent,"TooltipProvider",()=>t.TooltipProvider,"TooltipTrigger",()=>t.TooltipTrigger,"UnifiedErrorBoundary",()=>t.UnifiedErrorBoundary,"UserManagementErrorBoundary",()=>t.UserManagementErrorBoundary,"VoiceCameraIntegration",()=>t.VoiceCameraIntegration,"WIDGET_CATEGORIES",()=>t.WIDGET_CATEGORIES,"WIDGET_SIZES",()=>t.WIDGET_SIZES,"WIDGET_TEMPLATES",()=>u.WIDGET_TEMPLATES,"WIDGET_TYPES",()=>t.WIDGET_TYPES,"WidgetLibrary",()=>t.WidgetLibrary,"WorkflowErrorBoundary",()=>t.WorkflowErrorBoundary,"announceToScreenReader",()=>p.announceToScreenReader,"backgroundSyncService",()=>t.backgroundSyncService,"badgeVariants",()=>p.badgeVariants,"buttonVariants",()=>p.buttonVariants,"cn",()=>p.cn,"compressionService",()=>t.compressionService,"createFeatureErrorBoundary",()=>t.createFeatureErrorBoundary,"defaultCommandCategories",()=>t.defaultCommandCategories,"errorStateVariants",()=>t.errorStateVariants,"fieldOperationsDB",()=>t.fieldOperationsDB,"fieldOperationsSchema",()=>t.fieldOperationsSchema,"loadingButtonVariants",()=>t.loadingButtonVariants,"loadingOverlayVariants",()=>t.loadingOverlayVariants,"loadingStateVariants",()=>t.loadingStateVariants,"offlineManager",()=>t.offlineManager,"performanceMonitor",()=>t.performanceMonitor,"pwaManager",()=>t.pwaManager,"refreshButtonVariants",()=>t.refreshButtonVariants,"sonnerToast",()=>m.toast,"syncManager",()=>t.syncManager,"toast",()=>t.toast,"uiLogger",()=>t.uiLogger,"useAnnouncement",()=>t.useAnnouncement,"useAuthContext",()=>t.useAuthContext,"useConditionalRendering",()=>t.useConditionalRendering,"useDashboardBuilder",()=>t.useDashboardBuilder,"useErrorToast",()=>t.useErrorToast,"useFieldContext",()=>t.useFieldContext,"useFieldValidation",()=>t.useFieldValidation,"useFocusReturn",()=>t.useFocusReturn,"useFocusTrap",()=>t.useFocusTrap,"useInfoToast",()=>t.useInfoToast,"useLoadingState",()=>t.useLoadingState,"useRovingTabindex",()=>t.useRovingTabindex,"useServerTable",()=>t.useServerTable,"useSidebar",()=>t.useSidebar,"useSuccessToast",()=>t.useSuccessToast,"useToast",()=>t.useToast,"useWarningToast",()=>t.useWarningToast,"validateFieldRules",()=>t.validateFieldRules,"validateWithZod",()=>t.validateWithZod,"validationRules",()=>t.validationRules,"withErrorBoundary",()=>t.withErrorBoundary,"withLazyWrapper",()=>
3t.withLazyWrapper,"withUnifiedErrorBoundary",()=>t.withUnifiedErrorBoundary])},932802,e=>{"use strict";let t=(0,e.i(182233).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(["Smartphone",0,t],932802)},710380,e=>{"use strict";var t=e.i(846896),r=e.i(373985),a=e.i(623955),n=e.i(990432),s=e.i(559781),o=e.i(453575);function i(e,t){let r;if(e&&"object"==typeof e&&"type"in e&&"message"in e&&Object.values(n.AIErrorType).includes(e.type))return e;let a=(0,s.normalizeError)(e),o=!0,i=!0;return 429===a.status?(r=n.AIErrorType.RATE_LIMITED,o=!1):408===a.status||504===a.status?(r=n.AIErrorType.TIMEOUT,o=!0):503===a.status||502===a.status||a.type===s.ErrorType.NETWORK?(r=n.AIErrorType.MODEL_UNAVAILABLE,o=!0,i=!0):a.message?.toLowerCase().includes("partial")?(r=n.AIErrorType.PARTIAL_RESPONSE,o=!0):a.message?.toLowerCase().includes("invalid")||a.message?.toLowerCase().includes("malformed")?(r=n.AIErrorType.INVALID_RESPONSE,o=!0):(r=n.AIErrorType.SUGGESTION_FAILED,o=a.type===s.ErrorType.SYSTEM),{type:r,message:a.message,code:a.code,retryable:o,fallbackAvailable:i,originalError:e}}parseInt(t.default.env.NEXT_PUBLIC_LLM_MAX_TOKENS||t.default.env.LLM_MAX_TOKENS||"4096",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_MAX_INPUT_TOKENS||"3072",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_MAX_OUTPUT_TOKENS||"1024",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_MAX_EMBEDDING_TOKENS||"8192",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_MAX_CHAT_TOKENS||"4096",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_MAX_SUMMARY_TOKENS||"2048",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_RATE_LIMIT_TPM||t.default.env.LLM_RATE_LIMIT_TPM||"60000",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_RATE_LIMIT_RPM||"60",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_RATE_LIMIT_RPH||"1000",10),parseInt(t.default.env.NEXT_PUBLIC_LLM_MAX_CONCURRENT||"5",10),t.default.env.NEXT_PUBLIC_AI_CONTENT_FILTER_ENABLED,t.default.env.NEXT_PUBLIC_AI_CONTENT_FILTER_LEVEL,t.default.env.NEXT_PUBLIC_AI_DOMAIN_RESTRICTIONS_ENABLED,(t.default.env.NEXT_PUBLIC_AI_ALLOWED_DOMAINS||"").split(",").filter(Boolean),(t.default.env.NEXT_PUBLIC_AI_BLOCKED_DOMAINS||"").split(",").filter(Boolean),parseInt(t.default.env.NEXT_PUBLIC_AI_MAX_RETRIES||"3",10),parseInt(t.default.env.NEXT_PUBLIC_AI_REQUEST_TIMEOUT_MS||"30000",10);var l=e.i(939161),c=e.i(57606),d=e.i(931957);class u extends a.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:i(e,{component:"AIErrorBoundary"})}}componentDidCatch(e,r){let a=i(e,{component:this.props.componentName||"AIErrorBoundary",...this.props.context,metadata:{...this.props.context?.metadata,componentStack:r.componentStack}});this.setState({error:a,errorInfo:r});var n={component:this.props.componentName||"AIErrorBoundary",...this.props.context,metadata:{...this.props.context?.metadata,componentStack:r.componentStack}};try{window.gtag&&window.gtag("event","ai_error",{error_type:a.type,error_code:a.code,component:n.component,action:n.action,retryable:a.retryable,fallback_available:a.fallbackAvailable,...n.metadata}),o.logger.debug("[AI Error]",{type:a.type,message:a.message,code:a.code,component:n.component,action:n.action})}catch(e){o.logger.error("Failed to track AI error:",e)}if(c.ENV.IS_PRODUCTION||t.default.env.NEXT_PUBLIC_SENTRY_DEBUG){try{l.captureException(e,{tags:{errorBoundary:"ai-error-boundary",aiErrorType:a.type,component:this.props.componentName||"AIErrorBoundary"},extra:{aiError:a,errorInfo:{componentStack:r.componentStack},context:this.props.context},level:"error"})}catch(e){o.logger.error("[AIErrorBoundary] Sentry capture failed:",e)}(0,d.reportExceptionToPostHog)(e,{errorBoundary:"ai-error-boundary",aiErrorType:a.type,component:this.props.componentName||"AIErrorBoundary"})}}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null}),this.props.onReset&&this.props.onReset()};handleRetry=async()=>{this.handleReset()};handleFallback=()=>{this.props.onFallback&&this.props.onFallback(),this.handleReset()};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.handleReset):(0,r.jsx)(n.AIErrorState,{error:this.state.error,onRetry:this.handleRetry,onF
3allback:!1!==this.props.showFallback&&this.props.onFallback?this.handleFallback:void 0,showFallback:!1!==this.props.showFallback}):this.props.children}}e.s(["AIErrorBoundary",0,u],710380)},685522,e=>{"use strict";let t=(0,e.i(182233).default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["Server",0,t],685522)},197382,e=>{"use strict";var t=e.i(373985),r=e.i(623955),a=e.i(715028),n=e.i(453575),s=e.i(703980);let o="guest_session_token",i=(0,r.createContext)(void 0);async function l(e){try{if(!(await fetch("/api/proxy/cart/guest/merge",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":(0,s.getCSRFToken)()??"","X-Guest-Session":e},credentials:"include"})).ok)throw Error("Failed to merge guest cart")}catch(e){throw n.logger.error("Error merging guest cart",e),e}}async function c(){try{let e=localStorage.getItem(o);if(e)return e}catch{}let e=await fetch("/api/proxy/cart/guest/session",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":(0,s.getCSRFToken)()??""},credentials:"include"});if(!e.ok)throw Error("Failed to create guest session");let t=await e.json(),r=t.data?.sessionToken;if(!r)throw Error("No session token in response");try{localStorage.setItem(o,r)}catch{}return r}e.s(["GuestSessionProvider",0,function({children:e}){let[s,c]=(0,r.useState)(null),[d,u]=(0,r.useState)(!0),{user:p,isLoading:m}=(0,a.useAuth)();(0,r.useEffect)(()=>{try{let e=localStorage.getItem(o);c(e)}catch{n.logger.warn("localStorage unavailable for guest session")}u(!1)},[]),(0,r.useEffect)(()=>{!m&&p&&s&&l(s).then(()=>{try{localStorage.removeItem(o)}catch{}c(null)}).catch(e=>{n.logger.error("Failed to merge guest cart",e);try{localStorage.removeItem(o)}catch{}c(null)})},[p,m,s]);let f=(0,r.useCallback)(()=>{try{localStorage.removeItem(o)}catch{}c(null)},[]),g=(0,r.useCallback)(e=>{try{localStorage.setItem(o,e)}catch{}c(e)},[]);return(0,t.jsx)(i.Provider,{value:{sessionToken:s,isLoading:d||m,clearSession:f,updateSessionToken:g},children:e})},"getGuestSession",0,function(){return localStorage.getItem(o)},"getOrCreateGuestSession",0,c,"saveGuestSession",0,function(e){localStorage.setItem(o,e)},"useGuestSession",0,function(){let e=(0,r.useContext)(i);if(void 0===e)throw Error("useGuestSession must be used within a GuestSessionProvider");return e}])},13082,e=>{"use strict";let t=(0,e.i(182233).default)("wheat",[["path",{d:"M2 22 16 8",key:"60hf96"}],["path",{d:"M3.47 12.53 5 11l1.53 1.53a3.5 3.5 0 0 1 0 4.94L5 19l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1rdhi6"}],["path",{d:"M7.47 8.53 9 7l1.53 1.53a3.5 3.5 0 0 1 0 4.94L9 15l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1sdzmb"}],["path",{d:"M11.47 4.53 13 3l1.53 1.53a3.5 3.5 0 0 1 0 4.94L13 11l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"eoatbi"}],["path",{d:"M20 2h2v2a4 4 0 0 1-4 4h-2V6a4 4 0 0 1 4-4Z",key:"19rau1"}],["path",{d:"M11.47 17.47 13 19l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L5 19l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"tc8ph9"}],["path",{d:"M15.47 13.47 17 15l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L9 15l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"2m8kc5"}],["path",{d:"M19.47 9.47 21 11l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L13 11l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"vex3ng"}]]);e.s(["Wheat",0,t],13082)},323462,e=>{"use strict";var t=e.i(757045);function r(e,{pages:t,pageParams:a}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,a[n],a):void 0}function a(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}e.s(["hasNextPage",0,function(e,t){return!!t&&null!=r(e,t)},"hasPreviousPage",0,function(e,t){return!!t&&!!e.getPreviousPageParam&&null!=a(e,t)},"infiniteQueryBehavior",0,function(e){return{onFetch:(n,s)=>{let o=n.options,i=n.fetchOptions?.meta?.fetchMore?.direction,l=n.state.data?.pages||[],c=n.state.data?.pageParams||[],d={pages:[],pageParams:[]},u=0,p=async()=>{let s=!1,p=(0,t.ensureQueryFn)(n.options,n.fetchOptions),m=async(e,r,a)=>{let o;if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let i=(Object.defineProperty(o={client:n.client,queryKey:n.queryKey,pageParam:r,direction:a?"backward":"forward",meta:n.options.meta},"signal",{enumerable:!0,get:()=>(n.signal.aborted?s=!0:n.signal.addEventListener("abort",()=>{s=!0}),n.signal)}
3),o),l=await p(i),{maxPages:c}=n.options,d=a?t.addToStart:t.addToEnd;return{pages:d(e.pages,l,c),pageParams:d(e.pageParams,r,c)}};if(i&&l.length){let e="backward"===i,t={pages:l,pageParams:c},n=(e?a:r)(o,t);d=await m(t,n,e)}else{let t=e??l.length;do{let e=0===u?c[0]??o.initialPageParam:r(o,d);if(u>0&&null==e)break;d=await m(d,e),u++}while(u<t)}return d};n.options.persister?n.fetchFn=()=>n.options.persister?.(p,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},s):n.fetchFn=p}}}])},512800,e=>{"use strict";var t=e.i(657527),r=e.i(380485),a=e.i(816882),n=e.i(338277),s=e.i(427343),o=e.i(715028),i=e.i(108271),l=e.i(358786);let c={all:["branding"],config:()=>[...c.all,"config"]};e.s(["brandingKeys",0,c,"useBranding",0,function(){let e=(0,n.usePathname)(),{isAuthenticated:t}=(0,o.useAuth)(),a=t&&null!==e&&!(0,i.isPublicRoute)(e);return(0,r.useQuery)({queryKey:c.config(),queryFn:async()=>{try{let e=await s.apiAxios.get("/api/v1/branding/config");return(0,l.unwrapApiResponse)(e)}catch(e){if(e&&"object"==typeof e&&"response"in e&&e.response?.status===404)return null;throw e}},enabled:a,staleTime:3e5,gcTime:6e5,retry:(e,t)=>(!t||"object"!=typeof t||!("response"in t)||t.response?.status!==404)&&e<3})},"useUpdateBranding",0,function(){let e=(0,a.useQueryClient)();return(0,t.useMutation)({mutationFn:async({partnerId:e,brandingConfig:t})=>{let{logo_url:r,primary_color:a,secondary_color:n,font_family:o,favicon_url:i,custom_domain:c,...d}=t,u=await s.apiAxios.post(`/api/v1/partners/${e}/branding`,{branding_config:d});return(0,l.unwrapApiResponse)(u)},onSuccess:()=>{e.invalidateQueries({queryKey:c.all})}})},"useUploadBrandAsset",0,function(){return(0,t.useMutation)({mutationFn:async({file:e,context:t,contextId:r,caption:a})=>{let n=new URLSearchParams;n.set("context",t),r&&n.set("contextId",r),a&&n.set("caption",a);let o=new FormData;o.append("file",e);let i=await (0,s.apiFetch)(`/api/v1/media/upload?${n.toString()}`,{method:"POST",body:o});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error?.message||`Upload failed: ${i.status}`)}let l=await i.json();return l?.data?.media??l?.data??l}})}])},665681,e=>{"use strict";let t="hm_attribution",r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function a(){try{let e=sessionStorage.getItem(t);return e?JSON.parse(e):{}}catch{return{}}}e.s(["captureAttribution",0,function(e){try{let n={...a()};for(let t of r){let r=e.get(t);r&&!n[t]&&(n[t]=r)}let s=e.get("source")||e.get("src");if(s&&!n.utm_source&&(n.utm_source=s),!n.referrer&&document.referrer){let e=document.referrer;e.startsWith(window.location.origin)||(n.referrer=e)}n.source_path||(n.source_path=window.location.pathname),Object.keys(n).length>0&&sessionStorage.setItem(t,JSON.stringify(n))}catch{}},"clampAttribution",0,function(e){let t={...e};for(let[e,r]of Object.entries(t)){if(!r)continue;let a=e.startsWith("utm_")?100:500;t[e]=r.slice(0,a)}return t},"getAttribution",0,function(){let e=a();return Object.keys(e).length>0?e:void 0}])},462719,e=>{"use strict";var t=e.i(623955),r=e.i(23880),a=e.i(453575),n=e.i(951446);let s="apiary-pro-user-behavior",o={interactions:[],recentlyViewed:[],featureUsage:[],patterns:{preferredEntityTypes:[],preferredFeatures:[],peakActivityHours:[],commonSequences:[],aiPreferences:{suggestionAcceptanceRate:0,preferredSuggestionTypes:[],averageResponseTime:0}},lastUpdated:null};function i(e){try{localStorage.setItem(s,JSON.stringify(e))}catch(e){a.logger.error("Failed to save user behavior data to localStorage",e)}}let l=(0,r.create)((e,t)=>({...o,disabled:!1,hydrate:(t=!1)=>{t?e({disabled:!0}):e({...function(){try{let e=localStorage.getItem(s);if(!e)return o;let t=JSON.parse(e);return{...o,...t,interactions:t.interactions?.map(e=>({...e,timestamp:new Date(e.timestamp)}))||[],recentlyViewed:t.recentlyViewed?.map(e=>({...e,lastViewed:new Date(e.lastViewed)}))||[],featureUsage:t.featureUsage?.map(e=>({...e,lastUsed:new Date(e.lastUsed)}))||[],lastUpdated:t.lastUpdated?new Date(t.lastUpdated):null}}catch(e){return a.logger.warn("Failed to load user behavior state from localStorage, using defaults",e),o}}(),disabled:!1})},trackInteraction:(r,a,s,o,l)=>{if(t().disabled)return;let c={id:(0,n.generateTempId)("int"),entityType:r,entityId:s,entityName:o,action:a,timestamp:new Date,metadata:l,pageUrl:window.location.pathname};e(e=>{let t,r,a,n,s,o,l,d,u=[c,...e.interactions].slice(0,500),p=(t=u.reduce((e,t)=>
3(e[t.entityType]=(e[t.entityType]||0)+1,e),{}),r=u.length||1,a=Object.entries(t).map(([e,t])=>({type:e,weight:t/r})).sort((e,t)=>t.weight-e.weight).slice(0,5),s=Math.max(...Object.values(n=u.reduce((e,t)=>{let r=new Date(t.timestamp).getHours();return e[r]=(e[r]||0)+1,e},{})),1),o=Object.entries(n).filter(([,e])=>e>=.7*s).map(([e])=>parseInt(e)).sort((e,t)=>e-t),d=(l=u.filter(e=>"ai-suggestion-accepted"===e.action||"ai-suggestion-rejected"===e.action)).filter(e=>"ai-suggestion-accepted"===e.action).length,{preferredEntityTypes:a,preferredFeatures:[],peakActivityHours:o,commonSequences:[],aiPreferences:{suggestionAcceptanceRate:l.length>0?d/l.length:0,preferredSuggestionTypes:[],averageResponseTime:0}}),m={...e,interactions:u,patterns:p,lastUpdated:new Date};return i(m),m})},trackPageView:(r,a,n)=>{!t().disabled&&(t().trackInteraction(r,"view",a,n),a&&n&&e(e=>{let t,s=e.recentlyViewed.findIndex(e=>e.entityType===r&&e.entityId===a);if(s>=0){let r=e.recentlyViewed[s];t=[{...r,lastViewed:new Date,viewCount:r.viewCount+1,entityName:n},...e.recentlyViewed.filter((e,t)=>t!==s)].slice(0,50)}else t=[{entityType:r,entityId:a,entityName:n,lastViewed:new Date,viewCount:1},...e.recentlyViewed].slice(0,50);let o={...e,recentlyViewed:t,lastUpdated:new Date};return i(o),o}))},trackFeatureUsage:(r,a)=>{t().disabled||e(e=>{let t,n=e.featureUsage.findIndex(e=>e.featureId===r);if(n>=0){let r=e.featureUsage[n];t=[{...r,useCount:r.useCount+1,lastUsed:new Date},...e.featureUsage.filter((e,t)=>t!==n)]}else t=[{featureId:r,featureName:a,useCount:1,lastUsed:new Date},...e.featureUsage];let s={...e,featureUsage:t,patterns:{...e.patterns,preferredFeatures:t.slice(0,10).map(e=>({featureId:e.featureId,weight:e.useCount/t.reduce((e,t)=>e+t.useCount,1)}))},lastUpdated:new Date};return i(s),s})},getRecentlyViewed:(e,r=10)=>{let a=t().recentlyViewed;return e&&(a=a.filter(t=>t.entityType===e)),a.slice(0,r)},getFeatureUsage:(e=10)=>t().featureUsage.slice(0,e),getPatterns:()=>t().patterns,clearBehaviorData:()=>{e(o),localStorage.removeItem(s)},exportBehaviorData:()=>{let{interactions:e,recentlyViewed:r,featureUsage:a,patterns:n,lastUpdated:s}=t();return JSON.stringify({interactions:e,recentlyViewed:r,featureUsage:a,patterns:n,lastUpdated:s},null,2)}}));e.s(["usePersonalizedRecommendations",0,function(){let e=l(e=>e.getPatterns),r=l(e=>e.getRecentlyViewed),a=l(e=>e.getFeatureUsage);return t.default.useMemo(()=>{let t=e(),n=r(void 0,20),s=a(10);return{suggestedEntityTypes:t.preferredEntityTypes.slice(0,3),suggestedFeatures:s.slice(0,5),optimalNotificationHours:t.peakActivityHours,isAIFriendly:t.aiPreferences.suggestionAcceptanceRate>.5,quickAccessEntities:n.slice(0,5)}},[e,r,a])},"useTrackPageView",0,function(e,r,a){let n=l(e=>e.trackPageView);t.default.useEffect(()=>{n(e,r,a)},[n,e,r,a])},"useUserBehavior",0,function(){let e=l(e=>e.interactions),t=l(e=>e.recentlyViewed),r=l(e=>e.featureUsage),a=l(e=>e.patterns),n=l(e=>e.lastUpdated),s=l(e=>e.trackInteraction),o=l(e=>e.trackPageView),i=l(e=>e.trackFeatureUsage),c=l(e=>e.getRecentlyViewed),d=l(e=>e.getFeatureUsage),u=l(e=>e.getPatterns);return{state:{interactions:e,recentlyViewed:t,featureUsage:r,patterns:a,lastUpdated:n},trackInteraction:s,trackPageView:o,trackFeatureUsage:i,getRecentlyViewed:c,getFeatureUsage:d,getPatterns:u,clearBehaviorData:l(e=>e.clearBehaviorData),exportBehaviorData:l(e=>e.exportBehaviorData)}},"useUserBehaviorStore",0,l])},631668,e=>{"use strict";let t=(0,e.i(182233).default)("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);e.s(["HardDrive",0,t],631668)},710152,e=>{"use strict";var t=e.i(623955),r=e.i(140047),a=e.i(514102),n=e.i(453575);e.s(["useConflicts",0,function(e={}){let{autoRefresh:s=!0,refreshInterval:o=3e4,entityType:i,onConflictsDetected:l,onConflictResolved:c}=e,[d,u]=(0,t.useState)([]),[p,m]=(0,t.useState)(0),[f,g]=(0,t.useState)(!0),[h,y]=(0,t.useState)(!1),[v,b]=(0,t.useState)(null),x=(0,t.useCallback)(async()=>{try{let e;g(!0),b(null),e=i?(e=await (0,a.getConflictsByEntity)(i)).filter(e=>"pending"===e.status):await (0,r.getPendingConflicts)();let t=await (0,r.getConflictCount)();
3u(e),m(t),e.length>0&&l&&l(e)}catch(e){b(e instanceof Error?e.message:"Failed to load conflicts"),n.logger.error("[useConflicts] Failed to load conflicts",e)}finally{g(!1)}},[i,l]);(0,t.useEffect)(()=>{x()},[x]),(0,t.useEffect)(()=>{if(!s)return;let e=setInterval(()=>{x()},o);return()=>clearInterval(e)},[s,o,x]);let w=(0,t.useCallback)(async(e,t,s)=>{try{y(!0);let o=await (0,a.getConflictById)(e);if(!o)throw Error(`Conflict ${e} not found`);switch(t){case"use_local":default:o.localData;break;case"use_server":o.serverData;break;case"merge":s||o.localData}if("use_server"===t){let e=(await (0,a.getSyncQueue)()).find(e=>e.entityId===o.entityId&&e.entityType===o.entityType&&"conflicted"===e.status);e&&(await (0,a.removeFromSyncQueue)(e.id),n.logger.info(`[useConflicts] Removed sync queue item for accepted server version: ${e.id}`))}await (0,r.resolveConflict)(e),c&&c(e,t),await x(),n.logger.info(`[useConflicts] Resolved conflict ${e} with strategy: ${t}`)}catch(t){throw b(t instanceof Error?t.message:"Failed to resolve conflict"),n.logger.error(`[useConflicts] Failed to resolve conflict ${e}`,t),t}finally{y(!1)}},[x,c]),S=(0,t.useCallback)(async e=>{try{for(let t of(y(!0),d))await w(t.id,e);n.logger.info(`[useConflicts] Resolved all ${d.length} conflicts with strategy: ${e}`)}catch(e){throw b(e instanceof Error?e.message:"Failed to resolve all conflicts"),n.logger.error("[useConflicts] Failed to resolve all conflicts",e),e}finally{y(!1)}},[d,w]),T=(0,t.useCallback)(async(e,t,r)=>{try{let n=await (0,a.updateConflictServerData)(e,t,r);return n&&await x(),n}catch(t){return n.logger.error(`[useConflicts] Failed to update server data for conflict ${e}`,t),null}},[x]),k=(0,t.useCallback)(async e=>{try{await (0,r.deleteConflict)(e),await x(),n.logger.info(`[useConflicts] Deleted conflict ${e}`)}catch(t){throw n.logger.error(`[useConflicts] Failed to delete conflict ${e}`,t),t}},[x]),E=(0,t.useCallback)(async()=>{try{let e=await (0,r.clearResolvedConflicts)();return await x(),n.logger.info(`[useConflicts] Cleared ${e} resolved conflicts`),e}catch(e){return n.logger.error("[useConflicts] Failed to clear resolved conflicts",e),0}},[x]),N=(0,t.useCallback)(e=>d.filter(t=>t.entityType===e),[d]);return{conflicts:d,conflictCount:p,isLoading:f,error:v,isResolving:h,resolveConflict:w,resolveAll:S,refresh:x,clearResolved:E,updateServerData:T,deleteConflict:k,getByEntityType:N}}])},656170,e=>{"use strict";var t=e.i(373985),r=e.i(786195),a=e.i(803613),n=e.i(364672),s=e.i(465418),o=e.i(190823),i=e.i(161944),l=e.i(64618),c=e.i(969912),d=e.i(392526);e.s(["SyncStatusIndicator",0,function(){let{online:e,syncing:u,lastSync:p,pendingSync:m,sync:f,retryFailed:g}=(0,o.useOffline)(),{formatTime:h}=(0,i.useTimezone)(),{t:y}=(0,l.useTranslations)(),v=m.failed>0,b=!!p||m.total>0||v;if(e&&!u&&!b)return null;let x=e?u?"syncing":v?"failed":"synced":"offline",w="offline"===x?m.total>0?y("sync.pendingItems",{count:m.total}):y("sync.savedLocallyWillSync"):"failed"===x?y("sync.failed.title",{count:m.failed}):p?y("sync.lastSynced",{time:h(p)}):y("sync.lastSyncedNever");return(0,t.jsx)("div",{role:"status","aria-live":"polite",className:"fixed bottom-4 right-4 z-toast animate-in slide-in-from-bottom duration-300",children:(0,t.jsx)(d.TooltipProvider,{children:(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsx)(d.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",onClick:()=>{"failed"===x?g():f()},disabled:u,"aria-label":w,className:(0,c.cn)("flex items-center gap-2 px-3 py-2 rounded-full shadow-hive border text-sm font-medium transition-colors",u?"cursor-wait":"cursor-pointer","offline"===x?"bg-warning-100 text-warning-800 border-warning-200":"syncing"===x?"bg-primary-100 text-primary-800 border-primary-200":"failed"===x?"bg-danger-100 text-danger-800 border-danger-200":"bg-success-50 text-success-700 border-success-200"),children:["offline"===x&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.WifiOff,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:y("sync.offline")})]}),"syncing"===x&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.RefreshCw,{className:"w-4 h-4 animate-spin"}),(0,t.jsx)("span",{children:y("sync.syncing")})]}),"failed"===x&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.AlertTriangle,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:y("sync.failed.retryAll")})]}),"synced"===x&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.CheckCircle2,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:y("sync.synced")})]})]})}),(0,t.jsx)(d.TooltipContent,{children:w})]})})})}])},975553,130438,e=>{"use strict";var t=e.i(373985),r=e.i(623955),a=e.i(715028),n=e.i(710152);e.i(264060);var s=e.i(64618),o=e.i(353463),i=e.i(62952),l=e.i(416756),c=e.i(92880),d=e.i(465418),u=e.i(685522),p=e.i(631668),m=e.i(890325),f=e.i(533184),g=e.i(589842),h=e.i(969912);e.i(168534);var y=e.i(57925);function v({isOpen:e,onClose:a,conflicts:n,onResolve:x,isResolving:w=!1}){let{t:S}=(0,s.useTranslations)(),[T,k]=(0,r.useState)(0),[E,N]=(0,r.useState)("compare");if(!n.length)return null;let C=n[T],j=T===n.length-1,A=()=>{j||k(e=>e+1)},R=async e=>{await x(C.id,e),j?a():A()};return(0,t.jsx)(l.Dialog,{open:e,onOpenChange:e=>!e&&a(),children:(0,t.jsxs)(l.DialogContent,{className:"max-w-4xl max-h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("div",{className:"p-6 border-b pb-4",children:(0,t.jsx)(c.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-warning-100 dar
3k:bg-warning-900/30 rounded-lg",children:(0,t.jsx)(d.AlertTriangle,{className:"w-5 h-5 text-warning-600 dark:text-warning-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.DialogTitle,{children:S("offline.conflictResolver.title")}),(0,t.jsx)(c.DialogDescription,{children:S("offline.conflictResolver.description",{count:n.length})})]})]}),(0,t.jsx)(o.Badge,{variant:"outline",className:"text-sm",children:S("offline.conflictResolver.conflictOf",{current:T+1,total:n.length})})]})})}),(0,t.jsxs)("div",{className:"flex-1 overflow-hidden flex flex-col lg:flex-row bg-muted/20",children:[(0,t.jsx)("div",{className:"hidden lg:block w-64 border-r bg-background overflow-y-auto",children:(0,t.jsx)("div",{className:"p-4 space-y-2",children:n.map((e,r)=>(0,t.jsxs)("button",{onClick:()=>k(r),className:(0,h.cn)("w-full text-left p-3 rounded-lg text-sm border transition-all",T===r?"bg-primary-50 border-primary-200 ring-1 ring-primary-200 dark:bg-primary-900/20 dark:border-primary-800":"bg-background border-transparent hover:bg-muted"),children:[(0,t.jsx)("div",{className:"font-medium truncate mb-1",children:b(e.entityType)}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,t.jsx)(y.RelativeDate,{date:e.createdAt}),"high"===e.severity&&(0,t.jsx)(o.Badge,{variant:"destructive",className:"text-sm h-4 px-1",children:S("offline.conflictResolver.high")})]})]},e.id))})}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden flex flex-col bg-background",children:(0,t.jsx)(i.ScrollArea,{className:"flex-1 p-6",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"bg-muted/30 rounded-lg p-4 border flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:S("offline.conflictResolver.conflictIn",{entity:b(C.entityType)})}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["ID:"," ",(0,t.jsx)("code",{className:"text-sm bg-muted px-1 py-0.5 rounded",children:C.entityId})]})]}),(0,t.jsx)("div",{className:"text-right text-sm",children:(0,t.jsx)("div",{className:"font-medium text-warning-600",children:S("offline.conflictResolver.versionMismatch",{localVersion:C.local.version,serverVersion:C.server.version})})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)(o.Card,{className:(0,h.cn)("p-4 border-2 transition-colors cursor-pointer relative overflow-hidden","hover:border-primary-400 dark:hover:border-primary-600"),children:[(0,t.jsx)("div",{className:"absolute top-0 left-0 w-full h-1 bg-primary-500"}),(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.HardDrive,{className:"w-4 h-4 text-primary-500"}),(0,t.jsx)("span",{className:"font-semibold text-primary-700 dark:text-primary-300",children:S("offline.conflictResolver.onThisDevice")})]}),(0,t.jsx)(o.Badge,{variant:"outline",className:"bg-background",children:S("offline.conflictResolver.mostRecent")})]}),(0,t.jsxs)("div",{className:"text-sm text-muted-foreground mb-4 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(f.Clock,{className:"w-3 h-3"}),C.local.lastModified.toLocaleString()]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(g.User,{className:"w-3 h-3"}),C.local.modifiedBy||S("offline.conflictResolver.you")]})]}),(0,t.jsx)("div",{className:"bg-muted/50 rounded p-3 font-mono text-sm space-y-2 max-h-60 overflow-y-auto",children:Object.entries(C.local.data).map(([e,r])=>(0,t.jsxs)("div",{className:(0,h.cn)("p-1 rounded",C.server.data[e]!==r&&"bg-warning-100 dark:bg-warning-900/30"),children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e,":"]})," ",(0,t.jsx)("span",{className:"font-medium",children:String(r)})]},e))}),(0,t.jsx)(o.Button,{className:"w-full mt-4",onClick:()=>R("use_local"),disabled:w,children:S("offline.conflictResolver.keepThisVersion")})]}),(0,t.jsxs)(o.Card,{className:(0,h.cn)("p-4 border-2 transition-colors cursor-pointer relative overflow-hidden","hover:border-ai-400 dark:hover:border-ai-600"),children:[(0,t.jsx)("div",{className:"absolute top-0 left-0 w-full h-1 bg-ai-500"}),(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Server,{className:"w-4 h-4 text-ai-500"}),(0,t.jsx)("span",{className:"font-semibold text-ai-700 dark:text-ai-300",children:S("offline.conflictResolver.serverVersion")})]})}),(0,t.jsxs)("div",{className:"text-sm text-muted-foreground mb-4 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(f.Clock,{className:"w-3 h-3"}
3),C.server.lastModified.toLocaleString()]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(g.User,{className:"w-3 h-3"}),C.server.modifiedBy||S("offline.conflictResolver.system")]})]}),(0,t.jsx)("div",{className:"bg-muted/50 rounded p-3 font-mono text-sm space-y-2 max-h-60 overflow-y-auto",children:Object.entries(C.server.data).map(([e,r])=>(0,t.jsxs)("div",{className:(0,h.cn)("p-1 rounded",C.local.data[e]!==r&&"bg-warning-100 dark:bg-warning-900/30"),children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e,":"]})," ",(0,t.jsx)("span",{className:"font-medium",children:String(r)})]},e))}),(0,t.jsx)(o.Button,{variant:"secondary",className:"w-full mt-4",onClick:()=>R("use_server"),disabled:w,children:S("offline.conflictResolver.acceptServerVersion")})]})]})]})})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-muted/10 flex justify-between items-center",children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:S("offline.conflictResolver.pendingRemaining",{count:n.length-T-1})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.Button,{variant:"ghost",onClick:a,children:S("offline.conflictResolver.resolveLater")}),j?(0,t.jsx)(o.Button,{disabled:!0,className:"opacity-0",children:S("offline.conflictResolver.next")}):(0,t.jsxs)(o.Button,{variant:"outline",onClick:A,children:[S("offline.conflictResolver.skip")," ",(0,t.jsx)(m.ArrowRight,{className:"w-4 h-4 ml-2"})]})]})]})]})})}function b(e){return e.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function x(){let[e,a]=(0,r.useState)(!1),[s,o]=(0,r.useState)(!1),{conflicts:i,isLoading:l,isResolving:c,resolveConflict:d}=(0,n.useConflicts)(),u=i.map(e=>({id:e.id,entityId:e.entityId,entityType:e.entityType,type:"version_conflict",severity:"medium",createdAt:new Date(e.createdAt),local:{version:e.localVersion??1,lastModified:new Date(e.localModifiedAt??e.createdAt),modifiedBy:e.localModifiedBy??void 0,data:e.localData||{}},server:{version:e.serverVersion??2,lastModified:new Date(e.serverModifiedAt??e.createdAt),modifiedBy:e.serverModifiedBy??void 0,data:e.serverData||{}}}));(0,r.useEffect)(()=>{!(u.length>0)||s||l||(a(!0),o(!0)),0===u.length&&o(!1)},[u.length,s,l]);let p=(0,r.useCallback)(()=>{a(!1)},[]),m=(0,r.useCallback)(async(e,t)=>{await d(e,"manual"===t?"use_local":t)},[d]);return 0===u.length?null:(0,t.jsx)(v,{isOpen:e,onClose:p,conflicts:u,onResolve:m,isResolving:c})}function w(){let{isAuthenticated:e,isLoading:r}=(0,a.useAuth)();return!e||r?null:(0,t.jsx)(x,{})}e.s(["ConflictResolver",0,v],130438),e.s(["GlobalConflictResolver",0,w,"default",0,w],975553)},563543,e=>{"use strict";let t=(0,e.i(182233).default)("cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);e.s(["Cookie",0,t],563543)},681341,e=>{"use strict";e.s(["isAndroid",0,function(){return/Android/.test(navigator.userAgent)},"isIOS",0,function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}
3,"setMobileViewportHeight",0,function(){let e=()=>{let e=window.visualViewport?window.visualViewport.height:window.innerHeight;document.documentElement.style.setProperty("--vh",`${.01*e}px`)};return e(),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),window.visualViewport&&window.visualViewport.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e),window.visualViewport&&window.visualViewport.removeEventListener("resize",e)}}])},42842,e=>{"use strict";var t=e.i(373985),r=e.i(623955),a=e.i(715028),n=e.i(512800),s=e.i(550022),o=e.i(318869),i=e.i(616048),l=e.i(508043),c=e.i(398178),d=e.i(954878),u=e.i(462719);e.s(["BrandingSync",0,function({children:e}){let{data:a,isLoading:s,error:o,refetch:l}=(0,n.useBranding)(),c=(0,i.useBrandingStore)(e=>e.setBrandingFromApi),d=(0,i.useBrandingStore)(e=>e.setRefreshCallback);return(0,r.useEffect)(()=>{c(a?.data||null,s,o)},[a,s,o,c]),(0,r.useEffect)(()=>{d(async()=>{await l()})},[l,d]),(0,t.jsx)(t.Fragment,{children:e})},"ComplexitySync",0,function({children:e}){let a=(0,d.useComplexityStore)(e=>e.hydrate);return(0,r.useEffect)(()=>{a(),(0,d.initComplexityKeyboardShortcuts)()},[a]),(0,t.jsx)(t.Fragment,{children:e})},"CurrencySync",0,function({children:e}){let{user:n}=(0,a.useAuth)(),{data:o,isLoading:i}=(0,s.useProfileSettingsData)({enabled:!!n}),c=(0,l.useCurrencyStore)(e=>e.syncFromProfile),d=(0,l.useCurrencyStore)(e=>e.setIsLoading);return(0,r.useEffect)(()=>{d(!!n&&i)},[n,i,d]),(0,r.useEffect)(()=>{o&&c(o.currency)},[o,c]),(0,t.jsx)(t.Fragment,{children:e})},"ThemeSync",0,function({children:e}){let a=(0,o.useThemeStore)(e=>e.hydrate),n=(0,o.useThemeStore)(e=>e.themeMode);return(0,r.useEffect)(()=>{let e=a();return()=>{e?.()}},[a]),(0,r.useEffect)(()=>{(0,o.setupSystemThemeListener)()},[n]),(0,t.jsx)(t.Fragment,{children:e})},"TimezoneSync",0,function({children:e}){let{user:n}=(0,a.useAuth)(),{data:o,isLoading:i}=(0,s.useProfileSettingsData)({enabled:!!n}),l=(0,c.useTimezoneStore)(e=>e.hydrateFromBrowser),d=(0,c.useTimezoneStore)(e=>e.syncFromProfile),u=(0,c.useTimezoneStore)(e=>e.setIsLoading);return(0,r.useEffect)(()=>
3{l()},[l]),(0,r.useEffect)(()=>{u(!!n&&i)},[n,i,u]),(0,r.useEffect)(()=>{o&&d({timezone:o.timezone,dateFormat:o.dateFormat})},[o,d]),(0,t.jsx)(t.Fragment,{children:e})},"UserBehaviorSync",0,function({children:e}){let a=(0,u.useUserBehaviorStore)(e=>e.hydrate);return(0,r.useEffect)(()=>{a()},[a]),(0,t.jsx)(t.Fragment,{children:e})}])},336446,e=>{"use strict";var t=e.i(453575),r=e.i(514102);let a="AES-GCM";function n(){return window.crypto&&void 0!==window.crypto.subtle}function s(e){let t=new Uint8Array(e),r="";for(let e=0;e<t.byteLength;e++)r+=String.fromCharCode(t[e]);return btoa(r)}function o(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}async function i(e,t){let r=new TextEncoder().encode(e),n=await crypto.subtle.importKey("raw",r,"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:1e5,hash:"SHA-256"},n,{name:a,length:256},!0,["encrypt","decrypt"])}async function l(){return crypto.subtle.generateKey({name:a,length:256},!0,["encrypt","decrypt"])}async function c(e,t){let r=new TextEncoder().encode(e),n=crypto.getRandomValues(new Uint8Array(12));return{ciphertext:s(await crypto.subtle.encrypt({name:a,iv:n},t,r)),iv:s(n.buffer)}}async function d(e,t,r){let n=o(e),s=new Uint8Array(o(t)),i=await crypto.subtle.decrypt({name:a,iv:s},r,n);return new TextDecoder().decode(i)}let u=null,p=null;async function m(e){if(!n())return t.logger.warn("[Encryption] Web Crypto API not supported"),!1;try{let n=await (0,r.getActiveEncryptionKey)();if(n){let r=new Uint8Array(o(n.salt));u=await i(e,r);let s=await d(n.encryptedKey,n.iv,u),l=o(s);return p=await crypto.subtle.importKey("raw",l,{name:a,length:256},!0,["encrypt","decrypt"]),t.logger.info("[Encryption] Encryption initialized with existing key"),!0}return f(e)}catch(e){return t.logger.error("[Encryption] Failed to initialize encryption",e),u=null,p=null,!1}}async function f(e){try{p=await l();let n=await crypto.subtle.exportKey("raw",p),o=s(n),d=crypto.getRandomValues(new Uint8Array(16));u=await i(e,d);let{ciphertext:m,iv:f}=await c(o,u),g=`key-${Date.now()}`;return await (0,r.storeEncryptionKey)({keyId:g,encryptedKey:m,salt:s(d.buffer),iv:f,algorithm:a,isActive:!0}),t.logger.info("[Encryption] New encryption key created and stored"),!0}catch(e){return t.logger.error("[Encryption] Failed to setup new encryption key",e),!1}}function g(){return null!==p}async function h(e){if(!p)return t.logger.warn("[Encryption] Encryption not initialized - data stored unencrypted"),null;try{let{ciphertext:t,iv:r}=await c(e,p);return`${r}:${t}`}catch(e){return t.logger.error("[Encryption] Failed to encrypt data",e),null}}async function y(e){if(!p)return t.logger.warn("[Encryption] Encryption not initialized - cannot decrypt"),null;try{let[r,a]=e.split(":");if(!r||!a)return t.logger.error("[Encryption] Invalid encrypted data format"),null;return await d(a,r,p)}catch(e){return t.logger.error("[Encryption] Failed to decrypt data",e),null}}let v="apiary-device-encryption-key";async function b(){if(!n())return t.logger.info("[Encryption] Web Crypto API not supported, skipping auto-init"),!1;if(g())return t.logger.debug("[Encryption] Already initialized"),!0;try{let e=function(){if("u"<typeof localStorage)return"ssr-fallback-key";let e=localStorage.getItem(v);return e||(e=Array.from(crypto.getRandomValues(new Uint8Array(32))).map(e=>e.toString(16).padStart(2,"0")).join(""),localStorage.setItem(v,e)),e}(),r=await m(e);return r&&t.logger.info("[Encryption] Auto-initialized with device key"),r}catch(e){return t.logger.error("[Encryption] Auto-initialization failed",e),!1}}async function x(e){return g()&&await h(e)||e}async function w(e){return e.includes(":")&&2===e.split(":").length?g()?await y(e)||e:(t.logger.warn("[Encryption] Cannot decrypt - not initialized"),e):e}e.s(["autoInitializeEncryption",0,b,"isEncryptionInitialized",0,g,"safeDecrypt",0,w,"safeEncrypt",0,x])},653793,e=>{"use strict";var t=e.i(846896),r=e.i(623955),a=e.i(657527),n=e.i(427343),s=e.i(358786),o=e.i(453575),i=e.i(57606);
3e.s(["useBackgroundSync",0,function(){let[e,t]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if("serviceWorker"in navigator&&"sync"in window)try{let e=await navigator.serviceWorker.ready;t("sync"in e)}catch{t(!1)}})()},[]);let a=(0,r.useCallback)(async t=>{if(!e)return!1;try{let e=await navigator.serviceWorker.ready;return await e.sync.register(t),!0}catch{return!1}},[e]),n=(0,r.useCallback)(async()=>{if(!e)return[];try{let e=await navigator.serviceWorker.ready;return await e.sync.getTags()}catch{return[]}},[e]),[s,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=async()=>{o((await n()).length>0)};e&&t()},[e,n]),{isSupported:e,hasPendingSync:s,registerSync:a,getSyncTags:n}},"useNetwork",0,function(){let[e,t]=(0,r.useState)("u"<typeof navigator||navigator.onLine),[a,n]=(0,r.useState)(!1),[s,o]=(0,r.useState)({type:null,effectiveType:null,downlink:null});(0,r.useEffect)(()=>{let e=()=>{t(!0),n(!0),setTimeout(()=>n(!1),100)},r=()=>{t(!1)},a=()=>{let e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;e&&o({type:e.type||null,effectiveType:e.effectiveType||null,downlink:e.downlink||null})};a(),window.addEventListener("online",e),window.addEventListener("offline",r);let s=navigator.connection;return s&&s.addEventListener("change",a),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r),s&&s.removeEventListener("change",a)}},[]);let i="2g"===s.effectiveType||"slow-2g"===s.effectiveType||null!==s.downlink&&s.downlink<1;return{isOnline:e,wasOffline:a,connectionType:s.type,effectiveType:s.effectiveType,isSlowConnection:i,downlink:s.downlink}},"usePWAInstall",0,function(){let[e,t]=(0,r.useState)(null),[a,n]=(0,r.useState)(!1),[s,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{n(window.matchMedia("(display-mode: standalone)").matches||!0===window.navigator.standalone);let e=e=>{e.preventDefault(),t(e)},r=()=>{n(!0),t(null)};window.addEventListener("beforeinstallprompt",e),window.addEventListener("appinstalled",r);let a=window.matchMedia("(display-mode: standalone)"),s=e=>{n(e.matches)};return a.addEventListener("change",s),()=>{window.removeEventListener("beforeinstallprompt",e),window.removeEventListener("appinstalled",r),a.removeEventListener("change",s)}},[]);let i=(0,r.useCallback)(async()=>{if(!e)return!1;o(!0);try{await e.prompt();let{outcome:r}=await e.userChoice;if("accepted"===r)return t(null),!0;return!1}finally{o(!1)}},[e]);return{canInstall:!!e&&!a,isInstalled:a,isPrompting:s,isServiceWorkerReady:"u">typeof navigator&&"serviceWorker"in navigator,promptInstall:i,install:i,dismissInstall:(0,r.useCallback)(()=>{t(null)},[])}},"usePWAUpdate",0,function(){let[e,a]=(0,r.useState)(!1),[n,s]=(0,r.useState)(!1),[i,l]=(0,r.useState)(null),[c,d]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!("serviceWorker"in navigator))return;t.default.env.NEXT_PUBLIC_ENABLE_SW_DEV,(async()=>{try{let e=await navigator.serviceWorker.register("/sw.js");l(e),e.waiting&&e.waiting.postMessage({type:"SKIP_WAITING"}),e.addEventListener("updatefound",()=>{let t=e.installing;t&&t.addEventListener("statechange",()=>{"installed"===t.state&&navigator.serviceWorker.controller&&(d(t),a(!0))})}),setInterval(()=>{e.update()},36e5),document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&e.update().catch(()=>{})})}catch(e){o.logger.error("Service worker registration failed",{error:e instanceof Error?e.message:String(e),errorStack:e instanceof Error?e.stack:void 0,timestamp:new Date().toISOString()})}})();let e=!!navigator.serviceWorker.controller,r=!1;navigator.serviceWorker.addEventListener("controllerchange",()=>{e&&!r&&(r=!0,window.location.reload())})},[]);let u=(0,r.useCallback)(()=>{c&&(s(!0),c.postMessage({type:"SKIP_WAITING"}))},[c]);return{updateAvailable:e,hasUpdate:e,isUpdating:n,applyUpdate:u,dismissUpdate:(0,r.useCallback)(()=>{a(!1)},[]),checkForUpdates:(0,r.useCallback)(async()=>{i&&await i.update()},[i]),registration:i}},"usePushNotificationSubscription",0,function(){let e=(0,a.useMutation)({mutationFn:async e=>{let t=await n.apiAxios.post("/api/v1/push-notifications/subscribe",{endpoint:e.endpoint,p256dh_ke
3y:e.p256dhKey,auth_key:e.authKey,user_agent:e.userAgent,device_info:e.deviceInfo});return(0,s.unwrapApiResponse)(t)},onError:e=>{(0,s.showApiError)(e,"Failed to subscribe to push notifications")}}),t=(0,a.useMutation)({mutationFn:async e=>{let t=await n.apiAxios.delete("/api/v1/push-notifications/unsubscribe",{params:{endpoint:e.endpoint}});return(0,s.unwrapApiResponse)(t)},onError:e=>{(0,s.showApiError)(e,"Failed to unsubscribe from push notifications")}});return{subscribe:(0,r.useCallback)(async t=>{try{let r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:i.ENV.VAPID_PUBLIC_KEY})).toJSON();if(!r.endpoint||!r.keys?.p256dh||!r.keys?.auth)return o.logger.error("Invalid push subscription object received."),!1;let a=navigator.userAgent,n={platform:navigator.platform,vendor:navigator.vendor,browser:navigator.brave?"Brave":a.match(/firefox|chrome|safari/i)?.[0]};return await e.mutateAsync({endpoint:r.endpoint,p256dhKey:r.keys.p256dh,authKey:r.keys.auth,userAgent:a,deviceInfo:n}),o.logger.info("Successfully subscribed to push notifications and registered with backend."),!0}catch(e){return o.logger.error("Error subscribing to push notifications:",{error:e instanceof Error?e.message:String(e),errorStack:e instanceof Error?e.stack:void 0}),!1}},[e]),unsubscribe:(0,r.useCallback)(async()=>{try{let e=await navigator.serviceWorker.ready,r=await e.pushManager.getSubscription();return r&&(await r.unsubscribe(),await t.mutateAsync({endpoint:r.endpoint}),o.logger.info("Successfully unsubscribed from push notifications and unregistered with backend.")),!0}catch(e){return o.logger.error("Error unsubscribing from push notifications:",{error:e instanceof Error?e.message:String(e),errorStack:e instanceof Error?e.stack:void 0}),!1}},[t]),subscribeMutation:e,unsubscribeMutation:t}},"usePushNotifications",0,function(){let[e,t]=(0,r.useState)("u">typeof Notification?Notification.permission:"denied"),a="u">typeof Notification,n=(0,r.useCallback)(async()=>{if(!a)return!1;try{let e=await Notification.requestPermission();return t(e),"granted"===e}catch{return!1}},[a]),s=(0,r.useCallback)(async(t,r)=>{if(a&&"granted"===e)try{let e=await navigator.serviceWorker.ready;await e.showNotification(t,r)}catch{new Notification(t,r)}},[a,e]),o=(0,r.useCallback)(async()=>n(),[n]);return{isSupported:a,permission:e,isGranted:"granted"===e,isSubscribed:"granted"===e,requestPermission:n,subscribe:o,showNotification:s}}])},935341,e=>{e.v(t=>Promise.all(["static/chunks/0g8khwpz_u73m.js"].map(t=>e.l(t))).then(()=>t(408543)))},764809,e=>{e.v(t=>Promise.all(["static/chunks/0j7jbc6_stnyh.js"].map(t=>e.l(t))).then(()=>t(699443)))},912751,e=>{e.v(t=>Promise.all(["static/chunks/06.mzs1hfjvve.js"].map(t=>e.l(t))).then(()=>t(708505)))},575703,e=>{e.v(t=>Promise.all(["static/chunks/0ul3z8szv9~t9.js"].map(t=>e.l(t))).then(()=>t(701254)))},224595,e=>{e.v(t=>Promise.all(["static/chunks/10fzy8uk0-aek.js"].map(t=>e.l(t))).then(()=>t(106913)))},597444,e=>{e.v(t=>Promise.all(["static/chunks/0d8cmz5md1g5s.js"].map(t=>e.l(t))).then(()=>t(560046)))},511206,e=>{e.v(t=>Promise.all(["static/chunks/0.8lmwrze0sfc.js"].map(t=>e.l(t))).then(()=>t(557856)))},276247,e=>{e.v(t=>Promise.all(["static/chunks/06kqkrx4u3vey.js"].map(t=>e.l(t))).then(()=>t(785913)))},228080,e=>{e.v(t=>Promise.all(["static/chunks/01tqzf1p3s0i8.js"].map(t=>e.l(t))).then(()=>t(441926)))},404669,e=>{e.v(t=>Promise.all(["static/chunks/11.oofv7kyddb.js"].map(t=>e.l(t))).then(()=>t(728962)))},576678,e=>{e.v(t=>Promise.all(["static/chunks/0_rh1jltf6nxy.js"].map(t=>e.l(t))).then(()=>t(699807)))},629617,e=>{e.v(t=>Promise.all(["static/chunks/0p05f1eq4mnq~.js"].map(t=>e.l(t))).then(()=>t(361749)))},989219,e=>{e.v(t=>Promise.all(["static/chunks/0~4airu_d0oi1.js"].map(t=>e.l(t))).then(()=>t(635213)))},197732,e=>{e.v(t=>Promise.all(["static/chunks/0nvtk67k5ffap.js"].map(t=>e.l(t))).then(()=>t(756766)))},159129,e=>{e.v(e=>Promise.resolve().then(()=>e(336446)))},714104,e=>{e.v(e=>Promise.resolve().then(()=>e(800708)))},293394,e=>{e.v(t=>Promise.all(["static/chunks/0e_ew806nefye.js"].map(t=>e.l(t))).then(()=>t(313617)))},229908,e=>{e.v(e=>Promise.resolve().then(()=>e(514102)))}]);
4
5//# sourceMappingURL=0nvzy120-sv91.js.map
6//# debugId=9fae5934-1e74-5d6d-8578-3067a3e1e39d

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