import{s as y,A as x,p as l,h as B,x as C,c,a as o,b as e,F as w,r as S,i as z,e as L,g as T,o as a,j as _,d as $,u as i,k as A,t as k,n as N,O as V,q as f}from"./app-13978987.js";import j from"./OverviewGrid-21ea6fc2.js";import{_ as D}from"./PageHeader-8c638686.js";import{_ as H}from"./UserLayout-6a50516d.js";import{_ as I}from"./NoDataFound-bc81d7fa.js";import"./dropdown-45d66330.js";const O={class:"container flex-grow p-4 sm:p-6"},E={class:"mt-8"},F={class:"grid grid-cols-1 gap-8 lg:grid-cols-3"},M={class:"flex items-center justify-start gap-4 border-b border-primary-600 pb-8"},q={alt:"image",class:"h-full w-full rounded-full"},R={class:"text-sm capitalize text-gray-500"},G=["onClick"],J=e("i",{class:"bx bx-bookmark-alt-minus text-xl"},null,-1),K=[J],P=["innerHTML"],Q=T({layout:H}),ts=Object.assign(Q,{__name:"Index",props:["templates","credits","bookmarked","segments"],setup(r){const n=r,{textExcerpt:d,uiAvatar:h,trim:p}=y(),g=x(()=>{var t;return[{value:n.templates.length,title:l("AI Tools"),iconSrc:"/assets/dashboard/images/icon/icon_43.svg"},{value:((t=n.bookmarked)==null?void 0:t.length)??0,title:l("Bookmarked"),iconSrc:"/assets/dashboard/images/icon/icon_13.svg"},{value:n.credits,title:l("Credits"),iconSrc:"/assets/dashboard/images/icon/money.png"}]}),b=(t,m)=>{V.post(route("user.ai-tools.bookmark"),{ai_template_id:t},{onSuccess:()=>{m==1?f.danger("Bookmarked Removed Successfully"):f.success("Bookmarked Successfully")}})};return(t,m)=>{const u=B("Link"),v=C("lazy");return a(),c("main",O,[o(D,{title:"AI Tools",buttons:[]}),o(j,{items:g.value,grid:"3"},null,8,["items"]),e("div",E,[e("div",F,[(a(!0),c(w,null,S(r.templates,s=>(a(),c("div",{key:s.id,class:"card card-body"},[e("div",M,[o(u,{href:t.route("user.ai-tools.show",s.uuid),class:"logo h-16 min-w-[4rem]"},{default:_(()=>[$(e("img",q,null,512),[[v,i(h)(s.title,s.icon)]])]),_:2},1032,["href"]),e("div",null,[o(u,{href:t.route("user.ai-tools.show",s.uuid),class:"font-semibold capitalize"},{default:_(()=>[A(k(i(d)(s.title,65)),1)]),_:2},1032,["href"]),e("p",R,k(i(p)(s.prompt_type)),1)]),e("button",{onClick:U=>b(s.id,s.isBookmarked),type:"button",class:N(["btn ml-auto h-10 w-10 rounded-full",{"btn-primary":s.isBookmarked==1,"btn-outline-primary":s.isBookmarked==0}])},K,10,G)]),e("div",{innerHTML:i(d)(t.sanitizeHtml(s.description),100),class:"pt-5"},null,8,P)]))),128))]),r.templates.length<1?(a(),z(I,{key:0})):L("",!0)])])}}});export{ts as default};
