@walker-di/fortalece-ai-sdk 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,9 @@
1
1
  var FortaleceAI=(function(ne){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const ds=1,hs=2,ps=16,vs=1,gs=2,Yr="[",Rt="[!",or="]",lt={},F=Symbol(),ms="http://www.w3.org/1999/xhtml",lr=!1;var Zr=Array.isArray,_s=Array.prototype.indexOf,Mt=Array.from,It=Object.keys,Lt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,bs=Object.getOwnPropertyDescriptors,ws=Object.prototype,ys=Array.prototype,Gr=Object.getPrototypeOf,Jr=Object.isExtensible;function xs(e){for(var t=0;t<e.length;t++)e[t]()}function Xr(){var e,t,r=new Promise((n,s)=>{e=n,t=s});return{promise:r,resolve:e,reject:t}}const U=2,Dt=4,Ot=8,Qr=1<<24,Ce=16,Ae=32,je=64,cr=128,ue=512,H=1024,K=2048,ze=4096,se=8192,Te=16384,Nt=32768,ft=65536,en=1<<17,tn=1<<18,Xe=1<<19,$s=1<<20,Be=1<<25,Qe=32768,fr=1<<21,ur=1<<22,He=1<<23,Pt=Symbol("$state"),Ss=Symbol("legacy props"),ks=Symbol(""),ut=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},dr=3,dt=8;function Es(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Cs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function As(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function zs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ts(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Rs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ms(){throw new Error("https://svelte.dev/e/hydration_failed")}function Is(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ls(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ds(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Os(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Ft(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ns(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let k=!1;function Re(e){k=e}let S;function ie(e){if(e===null)throw Ft(),lt;return S=e}function Ut(){return ie(ye(S))}function z(e){if(k){if(ye(S)!==null)throw Ft(),lt;S=e}}function hr(e=1){if(k){for(var t=e,r=S;t--;)r=ye(r);S=r}}function jt(e=!0){for(var t=0,r=S;;){if(r.nodeType===dt){var n=r.data;if(n===or){if(t===0)return r;t-=1}else(n===Yr||n===Rt)&&(t+=1)}var s=ye(r);e&&r.remove(),r=s}}function rn(e){if(!e||e.nodeType!==dt)throw Ft(),lt;return e.data}function nn(e){return e===this.v}function Ps(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function sn(e){return!Ps(e,this.v)}let Fs=!1,ae=null;function ht(e){ae=e}function pr(e,t=!1,r){ae={p:ae,i:!1,c:null,e:null,s:e,x:null,l:null}}function vr(e){var t=ae,r=t.e;if(r!==null){t.e=null;for(var n of r)An(n)}return e!==void 0&&(t.x=e),t.i=!0,ae=t.p,e??{}}function an(){return!0}let et=[];function on(){var e=et;et=[],xs(e)}function tt(e){if(et.length===0&&!wt){var t=et;queueMicrotask(()=>{t===et&&on()})}et.push(e)}function Us(){for(;et.length>0;)on()}function ln(e){var t=E;if(t===null)return $.f|=He,e;if((t.f&Nt)===0){if((t.f&cr)===0)throw e;t.b.error(e)}else pt(e,t)}function pt(e,t){for(;t!==null;){if((t.f&cr)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const js=-7169;function N(e,t){e.f=e.f&js|t}function gr(e){(e.f&ue)!==0||e.deps===null?N(e,H):N(e,ze)}function cn(e){if(e!==null)for(const t of e)(t.f&U)===0||(t.f&Qe)===0||(t.f^=Qe,cn(t.deps))}function fn(e,t,r){(e.f&K)!==0?t.add(e):(e.f&ze)!==0&&r.add(e),cn(e.deps),N(e,H)}const Bt=new Set;let L=null,ge=null,oe=[],Ht=null,mr=!1,wt=!1;class Me{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#i=0;#a=null;#s=new Set;#n=new Set;skipped_effects=new Set;is_fork=!1;#o=!1;is_deferred(){return this.is_fork||this.#i>0}process(t){oe=[],this.apply();var r=[],n=[];for(const s of t)this.#l(s,r,n);if(this.is_deferred())this.#c(n),this.#c(r);else{for(const s of this.#e)s();this.#e.clear(),this.#r===0&&this.#f(),L=null,dn(n),dn(r),this.#a?.resolve()}ge=null}#l(t,r,n){t.f^=H;for(var s=t.first,i=null;s!==null;){var a=s.f,o=(a&(Ae|je))!==0,l=o&&(a&H)!==0,f=l||(a&se)!==0||this.skipped_effects.has(s);if(!f&&s.fn!==null){o?s.f^=H:i!==null&&(a&(Dt|Ot|Qr))!==0?i.b.defer_effect(s):(a&Dt)!==0?r.push(s):xt(s)&&((a&Ce)!==0&&this.#s.add(s),$t(s));var u=s.first;if(u!==null){s=u;continue}}var d=s.parent;for(s=s.next;s===null&&d!==null;)d===i&&(i=null),s=d.next,d=d.parent}}#c(t){for(var r=0;r<t.length;r+=1)fn(t[r],this.#s,this.#n)}capture(t,r){r!==F&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&He)===0&&(this.current.set(t,t.v),ge?.set(t,t.v))}activate(){L=this,this.apply()}deactivate(){L===this&&(L=null,ge=null)}flush(){if(this.activate(),oe.length>0){if(un(),L!==null&&L!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#t)t(this);this.#t.clear()}#f(){if(Bt.size>1){this.previous.clear();var t=ge,r=!0;for(const s of Bt){if(s===this){r=!1;continue}const i=[];for(const[o,l]of this.current){if(s.current.has(o))if(r&&l!==s.current.get(o))s.current.set(o,l);else continue;i.push(o)}if(i.length===0)continue;const a=[...s.current.keys()].filter(o=>!this.current.has(o));if(a.length>0){var n=oe;oe=[];const o=new Set,l=new Map;for(const f of i)hn(f,a,o,l);if(oe.length>0){L=s,s.apply();for(const f of oe)s.#l(f,[],[]);s.deactivate()}oe=n}}L=null,ge=t}this.committed=!0,Bt.delete(this)}increment(t){this.#r+=1,t&&(this.#i+=1)}decrement(t){this.#r-=1,t&&(this.#i-=1),!this.#o&&(this.#o=!0,tt(()=>{this.#o=!1,this.is_deferred()?oe.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#s)this.#n.delete(t),N(t,K),Le(t);for(const t of this.#n)N(t,ze),Le(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#t.add(t)}settled(){return(this.#a??=Xr()).promise}static ensure(){if(L===null){const t=L=new Me;Bt.add(L),wt||tt(()=>{L===t&&t.flush()})}return L}apply(){}}function q(e){var t=wt;wt=!0;try{for(var r;;){if(Us(),oe.length===0&&(L?.flush(),oe.length===0))return Ht=null,r;un()}}finally{wt=t}}function un(){mr=!0;var e=null;try{for(var t=0;oe.length>0;){var r=Me.ensure();if(t++>1e3){var n,s;Bs()}r.process(oe),qe.clear()}}finally{mr=!1,Ht=null}}function Bs(){try{Rs()}catch(e){pt(e,Ht)}}let Ie=null;function dn(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(Te|se))===0&&xt(n)&&(Ie=new Set,$t(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?Mn(n):n.fn=null),Ie?.size>0)){qe.clear();for(const s of Ie){if((s.f&(Te|se))!==0)continue;const i=[s];let a=s.parent;for(;a!==null;)Ie.has(a)&&(Ie.delete(a),i.push(a)),a=a.parent;for(let o=i.length-1;o>=0;o--){const l=i[o];(l.f&(Te|se))===0&&$t(l)}}Ie.clear()}}Ie=null}}function hn(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const s of e.reactions){const i=s.f;(i&U)!==0?hn(s,t,r,n):(i&(ur|Ce))!==0&&(i&K)===0&&pn(s,t,n)&&(N(s,K),Le(s))}}function pn(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const s of e.deps){if(t.includes(s))return!0;if((s.f&U)!==0&&pn(s,t,r))return r.set(s,!0),!0}return r.set(e,!1),!1}function Le(e){for(var t=Ht=e;t.parent!==null;){t=t.parent;var r=t.f;if(mr&&t===E&&(r&Ce)!==0&&(r&tn)===0)return;if((r&(je|Ae))!==0){if((r&H)===0)return;t.f^=H}}oe.push(t)}function Hs(e){let t=0,r=rt(0),n;return()=>{xr()&&(c(r),$r(()=>(t===0&&(n=Er(()=>e(()=>yt(r)))),t+=1,()=>{tt(()=>{t-=1,t===0&&(n?.(),n=void 0,yt(r))})})))}}var qs=ft|Xe|cr;function Vs(e,t,r){new Ws(e,t,r)}class Ws{parent;is_pending=!1;#e;#t=k?S:null;#r;#i;#a;#s=null;#n=null;#o=null;#l=null;#c=null;#f=0;#u=0;#p=!1;#h=!1;#v=new Set;#g=new Set;#d=null;#y=Hs(()=>(this.#d=rt(this.#f),()=>{this.#d=null}));constructor(t,r,n){this.#e=t,this.#r=r,this.#i=n,this.parent=E.b,this.is_pending=!!this.#r.pending,this.#a=Sr(()=>{if(E.b=this,k){const i=this.#t;Ut(),i.nodeType===dt&&i.data===Rt?this.#$():(this.#x(),this.#u===0&&(this.is_pending=!1))}else{var s=this.#b();try{this.#s=de(()=>n(s))}catch(i){this.error(i)}this.#u>0?this.#_():this.is_pending=!1}return()=>{this.#c?.remove()}},qs),k&&(this.#e=S)}#x(){try{this.#s=de(()=>this.#i(this.#e))}catch(t){this.error(t)}}#$(){const t=this.#r.pending;t&&(this.#n=de(()=>t(this.#e)),tt(()=>{var r=this.#b();this.#s=this.#m(()=>(Me.ensure(),de(()=>this.#i(r)))),this.#u>0?this.#_():(nt(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#b(){var t=this.#e;return this.is_pending&&(this.#c=_e(),this.#e.before(this.#c),t=this.#c),t}defer_effect(t){fn(t,this.#v,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#m(t){var r=E,n=$,s=ae;$e(this.#a),X(this.#a),ht(this.#a.ctx);try{return t()}catch(i){return ln(i),null}finally{$e(r),X(n),ht(s)}}#_(){const t=this.#r.pending;this.#s!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),Dn(this.#s,this.#l)),this.#n===null&&(this.#n=de(()=>t(this.#e)))}#w(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(t);return}if(this.#u+=t,this.#u===0){this.is_pending=!1;for(const r of this.#v)N(r,K),Le(r);for(const r of this.#g)N(r,ze),Le(r);this.#v.clear(),this.#g.clear(),this.#n&&nt(this.#n,()=>{this.#n=null}),this.#l&&(this.#e.before(this.#l),this.#l=null)}}update_pending_count(t){this.#w(t),this.#f+=t,!(!this.#d||this.#p)&&(this.#p=!0,tt(()=>{this.#p=!1,this.#d&&vt(this.#d,this.#f)}))}get_effect_pending(){return this.#y(),c(this.#d)}error(t){var r=this.#r.onerror;let n=this.#r.failed;if(this.#h||!r&&!n)throw t;this.#s&&(Y(this.#s),this.#s=null),this.#n&&(Y(this.#n),this.#n=null),this.#o&&(Y(this.#o),this.#o=null),k&&(ie(this.#t),hr(),ie(jt()));var s=!1,i=!1;const a=()=>{if(s){Ns();return}s=!0,i&&Os(),Me.ensure(),this.#f=0,this.#o!==null&&nt(this.#o,()=>{this.#o=null}),this.is_pending=this.has_pending_snippet(),this.#s=this.#m(()=>(this.#h=!1,de(()=>this.#i(this.#e)))),this.#u>0?this.#_():this.is_pending=!1};var o=$;try{X(null),i=!0,r?.(t,a),i=!1}catch(l){pt(l,this.#a&&this.#a.parent)}finally{X(o)}n&&tt(()=>{this.#o=this.#m(()=>{Me.ensure(),this.#h=!0;try{return de(()=>{n(this.#e,()=>t,()=>a)})}catch(l){return pt(l,this.#a.parent),null}finally{this.#h=!1}})})}}function Ks(e,t,r,n){const s=qt;var i=e.filter(h=>!h.settled);if(r.length===0&&i.length===0){n(t.map(s));return}var a=L,o=E,l=Ys(),f=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(h=>h.promise)):null;function u(h){l();try{n(h)}catch(g){(o.f&Te)===0&&pt(g,o)}a?.deactivate(),_r()}if(r.length===0){f.then(()=>u(t.map(s)));return}function d(){l(),Promise.all(r.map(h=>Zs(h))).then(h=>u([...t.map(s),...h])).catch(h=>pt(h,o))}f?f.then(d):d()}function Ys(){var e=E,t=$,r=ae,n=L;return function(i=!0){$e(e),X(t),ht(r),i&&n?.activate()}}function _r(){$e(null),X(null),ht(null)}function qt(e){var t=U|K,r=$!==null&&($.f&U)!==0?$:null;return E!==null&&(E.f|=Xe),{ctx:ae,deps:null,effects:null,equals:nn,f:t,fn:e,reactions:null,rv:0,v:F,wv:0,parent:r??E,ac:null}}function Zs(e,t,r){let n=E;n===null&&Cs();var s=n.b,i=void 0,a=rt(F),o=!$,l=new Map;return si(()=>{var f=Xr();i=f.promise;try{Promise.resolve(e()).then(f.resolve,f.reject).then(()=>{u===L&&u.committed&&u.deactivate(),_r()})}catch(g){f.reject(g),_r()}var u=L;if(o){var d=s.is_rendered();s.update_pending_count(1),u.increment(d),l.get(u)?.reject(ut),l.delete(u),l.set(u,f)}const h=(g,p=void 0)=>{if(u.activate(),p)p!==ut&&(a.f|=He,vt(a,p));else{(a.f&He)!==0&&(a.f^=He),vt(a,g);for(const[y,R]of l){if(l.delete(y),y===u)break;R.reject(ut)}}o&&(s.update_pending_count(-1),u.decrement(d))};f.promise.then(h,g=>h(null,g||"unknown"))}),ti(()=>{for(const f of l.values())f.reject(ut)}),new Promise(f=>{function u(d){function h(){d===i?f(a):u(i)}d.then(h,h)}u(i)})}function me(e){const t=qt(e);return Nn(t),t}function Gs(e){const t=qt(e);return t.equals=sn,t}function vn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Y(t[r])}}function Js(e){for(var t=e.parent;t!==null;){if((t.f&U)===0)return(t.f&Te)===0?t:null;t=t.parent}return null}function br(e){var t,r=E;$e(Js(e));try{e.f&=~Qe,vn(e),t=Bn(e)}finally{$e(r)}return t}function gn(e){var t=br(e);if(!e.equals(t)&&(e.wv=Un(),(!L?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){N(e,H);return}We||(ge!==null?(xr()||L?.is_fork)&&ge.set(e,t):gr(e))}let wr=new Set;const qe=new Map;let mn=!1;function rt(e,t){var r={f:0,v:e,reactions:null,equals:nn,rv:0,wv:0};return r}function A(e,t){const r=rt(e);return Nn(r),r}function _n(e,t=!1,r=!0){const n=rt(e);return t||(n.equals=sn),n}function m(e,t,r=!1){$!==null&&(!be||($.f&en)!==0)&&an()&&($.f&(U|Ce|ur|en))!==0&&!Oe?.includes(e)&&Ds();let n=r?De(t):t;return vt(e,n)}function vt(e,t){if(!e.equals(t)){var r=e.v;We?qe.set(e,t):qe.set(e,r),e.v=t;var n=Me.ensure();if(n.capture(e,r),(e.f&U)!==0){const s=e;(e.f&K)!==0&&br(s),gr(s)}e.wv=Un(),bn(e,K),E!==null&&(E.f&H)!==0&&(E.f&(Ae|je))===0&&(he===null?oi([e]):he.push(e)),!n.is_fork&&wr.size>0&&!mn&&Xs()}return t}function Xs(){mn=!1;for(const e of wr)(e.f&H)!==0&&N(e,ze),xt(e)&&$t(e);wr.clear()}function yt(e){m(e,e.v+1)}function bn(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,s=0;s<n;s++){var i=r[s],a=i.f,o=(a&K)===0;if(o&&N(i,t),(a&U)!==0){var l=i;ge?.delete(l),(a&Qe)===0&&(a&ue&&(i.f|=Qe),bn(l,ze))}else o&&((a&Ce)!==0&&Ie!==null&&Ie.add(i),Le(i))}}function De(e){if(typeof e!="object"||e===null||Pt in e)return e;const t=Gr(e);if(t!==ws&&t!==ys)return e;var r=new Map,n=Zr(e),s=A(0),i=it,a=o=>{if(it===i)return o();var l=$,f=it;X(null),Fn(i);var u=o();return X(l),Fn(f),u};return n&&r.set("length",A(e.length)),new Proxy(e,{defineProperty(o,l,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Is();var u=r.get(l);return u===void 0?u=a(()=>{var d=A(f.value);return r.set(l,d),d}):m(u,f.value,!0),!0},deleteProperty(o,l){var f=r.get(l);if(f===void 0){if(l in o){const u=a(()=>A(F));r.set(l,u),yt(s)}}else m(f,F),yt(s);return!0},get(o,l,f){if(l===Pt)return e;var u=r.get(l),d=l in o;if(u===void 0&&(!d||ct(o,l)?.writable)&&(u=a(()=>{var g=De(d?o[l]:F),p=A(g);return p}),r.set(l,u)),u!==void 0){var h=c(u);return h===F?void 0:h}return Reflect.get(o,l,f)},getOwnPropertyDescriptor(o,l){var f=Reflect.getOwnPropertyDescriptor(o,l);if(f&&"value"in f){var u=r.get(l);u&&(f.value=c(u))}else if(f===void 0){var d=r.get(l),h=d?.v;if(d!==void 0&&h!==F)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return f},has(o,l){if(l===Pt)return!0;var f=r.get(l),u=f!==void 0&&f.v!==F||Reflect.has(o,l);if(f!==void 0||E!==null&&(!u||ct(o,l)?.writable)){f===void 0&&(f=a(()=>{var h=u?De(o[l]):F,g=A(h);return g}),r.set(l,f));var d=c(f);if(d===F)return!1}return u},set(o,l,f,u){var d=r.get(l),h=l in o;if(n&&l==="length")for(var g=f;g<d.v;g+=1){var p=r.get(g+"");p!==void 0?m(p,F):g in o&&(p=a(()=>A(F)),r.set(g+"",p))}if(d===void 0)(!h||ct(o,l)?.writable)&&(d=a(()=>A(void 0)),m(d,De(f)),r.set(l,d));else{h=d.v!==F;var y=a(()=>De(f));m(d,y)}var R=Reflect.getOwnPropertyDescriptor(o,l);if(R?.set&&R.set.call(u,f),!h){if(n&&typeof l=="string"){var b=r.get("length"),x=Number(l);Number.isInteger(x)&&x>=b.v&&m(b,x+1)}yt(s)}return!0},ownKeys(o){c(s);var l=Reflect.ownKeys(o).filter(d=>{var h=r.get(d);return h===void 0||h.v!==F});for(var[f,u]of r)u.v!==F&&!(f in o)&&l.push(f);return l},setPrototypeOf(){Ls()}})}var wn,yn,xn,$n;function yr(){if(wn===void 0){wn=window,yn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;xn=ct(t,"firstChild").get,$n=ct(t,"nextSibling").get,Jr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Jr(r)&&(r.__t=void 0)}}function _e(e=""){return document.createTextNode(e)}function Ve(e){return xn.call(e)}function ye(e){return $n.call(e)}function T(e,t){if(!k)return Ve(e);var r=Ve(S);if(r===null)r=S.appendChild(_e());else if(t&&r.nodeType!==dr){var n=_e();return r?.before(n),ie(n),n}return ie(r),r}function Sn(e,t=!1){if(!k){var r=Ve(e);return r instanceof Comment&&r.data===""?ye(r):r}if(t&&S?.nodeType!==dr){var n=_e();return S?.before(n),ie(n),n}return S}function O(e,t=1,r=!1){let n=k?S:e;for(var s;t--;)s=n,n=ye(n);if(!k)return n;if(r&&n?.nodeType!==dr){var i=_e();return n===null?s?.after(i):n.before(i),ie(i),i}return ie(n),n}function kn(e){e.textContent=""}function En(){return!1}function Cn(e){var t=$,r=E;X(null),$e(null);try{return e()}finally{X(t),$e(r)}}function Qs(e){E===null&&($===null&&Ts(),zs()),We&&As()}function ei(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function xe(e,t,r){var n=E;n!==null&&(n.f&se)!==0&&(e|=se);var s={ctx:ae,deps:null,nodes:null,f:e|K|ue,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{$t(s),s.f|=Nt}catch(o){throw Y(s),o}else t!==null&&Le(s);var i=s;if(r&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&Xe)===0&&(i=i.first,(e&Ce)!==0&&(e&ft)!==0&&i!==null&&(i.f|=ft)),i!==null&&(i.parent=n,n!==null&&ei(i,n),$!==null&&($.f&U)!==0&&(e&je)===0)){var a=$;(a.effects??=[]).push(i)}return s}function xr(){return $!==null&&!be}function ti(e){const t=xe(Ot,null,!1);return N(t,H),t.teardown=e,t}function Vt(e){Qs();var t=E.f,r=!$&&(t&Ae)!==0&&(t&Nt)===0;if(r){var n=ae;(n.e??=[]).push(e)}else return An(e)}function An(e){return xe(Dt|$s,e,!1)}function ri(e){Me.ensure();const t=xe(je|Xe,e,!0);return()=>{Y(t)}}function ni(e){Me.ensure();const t=xe(je|Xe,e,!0);return(r={})=>new Promise(n=>{r.outro?nt(t,()=>{Y(t),n(void 0)}):(Y(t),n(void 0))})}function zn(e){return xe(Dt,e,!1)}function si(e){return xe(ur|Xe,e,!0)}function $r(e,t=0){return xe(Ot|t,e,!0)}function J(e,t=[],r=[],n=[]){Ks(n,t,r,s=>{xe(Ot,()=>e(...s.map(c)),!0)})}function Sr(e,t=0){var r=xe(Ce|t,e,!0);return r}function de(e){return xe(Ae|Xe,e,!0)}function Tn(e){var t=e.teardown;if(t!==null){const r=We,n=$;On(!0),X(null);try{t.call(null)}finally{On(r),X(n)}}}function Rn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const s=r.ac;s!==null&&Cn(()=>{s.abort(ut)});var n=r.next;(r.f&je)!==0?r.parent=null:Y(r,t),r=n}}function ii(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Ae)===0&&Y(t),t=r}}function Y(e,t=!0){var r=!1;(t||(e.f&tn)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ai(e.nodes.start,e.nodes.end),r=!0),Rn(e,t&&!r),Kt(e,0),N(e,Te);var n=e.nodes&&e.nodes.t;if(n!==null)for(const i of n)i.stop();Tn(e);var s=e.parent;s!==null&&s.first!==null&&Mn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function ai(e,t){for(;e!==null;){var r=e===t?null:ye(e);e.remove(),e=r}}function Mn(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function nt(e,t,r=!0){var n=[];In(e,n,!0);var s=()=>{r&&Y(e),t&&t()},i=n.length;if(i>0){var a=()=>--i||s();for(var o of n)o.out(a)}else s()}function In(e,t,r){if((e.f&se)===0){e.f^=se;var n=e.nodes&&e.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&t.push(o);for(var s=e.first;s!==null;){var i=s.next,a=(s.f&ft)!==0||(s.f&Ae)!==0&&(e.f&Ce)!==0;In(s,t,a?r:!1),s=i}}}function kr(e){Ln(e,!0)}function Ln(e,t){if((e.f&se)!==0){e.f^=se,(e.f&H)===0&&(N(e,K),Le(e));for(var r=e.first;r!==null;){var n=r.next,s=(r.f&ft)!==0||(r.f&Ae)!==0;Ln(r,s?t:!1),r=n}var i=e.nodes&&e.nodes.t;if(i!==null)for(const a of i)(a.is_global||t)&&a.in()}}function Dn(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var s=r===n?null:ye(r);t.append(r),r=s}}let Wt=!1,We=!1;function On(e){We=e}let $=null,be=!1;function X(e){$=e}let E=null;function $e(e){E=e}let Oe=null;function Nn(e){$!==null&&(Oe===null?Oe=[e]:Oe.push(e))}let Q=null,le=0,he=null;function oi(e){he=e}let Pn=1,st=0,it=st;function Fn(e){it=e}function Un(){return++Pn}function xt(e){var t=e.f;if((t&K)!==0)return!0;if(t&U&&(e.f&=~Qe),(t&ze)!==0){for(var r=e.deps,n=r.length,s=0;s<n;s++){var i=r[s];if(xt(i)&&gn(i),i.wv>e.wv)return!0}(t&ue)!==0&&ge===null&&N(e,H)}return!1}function jn(e,t,r=!0){var n=e.reactions;if(n!==null&&!Oe?.includes(e))for(var s=0;s<n.length;s++){var i=n[s];(i.f&U)!==0?jn(i,t,!1):t===i&&(r?N(i,K):(i.f&H)!==0&&N(i,ze),Le(i))}}function Bn(e){var t=Q,r=le,n=he,s=$,i=Oe,a=ae,o=be,l=it,f=e.f;Q=null,le=0,he=null,$=(f&(Ae|je))===0?e:null,Oe=null,ht(e.ctx),be=!1,it=++st,e.ac!==null&&(Cn(()=>{e.ac.abort(ut)}),e.ac=null);try{e.f|=fr;var u=e.fn,d=u(),h=e.deps;if(Q!==null){var g;if(Kt(e,le),h!==null&&le>0)for(h.length=le+Q.length,g=0;g<Q.length;g++)h[le+g]=Q[g];else e.deps=h=Q;if(xr()&&(e.f&ue)!==0)for(g=le;g<h.length;g++)(h[g].reactions??=[]).push(e)}else h!==null&&le<h.length&&(Kt(e,le),h.length=le);if(an()&&he!==null&&!be&&h!==null&&(e.f&(U|ze|K))===0)for(g=0;g<he.length;g++)jn(he[g],e);if(s!==null&&s!==e){if(st++,s.deps!==null)for(let p=0;p<r;p+=1)s.deps[p].rv=st;if(t!==null)for(const p of t)p.rv=st;he!==null&&(n===null?n=he:n.push(...he))}return(e.f&He)!==0&&(e.f^=He),d}catch(p){return ln(p)}finally{e.f^=fr,Q=t,le=r,he=n,$=s,Oe=i,ht(a),be=o,it=l}}function li(e,t){let r=t.reactions;if(r!==null){var n=_s.call(r,e);if(n!==-1){var s=r.length-1;s===0?r=t.reactions=null:(r[n]=r[s],r.pop())}}if(r===null&&(t.f&U)!==0&&(Q===null||!Q.includes(t))){var i=t;(i.f&ue)!==0&&(i.f^=ue,i.f&=~Qe),gr(i),vn(i),Kt(i,0)}}function Kt(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)li(e,r[n])}function $t(e){var t=e.f;if((t&Te)===0){N(e,H);var r=E,n=Wt;E=e,Wt=!0;try{(t&(Ce|Qr))!==0?ii(e):Rn(e),Tn(e);var s=Bn(e);e.teardown=typeof s=="function"?s:null,e.wv=Pn;var i;lr&&Fs&&(e.f&K)!==0&&e.deps}finally{Wt=n,E=r}}}function c(e){var t=e.f,r=(t&U)!==0;if($!==null&&!be){var n=E!==null&&(E.f&Te)!==0;if(!n&&!Oe?.includes(e)){var s=$.deps;if(($.f&fr)!==0)e.rv<st&&(e.rv=st,Q===null&&s!==null&&s[le]===e?le++:Q===null?Q=[e]:Q.push(e));else{($.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[$]:i.includes($)||i.push($)}}}if(We&&qe.has(e))return qe.get(e);if(r){var a=e;if(We){var o=a.v;return((a.f&H)===0&&a.reactions!==null||qn(a))&&(o=br(a)),qe.set(a,o),o}var l=(a.f&ue)===0&&!be&&$!==null&&(Wt||($.f&ue)!==0),f=a.deps===null;xt(a)&&(l&&(a.f|=ue),gn(a)),l&&!f&&Hn(a)}if(ge?.has(e))return ge.get(e);if((e.f&He)!==0)throw e.v;return e.v}function Hn(e){if(e.deps!==null){e.f|=ue;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&U)!==0&&(t.f&ue)===0&&Hn(t)}}function qn(e){if(e.v===F)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(qe.has(t)||(t.f&U)!==0&&qn(t))return!0;return!1}function Er(e){var t=be;try{return be=!0,e()}finally{be=t}}const Vn=new Set,Cr=new Set;function Wn(e){for(var t=0;t<e.length;t++)Vn.add(e[t]);for(var r of Cr)r(e)}let Kn=null;function Yt(e){var t=this,r=t.ownerDocument,n=e.type,s=e.composedPath?.()||[],i=s[0]||e.target;Kn=e;var a=0,o=Kn===e&&e.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var f=s.indexOf(t);if(f===-1)return;l<=f&&(a=l)}if(i=s[a]||e.target,i!==t){Lt(e,"currentTarget",{configurable:!0,get(){return i||r}});var u=$,d=E;X(null),$e(null);try{for(var h,g=[];i!==null;){var p=i.assignedSlot||i.parentNode||i.host||null;try{var y=i["__"+n];y!=null&&(!i.disabled||e.target===i)&&y.call(i,e)}catch(R){h?g.push(R):h=R}if(e.cancelBubble||p===t||p===null)break;i=p}if(h){for(let R of g)queueMicrotask(()=>{throw R});throw h}}finally{e.__root=t,delete e.currentTarget,X(u),$e(d)}}}function Yn(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Ke(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function P(e,t){var r=(t&vs)!==0,n=(t&gs)!==0,s,i=!e.startsWith("<!>");return()=>{if(k)return Ke(S,null),S;s===void 0&&(s=Yn(i?e:"<!>"+e),r||(s=Ve(s)));var a=n||yn?document.importNode(s,!0):s.cloneNode(!0);if(r){var o=Ve(a),l=a.lastChild;Ke(o,l)}else Ke(a,a);return a}}function ci(e,t,r="svg"){var n=!e.startsWith("<!>"),s=`<${r}>${n?e:"<!>"+e}</${r}>`,i;return()=>{if(k)return Ke(S,null),S;if(!i){var a=Yn(s),o=Ve(a);i=Ve(o)}var l=i.cloneNode(!0);return Ke(l,l),l}}function Zt(e,t){return ci(e,t,"svg")}function fi(){if(k)return Ke(S,null),S;var e=document.createDocumentFragment(),t=document.createComment(""),r=_e();return e.append(t,r),Ke(t,r),e}function I(e,t){if(k){var r=E;((r.f&Nt)===0||r.nodes.end===null)&&(r.nodes.end=S),Ut();return}e!==null&&e.before(t)}const ui=["touchstart","touchmove"];function di(e){return ui.includes(e)}function Ye(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function Zn(e,t){return Gn(e,t)}function hi(e,t){yr(),t.intro=t.intro??!1;const r=t.target,n=k,s=S;try{for(var i=Ve(r);i&&(i.nodeType!==dt||i.data!==Yr);)i=ye(i);if(!i)throw lt;Re(!0),ie(i);const a=Gn(e,{...t,anchor:i});return Re(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
2
  `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==lt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Ms(),yr(),kn(r),Re(!1),Zn(e,t)}finally{Re(n),ie(s)}}const gt=new Map;function Gn(e,{target:t,anchor:r,props:n={},events:s,context:i,intro:a=!0}){yr();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var g=d[h];if(!o.has(g)){o.add(g);var p=di(g);t.addEventListener(g,Yt,{passive:p});var y=gt.get(g);y===void 0?(document.addEventListener(g,Yt,{passive:p}),gt.set(g,1)):gt.set(g,y+1)}}};l(Mt(Vn)),Cr.add(l);var f=void 0,u=ni(()=>{var d=r??t.appendChild(_e());return Vs(d,{pending:()=>{}},h=>{if(i){pr({});var g=ae;g.c=i}if(s&&(n.$$events=s),k&&Ke(h,null),f=e(h,n)||{},k&&(E.nodes.end=S,S===null||S.nodeType!==dt||S.data!==or))throw Ft(),lt;i&&vr()}),()=>{for(var h of o){t.removeEventListener(h,Yt);var g=gt.get(h);--g===0?(document.removeEventListener(h,Yt),gt.delete(h)):gt.set(h,g)}Cr.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return Ar.set(f,u),f}let Ar=new WeakMap;function pi(e,t){const r=Ar.get(e);return r?(Ar.delete(e),r(t)):Promise.resolve()}class vi{anchor;#e=new Map;#t=new Map;#r=new Map;#i=new Set;#a=!0;constructor(t,r=!0){this.anchor=t,this.#a=r}#s=()=>{var t=L;if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)kr(n),this.#i.delete(r);else{var s=this.#r.get(r);s&&(this.#t.set(r,s.effect),this.#r.delete(r),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),n=s.effect)}for(const[i,a]of this.#e){if(this.#e.delete(i),i===t)break;const o=this.#r.get(a);o&&(Y(o.effect),this.#r.delete(a))}for(const[i,a]of this.#t){if(i===r||this.#i.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var f=document.createDocumentFragment();Dn(a,f),f.append(_e()),this.#r.set(i,{effect:a,fragment:f})}else Y(a);this.#i.delete(i),this.#t.delete(i)};this.#a||!n?(this.#i.add(i),nt(a,o,!1)):o()}}};#n=t=>{this.#e.delete(t);const r=Array.from(this.#e.values());for(const[n,s]of this.#r)r.includes(n)||(Y(s.effect),this.#r.delete(n))};ensure(t,r){var n=L,s=En();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(s){var i=document.createDocumentFragment(),a=_e();i.append(a),this.#r.set(t,{effect:de(()=>r(a)),fragment:i})}else this.#t.set(t,de(()=>r(this.anchor)));if(this.#e.set(n,t),s){for(const[o,l]of this.#t)o===t?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===t?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#s),n.ondiscard(this.#n)}else k&&(this.anchor=S),this.#s()}}function Jn(e){ae===null&&Es(),Vt(()=>{const t=Er(e);if(typeof t=="function")return t})}function j(e,t,r=!1){k&&Ut();var n=new vi(e),s=r?ft:0;function i(a,o){if(k){const f=rn(e)===Rt;if(a===f){var l=jt();ie(l),n.anchor=l,Re(!1),n.ensure(a,o),Re(!0);return}}n.ensure(a,o)}Sr(()=>{var a=!1;t((o,l=!0)=>{a=!0,i(l,o)}),a||i(!1,null)},s)}function gi(e,t,r){for(var n=[],s=t.length,i,a=t.length,o=0;o<s;o++){let d=t[o];nt(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=e.outrogroups;zr(Mt(i.done)),h.delete(i),h.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var f=r,u=f.parentNode;kn(u),u.append(f),e.items.clear()}zr(t,!l)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function zr(e,t=!0){for(var r=0;r<e.length;r++)Y(e[r],t)}var Xn;function mi(e,t,r,n,s,i=null){var a=e,o=new Map;k&&Ut();var l=null,f=Gs(()=>{var y=r();return Zr(y)?y:y==null?[]:Mt(y)}),u,d=!0;function h(){p.fallback=l,_i(p,u,a,t,n),l!==null&&(u.length===0?(l.f&Be)===0?kr(l):(l.f^=Be,St(l,null,a)):nt(l,()=>{l=null}))}var g=Sr(()=>{u=c(f);var y=u.length;let R=!1;if(k){var b=rn(a)===Rt;b!==(y===0)&&(a=jt(),ie(a),Re(!1),R=!0)}for(var x=new Set,ee=L,V=En(),W=0;W<y;W+=1){k&&S.nodeType===dt&&S.data===or&&(a=S,R=!0,Re(!1));var Ne=u[W],Se=n(Ne,W),M=d?null:o.get(Se);M?(M.v&&vt(M.v,Ne),M.i&&vt(M.i,W),V&&ee.skipped_effects.delete(M.e)):(M=bi(o,d?a:Xn??=_e(),Ne,Se,W,s,t,r),d||(M.e.f|=Be),o.set(Se,M)),x.add(Se)}if(y===0&&i&&!l&&(d?l=de(()=>i(a)):(l=de(()=>i(Xn??=_e())),l.f|=Be)),k&&y>0&&ie(jt()),!d)if(V){for(const[_t,we]of o)x.has(_t)||ee.skipped_effects.add(we.e);ee.oncommit(h),ee.ondiscard(()=>{})}else h();R&&Re(!0),c(f)}),p={effect:g,items:o,outrogroups:null,fallback:l};d=!1,k&&(a=S)}function _i(e,t,r,n,s){var i=t.length,a=e.items,o=e.effect.first,l,f=null,u=[],d=[],h,g,p,y;for(y=0;y<i;y+=1){if(h=t[y],g=s(h,y),p=a.get(g).e,e.outrogroups!==null)for(const M of e.outrogroups)M.pending.delete(p),M.done.delete(p);if((p.f&Be)!==0)if(p.f^=Be,p===o)St(p,null,r);else{var R=f?f.next:o;p===e.effect.last&&(e.effect.last=p.prev),p.prev&&(p.prev.next=p.next),p.next&&(p.next.prev=p.prev),Ze(e,f,p),Ze(e,p,R),St(p,R,r),f=p,u=[],d=[],o=f.next;continue}if((p.f&se)!==0&&kr(p),p!==o){if(l!==void 0&&l.has(p)){if(u.length<d.length){var b=d[0],x;f=b.prev;var ee=u[0],V=u[u.length-1];for(x=0;x<u.length;x+=1)St(u[x],b,r);for(x=0;x<d.length;x+=1)l.delete(d[x]);Ze(e,ee.prev,V.next),Ze(e,f,ee),Ze(e,V,b),o=b,f=V,y-=1,u=[],d=[]}else l.delete(p),St(p,o,r),Ze(e,p.prev,p.next),Ze(e,p,f===null?e.effect.first:f.next),Ze(e,f,p),f=p;continue}for(u=[],d=[];o!==null&&o!==p;)(l??=new Set).add(o),d.push(o),o=o.next;if(o===null)continue}(p.f&Be)===0&&u.push(p),f=p,o=p.next}if(e.outrogroups!==null){for(const M of e.outrogroups)M.pending.size===0&&(zr(Mt(M.done)),e.outrogroups?.delete(M));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||l!==void 0){var W=[];if(l!==void 0)for(p of l)(p.f&se)===0&&W.push(p);for(;o!==null;)(o.f&se)===0&&o!==e.fallback&&W.push(o),o=o.next;var Ne=W.length;if(Ne>0){var Se=null;gi(e,W,Se)}}}function bi(e,t,r,n,s,i,a,o){var l=(a&ds)!==0?(a&ps)===0?_n(r,!1,!1):rt(r):null,f=(a&hs)!==0?rt(s):null;return{v:l,i:f,e:de(()=>(i(t,l??r,f??s,o),()=>{e.delete(n)}))}}function St(e,t,r){if(e.nodes)for(var n=e.nodes.start,s=e.nodes.end,i=t&&(t.f&Be)===0?t.nodes.start:r;n!==null;){var a=ye(n);if(i.before(n),n===s)return;n=a}}function Ze(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Qn(e,t){zn(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const s=document.createElement("style");s.id=t.hash,s.textContent=t.code,n.appendChild(s)}})}const es=[...`
3
- \r\f \v\uFEFF`];function wi(e,t,r){var n=e==null?"":""+e;if(r){for(var s in r)if(r[s])n=n?n+" "+s:s;else if(n.length)for(var i=s.length,a=0;(a=n.indexOf(s,a))>=0;){var o=a+i;(a===0||es.includes(n[a-1]))&&(o===n.length||es.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function ts(e,t=!1){var r=t?" !important;":";",n="";for(var s in e){var i=e[s];i!=null&&i!==""&&(n+=" "+s+": "+i+r)}return n}function Tr(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function yi(e,t){if(t){var r="",n,s;if(Array.isArray(t)?(n=t[0],s=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(Tr)),s&&l.push(...Object.keys(s).map(Tr));var f=0,u=-1;const y=e.length;for(var d=0;d<y;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?a++:h===")"&&a--,!o&&i===!1&&a===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===y-1){if(u!==-1){var g=Tr(e.substring(f,u).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(f,d).trim();r+=" "+p+";"}}f=d+1,u=-1}}}}return n&&(r+=ts(n)),s&&(r+=ts(s,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function mt(e,t,r,n,s,i){var a=e.__className;if(k||a!==r||a===void 0){var o=wi(r,n,i);(!k||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(i&&s!==i)for(var l in i){var f=!!i[l];(s==null||f!==!!s[l])&&e.classList.toggle(l,f)}return i}function Rr(e,t={},r,n){for(var s in r){var i=r[s];t[s]!==i&&(r[s]==null?e.style.removeProperty(s):e.style.setProperty(s,i,n))}}function Mr(e,t,r,n){var s=e.__style;if(k||s!==t){var i=yi(t,n);(!k||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else n&&(Array.isArray(n)?(Rr(e,r?.[0],n[0]),Rr(e,r?.[1],n[1],"important")):Rr(e,r,n));return n}const xi=Symbol("is custom element"),$i=Symbol("is html");function Gt(e,t,r,n){var s=Si(e);k&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||s[t]!==(s[t]=r)&&(t==="loading"&&(e[ks]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ki(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Si(e){return e.__attributes??={[xi]:e.nodeName.includes("-"),[$i]:e.namespaceURI===ms}}var rs=new Map;function ki(e){var t=e.getAttribute("is")||e.nodeName,r=rs.get(t);if(r)return r;rs.set(t,r=[]);for(var n,s=e,i=Element.prototype;i!==s;){n=bs(s);for(var a in n)n[a].set&&r.push(a);s=Gr(s)}return r}function ns(e,t){return e===t||e?.[Pt]===t}function Ir(e={},t,r,n){return zn(()=>{var s,i;return $r(()=>{s=i,i=[],Er(()=>{e!==r(...i)&&(t(e,...i),s&&ns(r(...s),e)&&t(null,...s))})}),()=>{tt(()=>{i&&ns(r(...i),e)&&t(null,...i)})}}),e}function Z(e,t,r,n){var s=n,i=!0,a=()=>(i&&(i=!1,s=n),s),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(i=!0,h)};var f=!1,u=qt(()=>(f=!1,l())),d=E;return(function(h,g){if(arguments.length>0){const p=g?c(u):h;return m(u,p),f=!0,s!==void 0&&(s=p),h}return We&&f||(d.f&Te)!==0?u.v:c(u)})}function Ei(e){return new Ci(e)}class Ci{#e;#t;constructor(t){var r=new Map,n=(i,a)=>{var o=_n(a,!1,!1);return r.set(i,o),o};const s=new Proxy({...t.props||{},$$events:{}},{get(i,a){return c(r.get(a)??n(a,Reflect.get(i,a)))},has(i,a){return a===Ss?!0:(c(r.get(a)??n(a,Reflect.get(i,a))),Reflect.has(i,a))},set(i,a,o){return m(r.get(a)??n(a,o),o),Reflect.set(i,a,o)}});this.#t=(t.hydrate?hi:Zn)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&q(),this.#e=s.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Lt(this,i,{get(){return this.#t[i]},set(a){this.#t[i]=a},enumerable:!0});this.#t.$set=i=>{Object.assign(s,i)},this.#t.$destroy=()=>{pi(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...s)=>r.call(this,...s);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(s=>s!==n)}}$destroy(){this.#t.$destroy()}}let ss;typeof HTMLElement=="function"&&(ss=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),I(s,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=Ai(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=Jt(s,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ei({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ri(()=>{$r(()=>{this.$$r=!0;for(const n of It(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const s=Jt(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(const n in this.$$l)for(const s of this.$$l[n]){const i=this.$$c.$on(n,s);this.$$l_u.set(s,i)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Jt(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return It(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Jt(e,t,r,n){const s=r[e]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(s){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Ai(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function is(e,t,r,n,s,i){let a=class extends ss{constructor(){super(e,r,s),this.$$p_d=t}static get observedAttributes(){return It(t).map(o=>(t[o].attribute||o).toLowerCase())}};return It(t).forEach(o=>{Lt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Jt(o,l,t),this.$$d[o]=l;var f=this.$$c;if(f){var u=ct(f,o)?.get;u?f[o]=l:f.$set({[o]:l})}}})}),n.forEach(o=>{Lt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const zi=50,kt=5;class as{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,r){const n={level:t,message:r.map(s=>this.stringifyArg(s)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>zi&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!0});let r=null;try{r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const n=new AudioContext,s=n.createMediaStreamDestination(),i=t.getAudioTracks()[0];if(i&&n.createMediaStreamSource(new MediaStream([i])).connect(s),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(s)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=s.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const f=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let u="video/webm";for(const d of f)if(MediaRecorder.isTypeSupported(d)){u=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:u}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const n=this.mediaStream,s=n._originalDisplayStream;if(s)for(const o of s.getTracks())o.stop();const i=n._originalMicStream;if(i)for(const o of i.getTracks())o.stop();const a=n._audioContext;a&&a.close(),this.mediaStream=null}const r=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(r)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),r=document.createElement("video");r.srcObject=t,r.autoplay=!0,await new Promise(i=>{r.onloadedmetadata=i});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const s=n.getContext("2d");if(!s){for(const i of t.getTracks())i.stop();return null}s.drawImage(r,0,0);for(const i of t.getTracks())i.stop();return new Promise(i=>{n.toBlob(a=>i(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const n=await this.fileToDataUrl(t),s={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(s),s}async addBlobAttachment(t,r){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const s=await this.blobToDataUrl(t),i={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:s};return this.attachments.push(i),i}removeAttachment(t){const r=this.attachments.findIndex(n=>n.id===t);return r!==-1?(this.attachments.splice(r,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<kt}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Lr=null;function Dr(){return Lr||(Lr=new as),Lr}var Ti=P('<button class="recording-btn svelte-1105cax" aria-label="Stop recording"><span class="recording-dot svelte-1105cax"></span> <span class="recording-time svelte-1105cax"> </span> <span class="stop-label svelte-1105cax">Stop</span></button>'),Ri=P('<span class="unread-badge svelte-1105cax"> </span>'),Mi=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Ii=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Li=P('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),Di=P('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),Oi=P('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Ni={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
3
+ \r\f \v\uFEFF`];function wi(e,t,r){var n=e==null?"":""+e;if(r){for(var s in r)if(r[s])n=n?n+" "+s:s;else if(n.length)for(var i=s.length,a=0;(a=n.indexOf(s,a))>=0;){var o=a+i;(a===0||es.includes(n[a-1]))&&(o===n.length||es.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function ts(e,t=!1){var r=t?" !important;":";",n="";for(var s in e){var i=e[s];i!=null&&i!==""&&(n+=" "+s+": "+i+r)}return n}function Tr(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function yi(e,t){if(t){var r="",n,s;if(Array.isArray(t)?(n=t[0],s=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(Tr)),s&&l.push(...Object.keys(s).map(Tr));var f=0,u=-1;const y=e.length;for(var d=0;d<y;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?a++:h===")"&&a--,!o&&i===!1&&a===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===y-1){if(u!==-1){var g=Tr(e.substring(f,u).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(f,d).trim();r+=" "+p+";"}}f=d+1,u=-1}}}}return n&&(r+=ts(n)),s&&(r+=ts(s,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function mt(e,t,r,n,s,i){var a=e.__className;if(k||a!==r||a===void 0){var o=wi(r,n,i);(!k||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(i&&s!==i)for(var l in i){var f=!!i[l];(s==null||f!==!!s[l])&&e.classList.toggle(l,f)}return i}function Rr(e,t={},r,n){for(var s in r){var i=r[s];t[s]!==i&&(r[s]==null?e.style.removeProperty(s):e.style.setProperty(s,i,n))}}function Mr(e,t,r,n){var s=e.__style;if(k||s!==t){var i=yi(t,n);(!k||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else n&&(Array.isArray(n)?(Rr(e,r?.[0],n[0]),Rr(e,r?.[1],n[1],"important")):Rr(e,r,n));return n}const xi=Symbol("is custom element"),$i=Symbol("is html");function Gt(e,t,r,n){var s=Si(e);k&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||s[t]!==(s[t]=r)&&(t==="loading"&&(e[ks]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ki(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Si(e){return e.__attributes??={[xi]:e.nodeName.includes("-"),[$i]:e.namespaceURI===ms}}var rs=new Map;function ki(e){var t=e.getAttribute("is")||e.nodeName,r=rs.get(t);if(r)return r;rs.set(t,r=[]);for(var n,s=e,i=Element.prototype;i!==s;){n=bs(s);for(var a in n)n[a].set&&r.push(a);s=Gr(s)}return r}function ns(e,t){return e===t||e?.[Pt]===t}function Ir(e={},t,r,n){return zn(()=>{var s,i;return $r(()=>{s=i,i=[],Er(()=>{e!==r(...i)&&(t(e,...i),s&&ns(r(...s),e)&&t(null,...s))})}),()=>{tt(()=>{i&&ns(r(...i),e)&&t(null,...i)})}}),e}function Z(e,t,r,n){var s=n,i=!0,a=()=>(i&&(i=!1,s=n),s),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(i=!0,h)};var f=!1,u=qt(()=>(f=!1,l())),d=E;return(function(h,g){if(arguments.length>0){const p=g?c(u):h;return m(u,p),f=!0,s!==void 0&&(s=p),h}return We&&f||(d.f&Te)!==0?u.v:c(u)})}function Ei(e){return new Ci(e)}class Ci{#e;#t;constructor(t){var r=new Map,n=(i,a)=>{var o=_n(a,!1,!1);return r.set(i,o),o};const s=new Proxy({...t.props||{},$$events:{}},{get(i,a){return c(r.get(a)??n(a,Reflect.get(i,a)))},has(i,a){return a===Ss?!0:(c(r.get(a)??n(a,Reflect.get(i,a))),Reflect.has(i,a))},set(i,a,o){return m(r.get(a)??n(a,o),o),Reflect.set(i,a,o)}});this.#t=(t.hydrate?hi:Zn)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&q(),this.#e=s.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Lt(this,i,{get(){return this.#t[i]},set(a){this.#t[i]=a},enumerable:!0});this.#t.$set=i=>{Object.assign(s,i)},this.#t.$destroy=()=>{pi(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...s)=>r.call(this,...s);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(s=>s!==n)}}$destroy(){this.#t.$destroy()}}let ss;typeof HTMLElement=="function"&&(ss=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),I(s,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=Ai(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=Jt(s,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ei({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ri(()=>{$r(()=>{this.$$r=!0;for(const n of It(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const s=Jt(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(const n in this.$$l)for(const s of this.$$l[n]){const i=this.$$c.$on(n,s);this.$$l_u.set(s,i)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Jt(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return It(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Jt(e,t,r,n){const s=r[e]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(s){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Ai(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function is(e,t,r,n,s,i){let a=class extends ss{constructor(){super(e,r,s),this.$$p_d=t}static get observedAttributes(){return It(t).map(o=>(t[o].attribute||o).toLowerCase())}};return It(t).forEach(o=>{Lt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Jt(o,l,t),this.$$d[o]=l;var f=this.$$c;if(f){var u=ct(f,o)?.get;u?f[o]=l:f.$set({[o]:l})}}})}),n.forEach(o=>{Lt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const zi=50,kt=5;class as{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,r){const n={level:t,message:r.map(s=>this.stringifyArg(s)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>zi&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"window"},audio:!0});let r=null;try{r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const n=new AudioContext,s=n.createMediaStreamDestination(),i=t.getAudioTracks()[0];if(i&&n.createMediaStreamSource(new MediaStream([i])).connect(s),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(s)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=s.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const f=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let u="video/webm";for(const d of f)if(MediaRecorder.isTypeSupported(d)){u=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:u}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const n=this.mediaStream,s=n._originalDisplayStream;if(s)for(const o of s.getTracks())o.stop();const i=n._originalMicStream;if(i)for(const o of i.getTracks())o.stop();const a=n._audioContext;a&&a.close(),this.mediaStream=null}const r=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(r)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),r=document.createElement("video");r.srcObject=t,r.autoplay=!0,await new Promise(i=>{r.onloadedmetadata=i});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const s=n.getContext("2d");if(!s){for(const i of t.getTracks())i.stop();return null}s.drawImage(r,0,0);for(const i of t.getTracks())i.stop();return new Promise(i=>{n.toBlob(a=>i(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const n=await this.fileToDataUrl(t),s={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(s),s}async addBlobAttachment(t,r){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const s=await this.blobToDataUrl(t),i={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:s};return this.attachments.push(i),i}removeAttachment(t){const r=this.attachments.findIndex(n=>n.id===t);return r!==-1?(this.attachments.splice(r,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<kt}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Lr=null;function Dr(){return Lr||(Lr=new as),Lr}var Ti=P('<button class="recording-btn svelte-1105cax" aria-label="Stop recording"><span class="recording-dot svelte-1105cax"></span> <span class="recording-time svelte-1105cax"> </span> <span class="stop-label svelte-1105cax">Stop</span></button>'),Ri=P('<span class="unread-badge svelte-1105cax"> </span>'),Mi=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Ii=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Li=P('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),Di=P('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),Oi=P('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Ni={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
4
4
  0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
5
5
  "Helvetica Neue", Arial, sans-serif;}.toggle-btn.svelte-1105cax {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s,
6
- opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.chat-window.chat-window-fullscreen.svelte-1105cax {width:98vw;height:98vh;max-width:98vw;max-height:98vh;right:1vw;border-radius:0.5rem;transition:width 0.3s ease,
7
- height 0.3s ease,
8
- max-width 0.3s ease,
9
- max-height 0.3s ease;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
6
+ opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.chat-window.chat-window-fullscreen.svelte-1105cax {position:fixed;inset:1vh 1vw;width:auto;height:auto;max-width:none;max-height:none;border-radius:0.5rem;transition:all 0.3s ease;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
10
7
  animation: svelte-1105cax-spin 0.8s linear infinite;}
11
8
 
12
9
  @keyframes svelte-1105cax-spin {
@@ -45,7 +42,7 @@ var FortaleceAI=(function(ne){"use strict";typeof window<"u"&&((window.__svelte?
45
42
  var(--shadow),
46
43
  0 0 30px rgba(239, 68, 68, 0.6);
47
44
  }
48
- }`};function os(e,t){pr(t,!0),Qn(e,Ni);let r=Z(t,"embedId"),n=Z(t,"embedUrl",7,"https://app.fortalece.ai"),s=Z(t,"position",7,"bottom-right"),i=Z(t,"showHeader",7,"true"),a=Z(t,"allowAttachments",7,!0),o=Z(t,"allowScreenRecording",7,!0),l=Z(t,"captureConsoleLogs",7,!0),f=A(!1),u=A(!1),d=A(!1),h=A(0),g=A(!1),p=A(null),y=A("00:00"),R=A(void 0),b=A(null),x=A(De([])),ee=A(De([]));Vt(()=>{if(c(g)&&c(p)!==null){const w=setInterval(()=>{const D=Math.floor((Date.now()-c(p))/1e3),fe=Math.floor(D/60).toString().padStart(2,"0"),ke=(D%60).toString().padStart(2,"0");m(y,`${fe}:${ke}`)},1e3);return()=>clearInterval(w)}});const V=me(()=>i()==="false"||i()===!1),W=me(()=>!c(f)||c(V)||!c(u)),Ne=me(()=>`${n()}/embed/${r()}${c(V)?"?showHeader=false":""}`),Se=me(()=>s()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");Jn(()=>{m(b,Dr(),!0),l()&&c(b).startConsoleCapture();function w(D){try{const Je=new URL(n()).origin;if(D.origin!==Je)return}catch{return}const{type:fe,payload:ke}=D.data||{};switch(fe){case"fortalece:ready":m(u,!0);break;case"fortalece:close-request":m(f,!1);break;case"fortalece:request-context":Et();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Ct();break;case"fortalece:resize":m(d,ke?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ke?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(y,"00:00"),m(f,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(y,"00:00"),m(f,!0);break}}return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),l()&&c(b)&&c(b).stopConsoleCapture()}});function M(){m(f,!c(f)),c(f)&&m(h,0)}function _t(){we("fortalece:stop-recording"),m(g,!1),m(p,null),m(y,"00:00")}function we(w,D={}){if(c(R)?.contentWindow)try{const fe=new URL(n()).origin;c(R).contentWindow.postMessage({type:w,payload:D},fe)}catch{}}function Et(){if(!c(b))return;const w=c(b).getPageContext();if(we("fortalece:page-context",w),l()){const D=c(b).getConsoleErrors();m(ee,D,!0),we("fortalece:console-logs",{logs:D})}we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(x).length,maxAttachments:5})}function ce(){c(x).forEach(w=>{we("fortalece:attachment-added",w)})}function Ct(){c(b)&&(c(b).clearAttachments(),c(b).clearConsoleErrors(),m(x,[],!0),m(ee,[],!0),we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Vt(()=>{c(f)&&c(u)&&(we("fortalece:opened"),Et(),ce())});var Qt={get embedId(){return r()},set embedId(w){r(w),q()},get embedUrl(){return n()},set embedUrl(w="https://app.fortalece.ai"){n(w),q()},get position(){return s()},set position(w="bottom-right"){s(w),q()},get showHeader(){return i()},set showHeader(w="true"){i(w),q()},get allowAttachments(){return a()},set allowAttachments(w=!0){a(w),q()},get allowScreenRecording(){return o()},set allowScreenRecording(w=!0){o(w),q()},get captureConsoleLogs(){return l()},set captureConsoleLogs(w=!0){l(w),q()}},Ge=Oi(),er=T(Ge);{var Nr=w=>{var D=Ti();D.__click=_t;var fe=O(T(D),2),ke=T(fe,!0);z(fe),hr(2),z(D),J(()=>Ye(ke,c(y))),I(w,D)},Pr=w=>{var D=fi(),fe=Sn(D);{var ke=Je=>{var at=Li();at.__click=M;var zt=T(at);{var Ur=pe=>{var Pe=Ri(),v=T(Pe,!0);z(Pe),J(()=>Ye(v,c(h)>9?"9+":c(h))),I(pe,Pe)};j(zt,pe=>{c(h)>0&&!c(f)&&pe(Ur)})}var ir=O(zt,2);{var jr=pe=>{var Pe=Mi();I(pe,Pe)},Tt=pe=>{var Pe=Ii();I(pe,Pe)};j(ir,pe=>{c(f)?pe(jr):pe(Tt,!1)})}z(at),J(()=>Gt(at,"aria-label",c(f)?"Close chat":"Open chat")),I(Je,at)};j(fe,Je=>{c(W)&&Je(ke)},!0)}I(w,D)};j(er,w=>{c(g)?w(Nr):w(Pr,!1)})}var bt=O(er,2);let tr,rr;var nr=T(bt);{var Fr=w=>{var D=Di();I(w,D)};j(nr,w=>{c(u)||w(Fr)})}var At=O(nr,2);let sr;return Ir(At,w=>m(R,w),()=>c(R)),z(bt),z(Ge),J(()=>{Mr(Ge,c(Se)),tr=mt(bt,1,"chat-window svelte-1105cax",null,tr,{"chat-window-hidden":!c(f),"chat-window-fullscreen":c(d)}),rr=Mr(bt,"",rr,{bottom:c(W)&&!c(d)?"4.5rem":c(d)?"1vh":"0"}),Gt(At,"src",c(Ne)),sr=mt(At,1,"svelte-1105cax",null,sr,{hidden:!c(u)})}),I(e,Ge),vr(Qt)}Wn(["click"]),customElements.define("support-chat",is(os,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},showHeader:{attribute:"show-header",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],!0));var Pi=P('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),Fi=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),Ui=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),ji=P('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),Bi=P('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),Hi=P('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),qi=P('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),Vi=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Wi=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Ki=P('<button class="toggle-btn svelte-p7nz7"><!></button>'),Yi=P('<span class="badge svelte-p7nz7"> </span>'),Zi=P('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),Gi=P('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),Ji=P('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div>'),Xi=P('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const Qi={hash:"svelte-p7nz7",code:`
45
+ }`};function os(e,t){pr(t,!0),Qn(e,Ni);let r=Z(t,"embedId"),n=Z(t,"embedUrl",7,"https://app.fortalece.ai"),s=Z(t,"position",7,"bottom-right"),i=Z(t,"showHeader",7,"true"),a=Z(t,"allowAttachments",7,!0),o=Z(t,"allowScreenRecording",7,!0),l=Z(t,"captureConsoleLogs",7,!0),f=A(!1),u=A(!1),d=A(!1),h=A(0),g=A(!1),p=A(null),y=A("00:00"),R=A(void 0),b=A(null),x=A(De([])),ee=A(De([]));Vt(()=>{if(c(g)&&c(p)!==null){const w=setInterval(()=>{const D=Math.floor((Date.now()-c(p))/1e3),fe=Math.floor(D/60).toString().padStart(2,"0"),ke=(D%60).toString().padStart(2,"0");m(y,`${fe}:${ke}`)},1e3);return()=>clearInterval(w)}});const V=me(()=>i()==="false"||i()===!1),W=me(()=>!c(f)||c(V)||!c(u)),Ne=me(()=>`${n()}/embed/${r()}${c(V)?"?showHeader=false":""}`),Se=me(()=>s()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");Jn(()=>{m(b,Dr(),!0),l()&&c(b).startConsoleCapture();function w(D){try{const Je=new URL(n()).origin;if(D.origin!==Je)return}catch{return}const{type:fe,payload:ke}=D.data||{};switch(fe){case"fortalece:ready":m(u,!0);break;case"fortalece:close-request":m(f,!1);break;case"fortalece:request-context":Et();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Ct();break;case"fortalece:resize":m(d,ke?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ke?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(y,"00:00"),m(f,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(y,"00:00"),m(f,!0);break}}return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),l()&&c(b)&&c(b).stopConsoleCapture()}});function M(){m(f,!c(f)),c(f)&&m(h,0)}function _t(){we("fortalece:stop-recording"),m(g,!1),m(p,null),m(y,"00:00")}function we(w,D={}){if(c(R)?.contentWindow)try{const fe=new URL(n()).origin;c(R).contentWindow.postMessage({type:w,payload:D},fe)}catch{}}function Et(){if(!c(b))return;const w=c(b).getPageContext();if(we("fortalece:page-context",w),l()){const D=c(b).getConsoleErrors();m(ee,D,!0),we("fortalece:console-logs",{logs:D})}we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(x).length,maxAttachments:5})}function ce(){c(x).forEach(w=>{we("fortalece:attachment-added",w)})}function Ct(){c(b)&&(c(b).clearAttachments(),c(b).clearConsoleErrors(),m(x,[],!0),m(ee,[],!0),we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Vt(()=>{c(f)&&c(u)&&(we("fortalece:opened"),Et(),ce())});var Qt={get embedId(){return r()},set embedId(w){r(w),q()},get embedUrl(){return n()},set embedUrl(w="https://app.fortalece.ai"){n(w),q()},get position(){return s()},set position(w="bottom-right"){s(w),q()},get showHeader(){return i()},set showHeader(w="true"){i(w),q()},get allowAttachments(){return a()},set allowAttachments(w=!0){a(w),q()},get allowScreenRecording(){return o()},set allowScreenRecording(w=!0){o(w),q()},get captureConsoleLogs(){return l()},set captureConsoleLogs(w=!0){l(w),q()}},Ge=Oi(),er=T(Ge);{var Nr=w=>{var D=Ti();D.__click=_t;var fe=O(T(D),2),ke=T(fe,!0);z(fe),hr(2),z(D),J(()=>Ye(ke,c(y))),I(w,D)},Pr=w=>{var D=fi(),fe=Sn(D);{var ke=Je=>{var at=Li();at.__click=M;var zt=T(at);{var Ur=pe=>{var Pe=Ri(),v=T(Pe,!0);z(Pe),J(()=>Ye(v,c(h)>9?"9+":c(h))),I(pe,Pe)};j(zt,pe=>{c(h)>0&&!c(f)&&pe(Ur)})}var ir=O(zt,2);{var jr=pe=>{var Pe=Mi();I(pe,Pe)},Tt=pe=>{var Pe=Ii();I(pe,Pe)};j(ir,pe=>{c(f)?pe(jr):pe(Tt,!1)})}z(at),J(()=>Gt(at,"aria-label",c(f)?"Close chat":"Open chat")),I(Je,at)};j(fe,Je=>{c(W)&&Je(ke)},!0)}I(w,D)};j(er,w=>{c(g)?w(Nr):w(Pr,!1)})}var bt=O(er,2);let tr,rr;var nr=T(bt);{var Fr=w=>{var D=Di();I(w,D)};j(nr,w=>{c(u)||w(Fr)})}var At=O(nr,2);let sr;return Ir(At,w=>m(R,w),()=>c(R)),z(bt),z(Ge),J(()=>{Mr(Ge,c(Se)),tr=mt(bt,1,"chat-window svelte-1105cax",null,tr,{"chat-window-hidden":!c(f),"chat-window-fullscreen":c(d)}),rr=Mr(bt,"",rr,{bottom:c(d)?void 0:c(W)?"4.5rem":"0"}),Gt(At,"src",c(Ne)),sr=mt(At,1,"svelte-1105cax",null,sr,{hidden:!c(u)})}),I(e,Ge),vr(Qt)}Wn(["click"]),customElements.define("support-chat",is(os,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},showHeader:{attribute:"show-header",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],!0));var Pi=P('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),Fi=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),Ui=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),ji=P('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),Bi=P('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),Hi=P('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),qi=P('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),Vi=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Wi=Zt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Ki=P('<button class="toggle-btn svelte-p7nz7"><!></button>'),Yi=P('<span class="badge svelte-p7nz7"> </span>'),Zi=P('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),Gi=P('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),Ji=P('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div>'),Xi=P('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const Qi={hash:"svelte-p7nz7",code:`
49
46
  /* Host element styling for inline mode */:host {display:block;}:host([display="inline"]) {display:block;width:100%;height:100%;}.svelte-p7nz7 {box-sizing:border-box;margin:0;padding:0;}.feedback-panel.svelte-p7nz7 {--primary-color: #6366f1;--danger-color: #ef4444;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
50
47
  0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
51
48
  "Helvetica Neue", Arial, sans-serif;}
@@ -2816,7 +2816,7 @@ class Ni {
2816
2816
  try {
2817
2817
  const t = await navigator.mediaDevices.getDisplayMedia({
2818
2818
  video: {
2819
- displaySurface: "browser"
2819
+ displaySurface: "window"
2820
2820
  },
2821
2821
  audio: !0
2822
2822
  });
@@ -3039,10 +3039,7 @@ const Wi = {
3039
3039
  code: `.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
3040
3040
  0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
3041
3041
  "Helvetica Neue", Arial, sans-serif;}.toggle-btn.svelte-1105cax {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s,
3042
- opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.chat-window.chat-window-fullscreen.svelte-1105cax {width:98vw;height:98vh;max-width:98vw;max-height:98vh;right:1vw;border-radius:0.5rem;transition:width 0.3s ease,
3043
- height 0.3s ease,
3044
- max-width 0.3s ease,
3045
- max-height 0.3s ease;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
3042
+ opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.chat-window.chat-window-fullscreen.svelte-1105cax {position:fixed;inset:1vh 1vw;width:auto;height:auto;max-width:none;max-height:none;border-radius:0.5rem;transition:all 0.3s ease;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
3046
3043
  animation: svelte-1105cax-spin 0.8s linear infinite;}
3047
3044
 
3048
3045
  @keyframes svelte-1105cax-spin {
@@ -3309,7 +3306,7 @@ function Ki(e, t) {
3309
3306
  "chat-window-hidden": !c(f),
3310
3307
  "chat-window-fullscreen": c(d)
3311
3308
  }), It = zr(lt, "", It, {
3312
- bottom: c(q) && !c(d) ? "4.5rem" : c(d) ? "1vh" : "0"
3309
+ bottom: c(d) ? void 0 : c(q) ? "4.5rem" : "0"
3313
3310
  }), Zt(yt, "src", c(Ee)), Lt = ut(yt, 1, "svelte-1105cax", null, Lt, { hidden: !c(u) });
3314
3311
  }), I(e, Ue), Or(Tt);
3315
3312
  }
@@ -1,12 +1,9 @@
1
1
  (function(H,Rt){typeof exports=="object"&&typeof module<"u"?Rt(exports):typeof define=="function"&&define.amd?define(["exports"],Rt):(H=typeof globalThis<"u"?globalThis:H||self,Rt(H.FortaleceAI={}))})(this,(function(H){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const hs=1,ps=2,vs=16,gs=1,ms=2,Zr="[",Mt="[!",lr="]",lt={},F=Symbol(),_s="http://www.w3.org/1999/xhtml",cr=!1;var Gr=Array.isArray,bs=Array.prototype.indexOf,It=Array.from,Lt=Object.keys,Dt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,ws=Object.getOwnPropertyDescriptors,ys=Object.prototype,xs=Array.prototype,Jr=Object.getPrototypeOf,Xr=Object.isExtensible;function $s(e){for(var t=0;t<e.length;t++)e[t]()}function Qr(){var e,t,r=new Promise((n,s)=>{e=n,t=s});return{promise:r,resolve:e,reject:t}}const U=2,Ot=4,Nt=8,en=1<<24,Ce=16,Ae=32,je=64,fr=128,ue=512,q=1024,Y=2048,ze=4096,se=8192,Te=16384,Pt=32768,ft=65536,tn=1<<17,rn=1<<18,Xe=1<<19,Ss=1<<20,Be=1<<25,Qe=32768,ur=1<<21,dr=1<<22,He=1<<23,Ft=Symbol("$state"),ks=Symbol("legacy props"),Es=Symbol(""),ut=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},hr=3,dt=8;function Cs(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function As(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function zs(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ts(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Rs(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ms(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Is(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ls(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ds(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Os(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ns(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Ut(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ps(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let k=!1;function Re(e){k=e}let S;function ie(e){if(e===null)throw Ut(),lt;return S=e}function jt(){return ie(ye(S))}function z(e){if(k){if(ye(S)!==null)throw Ut(),lt;S=e}}function pr(e=1){if(k){for(var t=e,r=S;t--;)r=ye(r);S=r}}function Bt(e=!0){for(var t=0,r=S;;){if(r.nodeType===dt){var n=r.data;if(n===lr){if(t===0)return r;t-=1}else(n===Zr||n===Mt)&&(t+=1)}var s=ye(r);e&&r.remove(),r=s}}function nn(e){if(!e||e.nodeType!==dt)throw Ut(),lt;return e.data}function sn(e){return e===this.v}function Fs(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function an(e){return!Fs(e,this.v)}let Us=!1,ae=null;function ht(e){ae=e}function vr(e,t=!1,r){ae={p:ae,i:!1,c:null,e:null,s:e,x:null,l:null}}function gr(e){var t=ae,r=t.e;if(r!==null){t.e=null;for(var n of r)zn(n)}return e!==void 0&&(t.x=e),t.i=!0,ae=t.p,e??{}}function on(){return!0}let et=[];function ln(){var e=et;et=[],$s(e)}function tt(e){if(et.length===0&&!wt){var t=et;queueMicrotask(()=>{t===et&&ln()})}et.push(e)}function js(){for(;et.length>0;)ln()}function cn(e){var t=E;if(t===null)return $.f|=He,e;if((t.f&Pt)===0){if((t.f&fr)===0)throw e;t.b.error(e)}else pt(e,t)}function pt(e,t){for(;t!==null;){if((t.f&fr)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const Bs=-7169;function N(e,t){e.f=e.f&Bs|t}function mr(e){(e.f&ue)!==0||e.deps===null?N(e,q):N(e,ze)}function fn(e){if(e!==null)for(const t of e)(t.f&U)===0||(t.f&Qe)===0||(t.f^=Qe,fn(t.deps))}function un(e,t,r){(e.f&Y)!==0?t.add(e):(e.f&ze)!==0&&r.add(e),fn(e.deps),N(e,q)}const Ht=new Set;let L=null,ge=null,oe=[],qt=null,_r=!1,wt=!1;class Me{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#i=0;#a=null;#s=new Set;#n=new Set;skipped_effects=new Set;is_fork=!1;#o=!1;is_deferred(){return this.is_fork||this.#i>0}process(t){oe=[],this.apply();var r=[],n=[];for(const s of t)this.#l(s,r,n);if(this.is_deferred())this.#c(n),this.#c(r);else{for(const s of this.#e)s();this.#e.clear(),this.#r===0&&this.#f(),L=null,hn(n),hn(r),this.#a?.resolve()}ge=null}#l(t,r,n){t.f^=q;for(var s=t.first,i=null;s!==null;){var a=s.f,o=(a&(Ae|je))!==0,l=o&&(a&q)!==0,f=l||(a&se)!==0||this.skipped_effects.has(s);if(!f&&s.fn!==null){o?s.f^=q:i!==null&&(a&(Ot|Nt|en))!==0?i.b.defer_effect(s):(a&Ot)!==0?r.push(s):xt(s)&&((a&Ce)!==0&&this.#s.add(s),$t(s));var u=s.first;if(u!==null){s=u;continue}}var d=s.parent;for(s=s.next;s===null&&d!==null;)d===i&&(i=null),s=d.next,d=d.parent}}#c(t){for(var r=0;r<t.length;r+=1)un(t[r],this.#s,this.#n)}capture(t,r){r!==F&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&He)===0&&(this.current.set(t,t.v),ge?.set(t,t.v))}activate(){L=this,this.apply()}deactivate(){L===this&&(L=null,ge=null)}flush(){if(this.activate(),oe.length>0){if(dn(),L!==null&&L!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#t)t(this);this.#t.clear()}#f(){if(Ht.size>1){this.previous.clear();var t=ge,r=!0;for(const s of Ht){if(s===this){r=!1;continue}const i=[];for(const[o,l]of this.current){if(s.current.has(o))if(r&&l!==s.current.get(o))s.current.set(o,l);else continue;i.push(o)}if(i.length===0)continue;const a=[...s.current.keys()].filter(o=>!this.current.has(o));if(a.length>0){var n=oe;oe=[];const o=new Set,l=new Map;for(const f of i)pn(f,a,o,l);if(oe.length>0){L=s,s.apply();for(const f of oe)s.#l(f,[],[]);s.deactivate()}oe=n}}L=null,ge=t}this.committed=!0,Ht.delete(this)}increment(t){this.#r+=1,t&&(this.#i+=1)}decrement(t){this.#r-=1,t&&(this.#i-=1),!this.#o&&(this.#o=!0,tt(()=>{this.#o=!1,this.is_deferred()?oe.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#s)this.#n.delete(t),N(t,Y),Le(t);for(const t of this.#n)N(t,ze),Le(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#t.add(t)}settled(){return(this.#a??=Qr()).promise}static ensure(){if(L===null){const t=L=new Me;Ht.add(L),wt||tt(()=>{L===t&&t.flush()})}return L}apply(){}}function V(e){var t=wt;wt=!0;try{for(var r;;){if(js(),oe.length===0&&(L?.flush(),oe.length===0))return qt=null,r;dn()}}finally{wt=t}}function dn(){_r=!0;var e=null;try{for(var t=0;oe.length>0;){var r=Me.ensure();if(t++>1e3){var n,s;Hs()}r.process(oe),qe.clear()}}finally{_r=!1,qt=null}}function Hs(){try{Ms()}catch(e){pt(e,qt)}}let Ie=null;function hn(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(Te|se))===0&&xt(n)&&(Ie=new Set,$t(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?In(n):n.fn=null),Ie?.size>0)){qe.clear();for(const s of Ie){if((s.f&(Te|se))!==0)continue;const i=[s];let a=s.parent;for(;a!==null;)Ie.has(a)&&(Ie.delete(a),i.push(a)),a=a.parent;for(let o=i.length-1;o>=0;o--){const l=i[o];(l.f&(Te|se))===0&&$t(l)}}Ie.clear()}}Ie=null}}function pn(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const s of e.reactions){const i=s.f;(i&U)!==0?pn(s,t,r,n):(i&(dr|Ce))!==0&&(i&Y)===0&&vn(s,t,n)&&(N(s,Y),Le(s))}}function vn(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const s of e.deps){if(t.includes(s))return!0;if((s.f&U)!==0&&vn(s,t,r))return r.set(s,!0),!0}return r.set(e,!1),!1}function Le(e){for(var t=qt=e;t.parent!==null;){t=t.parent;var r=t.f;if(_r&&t===E&&(r&Ce)!==0&&(r&rn)===0)return;if((r&(je|Ae))!==0){if((r&q)===0)return;t.f^=q}}oe.push(t)}function qs(e){let t=0,r=rt(0),n;return()=>{$r()&&(c(r),Sr(()=>(t===0&&(n=Cr(()=>e(()=>yt(r)))),t+=1,()=>{tt(()=>{t-=1,t===0&&(n?.(),n=void 0,yt(r))})})))}}var Vs=ft|Xe|fr;function Ws(e,t,r){new Ks(e,t,r)}class Ks{parent;is_pending=!1;#e;#t=k?S:null;#r;#i;#a;#s=null;#n=null;#o=null;#l=null;#c=null;#f=0;#u=0;#p=!1;#h=!1;#v=new Set;#g=new Set;#d=null;#y=qs(()=>(this.#d=rt(this.#f),()=>{this.#d=null}));constructor(t,r,n){this.#e=t,this.#r=r,this.#i=n,this.parent=E.b,this.is_pending=!!this.#r.pending,this.#a=kr(()=>{if(E.b=this,k){const i=this.#t;jt(),i.nodeType===dt&&i.data===Mt?this.#$():(this.#x(),this.#u===0&&(this.is_pending=!1))}else{var s=this.#b();try{this.#s=de(()=>n(s))}catch(i){this.error(i)}this.#u>0?this.#_():this.is_pending=!1}return()=>{this.#c?.remove()}},Vs),k&&(this.#e=S)}#x(){try{this.#s=de(()=>this.#i(this.#e))}catch(t){this.error(t)}}#$(){const t=this.#r.pending;t&&(this.#n=de(()=>t(this.#e)),tt(()=>{var r=this.#b();this.#s=this.#m(()=>(Me.ensure(),de(()=>this.#i(r)))),this.#u>0?this.#_():(nt(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#b(){var t=this.#e;return this.is_pending&&(this.#c=_e(),this.#e.before(this.#c),t=this.#c),t}defer_effect(t){un(t,this.#v,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#m(t){var r=E,n=$,s=ae;$e(this.#a),Q(this.#a),ht(this.#a.ctx);try{return t()}catch(i){return cn(i),null}finally{$e(r),Q(n),ht(s)}}#_(){const t=this.#r.pending;this.#s!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),On(this.#s,this.#l)),this.#n===null&&(this.#n=de(()=>t(this.#e)))}#w(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(t);return}if(this.#u+=t,this.#u===0){this.is_pending=!1;for(const r of this.#v)N(r,Y),Le(r);for(const r of this.#g)N(r,ze),Le(r);this.#v.clear(),this.#g.clear(),this.#n&&nt(this.#n,()=>{this.#n=null}),this.#l&&(this.#e.before(this.#l),this.#l=null)}}update_pending_count(t){this.#w(t),this.#f+=t,!(!this.#d||this.#p)&&(this.#p=!0,tt(()=>{this.#p=!1,this.#d&&vt(this.#d,this.#f)}))}get_effect_pending(){return this.#y(),c(this.#d)}error(t){var r=this.#r.onerror;let n=this.#r.failed;if(this.#h||!r&&!n)throw t;this.#s&&(Z(this.#s),this.#s=null),this.#n&&(Z(this.#n),this.#n=null),this.#o&&(Z(this.#o),this.#o=null),k&&(ie(this.#t),pr(),ie(Bt()));var s=!1,i=!1;const a=()=>{if(s){Ps();return}s=!0,i&&Ns(),Me.ensure(),this.#f=0,this.#o!==null&&nt(this.#o,()=>{this.#o=null}),this.is_pending=this.has_pending_snippet(),this.#s=this.#m(()=>(this.#h=!1,de(()=>this.#i(this.#e)))),this.#u>0?this.#_():this.is_pending=!1};var o=$;try{Q(null),i=!0,r?.(t,a),i=!1}catch(l){pt(l,this.#a&&this.#a.parent)}finally{Q(o)}n&&tt(()=>{this.#o=this.#m(()=>{Me.ensure(),this.#h=!0;try{return de(()=>{n(this.#e,()=>t,()=>a)})}catch(l){return pt(l,this.#a.parent),null}finally{this.#h=!1}})})}}function Ys(e,t,r,n){const s=Vt;var i=e.filter(h=>!h.settled);if(r.length===0&&i.length===0){n(t.map(s));return}var a=L,o=E,l=Zs(),f=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(h=>h.promise)):null;function u(h){l();try{n(h)}catch(g){(o.f&Te)===0&&pt(g,o)}a?.deactivate(),br()}if(r.length===0){f.then(()=>u(t.map(s)));return}function d(){l(),Promise.all(r.map(h=>Gs(h))).then(h=>u([...t.map(s),...h])).catch(h=>pt(h,o))}f?f.then(d):d()}function Zs(){var e=E,t=$,r=ae,n=L;return function(i=!0){$e(e),Q(t),ht(r),i&&n?.activate()}}function br(){$e(null),Q(null),ht(null)}function Vt(e){var t=U|Y,r=$!==null&&($.f&U)!==0?$:null;return E!==null&&(E.f|=Xe),{ctx:ae,deps:null,effects:null,equals:sn,f:t,fn:e,reactions:null,rv:0,v:F,wv:0,parent:r??E,ac:null}}function Gs(e,t,r){let n=E;n===null&&As();var s=n.b,i=void 0,a=rt(F),o=!$,l=new Map;return ii(()=>{var f=Qr();i=f.promise;try{Promise.resolve(e()).then(f.resolve,f.reject).then(()=>{u===L&&u.committed&&u.deactivate(),br()})}catch(g){f.reject(g),br()}var u=L;if(o){var d=s.is_rendered();s.update_pending_count(1),u.increment(d),l.get(u)?.reject(ut),l.delete(u),l.set(u,f)}const h=(g,p=void 0)=>{if(u.activate(),p)p!==ut&&(a.f|=He,vt(a,p));else{(a.f&He)!==0&&(a.f^=He),vt(a,g);for(const[y,R]of l){if(l.delete(y),y===u)break;R.reject(ut)}}o&&(s.update_pending_count(-1),u.decrement(d))};f.promise.then(h,g=>h(null,g||"unknown"))}),ri(()=>{for(const f of l.values())f.reject(ut)}),new Promise(f=>{function u(d){function h(){d===i?f(a):u(i)}d.then(h,h)}u(i)})}function me(e){const t=Vt(e);return Pn(t),t}function Js(e){const t=Vt(e);return t.equals=an,t}function gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Z(t[r])}}function Xs(e){for(var t=e.parent;t!==null;){if((t.f&U)===0)return(t.f&Te)===0?t:null;t=t.parent}return null}function wr(e){var t,r=E;$e(Xs(e));try{e.f&=~Qe,gn(e),t=Hn(e)}finally{$e(r)}return t}function mn(e){var t=wr(e);if(!e.equals(t)&&(e.wv=jn(),(!L?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){N(e,q);return}We||(ge!==null?($r()||L?.is_fork)&&ge.set(e,t):mr(e))}let yr=new Set;const qe=new Map;let _n=!1;function rt(e,t){var r={f:0,v:e,reactions:null,equals:sn,rv:0,wv:0};return r}function A(e,t){const r=rt(e);return Pn(r),r}function bn(e,t=!1,r=!0){const n=rt(e);return t||(n.equals=an),n}function m(e,t,r=!1){$!==null&&(!be||($.f&tn)!==0)&&on()&&($.f&(U|Ce|dr|tn))!==0&&!Oe?.includes(e)&&Os();let n=r?De(t):t;return vt(e,n)}function vt(e,t){if(!e.equals(t)){var r=e.v;We?qe.set(e,t):qe.set(e,r),e.v=t;var n=Me.ensure();if(n.capture(e,r),(e.f&U)!==0){const s=e;(e.f&Y)!==0&&wr(s),mr(s)}e.wv=jn(),wn(e,Y),E!==null&&(E.f&q)!==0&&(E.f&(Ae|je))===0&&(he===null?li([e]):he.push(e)),!n.is_fork&&yr.size>0&&!_n&&Qs()}return t}function Qs(){_n=!1;for(const e of yr)(e.f&q)!==0&&N(e,ze),xt(e)&&$t(e);yr.clear()}function yt(e){m(e,e.v+1)}function wn(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,s=0;s<n;s++){var i=r[s],a=i.f,o=(a&Y)===0;if(o&&N(i,t),(a&U)!==0){var l=i;ge?.delete(l),(a&Qe)===0&&(a&ue&&(i.f|=Qe),wn(l,ze))}else o&&((a&Ce)!==0&&Ie!==null&&Ie.add(i),Le(i))}}function De(e){if(typeof e!="object"||e===null||Ft in e)return e;const t=Jr(e);if(t!==ys&&t!==xs)return e;var r=new Map,n=Gr(e),s=A(0),i=it,a=o=>{if(it===i)return o();var l=$,f=it;Q(null),Un(i);var u=o();return Q(l),Un(f),u};return n&&r.set("length",A(e.length)),new Proxy(e,{defineProperty(o,l,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Ls();var u=r.get(l);return u===void 0?u=a(()=>{var d=A(f.value);return r.set(l,d),d}):m(u,f.value,!0),!0},deleteProperty(o,l){var f=r.get(l);if(f===void 0){if(l in o){const u=a(()=>A(F));r.set(l,u),yt(s)}}else m(f,F),yt(s);return!0},get(o,l,f){if(l===Ft)return e;var u=r.get(l),d=l in o;if(u===void 0&&(!d||ct(o,l)?.writable)&&(u=a(()=>{var g=De(d?o[l]:F),p=A(g);return p}),r.set(l,u)),u!==void 0){var h=c(u);return h===F?void 0:h}return Reflect.get(o,l,f)},getOwnPropertyDescriptor(o,l){var f=Reflect.getOwnPropertyDescriptor(o,l);if(f&&"value"in f){var u=r.get(l);u&&(f.value=c(u))}else if(f===void 0){var d=r.get(l),h=d?.v;if(d!==void 0&&h!==F)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return f},has(o,l){if(l===Ft)return!0;var f=r.get(l),u=f!==void 0&&f.v!==F||Reflect.has(o,l);if(f!==void 0||E!==null&&(!u||ct(o,l)?.writable)){f===void 0&&(f=a(()=>{var h=u?De(o[l]):F,g=A(h);return g}),r.set(l,f));var d=c(f);if(d===F)return!1}return u},set(o,l,f,u){var d=r.get(l),h=l in o;if(n&&l==="length")for(var g=f;g<d.v;g+=1){var p=r.get(g+"");p!==void 0?m(p,F):g in o&&(p=a(()=>A(F)),r.set(g+"",p))}if(d===void 0)(!h||ct(o,l)?.writable)&&(d=a(()=>A(void 0)),m(d,De(f)),r.set(l,d));else{h=d.v!==F;var y=a(()=>De(f));m(d,y)}var R=Reflect.getOwnPropertyDescriptor(o,l);if(R?.set&&R.set.call(u,f),!h){if(n&&typeof l=="string"){var b=r.get("length"),x=Number(l);Number.isInteger(x)&&x>=b.v&&m(b,x+1)}yt(s)}return!0},ownKeys(o){c(s);var l=Reflect.ownKeys(o).filter(d=>{var h=r.get(d);return h===void 0||h.v!==F});for(var[f,u]of r)u.v!==F&&!(f in o)&&l.push(f);return l},setPrototypeOf(){Ds()}})}var yn,xn,$n,Sn;function xr(){if(yn===void 0){yn=window,xn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;$n=ct(t,"firstChild").get,Sn=ct(t,"nextSibling").get,Xr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Xr(r)&&(r.__t=void 0)}}function _e(e=""){return document.createTextNode(e)}function Ve(e){return $n.call(e)}function ye(e){return Sn.call(e)}function T(e,t){if(!k)return Ve(e);var r=Ve(S);if(r===null)r=S.appendChild(_e());else if(t&&r.nodeType!==hr){var n=_e();return r?.before(n),ie(n),n}return ie(r),r}function kn(e,t=!1){if(!k){var r=Ve(e);return r instanceof Comment&&r.data===""?ye(r):r}if(t&&S?.nodeType!==hr){var n=_e();return S?.before(n),ie(n),n}return S}function O(e,t=1,r=!1){let n=k?S:e;for(var s;t--;)s=n,n=ye(n);if(!k)return n;if(r&&n?.nodeType!==hr){var i=_e();return n===null?s?.after(i):n.before(i),ie(i),i}return ie(n),n}function En(e){e.textContent=""}function Cn(){return!1}function An(e){var t=$,r=E;Q(null),$e(null);try{return e()}finally{Q(t),$e(r)}}function ei(e){E===null&&($===null&&Rs(),Ts()),We&&zs()}function ti(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function xe(e,t,r){var n=E;n!==null&&(n.f&se)!==0&&(e|=se);var s={ctx:ae,deps:null,nodes:null,f:e|Y|ue,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{$t(s),s.f|=Pt}catch(o){throw Z(s),o}else t!==null&&Le(s);var i=s;if(r&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&Xe)===0&&(i=i.first,(e&Ce)!==0&&(e&ft)!==0&&i!==null&&(i.f|=ft)),i!==null&&(i.parent=n,n!==null&&ti(i,n),$!==null&&($.f&U)!==0&&(e&je)===0)){var a=$;(a.effects??=[]).push(i)}return s}function $r(){return $!==null&&!be}function ri(e){const t=xe(Nt,null,!1);return N(t,q),t.teardown=e,t}function Wt(e){ei();var t=E.f,r=!$&&(t&Ae)!==0&&(t&Pt)===0;if(r){var n=ae;(n.e??=[]).push(e)}else return zn(e)}function zn(e){return xe(Ot|Ss,e,!1)}function ni(e){Me.ensure();const t=xe(je|Xe,e,!0);return()=>{Z(t)}}function si(e){Me.ensure();const t=xe(je|Xe,e,!0);return(r={})=>new Promise(n=>{r.outro?nt(t,()=>{Z(t),n(void 0)}):(Z(t),n(void 0))})}function Tn(e){return xe(Ot,e,!1)}function ii(e){return xe(dr|Xe,e,!0)}function Sr(e,t=0){return xe(Nt|t,e,!0)}function X(e,t=[],r=[],n=[]){Ys(n,t,r,s=>{xe(Nt,()=>e(...s.map(c)),!0)})}function kr(e,t=0){var r=xe(Ce|t,e,!0);return r}function de(e){return xe(Ae|Xe,e,!0)}function Rn(e){var t=e.teardown;if(t!==null){const r=We,n=$;Nn(!0),Q(null);try{t.call(null)}finally{Nn(r),Q(n)}}}function Mn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const s=r.ac;s!==null&&An(()=>{s.abort(ut)});var n=r.next;(r.f&je)!==0?r.parent=null:Z(r,t),r=n}}function ai(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Ae)===0&&Z(t),t=r}}function Z(e,t=!0){var r=!1;(t||(e.f&rn)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(oi(e.nodes.start,e.nodes.end),r=!0),Mn(e,t&&!r),Yt(e,0),N(e,Te);var n=e.nodes&&e.nodes.t;if(n!==null)for(const i of n)i.stop();Rn(e);var s=e.parent;s!==null&&s.first!==null&&In(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function oi(e,t){for(;e!==null;){var r=e===t?null:ye(e);e.remove(),e=r}}function In(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function nt(e,t,r=!0){var n=[];Ln(e,n,!0);var s=()=>{r&&Z(e),t&&t()},i=n.length;if(i>0){var a=()=>--i||s();for(var o of n)o.out(a)}else s()}function Ln(e,t,r){if((e.f&se)===0){e.f^=se;var n=e.nodes&&e.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&t.push(o);for(var s=e.first;s!==null;){var i=s.next,a=(s.f&ft)!==0||(s.f&Ae)!==0&&(e.f&Ce)!==0;Ln(s,t,a?r:!1),s=i}}}function Er(e){Dn(e,!0)}function Dn(e,t){if((e.f&se)!==0){e.f^=se,(e.f&q)===0&&(N(e,Y),Le(e));for(var r=e.first;r!==null;){var n=r.next,s=(r.f&ft)!==0||(r.f&Ae)!==0;Dn(r,s?t:!1),r=n}var i=e.nodes&&e.nodes.t;if(i!==null)for(const a of i)(a.is_global||t)&&a.in()}}function On(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var s=r===n?null:ye(r);t.append(r),r=s}}let Kt=!1,We=!1;function Nn(e){We=e}let $=null,be=!1;function Q(e){$=e}let E=null;function $e(e){E=e}let Oe=null;function Pn(e){$!==null&&(Oe===null?Oe=[e]:Oe.push(e))}let ee=null,le=0,he=null;function li(e){he=e}let Fn=1,st=0,it=st;function Un(e){it=e}function jn(){return++Fn}function xt(e){var t=e.f;if((t&Y)!==0)return!0;if(t&U&&(e.f&=~Qe),(t&ze)!==0){for(var r=e.deps,n=r.length,s=0;s<n;s++){var i=r[s];if(xt(i)&&mn(i),i.wv>e.wv)return!0}(t&ue)!==0&&ge===null&&N(e,q)}return!1}function Bn(e,t,r=!0){var n=e.reactions;if(n!==null&&!Oe?.includes(e))for(var s=0;s<n.length;s++){var i=n[s];(i.f&U)!==0?Bn(i,t,!1):t===i&&(r?N(i,Y):(i.f&q)!==0&&N(i,ze),Le(i))}}function Hn(e){var t=ee,r=le,n=he,s=$,i=Oe,a=ae,o=be,l=it,f=e.f;ee=null,le=0,he=null,$=(f&(Ae|je))===0?e:null,Oe=null,ht(e.ctx),be=!1,it=++st,e.ac!==null&&(An(()=>{e.ac.abort(ut)}),e.ac=null);try{e.f|=ur;var u=e.fn,d=u(),h=e.deps;if(ee!==null){var g;if(Yt(e,le),h!==null&&le>0)for(h.length=le+ee.length,g=0;g<ee.length;g++)h[le+g]=ee[g];else e.deps=h=ee;if($r()&&(e.f&ue)!==0)for(g=le;g<h.length;g++)(h[g].reactions??=[]).push(e)}else h!==null&&le<h.length&&(Yt(e,le),h.length=le);if(on()&&he!==null&&!be&&h!==null&&(e.f&(U|ze|Y))===0)for(g=0;g<he.length;g++)Bn(he[g],e);if(s!==null&&s!==e){if(st++,s.deps!==null)for(let p=0;p<r;p+=1)s.deps[p].rv=st;if(t!==null)for(const p of t)p.rv=st;he!==null&&(n===null?n=he:n.push(...he))}return(e.f&He)!==0&&(e.f^=He),d}catch(p){return cn(p)}finally{e.f^=ur,ee=t,le=r,he=n,$=s,Oe=i,ht(a),be=o,it=l}}function ci(e,t){let r=t.reactions;if(r!==null){var n=bs.call(r,e);if(n!==-1){var s=r.length-1;s===0?r=t.reactions=null:(r[n]=r[s],r.pop())}}if(r===null&&(t.f&U)!==0&&(ee===null||!ee.includes(t))){var i=t;(i.f&ue)!==0&&(i.f^=ue,i.f&=~Qe),mr(i),gn(i),Yt(i,0)}}function Yt(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)ci(e,r[n])}function $t(e){var t=e.f;if((t&Te)===0){N(e,q);var r=E,n=Kt;E=e,Kt=!0;try{(t&(Ce|en))!==0?ai(e):Mn(e),Rn(e);var s=Hn(e);e.teardown=typeof s=="function"?s:null,e.wv=Fn;var i;cr&&Us&&(e.f&Y)!==0&&e.deps}finally{Kt=n,E=r}}}function c(e){var t=e.f,r=(t&U)!==0;if($!==null&&!be){var n=E!==null&&(E.f&Te)!==0;if(!n&&!Oe?.includes(e)){var s=$.deps;if(($.f&ur)!==0)e.rv<st&&(e.rv=st,ee===null&&s!==null&&s[le]===e?le++:ee===null?ee=[e]:ee.push(e));else{($.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[$]:i.includes($)||i.push($)}}}if(We&&qe.has(e))return qe.get(e);if(r){var a=e;if(We){var o=a.v;return((a.f&q)===0&&a.reactions!==null||Vn(a))&&(o=wr(a)),qe.set(a,o),o}var l=(a.f&ue)===0&&!be&&$!==null&&(Kt||($.f&ue)!==0),f=a.deps===null;xt(a)&&(l&&(a.f|=ue),mn(a)),l&&!f&&qn(a)}if(ge?.has(e))return ge.get(e);if((e.f&He)!==0)throw e.v;return e.v}function qn(e){if(e.deps!==null){e.f|=ue;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&U)!==0&&(t.f&ue)===0&&qn(t)}}function Vn(e){if(e.v===F)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(qe.has(t)||(t.f&U)!==0&&Vn(t))return!0;return!1}function Cr(e){var t=be;try{return be=!0,e()}finally{be=t}}const Wn=new Set,Ar=new Set;function Kn(e){for(var t=0;t<e.length;t++)Wn.add(e[t]);for(var r of Ar)r(e)}let Yn=null;function Zt(e){var t=this,r=t.ownerDocument,n=e.type,s=e.composedPath?.()||[],i=s[0]||e.target;Yn=e;var a=0,o=Yn===e&&e.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var f=s.indexOf(t);if(f===-1)return;l<=f&&(a=l)}if(i=s[a]||e.target,i!==t){Dt(e,"currentTarget",{configurable:!0,get(){return i||r}});var u=$,d=E;Q(null),$e(null);try{for(var h,g=[];i!==null;){var p=i.assignedSlot||i.parentNode||i.host||null;try{var y=i["__"+n];y!=null&&(!i.disabled||e.target===i)&&y.call(i,e)}catch(R){h?g.push(R):h=R}if(e.cancelBubble||p===t||p===null)break;i=p}if(h){for(let R of g)queueMicrotask(()=>{throw R});throw h}}finally{e.__root=t,delete e.currentTarget,Q(u),$e(d)}}}function Zn(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Ke(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function P(e,t){var r=(t&gs)!==0,n=(t&ms)!==0,s,i=!e.startsWith("<!>");return()=>{if(k)return Ke(S,null),S;s===void 0&&(s=Zn(i?e:"<!>"+e),r||(s=Ve(s)));var a=n||xn?document.importNode(s,!0):s.cloneNode(!0);if(r){var o=Ve(a),l=a.lastChild;Ke(o,l)}else Ke(a,a);return a}}function fi(e,t,r="svg"){var n=!e.startsWith("<!>"),s=`<${r}>${n?e:"<!>"+e}</${r}>`,i;return()=>{if(k)return Ke(S,null),S;if(!i){var a=Zn(s),o=Ve(a);i=Ve(o)}var l=i.cloneNode(!0);return Ke(l,l),l}}function Gt(e,t){return fi(e,t,"svg")}function ui(){if(k)return Ke(S,null),S;var e=document.createDocumentFragment(),t=document.createComment(""),r=_e();return e.append(t,r),Ke(t,r),e}function I(e,t){if(k){var r=E;((r.f&Pt)===0||r.nodes.end===null)&&(r.nodes.end=S),jt();return}e!==null&&e.before(t)}const di=["touchstart","touchmove"];function hi(e){return di.includes(e)}function Ye(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function Gn(e,t){return Jn(e,t)}function pi(e,t){xr(),t.intro=t.intro??!1;const r=t.target,n=k,s=S;try{for(var i=Ve(r);i&&(i.nodeType!==dt||i.data!==Zr);)i=ye(i);if(!i)throw lt;Re(!0),ie(i);const a=Jn(e,{...t,anchor:i});return Re(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
2
  `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==lt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Is(),xr(),En(r),Re(!1),Gn(e,t)}finally{Re(n),ie(s)}}const gt=new Map;function Jn(e,{target:t,anchor:r,props:n={},events:s,context:i,intro:a=!0}){xr();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var g=d[h];if(!o.has(g)){o.add(g);var p=hi(g);t.addEventListener(g,Zt,{passive:p});var y=gt.get(g);y===void 0?(document.addEventListener(g,Zt,{passive:p}),gt.set(g,1)):gt.set(g,y+1)}}};l(It(Wn)),Ar.add(l);var f=void 0,u=si(()=>{var d=r??t.appendChild(_e());return Ws(d,{pending:()=>{}},h=>{if(i){vr({});var g=ae;g.c=i}if(s&&(n.$$events=s),k&&Ke(h,null),f=e(h,n)||{},k&&(E.nodes.end=S,S===null||S.nodeType!==dt||S.data!==lr))throw Ut(),lt;i&&gr()}),()=>{for(var h of o){t.removeEventListener(h,Zt);var g=gt.get(h);--g===0?(document.removeEventListener(h,Zt),gt.delete(h)):gt.set(h,g)}Ar.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return zr.set(f,u),f}let zr=new WeakMap;function vi(e,t){const r=zr.get(e);return r?(zr.delete(e),r(t)):Promise.resolve()}class gi{anchor;#e=new Map;#t=new Map;#r=new Map;#i=new Set;#a=!0;constructor(t,r=!0){this.anchor=t,this.#a=r}#s=()=>{var t=L;if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)Er(n),this.#i.delete(r);else{var s=this.#r.get(r);s&&(this.#t.set(r,s.effect),this.#r.delete(r),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),n=s.effect)}for(const[i,a]of this.#e){if(this.#e.delete(i),i===t)break;const o=this.#r.get(a);o&&(Z(o.effect),this.#r.delete(a))}for(const[i,a]of this.#t){if(i===r||this.#i.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var f=document.createDocumentFragment();On(a,f),f.append(_e()),this.#r.set(i,{effect:a,fragment:f})}else Z(a);this.#i.delete(i),this.#t.delete(i)};this.#a||!n?(this.#i.add(i),nt(a,o,!1)):o()}}};#n=t=>{this.#e.delete(t);const r=Array.from(this.#e.values());for(const[n,s]of this.#r)r.includes(n)||(Z(s.effect),this.#r.delete(n))};ensure(t,r){var n=L,s=Cn();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(s){var i=document.createDocumentFragment(),a=_e();i.append(a),this.#r.set(t,{effect:de(()=>r(a)),fragment:i})}else this.#t.set(t,de(()=>r(this.anchor)));if(this.#e.set(n,t),s){for(const[o,l]of this.#t)o===t?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===t?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#s),n.ondiscard(this.#n)}else k&&(this.anchor=S),this.#s()}}function Xn(e){ae===null&&Cs(),Wt(()=>{const t=Cr(e);if(typeof t=="function")return t})}function j(e,t,r=!1){k&&jt();var n=new gi(e),s=r?ft:0;function i(a,o){if(k){const f=nn(e)===Mt;if(a===f){var l=Bt();ie(l),n.anchor=l,Re(!1),n.ensure(a,o),Re(!0);return}}n.ensure(a,o)}kr(()=>{var a=!1;t((o,l=!0)=>{a=!0,i(l,o)}),a||i(!1,null)},s)}function mi(e,t,r){for(var n=[],s=t.length,i,a=t.length,o=0;o<s;o++){let d=t[o];nt(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=e.outrogroups;Tr(It(i.done)),h.delete(i),h.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var f=r,u=f.parentNode;En(u),u.append(f),e.items.clear()}Tr(t,!l)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function Tr(e,t=!0){for(var r=0;r<e.length;r++)Z(e[r],t)}var Qn;function _i(e,t,r,n,s,i=null){var a=e,o=new Map;k&&jt();var l=null,f=Js(()=>{var y=r();return Gr(y)?y:y==null?[]:It(y)}),u,d=!0;function h(){p.fallback=l,bi(p,u,a,t,n),l!==null&&(u.length===0?(l.f&Be)===0?Er(l):(l.f^=Be,St(l,null,a)):nt(l,()=>{l=null}))}var g=kr(()=>{u=c(f);var y=u.length;let R=!1;if(k){var b=nn(a)===Mt;b!==(y===0)&&(a=Bt(),ie(a),Re(!1),R=!0)}for(var x=new Set,te=L,W=Cn(),K=0;K<y;K+=1){k&&S.nodeType===dt&&S.data===lr&&(a=S,R=!0,Re(!1));var Ne=u[K],Se=n(Ne,K),M=d?null:o.get(Se);M?(M.v&&vt(M.v,Ne),M.i&&vt(M.i,K),W&&te.skipped_effects.delete(M.e)):(M=wi(o,d?a:Qn??=_e(),Ne,Se,K,s,t,r),d||(M.e.f|=Be),o.set(Se,M)),x.add(Se)}if(y===0&&i&&!l&&(d?l=de(()=>i(a)):(l=de(()=>i(Qn??=_e())),l.f|=Be)),k&&y>0&&ie(Bt()),!d)if(W){for(const[_t,we]of o)x.has(_t)||te.skipped_effects.add(we.e);te.oncommit(h),te.ondiscard(()=>{})}else h();R&&Re(!0),c(f)}),p={effect:g,items:o,outrogroups:null,fallback:l};d=!1,k&&(a=S)}function bi(e,t,r,n,s){var i=t.length,a=e.items,o=e.effect.first,l,f=null,u=[],d=[],h,g,p,y;for(y=0;y<i;y+=1){if(h=t[y],g=s(h,y),p=a.get(g).e,e.outrogroups!==null)for(const M of e.outrogroups)M.pending.delete(p),M.done.delete(p);if((p.f&Be)!==0)if(p.f^=Be,p===o)St(p,null,r);else{var R=f?f.next:o;p===e.effect.last&&(e.effect.last=p.prev),p.prev&&(p.prev.next=p.next),p.next&&(p.next.prev=p.prev),Ze(e,f,p),Ze(e,p,R),St(p,R,r),f=p,u=[],d=[],o=f.next;continue}if((p.f&se)!==0&&Er(p),p!==o){if(l!==void 0&&l.has(p)){if(u.length<d.length){var b=d[0],x;f=b.prev;var te=u[0],W=u[u.length-1];for(x=0;x<u.length;x+=1)St(u[x],b,r);for(x=0;x<d.length;x+=1)l.delete(d[x]);Ze(e,te.prev,W.next),Ze(e,f,te),Ze(e,W,b),o=b,f=W,y-=1,u=[],d=[]}else l.delete(p),St(p,o,r),Ze(e,p.prev,p.next),Ze(e,p,f===null?e.effect.first:f.next),Ze(e,f,p),f=p;continue}for(u=[],d=[];o!==null&&o!==p;)(l??=new Set).add(o),d.push(o),o=o.next;if(o===null)continue}(p.f&Be)===0&&u.push(p),f=p,o=p.next}if(e.outrogroups!==null){for(const M of e.outrogroups)M.pending.size===0&&(Tr(It(M.done)),e.outrogroups?.delete(M));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||l!==void 0){var K=[];if(l!==void 0)for(p of l)(p.f&se)===0&&K.push(p);for(;o!==null;)(o.f&se)===0&&o!==e.fallback&&K.push(o),o=o.next;var Ne=K.length;if(Ne>0){var Se=null;mi(e,K,Se)}}}function wi(e,t,r,n,s,i,a,o){var l=(a&hs)!==0?(a&vs)===0?bn(r,!1,!1):rt(r):null,f=(a&ps)!==0?rt(s):null;return{v:l,i:f,e:de(()=>(i(t,l??r,f??s,o),()=>{e.delete(n)}))}}function St(e,t,r){if(e.nodes)for(var n=e.nodes.start,s=e.nodes.end,i=t&&(t.f&Be)===0?t.nodes.start:r;n!==null;){var a=ye(n);if(i.before(n),n===s)return;n=a}}function Ze(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function es(e,t){Tn(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const s=document.createElement("style");s.id=t.hash,s.textContent=t.code,n.appendChild(s)}})}const ts=[...`
3
- \r\f \v\uFEFF`];function yi(e,t,r){var n=e==null?"":""+e;if(r){for(var s in r)if(r[s])n=n?n+" "+s:s;else if(n.length)for(var i=s.length,a=0;(a=n.indexOf(s,a))>=0;){var o=a+i;(a===0||ts.includes(n[a-1]))&&(o===n.length||ts.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function rs(e,t=!1){var r=t?" !important;":";",n="";for(var s in e){var i=e[s];i!=null&&i!==""&&(n+=" "+s+": "+i+r)}return n}function Rr(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function xi(e,t){if(t){var r="",n,s;if(Array.isArray(t)?(n=t[0],s=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(Rr)),s&&l.push(...Object.keys(s).map(Rr));var f=0,u=-1;const y=e.length;for(var d=0;d<y;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?a++:h===")"&&a--,!o&&i===!1&&a===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===y-1){if(u!==-1){var g=Rr(e.substring(f,u).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(f,d).trim();r+=" "+p+";"}}f=d+1,u=-1}}}}return n&&(r+=rs(n)),s&&(r+=rs(s,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function mt(e,t,r,n,s,i){var a=e.__className;if(k||a!==r||a===void 0){var o=yi(r,n,i);(!k||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(i&&s!==i)for(var l in i){var f=!!i[l];(s==null||f!==!!s[l])&&e.classList.toggle(l,f)}return i}function Mr(e,t={},r,n){for(var s in r){var i=r[s];t[s]!==i&&(r[s]==null?e.style.removeProperty(s):e.style.setProperty(s,i,n))}}function Ir(e,t,r,n){var s=e.__style;if(k||s!==t){var i=xi(t,n);(!k||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else n&&(Array.isArray(n)?(Mr(e,r?.[0],n[0]),Mr(e,r?.[1],n[1],"important")):Mr(e,r,n));return n}const $i=Symbol("is custom element"),Si=Symbol("is html");function Jt(e,t,r,n){var s=ki(e);k&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||s[t]!==(s[t]=r)&&(t==="loading"&&(e[Es]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Ei(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function ki(e){return e.__attributes??={[$i]:e.nodeName.includes("-"),[Si]:e.namespaceURI===_s}}var ns=new Map;function Ei(e){var t=e.getAttribute("is")||e.nodeName,r=ns.get(t);if(r)return r;ns.set(t,r=[]);for(var n,s=e,i=Element.prototype;i!==s;){n=ws(s);for(var a in n)n[a].set&&r.push(a);s=Jr(s)}return r}function ss(e,t){return e===t||e?.[Ft]===t}function Lr(e={},t,r,n){return Tn(()=>{var s,i;return Sr(()=>{s=i,i=[],Cr(()=>{e!==r(...i)&&(t(e,...i),s&&ss(r(...s),e)&&t(null,...s))})}),()=>{tt(()=>{i&&ss(r(...i),e)&&t(null,...i)})}}),e}function G(e,t,r,n){var s=n,i=!0,a=()=>(i&&(i=!1,s=n),s),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(i=!0,h)};var f=!1,u=Vt(()=>(f=!1,l())),d=E;return(function(h,g){if(arguments.length>0){const p=g?c(u):h;return m(u,p),f=!0,s!==void 0&&(s=p),h}return We&&f||(d.f&Te)!==0?u.v:c(u)})}function Ci(e){return new Ai(e)}class Ai{#e;#t;constructor(t){var r=new Map,n=(i,a)=>{var o=bn(a,!1,!1);return r.set(i,o),o};const s=new Proxy({...t.props||{},$$events:{}},{get(i,a){return c(r.get(a)??n(a,Reflect.get(i,a)))},has(i,a){return a===ks?!0:(c(r.get(a)??n(a,Reflect.get(i,a))),Reflect.has(i,a))},set(i,a,o){return m(r.get(a)??n(a,o),o),Reflect.set(i,a,o)}});this.#t=(t.hydrate?pi:Gn)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&V(),this.#e=s.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Dt(this,i,{get(){return this.#t[i]},set(a){this.#t[i]=a},enumerable:!0});this.#t.$set=i=>{Object.assign(s,i)},this.#t.$destroy=()=>{vi(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...s)=>r.call(this,...s);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(s=>s!==n)}}$destroy(){this.#t.$destroy()}}let is;typeof HTMLElement=="function"&&(is=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),I(s,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=zi(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=Xt(s,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ci({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ni(()=>{Sr(()=>{this.$$r=!0;for(const n of Lt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const s=Xt(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(const n in this.$$l)for(const s of this.$$l[n]){const i=this.$$c.$on(n,s);this.$$l_u.set(s,i)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Xt(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Lt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Xt(e,t,r,n){const s=r[e]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(s){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function zi(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function as(e,t,r,n,s,i){let a=class extends is{constructor(){super(e,r,s),this.$$p_d=t}static get observedAttributes(){return Lt(t).map(o=>(t[o].attribute||o).toLowerCase())}};return Lt(t).forEach(o=>{Dt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Xt(o,l,t),this.$$d[o]=l;var f=this.$$c;if(f){var u=ct(f,o)?.get;u?f[o]=l:f.$set({[o]:l})}}})}),n.forEach(o=>{Dt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const Ti=50,kt=5;class os{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,r){const n={level:t,message:r.map(s=>this.stringifyArg(s)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>Ti&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!0});let r=null;try{r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const n=new AudioContext,s=n.createMediaStreamDestination(),i=t.getAudioTracks()[0];if(i&&n.createMediaStreamSource(new MediaStream([i])).connect(s),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(s)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=s.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const f=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let u="video/webm";for(const d of f)if(MediaRecorder.isTypeSupported(d)){u=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:u}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const n=this.mediaStream,s=n._originalDisplayStream;if(s)for(const o of s.getTracks())o.stop();const i=n._originalMicStream;if(i)for(const o of i.getTracks())o.stop();const a=n._audioContext;a&&a.close(),this.mediaStream=null}const r=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(r)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),r=document.createElement("video");r.srcObject=t,r.autoplay=!0,await new Promise(i=>{r.onloadedmetadata=i});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const s=n.getContext("2d");if(!s){for(const i of t.getTracks())i.stop();return null}s.drawImage(r,0,0);for(const i of t.getTracks())i.stop();return new Promise(i=>{n.toBlob(a=>i(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const n=await this.fileToDataUrl(t),s={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(s),s}async addBlobAttachment(t,r){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const s=await this.blobToDataUrl(t),i={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:s};return this.attachments.push(i),i}removeAttachment(t){const r=this.attachments.findIndex(n=>n.id===t);return r!==-1?(this.attachments.splice(r,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<kt}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Dr=null;function Or(){return Dr||(Dr=new os),Dr}var Ri=P('<button class="recording-btn svelte-1105cax" aria-label="Stop recording"><span class="recording-dot svelte-1105cax"></span> <span class="recording-time svelte-1105cax"> </span> <span class="stop-label svelte-1105cax">Stop</span></button>'),Mi=P('<span class="unread-badge svelte-1105cax"> </span>'),Ii=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Li=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Di=P('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),Oi=P('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),Ni=P('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Pi={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
3
+ \r\f \v\uFEFF`];function yi(e,t,r){var n=e==null?"":""+e;if(r){for(var s in r)if(r[s])n=n?n+" "+s:s;else if(n.length)for(var i=s.length,a=0;(a=n.indexOf(s,a))>=0;){var o=a+i;(a===0||ts.includes(n[a-1]))&&(o===n.length||ts.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function rs(e,t=!1){var r=t?" !important;":";",n="";for(var s in e){var i=e[s];i!=null&&i!==""&&(n+=" "+s+": "+i+r)}return n}function Rr(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function xi(e,t){if(t){var r="",n,s;if(Array.isArray(t)?(n=t[0],s=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(Rr)),s&&l.push(...Object.keys(s).map(Rr));var f=0,u=-1;const y=e.length;for(var d=0;d<y;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?a++:h===")"&&a--,!o&&i===!1&&a===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===y-1){if(u!==-1){var g=Rr(e.substring(f,u).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(f,d).trim();r+=" "+p+";"}}f=d+1,u=-1}}}}return n&&(r+=rs(n)),s&&(r+=rs(s,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function mt(e,t,r,n,s,i){var a=e.__className;if(k||a!==r||a===void 0){var o=yi(r,n,i);(!k||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(i&&s!==i)for(var l in i){var f=!!i[l];(s==null||f!==!!s[l])&&e.classList.toggle(l,f)}return i}function Mr(e,t={},r,n){for(var s in r){var i=r[s];t[s]!==i&&(r[s]==null?e.style.removeProperty(s):e.style.setProperty(s,i,n))}}function Ir(e,t,r,n){var s=e.__style;if(k||s!==t){var i=xi(t,n);(!k||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else n&&(Array.isArray(n)?(Mr(e,r?.[0],n[0]),Mr(e,r?.[1],n[1],"important")):Mr(e,r,n));return n}const $i=Symbol("is custom element"),Si=Symbol("is html");function Jt(e,t,r,n){var s=ki(e);k&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||s[t]!==(s[t]=r)&&(t==="loading"&&(e[Es]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Ei(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function ki(e){return e.__attributes??={[$i]:e.nodeName.includes("-"),[Si]:e.namespaceURI===_s}}var ns=new Map;function Ei(e){var t=e.getAttribute("is")||e.nodeName,r=ns.get(t);if(r)return r;ns.set(t,r=[]);for(var n,s=e,i=Element.prototype;i!==s;){n=ws(s);for(var a in n)n[a].set&&r.push(a);s=Jr(s)}return r}function ss(e,t){return e===t||e?.[Ft]===t}function Lr(e={},t,r,n){return Tn(()=>{var s,i;return Sr(()=>{s=i,i=[],Cr(()=>{e!==r(...i)&&(t(e,...i),s&&ss(r(...s),e)&&t(null,...s))})}),()=>{tt(()=>{i&&ss(r(...i),e)&&t(null,...i)})}}),e}function G(e,t,r,n){var s=n,i=!0,a=()=>(i&&(i=!1,s=n),s),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(i=!0,h)};var f=!1,u=Vt(()=>(f=!1,l())),d=E;return(function(h,g){if(arguments.length>0){const p=g?c(u):h;return m(u,p),f=!0,s!==void 0&&(s=p),h}return We&&f||(d.f&Te)!==0?u.v:c(u)})}function Ci(e){return new Ai(e)}class Ai{#e;#t;constructor(t){var r=new Map,n=(i,a)=>{var o=bn(a,!1,!1);return r.set(i,o),o};const s=new Proxy({...t.props||{},$$events:{}},{get(i,a){return c(r.get(a)??n(a,Reflect.get(i,a)))},has(i,a){return a===ks?!0:(c(r.get(a)??n(a,Reflect.get(i,a))),Reflect.has(i,a))},set(i,a,o){return m(r.get(a)??n(a,o),o),Reflect.set(i,a,o)}});this.#t=(t.hydrate?pi:Gn)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&V(),this.#e=s.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Dt(this,i,{get(){return this.#t[i]},set(a){this.#t[i]=a},enumerable:!0});this.#t.$set=i=>{Object.assign(s,i)},this.#t.$destroy=()=>{vi(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...s)=>r.call(this,...s);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(s=>s!==n)}}$destroy(){this.#t.$destroy()}}let is;typeof HTMLElement=="function"&&(is=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),I(s,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=zi(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=Xt(s,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ci({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ni(()=>{Sr(()=>{this.$$r=!0;for(const n of Lt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const s=Xt(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(const n in this.$$l)for(const s of this.$$l[n]){const i=this.$$c.$on(n,s);this.$$l_u.set(s,i)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Xt(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Lt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Xt(e,t,r,n){const s=r[e]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(s){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function zi(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function as(e,t,r,n,s,i){let a=class extends is{constructor(){super(e,r,s),this.$$p_d=t}static get observedAttributes(){return Lt(t).map(o=>(t[o].attribute||o).toLowerCase())}};return Lt(t).forEach(o=>{Dt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Xt(o,l,t),this.$$d[o]=l;var f=this.$$c;if(f){var u=ct(f,o)?.get;u?f[o]=l:f.$set({[o]:l})}}})}),n.forEach(o=>{Dt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const Ti=50,kt=5;class os{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,r){const n={level:t,message:r.map(s=>this.stringifyArg(s)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>Ti&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"window"},audio:!0});let r=null;try{r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const n=new AudioContext,s=n.createMediaStreamDestination(),i=t.getAudioTracks()[0];if(i&&n.createMediaStreamSource(new MediaStream([i])).connect(s),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(s)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=s.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const f=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let u="video/webm";for(const d of f)if(MediaRecorder.isTypeSupported(d)){u=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:u}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const n=this.mediaStream,s=n._originalDisplayStream;if(s)for(const o of s.getTracks())o.stop();const i=n._originalMicStream;if(i)for(const o of i.getTracks())o.stop();const a=n._audioContext;a&&a.close(),this.mediaStream=null}const r=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(r)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),r=document.createElement("video");r.srcObject=t,r.autoplay=!0,await new Promise(i=>{r.onloadedmetadata=i});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const s=n.getContext("2d");if(!s){for(const i of t.getTracks())i.stop();return null}s.drawImage(r,0,0);for(const i of t.getTracks())i.stop();return new Promise(i=>{n.toBlob(a=>i(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const n=await this.fileToDataUrl(t),s={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(s),s}async addBlobAttachment(t,r){if(this.attachments.length>=kt)return console.warn(`[SDK] Maximum ${kt} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const s=await this.blobToDataUrl(t),i={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:s};return this.attachments.push(i),i}removeAttachment(t){const r=this.attachments.findIndex(n=>n.id===t);return r!==-1?(this.attachments.splice(r,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<kt}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const s=new FileReader;s.onload=()=>r(s.result),s.onerror=n,s.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Dr=null;function Or(){return Dr||(Dr=new os),Dr}var Ri=P('<button class="recording-btn svelte-1105cax" aria-label="Stop recording"><span class="recording-dot svelte-1105cax"></span> <span class="recording-time svelte-1105cax"> </span> <span class="stop-label svelte-1105cax">Stop</span></button>'),Mi=P('<span class="unread-badge svelte-1105cax"> </span>'),Ii=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Li=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Di=P('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),Oi=P('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),Ni=P('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Pi={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
4
4
  0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
5
5
  "Helvetica Neue", Arial, sans-serif;}.toggle-btn.svelte-1105cax {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s,
6
- opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.chat-window.chat-window-fullscreen.svelte-1105cax {width:98vw;height:98vh;max-width:98vw;max-height:98vh;right:1vw;border-radius:0.5rem;transition:width 0.3s ease,
7
- height 0.3s ease,
8
- max-width 0.3s ease,
9
- max-height 0.3s ease;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
6
+ opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.chat-window.chat-window-fullscreen.svelte-1105cax {position:fixed;inset:1vh 1vw;width:auto;height:auto;max-width:none;max-height:none;border-radius:0.5rem;transition:all 0.3s ease;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
10
7
  animation: svelte-1105cax-spin 0.8s linear infinite;}
11
8
 
12
9
  @keyframes svelte-1105cax-spin {
@@ -45,7 +42,7 @@
45
42
  var(--shadow),
46
43
  0 0 30px rgba(239, 68, 68, 0.6);
47
44
  }
48
- }`};function ls(e,t){vr(t,!0),es(e,Pi);let r=G(t,"embedId"),n=G(t,"embedUrl",7,"https://app.fortalece.ai"),s=G(t,"position",7,"bottom-right"),i=G(t,"showHeader",7,"true"),a=G(t,"allowAttachments",7,!0),o=G(t,"allowScreenRecording",7,!0),l=G(t,"captureConsoleLogs",7,!0),f=A(!1),u=A(!1),d=A(!1),h=A(0),g=A(!1),p=A(null),y=A("00:00"),R=A(void 0),b=A(null),x=A(De([])),te=A(De([]));Wt(()=>{if(c(g)&&c(p)!==null){const w=setInterval(()=>{const D=Math.floor((Date.now()-c(p))/1e3),fe=Math.floor(D/60).toString().padStart(2,"0"),ke=(D%60).toString().padStart(2,"0");m(y,`${fe}:${ke}`)},1e3);return()=>clearInterval(w)}});const W=me(()=>i()==="false"||i()===!1),K=me(()=>!c(f)||c(W)||!c(u)),Ne=me(()=>`${n()}/embed/${r()}${c(W)?"?showHeader=false":""}`),Se=me(()=>s()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");Xn(()=>{m(b,Or(),!0),l()&&c(b).startConsoleCapture();function w(D){try{const Je=new URL(n()).origin;if(D.origin!==Je)return}catch{return}const{type:fe,payload:ke}=D.data||{};switch(fe){case"fortalece:ready":m(u,!0);break;case"fortalece:close-request":m(f,!1);break;case"fortalece:request-context":Et();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Ct();break;case"fortalece:resize":m(d,ke?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ke?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(y,"00:00"),m(f,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(y,"00:00"),m(f,!0);break}}return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),l()&&c(b)&&c(b).stopConsoleCapture()}});function M(){m(f,!c(f)),c(f)&&m(h,0)}function _t(){we("fortalece:stop-recording"),m(g,!1),m(p,null),m(y,"00:00")}function we(w,D={}){if(c(R)?.contentWindow)try{const fe=new URL(n()).origin;c(R).contentWindow.postMessage({type:w,payload:D},fe)}catch{}}function Et(){if(!c(b))return;const w=c(b).getPageContext();if(we("fortalece:page-context",w),l()){const D=c(b).getConsoleErrors();m(te,D,!0),we("fortalece:console-logs",{logs:D})}we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(x).length,maxAttachments:5})}function ce(){c(x).forEach(w=>{we("fortalece:attachment-added",w)})}function Ct(){c(b)&&(c(b).clearAttachments(),c(b).clearConsoleErrors(),m(x,[],!0),m(te,[],!0),we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Wt(()=>{c(f)&&c(u)&&(we("fortalece:opened"),Et(),ce())});var er={get embedId(){return r()},set embedId(w){r(w),V()},get embedUrl(){return n()},set embedUrl(w="https://app.fortalece.ai"){n(w),V()},get position(){return s()},set position(w="bottom-right"){s(w),V()},get showHeader(){return i()},set showHeader(w="true"){i(w),V()},get allowAttachments(){return a()},set allowAttachments(w=!0){a(w),V()},get allowScreenRecording(){return o()},set allowScreenRecording(w=!0){o(w),V()},get captureConsoleLogs(){return l()},set captureConsoleLogs(w=!0){l(w),V()}},Ge=Ni(),tr=T(Ge);{var Pr=w=>{var D=Ri();D.__click=_t;var fe=O(T(D),2),ke=T(fe,!0);z(fe),pr(2),z(D),X(()=>Ye(ke,c(y))),I(w,D)},Fr=w=>{var D=ui(),fe=kn(D);{var ke=Je=>{var at=Di();at.__click=M;var zt=T(at);{var jr=pe=>{var Pe=Mi(),v=T(Pe,!0);z(Pe),X(()=>Ye(v,c(h)>9?"9+":c(h))),I(pe,Pe)};j(zt,pe=>{c(h)>0&&!c(f)&&pe(jr)})}var ar=O(zt,2);{var Br=pe=>{var Pe=Ii();I(pe,Pe)},Tt=pe=>{var Pe=Li();I(pe,Pe)};j(ar,pe=>{c(f)?pe(Br):pe(Tt,!1)})}z(at),X(()=>Jt(at,"aria-label",c(f)?"Close chat":"Open chat")),I(Je,at)};j(fe,Je=>{c(K)&&Je(ke)},!0)}I(w,D)};j(tr,w=>{c(g)?w(Pr):w(Fr,!1)})}var bt=O(tr,2);let rr,nr;var sr=T(bt);{var Ur=w=>{var D=Oi();I(w,D)};j(sr,w=>{c(u)||w(Ur)})}var At=O(sr,2);let ir;return Lr(At,w=>m(R,w),()=>c(R)),z(bt),z(Ge),X(()=>{Ir(Ge,c(Se)),rr=mt(bt,1,"chat-window svelte-1105cax",null,rr,{"chat-window-hidden":!c(f),"chat-window-fullscreen":c(d)}),nr=Ir(bt,"",nr,{bottom:c(K)&&!c(d)?"4.5rem":c(d)?"1vh":"0"}),Jt(At,"src",c(Ne)),ir=mt(At,1,"svelte-1105cax",null,ir,{hidden:!c(u)})}),I(e,Ge),gr(er)}Kn(["click"]),customElements.define("support-chat",as(ls,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},showHeader:{attribute:"show-header",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],!0));var Fi=P('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),Ui=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),ji=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),Bi=P('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),Hi=P('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),qi=P('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),Vi=P('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),Wi=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Ki=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Yi=P('<button class="toggle-btn svelte-p7nz7"><!></button>'),Zi=P('<span class="badge svelte-p7nz7"> </span>'),Gi=P('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),Ji=P('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),Xi=P('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div>'),Qi=P('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const ea={hash:"svelte-p7nz7",code:`
45
+ }`};function ls(e,t){vr(t,!0),es(e,Pi);let r=G(t,"embedId"),n=G(t,"embedUrl",7,"https://app.fortalece.ai"),s=G(t,"position",7,"bottom-right"),i=G(t,"showHeader",7,"true"),a=G(t,"allowAttachments",7,!0),o=G(t,"allowScreenRecording",7,!0),l=G(t,"captureConsoleLogs",7,!0),f=A(!1),u=A(!1),d=A(!1),h=A(0),g=A(!1),p=A(null),y=A("00:00"),R=A(void 0),b=A(null),x=A(De([])),te=A(De([]));Wt(()=>{if(c(g)&&c(p)!==null){const w=setInterval(()=>{const D=Math.floor((Date.now()-c(p))/1e3),fe=Math.floor(D/60).toString().padStart(2,"0"),ke=(D%60).toString().padStart(2,"0");m(y,`${fe}:${ke}`)},1e3);return()=>clearInterval(w)}});const W=me(()=>i()==="false"||i()===!1),K=me(()=>!c(f)||c(W)||!c(u)),Ne=me(()=>`${n()}/embed/${r()}${c(W)?"?showHeader=false":""}`),Se=me(()=>s()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");Xn(()=>{m(b,Or(),!0),l()&&c(b).startConsoleCapture();function w(D){try{const Je=new URL(n()).origin;if(D.origin!==Je)return}catch{return}const{type:fe,payload:ke}=D.data||{};switch(fe){case"fortalece:ready":m(u,!0);break;case"fortalece:close-request":m(f,!1);break;case"fortalece:request-context":Et();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Ct();break;case"fortalece:resize":m(d,ke?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ke?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(y,"00:00"),m(f,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(y,"00:00"),m(f,!0);break}}return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),l()&&c(b)&&c(b).stopConsoleCapture()}});function M(){m(f,!c(f)),c(f)&&m(h,0)}function _t(){we("fortalece:stop-recording"),m(g,!1),m(p,null),m(y,"00:00")}function we(w,D={}){if(c(R)?.contentWindow)try{const fe=new URL(n()).origin;c(R).contentWindow.postMessage({type:w,payload:D},fe)}catch{}}function Et(){if(!c(b))return;const w=c(b).getPageContext();if(we("fortalece:page-context",w),l()){const D=c(b).getConsoleErrors();m(te,D,!0),we("fortalece:console-logs",{logs:D})}we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(x).length,maxAttachments:5})}function ce(){c(x).forEach(w=>{we("fortalece:attachment-added",w)})}function Ct(){c(b)&&(c(b).clearAttachments(),c(b).clearConsoleErrors(),m(x,[],!0),m(te,[],!0),we("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Wt(()=>{c(f)&&c(u)&&(we("fortalece:opened"),Et(),ce())});var er={get embedId(){return r()},set embedId(w){r(w),V()},get embedUrl(){return n()},set embedUrl(w="https://app.fortalece.ai"){n(w),V()},get position(){return s()},set position(w="bottom-right"){s(w),V()},get showHeader(){return i()},set showHeader(w="true"){i(w),V()},get allowAttachments(){return a()},set allowAttachments(w=!0){a(w),V()},get allowScreenRecording(){return o()},set allowScreenRecording(w=!0){o(w),V()},get captureConsoleLogs(){return l()},set captureConsoleLogs(w=!0){l(w),V()}},Ge=Ni(),tr=T(Ge);{var Pr=w=>{var D=Ri();D.__click=_t;var fe=O(T(D),2),ke=T(fe,!0);z(fe),pr(2),z(D),X(()=>Ye(ke,c(y))),I(w,D)},Fr=w=>{var D=ui(),fe=kn(D);{var ke=Je=>{var at=Di();at.__click=M;var zt=T(at);{var jr=pe=>{var Pe=Mi(),v=T(Pe,!0);z(Pe),X(()=>Ye(v,c(h)>9?"9+":c(h))),I(pe,Pe)};j(zt,pe=>{c(h)>0&&!c(f)&&pe(jr)})}var ar=O(zt,2);{var Br=pe=>{var Pe=Ii();I(pe,Pe)},Tt=pe=>{var Pe=Li();I(pe,Pe)};j(ar,pe=>{c(f)?pe(Br):pe(Tt,!1)})}z(at),X(()=>Jt(at,"aria-label",c(f)?"Close chat":"Open chat")),I(Je,at)};j(fe,Je=>{c(K)&&Je(ke)},!0)}I(w,D)};j(tr,w=>{c(g)?w(Pr):w(Fr,!1)})}var bt=O(tr,2);let rr,nr;var sr=T(bt);{var Ur=w=>{var D=Oi();I(w,D)};j(sr,w=>{c(u)||w(Ur)})}var At=O(sr,2);let ir;return Lr(At,w=>m(R,w),()=>c(R)),z(bt),z(Ge),X(()=>{Ir(Ge,c(Se)),rr=mt(bt,1,"chat-window svelte-1105cax",null,rr,{"chat-window-hidden":!c(f),"chat-window-fullscreen":c(d)}),nr=Ir(bt,"",nr,{bottom:c(d)?void 0:c(K)?"4.5rem":"0"}),Jt(At,"src",c(Ne)),ir=mt(At,1,"svelte-1105cax",null,ir,{hidden:!c(u)})}),I(e,Ge),gr(er)}Kn(["click"]),customElements.define("support-chat",as(ls,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},showHeader:{attribute:"show-header",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],!0));var Fi=P('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),Ui=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),ji=P('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),Bi=P('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),Hi=P('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),qi=P('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),Vi=P('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),Wi=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Ki=Gt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Yi=P('<button class="toggle-btn svelte-p7nz7"><!></button>'),Zi=P('<span class="badge svelte-p7nz7"> </span>'),Gi=P('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),Ji=P('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),Xi=P('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin" allow="clipboard-write; display-capture; microphone"></iframe></div>'),Qi=P('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const ea={hash:"svelte-p7nz7",code:`
49
46
  /* Host element styling for inline mode */:host {display:block;}:host([display="inline"]) {display:block;width:100%;height:100%;}.svelte-p7nz7 {box-sizing:border-box;margin:0;padding:0;}.feedback-panel.svelte-p7nz7 {--primary-color: #6366f1;--danger-color: #ef4444;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
50
47
  0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
51
48
  "Helvetica Neue", Arial, sans-serif;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walker-di/fortalece-ai-sdk",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "Fortalece AI Web Components SDK - Support Chat and Feedback widgets",
6
6
  "author": "Fortalece AI",