PageSourceSearch

https://app.knockknockapp.ai/assets/List-7W-FzeA-.js

js knockknockapp.ai collected 2026-10-01 16:41:04 UTC 16,217 bytes, 1 lines download raw bytes

1import{l,m as d,q as e,B as o,z as v,u as a,J as i,D as c,K as n,F as Z,v as H,y,Y as J,W as j,p as x,X as O,a6 as W,r as _,e as D,C as p,H as X}from"./vue-vendor-c0W5WEtO.js";import{u as ee,b as te,c as se}from"./query-vendor-BMwEzNLN.js";import{g as ae,d as re}from"./packages-CPtJ0n9D.js";import{t as A}from"./index-B2Yag7Gu.js";import{al as T,af as N,a_ as $,R as h,c as oe,aT as le,Z as ie,a6 as F,x as z,w as de,g as ne,d1 as xe,V as B,B as ce,P as ge,bQ as ue}from"./ui-vendor-B7SopUXd.js";import"./date-vendor-HBGOQ70J.js";import"./twilio-DAuME2Y9.js";import"./charts-BVdrK9wF.js";import"./socket-Kk_l3rvZ.js";const be={class:"mb-8"},me={class:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"},ye={class:"mt-6 flex flex-wrap items-center gap-4 rounded-xl border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50"},fe={class:"flex items-center gap-3"},ve={class:"inline-flex overflow-hidden rounded-lg border border-gray-200 bg-white dark:border-gray-600 dark:bg-gray-700"},pe={class:"ml-auto text-sm text-gray-500 dark:text-gray-400"},ke={class:"font-medium text-gray-700 dark:text-gray-200"},_e={key:0,class:"flex items-center justify-center rounded-2xl border border-gray-200 bg-white py-16 dark:border-gray-700 dark:bg-gray-800"},he={class:"text-center"},we={class:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-teal-50 dark:bg-teal-500/10"},ze={key:1,class:"rounded-2xl border border-red-200 bg-red-50 p-6 dark:border-red-500/30 dark:bg-red-500/10"},Ce={class:"flex items-start gap-4"},Pe={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-500/20"},Me={class:"mt-1 text-sm text-red-700 dark:text-red-400"},je={key:2,class:"flex flex-col items-center justify-center rounded-2xl border border-gray-200 bg-white py-16 dark:border-gray-700 dark:bg-gray-800"},De={class:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 dark:bg-gray-700"},Ae={class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},Te={key:3,class:"grid gap-6 md:grid-cols-2 xl:grid-cols-3"},Ne={key:0,class:"absolute top-4 -right-8 z-10 rotate-45 bg-linear-to-r from-amber-500 to-orange-500 px-10 py-1 text-xs font-bold text-white shadow-lg"},$e={class:"relative mb-4 flex items-center justify-between"},Fe={class:"flex flex-wrap gap-2"},Be={class:"relative mt-4 flex items-end gap-2"},Se={class:"flex items-baseline"},Ve={class:"mb-1 flex flex-col"},Le={class:"text-xs font-semibold tracking-wide text-white/50 uppercase"},qe={class:"flex flex-1 flex-col p-6 pt-4"},Ee={class:"mb-5 line-clamp-2 text-sm leading-relaxed text-gray-600 dark:text-gray-400"},Ie={class:"mb-5 grid grid-cols-2 gap-3"},Re={class:"rounded-xl border border-gray-100 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-700/50"},Ue={class:"flex items-center gap-2"},Qe={class:"mt-1 text-lg font-bold text-gray-900 dark:text-white"},Ke={class:"rounded-xl border border-gray-100 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-700/50"},Ge={class:"flex items-center gap-2"},Ye={class:"mt-1 text-lg font-bold text-gray-900 dark:text-white"},Ze={class:"rounded-xl border border-gray-100 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-700/50"},He={class:"flex items-center gap-2"},Je={class:"mt-1 text-lg font-bold text-gray-900 dark:text-white"},Oe={class:"rounded-xl border border-gray-100 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-700/50"},We={class:"flex items-center gap-2"},Xe={class:"mt-1 text-lg font-bold text-gray-900 dark:text-white"},et={class:"mb-5"},tt={class:"flex flex-wrap gap-1.5"},st={key:0,class:"inline-flex items-center gap-1 rounded-full bg-teal-500/10 px-2.5 py-1 text-xs font-medium text-teal-700 dark:bg-teal-500/20 dark:text-teal-400"},at={key:1,class:"inline-flex items-center gap-1 rounded-full bg-teal-500/10 px-2.5 py-1 text-xs font-medium text-teal-700 dark:bg-teal-500/20 dark:text-teal-400"},rt={key:2,class:"inline-flex items-center gap-1 rounded-full bg-teal-500/10 px-2.5 py-1 text-xs font-medium text-teal-700 dark:bg-teal-500/20 dark:text-teal-400"},ot={key:3,class:"inline-flex items-center gap-1 rounded-full bg-teal-500/10 px-2.5 py-1 text-xs font-medium text-teal-700 dark:bg-teal-500/20 dark:text-teal-400"},lt={key:4,class:"inline-flex items-center gap-1 rounded-full bg-teal-500/10 px-2.5 py-1 text-xs font-medium text-teal-700 dark:bg-teal-500/20 dark:text-teal-400"},it={key:5,class:"inline-flex items-center gap-1 rounded-full bg-teal-500/10 px-2.5 py-1 text-xs font-medium text-teal-700 dark:bg-teal-500/20 dark:text-teal-400"},dt={key:6,class:"text-xs text-gray-400 italic dark:text-gray-500"},nt={class:"mt-auto flex gap-2"},xt=["onClick","disabled"],ct={key:0,class:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-2xl dark:border-gray-700 dark:bg-gray-800"},gt={class:"flex items-start gap-4"},ut={class:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-500/20"},bt={class:"flex-1"},mt={class:"mt-2 text-sm text-gray-600 dark:text-gray-400"},yt={class:"font-semibold text-gray-900 dark:text-white"},ft={class:"mt-6 flex justify-end gap-3"},vt=["disabled"],Dt={__name:"List",setup(pt){const S=ee(),u=_(!1),b=_(null),m=_(!1),f=_(null),C=D(()=>({visibility:u.value?"private":"public",sort:"created_at",order:-1})),{isPending:V,isError:L,error:q,data:E,refetch:P}=te({queryKey:["admin","packages",C],queryFn:()=>ae(C.value)}),k=D(()=>E.value?.packages||[]),{mutate:I}=se({mutationFn:r=>re(r),onMutate:r=>{b.value=r},onSuccess:()=>{S.invalidateQueries({queryKey:["admin","packages"]}),A.success("Package deleted successfully"),m.value=!1,f.value=null},onError:r=>{A.error(r.response?.data?.message||"Failed to delete package")},onSettled:()=>{b.value=null}}),R=r=>{f.value=r,m.value=!0},U=()=>{f.value&&I(f.value._id)},Q=r=>
1r?r%1===0?r.toString():r.toFixed(2):"0",w=(r,t)=>{if(!r)return r;const g=parseInt(r.replace("#",""),16),s=Math.round(2.55*t),M=Math.max(0,Math.min(255,(g>>16)+s)),G=Math.max(0,Math.min(255,(g>>8&255)+s)),Y=Math.max(0,Math.min(255,(g&255)+s));return`#${(16777216+M*65536+G*256+Y).toString(16).slice(1)}`},K=r=>r.features?r.features.live_sessions||r.features.recorded_sessions||r.features.ai_chatbot||r.features.video_calls||r.features.audio_calls||r.features.teams:!1;return(r,t)=>{const g=W("router-link");return l(),d("div",null,[e("div",be,[e("div",me,[t[6]||(t[6]=e("div",null,[e("h1",{class:"text-2xl font-bold text-gray-900 dark:text-white"},"Packages"),e("p",{class:"mt-1 text-sm text-gray-500 dark:text-gray-400"}," Manage subscription packages and pricing plans ")],-1)),o(g,{to:"/admin/packages/create",class:"inline-flex items-center gap-2 rounded-xl bg-linear-to-r from-teal-500 to-teal-600 px-5 py-2.5 text-sm font-semibold text-white shadow-lg shadow-teal-500/25 transition-all hover:from-teal-600 hover:to-teal-700 hover:shadow-xl hover:shadow-teal-500/30 dark:shadow-teal-500/10 dark:hover:shadow-teal-500/20"},{default:v(()=>[o(a(T),{size:18}),t[5]||(t[5]=i(" Create Package ",-1))]),_:1})]),e("div",ye,[e("div",fe,[t[9]||(t[9]=e("span",{class:"text-sm font-medium text-gray-600 dark:text-gray-300"},"Visibility:",-1)),e("div",ve,[e("button",{onClick:t[0]||(t[0]=s=>u.value=!1),class:c(["px-4 py-2 text-sm font-medium transition-colors",u.value?"text-gray-600 hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-600":"bg-teal-500 text-white"])},[o(a(N),{size:14,class:"mr-1.5 inline-block"}),t[7]||(t[7]=i(" Public ",-1))],2),e("button",{onClick:t[1]||(t[1]=s=>u.value=!0),class:c(["px-4 py-2 text-sm font-medium transition-colors",u.value?"bg-teal-500 text-white":"text-gray-600 hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-600"])},[o(a($),{size:14,class:"mr-1.5 inline-block"}),t[8]||(t[8]=i(" Private ",-1))],2)])]),e("div",pe,[e("span",ke,n(k.value.length),1),i(" "+n(k.value.length===1?"package":"packages")+" found ",1)])])]),a(V)?(l(),d("div",_e,[e("div",he,[e("div",we,[o(a(h),{size:24,class:"animate-spin text-teal-500"})]),t[10]||(t[10]=e("p",{class:"mt-4 text-sm font-medium text-gray-600 dark:text-gray-400"},"Loading packages...",-1))])])):a(L)?(l(),d("div",ze,[e("div",Ce,[e("div",Pe,[o(a(oe),{size:20,class:"text-red-600 dark:text-red-400"})]),e("div",null,[t[12]||(t[12]=e("h3",{class:"font-semibold text-red-900 dark:text-red-300"},"Error Loading Packages",-1)),e("p",Me,n(a(q)?.message||"An unexpected error occurred. Please try again."),1),e("button",{onClick:t[2]||(t[2]=(...s)=>a(P)&&a(P)(...s)),class:"mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-red-700 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300"},[o(a(h),{size:14}),t[11]||(t[11]=i(" Try Again ",-1))])])])])):k.value?.length?(l(),d("div",Te,[(l(!0),d(Z,null,H(k.value,s=>(l(),d("div",{key:s._id,class:"group relative flex flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white transition-all duration-300 hover:border-gray-300 hover:shadow-xl dark:border-gray-700 dark:bg-gray-800 dark:hover:border-gray-600"},[s.popular?(l(),d("div",Ne," POPULAR ")):x("",!0),e("div",{class:c(["relative overflow-hidden p-6 pb-5",[!s.bg_color&&"bg-linear-to-br from-teal-600 to-teal-800 dark:from-teal-700 dark:to-teal-900"]]),style:p({background:s.bg_color?`linear-gradient(135deg, ${s.bg_color} 0%, ${w(s.bg_color,-20)} 100%)`:void 0})},[e("div",{class:"pointer-events-none absolute -top-12 -right-12 h-32 w-32 rounded-full opacity-10",style:p({background:s.bg_color?w(s.bg_color,30):"rgba(255,255,255,0.5)"})},null,4),e("div",{class:"pointer-events-none absolute -bottom-8 -left-8 h-24 w-24 rounded-full opacity-10",style:p({background:s.bg_color?w(s.bg_color,20):"rgba(255,255,255,0.3)"})},null,4),e("div",$e,[e("div",Fe,[e("span",{class:c(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-semibold backdrop-blur-sm",s.status==="active"?"bg-emerald-500/20 text-emerald-300":"bg-white/10 text-gray-300"])},[e("span",{class:c(["h-1.5 w-1.5 rounded-full",s.status==="active"?"animate-pulse bg-emerald-400":"bg-gray-400"])},null,2),i(" "+n(s.status==="active"?"Active":"Inactive"),1)],2),e("span",{class:c(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-semibold backdrop-blur-sm",s.visibility==="private"?"bg-violet-500/20 text-violet-300":"bg-teal-500/20 text-teal-300"])},[(l(),y(X(s.visibility==="private"?a($):a(N)),{size:11}
1)),i(" "+n(s.visibility==="private"?"Private":"Public"),1)],2)])]),e("h3",{class:c(["relative text-xl leading-tight font-bold",[!s.title_txt_color&&"text-white"]]),style:p({color:s.title_txt_color||void 0})},n(s.title),7),e("div",Be,[e("div",Se,[t[15]||(t[15]=e("span",{class:"text-lg font-medium text-white/60"},"$",-1)),e("span",{class:c(["text-4xl font-black tracking-tight",[!s.price_txt_color&&"text-white"]]),style:p({color:s.price_txt_color||void 0})},n(Q(s.base_price)),7)]),e("div",Ve,[e("span",Le,n(s.currency?.toUpperCase()||"NZD"),1),t[16]||(t[16]=e("span",{class:"text-xs font-medium text-white/40"},"per month",-1))])])],6),e("div",qe,[e("p",Ee,n(s.description||"No description available"),1),e("div",Ie,[e("div",Re,[e("div",Ue,[o(a(z),{size:14,class:"text-gray-400"}),t[17]||(t[17]=e("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"Default Users",-1))]),e("div",Qe,n(s.default_users||0),1)]),e("div",Ke,[e("div",Ge,[o(a(z),{size:14,class:"text-gray-400"}),t[18]||(t[18]=e("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"Max Users",-1))]),e("div",Ye,n(s.max_users||0),1)]),e("div",Ze,[e("div",He,[o(a(de),{size:14,class:"text-gray-400"}),t[19]||(t[19]=e("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"Trial Days",-1))]),e("div",Je,n(s.free_trial==="yes"?s.trial_limit:"-"),1)]),e("div",Oe,[e("div",We,[o(a(ne),{size:14,class:"text-gray-400"}),t[20]||(t[20]=e("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"AI Credits",-1))]),e("div",Xe,n(s.ai_credits||0),1)])]),e("div",et,[t[27]||(t[27]=e("div",{class:"mb-2 text-xs font-semibold tracking-wider text-gray-400 uppercase"}," Features ",-1)),e("div",tt,[s.features?.live_sessions?(l(),d("span",st,[o(a(xe),{size:12}),t[21]||(t[21]=i(" Live Sessions ",-1))])):x("",!0),s.features?.recorded_sessions?(l(),d("span",at,[o(a(B),{size:12}),t[22]||(t[22]=i(" Recordings ",-1))])):x("",!0),s.features?.ai_chatbot?(l(),d("span",rt,[o(a(ce),{size:12}),t[23]||(t[23]=i(" AI Chatbot ",-1))])):x("",!0),s.features?.video_calls?(l(),d("span",ot,[o(a(B),{size:12}),t[24]||(t[24]=i(" Video Calls ",-1))])):x("",!0),s.features?.audio_calls?(l(),d("span",lt,[o(a(ge),{size:12}),t[25]||(t[25]=i(" Audio Calls ",-1))])):x("",!0),s.features?.teams?(l(),d("span",it,[o(a(z),{size:12}),t[26]||(t[26]=i(" Teams ",-1))])):x("",!0),K(s)?x("",!0):(l(),d("span",dt," No features enabled "))])]),e("div",nt,[o(g,{to:`/admin/packages/${s._id}/edit`,class:"inline-flex flex-1 items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white px-4 py-2.5 text-sm font-semibold text-gray-700 transition-all hover:border-teal-500 hover:bg-teal-50 hover:text-teal-600 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 dark:hover:border-teal-500 dark:hover:bg-teal-500/10 dark:hover:text-teal-400"},{default:v(()=>[o(a(ue),{size:14}),t[28]||(t[28]=i(" Edit ",-1))]),_:1},8,["to"]),e("button",{onClick:M=>R(s),disabled:b.value===s._id,class:"inline-flex items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white px-4 py-2.5 text-sm font-semibold text-gray-500 transition-all hover:border-red-500 hover:bg-red-50 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 dark:hover:border-red-500 dark:hover:bg-red-500/10 dark:hover:text-red-400"},[b.value===s._id?(l(),y(a(h),{key:0,size:14,class:"animate-spin"})):(l(),y(a(F),{key:1,size:14}))],8,xt)])])]))),128))])):(l(),d("div",je,[e("div",De,[o(a(le),{size:32,class:"text-gray-400 dark:text-gray-500"})]),t[14]||(t[14]=e("h3",{class:"mt-4 text-lg font-semibold text-gray-900 dark:text-white"},"No packages found",-1)),e("p",Ae,n(u.value?"No private packages available":"No public packages available"),1),o(g,{to:"/admin/packages/create",class:"mt-6 inline-flex items-center gap-2 rounded-lg bg-teal-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-teal-600"},{default:v(()=>[o(a(T),{size:16}),t[13]||(t[13]=i(" Create Your First Package ",-1))]),_:1})])),(l(),y(O,{to:"body"},[o(j,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:v(()=>[m.value?(l(),d("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4 backdrop-blur-sm",onClick:t[4]||(t[4]=J(s=>m.value=!1,["self"]))},[o(j,{"enter-active-class":"transition-all duration-200","enter-from-class":"scale-95 opacity-0","enter-to-class":"scale-100 opacity-100","leave-active-class":"transition-all duration-200","leave-from-class":"scale-100 opacity-100","leave-to-class":"scale-95 opacity-0"},{default:v(()=>[m.value?(l(),d("div",ct,[e("div",gt,[e("div",ut,[o(a(ie),{size:24,class:"text-red-600 dark:text-red-400"})]),e("div",bt,[t[31]||(t[31]=e("h3",{class:"text-lg font-semibold text-gray-900 dark:text-white"}," Delete Package ",-1)),e("p",mt,[t[29]||(t[29]=i(" Are you sure you want to delete ",-1)),e("span",yt,n(f.value?.title),
11),t[30]||(t[30]=i("? This action cannot be undone. ",-1))])])]),e("div",ft,[e("button",{onClick:t[3]||(t[3]=s=>m.value=!1),class:"rounded-xl border border-gray-200 bg-white px-4 py-2 text-sm font-semibold text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}," Cancel "),e("button",{onClick:U,disabled:b.value,class:"inline-flex items-center gap-2 rounded-xl bg-red-500 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-50"},[b.value?(l(),y(a(h),{key:0,size:14,class:"animate-spin"})):(l(),y(a(F),{key:1,size:14})),t[32]||(t[32]=i(" Delete ",-1))],8,vt)])])):x("",!0)]),_:1})])):x("",!0)]),_:1})]))])}}};export{Dt as default};

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.