1import{d as g,c as p,a as f,o as h,e as m,ab as v,P as b,b as r,E as w,aU as P,D as C,J as x,aj as y,U as E}from"./DHvuqvus.js";const _=g({__name:"ToastAction",props:{altText:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const s=t,n=p(()=>{const{class:a,...i}=s;return i});return(a,i)=>(h(),f(r(P),b(n.value,{class:r(w)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",s.class)}),{default:m(()=>[v(a.$slots,"default")]),_:3},16,["class"]))}});function S(){const{toast:t}=C(),s=x(),n=y(),a=e=>{t({title:"Balance too low",description:e,variant:"info"}),s.hasPermission("billing")&&n.push("/billing?addBalance=true")};return{handleError:(e,d=null)=>{var l,u,c;if(e.statusCode===422&&d&&((l=e.data)!=null&&l.errors))Object.keys(e.data.errors).forEach(o=>{d.setFieldError(o,e.data.errors[o][0])});else if(e.statusCode===424)t({title:"Upgrade Plan",description:e.data.message||e.data.error||"Something went wrong. Please try again later",variant:"planlimit",action:E(_,{altText:"Upgrade Plan",onClick:()=>{n.push("/plans")}},{default:()=>"Upgrade Plan"})});else if(e.statusCode===425)a(e.data.message||e.data.error||"Something went wrong. Please try again later");else{const o=!(e!=null&&e.statusCode)||e.statusCode>=500;t({title:"Something went wrong",description:o?"The request failed on our side. Please try again.":((u=e==null?void 0:e.data)==null?void 0:u.message)||((c=e==null?void 0:e.data)==null?void 0:c.error)||"Something went wrong. Please try again later",variant:"warning"})}},handleBalanceError:a}}export{_,S as u};
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.