@walker-di/fortalece-ai-sdk 0.3.18 → 0.3.19

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.19] - 2026-05-09
9
+
10
+ ### Fixed
11
+
12
+ - Added `allow-top-navigation-by-user-activation` to the iframe `sandbox` attribute in both `<feedback-panel>` and `<support-chat>` custom elements. This allows user-activated top-level navigation (e.g., link clicks) inside the embedded iframe without triggering Chrome sandbox security errors, while preserving all existing sandbox restrictions.
13
+
8
14
  ## [0.1.0] - 2024-12-11
9
15
 
10
16
  ### Added
@@ -1,6 +1,6 @@
1
1
  var FortaleceAI=(function($){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const mi=1,_i=2,bi=16,wi=1,yi=2,Qr="[",Dt="[!",fr="]",ct={},B=Symbol(),$i="http://www.w3.org/1999/xhtml",dr=!1;var en=Array.isArray,Si=Array.prototype.indexOf,ut=Array.prototype.includes,Lt=Array.from,Pt=Object.keys,Ft=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,ki=Object.getOwnPropertyDescriptors,Ei=Object.prototype,xi=Array.prototype,tn=Object.getPrototypeOf,rn=Object.isExtensible;function Ci(e){for(var t=0;t<e.length;t++)e[t]()}function nn(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}const H=2,Nt=4,Ut=8,sn=1<<24,Me=16,_e=32,Be=64,hr=128,fe=512,U=1024,W=2048,be=4096,ie=8192,Ie=16384,jt=32768,dt=65536,an=1<<17,on=1<<18,Qe=1<<19,Ai=1<<20,He=1<<25,et=32768,pr=1<<21,vr=1<<22,We=1<<23,Bt=Symbol("$state"),Ti=Symbol("legacy props"),zi=Symbol(""),ht=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Ht=3,pt=8;function Ri(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Mi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ii(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Oi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Di(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Li(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Pi(){throw new Error("https://svelte.dev/e/hydration_failed")}function Fi(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ni(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ui(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ji(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Wt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Bi(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let x=!1;function Oe(e){x=e}let E;function se(e){if(e===null)throw Wt(),ct;return E=e}function qt(){return se(xe(E))}function R(e){if(x){if(xe(E)!==null)throw Wt(),ct;E=e}}function gr(e=1){if(x){for(var t=e,r=E;t--;)r=xe(r);E=r}}function Vt(e=!0){for(var t=0,r=E;;){if(r.nodeType===pt){var n=r.data;if(n===fr){if(t===0)return r;t-=1}else(n===Qr||n===Dt)&&(t+=1)}var i=xe(r);e&&r.remove(),r=i}}function ln(e){if(!e||e.nodeType!==pt)throw Wt(),ct;return e.data}function cn(e){return e===this.v}function Hi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function un(e){return!Hi(e,this.v)}let Wi=!1,ae=null;function vt(e){ae=e}function mr(e,t=!1,r){ae={p:ae,i:!1,c:null,e:null,s:e,x:null,l:null}}function _r(e){var t=ae,r=t.e;if(r!==null){t.e=null;for(var n of r)On(n)}return e!==void 0&&(t.x=e),t.i=!0,ae=t.p,e??{}}function fn(){return!0}let tt=[];function dn(){var e=tt;tt=[],Ci(e)}function rt(e){if(tt.length===0&&!$t){var t=tt;queueMicrotask(()=>{t===tt&&dn()})}tt.push(e)}function qi(){for(;tt.length>0;)dn()}function hn(e){var t=C;if(t===null)return k.f|=We,e;if((t.f&jt)===0){if((t.f&hr)===0)throw e;t.b.error(e)}else gt(e,t)}function gt(e,t){for(;t!==null;){if((t.f&hr)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const Vi=-7169;function N(e,t){e.f=e.f&Vi|t}function br(e){(e.f&fe)!==0||e.deps===null?N(e,U):N(e,be)}function pn(e){if(e!==null)for(const t of e)(t.f&H)===0||(t.f&et)===0||(t.f^=et,pn(t.deps))}function vn(e,t,r){(e.f&W)!==0?t.add(e):(e.f&be)!==0&&r.add(e),pn(e.deps),N(e,U)}const Gt=new Set;let D=null,we=null,oe=[],Kt=null,wr=!1,$t=!1;class De{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#a=0;#o=null;#i=new Set;#n=new Set;#s=new Map;is_fork=!1;#l=!1;is_deferred(){return this.is_fork||this.#a>0}skip_effect(t){this.#s.has(t)||this.#s.set(t,{d:[],m:[]})}unskip_effect(t){var r=this.#s.get(t);if(r){this.#s.delete(t);for(var n of r.d)N(n,W),ye(n);for(n of r.m)N(n,be),ye(n)}}process(t){oe=[],this.apply();var r=[],n=[];for(const i of t)this.#c(i,r,n);if(this.is_deferred()){this.#f(n),this.#f(r);for(const[i,s]of this.#s)wn(i,s)}else{for(const i of this.#e)i();this.#e.clear(),this.#r===0&&this.#u(),D=null,mn(n),mn(r),this.#o?.resolve()}we=null}#c(t,r,n){t.f^=U;for(var i=t.first,s=null;i!==null;){var a=i.f,o=(a&(_e|Be))!==0,l=o&&(a&U)!==0,u=l||(a&ie)!==0||this.#s.has(i);if(!u&&i.fn!==null){o?i.f^=U:s!==null&&(a&(Nt|Ut|sn))!==0?s.b.defer_effect(i):(a&Nt)!==0?r.push(i):kt(i)&&((a&Me)!==0&&this.#n.add(i),Et(i));var f=i.first;if(f!==null){i=f;continue}}var d=i.parent;for(i=i.next;i===null&&d!==null;)d===s&&(s=null),i=d.next,d=d.parent}}#f(t){for(var r=0;r<t.length;r+=1)vn(t[r],this.#i,this.#n)}capture(t,r){r!==B&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&We)===0&&(this.current.set(t,t.v),we?.set(t,t.v))}activate(){D=this,this.apply()}deactivate(){D===this&&(D=null,we=null)}flush(){if(this.activate(),oe.length>0){if(gn(),D!==null&&D!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#t)t(this);this.#t.clear()}#u(){if(Gt.size>1){this.previous.clear();var t=we,r=!0;for(const i of Gt){if(i===this){r=!1;continue}const s=[];for(const[o,l]of this.current){if(i.current.has(o))if(r&&l!==i.current.get(o))i.current.set(o,l);else continue;s.push(o)}if(s.length===0)continue;const a=[...i.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 u of s)_n(u,a,o,l);if(oe.length>0){D=i,i.apply();for(const u of oe)i.#c(u,[],[]);i.deactivate()}oe=n}}D=null,we=t}this.committed=!0,Gt.delete(this)}increment(t){this.#r+=1,t&&(this.#a+=1)}decrement(t){this.#r-=1,t&&(this.#a-=1),!this.#l&&(this.#l=!0,rt(()=>{this.#l=!1,this.is_deferred()?oe.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#i)this.#n.delete(t),N(t,W),ye(t);for(const t of this.#n)N(t,be),ye(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#t.add(t)}settled(){return(this.#o??=nn()).promise}static ensure(){if(D===null){const t=D=new De;Gt.add(D),$t||rt(()=>{D===t&&t.flush()})}return D}apply(){}}function G(e){var t=$t;$t=!0;try{for(var r;;){if(qi(),oe.length===0&&(D?.flush(),oe.length===0))return Kt=null,r;gn()}}finally{$t=t}}function gn(){wr=!0;var e=null;try{for(var t=0;oe.length>0;){var r=De.ensure();if(t++>1e3){var n,i;Gi()}r.process(oe),qe.clear()}}finally{wr=!1,Kt=null}}function Gi(){try{Li()}catch(e){gt(e,Kt)}}let Le=null;function mn(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(Ie|ie))===0&&kt(n)&&(Le=new Set,Et(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?Fn(n):n.fn=null),Le?.size>0)){qe.clear();for(const i of Le){if((i.f&(Ie|ie))!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)Le.has(a)&&(Le.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const l=s[o];(l.f&(Ie|ie))===0&&Et(l)}}Le.clear()}}Le=null}}function _n(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&H)!==0?_n(i,t,r,n):(s&(vr|Me))!==0&&(s&W)===0&&bn(i,t,n)&&(N(i,W),ye(i))}}function bn(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const i of e.deps){if(ut.call(t,i))return!0;if((i.f&H)!==0&&bn(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function ye(e){for(var t=Kt=e;t.parent!==null;){t=t.parent;var r=t.f;if(wr&&t===C&&(r&Me)!==0&&(r&on)===0)return;if((r&(Be|_e))!==0){if((r&U)===0)return;t.f^=U}}oe.push(t)}function wn(e,t){if(!((e.f&_e)!==0&&(e.f&U)!==0)){(e.f&W)!==0?t.d.push(e):(e.f&be)!==0&&t.m.push(e),N(e,U);for(var r=e.first;r!==null;)wn(r,t),r=r.next}}function Ki(e){let t=0,r=nt(0),n;return()=>{xr()&&(c(r),Cr(()=>(t===0&&(n=zr(()=>e(()=>St(r)))),t+=1,()=>{rt(()=>{t-=1,t===0&&(n?.(),n=void 0,St(r))})})))}}var Ji=dt|Qe|hr;function Yi(e,t,r){new Zi(e,t,r)}class Zi{parent;is_pending=!1;#e;#t=x?E:null;#r;#a;#o;#i=null;#n=null;#s=null;#l=null;#c=null;#f=0;#u=0;#p=!1;#h=!1;#v=new Set;#g=new Set;#d=null;#y=Ki(()=>(this.#d=nt(this.#f),()=>{this.#d=null}));constructor(t,r,n){this.#e=t,this.#r=r,this.#a=n,this.parent=C.b,this.is_pending=!!this.#r.pending,this.#o=Ar(()=>{if(C.b=this,x){const s=this.#t;qt(),s.nodeType===pt&&s.data===Dt?this.#S():(this.#$(),this.#u===0&&(this.is_pending=!1))}else{var i=this.#b();try{this.#i=de(()=>n(i))}catch(s){this.error(s)}this.#u>0?this.#_():this.is_pending=!1}return()=>{this.#c?.remove()}},Ji),x&&(this.#e=E)}#$(){try{this.#i=de(()=>this.#a(this.#e))}catch(t){this.error(t)}}#S(){const t=this.#r.pending;t&&(this.#n=de(()=>t(this.#e)),rt(()=>{var r=this.#b();this.#i=this.#m(()=>(De.ensure(),de(()=>this.#a(r)))),this.#u>0?this.#_():(it(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#b(){var t=this.#e;return this.is_pending&&(this.#c=Se(),this.#e.before(this.#c),t=this.#c),t}defer_effect(t){vn(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=C,n=k,i=ae;Ae(this.#o),he(this.#o),vt(this.#o.ctx);try{return t()}catch(s){return hn(s),null}finally{Ae(r),he(n),vt(i)}}#_(){const t=this.#r.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),jn(this.#i,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,W),ye(r);for(const r of this.#g)N(r,be),ye(r);this.#v.clear(),this.#g.clear(),this.#n&&it(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,rt(()=>{this.#p=!1,this.#d&&mt(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.#i&&(Y(this.#i),this.#i=null),this.#n&&(Y(this.#n),this.#n=null),this.#s&&(Y(this.#s),this.#s=null),x&&(se(this.#t),gr(),se(Vt()));var i=!1,s=!1;const a=()=>{if(i){Bi();return}i=!0,s&&ji(),De.ensure(),this.#f=0,this.#s!==null&&it(this.#s,()=>{this.#s=null}),this.is_pending=this.has_pending_snippet(),this.#i=this.#m(()=>(this.#h=!1,de(()=>this.#a(this.#e)))),this.#u>0?this.#_():this.is_pending=!1};rt(()=>{try{s=!0,r?.(t,a),s=!1}catch(o){gt(o,this.#o&&this.#o.parent)}n&&(this.#s=this.#m(()=>{De.ensure(),this.#h=!0;try{return de(()=>{n(this.#e,()=>t,()=>a)})}catch(o){return gt(o,this.#o.parent),null}finally{this.#h=!1}}))})}}function Xi(e,t,r,n){const i=Jt;var s=e.filter(h=>!h.settled);if(r.length===0&&s.length===0){n(t.map(i));return}var a=D,o=C,l=Qi(),u=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(h=>h.promise)):null;function f(h){l();try{n(h)}catch(g){(o.f&Ie)===0&&gt(g,o)}a?.deactivate(),yr()}if(r.length===0){u.then(()=>f(t.map(i)));return}function d(){l(),Promise.all(r.map(h=>es(h))).then(h=>f([...t.map(i),...h])).catch(h=>gt(h,o))}u?u.then(d):d()}function Qi(){var e=C,t=k,r=ae,n=D;return function(s=!0){Ae(e),he(t),vt(r),s&&n?.activate()}}function yr(){Ae(null),he(null),vt(null)}function Jt(e){var t=H|W,r=k!==null&&(k.f&H)!==0?k:null;return C!==null&&(C.f|=Qe),{ctx:ae,deps:null,effects:null,equals:cn,f:t,fn:e,reactions:null,rv:0,v:B,wv:0,parent:r??C,ac:null}}function es(e,t,r){let n=C;n===null&&Mi();var i=n.b,s=void 0,a=nt(B),o=!k,l=new Map;return cs(()=>{var u=nn();s=u.promise;try{Promise.resolve(e()).then(u.resolve,u.reject).then(()=>{f===D&&f.committed&&f.deactivate(),yr()})}catch(g){u.reject(g),yr()}var f=D;if(o){var d=i.is_rendered();i.update_pending_count(1),f.increment(d),l.get(f)?.reject(ht),l.delete(f),l.set(f,u)}const h=(g,p=void 0)=>{if(f.activate(),p)p!==ht&&(a.f|=We,mt(a,p));else{(a.f&We)!==0&&(a.f^=We),mt(a,g);for(const[_,I]of l){if(l.delete(_),_===f)break;I.reject(ht)}}o&&(i.update_pending_count(-1),f.decrement(d))};u.promise.then(h,g=>h(null,g||"unknown"))}),as(()=>{for(const u of l.values())u.reject(ht)}),new Promise(u=>{function f(d){function h(){d===s?u(a):f(s)}d.then(h,h)}f(s)})}function $e(e){const t=Jt(e);return Hn(t),t}function ts(e){const t=Jt(e);return t.equals=un,t}function yn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Y(t[r])}}function rs(e){for(var t=e.parent;t!==null;){if((t.f&H)===0)return(t.f&Ie)===0?t:null;t=t.parent}return null}function $r(e){var t,r=C;Ae(rs(e));try{e.f&=~et,yn(e),t=Kn(e)}finally{Ae(r)}return t}function $n(e){var t=$r(e);if(!e.equals(t)&&(e.wv=Vn(),(!D?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){N(e,U);return}Ge||(we!==null?(xr()||D?.is_fork)&&we.set(e,t):br(e))}let Sr=new Set;const qe=new Map;let Sn=!1;function nt(e,t){var r={f:0,v:e,reactions:null,equals:cn,rv:0,wv:0};return r}function T(e,t){const r=nt(e);return Hn(r),r}function kn(e,t=!1,r=!0){const n=nt(e);return t||(n.equals=un),n}function m(e,t,r=!1){k!==null&&(!ke||(k.f&an)!==0)&&fn()&&(k.f&(H|Me|vr|an))!==0&&(pe===null||!ut.call(pe,e))&&Ui();let n=r?Pe(t):t;return mt(e,n)}function mt(e,t){if(!e.equals(t)){var r=e.v;Ge?qe.set(e,t):qe.set(e,r),e.v=t;var n=De.ensure();if(n.capture(e,r),(e.f&H)!==0){const i=e;(e.f&W)!==0&&$r(i),br(i)}e.wv=Vn(),En(e,W),C!==null&&(C.f&U)!==0&&(C.f&(_e|Be))===0&&(ve===null?ds([e]):ve.push(e)),!n.is_fork&&Sr.size>0&&!Sn&&ns()}return t}function ns(){Sn=!1;for(const e of Sr)(e.f&U)!==0&&N(e,be),kt(e)&&Et(e);Sr.clear()}function St(e){m(e,e.v+1)}function En(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],a=s.f,o=(a&W)===0;if(o&&N(s,t),(a&H)!==0){var l=s;we?.delete(l),(a&et)===0&&(a&fe&&(s.f|=et),En(l,be))}else o&&((a&Me)!==0&&Le!==null&&Le.add(s),ye(s))}}function Pe(e){if(typeof e!="object"||e===null||Bt in e)return e;const t=tn(e);if(t!==Ei&&t!==xi)return e;var r=new Map,n=en(e),i=T(0),s=at,a=o=>{if(at===s)return o();var l=k,u=at;he(null),qn(s);var f=o();return he(l),qn(u),f};return n&&r.set("length",T(e.length)),new Proxy(e,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Fi();var f=r.get(l);return f===void 0?f=a(()=>{var d=T(u.value);return r.set(l,d),d}):m(f,u.value,!0),!0},deleteProperty(o,l){var u=r.get(l);if(u===void 0){if(l in o){const f=a(()=>T(B));r.set(l,f),St(i)}}else m(u,B),St(i);return!0},get(o,l,u){if(l===Bt)return e;var f=r.get(l),d=l in o;if(f===void 0&&(!d||ft(o,l)?.writable)&&(f=a(()=>{var g=Pe(d?o[l]:B),p=T(g);return p}),r.set(l,f)),f!==void 0){var h=c(f);return h===B?void 0:h}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var f=r.get(l);f&&(u.value=c(f))}else if(u===void 0){var d=r.get(l),h=d?.v;if(d!==void 0&&h!==B)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(o,l){if(l===Bt)return!0;var u=r.get(l),f=u!==void 0&&u.v!==B||Reflect.has(o,l);if(u!==void 0||C!==null&&(!f||ft(o,l)?.writable)){u===void 0&&(u=a(()=>{var h=f?Pe(o[l]):B,g=T(h);return g}),r.set(l,u));var d=c(u);if(d===B)return!1}return f},set(o,l,u,f){var d=r.get(l),h=l in o;if(n&&l==="length")for(var g=u;g<d.v;g+=1){var p=r.get(g+"");p!==void 0?m(p,B):g in o&&(p=a(()=>T(B)),r.set(g+"",p))}if(d===void 0)(!h||ft(o,l)?.writable)&&(d=a(()=>T(void 0)),m(d,Pe(u)),r.set(l,d));else{h=d.v!==B;var _=a(()=>Pe(u));m(d,_)}var I=Reflect.getOwnPropertyDescriptor(o,l);if(I?.set&&I.set.call(f,u),!h){if(n&&typeof l=="string"){var w=r.get("length"),S=Number(l);Number.isInteger(S)&&S>=w.v&&m(w,S+1)}St(i)}return!0},ownKeys(o){c(i);var l=Reflect.ownKeys(o).filter(d=>{var h=r.get(d);return h===void 0||h.v!==B});for(var[u,f]of r)f.v!==B&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Ni()}})}var xn,Cn,An,Tn;function kr(){if(xn===void 0){xn=window,Cn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;An=ft(t,"firstChild").get,Tn=ft(t,"nextSibling").get,rn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),rn(r)&&(r.__t=void 0)}}function Se(e=""){return document.createTextNode(e)}function Ve(e){return An.call(e)}function xe(e){return Tn.call(e)}function M(e,t){if(!x)return Ve(e);var r=Ve(E);if(r===null)r=E.appendChild(Se());else if(t&&r.nodeType!==Ht){var n=Se();return r?.before(n),se(n),n}return t&&Er(r),se(r),r}function zn(e,t=!1){if(!x){var r=Ve(e);return r instanceof Comment&&r.data===""?xe(r):r}if(t){if(E?.nodeType!==Ht){var n=Se();return E?.before(n),se(n),n}Er(E)}return E}function F(e,t=1,r=!1){let n=x?E:e;for(var i;t--;)i=n,n=xe(n);if(!x)return n;if(r){if(n?.nodeType!==Ht){var s=Se();return n===null?i?.after(s):n.before(s),se(s),s}Er(n)}return se(n),n}function Rn(e){e.textContent=""}function Mn(){return!1}function Er(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ht;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function In(e){var t=k,r=C;he(null),Ae(null);try{return e()}finally{he(t),Ae(r)}}function is(e){C===null&&(k===null&&Di(),Oi()),Ge&&Ii()}function ss(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Ce(e,t,r){var n=C;n!==null&&(n.f&ie)!==0&&(e|=ie);var i={ctx:ae,deps:null,nodes:null,f:e|W|fe,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{Et(i),i.f|=jt}catch(o){throw Y(i),o}else t!==null&&ye(i);var s=i;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Qe)===0&&(s=s.first,(e&Me)!==0&&(e&dt)!==0&&s!==null&&(s.f|=dt)),s!==null&&(s.parent=n,n!==null&&ss(s,n),k!==null&&(k.f&H)!==0&&(e&Be)===0)){var a=k;(a.effects??=[]).push(s)}return i}function xr(){return k!==null&&!ke}function as(e){const t=Ce(Ut,null,!1);return N(t,U),t.teardown=e,t}function Yt(e){is();var t=C.f,r=!k&&(t&_e)!==0&&(t&jt)===0;if(r){var n=ae;(n.e??=[]).push(e)}else return On(e)}function On(e){return Ce(Nt|Ai,e,!1)}function os(e){De.ensure();const t=Ce(Be|Qe,e,!0);return()=>{Y(t)}}function ls(e){De.ensure();const t=Ce(Be|Qe,e,!0);return(r={})=>new Promise(n=>{r.outro?it(t,()=>{Y(t),n(void 0)}):(Y(t),n(void 0))})}function Dn(e){return Ce(Nt,e,!1)}function cs(e){return Ce(vr|Qe,e,!0)}function Cr(e,t=0){return Ce(Ut|t,e,!0)}function Q(e,t=[],r=[],n=[]){Xi(n,t,r,i=>{Ce(Ut,()=>e(...i.map(c)),!0)})}function Ar(e,t=0){var r=Ce(Me|t,e,!0);return r}function de(e){return Ce(_e|Qe,e,!0)}function Ln(e){var t=e.teardown;if(t!==null){const r=Ge,n=k;Bn(!0),he(null);try{t.call(null)}finally{Bn(r),he(n)}}}function Pn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const i=r.ac;i!==null&&In(()=>{i.abort(ht)});var n=r.next;(r.f&Be)!==0?r.parent=null:Y(r,t),r=n}}function us(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&_e)===0&&Y(t),t=r}}function Y(e,t=!0){var r=!1;(t||(e.f&on)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(fs(e.nodes.start,e.nodes.end),r=!0),Pn(e,t&&!r),Xt(e,0),N(e,Ie);var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)s.stop();Ln(e);var i=e.parent;i!==null&&i.first!==null&&Fn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function fs(e,t){for(;e!==null;){var r=e===t?null:xe(e);e.remove(),e=r}}function Fn(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 it(e,t,r=!0){var n=[];Nn(e,n,!0);var i=()=>{r&&Y(e),t&&t()},s=n.length;if(s>0){var a=()=>--s||i();for(var o of n)o.out(a)}else i()}function Nn(e,t,r){if((e.f&ie)===0){e.f^=ie;var n=e.nodes&&e.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&t.push(o);for(var i=e.first;i!==null;){var s=i.next,a=(i.f&dt)!==0||(i.f&_e)!==0&&(e.f&Me)!==0;Nn(i,t,a?r:!1),i=s}}}function Tr(e){Un(e,!0)}function Un(e,t){if((e.f&ie)!==0){e.f^=ie,(e.f&U)===0&&(N(e,W),ye(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&dt)!==0||(r.f&_e)!==0;Un(r,i?t:!1),r=n}var s=e.nodes&&e.nodes.t;if(s!==null)for(const a of s)(a.is_global||t)&&a.in()}}function jn(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:xe(r);t.append(r),r=i}}let Zt=!1,Ge=!1;function Bn(e){Ge=e}let k=null,ke=!1;function he(e){k=e}let C=null;function Ae(e){C=e}let pe=null;function Hn(e){k!==null&&(pe===null?pe=[e]:pe.push(e))}let ee=null,le=0,ve=null;function ds(e){ve=e}let Wn=1,st=0,at=st;function qn(e){at=e}function Vn(){return++Wn}function kt(e){var t=e.f;if((t&W)!==0)return!0;if(t&H&&(e.f&=~et),(t&be)!==0){for(var r=e.deps,n=r.length,i=0;i<n;i++){var s=r[i];if(kt(s)&&$n(s),s.wv>e.wv)return!0}(t&fe)!==0&&we===null&&N(e,U)}return!1}function Gn(e,t,r=!0){var n=e.reactions;if(n!==null&&!(pe!==null&&ut.call(pe,e)))for(var i=0;i<n.length;i++){var s=n[i];(s.f&H)!==0?Gn(s,t,!1):t===s&&(r?N(s,W):(s.f&U)!==0&&N(s,be),ye(s))}}function Kn(e){var t=ee,r=le,n=ve,i=k,s=pe,a=ae,o=ke,l=at,u=e.f;ee=null,le=0,ve=null,k=(u&(_e|Be))===0?e:null,pe=null,vt(e.ctx),ke=!1,at=++st,e.ac!==null&&(In(()=>{e.ac.abort(ht)}),e.ac=null);try{e.f|=pr;var f=e.fn,d=f(),h=e.deps,g=D?.is_fork;if(ee!==null){var p;if(g||Xt(e,le),h!==null&&le>0)for(h.length=le+ee.length,p=0;p<ee.length;p++)h[le+p]=ee[p];else e.deps=h=ee;if(xr()&&(e.f&fe)!==0)for(p=le;p<h.length;p++)(h[p].reactions??=[]).push(e)}else!g&&h!==null&&le<h.length&&(Xt(e,le),h.length=le);if(fn()&&ve!==null&&!ke&&h!==null&&(e.f&(H|be|W))===0)for(p=0;p<ve.length;p++)Gn(ve[p],e);if(i!==null&&i!==e){if(st++,i.deps!==null)for(let _=0;_<r;_+=1)i.deps[_].rv=st;if(t!==null)for(const _ of t)_.rv=st;ve!==null&&(n===null?n=ve:n.push(...ve))}return(e.f&We)!==0&&(e.f^=We),d}catch(_){return hn(_)}finally{e.f^=pr,ee=t,le=r,ve=n,k=i,pe=s,vt(a),ke=o,at=l}}function hs(e,t){let r=t.reactions;if(r!==null){var n=Si.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(t.f&H)!==0&&(ee===null||!ut.call(ee,t))){var s=t;(s.f&fe)!==0&&(s.f^=fe,s.f&=~et),br(s),yn(s),Xt(s,0)}}function Xt(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)hs(e,r[n])}function Et(e){var t=e.f;if((t&Ie)===0){N(e,U);var r=C,n=Zt;C=e,Zt=!0;try{(t&(Me|sn))!==0?us(e):Pn(e),Ln(e);var i=Kn(e);e.teardown=typeof i=="function"?i:null,e.wv=Wn;var s;dr&&Wi&&(e.f&W)!==0&&e.deps}finally{Zt=n,C=r}}}function c(e){var t=e.f,r=(t&H)!==0;if(k!==null&&!ke){var n=C!==null&&(C.f&Ie)!==0;if(!n&&(pe===null||!ut.call(pe,e))){var i=k.deps;if((k.f&pr)!==0)e.rv<st&&(e.rv=st,ee===null&&i!==null&&i[le]===e?le++:ee===null?ee=[e]:ee.push(e));else{(k.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[k]:ut.call(s,k)||s.push(k)}}}if(Ge&&qe.has(e))return qe.get(e);if(r){var a=e;if(Ge){var o=a.v;return((a.f&U)===0&&a.reactions!==null||Yn(a))&&(o=$r(a)),qe.set(a,o),o}var l=(a.f&fe)===0&&!ke&&k!==null&&(Zt||(k.f&fe)!==0),u=a.deps===null;kt(a)&&(l&&(a.f|=fe),$n(a)),l&&!u&&Jn(a)}if(we?.has(e))return we.get(e);if((e.f&We)!==0)throw e.v;return e.v}function Jn(e){if(e.deps!==null){e.f|=fe;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&H)!==0&&(t.f&fe)===0&&Jn(t)}}function Yn(e){if(e.v===B)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(qe.has(t)||(t.f&H)!==0&&Yn(t))return!0;return!1}function zr(e){var t=ke;try{return ke=!0,e()}finally{ke=t}}const Zn=new Set,Rr=new Set;function Xn(e){for(var t=0;t<e.length;t++)Zn.add(e[t]);for(var r of Rr)r(e)}let Qn=null;function Qt(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;Qn=e;var a=0,o=Qn===e&&e.__root;if(o){var l=i.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var u=i.indexOf(t);if(u===-1)return;l<=u&&(a=l)}if(s=i[a]||e.target,s!==t){Ft(e,"currentTarget",{configurable:!0,get(){return s||r}});var f=k,d=C;he(null),Ae(null);try{for(var h,g=[];s!==null;){var p=s.assignedSlot||s.parentNode||s.host||null;try{var _=s["__"+n];_!=null&&(!s.disabled||e.target===s)&&_.call(s,e)}catch(I){h?g.push(I):h=I}if(e.cancelBubble||p===t||p===null)break;s=p}if(h){for(let I of g)queueMicrotask(()=>{throw I});throw h}}finally{e.__root=t,delete e.currentTarget,he(f),Ae(d)}}}function ei(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Ke(e,t){var r=C;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function j(e,t){var r=(t&wi)!==0,n=(t&yi)!==0,i,s=!e.startsWith("<!>");return()=>{if(x)return Ke(E,null),E;i===void 0&&(i=ei(s?e:"<!>"+e),r||(i=Ve(i)));var a=n||Cn?document.importNode(i,!0):i.cloneNode(!0);if(r){var o=Ve(a),l=a.lastChild;Ke(o,l)}else Ke(a,a);return a}}function ps(e,t,r="svg"){var n=!e.startsWith("<!>"),i=`<${r}>${n?e:"<!>"+e}</${r}>`,s;return()=>{if(x)return Ke(E,null),E;if(!s){var a=ei(i),o=Ve(a);s=Ve(o)}var l=s.cloneNode(!0);return Ke(l,l),l}}function er(e,t){return ps(e,t,"svg")}function vs(){if(x)return Ke(E,null),E;var e=document.createDocumentFragment(),t=document.createComment(""),r=Se();return e.append(t,r),Ke(t,r),e}function L(e,t){if(x){var r=C;((r.f&jt)===0||r.nodes.end===null)&&(r.nodes.end=E),qt();return}e!==null&&e.before(t)}const gs=["touchstart","touchmove"];function ms(e){return gs.includes(e)}function Je(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function ti(e,t){return ri(e,t)}function _s(e,t){kr(),t.intro=t.intro??!1;const r=t.target,n=x,i=E;try{for(var s=Ve(r);s&&(s.nodeType!==pt||s.data!==Qr);)s=xe(s);if(!s)throw ct;Oe(!0),se(s);const a=ri(e,{...t,anchor:s});return Oe(!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!==ct&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Pi(),kr(),Rn(r),Oe(!1),ti(e,t)}finally{Oe(n),se(i)}}const _t=new Map;function ri(e,{target:t,anchor:r,props:n={},events:i,context:s,intro:a=!0}){kr();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=ms(g);t.addEventListener(g,Qt,{passive:p});var _=_t.get(g);_===void 0?(document.addEventListener(g,Qt,{passive:p}),_t.set(g,1)):_t.set(g,_+1)}}};l(Lt(Zn)),Rr.add(l);var u=void 0,f=ls(()=>{var d=r??t.appendChild(Se());return Yi(d,{pending:()=>{}},h=>{if(s){mr({});var g=ae;g.c=s}if(i&&(n.$$events=i),x&&Ke(h,null),u=e(h,n)||{},x&&(C.nodes.end=E,E===null||E.nodeType!==pt||E.data!==fr))throw Wt(),ct;s&&_r()}),()=>{for(var h of o){t.removeEventListener(h,Qt);var g=_t.get(h);--g===0?(document.removeEventListener(h,Qt),_t.delete(h)):_t.set(h,g)}Rr.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return Mr.set(u,f),u}let Mr=new WeakMap;function bs(e,t){const r=Mr.get(e);return r?(Mr.delete(e),r(t)):Promise.resolve()}class ws{anchor;#e=new Map;#t=new Map;#r=new Map;#a=new Set;#o=!0;constructor(t,r=!0){this.anchor=t,this.#o=r}#i=()=>{var t=D;if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)Tr(n),this.#a.delete(r);else{var i=this.#r.get(r);i&&(this.#t.set(r,i.effect),this.#r.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[s,a]of this.#e){if(this.#e.delete(s),s===t)break;const o=this.#r.get(a);o&&(Y(o.effect),this.#r.delete(a))}for(const[s,a]of this.#t){if(s===r||this.#a.has(s))continue;const o=()=>{if(Array.from(this.#e.values()).includes(s)){var u=document.createDocumentFragment();jn(a,u),u.append(Se()),this.#r.set(s,{effect:a,fragment:u})}else Y(a);this.#a.delete(s),this.#t.delete(s)};this.#o||!n?(this.#a.add(s),it(a,o,!1)):o()}}};#n=t=>{this.#e.delete(t);const r=Array.from(this.#e.values());for(const[n,i]of this.#r)r.includes(n)||(Y(i.effect),this.#r.delete(n))};ensure(t,r){var n=D,i=Mn();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(i){var s=document.createDocumentFragment(),a=Se();s.append(a),this.#r.set(t,{effect:de(()=>r(a)),fragment:s})}else this.#t.set(t,de(()=>r(this.anchor)));if(this.#e.set(n,t),i){for(const[o,l]of this.#t)o===t?n.unskip_effect(l):n.skip_effect(l);for(const[o,l]of this.#r)o===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(this.#i),n.ondiscard(this.#n)}else x&&(this.anchor=E),this.#i()}}function ni(e){ae===null&&Ri(),Yt(()=>{const t=zr(e);if(typeof t=="function")return t})}function q(e,t,r=!1){x&&qt();var n=new ws(e),i=r?dt:0;function s(a,o){if(x){const u=ln(e)===Dt;if(a===u){var l=Vt();se(l),n.anchor=l,Oe(!1),n.ensure(a,o),Oe(!0);return}}n.ensure(a,o)}Ar(()=>{var a=!1;t((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},i)}function ys(e,t,r){for(var n=[],i=t.length,s,a=t.length,o=0;o<i;o++){let d=t[o];it(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=e.outrogroups;Ir(Lt(s.done)),h.delete(s),h.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var u=r,f=u.parentNode;Rn(f),f.append(u),e.items.clear()}Ir(t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function Ir(e,t=!0){for(var r=0;r<e.length;r++)Y(e[r],t)}var ii;function $s(e,t,r,n,i,s=null){var a=e,o=new Map;x&&qt();var l=null,u=ts(()=>{var _=r();return en(_)?_:_==null?[]:Lt(_)}),f,d=!0;function h(){p.fallback=l,Ss(p,f,a,t,n),l!==null&&(f.length===0?(l.f&He)===0?Tr(l):(l.f^=He,Ct(l,null,a)):it(l,()=>{l=null}))}var g=Ar(()=>{f=c(u);var _=f.length;let I=!1;if(x){var w=ln(a)===Dt;w!==(_===0)&&(a=Vt(),se(a),Oe(!1),I=!0)}for(var S=new Set,te=D,K=Mn(),J=0;J<_;J+=1){x&&E.nodeType===pt&&E.data===fr&&(a=E,I=!0,Oe(!1));var Fe=f[J],Te=n(Fe,J),O=d?null:o.get(Te);O?(O.v&&mt(O.v,Fe),O.i&&mt(O.i,J),K&&te.unskip_effect(O.e)):(O=ks(o,d?a:ii??=Se(),Fe,Te,J,i,t,r),d||(O.e.f|=He),o.set(Te,O)),S.add(Te)}if(_===0&&s&&!l&&(d?l=de(()=>s(a)):(l=de(()=>s(ii??=Se())),l.f|=He)),x&&_>0&&se(Vt()),!d)if(K){for(const[wt,Ee]of o)S.has(wt)||te.skip_effect(Ee.e);te.oncommit(h),te.ondiscard(()=>{})}else h();I&&Oe(!0),c(u)}),p={effect:g,items:o,outrogroups:null,fallback:l};d=!1,x&&(a=E)}function xt(e){for(;e!==null&&(e.f&_e)===0;)e=e.next;return e}function Ss(e,t,r,n,i){var s=t.length,a=e.items,o=xt(e.effect.first),l,u=null,f=[],d=[],h,g,p,_;for(_=0;_<s;_+=1){if(h=t[_],g=i(h,_),p=a.get(g).e,e.outrogroups!==null)for(const O of e.outrogroups)O.pending.delete(p),O.done.delete(p);if((p.f&He)!==0)if(p.f^=He,p===o)Ct(p,null,r);else{var I=u?u.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),Ye(e,u,p),Ye(e,p,I),Ct(p,I,r),u=p,f=[],d=[],o=xt(u.next);continue}if((p.f&ie)!==0&&Tr(p),p!==o){if(l!==void 0&&l.has(p)){if(f.length<d.length){var w=d[0],S;u=w.prev;var te=f[0],K=f[f.length-1];for(S=0;S<f.length;S+=1)Ct(f[S],w,r);for(S=0;S<d.length;S+=1)l.delete(d[S]);Ye(e,te.prev,K.next),Ye(e,u,te),Ye(e,K,w),o=w,u=K,_-=1,f=[],d=[]}else l.delete(p),Ct(p,o,r),Ye(e,p.prev,p.next),Ye(e,p,u===null?e.effect.first:u.next),Ye(e,u,p),u=p;continue}for(f=[],d=[];o!==null&&o!==p;)(l??=new Set).add(o),d.push(o),o=xt(o.next);if(o===null)continue}(p.f&He)===0&&f.push(p),u=p,o=xt(p.next)}if(e.outrogroups!==null){for(const O of e.outrogroups)O.pending.size===0&&(Ir(Lt(O.done)),e.outrogroups?.delete(O));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||l!==void 0){var J=[];if(l!==void 0)for(p of l)(p.f&ie)===0&&J.push(p);for(;o!==null;)(o.f&ie)===0&&o!==e.fallback&&J.push(o),o=xt(o.next);var Fe=J.length;if(Fe>0){var Te=null;ys(e,J,Te)}}}function ks(e,t,r,n,i,s,a,o){var l=(a&mi)!==0?(a&bi)===0?kn(r,!1,!1):nt(r):null,u=(a&_i)!==0?nt(i):null;return{v:l,i:u,e:de(()=>(s(t,l??r,u??i,o),()=>{e.delete(n)}))}}function Ct(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,s=t&&(t.f&He)===0?t.nodes.start:r;n!==null;){var a=xe(n);if(s.before(n),n===i)return;n=a}}function Ye(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function si(e,t){Dn(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i)}})}const ai=[...`
3
- \r\f \v\uFEFF`];function Es(e,t,r){var n=e==null?"":""+e;if(r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var o=a+s;(a===0||ai.includes(n[a-1]))&&(o===n.length||ai.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function oi(e,t=!1){var r=t?" !important;":";",n="";for(var i in e){var s=e[i];s!=null&&s!==""&&(n+=" "+i+": "+s+r)}return n}function Or(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function xs(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(Or)),i&&l.push(...Object.keys(i).map(Or));var u=0,f=-1;const _=e.length;for(var d=0;d<_;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):s?s===h&&(s=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?s=h:h==="("?a++:h===")"&&a--,!o&&s===!1&&a===0){if(h===":"&&f===-1)f=d;else if(h===";"||d===_-1){if(f!==-1){var g=Or(e.substring(u,f).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(u,d).trim();r+=" "+p+";"}}u=d+1,f=-1}}}}return n&&(r+=oi(n)),i&&(r+=oi(i,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function bt(e,t,r,n,i,s){var a=e.__className;if(x||a!==r||a===void 0){var o=Es(r,n,s);(!x||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(s&&i!==s)for(var l in s){var u=!!s[l];(i==null||u!==!!i[l])&&e.classList.toggle(l,u)}return s}function Dr(e,t={},r,n){for(var i in r){var s=r[i];t[i]!==s&&(r[i]==null?e.style.removeProperty(i):e.style.setProperty(i,s,n))}}function Lr(e,t,r,n){var i=e.__style;if(x||i!==t){var s=xs(t,n);(!x||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}else n&&(Array.isArray(n)?(Dr(e,r?.[0],n[0]),Dr(e,r?.[1],n[1],"important")):Dr(e,r,n));return n}const Cs=Symbol("is custom element"),As=Symbol("is html");function tr(e,t,r,n){var i=Ts(e);x&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[zi]=r),r==null?e.removeAttribute(t):typeof r!="string"&&zs(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Ts(e){return e.__attributes??={[Cs]:e.nodeName.includes("-"),[As]:e.namespaceURI===$i}}var li=new Map;function zs(e){var t=e.getAttribute("is")||e.nodeName,r=li.get(t);if(r)return r;li.set(t,r=[]);for(var n,i=e,s=Element.prototype;s!==i;){n=ki(i);for(var a in n)n[a].set&&r.push(a);i=tn(i)}return r}function ci(e,t){return e===t||e?.[Bt]===t}function Pr(e={},t,r,n){return Dn(()=>{var i,s;return Cr(()=>{i=s,s=[],zr(()=>{e!==r(...s)&&(t(e,...s),i&&ci(r(...i),e)&&t(null,...i))})}),()=>{rt(()=>{s&&ci(r(...s),e)&&t(null,...s)})}}),e}function Z(e,t,r,n){var i=n,s=!0,a=()=>(s&&(s=!1,i=n),i),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(s=!0,h)};var u=!1,f=Jt(()=>(u=!1,l())),d=C;return(function(h,g){if(arguments.length>0){const p=g?c(f):h;return m(f,p),u=!0,i!==void 0&&(i=p),h}return Ge&&u||(d.f&Ie)!==0?f.v:c(f)})}function Rs(e){return new Ms(e)}class Ms{#e;#t;constructor(t){var r=new Map,n=(s,a)=>{var o=kn(a,!1,!1);return r.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return c(r.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===Ti?!0:(c(r.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return m(r.get(a)??n(a,o),o),Reflect.set(s,a,o)}});this.#t=(t.hydrate?_s:ti)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&G(),this.#e=i.$$events;for(const s of Object.keys(this.#t))s==="$set"||s==="$destroy"||s==="$on"||Ft(this,s,{get(){return this.#t[s]},set(a){this.#t[s]=a},enumerable:!0});this.#t.$set=s=>{Object.assign(i,s)},this.#t.$destroy=()=>{bs(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...i)=>r.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}let ui;typeof HTMLElement=="function"&&(ui=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}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 i=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),L(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=Is(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 i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=rr(i,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=Rs({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=os(()=>{Cr(()=>{this.$$r=!0;for(const n of Pt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=rr(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=rr(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 Pt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function rr(e,t,r,n){const i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){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(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Is(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function fi(e,t,r,n,i,s){let a=class extends ui{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return Pt(t).map(o=>(t[o].attribute||o).toLowerCase())}};return Pt(t).forEach(o=>{Ft(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=rr(o,l,t),this.$$d[o]=l;var u=this.$$c;if(u){var f=ft(u,o)?.get;f?u[o]=l:u.$set({[o]:l})}}})}),n.forEach(o=>{Ft(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const Os=50,At=5;class di{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(i=>this.stringifyArg(i)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>Os&&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,preferCurrentTab:!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,i=n.createMediaStreamDestination(),s=t.getAudioTracks()[0];if(s&&n.createMediaStreamSource(new MediaStream([s])).connect(i),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(i)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=i.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const u=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let f="video/webm";for(const d of u)if(MediaRecorder.isTypeSupported(d)){f=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:f}),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,i=n._originalDisplayStream;if(i)for(const o of i.getTracks())o.stop();const s=n._originalMicStream;if(s)for(const o of s.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(s=>{r.onloadedmetadata=s});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const i=n.getContext("2d");if(!i){for(const s of t.getTracks())s.stop();return null}i.drawImage(r,0,0);for(const s of t.getTracks())s.stop();return new Promise(s=>{n.toBlob(a=>s(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} 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),i={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(i),i}async addBlobAttachment(t,r){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const i=await this.blobToDataUrl(t),s={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:i};return this.attachments.push(s),s}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<At}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 i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Fr=null;function Nr(){return Fr||(Fr=new di),Fr}var Ds=j('<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>'),Ls=j('<span class="unread-badge svelte-1105cax"> </span>'),Ps=er('<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>'),Fs=er('<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>'),Ns=j('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),Us=j('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),js=j('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Bs={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 Es(e,t,r){var n=e==null?"":""+e;if(r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var o=a+s;(a===0||ai.includes(n[a-1]))&&(o===n.length||ai.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function oi(e,t=!1){var r=t?" !important;":";",n="";for(var i in e){var s=e[i];s!=null&&s!==""&&(n+=" "+i+": "+s+r)}return n}function Or(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function xs(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(Or)),i&&l.push(...Object.keys(i).map(Or));var u=0,f=-1;const _=e.length;for(var d=0;d<_;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):s?s===h&&(s=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?s=h:h==="("?a++:h===")"&&a--,!o&&s===!1&&a===0){if(h===":"&&f===-1)f=d;else if(h===";"||d===_-1){if(f!==-1){var g=Or(e.substring(u,f).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(u,d).trim();r+=" "+p+";"}}u=d+1,f=-1}}}}return n&&(r+=oi(n)),i&&(r+=oi(i,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function bt(e,t,r,n,i,s){var a=e.__className;if(x||a!==r||a===void 0){var o=Es(r,n,s);(!x||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=r}else if(s&&i!==s)for(var l in s){var u=!!s[l];(i==null||u!==!!i[l])&&e.classList.toggle(l,u)}return s}function Dr(e,t={},r,n){for(var i in r){var s=r[i];t[i]!==s&&(r[i]==null?e.style.removeProperty(i):e.style.setProperty(i,s,n))}}function Lr(e,t,r,n){var i=e.__style;if(x||i!==t){var s=xs(t,n);(!x||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}else n&&(Array.isArray(n)?(Dr(e,r?.[0],n[0]),Dr(e,r?.[1],n[1],"important")):Dr(e,r,n));return n}const Cs=Symbol("is custom element"),As=Symbol("is html");function tr(e,t,r,n){var i=Ts(e);x&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[zi]=r),r==null?e.removeAttribute(t):typeof r!="string"&&zs(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Ts(e){return e.__attributes??={[Cs]:e.nodeName.includes("-"),[As]:e.namespaceURI===$i}}var li=new Map;function zs(e){var t=e.getAttribute("is")||e.nodeName,r=li.get(t);if(r)return r;li.set(t,r=[]);for(var n,i=e,s=Element.prototype;s!==i;){n=ki(i);for(var a in n)n[a].set&&r.push(a);i=tn(i)}return r}function ci(e,t){return e===t||e?.[Bt]===t}function Pr(e={},t,r,n){return Dn(()=>{var i,s;return Cr(()=>{i=s,s=[],zr(()=>{e!==r(...s)&&(t(e,...s),i&&ci(r(...i),e)&&t(null,...i))})}),()=>{rt(()=>{s&&ci(r(...s),e)&&t(null,...s)})}}),e}function Z(e,t,r,n){var i=n,s=!0,a=()=>(s&&(s=!1,i=n),i),o;o=e[t],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(s=!0,h)};var u=!1,f=Jt(()=>(u=!1,l())),d=C;return(function(h,g){if(arguments.length>0){const p=g?c(f):h;return m(f,p),u=!0,i!==void 0&&(i=p),h}return Ge&&u||(d.f&Ie)!==0?f.v:c(f)})}function Rs(e){return new Ms(e)}class Ms{#e;#t;constructor(t){var r=new Map,n=(s,a)=>{var o=kn(a,!1,!1);return r.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return c(r.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===Ti?!0:(c(r.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return m(r.get(a)??n(a,o),o),Reflect.set(s,a,o)}});this.#t=(t.hydrate?_s:ti)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&G(),this.#e=i.$$events;for(const s of Object.keys(this.#t))s==="$set"||s==="$destroy"||s==="$on"||Ft(this,s,{get(){return this.#t[s]},set(a){this.#t[s]=a},enumerable:!0});this.#t.$set=s=>{Object.assign(i,s)},this.#t.$destroy=()=>{bs(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...i)=>r.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}let ui;typeof HTMLElement=="function"&&(ui=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}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 i=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),L(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=Is(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 i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=rr(i,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=Rs({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=os(()=>{Cr(()=>{this.$$r=!0;for(const n of Pt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=rr(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=rr(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 Pt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function rr(e,t,r,n){const i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){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(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Is(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function fi(e,t,r,n,i,s){let a=class extends ui{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return Pt(t).map(o=>(t[o].attribute||o).toLowerCase())}};return Pt(t).forEach(o=>{Ft(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=rr(o,l,t),this.$$d[o]=l;var u=this.$$c;if(u){var f=ft(u,o)?.get;f?u[o]=l:u.$set({[o]:l})}}})}),n.forEach(o=>{Ft(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const Os=50,At=5;class di{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(i=>this.stringifyArg(i)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(n),this.consoleErrors.length>Os&&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,preferCurrentTab:!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,i=n.createMediaStreamDestination(),s=t.getAudioTracks()[0];if(s&&n.createMediaStreamSource(new MediaStream([s])).connect(i),r){const d=r.getAudioTracks()[0];d&&n.createMediaStreamSource(new MediaStream([d])).connect(i)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=i.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=r,this.mediaStream._audioContext=n;const u=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let f="video/webm";for(const d of u)if(MediaRecorder.isTypeSupported(d)){f=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:f}),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,i=n._originalDisplayStream;if(i)for(const o of i.getTracks())o.stop();const s=n._originalMicStream;if(s)for(const o of s.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(s=>{r.onloadedmetadata=s});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const i=n.getContext("2d");if(!i){for(const s of t.getTracks())s.stop();return null}i.drawImage(r,0,0);for(const s of t.getTracks())s.stop();return new Promise(s=>{n.toBlob(a=>s(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} 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),i={id:this.generateId(),name:t.name,type:r,size:t.size,dataUrl:n};return this.attachments.push(i),i}async addBlobAttachment(t,r){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const i=await this.blobToDataUrl(t),s={id:this.generateId(),name:r,type:n,size:t.size,dataUrl:i};return this.attachments.push(s),s}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<At}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 i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Fr=null;function Nr(){return Fr||(Fr=new di),Fr}var Ds=j('<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>'),Ls=j('<span class="unread-badge svelte-1105cax"> </span>'),Ps=er('<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>'),Fs=er('<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>'),Ns=j('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),Us=j('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),js=j('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Bs={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
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%;
@@ -42,7 +42,7 @@ var FortaleceAI=(function($){"use strict";typeof window<"u"&&((window.__svelte??
42
42
  var(--shadow),
43
43
  0 0 30px rgba(239, 68, 68, 0.6);
44
44
  }
45
- }`};function hi(e,t){mr(t,!0),si(e,Bs);let r=Z(t,"embedId"),n=Z(t,"embedUrl",7,"https://app.fortalece.ai"),i=Z(t,"position",7,"bottom-right"),s=Z(t,"showHeader",7,"true"),a=Z(t,"allowAttachments",7,!0),o=Z(t,"allowScreenRecording",7,!0),l=Z(t,"captureConsoleLogs",7,!0),u=T(!1),f=T(!1),d=T(!1),h=T(0),g=T(!1),p=T(null),_=T("00:00"),I=T(void 0),w=T(null),S=T(Pe([])),te=T(Pe([]));Yt(()=>{if(c(g)&&c(p)!==null){const y=setInterval(()=>{const P=Math.floor((Date.now()-c(p))/1e3),ue=Math.floor(P/60).toString().padStart(2,"0"),ze=(P%60).toString().padStart(2,"0");m(_,`${ue}:${ze}`)},1e3);return()=>clearInterval(y)}});const K=$e(()=>s()==="false"||s()===!1),J=$e(()=>!c(u)||c(K)||!c(f)),Fe=$e(()=>`${n()}/embed/${r()}${c(K)?"?showHeader=false":""}`),Te=$e(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");ni(()=>{m(w,Nr(),!0),l()&&c(w).startConsoleCapture();function y(P){try{const Xe=new URL(n()).origin;if(P.origin!==Xe)return}catch{return}const{type:ue,payload:ze}=P.data||{};switch(ue){case"fortalece:ready":m(f,!0);break;case"fortalece:close-request":m(u,!1);break;case"fortalece:request-context":zt();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Rt();break;case"fortalece:resize":m(d,ze?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ze?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(_,"00:00"),m(u,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(_,"00:00"),m(u,!0);break}}return window.addEventListener("message",y),()=>{window.removeEventListener("message",y),l()&&c(w)&&c(w).stopConsoleCapture()}});function O(){m(u,!c(u)),c(u)&&m(h,0)}function wt(){Ee("fortalece:stop-recording"),m(g,!1),m(p,null),m(_,"00:00")}function Ee(y,P={}){if(c(I)?.contentWindow)try{const ue=new URL(n()).origin;c(I).contentWindow.postMessage({type:y,payload:P},ue)}catch{}}function zt(){if(!c(w))return;const y=c(w).getPageContext();if(Ee("fortalece:page-context",y),l()){const P=c(w).getConsoleErrors();m(te,P,!0),Ee("fortalece:console-logs",{logs:P})}Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(S).length,maxAttachments:5})}function ce(){c(S).forEach(y=>{Ee("fortalece:attachment-added",y)})}function Rt(){c(w)&&(c(w).clearAttachments(),c(w).clearConsoleErrors(),m(S,[],!0),m(te,[],!0),Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Yt(()=>{c(u)&&c(f)&&(Ee("fortalece:opened"),zt(),ce())});var nr={get embedId(){return r()},set embedId(y){r(y),G()},get embedUrl(){return n()},set embedUrl(y="https://app.fortalece.ai"){n(y),G()},get position(){return i()},set position(y="bottom-right"){i(y),G()},get showHeader(){return s()},set showHeader(y="true"){s(y),G()},get allowAttachments(){return a()},set allowAttachments(y=!0){a(y),G()},get allowScreenRecording(){return o()},set allowScreenRecording(y=!0){o(y),G()},get captureConsoleLogs(){return l()},set captureConsoleLogs(y=!0){l(y),G()}},Ze=js(),ir=M(Ze);{var Br=y=>{var P=Ds();P.__click=wt;var ue=F(M(P),2),ze=M(ue,!0);R(ue),gr(2),R(P),Q(()=>Je(ze,c(_))),L(y,P)},Hr=y=>{var P=vs(),ue=zn(P);{var ze=Xe=>{var ot=Ns();ot.__click=O;var It=M(ot);{var qr=ge=>{var Ne=Ls(),v=M(Ne,!0);R(Ne),Q(()=>Je(v,c(h)>9?"9+":c(h))),L(ge,Ne)};q(It,ge=>{c(h)>0&&!c(u)&&ge(qr)})}var cr=F(It,2);{var Vr=ge=>{var Ne=Ps();L(ge,Ne)},Ot=ge=>{var Ne=Fs();L(ge,Ne)};q(cr,ge=>{c(u)?ge(Vr):ge(Ot,!1)})}R(ot),Q(()=>tr(ot,"aria-label",c(u)?"Close chat":"Open chat")),L(Xe,ot)};q(ue,Xe=>{c(J)&&Xe(ze)},!0)}L(y,P)};q(ir,y=>{c(g)?y(Br):y(Hr,!1)})}var yt=F(ir,2);let sr,ar;var or=M(yt);{var Wr=y=>{var P=Us();L(y,P)};q(or,y=>{c(f)||y(Wr)})}var Mt=F(or,2);let lr;return Pr(Mt,y=>m(I,y),()=>c(I)),R(yt),R(Ze),Q(()=>{Lr(Ze,c(Te)),sr=bt(yt,1,"chat-window svelte-1105cax",null,sr,{"chat-window-hidden":!c(u),"chat-window-fullscreen":c(d)}),ar=Lr(yt,"",ar,{bottom:c(d)?void 0:c(J)?"4.5rem":"0"}),tr(Mt,"src",c(Fe)),lr=bt(Mt,1,"svelte-1105cax",null,lr,{hidden:!c(f)})}),L(e,Ze),_r(nr)}Xn(["click"]),customElements.define("support-chat",fi(hi,{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"}},[],[],{mode:"open"}));var Hs=j('<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>'),Ws=j('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),qs=j('<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),Vs=j('<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>'),Gs=j('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),Ks=j('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),Js=j('<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>'),Ys=er('<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>'),Zs=er('<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>'),Xs=j('<button class="toggle-btn svelte-p7nz7"><!></button>'),Qs=j('<span class="badge svelte-p7nz7"> </span>'),ea=j('<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>'),ta=j('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),ra=j('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox" allow="clipboard-write; display-capture; microphone"></iframe></div>'),na=j('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const ia={hash:"svelte-p7nz7",code:`
45
+ }`};function hi(e,t){mr(t,!0),si(e,Bs);let r=Z(t,"embedId"),n=Z(t,"embedUrl",7,"https://app.fortalece.ai"),i=Z(t,"position",7,"bottom-right"),s=Z(t,"showHeader",7,"true"),a=Z(t,"allowAttachments",7,!0),o=Z(t,"allowScreenRecording",7,!0),l=Z(t,"captureConsoleLogs",7,!0),u=T(!1),f=T(!1),d=T(!1),h=T(0),g=T(!1),p=T(null),_=T("00:00"),I=T(void 0),w=T(null),S=T(Pe([])),te=T(Pe([]));Yt(()=>{if(c(g)&&c(p)!==null){const y=setInterval(()=>{const P=Math.floor((Date.now()-c(p))/1e3),ue=Math.floor(P/60).toString().padStart(2,"0"),ze=(P%60).toString().padStart(2,"0");m(_,`${ue}:${ze}`)},1e3);return()=>clearInterval(y)}});const K=$e(()=>s()==="false"||s()===!1),J=$e(()=>!c(u)||c(K)||!c(f)),Fe=$e(()=>`${n()}/embed/${r()}${c(K)?"?showHeader=false":""}`),Te=$e(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");ni(()=>{m(w,Nr(),!0),l()&&c(w).startConsoleCapture();function y(P){try{const Xe=new URL(n()).origin;if(P.origin!==Xe)return}catch{return}const{type:ue,payload:ze}=P.data||{};switch(ue){case"fortalece:ready":m(f,!0);break;case"fortalece:close-request":m(u,!1);break;case"fortalece:request-context":zt();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Rt();break;case"fortalece:resize":m(d,ze?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ze?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(_,"00:00"),m(u,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(_,"00:00"),m(u,!0);break}}return window.addEventListener("message",y),()=>{window.removeEventListener("message",y),l()&&c(w)&&c(w).stopConsoleCapture()}});function O(){m(u,!c(u)),c(u)&&m(h,0)}function wt(){Ee("fortalece:stop-recording"),m(g,!1),m(p,null),m(_,"00:00")}function Ee(y,P={}){if(c(I)?.contentWindow)try{const ue=new URL(n()).origin;c(I).contentWindow.postMessage({type:y,payload:P},ue)}catch{}}function zt(){if(!c(w))return;const y=c(w).getPageContext();if(Ee("fortalece:page-context",y),l()){const P=c(w).getConsoleErrors();m(te,P,!0),Ee("fortalece:console-logs",{logs:P})}Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(S).length,maxAttachments:5})}function ce(){c(S).forEach(y=>{Ee("fortalece:attachment-added",y)})}function Rt(){c(w)&&(c(w).clearAttachments(),c(w).clearConsoleErrors(),m(S,[],!0),m(te,[],!0),Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Yt(()=>{c(u)&&c(f)&&(Ee("fortalece:opened"),zt(),ce())});var nr={get embedId(){return r()},set embedId(y){r(y),G()},get embedUrl(){return n()},set embedUrl(y="https://app.fortalece.ai"){n(y),G()},get position(){return i()},set position(y="bottom-right"){i(y),G()},get showHeader(){return s()},set showHeader(y="true"){s(y),G()},get allowAttachments(){return a()},set allowAttachments(y=!0){a(y),G()},get allowScreenRecording(){return o()},set allowScreenRecording(y=!0){o(y),G()},get captureConsoleLogs(){return l()},set captureConsoleLogs(y=!0){l(y),G()}},Ze=js(),ir=M(Ze);{var Br=y=>{var P=Ds();P.__click=wt;var ue=F(M(P),2),ze=M(ue,!0);R(ue),gr(2),R(P),Q(()=>Je(ze,c(_))),L(y,P)},Hr=y=>{var P=vs(),ue=zn(P);{var ze=Xe=>{var ot=Ns();ot.__click=O;var It=M(ot);{var qr=ge=>{var Ne=Ls(),v=M(Ne,!0);R(Ne),Q(()=>Je(v,c(h)>9?"9+":c(h))),L(ge,Ne)};q(It,ge=>{c(h)>0&&!c(u)&&ge(qr)})}var cr=F(It,2);{var Vr=ge=>{var Ne=Ps();L(ge,Ne)},Ot=ge=>{var Ne=Fs();L(ge,Ne)};q(cr,ge=>{c(u)?ge(Vr):ge(Ot,!1)})}R(ot),Q(()=>tr(ot,"aria-label",c(u)?"Close chat":"Open chat")),L(Xe,ot)};q(ue,Xe=>{c(J)&&Xe(ze)},!0)}L(y,P)};q(ir,y=>{c(g)?y(Br):y(Hr,!1)})}var yt=F(ir,2);let sr,ar;var or=M(yt);{var Wr=y=>{var P=Us();L(y,P)};q(or,y=>{c(f)||y(Wr)})}var Mt=F(or,2);let lr;return Pr(Mt,y=>m(I,y),()=>c(I)),R(yt),R(Ze),Q(()=>{Lr(Ze,c(Te)),sr=bt(yt,1,"chat-window svelte-1105cax",null,sr,{"chat-window-hidden":!c(u),"chat-window-fullscreen":c(d)}),ar=Lr(yt,"",ar,{bottom:c(d)?void 0:c(J)?"4.5rem":"0"}),tr(Mt,"src",c(Fe)),lr=bt(Mt,1,"svelte-1105cax",null,lr,{hidden:!c(f)})}),L(e,Ze),_r(nr)}Xn(["click"]),customElements.define("support-chat",fi(hi,{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"}},[],[],{mode:"open"}));var Hs=j('<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>'),Ws=j('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),qs=j('<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),Vs=j('<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>'),Gs=j('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),Ks=j('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),Js=j('<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>'),Ys=er('<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>'),Zs=er('<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>'),Xs=j('<button class="toggle-btn svelte-p7nz7"><!></button>'),Qs=j('<span class="badge svelte-p7nz7"> </span>'),ea=j('<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>'),ta=j('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),ra=j('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation" allow="clipboard-write; display-capture; microphone"></iframe></div>'),na=j('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const ia={hash:"svelte-p7nz7",code:`
46
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),
47
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,
48
48
  "Helvetica Neue", Arial, sans-serif;}