tama 0.0.1

Multi-agent AI framework — build, run, and trace agent pipelines from the command line
Documentation
1
2
3
4
5
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=!1,t=!1,n=[],r=-1,i=!1;function a(e){c(e)}function o(){i=!0}function s(){i=!1,u()}function c(e){n.includes(e)||n.push(e),u()}function l(e){let t=n.indexOf(e);t!==-1&&t>r&&n.splice(t,1)}function u(){if(!t&&!e){if(i)return;e=!0,queueMicrotask(d)}}function d(){e=!1,t=!0;for(let e=0;e<n.length;e++)n[e](),r=e;n.length=0,r=-1,t=!1}var f,p,m,h,g=!0;function ee(e){g=!1,e(),g=!0}function te(e){f=e.reactive,m=e.release,p=t=>e.effect(t,{scheduler:e=>{g?a(e):e()}}),h=e.raw}function ne(e){p=e}function re(e){let t=()=>{};return[n=>{let r=p(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(e=>e())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),m(r))},r},()=>{t()}]}function ie(e,t){let n=!0,r,i=p(()=>{let i=e();if(JSON.stringify(i),!n&&(typeof i==`object`||i!==r)){let e=r;queueMicrotask(()=>{t(i,e)})}r=i,n=!1});return()=>m(i)}async function ae(e){o();try{await e(),await Promise.resolve()}finally{s()}}var oe=[],se=[],ce=[];function le(e){ce.push(e)}function ue(e,t){typeof t==`function`?(e._x_cleanups||=[],e._x_cleanups.push(t)):(t=e,se.push(t))}function de(e){oe.push(e)}function fe(e,t,n){e._x_attributeCleanups||={},e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function pe(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,r])=>{(t===void 0||t.includes(n))&&(r.forEach(e=>e()),delete e._x_attributeCleanups[n])})}function me(e){for(e._x_effects?.forEach(l);e._x_cleanups?.length;)e._x_cleanups.pop()()}var he=new MutationObserver(we),ge=!1;function _e(){he.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),ge=!0}function ve(){ye(),he.disconnect(),ge=!1}var _=[];function ye(){let e=he.takeRecords();_.push(()=>e.length>0&&we(e));let t=_.length;queueMicrotask(()=>{if(_.length===t)for(;_.length>0;)_.shift()()})}function v(e){if(!ge)return e();ve();let t=e();return _e(),t}var be=!1,xe=[];function Se(){be=!0}function Ce(){be=!1,we(xe),xe=[]}function we(e){if(be){xe=xe.concat(e);return}let t=[],n=new Set,r=new Map,i=new Map;for(let a=0;a<e.length;a++)if(!e[a].target._x_ignoreMutationObserver&&(e[a].type===`childList`&&(e[a].removedNodes.forEach(e=>{e.nodeType===1&&e._x_marker&&n.add(e)}),e[a].addedNodes.forEach(e=>{if(e.nodeType===1){if(n.has(e)){n.delete(e);return}e._x_marker||t.push(e)}})),e[a].type===`attributes`)){let t=e[a].target,n=e[a].attributeName,o=e[a].oldValue,s=()=>{r.has(t)||r.set(t,[]),r.get(t).push({name:n,value:t.getAttribute(n)})},c=()=>{i.has(t)||i.set(t,[]),i.get(t).push(n)};t.hasAttribute(n)&&o===null?s():t.hasAttribute(n)?(c(),s()):c()}i.forEach((e,t)=>{pe(t,e)}),r.forEach((e,t)=>{oe.forEach(n=>n(t,e))});for(let e of n)t.some(t=>t.contains(e))||se.forEach(t=>t(e));for(let e of t)e.isConnected&&ce.forEach(t=>t(e));t=null,n=null,r=null,i=null}function Te(e){return x(b(e))}function y(e,t,n){return e._x_dataStack=[t,...b(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(e=>e!==t)}}function b(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot==`function`&&e instanceof ShadowRoot?b(e.host):e.parentNode?b(e.parentNode):[]}function x(e){return new Proxy({objects:e},Ee)}var Ee={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(e=>Object.keys(e))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(e=>Object.prototype.hasOwnProperty.call(e,t)||Reflect.has(e,t))},get({objects:e},t,n){return t==`toJSON`?De:Reflect.get(e.find(e=>Reflect.has(e,t))||{},t,n)},set({objects:e},t,n,r){let i=e.find(e=>Object.prototype.hasOwnProperty.call(e,t))||e[e.length-1],a=Object.getOwnPropertyDescriptor(i,t);return a?.set&&a?.get?a.set.call(r,n)||!0:Reflect.set(i,t,n)}};function De(){return Reflect.ownKeys(this).reduce((e,t)=>(e[t]=Reflect.get(this,t),e),{})}function Oe(e){let t=e=>typeof e==`object`&&!Array.isArray(e)&&e!==null,n=(r,i=``)=>{Object.entries(Object.getOwnPropertyDescriptors(r)).forEach(([a,{value:o,enumerable:s}])=>{if(s===!1||o===void 0||typeof o==`object`&&o&&o.__v_skip)return;let c=i===``?a:`${i}.${a}`;typeof o==`object`&&o&&o._x_interceptor?r[a]=o.initialize(e,c,a):t(o)&&o!==r&&!(o instanceof Element)&&n(o,c)})};return n(e)}function ke(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(t,n,r){return e(this.initialValue,()=>Ae(t,n),e=>je(t,n,e),n,r)}};return t(n),e=>{if(typeof e==`object`&&e&&e._x_interceptor){let t=n.initialize.bind(n);n.initialize=(r,i,a)=>(n.initialValue=e.initialize(r,i,a),t(r,i,a))}else n.initialValue=e;return n}}function Ae(e,t){return t.split(`.`).reduce((e,t)=>e[t],e)}function je(e,t,n){if(typeof t==`string`&&(t=t.split(`.`)),t.length===1)e[t[0]]=n;else if(t.length===0)throw error;else if(e[t[0]])return je(e[t[0]],t.slice(1),n);else return e[t[0]]={},je(e[t[0]],t.slice(1),n)}var Me={};function S(e,t){Me[e]=t}function Ne(e,t){let n=Pe(t);return Object.entries(Me).forEach(([r,i])=>{Object.defineProperty(e,`$${r}`,{get(){return i(t,n)},enumerable:!1})}),e}function Pe(e){let[t,n]=st(e),r={interceptor:ke,...t};return ue(e,n),r}function Fe(e,t,n,...r){try{return n(...r)}catch(n){Ie(n,e,t)}}function Ie(...e){return Le(...e)}var Le=ze;function Re(e){Le=e}function ze(e,t,n=void 0){e=Object.assign(e??{message:`No error message given.`},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}

${n?`Expression: "`+n+`"

`:``}`,t),setTimeout(()=>{throw e},0)}var C=!0;function Be(e){let t=C;C=!1;let n=e();return C=t,n}function w(e,t,n={}){let r;return T(e,t)(e=>r=e,n),r}function T(...e){return Ve(...e)}var Ve=Ge;function He(e){Ve=e}var Ue;function We(e){Ue=e}function Ge(e,t){let n={};Ne(n,e);let r=[n,...b(e)],i=typeof t==`function`?Ke(r,t):Ye(r,t,e);return Fe.bind(null,e,t,i)}function Ke(e,t){return(n=()=>{},{scope:r={},params:i=[],context:a}={})=>{if(!C){E(n,t,x([r,...e]),i);return}E(n,t.apply(x([r,...e]),i))}}var qe={};function Je(e,t){if(qe[e])return qe[e];let n=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,i=(()=>{try{let t=new n([`__self`,`scope`],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Object.defineProperty(t,`name`,{value:`[Alpine] ${e}`}),t}catch(n){return Ie(n,t,e),Promise.resolve()}})();return qe[e]=i,i}function Ye(e,t,n){let r=Je(t,n);return(i=()=>{},{scope:a={},params:o=[],context:s}={})=>{r.result=void 0,r.finished=!1;let c=x([a,...e]);if(typeof r==`function`){let e=r.call(s,r,c).catch(e=>Ie(e,n,t));r.finished?(E(i,r.result,c,o,n),r.result=void 0):e.then(e=>{E(i,e,c,o,n)}).catch(e=>Ie(e,n,t)).finally(()=>r.result=void 0)}}}function E(e,t,n,r,i){if(C&&typeof t==`function`){let a=t.apply(n,r);a instanceof Promise?a.then(t=>E(e,t,n,r)).catch(e=>Ie(e,i,t)):e(a)}else typeof t==`object`&&t instanceof Promise?t.then(t=>e(t)):e(t)}function Xe(...e){return Ue(...e)}function Ze(e,t,n={}){let r={};Ne(r,e);let i=[r,...b(e)],a=x([n.scope??{},...i]),o=n.params??[];if(t.includes(`await`)){let e=Object.getPrototypeOf(async function(){}).constructor;return new e([`scope`],`with (scope) { let __result = ${/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t}; return __result }`).call(n.context,a)}else{let e=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(()=>{ ${t} })()`:t,r=Function([`scope`],`with (scope) { let __result = ${e}; return __result }`).call(n.context,a);return typeof r==`function`&&C?r.apply(a,o):r}}var Qe=`x-`;function D(e=``){return Qe+e}function $e(e){Qe=e}var et={};function O(e,t){return et[e]=t,{before(t){if(!et[t]){console.warn(String.raw`Cannot find directive \`${t}\`. \`${e}\` will use the default order of execution`);return}let n=A.indexOf(t);A.splice(n>=0?n:A.indexOf(`DEFAULT`),0,e)}}}function tt(e){return Object.keys(et).includes(e)}function nt(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let n=Object.entries(e._x_virtualDirectives).map(([e,t])=>({name:e,value:t})),r=rt(n);n=n.map(e=>r.find(t=>t.name===e.name)?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e),t=t.concat(n)}let r={};return t.map(dt((e,t)=>r[e]=t)).filter(mt).map(gt(r,n)).sort(vt).map(t=>ct(e,t))}function rt(e){return Array.from(e).map(dt()).filter(e=>!mt(e))}var it=!1,k=new Map,at=Symbol();function ot(e){it=!0;let t=Symbol();at=t,k.set(t,[]);let n=()=>{for(;k.get(t).length;)k.get(t).shift()();k.delete(t)};e(n),it=!1,n()}function st(e){let t=[],n=e=>t.push(e),[r,i]=re(e);return t.push(i),[{Alpine:V,effect:r,cleanup:n,evaluateLater:T.bind(T,e),evaluate:w.bind(w,e)},()=>t.forEach(e=>e())]}function ct(e,t){let n=et[t.type]||(()=>{}),[r,i]=st(e);fe(e,t.original,i);let a=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,r),n=n.bind(n,e,t,r),it?k.get(at).push(n):n())};return a.runCleanups=i,a}var lt=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r}),ut=e=>e;function dt(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:i}=ft.reduce((e,t)=>t(e),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:i}}}var ft=[];function pt(e){ft.push(e)}function mt({name:e}){return ht().test(e)}var ht=()=>RegExp(`^${Qe}([^:^.]+)\\b`);function gt(e,t){return({name:n,value:r})=>{n===r&&(r=``);let i=n.match(ht()),a=n.match(/:([a-zA-Z0-9\-_:]+)/),o=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[n]||n;return{type:i?i[1]:null,value:a?a[1]:null,modifiers:o.map(e=>e.replace(`.`,``)),expression:r,original:s}}}var _t=`DEFAULT`,A=[`ignore`,`ref`,`data`,`id`,`anchor`,`bind`,`init`,`for`,`model`,`modelable`,`transition`,`show`,`if`,_t,`teleport`];function vt(e,t){let n=A.indexOf(e.type)===-1?_t:e.type,r=A.indexOf(t.type)===-1?_t:t.type;return A.indexOf(n)-A.indexOf(r)}function j(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function M(e,t){if(typeof ShadowRoot==`function`&&e instanceof ShadowRoot){Array.from(e.children).forEach(e=>M(e,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let r=e.firstElementChild;for(;r;)M(r,t,!1),r=r.nextElementSibling}function N(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var yt=!1;function bt(){yt&&N(`Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.`),yt=!0,document.body||N("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),j(document,`alpine:init`),j(document,`alpine:initializing`),_e(),le(e=>F(e,M)),ue(e=>I(e)),de((e,t)=>{nt(e,t).forEach(e=>e())}),Array.from(document.querySelectorAll(wt().join(`,`))).filter(e=>!Dt(e.parentElement,!0)).forEach(e=>{F(e)}),j(document,`alpine:initialized`),setTimeout(()=>{Mt()})}var xt=[],St=[];function Ct(){return xt.map(e=>e())}function wt(){return xt.concat(St).map(e=>e())}function Tt(e){xt.push(e)}function Et(e){St.push(e)}function Dt(e,t=!1){return P(e,e=>{if((t?wt():Ct()).some(t=>e.matches(t)))return!0})}function P(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),e.parentNode instanceof ShadowRoot)return P(e.parentNode.host,t);if(e.parentElement)return P(e.parentElement,t)}}function Ot(e){return Ct().some(t=>e.matches(t))}var kt=[];function At(e){kt.push(e)}var jt=1;function F(e,t=M,n=()=>{}){P(e,e=>e._x_ignore)||ot(()=>{t(e,(e,t)=>{e._x_marker||(n(e,t),kt.forEach(n=>n(e,t)),nt(e,e.attributes).forEach(e=>e()),e._x_ignore||(e._x_marker=jt++),e._x_ignore&&t())})})}function I(e,t=M){t(e,e=>{me(e),pe(e),delete e._x_marker})}function Mt(){[[`ui`,`dialog`,[`[x-dialog], [x-popover]`]],[`anchor`,`anchor`,[`[x-anchor]`]],[`sort`,`sort`,[`[x-sort]`]]].forEach(([e,t,n])=>{tt(t)||n.some(t=>{if(document.querySelector(t))return N(`found "${t}", but missing ${e} plugin`),!0})})}var Nt=[],Pt=!1;function Ft(e=()=>{}){return queueMicrotask(()=>{Pt||setTimeout(()=>{It()})}),new Promise(t=>{Nt.push(()=>{e(),t()})})}function It(){for(Pt=!1;Nt.length;)Nt.shift()()}function Lt(){Pt=!0}function Rt(e,t){return Array.isArray(t)?zt(e,t.join(` `)):typeof t==`object`&&t?Bt(e,t):typeof t==`function`?Rt(e,t()):zt(e,t)}function zt(e,t){return t=t===!0?t=``:t||``,(t=>(e.classList.add(...t),()=>{e.classList.remove(...t)}))((t=>t.split(` `).filter(t=>!e.classList.contains(t)).filter(Boolean))(t))}function Bt(e,t){let n=e=>e.split(` `).filter(Boolean),r=Object.entries(t).flatMap(([e,t])=>t?n(e):!1).filter(Boolean),i=Object.entries(t).flatMap(([e,t])=>t?!1:n(e)).filter(Boolean),a=[],o=[];return i.forEach(t=>{e.classList.contains(t)&&(e.classList.remove(t),o.push(t))}),r.forEach(t=>{e.classList.contains(t)||(e.classList.add(t),a.push(t))}),()=>{o.forEach(t=>e.classList.add(t)),a.forEach(t=>e.classList.remove(t))}}function Vt(e,t){return typeof t==`object`&&t?Ht(e,t):Ut(e,t)}function Ht(e,t){let n={};return Object.entries(t).forEach(([t,r])=>{n[t]=e.style[t],t.startsWith(`--`)||(t=Wt(t)),e.style.setProperty(t,r)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute(`style`)}),()=>{Vt(e,n)}}function Ut(e,t){let n=e.getAttribute(`style`,t);return e.setAttribute(`style`,t),()=>{e.setAttribute(`style`,n||``)}}function Wt(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function Gt(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}O(`transition`,(e,{value:t,modifiers:n,expression:r},{evaluate:i})=>{typeof r==`function`&&(r=i(r)),r!==!1&&(!r||typeof r==`boolean`?qt(e,n,t):Kt(e,r,t))});function Kt(e,t,n){Jt(e,Rt,``),{enter:t=>{e._x_transition.enter.during=t},"enter-start":t=>{e._x_transition.enter.start=t},"enter-end":t=>{e._x_transition.enter.end=t},leave:t=>{e._x_transition.leave.during=t},"leave-start":t=>{e._x_transition.leave.start=t},"leave-end":t=>{e._x_transition.leave.end=t}}[n](t)}function qt(e,t,n){Jt(e,Vt);let r=!t.includes(`in`)&&!t.includes(`out`)&&!n,i=r||t.includes(`in`)||[`enter`].includes(n),a=r||t.includes(`out`)||[`leave`].includes(n);t.includes(`in`)&&!r&&(t=t.filter((e,n)=>n<t.indexOf(`out`))),t.includes(`out`)&&!r&&(t=t.filter((e,n)=>n>t.indexOf(`out`)));let o=!t.includes(`opacity`)&&!t.includes(`scale`),s=o||t.includes(`opacity`),c=o||t.includes(`scale`),l=s?0:1,u=c?L(t,`scale`,95)/100:1,d=L(t,`delay`,0)/1e3,f=L(t,`origin`,`center`),p=`opacity, transform`,m=L(t,`duration`,150)/1e3,h=L(t,`duration`,75)/1e3,g=`cubic-bezier(0.4, 0.0, 0.2, 1)`;i&&(e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${d}s`,transitionProperty:p,transitionDuration:`${m}s`,transitionTimingFunction:g},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:`scale(1)`}),a&&(e._x_transition.leave.during={transformOrigin:f,transitionDelay:`${d}s`,transitionProperty:p,transitionDuration:`${h}s`,transitionTimingFunction:g},e._x_transition.leave.start={opacity:1,transform:`scale(1)`},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function Jt(e,t,n={}){e._x_transition||={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(n=()=>{},r=()=>{}){Xt(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,r)},out(n=()=>{},r=()=>{}){Xt(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,r)}}}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,r){let i=document.visibilityState===`visible`?requestAnimationFrame:setTimeout,a=()=>i(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):a():e._x_transition?e._x_transition.in(n):a();return}e._x_hidePromise=e._x_transition?new Promise((t,n)=>{e._x_transition.out(()=>{},()=>t(r)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>n({isFromCancelledTransition:!0}))}):Promise.resolve(r),queueMicrotask(()=>{let t=Yt(e);t?(t._x_hideChildren||=[],t._x_hideChildren.push(e)):i(()=>{let t=e=>{let n=Promise.all([e._x_hidePromise,...(e._x_hideChildren||[]).map(t)]).then(([e])=>e?.());return delete e._x_hidePromise,delete e._x_hideChildren,n};t(e).catch(e=>{if(!e.isFromCancelledTransition)throw e})})})};function Yt(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Yt(t)}function Xt(e,t,{during:n,start:r,end:i}={},a=()=>{},o=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(r).length===0&&Object.keys(i).length===0){a(),o();return}let s,c,l;Zt(e,{start(){s=t(e,r)},during(){c=t(e,n)},before:a,end(){s(),l=t(e,i)},after:o,cleanup(){c(),l()}})}function Zt(e,t){let n,r,i,a=Gt(()=>{v(()=>{n=!0,r||t.before(),i||(t.end(),It()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(e){this.beforeCancels.push(e)},cancel:Gt(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();a()}),finish:a},v(()=>{t.start(),t.during()}),Lt(),requestAnimationFrame(()=>{if(n)return;let a=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,``).replace(`s`,``))*1e3,o=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,``).replace(`s`,``))*1e3;a===0&&(a=Number(getComputedStyle(e).animationDuration.replace(`s`,``))*1e3),v(()=>{t.before()}),r=!0,requestAnimationFrame(()=>{n||(v(()=>{t.end()}),It(),setTimeout(e._x_transitioning.finish,a+o),i=!0)})})}function L(e,t,n){if(e.indexOf(t)===-1)return n;let r=e[e.indexOf(t)+1];if(!r||t===`scale`&&isNaN(r))return n;if(t===`duration`||t===`delay`){let e=r.match(/([0-9]+)ms/);if(e)return e[1]}return t===`origin`&&[`top`,`right`,`left`,`center`,`bottom`].includes(e[e.indexOf(t)+2])?[r,e[e.indexOf(t)+2]].join(` `):r}var R=!1;function z(e,t=()=>{}){return(...n)=>R?t(...n):e(...n)}function Qt(e){return(...t)=>R&&e(...t)}var $t=[];function en(e){$t.push(e)}function tn(e,t){$t.forEach(n=>n(e,t)),R=!0,on(()=>{F(t,(e,t)=>{t(e,()=>{})})}),R=!1}var nn=!1;function rn(e,t){t._x_dataStack||=e._x_dataStack,R=!0,nn=!0,on(()=>{an(t)}),R=!1,nn=!1}function an(e){let t=!1;F(e,(e,n)=>{M(e,(e,r)=>{if(t&&Ot(e))return r();t=!0,n(e,r)})})}function on(e){let t=p;ne((e,n)=>{let r=t(e);return m(r),()=>{}}),e(),ne(t)}function sn(e,t,n,r=[]){switch(e._x_bindings||=f({}),e._x_bindings[t]=n,t=r.includes(`camel`)?gn(t):t,t){case`value`:cn(e,n);break;case`style`:un(e,n);break;case`class`:ln(e,n);break;case`selected`:case`checked`:dn(e,t,n);break;default:fn(e,t,n);break}}function cn(e,t){if(En(e))e.attributes.value===void 0&&(e.value=t),window.fromModel&&(typeof t==`boolean`?e.checked=vn(e.value)===t:e.checked=_n(e.value,t));else if(Tn(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!=`boolean`&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(t=>_n(t,e.value)):e.checked=!!t;else if(e.tagName===`SELECT`)hn(e,t);else{if(e.value===t)return;e.value=t===void 0?``:t}}function ln(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=Rt(e,t)}function un(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Vt(e,t)}function dn(e,t,n){fn(e,t,n),mn(e,t,n)}function fn(e,t,n){[null,void 0,!1].includes(n)&&xn(t)?e.removeAttribute(t):(bn(t)&&(n=t),pn(e,t,n))}function pn(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function mn(e,t,n){e[t]!==n&&(e[t]=n)}function hn(e,t){let n=[].concat(t).map(e=>e+``);Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}function gn(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function _n(e,t){return e==t}function vn(e){return[1,`1`,`true`,`on`,`yes`,!0].includes(e)?!0:[0,`0`,`false`,`off`,`no`,!1].includes(e)?!1:e?!!e:null}var yn=new Set(`allowfullscreen.async.autofocus.autoplay.checked.controls.default.defer.disabled.formnovalidate.inert.ismap.itemscope.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.selected.shadowrootclonable.shadowrootdelegatesfocus.shadowrootserializable`.split(`.`));function bn(e){return yn.has(e)}function xn(e){return![`aria-pressed`,`aria-checked`,`aria-expanded`,`aria-selected`].includes(e)}function Sn(e,t,n){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:wn(e,t,n)}function Cn(e,t,n,r=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let n=e._x_inlineBindings[t];return n.extract=r,Be(()=>w(e,n.expression))}return wn(e,t,n)}function wn(e,t,n){let r=e.getAttribute(t);return r===null?typeof n==`function`?n():n:r===``?!0:bn(t)?!![t,`true`].includes(r):r}function Tn(e){return e.type===`checkbox`||e.localName===`ui-checkbox`||e.localName===`ui-switch`}function En(e){return e.type===`radio`||e.localName===`ui-radio`}function Dn(e,t){let n;return function(){let r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){n=null,e.apply(r,i)},t)}}function On(e,t){let n;return function(){let r=this,i=arguments;n||(e.apply(r,i),n=!0,setTimeout(()=>n=!1,t))}}function kn({get:e,set:t},{get:n,set:r}){let i=!0,a,o=p(()=>{let o=e(),s=n();if(i)r(An(o)),i=!1;else{let e=JSON.stringify(o),n=JSON.stringify(s);e===a?e!==n&&t(An(s)):r(An(o))}a=JSON.stringify(e()),JSON.stringify(n())});return()=>{m(o)}}function An(e){return typeof e==`object`?JSON.parse(JSON.stringify(e)):e}function jn(e){(Array.isArray(e)?e:[e]).forEach(e=>e(V))}var B={},Mn=!1;function Nn(e,t){if(Mn||=(B=f(B),!0),t===void 0)return B[e];B[e]=t,Oe(B[e]),typeof t==`object`&&t&&t.hasOwnProperty(`init`)&&typeof t.init==`function`&&B[e].init()}function Pn(){return B}var Fn={};function In(e,t){let n=typeof t==`function`?t:()=>t;return e instanceof Element?Rn(e,n()):(Fn[e]=n,()=>{})}function Ln(e){return Object.entries(Fn).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...e)=>n(...e)}})}),e}function Rn(e,t,n){let r=[];for(;r.length;)r.pop()();let i=Object.entries(t).map(([e,t])=>({name:e,value:t})),a=rt(i);return i=i.map(e=>a.find(t=>t.name===e.name)?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e),nt(e,i,n).map(e=>{r.push(e.runCleanups),e()}),()=>{for(;r.length;)r.pop()()}}var zn={};function Bn(e,t){zn[e]=t}function Vn(e,t){return Object.entries(zn).forEach(([n,r])=>{Object.defineProperty(e,n,{get(){return(...e)=>r.bind(t)(...e)},enumerable:!1})}),e}var V={get reactive(){return f},get release(){return m},get effect(){return p},get raw(){return h},get transaction(){return ae},version:`3.15.8`,flushAndStopDeferringMutations:Ce,dontAutoEvaluateFunctions:Be,disableEffectScheduling:ee,startObservingMutations:_e,stopObservingMutations:ve,setReactivityEngine:te,onAttributeRemoved:fe,onAttributesAdded:de,closestDataStack:b,skipDuringClone:z,onlyDuringClone:Qt,addRootSelector:Tt,addInitSelector:Et,setErrorHandler:Re,interceptClone:en,addScopeToNode:y,deferMutations:Se,mapAttributes:pt,evaluateLater:T,interceptInit:At,initInterceptors:Oe,injectMagics:Ne,setEvaluator:He,setRawEvaluator:We,mergeProxies:x,extractProp:Cn,findClosest:P,onElRemoved:ue,closestRoot:Dt,destroyTree:I,interceptor:ke,transition:Xt,setStyles:Vt,mutateDom:v,directive:O,entangle:kn,throttle:On,debounce:Dn,evaluate:w,evaluateRaw:Xe,initTree:F,nextTick:Ft,prefixed:D,prefix:$e,plugin:jn,magic:S,store:Nn,start:bt,clone:rn,cloneNode:tn,bound:Sn,$data:Te,watch:ie,walk:M,data:Bn,bind:In};function Hn(e,t){let n=Object.create(null),r=e.split(`,`);for(let e=0;e<r.length;e++)n[r[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}var Un=Object.freeze({});Object.freeze([]);var Wn=Object.prototype.hasOwnProperty,Gn=(e,t)=>Wn.call(e,t),H=Array.isArray,U=e=>Xn(e)===`[object Map]`,Kn=e=>typeof e==`string`,qn=e=>typeof e==`symbol`,Jn=e=>typeof e==`object`&&!!e,Yn=Object.prototype.toString,Xn=e=>Yn.call(e),Zn=e=>Xn(e).slice(8,-1),Qn=e=>Kn(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,$n=(e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),er=(e,t)=>e!==t&&(e===e||t===t),tr=new WeakMap,W=[],G,K=Symbol(`iterate`),nr=Symbol(`Map key iterate`);function rr(e){return e&&e._isEffect===!0}function ir(e,t=Un){rr(e)&&(e=e.raw);let n=sr(e,t);return t.lazy||n(),n}function ar(e){e.active&&=(cr(e),e.options.onStop&&e.options.onStop(),!1)}var or=0;function sr(e,t){let n=function(){if(!n.active)return e();if(!W.includes(n)){cr(n);try{return dr(),W.push(n),G=n,e()}finally{W.pop(),fr(),G=W[W.length-1]}}};return n.id=or++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function cr(e){let{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var q=!0,lr=[];function ur(){lr.push(q),q=!1}function dr(){lr.push(q),q=!0}function fr(){let e=lr.pop();q=e===void 0?!0:e}function J(e,t,n){if(!q||G===void 0)return;let r=tr.get(e);r||tr.set(e,r=new Map);let i=r.get(n);i||r.set(n,i=new Set),i.has(G)||(i.add(G),G.deps.push(i),G.options.onTrack&&G.options.onTrack({effect:G,target:e,type:t,key:n}))}function Y(e,t,n,r,i,a){let o=tr.get(e);if(!o)return;let s=new Set,c=e=>{e&&e.forEach(e=>{(e!==G||e.allowRecurse)&&s.add(e)})};if(t===`clear`)o.forEach(c);else if(n===`length`&&H(e))o.forEach((e,t)=>{(t===`length`||t>=r)&&c(e)});else switch(n!==void 0&&c(o.get(n)),t){case`add`:H(e)?Qn(n)&&c(o.get(`length`)):(c(o.get(K)),U(e)&&c(o.get(nr)));break;case`delete`:H(e)||(c(o.get(K)),U(e)&&c(o.get(nr)));break;case`set`:U(e)&&c(o.get(K));break}s.forEach(o=>{o.options.onTrigger&&o.options.onTrigger({effect:o,target:e,key:n,type:t,newValue:r,oldValue:i,oldTarget:a}),o.options.scheduler?o.options.scheduler(o):o()})}var pr=Hn(`__proto__,__v_isRef,__isVue`),mr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(qn)),hr=yr(),gr=yr(!0),_r=vr();function vr(){let e={};return[`includes`,`indexOf`,`lastIndexOf`].forEach(t=>{e[t]=function(...e){let n=Z(this);for(let e=0,t=this.length;e<t;e++)J(n,`get`,e+``);let r=n[t](...e);return r===-1||r===!1?n[t](...e.map(Z)):r}}),[`push`,`pop`,`shift`,`unshift`,`splice`].forEach(t=>{e[t]=function(...e){ur();let n=Z(this)[t].apply(this,e);return fr(),n}}),e}function yr(e=!1,t=!1){return function(n,r,i){if(r===`__v_isReactive`)return!e;if(r===`__v_isReadonly`)return e;if(r===`__v_raw`&&i===(e?t?Qr:Zr:t?Xr:Yr).get(n))return n;let a=H(n);if(!e&&a&&Gn(_r,r))return Reflect.get(_r,r,i);let o=Reflect.get(n,r,i);return(qn(r)?mr.has(r):pr(r))||(e||J(n,`get`,r),t)?o:ii(o)?!a||!Qn(r)?o.value:o:Jn(o)?e?ni(o):ti(o):o}}var br=xr();function xr(e=!1){return function(t,n,r,i){let a=t[n];if(!e&&(r=Z(r),a=Z(a),!H(t)&&ii(a)&&!ii(r)))return a.value=r,!0;let o=H(t)&&Qn(n)?Number(n)<t.length:Gn(t,n),s=Reflect.set(t,n,r,i);return t===Z(i)&&(o?er(r,a)&&Y(t,`set`,n,r,a):Y(t,`add`,n,r)),s}}function Sr(e,t){let n=Gn(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Y(e,`delete`,t,void 0,r),i}function Cr(e,t){let n=Reflect.has(e,t);return(!qn(t)||!mr.has(t))&&J(e,`has`,t),n}function wr(e){return J(e,`iterate`,H(e)?`length`:K),Reflect.ownKeys(e)}var Tr={get:hr,set:br,deleteProperty:Sr,has:Cr,ownKeys:wr},Er={get:gr,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Dr=e=>Jn(e)?ti(e):e,Or=e=>Jn(e)?ni(e):e,kr=e=>e,Ar=e=>Reflect.getPrototypeOf(e);function jr(e,t,n=!1,r=!1){e=e.__v_raw;let i=Z(e),a=Z(t);t!==a&&!n&&J(i,`get`,t),!n&&J(i,`get`,a);let{has:o}=Ar(i),s=r?kr:n?Or:Dr;if(o.call(i,t))return s(e.get(t));if(o.call(i,a))return s(e.get(a));e!==i&&e.get(t)}function Mr(e,t=!1){let n=this.__v_raw,r=Z(n),i=Z(e);return e!==i&&!t&&J(r,`has`,e),!t&&J(r,`has`,i),e===i?n.has(e):n.has(e)||n.has(i)}function Nr(e,t=!1){return e=e.__v_raw,!t&&J(Z(e),`iterate`,K),Reflect.get(e,`size`,e)}function Pr(e){e=Z(e);let t=Z(this);return Ar(t).has.call(t,e)||(t.add(e),Y(t,`add`,e,e)),this}function Fr(e,t){t=Z(t);let n=Z(this),{has:r,get:i}=Ar(n),a=r.call(n,e);a?Jr(n,r,e):(e=Z(e),a=r.call(n,e));let o=i.call(n,e);return n.set(e,t),a?er(t,o)&&Y(n,`set`,e,t,o):Y(n,`add`,e,t),this}function Ir(e){let t=Z(this),{has:n,get:r}=Ar(t),i=n.call(t,e);i?Jr(t,n,e):(e=Z(e),i=n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Y(t,`delete`,e,void 0,a),o}function Lr(){let e=Z(this),t=e.size!==0,n=U(e)?new Map(e):new Set(e),r=e.clear();return t&&Y(e,`clear`,void 0,void 0,n),r}function Rr(e,t){return function(n,r){let i=this,a=i.__v_raw,o=Z(a),s=t?kr:e?Or:Dr;return!e&&J(o,`iterate`,K),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}}function zr(e,t,n){return function(...r){let i=this.__v_raw,a=Z(i),o=U(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?kr:t?Or:Dr;return!t&&J(a,`iterate`,c?nr:K),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function X(e){return function(...t){{let n=t[0]?`on key "${t[0]}" `:``;console.warn(`${$n(e)} operation ${n}failed: target is readonly.`,Z(this))}return e===`delete`?!1:this}}function Br(){let e={get(e){return jr(this,e)},get size(){return Nr(this)},has:Mr,add:Pr,set:Fr,delete:Ir,clear:Lr,forEach:Rr(!1,!1)},t={get(e){return jr(this,e,!1,!0)},get size(){return Nr(this)},has:Mr,add:Pr,set:Fr,delete:Ir,clear:Lr,forEach:Rr(!1,!0)},n={get(e){return jr(this,e,!0)},get size(){return Nr(this,!0)},has(e){return Mr.call(this,e,!0)},add:X(`add`),set:X(`set`),delete:X(`delete`),clear:X(`clear`),forEach:Rr(!0,!1)},r={get(e){return jr(this,e,!0,!0)},get size(){return Nr(this,!0)},has(e){return Mr.call(this,e,!0)},add:X(`add`),set:X(`set`),delete:X(`delete`),clear:X(`clear`),forEach:Rr(!0,!0)};return[`keys`,`values`,`entries`,Symbol.iterator].forEach(i=>{e[i]=zr(i,!1,!1),n[i]=zr(i,!0,!1),t[i]=zr(i,!1,!0),r[i]=zr(i,!0,!0)}),[e,n,t,r]}var[Vr,Hr,Ur,Wr]=Br();function Gr(e,t){let n=t?e?Wr:Ur:e?Hr:Vr;return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(Gn(n,r)&&r in t?n:t,r,i)}var Kr={get:Gr(!1,!1)},qr={get:Gr(!0,!1)};function Jr(e,t,n){let r=Z(n);if(r!==n&&t.call(e,r)){let t=Zn(e);console.warn(`Reactive ${t} contains both the raw and reactive versions of the same object${t===`Map`?` as keys`:``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var Yr=new WeakMap,Xr=new WeakMap,Zr=new WeakMap,Qr=new WeakMap;function $r(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function ei(e){return e.__v_skip||!Object.isExtensible(e)?0:$r(Zn(e))}function ti(e){return e&&e.__v_isReadonly?e:ri(e,!1,Tr,Kr,Yr)}function ni(e){return ri(e,!0,Er,qr,Zr)}function ri(e,t,n,r,i){if(!Jn(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=i.get(e);if(a)return a;let o=ei(e);if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Z(e){return e&&Z(e.__v_raw)||e}function ii(e){return!!(e&&e.__v_isRef===!0)}S(`nextTick`,()=>Ft),S(`dispatch`,e=>j.bind(j,e)),S(`watch`,(e,{evaluateLater:t,cleanup:n})=>(e,r)=>{let i=t(e);n(ie(()=>{let e;return i(t=>e=t),e},r))}),S(`store`,Pn),S(`data`,e=>Te(e)),S(`root`,e=>Dt(e)),S(`refs`,e=>(e._x_refs_proxy||=x(ai(e)),e._x_refs_proxy));function ai(e){let t=[];return P(e,e=>{e._x_refs&&t.push(e._x_refs)}),t}var oi={};function si(e){return oi[e]||(oi[e]=0),++oi[e]}function ci(e,t){return P(e,e=>{if(e._x_ids&&e._x_ids[t])return!0})}function li(e,t){e._x_ids||={},e._x_ids[t]||(e._x_ids[t]=si(t))}S(`id`,(e,{cleanup:t})=>(n,r=null)=>ui(e,`${n}${r?`-${r}`:``}`,t,()=>{let t=ci(e,n),i=t?t._x_ids[n]:si(n);return r?`${n}-${i}-${r}`:`${n}-${i}`})),en((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function ui(e,t,n,r){if(e._x_id||={},e._x_id[t])return e._x_id[t];let i=r();return e._x_id[t]=i,n(()=>{delete e._x_id[t]}),i}S(`el`,e=>e),di(`Focus`,`focus`,`focus`),di(`Persist`,`persist`,`persist`);function di(e,t,n){S(t,r=>N(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}O(`modelable`,(e,{expression:t},{effect:n,evaluateLater:r,cleanup:i})=>{let a=r(t),o=()=>{let e;return a(t=>e=t),e},s=r(`${t} = __placeholder`),c=e=>s(()=>{},{scope:{__placeholder:e}});c(o()),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let t=e._x_model.get,n=e._x_model.set;i(kn({get(){return t()},set(e){n(e)}},{get(){return o()},set(e){c(e)}}))})}),O(`teleport`,(e,{modifiers:t,expression:n},{cleanup:r})=>{e.tagName.toLowerCase()!==`template`&&N(`x-teleport can only be used on a <template> tag`,e);let i=pi(n),a=e.content.cloneNode(!0).firstElementChild;e._x_teleport=a,a._x_teleportBack=e,e.setAttribute(`data-teleport-template`,!0),a.setAttribute(`data-teleport-target`,!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(t=>{a.addEventListener(t,t=>{t.stopPropagation(),e.dispatchEvent(new t.constructor(t.type,t))})}),y(a,{},e);let o=(e,t,n)=>{n.includes(`prepend`)?t.parentNode.insertBefore(e,t):n.includes(`append`)?t.parentNode.insertBefore(e,t.nextSibling):t.appendChild(e)};v(()=>{o(a,i,t),z(()=>{F(a)})()}),e._x_teleportPutBack=()=>{let r=pi(n);v(()=>{o(e._x_teleport,r,t)})},r(()=>v(()=>{a.remove(),I(a)}))});var fi=document.createElement(`div`);function pi(e){let t=z(()=>document.querySelector(e),()=>fi)();return t||N(`Cannot find x-teleport element for selector: "${e}"`),t}var mi=()=>{};mi.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes(`self`)?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes(`self`)?delete e._x_ignoreSelf:delete e._x_ignore})},O(`ignore`,mi),O(`effect`,z((e,{expression:t},{effect:n})=>{n(T(e,t))}));function Q(e,t,n,r){let i=e,a=e=>r(e),o={},s=(e,t)=>n=>t(e,n);if(n.includes(`dot`)&&(t=hi(t)),n.includes(`camel`)&&(t=gi(t)),n.includes(`passive`)&&(o.passive=!0),n.includes(`capture`)&&(o.capture=!0),n.includes(`window`)&&(i=window),n.includes(`document`)&&(i=document),n.includes(`debounce`)){let e=n[n.indexOf(`debounce`)+1]||`invalid-wait`,t=_i(e.split(`ms`)[0])?Number(e.split(`ms`)[0]):250;a=Dn(a,t)}if(n.includes(`throttle`)){let e=n[n.indexOf(`throttle`)+1]||`invalid-wait`,t=_i(e.split(`ms`)[0])?Number(e.split(`ms`)[0]):250;a=On(a,t)}return n.includes(`prevent`)&&(a=s(a,(e,t)=>{t.preventDefault(),e(t)})),n.includes(`stop`)&&(a=s(a,(e,t)=>{t.stopPropagation(),e(t)})),n.includes(`once`)&&(a=s(a,(e,n)=>{e(n),i.removeEventListener(t,a,o)})),(n.includes(`away`)||n.includes(`outside`))&&(i=document,a=s(a,(t,n)=>{e.contains(n.target)||n.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&t(n))})),n.includes(`self`)&&(a=s(a,(t,n)=>{n.target===e&&t(n)})),t===`submit`&&(a=s(a,(e,t)=>{t.target._x_pendingModelUpdates&&t.target._x_pendingModelUpdates.forEach(e=>e()),e(t)})),(yi(t)||bi(t))&&(a=s(a,(e,t)=>{xi(t,n)||e(t)})),i.addEventListener(t,a,o),()=>{i.removeEventListener(t,a,o)}}function hi(e){return e.replace(/-/g,`.`)}function gi(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function _i(e){return!Array.isArray(e)&&!isNaN(e)}function vi(e){return[` `,`_`].includes(e)?e:e.replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/[_\s]/,`-`).toLowerCase()}function yi(e){return[`keydown`,`keyup`].includes(e)}function bi(e){return[`contextmenu`,`click`,`mouse`].some(t=>e.includes(t))}function xi(e,t){let n=t.filter(e=>![`window`,`document`,`prevent`,`stop`,`once`,`capture`,`self`,`away`,`outside`,`passive`,`preserve-scroll`,`blur`,`change`,`lazy`].includes(e));if(n.includes(`debounce`)){let e=n.indexOf(`debounce`);n.splice(e,_i((n[e+1]||`invalid-wait`).split(`ms`)[0])?2:1)}if(n.includes(`throttle`)){let e=n.indexOf(`throttle`);n.splice(e,_i((n[e+1]||`invalid-wait`).split(`ms`)[0])?2:1)}if(n.length===0||n.length===1&&Si(e.key).includes(n[0]))return!1;let r=[`ctrl`,`shift`,`alt`,`meta`,`cmd`,`super`].filter(e=>n.includes(e));return n=n.filter(e=>!r.includes(e)),!(r.length>0&&r.filter(t=>((t===`cmd`||t===`super`)&&(t=`meta`),e[`${t}Key`])).length===r.length&&(bi(e.type)||Si(e.key).includes(n[0])))}function Si(e){if(!e)return[];e=vi(e);let t={ctrl:`control`,slash:`/`,space:` `,spacebar:` `,cmd:`meta`,esc:`escape`,up:`arrow-up`,down:`arrow-down`,left:`arrow-left`,right:`arrow-right`,period:`.`,comma:`,`,equal:`=`,minus:`-`,underscore:`_`};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(e=>e)}O(`model`,(e,{modifiers:t,expression:n},{effect:r,cleanup:i})=>{let a=e;t.includes(`parent`)&&(a=e.parentNode);let o=T(a,n),s;s=typeof n==`string`?T(a,`${n} = __placeholder`):typeof n==`function`&&typeof n()==`string`?T(a,`${n()} = __placeholder`):()=>{};let c=()=>{let e;return o(t=>e=t),Di(e)?e.get():e},l=e=>{let t;o(e=>t=e),Di(t)?t.set(e):s(()=>{},{scope:{__placeholder:e}})};typeof n==`string`&&e.type===`radio`&&v(()=>{e.hasAttribute(`name`)||e.setAttribute(`name`,n)});let u=t.includes(`change`)||t.includes(`lazy`),d=t.includes(`blur`),f=t.includes(`enter`),p=u||d||f,m;if(R)m=()=>{};else if(p){let n=[],r=n=>l(Ci(e,t,n,c()));if(u&&n.push(Q(e,`change`,t,r)),d&&(n.push(Q(e,`blur`,t,r)),e.form)){let t=()=>r({target:e});e.form._x_pendingModelUpdates||(e.form._x_pendingModelUpdates=[]),e.form._x_pendingModelUpdates.push(t),i(()=>e.form._x_pendingModelUpdates.splice(e.form._x_pendingModelUpdates.indexOf(t),1))}f&&n.push(Q(e,`keydown`,t,e=>{e.key===`Enter`&&r(e)})),m=()=>n.forEach(e=>e())}else m=Q(e,e.tagName.toLowerCase()===`select`||[`checkbox`,`radio`].includes(e.type)?`change`:`input`,t,n=>{l(Ci(e,t,n,c()))});if(t.includes(`fill`)&&([void 0,null,``].includes(c())||Tn(e)&&Array.isArray(c())||e.tagName.toLowerCase()===`select`&&e.multiple)&&l(Ci(e,t,{target:e},c())),e._x_removeModelListeners||={},e._x_removeModelListeners.default=m,i(()=>e._x_removeModelListeners.default()),e.form){let n=Q(e.form,`reset`,[],n=>{Ft(()=>e._x_model&&e._x_model.set(Ci(e,t,{target:e},c())))});i(()=>n())}e._x_model={get(){return c()},set(e){l(e)}},e._x_forceModelUpdate=t=>{t===void 0&&typeof n==`string`&&n.match(/\./)&&(t=``),window.fromModel=!0,v(()=>sn(e,`value`,t)),delete window.fromModel},r(()=>{let n=c();t.includes(`unintrusive`)&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(n)})});function Ci(e,t,n,r){return v(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail!==null&&n.detail!==void 0?n.detail:n.target.value;if(Tn(e))if(Array.isArray(r)){let e=null;return e=t.includes(`number`)?wi(n.target.value):t.includes(`boolean`)?vn(n.target.value):n.target.value,n.target.checked?r.includes(e)?r:r.concat([e]):r.filter(t=>!Ti(t,e))}else return n.target.checked;else if(e.tagName.toLowerCase()===`select`&&e.multiple)return t.includes(`number`)?Array.from(n.target.selectedOptions).map(e=>wi(e.value||e.text)):t.includes(`boolean`)?Array.from(n.target.selectedOptions).map(e=>vn(e.value||e.text)):Array.from(n.target.selectedOptions).map(e=>e.value||e.text);else{let i;return i=En(e)?n.target.checked?n.target.value:r:n.target.value,t.includes(`number`)?wi(i):t.includes(`boolean`)?vn(i):t.includes(`trim`)?i.trim():i}})}function wi(e){let t=e?parseFloat(e):null;return Ei(t)?t:e}function Ti(e,t){return e==t}function Ei(e){return!Array.isArray(e)&&!isNaN(e)}function Di(e){return typeof e==`object`&&!!e&&typeof e.get==`function`&&typeof e.set==`function`}O(`cloak`,e=>queueMicrotask(()=>v(()=>e.removeAttribute(D(`cloak`))))),Et(()=>`[${D(`init`)}]`),O(`init`,z((e,{expression:t},{evaluate:n})=>typeof t==`string`?!!t.trim()&&n(t,{},!1):n(t,{},!1))),O(`text`,(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(t=>{v(()=>{e.textContent=t})})})}),O(`html`,(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(t=>{v(()=>{e.innerHTML=t,e._x_ignoreSelf=!0,F(e),delete e._x_ignoreSelf})})})}),pt(lt(`:`,ut(D(`bind:`))));var Oi=(e,{value:t,modifiers:n,expression:r,original:i},{effect:a,cleanup:o})=>{if(!t){let t={};Ln(t),T(e,r)(t=>{Rn(e,t,i)},{scope:t});return}if(t===`key`)return ki(e,r);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let s=T(e,r);a(()=>s(i=>{i===void 0&&typeof r==`string`&&r.match(/\./)&&(i=``),v(()=>sn(e,t,i,n))})),o(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};Oi.inline=(e,{value:t,modifiers:n,expression:r})=>{t&&(e._x_inlineBindings||={},e._x_inlineBindings[t]={expression:r,extract:!1})},O(`bind`,Oi);function ki(e,t){e._x_keyExpression=t}Tt(()=>`[${D(`data`)}]`),O(`data`,(e,{expression:t},{cleanup:n})=>{if(Ai(e))return;t=t===``?`{}`:t;let r={};Ne(r,e);let i={};Vn(i,r);let a=w(e,t,{scope:i});(a===void 0||a===!0)&&(a={}),Ne(a,e);let o=f(a);Oe(o);let s=y(e,o);o.init&&w(e,o.init),n(()=>{o.destroy&&w(e,o.destroy),s()})}),en((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute(`data-has-alpine-state`,!0))});function Ai(e){return R?nn?!0:e.hasAttribute(`data-has-alpine-state`):!1}O(`show`,(e,{modifiers:t,expression:n},{effect:r})=>{let i=T(e,n);e._x_doHide||=()=>{v(()=>{e.style.setProperty(`display`,`none`,t.includes(`important`)?`important`:void 0)})},e._x_doShow||=()=>{v(()=>{e.style.length===1&&e.style.display===`none`?e.removeAttribute(`style`):e.style.removeProperty(`display`)})};let a=()=>{e._x_doHide(),e._x_isShown=!1},o=()=>{e._x_doShow(),e._x_isShown=!0},s=()=>setTimeout(o),c=Gt(e=>e?o():a(),t=>{typeof e._x_toggleAndCascadeWithTransitions==`function`?e._x_toggleAndCascadeWithTransitions(e,t,o,a):t?s():a()}),l,u=!0;r(()=>i(e=>{!u&&e===l||(t.includes(`immediate`)&&(e?s():a()),c(e),l=e,u=!1)}))}),O(`for`,(e,{expression:t},{effect:n,cleanup:r})=>{let i=Mi(t),a=T(e,i.items),o=T(e,e._x_keyExpression||`index`);e._x_prevKeys=[],e._x_lookup={},n(()=>ji(e,i,a,o)),r(()=>{Object.values(e._x_lookup).forEach(e=>v(()=>{I(e),e.remove()})),delete e._x_prevKeys,delete e._x_lookup})});function ji(e,t,n,r){let i=e=>typeof e==`object`&&!Array.isArray(e),a=e;n(n=>{Pi(n)&&n>=0&&(n=Array.from(Array(n).keys(),e=>e+1)),n===void 0&&(n=[]);let o=e._x_lookup,s=e._x_prevKeys,c=[],l=[];if(i(n))n=Object.entries(n).map(([i,a])=>{let o=Ni(t,a,i,n);r(t=>{l.includes(t)&&N(`Duplicate key on x-for`,e),l.push(t)},{scope:{index:i,...o}}),c.push(o)});else for(let i=0;i<n.length;i++){let a=Ni(t,n[i],i,n);r(t=>{l.includes(t)&&N(`Duplicate key on x-for`,e),l.push(t)},{scope:{index:i,...a}}),c.push(a)}let u=[],d=[],p=[],m=[];for(let e=0;e<s.length;e++){let t=s[e];l.indexOf(t)===-1&&p.push(t)}s=s.filter(e=>!p.includes(e));let h=`template`;for(let e=0;e<l.length;e++){let t=l[e],n=s.indexOf(t);if(n===-1)s.splice(e,0,t),u.push([h,e]);else if(n!==e){let t=s.splice(e,1)[0],r=s.splice(n-1,1)[0];s.splice(e,0,r),s.splice(n,0,t),d.push([t,r])}else m.push(t);h=t}for(let e=0;e<p.length;e++){let t=p[e];t in o&&(v(()=>{I(o[t]),o[t].remove()}),delete o[t])}for(let e=0;e<d.length;e++){let[t,n]=d[e],r=o[t],i=o[n],s=document.createElement(`div`);v(()=>{i||N(`x-for ":key" is undefined or invalid`,a,n,o),i.after(s),r.after(i),i._x_currentIfEl&&i.after(i._x_currentIfEl),s.before(r),r._x_currentIfEl&&r.after(r._x_currentIfEl),s.remove()}),i._x_refreshXForScope(c[l.indexOf(n)])}for(let e=0;e<u.length;e++){let[t,n]=u[e],r=t===`template`?a:o[t];r._x_currentIfEl&&(r=r._x_currentIfEl);let i=c[n],s=l[n],d=document.importNode(a.content,!0).firstElementChild,p=f(i);y(d,p,a),d._x_refreshXForScope=e=>{Object.entries(e).forEach(([e,t])=>{p[e]=t})},v(()=>{r.after(d),z(()=>F(d))()}),typeof s==`object`&&N(`x-for key cannot be an object, it must be a string or an integer`,a),o[s]=d}for(let e=0;e<m.length;e++)o[m[e]]._x_refreshXForScope(c[l.indexOf(m[e])]);a._x_prevKeys=l})}function Mi(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,r=e.match(/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/);if(!r)return;let i={};i.items=r[2].trim();let a=r[1].replace(n,``).trim(),o=a.match(t);return o?(i.item=a.replace(t,``).trim(),i.index=o[1].trim(),o[2]&&(i.collection=o[2].trim())):i.item=a,i}function Ni(e,t,n,r){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace(`[`,``).replace(`]`,``).split(`,`).map(e=>e.trim()).forEach((e,n)=>{i[e]=t[n]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t==`object`?e.item.replace(`{`,``).replace(`}`,``).split(`,`).map(e=>e.trim()).forEach(e=>{i[e]=t[e]}):i[e.item]=t,e.index&&(i[e.index]=n),e.collection&&(i[e.collection]=r),i}function Pi(e){return!Array.isArray(e)&&!isNaN(e)}function Fi(){}Fi.inline=(e,{expression:t},{cleanup:n})=>{let r=Dt(e);r._x_refs||={},r._x_refs[t]=e,n(()=>delete r._x_refs[t])},O(`ref`,Fi),O(`if`,(e,{expression:t},{effect:n,cleanup:r})=>{e.tagName.toLowerCase()!==`template`&&N(`x-if can only be used on a <template> tag`,e);let i=T(e,t),a=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let t=e.content.cloneNode(!0).firstElementChild;return y(t,{},e),v(()=>{e.after(t),z(()=>F(t))()}),e._x_currentIfEl=t,e._x_undoIf=()=>{v(()=>{I(t),t.remove()}),delete e._x_currentIfEl},t},o=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>i(e=>{e?a():o()})),r(()=>e._x_undoIf&&e._x_undoIf())}),O(`id`,(e,{expression:t},{evaluate:n})=>{n(t).forEach(t=>li(e,t))}),en((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)}),pt(lt(`@`,ut(D(`on:`)))),O(`on`,z((e,{value:t,modifiers:n,expression:r},{cleanup:i})=>{let a=r?T(e,r):()=>{};e.tagName.toLowerCase()===`template`&&(e._x_forwardEvents||=[],e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let o=Q(e,t,n,e=>{a(()=>{},{scope:{$event:e},params:[e]})});i(()=>o())})),Ii(`Collapse`,`collapse`,`collapse`),Ii(`Intersect`,`intersect`,`intersect`),Ii(`Focus`,`trap`,`focus`),Ii(`Mask`,`mask`,`mask`);function Ii(e,t,n){O(t,r=>N(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}V.setEvaluator(Ge),V.setRawEvaluator(Ze),V.setReactivityEngine({reactive:ti,effect:ir,release:ar,raw:Z});var $=V;window.Alpine=$,$.data(`app`,()=>({runs:[],selectedRunId:null,tree:[],expanded:{},activeAttempts:{},timeline:null,get flatRows(){let e=[],t=(n,r)=>{for(let i of n){let n=Ri(i,r),a=this.activeAttempts[n]??0,o=i.attempts[a]??i.attempts[0],s=o.children.length>0;e.push({key:n,group:i,depth:r,attemptIdx:a,hasChildren:s,dur:o.duration_ms}),s&&this.expanded[n]&&t(o.children,r+1)}};return t(this.tree,0),e},async init(){await this.loadRuns(),setInterval(()=>this.loadRuns(),3e3)},async loadRuns(){try{this.runs=await(await fetch(`/api/runs`)).json()}catch(e){console.error(`failed to load runs`,e)}},async selectRun(e){if(this.selectedRunId!==e.trace_id){this.selectedRunId=e.trace_id,this.tree=[],this.expanded={},this.activeAttempts={},this.timeline=null;try{let t=await(await fetch(`/api/runs/${e.trace_id}/tree`)).json();if(this.tree=t,t.length>0){let e=Ri(t[0],0);this.expanded[e]=!0}}catch(e){console.error(`failed to load tree`,e)}}},toggleExpand(e){this.expanded[e]=!this.expanded[e]},async selectAgent(e){e.hasChildren&&(this.expanded[e.key]=!this.expanded[e.key]),await this.loadTimeline(e.key,e.group,e.attemptIdx)},async loadTimeline(e,t,n){let r=t.attempts[n]??t.attempts[0];try{let i=await(await fetch(`/api/agents/${r.span_id}/timeline`)).json(),a=i.filter(e=>e.kind===`llm`),o=a[0];this.timeline={groupKey:e,agentName:t.name,pattern:t.pattern,spanId:r.span_id,attemptIdx:n,totalAttempts:t.attempts.length,events:i,model:o?.model||``,temperature:o?.temperature??null,systemPrompt:o?.system_prompt||``,totalIn:a.reduce((e,t)=>e+t.input_tokens,0),totalOut:a.reduce((e,t)=>e+t.output_tokens,0),totalMs:a.reduce((e,t)=>e+t.duration_ms,0)}}catch(e){console.error(`failed to load timeline`,e)}},async switchAttempt(e,t){if(this.activeAttempts[e]=t,this.timeline&&this.timeline.groupKey===e){let n=this.flatRows.find(t=>t.key===e);n&&await this.loadTimeline(e,n.group,t)}},async switchAttemptTimeline(e){if(!this.timeline)return;let t=this.flatRows.find(e=>e.key===this.timeline.groupKey);t&&(this.activeAttempts[this.timeline.groupKey]=e,await this.loadTimeline(this.timeline.groupKey,t.group,e))}})),window.prettyJson=function(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e||``}},window.shortArgs=function(e){try{let t=JSON.parse(e),n=Object.keys(t);return n.length===0?``:n.map(e=>{let n=String(t[e]);return`${e}=${n.length>30?n.slice(0,30)+`…`:n}`}).join(`  `)}catch{return e||``}},window.truncate=function(e,t){return e?e.length>t?e.slice(0,t)+`…`:e:``};var Li={react:`#3fa9f5`,scatter:`#9263ab`,parallel:`#3737aa`,orchestrator:`#19838e`,fsm:`#8b9b29`,critic:`#f15a24`,reflexion:`#aa2e2e`,constitutional:`#6b7280`,debate:`#d946ef`,best_of_n:`#0ea5e9`,chain_of_verification:`#19838e`,plan_execute:`#8b9b29`,oneshot:`#6b7280`};window.patternColor=function(e){return Li[e]||`#9ca3af`},$.magic(`prettyJson`,()=>window.prettyJson),$.magic(`shortArgs`,()=>window.shortArgs),$.magic(`truncate`,()=>window.truncate),$.magic(`patternColor`,()=>window.patternColor),$.start();function Ri(e,t){return e.id}