randmarcomps 1.643.0 → 1.644.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/randmarcomps.cjs +1 -1
- package/dist/randmarcomps.js +1 -1
- package/package.json +1 -1
package/dist/randmarcomps.cjs
CHANGED
|
@@ -72,7 +72,7 @@ ${le}`)}}catch(se){console.error("Could not load hidden SOP content:",se)}finall
|
|
|
72
72
|
|
|
73
73
|
${F}
|
|
74
74
|
|
|
75
|
-
Repeat and ask me what to change or improve until we are done creating pictures.`)},[y,s,t,d]);return e.jsxs(e.Fragment,{children:[e.jsx(De,{open:i,onOpenChange:l,children:e.jsx(Me,{className:"max-w-4xl p-0 overflow-hidden",children:S||!C?e.jsx(Xc,{}):e.jsx(e.Fragment,{children:n?e.jsxs("div",{className:"flex flex-row",children:[e.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[e.jsx("source",{src:C,type:"video/mp4"}),"Your browser does not support the video tag."]}),e.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):e.jsxs("div",{className:"w-full relative",children:[e.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[e.jsx("source",{src:C,type:"video/mp4"}),"Your browser does not support the video tag."]}),e.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:D,"aria-label":"Copy video link",children:u?e.jsx(g.Check,{className:"h-4 w-4"}):e.jsx(g.Copy,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Copy video link"})})]})}),e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:k,"aria-label":"Download video",children:e.jsx(g.Download,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Download video"})})]})})]})]})})})}),e.jsxs("div",{className:"relative w-max h-max",ref:f,children:[A?e.jsx(h,{className:"rounded-md",style:{width:m,height:m}}):y?e.jsx("img",{alt:r||`Product ${s}`,className:`rounded-md ${b?"cursor-pointer":""}`,onClick:O,src:y,width:m,height:m}):e.jsx(Zc,{size:m}),e.jsxs("div",{className:"absolute top-2 right-2 flex flex-col gap-1",children:[b==!0&&e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:O,"aria-label":"Play product video",children:e.jsx(g.Play,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Play video"})})]})}),y?e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:M,"aria-label":"Ask AI to generate product images",children:e.jsx(g.Bot,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Ask AI to generate product images"})})]})}):null]})]})]})}function ed({reseller:s,actions:t,loading:a=!1}){return a||!s?e.jsx(sd,{}):e.jsx(td,{reseller:s,actions:t})}function sd(){return e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:e.jsx(h,{className:"h-6 w-40"})})}),e.jsxs(W,{children:[e.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[e.jsx("div",{className:"space-y-4",children:Array(3).fill(0).map((s,t)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx(h,{className:"h-5 w-24"}),e.jsx(h,{className:"h-9 w-9 rounded-full"})]}),e.jsxs("div",{children:[e.jsx(h,{className:"h-4 w-20 mb-1"}),e.jsx(h,{className:"h-7 w-28"})]})]},t))}),e.jsx("div",{className:"space-y-4",children:Array(2).fill(0).map((s,t)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx(h,{className:"h-5 w-24"}),e.jsx(h,{className:"h-9 w-9 rounded-full"})]}),e.jsxs("div",{children:[e.jsx(h,{className:"h-4 w-20 mb-1"}),e.jsx(h,{className:"h-7 w-28"})]})]},t))})]}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx(h,{className:"h-10 w-28 rounded-md"})})]})]})}function td({reseller:s,actions:t}){const a=s.Statement||{},r=[{title:"0 - 30 Days",amount:a.Over0||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-primary-foreground"}),color:"bg-primary"},{title:"31 - 45 Days",amount:a.Over30||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-primary-foreground"}),color:"bg-primary"},{title:"45+ Days",amount:a.Over45||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-primary-foreground"}),color:"bg-primary"}],n=[{title:"Total",amount:a.Total||0,icon:e.jsx(g.DollarSign,{className:"h-5 w-5 text-success-foreground"}),color:"bg-success"},{title:"Credit Limit",amount:s.CreditLimit||0,icon:e.jsx(g.CreditCard,{className:"h-5 w-5 text-info-foreground"}),color:"bg-info"}];return e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:"Billing Overview"})}),e.jsxs(W,{children:[e.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[e.jsx("div",{className:"space-y-4",children:r.map((i,l)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-sm sm:text-base font-medium",children:i.title}),e.jsx("div",{className:`p-2 rounded-full ${i.color}`,children:i.icon})]}),e.jsx("div",{children:e.jsx("p",{className:"text-base sm:text-lg font-bold",children:oe(i.amount)})})]},l))}),e.jsx("div",{className:"space-y-4",children:n.map((i,l)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-sm sm:text-base font-medium",children:i.title}),e.jsx("div",{className:`p-2 rounded-full ${i.color}`,children:i.icon})]}),e.jsx("div",{children:e.jsx("p",{className:"text-base sm:text-lg font-bold",children:oe(i.amount)})})]},l))})]}),t&&e.jsx("div",{className:"flex justify-end mt-4",children:t})]})]})}function bi({qualifications:s=[],loading:t=!1}){return t?e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:"Qualifications"})}),e.jsx(W,{className:"p-6",children:e.jsx("div",{className:"grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-5 gap-4 gap-y-8",children:Array.from({length:10}).map((a,r)=>e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx(h,{className:"h-12 w-24 rounded-md mb-2"}),e.jsx(h,{className:"h-5 w-16 rounded-full"})]},r))})})]}):e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:"Qualifications"})}),e.jsx(W,{children:s&&s.length>0?e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"flex grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-5 gap-4 gap-y-8",children:s.map((a,r)=>e.jsx(ad,{manufacturerId:a.ManufacturerId,opportunityNumber:a.DefaultOpportunityNumber},`${a.ManufacturerId}-${r}`))})}):e.jsx("p",{children:"No qualification available."})})]})}function ad({manufacturerId:s,opportunityNumber:t}){return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"h-12 w-full items-center justify-center mb-2",children:e.jsx(hs,{id:s,width:96,height:48})}),t&&e.jsx(he,{variant:"outline",className:"text-xs",children:t})]})}function rd({salesData:s,salesStatistics:t=[],loading:a=!1}){return a||!s?e.jsx(nd,{}):e.jsx(id,{salesData:s,salesStatistics:t})}function nd(){return e.jsxs(q,{children:[e.jsx(J,{className:"pb-0",children:e.jsx(ce,{className:"text-lg @sm:text-xl",children:e.jsx(h,{className:"h-7 w-40"})})}),e.jsxs(W,{className:"pt-4 px-3 @sm:px-6",children:[e.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4",children:Array(3).fill(0).map((s,t)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx(h,{className:"h-5 w-24"}),e.jsx(h,{className:"h-9 w-9 rounded-full"})]}),e.jsxs("div",{children:[e.jsx(h,{className:"h-4 w-20 mb-1"}),e.jsx(h,{className:"h-7 w-28"})]})]},t))}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(h,{className:"h-5 w-32"}),e.jsx(h,{className:"h-[250px] w-full rounded-lg"})]})})]})]})}function id({salesData:s,salesStatistics:t=[]}){const a=[{title:"Last 30 days",amount:s.SalesLast30Days||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-info-foreground"}),color:"bg-info"},{title:"Last 3 months",amount:s.SalesLast3Months||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-warning-foreground"}),color:"bg-warning"},{title:"Year to date",amount:s.SalesYearToDay||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-success-foreground"}),color:"bg-success"}];return e.jsxs(q,{children:[e.jsx(J,{className:"pb-0",children:e.jsx(ce,{className:"text-lg @sm:text-xl",children:"Sales Overview"})}),e.jsxs(W,{className:"pt-4 px-3 @sm:px-6",children:[e.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4",children:a.map((r,n)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"text-sm @sm:text-base font-medium",children:r.title}),e.jsx("div",{className:`p-2 rounded-full ${r.color}`,children:r.icon})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),e.jsx("p",{className:"text-base @sm:text-lg font-bold",children:oe(r.amount)})]})]},n))}),e.jsx("div",{className:"mt-6",children:t&&t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-sm font-medium mb-4",children:"Sales Trend"}),e.jsx("div",{className:"space-y-6",children:e.jsx(zs,{statistics:t,chartHeight:300,mode:"week"})})]})})]})]})}function ld({icon:s,contentType:t,identifier:a,description:r,fields:n,actions:i,highlightedHeader:l=!1,className:u,...x}){const d=P.Children.toArray(i).filter(Boolean);return e.jsxs(q,{className:v("flex flex-col h-full overflow-hidden",u),...x,children:[e.jsx("header",{className:v("space-y-3 p-6",l&&"rounded-t-md bg-primary text-primary-foreground"),children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(s,{"aria-hidden":"true",className:v("mt-0.5 h-5 w-5 shrink-0",l?"text-primary-foreground":"text-primary")}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[e.jsx("h3",{className:v("text-base font-medium",l?"text-primary-foreground":"text-foreground"),children:t}),e.jsx("span",{className:v("font-mono text-sm",l?"text-primary-foreground":"text-foreground"),children:a})]}),e.jsx("p",{className:v("mt-1 text-sm",l?"text-primary-foreground":"text-muted-foreground"),children:r})]})]})}),e.jsx("section",{className:"flex-1 bg-card p-6",children:e.jsx("dl",{className:"grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2 lg:grid-cols-3",children:n.map((c,m)=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("dt",{className:"text-xs font-semibold text-muted-foreground",children:c.label}),e.jsx("dd",{className:"text-sm text-foreground",children:c.value??"-"})]},`${c.label}-${m}`))})}),d.length>0&&e.jsx("footer",{className:"border-t border-border p-6 pt-4",children:e.jsx("div",{className:"flex justify-end gap-3",children:d.map((c,m)=>e.jsx("div",{className:"flex items-center justify-center [&>*]:min-h-11 [&>*]:min-w-11",children:c},m))})})]})}const hr=Ze.Root,fr=Ze.Trigger,od=Ze.Portal,yi=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Overlay,{className:v("fixed inset-0 z-50 bg-foreground/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t,ref:a}));yi.displayName=Ze.Overlay.displayName;const Zt=P.forwardRef(({className:s,...t},a)=>e.jsxs(od,{children:[e.jsx(yi,{}),e.jsx(Ze.Content,{ref:a,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...t})]}));Zt.displayName=Ze.Content.displayName;const Xt=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",s),...t});Xt.displayName="AlertDialogHeader";const ea=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});ea.displayName="AlertDialogFooter";const sa=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Title,{ref:a,className:v("text-lg font-semibold",s),...t}));sa.displayName=Ze.Title.displayName;const ta=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Description,{ref:a,className:v("text-sm text-muted-foreground",s),...t}));ta.displayName=Ze.Description.displayName;const aa=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Action,{ref:a,className:v(_s(),s),...t}));aa.displayName=Ze.Action.displayName;const ra=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Cancel,{ref:a,className:v(_s({variant:"outline"}),"mt-2 sm:mt-0",s),...t}));ra.displayName=Ze.Cancel.displayName;const cd="https://assistant.randmar.io";function dd(s){if(s==null)return null;const t=s instanceof Date?s:new Date(s);return Number.isNaN(t.getTime())?null:t}function ud(s){const t=dd(s);if(!t)return"Never";const a=new Date;return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()?`Today at ${new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)}`:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)}function Ni({lastRefreshAt:s,onRefresh:t,onProgressiveRefresh:a,onAssistantClick:r,isRefreshing:n=!1,refreshLabel:i="Refresh",assistantLabel:l="Assistant",className:u,disabled:x=!1}){const[d,c]=P.useState(!1),[m,f]=P.useState(s);P.useEffect(()=>{f(s)},[s]);const p=!!(t||a),N=n||d,w=s??m,y=P.useCallback(async()=>{if(!(!p||x||N)){c(!0);try{a?(await a(!1),await a(!0)):await t?.(),f(new Date)}finally{c(!1)}}},[p,x,N,a,t]);return e.jsxs("div",{className:v("flex w-full flex-wrap items-center justify-start gap-2 lg:w-auto lg:justify-end",u),children:[e.jsxs("p",{className:"w-full text-xs text-muted-foreground sm:text-sm lg:w-auto",children:["Last refresh:"," ",e.jsx("span",{className:"font-medium text-foreground",children:ud(w)})]}),e.jsxs(E,{type:"button",variant:"outline",className:"min-h-11",disabled:x||N||!p,onClick:y,children:[N?e.jsx(g.Loader2,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):e.jsx(g.RefreshCw,{className:"h-4 w-4","aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx(E,{asChild:!0,variant:"default",className:v("min-h-11 lg:hidden",x&&"pointer-events-none opacity-50"),children:e.jsxs("a",{href:cd,target:"_blank",rel:"noopener noreferrer","aria-disabled":x||void 0,onClick:x?j=>j.preventDefault():void 0,children:[e.jsx(g.Bot,{className:"h-4 w-4","aria-hidden":"true"}),e.jsx("span",{children:l})]})}),e.jsxs(E,{type:"button",variant:"default",className:"hidden min-h-11 lg:inline-flex",disabled:x,onClick:r,children:[e.jsx(g.Bot,{className:"h-4 w-4","aria-hidden":"true"}),e.jsx("span",{children:l})]})]})}function md({onAssistantClick:s,assistantPromptOptions:t,onAssistantUnavailable:a,...r}){const n=Bn(),i=P.useCallback(()=>{if(s){s();return}if(t){if(!n){a?.();return}n.sendMessageWithClear(t.prompt,t.hiddenPrompt,t.sopID)||a?.();return}a?.()},[t,n,s,a]);return e.jsx(Ni,{...r,onAssistantClick:i})}const Yr="w-full max-w-none w-[100cqw] ml-[calc(50%-50cqw)] mr-[calc(50%-50cqw)]",vi="px-4 lg:px-6",xd=`${vi} py-4`,hd=`${vi} py-3`;function fd({item:s,isCurrent:t}){return!t&&s.href?e.jsx("a",{href:s.href,className:"text-xs font-medium text-muted-foreground underline-offset-4 transition-colors hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:s.label}):!t&&s.onClick?e.jsx("button",{type:"button",className:"text-xs font-medium text-muted-foreground underline-offset-4 transition-colors hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",onClick:s.onClick,children:s.label}):e.jsx("span",{"aria-current":t?"page":void 0,className:v("text-xs font-medium",t?"text-foreground":"text-muted-foreground"),children:s.label})}function pd({items:s}){return s.length===0?null:e.jsx("nav",{"aria-label":"Breadcrumb",className:"w-full",children:e.jsx("ol",{className:"flex flex-wrap items-center gap-1.5",children:s.map((t,a)=>{const r=a===s.length-1,n=t.key??`${String(t.label)}-${a}`;return e.jsxs("li",{className:"inline-flex items-center gap-1.5",children:[e.jsx(fd,{item:t,isCurrent:!!t.current||r}),r?null:e.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted-foreground",children:"/"})]},n)})})})}function wi({title:s,subtitle:t,breadcrumbs:a,rightTopActions:r,rightBottomActions:n,secondaryRow:i,sticky:l=!1,stickyClassName:u,className:x,cardClassName:d,contentClassName:c}){const m=!!(r||n),f=e.jsxs("header",{className:v("w-full border-b border-border bg-background",x),children:[e.jsx("div",{className:v(xd,d),children:e.jsxs("div",{className:v("flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",c),children:[e.jsxs("div",{className:"space-y-1",children:[a?.length?e.jsx(pd,{items:a}):null,e.jsx("h1",{className:"text-2xl font-semibold leading-tight tracking-tight text-foreground",children:s}),t?e.jsx("p",{className:"text-sm text-muted-foreground",children:t}):null]}),m?e.jsxs("div",{className:"flex w-full flex-col items-start gap-2 lg:w-auto lg:min-w-[16rem] lg:items-end",children:[r?e.jsx("div",{className:"flex w-full flex-wrap items-center justify-start gap-2 lg:justify-end",children:r}):null,n?e.jsx("div",{className:"flex w-full flex-wrap items-center justify-start gap-2 lg:justify-end",children:n}):null]}):null]})}),i?e.jsx("div",{className:"border-t border-border bg-primary/5",children:e.jsx("div",{className:hd,children:i})}):null]});return l?e.jsx("div",{className:Yr,children:e.jsx("div",{className:v("sticky top-0 z-20",u),children:f})}):e.jsx("div",{className:Yr,children:f})}function gd({title:s,children:t,className:a}){return e.jsx(wi,{title:s,rightBottomActions:t?e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:t}):void 0,cardClassName:a})}const Si="space-y-8",Ci="px-4 py-4 sm:px-6 sm:py-6";function jd({header:s,children:t,className:a,contentClassName:r,contentProps:n,...i}){return e.jsxs("section",{className:v(Si,a),...i,children:[s,e.jsx("div",{className:v(Ci,r),...n,children:t})]})}function bd({className:s,children:t,...a}){return e.jsx("section",{className:v("px-4 py-4 sm:px-6 sm:py-6",s),...a,children:t})}const yd=[{value:"paragraph",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"},{value:"h5",label:"Heading 5"},{value:"h6",label:"Heading 6"}],Nd=`
|
|
75
|
+
Repeat and ask me what to change or improve until we are done creating pictures.`)},[y,s,t,d]);return e.jsxs(e.Fragment,{children:[e.jsx(De,{open:i,onOpenChange:l,children:e.jsx(Me,{className:"max-w-4xl p-0 overflow-hidden",children:S||!C?e.jsx(Xc,{}):e.jsx(e.Fragment,{children:n?e.jsxs("div",{className:"flex flex-row",children:[e.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[e.jsx("source",{src:C,type:"video/mp4"}),"Your browser does not support the video tag."]}),e.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):e.jsxs("div",{className:"w-full relative",children:[e.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[e.jsx("source",{src:C,type:"video/mp4"}),"Your browser does not support the video tag."]}),e.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:D,"aria-label":"Copy video link",children:u?e.jsx(g.Check,{className:"h-4 w-4"}):e.jsx(g.Copy,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Copy video link"})})]})}),e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:k,"aria-label":"Download video",children:e.jsx(g.Download,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Download video"})})]})})]})]})})})}),e.jsxs("div",{className:"relative w-max h-max",ref:f,children:[A?e.jsx(h,{className:"rounded-md",style:{width:m,height:m}}):y?e.jsx("img",{alt:r||`Product ${s}`,className:`rounded-md ${b?"cursor-pointer":""}`,onClick:O,src:y,width:m,height:m}):e.jsx(Zc,{size:m}),e.jsxs("div",{className:"absolute top-2 right-2 flex flex-col gap-1",children:[b==!0&&e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:O,"aria-label":"Play product video",children:e.jsx(g.Play,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Play video"})})]})}),y?e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(je,{asChild:!0,children:e.jsx(E,{variant:"secondary",size:"icon",onClick:M,"aria-label":"Ask AI to generate product images",children:e.jsx(g.Bot,{className:"h-4 w-4"})})}),e.jsx(fe,{children:e.jsx("p",{children:"Ask AI to generate product images"})})]})}):null]})]})]})}function ed({reseller:s,actions:t,loading:a=!1}){return a||!s?e.jsx(sd,{}):e.jsx(td,{reseller:s,actions:t})}function sd(){return e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:e.jsx(h,{className:"h-6 w-40"})})}),e.jsxs(W,{children:[e.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[e.jsx("div",{className:"space-y-4",children:Array(3).fill(0).map((s,t)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx(h,{className:"h-5 w-24"}),e.jsx(h,{className:"h-9 w-9 rounded-full"})]}),e.jsxs("div",{children:[e.jsx(h,{className:"h-4 w-20 mb-1"}),e.jsx(h,{className:"h-7 w-28"})]})]},t))}),e.jsx("div",{className:"space-y-4",children:Array(2).fill(0).map((s,t)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx(h,{className:"h-5 w-24"}),e.jsx(h,{className:"h-9 w-9 rounded-full"})]}),e.jsxs("div",{children:[e.jsx(h,{className:"h-4 w-20 mb-1"}),e.jsx(h,{className:"h-7 w-28"})]})]},t))})]}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx(h,{className:"h-10 w-28 rounded-md"})})]})]})}function td({reseller:s,actions:t}){const a=s.Statement||{},r=[{title:"0 - 30 Days",amount:a.Over0||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-primary-foreground"}),color:"bg-primary"},{title:"31 - 45 Days",amount:a.Over30||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-primary-foreground"}),color:"bg-primary"},{title:"45+ Days",amount:a.Over45||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-primary-foreground"}),color:"bg-primary"}],n=[{title:"Total",amount:a.Total||0,icon:e.jsx(g.DollarSign,{className:"h-5 w-5 text-success-foreground"}),color:"bg-success"},{title:"Credit Limit",amount:s.CreditLimit||0,icon:e.jsx(g.CreditCard,{className:"h-5 w-5 text-info-foreground"}),color:"bg-info"}];return e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:"Billing Overview"})}),e.jsxs(W,{children:[e.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[e.jsx("div",{className:"space-y-4",children:r.map((i,l)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-sm sm:text-base font-medium",children:i.title}),e.jsx("div",{className:`p-2 rounded-full ${i.color}`,children:i.icon})]}),e.jsx("div",{children:e.jsx("p",{className:"text-base sm:text-lg font-bold",children:oe(i.amount)})})]},l))}),e.jsx("div",{className:"space-y-4",children:n.map((i,l)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-sm sm:text-base font-medium",children:i.title}),e.jsx("div",{className:`p-2 rounded-full ${i.color}`,children:i.icon})]}),e.jsx("div",{children:e.jsx("p",{className:"text-base sm:text-lg font-bold",children:oe(i.amount)})})]},l))})]}),t&&e.jsx("div",{className:"flex justify-end mt-4",children:t})]})]})}function bi({qualifications:s=[],loading:t=!1}){return t?e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:"Qualifications"})}),e.jsx(W,{className:"p-6",children:e.jsx("div",{className:"grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-5 gap-4 gap-y-8",children:Array.from({length:10}).map((a,r)=>e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx(h,{className:"h-12 w-24 rounded-md mb-2"}),e.jsx(h,{className:"h-5 w-16 rounded-full"})]},r))})})]}):e.jsxs(q,{children:[e.jsx(J,{children:e.jsx(ce,{children:"Qualifications"})}),e.jsx(W,{children:s&&s.length>0?e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"flex grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-5 gap-4 gap-y-8",children:s.map((a,r)=>e.jsx(ad,{manufacturerId:a.ManufacturerId,opportunityNumber:a.DefaultOpportunityNumber},`${a.ManufacturerId}-${r}`))})}):e.jsx("p",{children:"No qualification available."})})]})}function ad({manufacturerId:s,opportunityNumber:t}){return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"h-12 w-full items-center justify-center mb-2",children:e.jsx(hs,{id:s,width:96,height:48})}),t&&e.jsx(he,{variant:"outline",className:"text-xs",children:t})]})}function rd({salesData:s,salesStatistics:t=[],loading:a=!1}){return a||!s?e.jsx(nd,{}):e.jsx(id,{salesData:s,salesStatistics:t})}function nd(){return e.jsxs(q,{children:[e.jsx(J,{className:"pb-0",children:e.jsx(ce,{className:"text-lg @sm:text-xl",children:e.jsx(h,{className:"h-7 w-40"})})}),e.jsxs(W,{className:"pt-4 px-3 @sm:px-6",children:[e.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4",children:Array(3).fill(0).map((s,t)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx(h,{className:"h-5 w-24"}),e.jsx(h,{className:"h-9 w-9 rounded-full"})]}),e.jsxs("div",{children:[e.jsx(h,{className:"h-4 w-20 mb-1"}),e.jsx(h,{className:"h-7 w-28"})]})]},t))}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(h,{className:"h-5 w-32"}),e.jsx(h,{className:"h-[250px] w-full rounded-lg"})]})})]})]})}function id({salesData:s,salesStatistics:t=[]}){const a=[{title:"Last 30 days",amount:s.SalesLast30Days||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-info-foreground"}),color:"bg-info"},{title:"Last 3 months",amount:s.SalesLast3Months||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-warning-foreground"}),color:"bg-warning"},{title:"Year to date",amount:s.SalesYearToDay||0,icon:e.jsx(g.Calendar,{className:"h-5 w-5 text-success-foreground"}),color:"bg-success"}];return e.jsxs(q,{children:[e.jsx(J,{className:"pb-0",children:e.jsx(ce,{className:"text-lg @sm:text-xl",children:"Sales Overview"})}),e.jsxs(W,{className:"pt-4 px-3 @sm:px-6",children:[e.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4",children:a.map((r,n)=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"text-sm @sm:text-base font-medium",children:r.title}),e.jsx("div",{className:`p-2 rounded-full ${r.color}`,children:r.icon})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),e.jsx("p",{className:"text-base @sm:text-lg font-bold",children:oe(r.amount)})]})]},n))}),e.jsx("div",{className:"mt-6",children:t&&t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-sm font-medium mb-4",children:"Sales Trend"}),e.jsx("div",{className:"space-y-6",children:e.jsx(zs,{statistics:t,chartHeight:300,mode:"week"})})]})})]})]})}function ld({icon:s,contentType:t,identifier:a,description:r,fields:n,actions:i,highlightedHeader:l=!1,className:u,...x}){const d=P.Children.toArray(i).filter(Boolean);return e.jsxs(q,{className:v("flex flex-col h-full overflow-hidden",u),...x,children:[e.jsx("header",{className:v("space-y-3 p-6",l&&"rounded-t-md bg-primary text-primary-foreground"),children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(s,{"aria-hidden":"true",className:v("mt-0.5 h-5 w-5 shrink-0",l?"text-primary-foreground":"text-primary")}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[e.jsx("h3",{className:v("text-base font-medium",l?"text-primary-foreground":"text-foreground"),children:t}),e.jsx("span",{className:v("font-mono text-sm",l?"text-primary-foreground":"text-foreground"),children:a})]}),e.jsx("p",{className:v("mt-1 text-sm",l?"text-primary-foreground":"text-muted-foreground"),children:r})]})]})}),e.jsx("section",{className:"flex-1 bg-card p-6",children:e.jsx("dl",{className:"grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2 lg:grid-cols-3",children:n.map((c,m)=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("dt",{className:"text-xs font-semibold text-muted-foreground",children:c.label}),e.jsx("dd",{className:"text-sm text-foreground",children:c.value??"-"})]},`${c.label}-${m}`))})}),d.length>0&&e.jsx("footer",{className:"border-t border-border p-6 pt-4",children:e.jsx("div",{className:"flex justify-end gap-3",children:d.map((c,m)=>e.jsx("div",{className:"flex items-center justify-center [&>*]:min-h-11 [&>*]:min-w-11",children:c},m))})})]})}const hr=Ze.Root,fr=Ze.Trigger,od=Ze.Portal,yi=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Overlay,{className:v("fixed inset-0 z-50 bg-foreground/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t,ref:a}));yi.displayName=Ze.Overlay.displayName;const Zt=P.forwardRef(({className:s,...t},a)=>e.jsxs(od,{children:[e.jsx(yi,{}),e.jsx(Ze.Content,{ref:a,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...t})]}));Zt.displayName=Ze.Content.displayName;const Xt=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",s),...t});Xt.displayName="AlertDialogHeader";const ea=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});ea.displayName="AlertDialogFooter";const sa=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Title,{ref:a,className:v("text-lg font-semibold",s),...t}));sa.displayName=Ze.Title.displayName;const ta=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Description,{ref:a,className:v("text-sm text-muted-foreground",s),...t}));ta.displayName=Ze.Description.displayName;const aa=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Action,{ref:a,className:v(_s(),s),...t}));aa.displayName=Ze.Action.displayName;const ra=P.forwardRef(({className:s,...t},a)=>e.jsx(Ze.Cancel,{ref:a,className:v(_s({variant:"outline"}),"mt-2 sm:mt-0",s),...t}));ra.displayName=Ze.Cancel.displayName;const cd="https://randmar.ai";function dd(s){if(s==null)return null;const t=s instanceof Date?s:new Date(s);return Number.isNaN(t.getTime())?null:t}function ud(s){const t=dd(s);if(!t)return"Never";const a=new Date;return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()?`Today at ${new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)}`:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)}function Ni({lastRefreshAt:s,onRefresh:t,onProgressiveRefresh:a,onAssistantClick:r,isRefreshing:n=!1,refreshLabel:i="Refresh",assistantLabel:l="Assistant",className:u,disabled:x=!1}){const[d,c]=P.useState(!1),[m,f]=P.useState(s);P.useEffect(()=>{f(s)},[s]);const p=!!(t||a),N=n||d,w=s??m,y=P.useCallback(async()=>{if(!(!p||x||N)){c(!0);try{a?(await a(!1),await a(!0)):await t?.(),f(new Date)}finally{c(!1)}}},[p,x,N,a,t]);return e.jsxs("div",{className:v("flex w-full flex-wrap items-center justify-start gap-2 lg:w-auto lg:justify-end",u),children:[e.jsxs("p",{className:"w-full text-xs text-muted-foreground sm:text-sm lg:w-auto",children:["Last refresh:"," ",e.jsx("span",{className:"font-medium text-foreground",children:ud(w)})]}),e.jsxs(E,{type:"button",variant:"outline",className:"min-h-11",disabled:x||N||!p,onClick:y,children:[N?e.jsx(g.Loader2,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):e.jsx(g.RefreshCw,{className:"h-4 w-4","aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx(E,{asChild:!0,variant:"default",className:v("min-h-11 lg:hidden",x&&"pointer-events-none opacity-50"),children:e.jsxs("a",{href:cd,target:"_blank",rel:"noopener noreferrer","aria-disabled":x||void 0,onClick:x?j=>j.preventDefault():void 0,children:[e.jsx(g.Bot,{className:"h-4 w-4","aria-hidden":"true"}),e.jsx("span",{children:l})]})}),e.jsxs(E,{type:"button",variant:"default",className:"hidden min-h-11 lg:inline-flex",disabled:x,onClick:r,children:[e.jsx(g.Bot,{className:"h-4 w-4","aria-hidden":"true"}),e.jsx("span",{children:l})]})]})}function md({onAssistantClick:s,assistantPromptOptions:t,onAssistantUnavailable:a,...r}){const n=Bn(),i=P.useCallback(()=>{if(s){s();return}if(t){if(!n){a?.();return}n.sendMessageWithClear(t.prompt,t.hiddenPrompt,t.sopID)||a?.();return}a?.()},[t,n,s,a]);return e.jsx(Ni,{...r,onAssistantClick:i})}const Yr="w-full max-w-none w-[100cqw] ml-[calc(50%-50cqw)] mr-[calc(50%-50cqw)]",vi="px-4 lg:px-6",xd=`${vi} py-4`,hd=`${vi} py-3`;function fd({item:s,isCurrent:t}){return!t&&s.href?e.jsx("a",{href:s.href,className:"text-xs font-medium text-muted-foreground underline-offset-4 transition-colors hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:s.label}):!t&&s.onClick?e.jsx("button",{type:"button",className:"text-xs font-medium text-muted-foreground underline-offset-4 transition-colors hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",onClick:s.onClick,children:s.label}):e.jsx("span",{"aria-current":t?"page":void 0,className:v("text-xs font-medium",t?"text-foreground":"text-muted-foreground"),children:s.label})}function pd({items:s}){return s.length===0?null:e.jsx("nav",{"aria-label":"Breadcrumb",className:"w-full",children:e.jsx("ol",{className:"flex flex-wrap items-center gap-1.5",children:s.map((t,a)=>{const r=a===s.length-1,n=t.key??`${String(t.label)}-${a}`;return e.jsxs("li",{className:"inline-flex items-center gap-1.5",children:[e.jsx(fd,{item:t,isCurrent:!!t.current||r}),r?null:e.jsx("span",{"aria-hidden":"true",className:"text-xs text-muted-foreground",children:"/"})]},n)})})})}function wi({title:s,subtitle:t,breadcrumbs:a,rightTopActions:r,rightBottomActions:n,secondaryRow:i,sticky:l=!1,stickyClassName:u,className:x,cardClassName:d,contentClassName:c}){const m=!!(r||n),f=e.jsxs("header",{className:v("w-full border-b border-border bg-background",x),children:[e.jsx("div",{className:v(xd,d),children:e.jsxs("div",{className:v("flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",c),children:[e.jsxs("div",{className:"space-y-1",children:[a?.length?e.jsx(pd,{items:a}):null,e.jsx("h1",{className:"text-2xl font-semibold leading-tight tracking-tight text-foreground",children:s}),t?e.jsx("p",{className:"text-sm text-muted-foreground",children:t}):null]}),m?e.jsxs("div",{className:"flex w-full flex-col items-start gap-2 lg:w-auto lg:min-w-[16rem] lg:items-end",children:[r?e.jsx("div",{className:"flex w-full flex-wrap items-center justify-start gap-2 lg:justify-end",children:r}):null,n?e.jsx("div",{className:"flex w-full flex-wrap items-center justify-start gap-2 lg:justify-end",children:n}):null]}):null]})}),i?e.jsx("div",{className:"border-t border-border bg-primary/5",children:e.jsx("div",{className:hd,children:i})}):null]});return l?e.jsx("div",{className:Yr,children:e.jsx("div",{className:v("sticky top-0 z-20",u),children:f})}):e.jsx("div",{className:Yr,children:f})}function gd({title:s,children:t,className:a}){return e.jsx(wi,{title:s,rightBottomActions:t?e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:t}):void 0,cardClassName:a})}const Si="space-y-8",Ci="px-4 py-4 sm:px-6 sm:py-6";function jd({header:s,children:t,className:a,contentClassName:r,contentProps:n,...i}){return e.jsxs("section",{className:v(Si,a),...i,children:[s,e.jsx("div",{className:v(Ci,r),...n,children:t})]})}function bd({className:s,children:t,...a}){return e.jsx("section",{className:v("px-4 py-4 sm:px-6 sm:py-6",s),...a,children:t})}const yd=[{value:"paragraph",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"},{value:"h5",label:"Heading 5"},{value:"h6",label:"Heading 6"}],Nd=`
|
|
76
76
|
.ProseMirror {
|
|
77
77
|
min-height: 150px;
|
|
78
78
|
padding: 0.5rem;
|
package/dist/randmarcomps.js
CHANGED
|
@@ -11721,7 +11721,7 @@ const yn = P.forwardRef(({ className: t, ...r }, n) => /* @__PURE__ */ e(
|
|
|
11721
11721
|
}
|
|
11722
11722
|
));
|
|
11723
11723
|
yn.displayName = tt.Cancel.displayName;
|
|
11724
|
-
const Zm = "https://
|
|
11724
|
+
const Zm = "https://randmar.ai";
|
|
11725
11725
|
function Xm(t) {
|
|
11726
11726
|
if (t == null) return null;
|
|
11727
11727
|
const r = t instanceof Date ? t : new Date(t);
|