import{A as x,p as a,s as k,m as C,h as b,c,a as l,b as t,t as s,u as o,w as g,d as D,f as F,F as N,r as T,i as $,g as A,o as n,j as B,k as G}from"./app-13978987.js";import{h as I}from"./moment-a9aaa855.js";import{_ as M}from"./NoDataFound-bc81d7fa.js";import S from"./OverviewGrid-21ea6fc2.js";import{_ as V}from"./Paginate-f61b79b2.js";import{_ as Y}from"./PageHeader-8c638686.js";import{_ as j}from"./UserLayout-6a50516d.js";import"./dropdown-45d66330.js";const L={class:"container flex-grow p-4 sm:p-6"},R={class:"my-3 flex items-center justify-end gap-x-2"},E={class:"dropdown","data-placement":"bottom-end"},z={class:"dropdown-toggle"},H={type:"button",class:"btn bg-white font-medium shadow-sm dark:bg-slate-800"},O={class:"dropdown-content w-72 !overflow-visible"},U={class:"dropdown-list space-y-4 p-4"},W={class:"dropdown-list-item"},q={class:"my-1 text-sm font-medium"},J={class:"mb-2"},K={value:"active"},P={value:"inactive"},Q={class:"dropdown-list-item"},X={type:"submit",class:"btn btn-primary w-full"},Z={class:"table-responsive whitespace-nowrap rounded-primary"},tt={class:"table"},st={class:"text-end"},et={key:0},ot={class:"capitalize"},at={class:"text-left"},lt={class:"text-end"},nt=A({layout:j}),ft=Object.assign(nt,{__name:"Index",props:["aiGenerated","total","totalCharges","totalResults","segments"],setup(i){const d=i,v=x(()=>[{value:d.total,title:a("Total"),iconClass:"bx:receipt"},{value:d.totalCharges,title:a("Total Charges"),iconClass:"bx:dollar"},{value:d.totalResults,title:a("Total Results"),iconClass:"bx:food-menu"}]),{pickBy:it,textExcerpt:m,trim:y}=k(),_=C({order:"active"});return(u,r)=>{const p=b("Icon"),w=b("Link");return n(),c("main",L,[l(Y,{title:"AI History",buttons:[]}),l(S,{items:v.value,grid:"3"},null,8,["items"]),t("div",R,[t("div",E,[t("div",z,[t("button",H,[l(p,{icon:"fe:filter"}),t("span",null,s(o(a)("Filter")),1),l(p,{icon:"bx:chevron-down"})])]),t("div",O,[t("form",{onSubmit:r[1]||(r[1]=g(e=>u.filterData.get(u.route("user.ai-generated-history.index")),["prevent"]))},[t("ul",U,[t("li",W,[t("h2",q,s(o(a)("Status")),1),t("div",J,[D(t("select",{class:"select",name:"type","onUpdate:modelValue":r[0]||(r[0]=e=>_.value.order=e)},[t("option",K,s(o(a)("Active")),1),t("option",P,s(o(a)("Inactive")),1)],512),[[F,_.value.order]])])]),t("li",Q,[t("button",X,s(o(a)("Filter")),1)])])],32)])])]),t("div",Z,[t("table",tt,[t("thead",null,[t("tr",null,[t("th",null,s(o(a)("Generated For")),1),t("th",null,s(o(a)("Title/Name")),1),t("th",null,s(o(a)("Charge")),1),t("th",null,s(o(a)("Total Words")),1),t("th",null,s(o(a)("Content")),1),t("th",null,[t("p",st,s(o(a)("Date")),1)])])]),i.aiGenerated.total>0?(n(),c("tbody",et,[(n(!0),c(N,null,T(i.aiGenerated.data,e=>(n(),c("tr",{key:e.id},[t("td",ot,s(o(y)(e.type??"N/A")),1),t("td",null,[l(w,{class:"underline",href:u.route("user.ai-generated-history.edit",e.uuid)},{default:B(()=>{var h,f;return[G(s(o(m)(((h=e==null?void 0:e.generatable)==null?void 0:h.title)||((f=e==null?void 0:e.generatable)==null?void 0:f.name)||"N/A",30)),1)]}),_:2},1032,["href"])]),t("td",null,s(e.charge),1),t("td",null,s(e.length),1),t("td",null,s(o(m)(e.content,100)),1),t("td",at,[t("p",lt,s(o(I)(e.updated_at).format("DD MMM, YYYY")),1)])]))),128))])):(n(),$(M,{key:1,"for-table":!0}))])]),l(V,{links:i.aiGenerated.links},null,8,["links"])])}}});export{ft as default};
