import{o as f,c as N,w as q,a as e,b as P,t as _,d as h,_ as L,e as me,r as I,f as U,g as D,v as fe,u as d,i as M,F as $,h as Z,j as K,k as b,l as C,m as ee,n as B,p as te,q as ie,s as ge,x as pe,y as _e,z,A as oe,B as he,C as ve,D as V,E as ye,G as be,H as we,I as xe}from"./CDVaHkEN.js";import{i as Ae,_ as Te}from"./5zwy1AoC.js";function Ie(t,a){if(typeof t!="string")throw new TypeError("argument str must be a string");const o={},i=a||{},s=i.decode||ke;let n=0;for(;nnew Intl.NumberFormat().format(o);return(o,i)=>{const s=L,n=me;return f(),N(n,{href:`https://docs.happi.dev/${t.api.documentation_path}`,key:t.api.title,class:"api"},{default:q(()=>[e("div",Pe,[t.api.image?(f(),N(s,{key:0,src:t.api.image.replace(".png","-64.png"),class:"image",width:45,height:45},null,8,["src"])):P("",!0),e("div",null,[e("div",qe,[e("h3",$e,_(t.api.title),1),t.api.badge?(f(),h("div",Ze,_(t.api.badge),1)):P("",!0),e("div",De,_(a(t.api.credit)),1)]),e("p",Re,_(t.api.description),1)])])]),_:1},8,["href"])}}},je={class:"pricing-calculator mt-4"},Ue={class:"d-flex gap-2 align-center px-2 flex-column-mobile"},Ne=e("label",{for:"api"},"API",-1),Le=e("option",{value:"",disabled:"",selected:""},"Select API",-1),Fe=["value"],Oe={class:"d-flex gap-2 align-center px-2 flex-column-mobile"},Ge=e("label",{for:"requests"},"Requests",-1),Me={colspan:"2"},Be={key:0,class:"dark hidden-on-mobile"},ze=e("th",null,"API",-1),He=e("th",null,"Requests",-1),Qe=e("th",null,"Credits",-1),Ve=[ze,He,Qe],Xe={key:0},Je=["onClick"],We={class:"d-flex gap-2 align-center"},Ye={class:"d-flex gap-1 flex-column"},Ke={class:"text-muted text-caption"},et={class:"text-center"},tt={class:"text-center"},it={key:1},ot=e("td",{colspan:"2",class:"text-right"},"You must recharge *",-1),at={class:"text-right"},st=e("td",{colspan:"2",class:"text-right"},"Total Purchase Credits ≈",-1),nt={class:"text-right"},rt=e("td",{colspan:"2",class:"text-right"},"Total Credits Used ≈",-1),ct={class:"text-right"},lt=e("td",{colspan:"2",class:"text-right"},"Total Credits Remaining ≈",-1),dt={class:"text-right"},ut={key:0,class:"text-muted mt-2 text-caption"},mt={__name:"PricingCalculator",props:{apis:{type:Array,required:!0},priceCredit:{type:Number,required:!0},minRecharge:{type:Number,required:!0}},setup(t){const a=t,o=I({}),i=I([]),s=I(""),n=l=>{if(!l||!l.credit){alert("Please select a valid API");return}if(isNaN(s.value)){alert("Please enter a valid number of requests");return}if(!s.value||s.value<1||s.value>1e7){alert("Please enter a number between 1 and 10,000,000");return}const p={...l,requests:s.value,credits:s.value*l.credit,price:s.value*l.credit*a.priceCredit},x=i.value.findIndex(w=>w.id===p.id);x>-1?i.value[x]=p:i.value.push(p),o.value={},s.value=""},c=l=>{l&&confirm(`Are you sure you want to remove ${l.name} from the list?`)&&(i.value=i.value.filter(p=>p.id!==l.id))},r=l=>new Intl.NumberFormat().format(l),v=U(()=>{let l=i.value.reduce((p,x)=>p+x.price,0);return l=Math.ceil(l),lv.value/a.priceCredit),y=U(()=>i.value.reduce((l,p)=>l+p.credits,0));return(l,p)=>{const x=ee,w=L;return f(),h("div",je,[e("table",null,[e("thead",null,[e("tr",null,[e("th",null,[e("div",Ue,[Ne,D(e("select",{"onUpdate:modelValue":p[0]||(p[0]=u=>M(o)?o.value=u:null),class:"ml-3"},[Le,(f(!0),h($,null,Z(t.apis,u=>(f(),h("option",{key:u.id,value:u},_(u.title),9,Fe))),128))],512),[[fe,d(o)]])])]),e("th",null,[e("div",Oe,[Ge,D(e("input",{type:"number",placeholder:"Number of requests","onUpdate:modelValue":p[1]||(p[1]=u=>M(s)?s.value=u:null),class:"ml-3"},null,512),[[K,d(s)]])])]),e("th",Me,[b(x,{color:"primary",onClick:p[2]||(p[2]=u=>n(d(o))),disabled:!d(o)||!d(s)},{default:q(()=>[C(" Add ")]),_:1},8,["disabled"])])]),d(i).length?(f(),h("tr",Be,Ve)):P("",!0)]),d(i).length?(f(),h("tbody",Xe,[(f(!0),h($,null,Z(d(i),u=>(f(),h("tr",{key:u.id,onClick:k=>c(u),class:"is-action"},[e("td",null,[e("div",We,[b(w,{src:u.image,alt:u.name,width:"32",height:"32",class:"mx-1"},null,8,["src","alt"]),e("div",Ye,[C(_(u.title)+" ",1),e("small",Ke,_(r(u.credit))+" credits per request ",1)])])]),e("td",et,_(r(u.requests)),1),e("td",tt,_(r(u.credits)),1)],8,Je))),128))])):P("",!0),d(i).length?(f(),h("tfoot",it,[e("tr",null,[ot,e("td",at,_(r(d(v)))+" USD",1)]),e("tr",null,[st,e("td",nt,_(r(d(g))),1)]),e("tr",null,[rt,e("td",ct,_(r(d(y))),1)]),e("tr",null,[lt,e("td",dt,_(r(d(g)-d(y))),1)])])):P("",!0)]),d(i).length&&d(v)==t.minRecharge?(f(),h("div",ut," * A minimum recharge of "+_(r(t.minRecharge))+" USD is required. ",1)):P("",!0)])}}},ft={class:"d-flex gap-5 align-center hero-feature flex-column-mobile"},gt={key:0,class:"image hidden-on-mobile"},pt={class:"feature"},_t={class:"text-rounded mb-2 text-secondary border-secondary"},ht={class:"title mb-2"},vt={class:"description"},yt={key:1,class:"image hidden-on-mobile"},bt={__name:"HeroFeature",props:{title:{type:String,required:!0},description:{type:String,required:!0},image:{type:String,required:!0},layout:{type:String,default:"left"},tagline:{type:String,default:""}},setup(t){return(a,o)=>{const i=L;return f(),h("div",ft,[t.layout==="left"?(f(),h("div",gt,[b(i,{src:t.image,alt:"hero image",width:400},null,8,["src"])])):P("",!0),e("div",pt,[e("div",_t,_(t.tagline),1),e("h3",ht,_(t.title),1),e("p",vt,_(t.description),1)]),t.layout==="right"?(f(),h("div",yt,[b(i,{src:t.image,alt:"hero image",width:400},null,8,["src"])])):P("",!0)])}}},wt={class:"faq"},xt=["onClick"],At={__name:"FAQ",props:{faq:{type:Array,required:!0}},setup(t){const a=I(!1),o=i=>{a.value=i};return(i,s)=>(f(),h("div",wt,[(f(!0),h($,null,Z(t.faq,n=>(f(),h("div",{key:n.id,class:B(`question ${d(a)===n.question?"active":""}`)},[e("div",{class:B("px-3 py-3 is-action"),onClick:c=>o(n.question)},_(n.question),9,xt),D(e("p",{class:"description px-4 pb-4"},_(n.answer),513),[[te,d(a)===n.question]])],2))),128))]))}};function A(t){if(typeof t!="object")return t;var a,o,i=Object.prototype.toString.call(t);if(i==="[object Object]"){if(t.constructor!==Object&&typeof t.constructor=="function"){o=new t.constructor;for(a in t)t.hasOwnProperty(a)&&o[a]!==t[a]&&(o[a]=A(t[a]))}else{o={};for(a in t)a==="__proto__"?Object.defineProperty(o,a,{value:A(t[a]),configurable:!0,enumerable:!0,writable:!0}):o[a]=A(t[a])}return o}if(i==="[object Array]"){for(a=t.length,o=Array(a);a--;)o[a]=A(t[a]);return o}return i==="[object Set]"?(o=new Set,t.forEach(function(s){o.add(A(s))}),o):i==="[object Map]"?(o=new Map,t.forEach(function(s,n){o.set(A(n),A(s))}),o):i==="[object Date]"?new Date(+t):i==="[object RegExp]"?(o=new RegExp(t.source,t.flags),o.lastIndex=t.lastIndex,o):i==="[object DataView]"?new t.constructor(A(t.buffer)):i==="[object ArrayBuffer]"?t.slice(0):i.slice(-6)==="Array]"?new t.constructor(t):t}const Tt={path:"/",watch:!0,decode:t=>pe(decodeURIComponent(t)),encode:t=>encodeURIComponent(typeof t=="string"?t:JSON.stringify(t))},j=window.cookieStore;function J(t,a){var v;const o={...Tt,...a},i=W(o)||{};let s;o.maxAge!==void 0?s=o.maxAge*1e3:o.expires&&(s=o.expires.getTime()-Date.now());const n=s!==void 0&&s<=0,c=A(n?void 0:i[t]??((v=o.default)==null?void 0:v.call(o))),r=s&&!n?St(c,s,o.watch&&o.watch!=="shallow"):I(c);{let g=null;try{!j&&typeof BroadcastChannel<"u"&&(g=new BroadcastChannel(`nuxt:cookies:${t}`))}catch{}const y=()=>{o.readonly||Ae(r.value,i[t])||(kt(t,r.value,o),i[t]=A(r.value),g==null||g.postMessage({value:o.encode(r.value)}))},l=w=>{var k;const u=w.refresh?(k=W(o))==null?void 0:k[t]:o.decode(w.value);p=!0,r.value=u,i[t]=A(u),_e(()=>{p=!1})};let p=!1;const x=!!oe();if(x&&z(()=>{p=!0,y(),g==null||g.close()}),j){const w=u=>{const k=u.changed.find(F=>F.name===t);k&&l({value:k.value})};j.addEventListener("change",w),x&&z(()=>j.removeEventListener("change",w))}else g&&(g.onmessage=({data:w})=>l(w));o.watch?ie(r,()=>{p||y()},{deep:o.watch!=="shallow"}):y()}return r}function W(t={}){return Ie(document.cookie,t)}function It(t,a,o={}){return a==null?X(t,a,{...o,maxAge:-1}):X(t,a,o)}function kt(t,a,o={}){document.cookie=It(t,a,o)}const Y=2147483647;function St(t,a,o){let i,s,n=0;const c=o?I(t):{value:t};return oe()&&z(()=>{s==null||s(),clearTimeout(i)}),ge((r,v)=>{o&&(s=ie(c,v));function g(){n=0,clearTimeout(i);const y=a-n,l=y{if(n+=l,n