jat-feedback 3.3.0 → 3.3.1
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/dist/jat-feedback.js +6 -6
- package/dist/jat-feedback.mjs +123 -120
- package/package.json +1 -1
package/dist/jat-feedback.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var eo=Object.defineProperty;var Mr=Ke=>{throw TypeError(Ke)};var to=(Ke,Je,lt)=>Je in Ke?eo(Ke,Je,{enumerable:!0,configurable:!0,writable:!0,value:lt}):Ke[Je]=lt;var Ie=(Ke,Je,lt)=>to(Ke,typeof Je!="symbol"?Je+"":Je,lt),br=(Ke,Je,lt)=>Je.has(Ke)||Mr("Cannot "+lt);var U=(Ke,Je,lt)=>(br(Ke,Je,"read from private field"),lt?lt.call(Ke):Je.get(Ke)),ze=(Ke,Je,lt)=>Je.has(Ke)?Mr("Cannot add the same private member more than once"):Je instanceof WeakSet?Je.add(Ke):Je.set(Ke,lt),$e=(Ke,Je,lt,Ht)=>(br(Ke,Je,"write to private field"),Ht?Ht.call(Ke,lt):Je.set(Ke,lt),lt),vt=(Ke,Je,lt)=>(br(Ke,Je,"access private method"),lt);(function(){"use strict";var Ke,Je,lt,Ht,yn,ln,wn,Mn,zn,cn,qt,xn,Pt,yr,wr,zr,It,On,Zt,dn,Bt,$t,St,Ut,Yt,tn,un,Kt,En,fn,Sn,kn,Xt,qn,ct,Or,Dr,xr,or,sr,Er,Sr,kr,zt,jt,Tt,pn,Dn,Ln,Yn,Jt,Mt,Cr;const PUBLIC_VERSION="5";typeof window<"u"&&((Ke=window.__svelte??(window.__svelte={})).v??(Ke.v=new Set)).add("5");const EACH_ITEM_REACTIVE=1,EACH_INDEX_REACTIVE=2,EACH_IS_CONTROLLED=4,EACH_IS_ANIMATED=8,EACH_ITEM_IMMUTABLE=16,PROPS_IS_IMMUTABLE=1,PROPS_IS_UPDATED=4,PROPS_IS_BINDABLE=8,PROPS_IS_LAZY_INITIAL=16,TRANSITION_GLOBAL=4,TEMPLATE_FRAGMENT=1,TEMPLATE_USE_IMPORT_NODE=2,HYDRATION_START="[",HYDRATION_START_ELSE="[!",HYDRATION_END="]",HYDRATION_ERROR={},UNINITIALIZED=Symbol(),NAMESPACE_HTML="http://www.w3.org/1999/xhtml",DEV=!1;var is_array=Array.isArray,index_of=Array.prototype.indexOf,includes=Array.prototype.includes,array_from=Array.from,object_keys=Object.keys,define_property=Object.defineProperty,get_descriptor=Object.getOwnPropertyDescriptor,get_descriptors=Object.getOwnPropertyDescriptors,object_prototype=Object.prototype,array_prototype=Array.prototype,get_prototype_of=Object.getPrototypeOf,is_extensible=Object.isExtensible;function is_function(d){return typeof d=="function"}const noop=()=>{};function run_all(d){for(var p=0;p<d.length;p++)d[p]()}function deferred(){var d,p,h=new Promise((g,m)=>{d=g,p=m});return{promise:h,resolve:d,reject:p}}const DERIVED=2,EFFECT=4,RENDER_EFFECT=8,MANAGED_EFFECT=1<<24,BLOCK_EFFECT=16,BRANCH_EFFECT=32,ROOT_EFFECT=64,BOUNDARY_EFFECT=128,CONNECTED=512,CLEAN=1024,DIRTY=2048,MAYBE_DIRTY=4096,INERT=8192,DESTROYED=16384,REACTION_RAN=32768,EFFECT_TRANSPARENT=65536,EAGER_EFFECT=1<<17,HEAD_EFFECT=1<<18,EFFECT_PRESERVED=1<<19,USER_EFFECT=1<<20,EFFECT_OFFSCREEN=1<<25,WAS_MARKED=65536,REACTION_IS_UPDATING=1<<21,ASYNC=1<<22,ERROR_VALUE=1<<23,STATE_SYMBOL=Symbol("$state"),LEGACY_PROPS=Symbol("legacy props"),LOADING_ATTR_SYMBOL=Symbol(""),STALE_REACTION=new class extends Error{constructor(){super(...arguments);Ie(this,"name","StaleReactionError");Ie(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},IS_XHTML=((lt=(Je=globalThis.document)==null?void 0:Je.contentType)==null?void 0:lt.includes("xml"))??!1,TEXT_NODE=3,COMMENT_NODE=8;function lifecycle_outside_component(d){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function async_derived_orphan(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function each_key_duplicate(d,p,h){throw new Error("https://svelte.dev/e/each_key_duplicate")}function effect_in_teardown(d){throw new Error("https://svelte.dev/e/effect_in_teardown")}function effect_in_unowned_derived(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function effect_orphan(d){throw new Error("https://svelte.dev/e/effect_orphan")}function effect_update_depth_exceeded(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function hydration_failed(){throw new Error("https://svelte.dev/e/hydration_failed")}function props_invalid_value(d){throw new Error("https://svelte.dev/e/props_invalid_value")}function state_descriptors_fixed(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function state_prototype_fixed(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function state_unsafe_mutation(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function svelte_boundary_reset_onerror(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function hydration_mismatch(d){console.warn("https://svelte.dev/e/hydration_mismatch")}function select_multiple_invalid_value(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function svelte_boundary_reset_noop(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let hydrating=!1;function set_hydrating(d){hydrating=d}let hydrate_node;function set_hydrate_node(d){if(d===null)throw hydration_mismatch(),HYDRATION_ERROR;return hydrate_node=d}function hydrate_next(){return set_hydrate_node(get_next_sibling(hydrate_node))}function reset(d){if(hydrating){if(get_next_sibling(hydrate_node)!==null)throw hydration_mismatch(),HYDRATION_ERROR;hydrate_node=d}}function next(d=1){if(hydrating){for(var p=d,h=hydrate_node;p--;)h=get_next_sibling(h);hydrate_node=h}}function skip_nodes(d=!0){for(var p=0,h=hydrate_node;;){if(h.nodeType===COMMENT_NODE){var g=h.data;if(g===HYDRATION_END){if(p===0)return h;p-=1}else(g===HYDRATION_START||g===HYDRATION_START_ELSE||g[0]==="["&&!isNaN(Number(g.slice(1))))&&(p+=1)}var m=get_next_sibling(h);d&&h.remove(),h=m}}function read_hydration_instruction(d){if(!d||d.nodeType!==COMMENT_NODE)throw hydration_mismatch(),HYDRATION_ERROR;return d.data}function equals(d){return d===this.v}function safe_not_equal(d,p){return d!=d?p==p:d!==p||d!==null&&typeof d=="object"||typeof d=="function"}function safe_equals(d){return!safe_not_equal(d,this.v)}let tracing_mode_flag=!1,component_context=null;function set_component_context(d){component_context=d}function push(d,p=!1,h){component_context={p:component_context,i:!1,c:null,e:null,s:d,x:null,l:null}}function pop(d){var p=component_context,h=p.e;if(h!==null){p.e=null;for(var g of h)create_user_effect(g)}return d!==void 0&&(p.x=d),p.i=!0,component_context=p.p,d??{}}function is_runes(){return!0}let micro_tasks=[];function run_micro_tasks(){var d=micro_tasks;micro_tasks=[],run_all(d)}function queue_micro_task(d){if(micro_tasks.length===0&&!is_flushing_sync){var p=micro_tasks;queueMicrotask(()=>{p===micro_tasks&&run_micro_tasks()})}micro_tasks.push(d)}function flush_tasks(){for(;micro_tasks.length>0;)run_micro_tasks()}function handle_error(d){var p=active_effect;if(p===null)return active_reaction.f|=ERROR_VALUE,d;if((p.f&REACTION_RAN)===0&&(p.f&EFFECT)===0)throw d;invoke_error_boundary(d,p)}function invoke_error_boundary(d,p){for(;p!==null;){if((p.f&BOUNDARY_EFFECT)!==0){if((p.f&REACTION_RAN)===0)throw d;try{p.b.error(d);return}catch(h){d=h}}p=p.parent}throw d}const STATUS_MASK=-7169;function set_signal_status(d,p){d.f=d.f&STATUS_MASK|p}function update_derived_status(d){(d.f&CONNECTED)!==0||d.deps===null?set_signal_status(d,CLEAN):set_signal_status(d,MAYBE_DIRTY)}function clear_marked(d){if(d!==null)for(const p of d)(p.f&DERIVED)===0||(p.f&WAS_MARKED)===0||(p.f^=WAS_MARKED,clear_marked(p.deps))}function defer_effect(d,p,h){(d.f&DIRTY)!==0?p.add(d):(d.f&MAYBE_DIRTY)!==0&&h.add(d),clear_marked(d.deps),set_signal_status(d,CLEAN)}const batches=new Set;let current_batch=null,previous_batch=null,batch_values=null,queued_root_effects=[],last_scheduled_effect=null,is_flushing=!1,is_flushing_sync=!1;const ir=class ir{constructor(){ze(this,Pt);Ie(this,"committed",!1);Ie(this,"current",new Map);Ie(this,"previous",new Map);ze(this,Ht,new Set);ze(this,yn,new Set);ze(this,ln,0);ze(this,wn,0);ze(this,Mn,null);ze(this,zn,new Set);ze(this,cn,new Set);ze(this,qt,new Map);Ie(this,"is_fork",!1);ze(this,xn,!1)}is_deferred(){return this.is_fork||U(this,wn)>0}skip_effect(p){U(this,qt).has(p)||U(this,qt).set(p,{d:[],m:[]})}unskip_effect(p){var h=U(this,qt).get(p);if(h){U(this,qt).delete(p);for(var g of h.d)set_signal_status(g,DIRTY),schedule_effect(g);for(g of h.m)set_signal_status(g,MAYBE_DIRTY),schedule_effect(g)}}process(p){var m;queued_root_effects=[],this.apply();var h=[],g=[];for(const _ of p)vt(this,Pt,yr).call(this,_,h,g);if(this.is_deferred()){vt(this,Pt,wr).call(this,g),vt(this,Pt,wr).call(this,h);for(const[_,b]of U(this,qt))reset_branch(_,b)}else{for(const _ of U(this,Ht))_();U(this,Ht).clear(),U(this,ln)===0&&vt(this,Pt,zr).call(this),previous_batch=this,current_batch=null,flush_queued_effects(g),flush_queued_effects(h),previous_batch=null,(m=U(this,Mn))==null||m.resolve()}batch_values=null}capture(p,h){h!==UNINITIALIZED&&!this.previous.has(p)&&this.previous.set(p,h),(p.f&ERROR_VALUE)===0&&(this.current.set(p,p.v),batch_values==null||batch_values.set(p,p.v))}activate(){current_batch=this,this.apply()}deactivate(){current_batch===this&&(current_batch=null,batch_values=null)}flush(){if(this.activate(),queued_root_effects.length>0){if(flush_effects(),current_batch!==null&¤t_batch!==this)return}else U(this,ln)===0&&this.process([]);this.deactivate()}discard(){for(const p of U(this,yn))p(this);U(this,yn).clear()}increment(p){$e(this,ln,U(this,ln)+1),p&&$e(this,wn,U(this,wn)+1)}decrement(p){$e(this,ln,U(this,ln)-1),p&&$e(this,wn,U(this,wn)-1),!U(this,xn)&&($e(this,xn,!0),queue_micro_task(()=>{$e(this,xn,!1),this.is_deferred()?queued_root_effects.length>0&&this.flush():this.revive()}))}revive(){for(const p of U(this,zn))U(this,cn).delete(p),set_signal_status(p,DIRTY),schedule_effect(p);for(const p of U(this,cn))set_signal_status(p,MAYBE_DIRTY),schedule_effect(p);this.flush()}oncommit(p){U(this,Ht).add(p)}ondiscard(p){U(this,yn).add(p)}settled(){return(U(this,Mn)??$e(this,Mn,deferred())).promise}static ensure(){if(current_batch===null){const p=current_batch=new ir;batches.add(current_batch),is_flushing_sync||queue_micro_task(()=>{current_batch===p&&p.flush()})}return current_batch}apply(){}};Ht=new WeakMap,yn=new WeakMap,ln=new WeakMap,wn=new WeakMap,Mn=new WeakMap,zn=new WeakMap,cn=new WeakMap,qt=new WeakMap,xn=new WeakMap,Pt=new WeakSet,yr=function(p,h,g){p.f^=CLEAN;for(var m=p.first,_=null;m!==null;){var b=m.f,y=(b&(BRANCH_EFFECT|ROOT_EFFECT))!==0,w=y&&(b&CLEAN)!==0,x=w||(b&INERT)!==0||U(this,qt).has(m);if(!x&&m.fn!==null){y?m.f^=CLEAN:_!==null&&(b&(EFFECT|RENDER_EFFECT|MANAGED_EFFECT))!==0?_.b.defer_effect(m):(b&EFFECT)!==0?h.push(m):is_dirty(m)&&((b&BLOCK_EFFECT)!==0&&U(this,cn).add(m),update_effect(m));var E=m.first;if(E!==null){m=E;continue}}var S=m.parent;for(m=m.next;m===null&&S!==null;)S===_&&(_=null),m=S.next,S=S.parent}},wr=function(p){for(var h=0;h<p.length;h+=1)defer_effect(p[h],U(this,zn),U(this,cn))},zr=function(){var m;if(batches.size>1){this.previous.clear();var p=batch_values,h=!0;for(const _ of batches){if(_===this){h=!1;continue}const b=[];for(const[w,x]of this.current){if(_.current.has(w))if(h&&x!==_.current.get(w))_.current.set(w,x);else continue;b.push(w)}if(b.length===0)continue;const y=[..._.current.keys()].filter(w=>!this.current.has(w));if(y.length>0){var g=queued_root_effects;queued_root_effects=[];const w=new Set,x=new Map;for(const E of b)mark_effects(E,y,w,x);if(queued_root_effects.length>0){current_batch=_,_.apply();for(const E of queued_root_effects)vt(m=_,Pt,yr).call(m,E,[],[]);_.deactivate()}queued_root_effects=g}}current_batch=null,batch_values=p}this.committed=!0,batches.delete(this)};let Batch=ir;function flushSync(d){var p=is_flushing_sync;is_flushing_sync=!0;try{for(var h;;){if(flush_tasks(),queued_root_effects.length===0&&(current_batch==null||current_batch.flush(),queued_root_effects.length===0))return last_scheduled_effect=null,h;flush_effects()}}finally{is_flushing_sync=p}}function flush_effects(){is_flushing=!0;var d=null;try{for(var p=0;queued_root_effects.length>0;){var h=Batch.ensure();if(p++>1e3){var g,m;infinite_loop_guard()}h.process(queued_root_effects),old_values.clear()}}finally{queued_root_effects=[],is_flushing=!1,last_scheduled_effect=null}}function infinite_loop_guard(){try{effect_update_depth_exceeded()}catch(d){invoke_error_boundary(d,last_scheduled_effect)}}let eager_block_effects=null;function flush_queued_effects(d){var p=d.length;if(p!==0){for(var h=0;h<p;){var g=d[h++];if((g.f&(DESTROYED|INERT))===0&&is_dirty(g)&&(eager_block_effects=new Set,update_effect(g),g.deps===null&&g.first===null&&g.nodes===null&&g.teardown===null&&g.ac===null&&unlink_effect(g),(eager_block_effects==null?void 0:eager_block_effects.size)>0)){old_values.clear();for(const m of eager_block_effects){if((m.f&(DESTROYED|INERT))!==0)continue;const _=[m];let b=m.parent;for(;b!==null;)eager_block_effects.has(b)&&(eager_block_effects.delete(b),_.push(b)),b=b.parent;for(let y=_.length-1;y>=0;y--){const w=_[y];(w.f&(DESTROYED|INERT))===0&&update_effect(w)}}eager_block_effects.clear()}}eager_block_effects=null}}function mark_effects(d,p,h,g){if(!h.has(d)&&(h.add(d),d.reactions!==null))for(const m of d.reactions){const _=m.f;(_&DERIVED)!==0?mark_effects(m,p,h,g):(_&(ASYNC|BLOCK_EFFECT))!==0&&(_&DIRTY)===0&&depends_on(m,p,g)&&(set_signal_status(m,DIRTY),schedule_effect(m))}}function depends_on(d,p,h){const g=h.get(d);if(g!==void 0)return g;if(d.deps!==null)for(const m of d.deps){if(includes.call(p,m))return!0;if((m.f&DERIVED)!==0&&depends_on(m,p,h))return h.set(m,!0),!0}return h.set(d,!1),!1}function schedule_effect(d){for(var p=last_scheduled_effect=d;p.parent!==null;){p=p.parent;var h=p.f;if(is_flushing&&p===active_effect&&(h&BLOCK_EFFECT)!==0&&(h&HEAD_EFFECT)===0)return;if((h&(ROOT_EFFECT|BRANCH_EFFECT))!==0){if((h&CLEAN)===0)return;p.f^=CLEAN}}queued_root_effects.push(p)}function reset_branch(d,p){if(!((d.f&BRANCH_EFFECT)!==0&&(d.f&CLEAN)!==0)){(d.f&DIRTY)!==0?p.d.push(d):(d.f&MAYBE_DIRTY)!==0&&p.m.push(d),set_signal_status(d,CLEAN);for(var h=d.first;h!==null;)reset_branch(h,p),h=h.next}}function createSubscriber(d){let p=0,h=source(0),g;return()=>{effect_tracking()&&(get(h),render_effect(()=>(p===0&&(g=untrack(()=>d(()=>increment(h)))),p+=1,()=>{queue_micro_task(()=>{p-=1,p===0&&(g==null||g(),g=void 0,increment(h))})})))}}var flags=EFFECT_TRANSPARENT|EFFECT_PRESERVED|BOUNDARY_EFFECT;function boundary(d,p,h){new Boundary(d,p,h)}class Boundary{constructor(p,h,g){ze(this,ct);Ie(this,"parent");Ie(this,"is_pending",!1);ze(this,It);ze(this,On,hydrating?hydrate_node:null);ze(this,Zt);ze(this,dn);ze(this,Bt);ze(this,$t,null);ze(this,St,null);ze(this,Ut,null);ze(this,Yt,null);ze(this,tn,null);ze(this,un,0);ze(this,Kt,0);ze(this,En,!1);ze(this,fn,!1);ze(this,Sn,new Set);ze(this,kn,new Set);ze(this,Xt,null);ze(this,qn,createSubscriber(()=>($e(this,Xt,source(U(this,un))),()=>{$e(this,Xt,null)})));$e(this,It,p),$e(this,Zt,h),$e(this,dn,g),this.parent=active_effect.b,this.is_pending=!!U(this,Zt).pending,$e(this,Bt,block(()=>{if(active_effect.b=this,hydrating){const _=U(this,On);hydrate_next(),_.nodeType===COMMENT_NODE&&_.data===HYDRATION_START_ELSE?vt(this,ct,Dr).call(this):(vt(this,ct,Or).call(this),U(this,Kt)===0&&(this.is_pending=!1))}else{var m=vt(this,ct,xr).call(this);try{$e(this,$t,branch(()=>g(m)))}catch(_){this.error(_)}U(this,Kt)>0?vt(this,ct,sr).call(this):this.is_pending=!1}return()=>{var _;(_=U(this,tn))==null||_.remove()}},flags)),hydrating&&$e(this,It,hydrate_node)}defer_effect(p){defer_effect(p,U(this,Sn),U(this,kn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!U(this,Zt).pending}update_pending_count(p){vt(this,ct,Er).call(this,p),$e(this,un,U(this,un)+p),!(!U(this,Xt)||U(this,En))&&($e(this,En,!0),queue_micro_task(()=>{$e(this,En,!1),U(this,Xt)&&internal_set(U(this,Xt),U(this,un))}))}get_effect_pending(){return U(this,qn).call(this),get(U(this,Xt))}error(p){var h=U(this,Zt).onerror;let g=U(this,Zt).failed;if(U(this,fn)||!h&&!g)throw p;U(this,$t)&&(destroy_effect(U(this,$t)),$e(this,$t,null)),U(this,St)&&(destroy_effect(U(this,St)),$e(this,St,null)),U(this,Ut)&&(destroy_effect(U(this,Ut)),$e(this,Ut,null)),hydrating&&(set_hydrate_node(U(this,On)),next(),set_hydrate_node(skip_nodes()));var m=!1,_=!1;const b=()=>{if(m){svelte_boundary_reset_noop();return}m=!0,_&&svelte_boundary_reset_onerror(),Batch.ensure(),$e(this,un,0),U(this,Ut)!==null&&pause_effect(U(this,Ut),()=>{$e(this,Ut,null)}),this.is_pending=this.has_pending_snippet(),$e(this,$t,vt(this,ct,or).call(this,()=>($e(this,fn,!1),branch(()=>U(this,dn).call(this,U(this,It)))))),U(this,Kt)>0?vt(this,ct,sr).call(this):this.is_pending=!1};queue_micro_task(()=>{try{_=!0,h==null||h(p,b),_=!1}catch(y){invoke_error_boundary(y,U(this,Bt)&&U(this,Bt).parent)}g&&$e(this,Ut,vt(this,ct,or).call(this,()=>{Batch.ensure(),$e(this,fn,!0);try{return branch(()=>{g(U(this,It),()=>p,()=>b)})}catch(y){return invoke_error_boundary(y,U(this,Bt).parent),null}finally{$e(this,fn,!1)}}))})}}It=new WeakMap,On=new WeakMap,Zt=new WeakMap,dn=new WeakMap,Bt=new WeakMap,$t=new WeakMap,St=new WeakMap,Ut=new WeakMap,Yt=new WeakMap,tn=new WeakMap,un=new WeakMap,Kt=new WeakMap,En=new WeakMap,fn=new WeakMap,Sn=new WeakMap,kn=new WeakMap,Xt=new WeakMap,qn=new WeakMap,ct=new WeakSet,Or=function(){try{$e(this,$t,branch(()=>U(this,dn).call(this,U(this,It))))}catch(p){this.error(p)}},Dr=function(){const p=U(this,Zt).pending;p&&($e(this,St,branch(()=>p(U(this,It)))),queue_micro_task(()=>{var h=vt(this,ct,xr).call(this);$e(this,$t,vt(this,ct,or).call(this,()=>(Batch.ensure(),branch(()=>U(this,dn).call(this,h))))),U(this,Kt)>0?vt(this,ct,sr).call(this):(pause_effect(U(this,St),()=>{$e(this,St,null)}),this.is_pending=!1)}))},xr=function(){var p=U(this,It);return this.is_pending&&($e(this,tn,create_text()),U(this,It).before(U(this,tn)),p=U(this,tn)),p},or=function(p){var h=active_effect,g=active_reaction,m=component_context;set_active_effect(U(this,Bt)),set_active_reaction(U(this,Bt)),set_component_context(U(this,Bt).ctx);try{return p()}catch(_){return handle_error(_),null}finally{set_active_effect(h),set_active_reaction(g),set_component_context(m)}},sr=function(){const p=U(this,Zt).pending;U(this,$t)!==null&&($e(this,Yt,document.createDocumentFragment()),U(this,Yt).append(U(this,tn)),move_effect(U(this,$t),U(this,Yt))),U(this,St)===null&&$e(this,St,branch(()=>p(U(this,It))))},Er=function(p){var h;if(!this.has_pending_snippet()){this.parent&&vt(h=this.parent,ct,Er).call(h,p);return}if($e(this,Kt,U(this,Kt)+p),U(this,Kt)===0){this.is_pending=!1;for(const g of U(this,Sn))set_signal_status(g,DIRTY),schedule_effect(g);for(const g of U(this,kn))set_signal_status(g,MAYBE_DIRTY),schedule_effect(g);U(this,Sn).clear(),U(this,kn).clear(),U(this,St)&&pause_effect(U(this,St),()=>{$e(this,St,null)}),U(this,Yt)&&(U(this,It).before(U(this,Yt)),$e(this,Yt,null))}};function flatten(d,p,h,g){const m=derived;var _=d.filter(k=>!k.settled);if(h.length===0&&_.length===0){g(p.map(m));return}var b=current_batch,y=active_effect,w=capture(),x=_.length===1?_[0].promise:_.length>1?Promise.all(_.map(k=>k.promise)):null;function E(k){w();try{g(k)}catch(I){(y.f&DESTROYED)===0&&invoke_error_boundary(I,y)}b==null||b.deactivate(),unset_context()}if(h.length===0){x.then(()=>E(p.map(m)));return}function S(){w(),Promise.all(h.map(k=>async_derived(k))).then(k=>E([...p.map(m),...k])).catch(k=>invoke_error_boundary(k,y))}x?x.then(S):S()}function capture(){var d=active_effect,p=active_reaction,h=component_context,g=current_batch;return function(_=!0){set_active_effect(d),set_active_reaction(p),set_component_context(h),_&&(g==null||g.activate())}}function unset_context(){set_active_effect(null),set_active_reaction(null),set_component_context(null)}function derived(d){var p=DERIVED|DIRTY,h=active_reaction!==null&&(active_reaction.f&DERIVED)!==0?active_reaction:null;return active_effect!==null&&(active_effect.f|=EFFECT_PRESERVED),{ctx:component_context,deps:null,effects:null,equals,f:p,fn:d,reactions:null,rv:0,v:UNINITIALIZED,wv:0,parent:h??active_effect,ac:null}}function async_derived(d,p,h){let g=active_effect;g===null&&async_derived_orphan();var m=g.b,_=void 0,b=source(UNINITIALIZED),y=!active_reaction,w=new Map;return async_effect(()=>{var I;var x=deferred();_=x.promise;try{Promise.resolve(d()).then(x.resolve,x.reject).then(()=>{E===current_batch&&E.committed&&E.deactivate(),unset_context()})}catch(R){x.reject(R),unset_context()}var E=current_batch;if(y){var S=m.is_rendered();m.update_pending_count(1),E.increment(S),(I=w.get(E))==null||I.reject(STALE_REACTION),w.delete(E),w.set(E,x)}const k=(R,M=void 0)=>{if(E.activate(),M)M!==STALE_REACTION&&(b.f|=ERROR_VALUE,internal_set(b,M));else{(b.f&ERROR_VALUE)!==0&&(b.f^=ERROR_VALUE),internal_set(b,R);for(const[A,C]of w){if(w.delete(A),A===E)break;C.reject(STALE_REACTION)}}y&&(m.update_pending_count(-1),E.decrement(S))};x.promise.then(k,R=>k(null,R||"unknown"))}),teardown(()=>{for(const x of w.values())x.reject(STALE_REACTION)}),new Promise(x=>{function E(S){function k(){S===_?x(b):E(_)}S.then(k,k)}E(_)})}function user_derived(d){const p=derived(d);return push_reaction_value(p),p}function derived_safe_equal(d){const p=derived(d);return p.equals=safe_equals,p}function destroy_derived_effects(d){var p=d.effects;if(p!==null){d.effects=null;for(var h=0;h<p.length;h+=1)destroy_effect(p[h])}}function get_derived_parent_effect(d){for(var p=d.parent;p!==null;){if((p.f&DERIVED)===0)return(p.f&DESTROYED)===0?p:null;p=p.parent}return null}function execute_derived(d){var p,h=active_effect;set_active_effect(get_derived_parent_effect(d));try{d.f&=~WAS_MARKED,destroy_derived_effects(d),p=update_reaction(d)}finally{set_active_effect(h)}return p}function update_derived(d){var p=execute_derived(d);if(!d.equals(p)&&(d.wv=increment_write_version(),(!(current_batch!=null&¤t_batch.is_fork)||d.deps===null)&&(d.v=p,d.deps===null))){set_signal_status(d,CLEAN);return}is_destroying_effect||(batch_values!==null?(effect_tracking()||current_batch!=null&¤t_batch.is_fork)&&batch_values.set(d,p):update_derived_status(d))}function freeze_derived_effects(d){var p,h;if(d.effects!==null)for(const g of d.effects)(g.teardown||g.ac)&&((p=g.teardown)==null||p.call(g),(h=g.ac)==null||h.abort(STALE_REACTION),g.teardown=noop,g.ac=null,remove_reactions(g,0),destroy_effect_children(g))}function unfreeze_derived_effects(d){if(d.effects!==null)for(const p of d.effects)p.teardown&&update_effect(p)}let eager_effects=new Set;const old_values=new Map;let eager_effects_deferred=!1;function source(d,p){var h={f:0,v:d,reactions:null,equals,rv:0,wv:0};return h}function state(d,p){const h=source(d);return push_reaction_value(h),h}function mutable_source(d,p=!1,h=!0){const g=source(d);return p||(g.equals=safe_equals),g}function set(d,p,h=!1){active_reaction!==null&&(!untracking||(active_reaction.f&EAGER_EFFECT)!==0)&&is_runes()&&(active_reaction.f&(DERIVED|BLOCK_EFFECT|ASYNC|EAGER_EFFECT))!==0&&(current_sources===null||!includes.call(current_sources,d))&&state_unsafe_mutation();let g=h?proxy(p):p;return internal_set(d,g)}function internal_set(d,p){if(!d.equals(p)){var h=d.v;is_destroying_effect?old_values.set(d,p):old_values.set(d,h),d.v=p;var g=Batch.ensure();if(g.capture(d,h),(d.f&DERIVED)!==0){const m=d;(d.f&DIRTY)!==0&&execute_derived(m),update_derived_status(m)}d.wv=increment_write_version(),mark_reactions(d,DIRTY),active_effect!==null&&(active_effect.f&CLEAN)!==0&&(active_effect.f&(BRANCH_EFFECT|ROOT_EFFECT))===0&&(untracked_writes===null?set_untracked_writes([d]):untracked_writes.push(d)),!g.is_fork&&eager_effects.size>0&&!eager_effects_deferred&&flush_eager_effects()}return p}function flush_eager_effects(){eager_effects_deferred=!1;for(const d of eager_effects)(d.f&CLEAN)!==0&&set_signal_status(d,MAYBE_DIRTY),is_dirty(d)&&update_effect(d);eager_effects.clear()}function increment(d){set(d,d.v+1)}function mark_reactions(d,p){var h=d.reactions;if(h!==null)for(var g=h.length,m=0;m<g;m++){var _=h[m],b=_.f,y=(b&DIRTY)===0;if(y&&set_signal_status(_,p),(b&DERIVED)!==0){var w=_;batch_values==null||batch_values.delete(w),(b&WAS_MARKED)===0&&(b&CONNECTED&&(_.f|=WAS_MARKED),mark_reactions(w,MAYBE_DIRTY))}else y&&((b&BLOCK_EFFECT)!==0&&eager_block_effects!==null&&eager_block_effects.add(_),schedule_effect(_))}}function proxy(d){if(typeof d!="object"||d===null||STATE_SYMBOL in d)return d;const p=get_prototype_of(d);if(p!==object_prototype&&p!==array_prototype)return d;var h=new Map,g=is_array(d),m=state(0),_=update_version,b=y=>{if(update_version===_)return y();var w=active_reaction,x=update_version;set_active_reaction(null),set_update_version(_);var E=y();return set_active_reaction(w),set_update_version(x),E};return g&&h.set("length",state(d.length)),new Proxy(d,{defineProperty(y,w,x){(!("value"in x)||x.configurable===!1||x.enumerable===!1||x.writable===!1)&&state_descriptors_fixed();var E=h.get(w);return E===void 0?b(()=>{var S=state(x.value);return h.set(w,S),S}):set(E,x.value,!0),!0},deleteProperty(y,w){var x=h.get(w);if(x===void 0){if(w in y){const E=b(()=>state(UNINITIALIZED));h.set(w,E),increment(m)}}else set(x,UNINITIALIZED),increment(m);return!0},get(y,w,x){var I;if(w===STATE_SYMBOL)return d;var E=h.get(w),S=w in y;if(E===void 0&&(!S||(I=get_descriptor(y,w))!=null&&I.writable)&&(E=b(()=>{var R=proxy(S?y[w]:UNINITIALIZED),M=state(R);return M}),h.set(w,E)),E!==void 0){var k=get(E);return k===UNINITIALIZED?void 0:k}return Reflect.get(y,w,x)},getOwnPropertyDescriptor(y,w){var x=Reflect.getOwnPropertyDescriptor(y,w);if(x&&"value"in x){var E=h.get(w);E&&(x.value=get(E))}else if(x===void 0){var S=h.get(w),k=S==null?void 0:S.v;if(S!==void 0&&k!==UNINITIALIZED)return{enumerable:!0,configurable:!0,value:k,writable:!0}}return x},has(y,w){var k;if(w===STATE_SYMBOL)return!0;var x=h.get(w),E=x!==void 0&&x.v!==UNINITIALIZED||Reflect.has(y,w);if(x!==void 0||active_effect!==null&&(!E||(k=get_descriptor(y,w))!=null&&k.writable)){x===void 0&&(x=b(()=>{var I=E?proxy(y[w]):UNINITIALIZED,R=state(I);return R}),h.set(w,x));var S=get(x);if(S===UNINITIALIZED)return!1}return E},set(y,w,x,E){var $;var S=h.get(w),k=w in y;if(g&&w==="length")for(var I=x;I<S.v;I+=1){var R=h.get(I+"");R!==void 0?set(R,UNINITIALIZED):I in y&&(R=b(()=>state(UNINITIALIZED)),h.set(I+"",R))}if(S===void 0)(!k||($=get_descriptor(y,w))!=null&&$.writable)&&(S=b(()=>state(void 0)),set(S,proxy(x)),h.set(w,S));else{k=S.v!==UNINITIALIZED;var M=b(()=>proxy(x));set(S,M)}var A=Reflect.getOwnPropertyDescriptor(y,w);if(A!=null&&A.set&&A.set.call(E,x),!k){if(g&&typeof w=="string"){var C=h.get("length"),N=Number(w);Number.isInteger(N)&&N>=C.v&&set(C,N+1)}increment(m)}return!0},ownKeys(y){get(m);var w=Reflect.ownKeys(y).filter(S=>{var k=h.get(S);return k===void 0||k.v!==UNINITIALIZED});for(var[x,E]of h)E.v!==UNINITIALIZED&&!(x in y)&&w.push(x);return w},setPrototypeOf(){state_prototype_fixed()}})}function get_proxied_value(d){try{if(d!==null&&typeof d=="object"&&STATE_SYMBOL in d)return d[STATE_SYMBOL]}catch{}return d}function is(d,p){return Object.is(get_proxied_value(d),get_proxied_value(p))}var $window,is_firefox,first_child_getter,next_sibling_getter;function init_operations(){if($window===void 0){$window=window,is_firefox=/Firefox/.test(navigator.userAgent);var d=Element.prototype,p=Node.prototype,h=Text.prototype;first_child_getter=get_descriptor(p,"firstChild").get,next_sibling_getter=get_descriptor(p,"nextSibling").get,is_extensible(d)&&(d.__click=void 0,d.__className=void 0,d.__attributes=null,d.__style=void 0,d.__e=void 0),is_extensible(h)&&(h.__t=void 0)}}function create_text(d=""){return document.createTextNode(d)}function get_first_child(d){return first_child_getter.call(d)}function get_next_sibling(d){return next_sibling_getter.call(d)}function child(d,p){if(!hydrating)return get_first_child(d);var h=get_first_child(hydrate_node);if(h===null)h=hydrate_node.appendChild(create_text());else if(p&&h.nodeType!==TEXT_NODE){var g=create_text();return h==null||h.before(g),set_hydrate_node(g),g}return p&&merge_text_nodes(h),set_hydrate_node(h),h}function first_child(d,p=!1){if(!hydrating){var h=get_first_child(d);return h instanceof Comment&&h.data===""?get_next_sibling(h):h}if(p){if((hydrate_node==null?void 0:hydrate_node.nodeType)!==TEXT_NODE){var g=create_text();return hydrate_node==null||hydrate_node.before(g),set_hydrate_node(g),g}merge_text_nodes(hydrate_node)}return hydrate_node}function sibling(d,p=1,h=!1){let g=hydrating?hydrate_node:d;for(var m;p--;)m=g,g=get_next_sibling(g);if(!hydrating)return g;if(h){if((g==null?void 0:g.nodeType)!==TEXT_NODE){var _=create_text();return g===null?m==null||m.after(_):g.before(_),set_hydrate_node(_),_}merge_text_nodes(g)}return set_hydrate_node(g),g}function clear_text_content(d){d.textContent=""}function should_defer_append(){return!1}function create_element(d,p,h){return document.createElementNS(NAMESPACE_HTML,d,void 0)}function merge_text_nodes(d){if(d.nodeValue.length<65536)return;let p=d.nextSibling;for(;p!==null&&p.nodeType===TEXT_NODE;)p.remove(),d.nodeValue+=p.nodeValue,p=d.nextSibling}function remove_textarea_child(d){hydrating&&get_first_child(d)!==null&&clear_text_content(d)}let listening_to_form_reset=!1;function add_form_reset_listener(){listening_to_form_reset||(listening_to_form_reset=!0,document.addEventListener("reset",d=>{Promise.resolve().then(()=>{var p;if(!d.defaultPrevented)for(const h of d.target.elements)(p=h.__on_r)==null||p.call(h)})},{capture:!0}))}function without_reactive_context(d){var p=active_reaction,h=active_effect;set_active_reaction(null),set_active_effect(null);try{return d()}finally{set_active_reaction(p),set_active_effect(h)}}function listen_to_event_and_reset_event(d,p,h,g=h){d.addEventListener(p,()=>without_reactive_context(h));const m=d.__on_r;m?d.__on_r=()=>{m(),g(!0)}:d.__on_r=()=>g(!0),add_form_reset_listener()}function validate_effect(d){active_effect===null&&(active_reaction===null&&effect_orphan(),effect_in_unowned_derived()),is_destroying_effect&&effect_in_teardown()}function push_effect(d,p){var h=p.last;h===null?p.last=p.first=d:(h.next=d,d.prev=h,p.last=d)}function create_effect(d,p,h){var g=active_effect;g!==null&&(g.f&INERT)!==0&&(d|=INERT);var m={ctx:component_context,deps:null,nodes:null,f:d|DIRTY|CONNECTED,first:null,fn:p,last:null,next:null,parent:g,b:g&&g.b,prev:null,teardown:null,wv:0,ac:null};if(h)try{update_effect(m)}catch(y){throw destroy_effect(m),y}else p!==null&&schedule_effect(m);var _=m;if(h&&_.deps===null&&_.teardown===null&&_.nodes===null&&_.first===_.last&&(_.f&EFFECT_PRESERVED)===0&&(_=_.first,(d&BLOCK_EFFECT)!==0&&(d&EFFECT_TRANSPARENT)!==0&&_!==null&&(_.f|=EFFECT_TRANSPARENT)),_!==null&&(_.parent=g,g!==null&&push_effect(_,g),active_reaction!==null&&(active_reaction.f&DERIVED)!==0&&(d&ROOT_EFFECT)===0)){var b=active_reaction;(b.effects??(b.effects=[])).push(_)}return m}function effect_tracking(){return active_reaction!==null&&!untracking}function teardown(d){const p=create_effect(RENDER_EFFECT,null,!1);return set_signal_status(p,CLEAN),p.teardown=d,p}function user_effect(d){validate_effect();var p=active_effect.f,h=!active_reaction&&(p&BRANCH_EFFECT)!==0&&(p&REACTION_RAN)===0;if(h){var g=component_context;(g.e??(g.e=[])).push(d)}else return create_user_effect(d)}function create_user_effect(d){return create_effect(EFFECT|USER_EFFECT,d,!1)}function effect_root(d){Batch.ensure();const p=create_effect(ROOT_EFFECT|EFFECT_PRESERVED,d,!0);return()=>{destroy_effect(p)}}function component_root(d){Batch.ensure();const p=create_effect(ROOT_EFFECT|EFFECT_PRESERVED,d,!0);return(h={})=>new Promise(g=>{h.outro?pause_effect(p,()=>{destroy_effect(p),g(void 0)}):(destroy_effect(p),g(void 0))})}function effect(d){return create_effect(EFFECT,d,!1)}function async_effect(d){return create_effect(ASYNC|EFFECT_PRESERVED,d,!0)}function render_effect(d,p=0){return create_effect(RENDER_EFFECT|p,d,!0)}function template_effect(d,p=[],h=[],g=[]){flatten(g,p,h,m=>{create_effect(RENDER_EFFECT,()=>d(...m.map(get)),!0)})}function block(d,p=0){var h=create_effect(BLOCK_EFFECT|p,d,!0);return h}function branch(d){return create_effect(BRANCH_EFFECT|EFFECT_PRESERVED,d,!0)}function execute_effect_teardown(d){var p=d.teardown;if(p!==null){const h=is_destroying_effect,g=active_reaction;set_is_destroying_effect(!0),set_active_reaction(null);try{p.call(null)}finally{set_is_destroying_effect(h),set_active_reaction(g)}}}function destroy_effect_children(d,p=!1){var h=d.first;for(d.first=d.last=null;h!==null;){const m=h.ac;m!==null&&without_reactive_context(()=>{m.abort(STALE_REACTION)});var g=h.next;(h.f&ROOT_EFFECT)!==0?h.parent=null:destroy_effect(h,p),h=g}}function destroy_block_effect_children(d){for(var p=d.first;p!==null;){var h=p.next;(p.f&BRANCH_EFFECT)===0&&destroy_effect(p),p=h}}function destroy_effect(d,p=!0){var h=!1;(p||(d.f&HEAD_EFFECT)!==0)&&d.nodes!==null&&d.nodes.end!==null&&(remove_effect_dom(d.nodes.start,d.nodes.end),h=!0),destroy_effect_children(d,p&&!h),remove_reactions(d,0),set_signal_status(d,DESTROYED);var g=d.nodes&&d.nodes.t;if(g!==null)for(const _ of g)_.stop();execute_effect_teardown(d);var m=d.parent;m!==null&&m.first!==null&&unlink_effect(d),d.next=d.prev=d.teardown=d.ctx=d.deps=d.fn=d.nodes=d.ac=null}function remove_effect_dom(d,p){for(;d!==null;){var h=d===p?null:get_next_sibling(d);d.remove(),d=h}}function unlink_effect(d){var p=d.parent,h=d.prev,g=d.next;h!==null&&(h.next=g),g!==null&&(g.prev=h),p!==null&&(p.first===d&&(p.first=g),p.last===d&&(p.last=h))}function pause_effect(d,p,h=!0){var g=[];pause_children(d,g,!0);var m=()=>{h&&destroy_effect(d),p&&p()},_=g.length;if(_>0){var b=()=>--_||m();for(var y of g)y.out(b)}else m()}function pause_children(d,p,h){if((d.f&INERT)===0){d.f^=INERT;var g=d.nodes&&d.nodes.t;if(g!==null)for(const y of g)(y.is_global||h)&&p.push(y);for(var m=d.first;m!==null;){var _=m.next,b=(m.f&EFFECT_TRANSPARENT)!==0||(m.f&BRANCH_EFFECT)!==0&&(d.f&BLOCK_EFFECT)!==0;pause_children(m,p,b?h:!1),m=_}}}function resume_effect(d){resume_children(d,!0)}function resume_children(d,p){if((d.f&INERT)!==0){d.f^=INERT,(d.f&CLEAN)===0&&(set_signal_status(d,DIRTY),schedule_effect(d));for(var h=d.first;h!==null;){var g=h.next,m=(h.f&EFFECT_TRANSPARENT)!==0||(h.f&BRANCH_EFFECT)!==0;resume_children(h,m?p:!1),h=g}var _=d.nodes&&d.nodes.t;if(_!==null)for(const b of _)(b.is_global||p)&&b.in()}}function move_effect(d,p){if(d.nodes)for(var h=d.nodes.start,g=d.nodes.end;h!==null;){var m=h===g?null:get_next_sibling(h);p.append(h),h=m}}let is_updating_effect=!1,is_destroying_effect=!1;function set_is_destroying_effect(d){is_destroying_effect=d}let active_reaction=null,untracking=!1;function set_active_reaction(d){active_reaction=d}let active_effect=null;function set_active_effect(d){active_effect=d}let current_sources=null;function push_reaction_value(d){active_reaction!==null&&(current_sources===null?current_sources=[d]:current_sources.push(d))}let new_deps=null,skipped_deps=0,untracked_writes=null;function set_untracked_writes(d){untracked_writes=d}let write_version=1,read_version=0,update_version=read_version;function set_update_version(d){update_version=d}function increment_write_version(){return++write_version}function is_dirty(d){var p=d.f;if((p&DIRTY)!==0)return!0;if(p&DERIVED&&(d.f&=~WAS_MARKED),(p&MAYBE_DIRTY)!==0){for(var h=d.deps,g=h.length,m=0;m<g;m++){var _=h[m];if(is_dirty(_)&&update_derived(_),_.wv>d.wv)return!0}(p&CONNECTED)!==0&&batch_values===null&&set_signal_status(d,CLEAN)}return!1}function schedule_possible_effect_self_invalidation(d,p,h=!0){var g=d.reactions;if(g!==null&&!(current_sources!==null&&includes.call(current_sources,d)))for(var m=0;m<g.length;m++){var _=g[m];(_.f&DERIVED)!==0?schedule_possible_effect_self_invalidation(_,p,!1):p===_&&(h?set_signal_status(_,DIRTY):(_.f&CLEAN)!==0&&set_signal_status(_,MAYBE_DIRTY),schedule_effect(_))}}function update_reaction(d){var M;var p=new_deps,h=skipped_deps,g=untracked_writes,m=active_reaction,_=current_sources,b=component_context,y=untracking,w=update_version,x=d.f;new_deps=null,skipped_deps=0,untracked_writes=null,active_reaction=(x&(BRANCH_EFFECT|ROOT_EFFECT))===0?d:null,current_sources=null,set_component_context(d.ctx),untracking=!1,update_version=++read_version,d.ac!==null&&(without_reactive_context(()=>{d.ac.abort(STALE_REACTION)}),d.ac=null);try{d.f|=REACTION_IS_UPDATING;var E=d.fn,S=E();d.f|=REACTION_RAN;var k=d.deps,I=current_batch==null?void 0:current_batch.is_fork;if(new_deps!==null){var R;if(I||remove_reactions(d,skipped_deps),k!==null&&skipped_deps>0)for(k.length=skipped_deps+new_deps.length,R=0;R<new_deps.length;R++)k[skipped_deps+R]=new_deps[R];else d.deps=k=new_deps;if(effect_tracking()&&(d.f&CONNECTED)!==0)for(R=skipped_deps;R<k.length;R++)((M=k[R]).reactions??(M.reactions=[])).push(d)}else!I&&k!==null&&skipped_deps<k.length&&(remove_reactions(d,skipped_deps),k.length=skipped_deps);if(is_runes()&&untracked_writes!==null&&!untracking&&k!==null&&(d.f&(DERIVED|MAYBE_DIRTY|DIRTY))===0)for(R=0;R<untracked_writes.length;R++)schedule_possible_effect_self_invalidation(untracked_writes[R],d);if(m!==null&&m!==d){if(read_version++,m.deps!==null)for(let A=0;A<h;A+=1)m.deps[A].rv=read_version;if(p!==null)for(const A of p)A.rv=read_version;untracked_writes!==null&&(g===null?g=untracked_writes:g.push(...untracked_writes))}return(d.f&ERROR_VALUE)!==0&&(d.f^=ERROR_VALUE),S}catch(A){return handle_error(A)}finally{d.f^=REACTION_IS_UPDATING,new_deps=p,skipped_deps=h,untracked_writes=g,active_reaction=m,current_sources=_,set_component_context(b),untracking=y,update_version=w}}function remove_reaction(d,p){let h=p.reactions;if(h!==null){var g=index_of.call(h,d);if(g!==-1){var m=h.length-1;m===0?h=p.reactions=null:(h[g]=h[m],h.pop())}}if(h===null&&(p.f&DERIVED)!==0&&(new_deps===null||!includes.call(new_deps,p))){var _=p;(_.f&CONNECTED)!==0&&(_.f^=CONNECTED,_.f&=~WAS_MARKED),update_derived_status(_),freeze_derived_effects(_),remove_reactions(_,0)}}function remove_reactions(d,p){var h=d.deps;if(h!==null)for(var g=p;g<h.length;g++)remove_reaction(d,h[g])}function update_effect(d){var p=d.f;if((p&DESTROYED)===0){set_signal_status(d,CLEAN);var h=active_effect,g=is_updating_effect;active_effect=d,is_updating_effect=!0;try{(p&(BLOCK_EFFECT|MANAGED_EFFECT))!==0?destroy_block_effect_children(d):destroy_effect_children(d),execute_effect_teardown(d);var m=update_reaction(d);d.teardown=typeof m=="function"?m:null,d.wv=write_version;var _;DEV&&tracing_mode_flag&&(d.f&DIRTY)!==0&&d.deps}finally{is_updating_effect=g,active_effect=h}}}async function tick(){await Promise.resolve(),flushSync()}function get(d){var p=d.f,h=(p&DERIVED)!==0;if(active_reaction!==null&&!untracking){var g=active_effect!==null&&(active_effect.f&DESTROYED)!==0;if(!g&&(current_sources===null||!includes.call(current_sources,d))){var m=active_reaction.deps;if((active_reaction.f&REACTION_IS_UPDATING)!==0)d.rv<read_version&&(d.rv=read_version,new_deps===null&&m!==null&&m[skipped_deps]===d?skipped_deps++:new_deps===null?new_deps=[d]:new_deps.push(d));else{(active_reaction.deps??(active_reaction.deps=[])).push(d);var _=d.reactions;_===null?d.reactions=[active_reaction]:includes.call(_,active_reaction)||_.push(active_reaction)}}}if(is_destroying_effect&&old_values.has(d))return old_values.get(d);if(h){var b=d;if(is_destroying_effect){var y=b.v;return((b.f&CLEAN)===0&&b.reactions!==null||depends_on_old_values(b))&&(y=execute_derived(b)),old_values.set(b,y),y}var w=(b.f&CONNECTED)===0&&!untracking&&active_reaction!==null&&(is_updating_effect||(active_reaction.f&CONNECTED)!==0),x=(b.f&REACTION_RAN)===0;is_dirty(b)&&(w&&(b.f|=CONNECTED),update_derived(b)),w&&!x&&(unfreeze_derived_effects(b),reconnect(b))}if(batch_values!=null&&batch_values.has(d))return batch_values.get(d);if((d.f&ERROR_VALUE)!==0)throw d.v;return d.v}function reconnect(d){if(d.f|=CONNECTED,d.deps!==null)for(const p of d.deps)(p.reactions??(p.reactions=[])).push(d),(p.f&DERIVED)!==0&&(p.f&CONNECTED)===0&&(unfreeze_derived_effects(p),reconnect(p))}function depends_on_old_values(d){if(d.v===UNINITIALIZED)return!0;if(d.deps===null)return!1;for(const p of d.deps)if(old_values.has(p)||(p.f&DERIVED)!==0&&depends_on_old_values(p))return!0;return!1}function untrack(d){var p=untracking;try{return untracking=!0,d()}finally{untracking=p}}const PASSIVE_EVENTS=["touchstart","touchmove"];function is_passive_event(d){return PASSIVE_EVENTS.includes(d)}const event_symbol=Symbol("events"),all_registered_events=new Set,root_event_handles=new Set;function create_event(d,p,h,g={}){function m(_){if(g.capture||handle_event_propagation.call(p,_),!_.cancelBubble)return without_reactive_context(()=>h==null?void 0:h.call(this,_))}return d.startsWith("pointer")||d.startsWith("touch")||d==="wheel"?queue_micro_task(()=>{p.addEventListener(d,m,g)}):p.addEventListener(d,m,g),m}function event(d,p,h,g,m){var _={capture:g,passive:m},b=create_event(d,p,h,_);(p===document.body||p===window||p===document||p instanceof HTMLMediaElement)&&teardown(()=>{p.removeEventListener(d,b,_)})}function delegated(d,p,h){(p[event_symbol]??(p[event_symbol]={}))[d]=h}function delegate(d){for(var p=0;p<d.length;p++)all_registered_events.add(d[p]);for(var h of root_event_handles)h(d)}let last_propagated_event=null;function handle_event_propagation(d){var A,C;var p=this,h=p.ownerDocument,g=d.type,m=((A=d.composedPath)==null?void 0:A.call(d))||[],_=m[0]||d.target;last_propagated_event=d;var b=0,y=last_propagated_event===d&&d.__root;if(y){var w=m.indexOf(y);if(w!==-1&&(p===document||p===window)){d.__root=p;return}var x=m.indexOf(p);if(x===-1)return;w<=x&&(b=w)}if(_=m[b]||d.target,_!==p){define_property(d,"currentTarget",{configurable:!0,get(){return _||h}});var E=active_reaction,S=active_effect;set_active_reaction(null),set_active_effect(null);try{for(var k,I=[];_!==null;){var R=_.assignedSlot||_.parentNode||_.host||null;try{var M=(C=_[event_symbol])==null?void 0:C[g];M!=null&&(!_.disabled||d.target===_)&&M.call(_,d)}catch(N){k?I.push(N):k=N}if(d.cancelBubble||R===p||R===null)break;_=R}if(k){for(let N of I)queueMicrotask(()=>{throw N});throw k}}finally{d.__root=p,delete d.currentTarget,set_active_reaction(E),set_active_effect(S)}}}const policy=(kr=(Sr=globalThis==null?void 0:globalThis.window)==null?void 0:Sr.trustedTypes)==null?void 0:kr.createPolicy("svelte-trusted-html",{createHTML:d=>d});function create_trusted_html(d){return(policy==null?void 0:policy.createHTML(d))??d}function create_fragment_from_html(d,p=!1){var h=create_element("template");return d=d.replaceAll("<!>","<!---->"),h.innerHTML=p?create_trusted_html(d):d,h.content}function assign_nodes(d,p){var h=active_effect;h.nodes===null&&(h.nodes={start:d,end:p,a:null,t:null})}function from_html(d,p){var h=(p&TEMPLATE_FRAGMENT)!==0,g=(p&TEMPLATE_USE_IMPORT_NODE)!==0,m,_=!d.startsWith("<!>");return()=>{if(hydrating)return assign_nodes(hydrate_node,null),hydrate_node;m===void 0&&(m=create_fragment_from_html(_?d:"<!>"+d,!0),h||(m=get_first_child(m)));var b=g||is_firefox?document.importNode(m,!0):m.cloneNode(!0);if(h){var y=get_first_child(b),w=b.lastChild;assign_nodes(y,w)}else assign_nodes(b,b);return b}}function from_namespace(d,p,h="svg"){var g=!d.startsWith("<!>"),m=(p&TEMPLATE_FRAGMENT)!==0,_=`<${h}>${g?d:"<!>"+d}</${h}>`,b;return()=>{if(hydrating)return assign_nodes(hydrate_node,null),hydrate_node;if(!b){var y=create_fragment_from_html(_,!0),w=get_first_child(y);if(m)for(b=document.createDocumentFragment();get_first_child(w);)b.appendChild(get_first_child(w));else b=get_first_child(w)}var x=b.cloneNode(!0);if(m){var E=get_first_child(x),S=x.lastChild;assign_nodes(E,S)}else assign_nodes(x,x);return x}}function from_svg(d,p){return from_namespace(d,p,"svg")}function text(d=""){if(!hydrating){var p=create_text(d+"");return assign_nodes(p,p),p}var h=hydrate_node;return h.nodeType!==TEXT_NODE?(h.before(h=create_text()),set_hydrate_node(h)):merge_text_nodes(h),assign_nodes(h,h),h}function comment(){if(hydrating)return assign_nodes(hydrate_node,null),hydrate_node;var d=document.createDocumentFragment(),p=document.createComment(""),h=create_text();return d.append(p,h),assign_nodes(p,h),d}function append(d,p){if(hydrating){var h=active_effect;((h.f&REACTION_RAN)===0||h.nodes.end===null)&&(h.nodes.end=hydrate_node),hydrate_next();return}d!==null&&d.before(p)}let should_intro=!0;function set_text(d,p){var h=p==null?"":typeof p=="object"?p+"":p;h!==(d.__t??(d.__t=d.nodeValue))&&(d.__t=h,d.nodeValue=h+"")}function mount(d,p){return _mount(d,p)}function hydrate(d,p){init_operations(),p.intro=p.intro??!1;const h=p.target,g=hydrating,m=hydrate_node;try{for(var _=get_first_child(h);_&&(_.nodeType!==COMMENT_NODE||_.data!==HYDRATION_START);)_=get_next_sibling(_);if(!_)throw HYDRATION_ERROR;set_hydrating(!0),set_hydrate_node(_);const b=_mount(d,{...p,anchor:_});return set_hydrating(!1),b}catch(b){if(b instanceof Error&&b.message.split(`
|
|
1
|
+
var eo=Object.defineProperty;var Mr=Ke=>{throw TypeError(Ke)};var to=(Ke,Je,lt)=>Je in Ke?eo(Ke,Je,{enumerable:!0,configurable:!0,writable:!0,value:lt}):Ke[Je]=lt;var Ie=(Ke,Je,lt)=>to(Ke,typeof Je!="symbol"?Je+"":Je,lt),br=(Ke,Je,lt)=>Je.has(Ke)||Mr("Cannot "+lt);var U=(Ke,Je,lt)=>(br(Ke,Je,"read from private field"),lt?lt.call(Ke):Je.get(Ke)),ze=(Ke,Je,lt)=>Je.has(Ke)?Mr("Cannot add the same private member more than once"):Je instanceof WeakSet?Je.add(Ke):Je.set(Ke,lt),$e=(Ke,Je,lt,Ht)=>(br(Ke,Je,"write to private field"),Ht?Ht.call(Ke,lt):Je.set(Ke,lt),lt),vt=(Ke,Je,lt)=>(br(Ke,Je,"access private method"),lt);(function(){"use strict";var Ke,Je,lt,Ht,yn,ln,wn,Mn,zn,cn,qt,xn,Pt,yr,wr,zr,It,On,Zt,dn,Bt,$t,St,Ut,Yt,tn,un,Kt,En,fn,Sn,kn,Xt,qn,ct,Or,Dr,xr,sr,ir,Er,Sr,kr,zt,jt,Tt,pn,Dn,Ln,Yn,Jt,Mt,Cr;const PUBLIC_VERSION="5";typeof window<"u"&&((Ke=window.__svelte??(window.__svelte={})).v??(Ke.v=new Set)).add("5");const EACH_ITEM_REACTIVE=1,EACH_INDEX_REACTIVE=2,EACH_IS_CONTROLLED=4,EACH_IS_ANIMATED=8,EACH_ITEM_IMMUTABLE=16,PROPS_IS_IMMUTABLE=1,PROPS_IS_UPDATED=4,PROPS_IS_BINDABLE=8,PROPS_IS_LAZY_INITIAL=16,TRANSITION_GLOBAL=4,TEMPLATE_FRAGMENT=1,TEMPLATE_USE_IMPORT_NODE=2,HYDRATION_START="[",HYDRATION_START_ELSE="[!",HYDRATION_END="]",HYDRATION_ERROR={},UNINITIALIZED=Symbol(),NAMESPACE_HTML="http://www.w3.org/1999/xhtml",DEV=!1;var is_array=Array.isArray,index_of=Array.prototype.indexOf,includes=Array.prototype.includes,array_from=Array.from,object_keys=Object.keys,define_property=Object.defineProperty,get_descriptor=Object.getOwnPropertyDescriptor,get_descriptors=Object.getOwnPropertyDescriptors,object_prototype=Object.prototype,array_prototype=Array.prototype,get_prototype_of=Object.getPrototypeOf,is_extensible=Object.isExtensible;function is_function(d){return typeof d=="function"}const noop=()=>{};function run_all(d){for(var p=0;p<d.length;p++)d[p]()}function deferred(){var d,p,h=new Promise((g,m)=>{d=g,p=m});return{promise:h,resolve:d,reject:p}}const DERIVED=2,EFFECT=4,RENDER_EFFECT=8,MANAGED_EFFECT=1<<24,BLOCK_EFFECT=16,BRANCH_EFFECT=32,ROOT_EFFECT=64,BOUNDARY_EFFECT=128,CONNECTED=512,CLEAN=1024,DIRTY=2048,MAYBE_DIRTY=4096,INERT=8192,DESTROYED=16384,REACTION_RAN=32768,EFFECT_TRANSPARENT=65536,EAGER_EFFECT=1<<17,HEAD_EFFECT=1<<18,EFFECT_PRESERVED=1<<19,USER_EFFECT=1<<20,EFFECT_OFFSCREEN=1<<25,WAS_MARKED=65536,REACTION_IS_UPDATING=1<<21,ASYNC=1<<22,ERROR_VALUE=1<<23,STATE_SYMBOL=Symbol("$state"),LEGACY_PROPS=Symbol("legacy props"),LOADING_ATTR_SYMBOL=Symbol(""),STALE_REACTION=new class extends Error{constructor(){super(...arguments);Ie(this,"name","StaleReactionError");Ie(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},IS_XHTML=((lt=(Je=globalThis.document)==null?void 0:Je.contentType)==null?void 0:lt.includes("xml"))??!1,TEXT_NODE=3,COMMENT_NODE=8;function lifecycle_outside_component(d){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function async_derived_orphan(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function each_key_duplicate(d,p,h){throw new Error("https://svelte.dev/e/each_key_duplicate")}function effect_in_teardown(d){throw new Error("https://svelte.dev/e/effect_in_teardown")}function effect_in_unowned_derived(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function effect_orphan(d){throw new Error("https://svelte.dev/e/effect_orphan")}function effect_update_depth_exceeded(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function hydration_failed(){throw new Error("https://svelte.dev/e/hydration_failed")}function props_invalid_value(d){throw new Error("https://svelte.dev/e/props_invalid_value")}function state_descriptors_fixed(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function state_prototype_fixed(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function state_unsafe_mutation(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function svelte_boundary_reset_onerror(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function hydration_mismatch(d){console.warn("https://svelte.dev/e/hydration_mismatch")}function select_multiple_invalid_value(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function svelte_boundary_reset_noop(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let hydrating=!1;function set_hydrating(d){hydrating=d}let hydrate_node;function set_hydrate_node(d){if(d===null)throw hydration_mismatch(),HYDRATION_ERROR;return hydrate_node=d}function hydrate_next(){return set_hydrate_node(get_next_sibling(hydrate_node))}function reset(d){if(hydrating){if(get_next_sibling(hydrate_node)!==null)throw hydration_mismatch(),HYDRATION_ERROR;hydrate_node=d}}function next(d=1){if(hydrating){for(var p=d,h=hydrate_node;p--;)h=get_next_sibling(h);hydrate_node=h}}function skip_nodes(d=!0){for(var p=0,h=hydrate_node;;){if(h.nodeType===COMMENT_NODE){var g=h.data;if(g===HYDRATION_END){if(p===0)return h;p-=1}else(g===HYDRATION_START||g===HYDRATION_START_ELSE||g[0]==="["&&!isNaN(Number(g.slice(1))))&&(p+=1)}var m=get_next_sibling(h);d&&h.remove(),h=m}}function read_hydration_instruction(d){if(!d||d.nodeType!==COMMENT_NODE)throw hydration_mismatch(),HYDRATION_ERROR;return d.data}function equals(d){return d===this.v}function safe_not_equal(d,p){return d!=d?p==p:d!==p||d!==null&&typeof d=="object"||typeof d=="function"}function safe_equals(d){return!safe_not_equal(d,this.v)}let tracing_mode_flag=!1,component_context=null;function set_component_context(d){component_context=d}function push(d,p=!1,h){component_context={p:component_context,i:!1,c:null,e:null,s:d,x:null,l:null}}function pop(d){var p=component_context,h=p.e;if(h!==null){p.e=null;for(var g of h)create_user_effect(g)}return d!==void 0&&(p.x=d),p.i=!0,component_context=p.p,d??{}}function is_runes(){return!0}let micro_tasks=[];function run_micro_tasks(){var d=micro_tasks;micro_tasks=[],run_all(d)}function queue_micro_task(d){if(micro_tasks.length===0&&!is_flushing_sync){var p=micro_tasks;queueMicrotask(()=>{p===micro_tasks&&run_micro_tasks()})}micro_tasks.push(d)}function flush_tasks(){for(;micro_tasks.length>0;)run_micro_tasks()}function handle_error(d){var p=active_effect;if(p===null)return active_reaction.f|=ERROR_VALUE,d;if((p.f&REACTION_RAN)===0&&(p.f&EFFECT)===0)throw d;invoke_error_boundary(d,p)}function invoke_error_boundary(d,p){for(;p!==null;){if((p.f&BOUNDARY_EFFECT)!==0){if((p.f&REACTION_RAN)===0)throw d;try{p.b.error(d);return}catch(h){d=h}}p=p.parent}throw d}const STATUS_MASK=-7169;function set_signal_status(d,p){d.f=d.f&STATUS_MASK|p}function update_derived_status(d){(d.f&CONNECTED)!==0||d.deps===null?set_signal_status(d,CLEAN):set_signal_status(d,MAYBE_DIRTY)}function clear_marked(d){if(d!==null)for(const p of d)(p.f&DERIVED)===0||(p.f&WAS_MARKED)===0||(p.f^=WAS_MARKED,clear_marked(p.deps))}function defer_effect(d,p,h){(d.f&DIRTY)!==0?p.add(d):(d.f&MAYBE_DIRTY)!==0&&h.add(d),clear_marked(d.deps),set_signal_status(d,CLEAN)}const batches=new Set;let current_batch=null,previous_batch=null,batch_values=null,queued_root_effects=[],last_scheduled_effect=null,is_flushing=!1,is_flushing_sync=!1;const ar=class ar{constructor(){ze(this,Pt);Ie(this,"committed",!1);Ie(this,"current",new Map);Ie(this,"previous",new Map);ze(this,Ht,new Set);ze(this,yn,new Set);ze(this,ln,0);ze(this,wn,0);ze(this,Mn,null);ze(this,zn,new Set);ze(this,cn,new Set);ze(this,qt,new Map);Ie(this,"is_fork",!1);ze(this,xn,!1)}is_deferred(){return this.is_fork||U(this,wn)>0}skip_effect(p){U(this,qt).has(p)||U(this,qt).set(p,{d:[],m:[]})}unskip_effect(p){var h=U(this,qt).get(p);if(h){U(this,qt).delete(p);for(var g of h.d)set_signal_status(g,DIRTY),schedule_effect(g);for(g of h.m)set_signal_status(g,MAYBE_DIRTY),schedule_effect(g)}}process(p){var m;queued_root_effects=[],this.apply();var h=[],g=[];for(const _ of p)vt(this,Pt,yr).call(this,_,h,g);if(this.is_deferred()){vt(this,Pt,wr).call(this,g),vt(this,Pt,wr).call(this,h);for(const[_,b]of U(this,qt))reset_branch(_,b)}else{for(const _ of U(this,Ht))_();U(this,Ht).clear(),U(this,ln)===0&&vt(this,Pt,zr).call(this),previous_batch=this,current_batch=null,flush_queued_effects(g),flush_queued_effects(h),previous_batch=null,(m=U(this,Mn))==null||m.resolve()}batch_values=null}capture(p,h){h!==UNINITIALIZED&&!this.previous.has(p)&&this.previous.set(p,h),(p.f&ERROR_VALUE)===0&&(this.current.set(p,p.v),batch_values==null||batch_values.set(p,p.v))}activate(){current_batch=this,this.apply()}deactivate(){current_batch===this&&(current_batch=null,batch_values=null)}flush(){if(this.activate(),queued_root_effects.length>0){if(flush_effects(),current_batch!==null&¤t_batch!==this)return}else U(this,ln)===0&&this.process([]);this.deactivate()}discard(){for(const p of U(this,yn))p(this);U(this,yn).clear()}increment(p){$e(this,ln,U(this,ln)+1),p&&$e(this,wn,U(this,wn)+1)}decrement(p){$e(this,ln,U(this,ln)-1),p&&$e(this,wn,U(this,wn)-1),!U(this,xn)&&($e(this,xn,!0),queue_micro_task(()=>{$e(this,xn,!1),this.is_deferred()?queued_root_effects.length>0&&this.flush():this.revive()}))}revive(){for(const p of U(this,zn))U(this,cn).delete(p),set_signal_status(p,DIRTY),schedule_effect(p);for(const p of U(this,cn))set_signal_status(p,MAYBE_DIRTY),schedule_effect(p);this.flush()}oncommit(p){U(this,Ht).add(p)}ondiscard(p){U(this,yn).add(p)}settled(){return(U(this,Mn)??$e(this,Mn,deferred())).promise}static ensure(){if(current_batch===null){const p=current_batch=new ar;batches.add(current_batch),is_flushing_sync||queue_micro_task(()=>{current_batch===p&&p.flush()})}return current_batch}apply(){}};Ht=new WeakMap,yn=new WeakMap,ln=new WeakMap,wn=new WeakMap,Mn=new WeakMap,zn=new WeakMap,cn=new WeakMap,qt=new WeakMap,xn=new WeakMap,Pt=new WeakSet,yr=function(p,h,g){p.f^=CLEAN;for(var m=p.first,_=null;m!==null;){var b=m.f,y=(b&(BRANCH_EFFECT|ROOT_EFFECT))!==0,w=y&&(b&CLEAN)!==0,x=w||(b&INERT)!==0||U(this,qt).has(m);if(!x&&m.fn!==null){y?m.f^=CLEAN:_!==null&&(b&(EFFECT|RENDER_EFFECT|MANAGED_EFFECT))!==0?_.b.defer_effect(m):(b&EFFECT)!==0?h.push(m):is_dirty(m)&&((b&BLOCK_EFFECT)!==0&&U(this,cn).add(m),update_effect(m));var E=m.first;if(E!==null){m=E;continue}}var S=m.parent;for(m=m.next;m===null&&S!==null;)S===_&&(_=null),m=S.next,S=S.parent}},wr=function(p){for(var h=0;h<p.length;h+=1)defer_effect(p[h],U(this,zn),U(this,cn))},zr=function(){var m;if(batches.size>1){this.previous.clear();var p=batch_values,h=!0;for(const _ of batches){if(_===this){h=!1;continue}const b=[];for(const[w,x]of this.current){if(_.current.has(w))if(h&&x!==_.current.get(w))_.current.set(w,x);else continue;b.push(w)}if(b.length===0)continue;const y=[..._.current.keys()].filter(w=>!this.current.has(w));if(y.length>0){var g=queued_root_effects;queued_root_effects=[];const w=new Set,x=new Map;for(const E of b)mark_effects(E,y,w,x);if(queued_root_effects.length>0){current_batch=_,_.apply();for(const E of queued_root_effects)vt(m=_,Pt,yr).call(m,E,[],[]);_.deactivate()}queued_root_effects=g}}current_batch=null,batch_values=p}this.committed=!0,batches.delete(this)};let Batch=ar;function flushSync(d){var p=is_flushing_sync;is_flushing_sync=!0;try{for(var h;;){if(flush_tasks(),queued_root_effects.length===0&&(current_batch==null||current_batch.flush(),queued_root_effects.length===0))return last_scheduled_effect=null,h;flush_effects()}}finally{is_flushing_sync=p}}function flush_effects(){is_flushing=!0;var d=null;try{for(var p=0;queued_root_effects.length>0;){var h=Batch.ensure();if(p++>1e3){var g,m;infinite_loop_guard()}h.process(queued_root_effects),old_values.clear()}}finally{queued_root_effects=[],is_flushing=!1,last_scheduled_effect=null}}function infinite_loop_guard(){try{effect_update_depth_exceeded()}catch(d){invoke_error_boundary(d,last_scheduled_effect)}}let eager_block_effects=null;function flush_queued_effects(d){var p=d.length;if(p!==0){for(var h=0;h<p;){var g=d[h++];if((g.f&(DESTROYED|INERT))===0&&is_dirty(g)&&(eager_block_effects=new Set,update_effect(g),g.deps===null&&g.first===null&&g.nodes===null&&g.teardown===null&&g.ac===null&&unlink_effect(g),(eager_block_effects==null?void 0:eager_block_effects.size)>0)){old_values.clear();for(const m of eager_block_effects){if((m.f&(DESTROYED|INERT))!==0)continue;const _=[m];let b=m.parent;for(;b!==null;)eager_block_effects.has(b)&&(eager_block_effects.delete(b),_.push(b)),b=b.parent;for(let y=_.length-1;y>=0;y--){const w=_[y];(w.f&(DESTROYED|INERT))===0&&update_effect(w)}}eager_block_effects.clear()}}eager_block_effects=null}}function mark_effects(d,p,h,g){if(!h.has(d)&&(h.add(d),d.reactions!==null))for(const m of d.reactions){const _=m.f;(_&DERIVED)!==0?mark_effects(m,p,h,g):(_&(ASYNC|BLOCK_EFFECT))!==0&&(_&DIRTY)===0&&depends_on(m,p,g)&&(set_signal_status(m,DIRTY),schedule_effect(m))}}function depends_on(d,p,h){const g=h.get(d);if(g!==void 0)return g;if(d.deps!==null)for(const m of d.deps){if(includes.call(p,m))return!0;if((m.f&DERIVED)!==0&&depends_on(m,p,h))return h.set(m,!0),!0}return h.set(d,!1),!1}function schedule_effect(d){for(var p=last_scheduled_effect=d;p.parent!==null;){p=p.parent;var h=p.f;if(is_flushing&&p===active_effect&&(h&BLOCK_EFFECT)!==0&&(h&HEAD_EFFECT)===0)return;if((h&(ROOT_EFFECT|BRANCH_EFFECT))!==0){if((h&CLEAN)===0)return;p.f^=CLEAN}}queued_root_effects.push(p)}function reset_branch(d,p){if(!((d.f&BRANCH_EFFECT)!==0&&(d.f&CLEAN)!==0)){(d.f&DIRTY)!==0?p.d.push(d):(d.f&MAYBE_DIRTY)!==0&&p.m.push(d),set_signal_status(d,CLEAN);for(var h=d.first;h!==null;)reset_branch(h,p),h=h.next}}function createSubscriber(d){let p=0,h=source(0),g;return()=>{effect_tracking()&&(get(h),render_effect(()=>(p===0&&(g=untrack(()=>d(()=>increment(h)))),p+=1,()=>{queue_micro_task(()=>{p-=1,p===0&&(g==null||g(),g=void 0,increment(h))})})))}}var flags=EFFECT_TRANSPARENT|EFFECT_PRESERVED|BOUNDARY_EFFECT;function boundary(d,p,h){new Boundary(d,p,h)}class Boundary{constructor(p,h,g){ze(this,ct);Ie(this,"parent");Ie(this,"is_pending",!1);ze(this,It);ze(this,On,hydrating?hydrate_node:null);ze(this,Zt);ze(this,dn);ze(this,Bt);ze(this,$t,null);ze(this,St,null);ze(this,Ut,null);ze(this,Yt,null);ze(this,tn,null);ze(this,un,0);ze(this,Kt,0);ze(this,En,!1);ze(this,fn,!1);ze(this,Sn,new Set);ze(this,kn,new Set);ze(this,Xt,null);ze(this,qn,createSubscriber(()=>($e(this,Xt,source(U(this,un))),()=>{$e(this,Xt,null)})));$e(this,It,p),$e(this,Zt,h),$e(this,dn,g),this.parent=active_effect.b,this.is_pending=!!U(this,Zt).pending,$e(this,Bt,block(()=>{if(active_effect.b=this,hydrating){const _=U(this,On);hydrate_next(),_.nodeType===COMMENT_NODE&&_.data===HYDRATION_START_ELSE?vt(this,ct,Dr).call(this):(vt(this,ct,Or).call(this),U(this,Kt)===0&&(this.is_pending=!1))}else{var m=vt(this,ct,xr).call(this);try{$e(this,$t,branch(()=>g(m)))}catch(_){this.error(_)}U(this,Kt)>0?vt(this,ct,ir).call(this):this.is_pending=!1}return()=>{var _;(_=U(this,tn))==null||_.remove()}},flags)),hydrating&&$e(this,It,hydrate_node)}defer_effect(p){defer_effect(p,U(this,Sn),U(this,kn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!U(this,Zt).pending}update_pending_count(p){vt(this,ct,Er).call(this,p),$e(this,un,U(this,un)+p),!(!U(this,Xt)||U(this,En))&&($e(this,En,!0),queue_micro_task(()=>{$e(this,En,!1),U(this,Xt)&&internal_set(U(this,Xt),U(this,un))}))}get_effect_pending(){return U(this,qn).call(this),get(U(this,Xt))}error(p){var h=U(this,Zt).onerror;let g=U(this,Zt).failed;if(U(this,fn)||!h&&!g)throw p;U(this,$t)&&(destroy_effect(U(this,$t)),$e(this,$t,null)),U(this,St)&&(destroy_effect(U(this,St)),$e(this,St,null)),U(this,Ut)&&(destroy_effect(U(this,Ut)),$e(this,Ut,null)),hydrating&&(set_hydrate_node(U(this,On)),next(),set_hydrate_node(skip_nodes()));var m=!1,_=!1;const b=()=>{if(m){svelte_boundary_reset_noop();return}m=!0,_&&svelte_boundary_reset_onerror(),Batch.ensure(),$e(this,un,0),U(this,Ut)!==null&&pause_effect(U(this,Ut),()=>{$e(this,Ut,null)}),this.is_pending=this.has_pending_snippet(),$e(this,$t,vt(this,ct,sr).call(this,()=>($e(this,fn,!1),branch(()=>U(this,dn).call(this,U(this,It)))))),U(this,Kt)>0?vt(this,ct,ir).call(this):this.is_pending=!1};queue_micro_task(()=>{try{_=!0,h==null||h(p,b),_=!1}catch(y){invoke_error_boundary(y,U(this,Bt)&&U(this,Bt).parent)}g&&$e(this,Ut,vt(this,ct,sr).call(this,()=>{Batch.ensure(),$e(this,fn,!0);try{return branch(()=>{g(U(this,It),()=>p,()=>b)})}catch(y){return invoke_error_boundary(y,U(this,Bt).parent),null}finally{$e(this,fn,!1)}}))})}}It=new WeakMap,On=new WeakMap,Zt=new WeakMap,dn=new WeakMap,Bt=new WeakMap,$t=new WeakMap,St=new WeakMap,Ut=new WeakMap,Yt=new WeakMap,tn=new WeakMap,un=new WeakMap,Kt=new WeakMap,En=new WeakMap,fn=new WeakMap,Sn=new WeakMap,kn=new WeakMap,Xt=new WeakMap,qn=new WeakMap,ct=new WeakSet,Or=function(){try{$e(this,$t,branch(()=>U(this,dn).call(this,U(this,It))))}catch(p){this.error(p)}},Dr=function(){const p=U(this,Zt).pending;p&&($e(this,St,branch(()=>p(U(this,It)))),queue_micro_task(()=>{var h=vt(this,ct,xr).call(this);$e(this,$t,vt(this,ct,sr).call(this,()=>(Batch.ensure(),branch(()=>U(this,dn).call(this,h))))),U(this,Kt)>0?vt(this,ct,ir).call(this):(pause_effect(U(this,St),()=>{$e(this,St,null)}),this.is_pending=!1)}))},xr=function(){var p=U(this,It);return this.is_pending&&($e(this,tn,create_text()),U(this,It).before(U(this,tn)),p=U(this,tn)),p},sr=function(p){var h=active_effect,g=active_reaction,m=component_context;set_active_effect(U(this,Bt)),set_active_reaction(U(this,Bt)),set_component_context(U(this,Bt).ctx);try{return p()}catch(_){return handle_error(_),null}finally{set_active_effect(h),set_active_reaction(g),set_component_context(m)}},ir=function(){const p=U(this,Zt).pending;U(this,$t)!==null&&($e(this,Yt,document.createDocumentFragment()),U(this,Yt).append(U(this,tn)),move_effect(U(this,$t),U(this,Yt))),U(this,St)===null&&$e(this,St,branch(()=>p(U(this,It))))},Er=function(p){var h;if(!this.has_pending_snippet()){this.parent&&vt(h=this.parent,ct,Er).call(h,p);return}if($e(this,Kt,U(this,Kt)+p),U(this,Kt)===0){this.is_pending=!1;for(const g of U(this,Sn))set_signal_status(g,DIRTY),schedule_effect(g);for(const g of U(this,kn))set_signal_status(g,MAYBE_DIRTY),schedule_effect(g);U(this,Sn).clear(),U(this,kn).clear(),U(this,St)&&pause_effect(U(this,St),()=>{$e(this,St,null)}),U(this,Yt)&&(U(this,It).before(U(this,Yt)),$e(this,Yt,null))}};function flatten(d,p,h,g){const m=derived;var _=d.filter(k=>!k.settled);if(h.length===0&&_.length===0){g(p.map(m));return}var b=current_batch,y=active_effect,w=capture(),x=_.length===1?_[0].promise:_.length>1?Promise.all(_.map(k=>k.promise)):null;function E(k){w();try{g(k)}catch(I){(y.f&DESTROYED)===0&&invoke_error_boundary(I,y)}b==null||b.deactivate(),unset_context()}if(h.length===0){x.then(()=>E(p.map(m)));return}function S(){w(),Promise.all(h.map(k=>async_derived(k))).then(k=>E([...p.map(m),...k])).catch(k=>invoke_error_boundary(k,y))}x?x.then(S):S()}function capture(){var d=active_effect,p=active_reaction,h=component_context,g=current_batch;return function(_=!0){set_active_effect(d),set_active_reaction(p),set_component_context(h),_&&(g==null||g.activate())}}function unset_context(){set_active_effect(null),set_active_reaction(null),set_component_context(null)}function derived(d){var p=DERIVED|DIRTY,h=active_reaction!==null&&(active_reaction.f&DERIVED)!==0?active_reaction:null;return active_effect!==null&&(active_effect.f|=EFFECT_PRESERVED),{ctx:component_context,deps:null,effects:null,equals,f:p,fn:d,reactions:null,rv:0,v:UNINITIALIZED,wv:0,parent:h??active_effect,ac:null}}function async_derived(d,p,h){let g=active_effect;g===null&&async_derived_orphan();var m=g.b,_=void 0,b=source(UNINITIALIZED),y=!active_reaction,w=new Map;return async_effect(()=>{var I;var x=deferred();_=x.promise;try{Promise.resolve(d()).then(x.resolve,x.reject).then(()=>{E===current_batch&&E.committed&&E.deactivate(),unset_context()})}catch(R){x.reject(R),unset_context()}var E=current_batch;if(y){var S=m.is_rendered();m.update_pending_count(1),E.increment(S),(I=w.get(E))==null||I.reject(STALE_REACTION),w.delete(E),w.set(E,x)}const k=(R,M=void 0)=>{if(E.activate(),M)M!==STALE_REACTION&&(b.f|=ERROR_VALUE,internal_set(b,M));else{(b.f&ERROR_VALUE)!==0&&(b.f^=ERROR_VALUE),internal_set(b,R);for(const[A,C]of w){if(w.delete(A),A===E)break;C.reject(STALE_REACTION)}}y&&(m.update_pending_count(-1),E.decrement(S))};x.promise.then(k,R=>k(null,R||"unknown"))}),teardown(()=>{for(const x of w.values())x.reject(STALE_REACTION)}),new Promise(x=>{function E(S){function k(){S===_?x(b):E(_)}S.then(k,k)}E(_)})}function user_derived(d){const p=derived(d);return push_reaction_value(p),p}function derived_safe_equal(d){const p=derived(d);return p.equals=safe_equals,p}function destroy_derived_effects(d){var p=d.effects;if(p!==null){d.effects=null;for(var h=0;h<p.length;h+=1)destroy_effect(p[h])}}function get_derived_parent_effect(d){for(var p=d.parent;p!==null;){if((p.f&DERIVED)===0)return(p.f&DESTROYED)===0?p:null;p=p.parent}return null}function execute_derived(d){var p,h=active_effect;set_active_effect(get_derived_parent_effect(d));try{d.f&=~WAS_MARKED,destroy_derived_effects(d),p=update_reaction(d)}finally{set_active_effect(h)}return p}function update_derived(d){var p=execute_derived(d);if(!d.equals(p)&&(d.wv=increment_write_version(),(!(current_batch!=null&¤t_batch.is_fork)||d.deps===null)&&(d.v=p,d.deps===null))){set_signal_status(d,CLEAN);return}is_destroying_effect||(batch_values!==null?(effect_tracking()||current_batch!=null&¤t_batch.is_fork)&&batch_values.set(d,p):update_derived_status(d))}function freeze_derived_effects(d){var p,h;if(d.effects!==null)for(const g of d.effects)(g.teardown||g.ac)&&((p=g.teardown)==null||p.call(g),(h=g.ac)==null||h.abort(STALE_REACTION),g.teardown=noop,g.ac=null,remove_reactions(g,0),destroy_effect_children(g))}function unfreeze_derived_effects(d){if(d.effects!==null)for(const p of d.effects)p.teardown&&update_effect(p)}let eager_effects=new Set;const old_values=new Map;let eager_effects_deferred=!1;function source(d,p){var h={f:0,v:d,reactions:null,equals,rv:0,wv:0};return h}function state(d,p){const h=source(d);return push_reaction_value(h),h}function mutable_source(d,p=!1,h=!0){const g=source(d);return p||(g.equals=safe_equals),g}function set(d,p,h=!1){active_reaction!==null&&(!untracking||(active_reaction.f&EAGER_EFFECT)!==0)&&is_runes()&&(active_reaction.f&(DERIVED|BLOCK_EFFECT|ASYNC|EAGER_EFFECT))!==0&&(current_sources===null||!includes.call(current_sources,d))&&state_unsafe_mutation();let g=h?proxy(p):p;return internal_set(d,g)}function internal_set(d,p){if(!d.equals(p)){var h=d.v;is_destroying_effect?old_values.set(d,p):old_values.set(d,h),d.v=p;var g=Batch.ensure();if(g.capture(d,h),(d.f&DERIVED)!==0){const m=d;(d.f&DIRTY)!==0&&execute_derived(m),update_derived_status(m)}d.wv=increment_write_version(),mark_reactions(d,DIRTY),active_effect!==null&&(active_effect.f&CLEAN)!==0&&(active_effect.f&(BRANCH_EFFECT|ROOT_EFFECT))===0&&(untracked_writes===null?set_untracked_writes([d]):untracked_writes.push(d)),!g.is_fork&&eager_effects.size>0&&!eager_effects_deferred&&flush_eager_effects()}return p}function flush_eager_effects(){eager_effects_deferred=!1;for(const d of eager_effects)(d.f&CLEAN)!==0&&set_signal_status(d,MAYBE_DIRTY),is_dirty(d)&&update_effect(d);eager_effects.clear()}function increment(d){set(d,d.v+1)}function mark_reactions(d,p){var h=d.reactions;if(h!==null)for(var g=h.length,m=0;m<g;m++){var _=h[m],b=_.f,y=(b&DIRTY)===0;if(y&&set_signal_status(_,p),(b&DERIVED)!==0){var w=_;batch_values==null||batch_values.delete(w),(b&WAS_MARKED)===0&&(b&CONNECTED&&(_.f|=WAS_MARKED),mark_reactions(w,MAYBE_DIRTY))}else y&&((b&BLOCK_EFFECT)!==0&&eager_block_effects!==null&&eager_block_effects.add(_),schedule_effect(_))}}function proxy(d){if(typeof d!="object"||d===null||STATE_SYMBOL in d)return d;const p=get_prototype_of(d);if(p!==object_prototype&&p!==array_prototype)return d;var h=new Map,g=is_array(d),m=state(0),_=update_version,b=y=>{if(update_version===_)return y();var w=active_reaction,x=update_version;set_active_reaction(null),set_update_version(_);var E=y();return set_active_reaction(w),set_update_version(x),E};return g&&h.set("length",state(d.length)),new Proxy(d,{defineProperty(y,w,x){(!("value"in x)||x.configurable===!1||x.enumerable===!1||x.writable===!1)&&state_descriptors_fixed();var E=h.get(w);return E===void 0?b(()=>{var S=state(x.value);return h.set(w,S),S}):set(E,x.value,!0),!0},deleteProperty(y,w){var x=h.get(w);if(x===void 0){if(w in y){const E=b(()=>state(UNINITIALIZED));h.set(w,E),increment(m)}}else set(x,UNINITIALIZED),increment(m);return!0},get(y,w,x){var I;if(w===STATE_SYMBOL)return d;var E=h.get(w),S=w in y;if(E===void 0&&(!S||(I=get_descriptor(y,w))!=null&&I.writable)&&(E=b(()=>{var R=proxy(S?y[w]:UNINITIALIZED),M=state(R);return M}),h.set(w,E)),E!==void 0){var k=get(E);return k===UNINITIALIZED?void 0:k}return Reflect.get(y,w,x)},getOwnPropertyDescriptor(y,w){var x=Reflect.getOwnPropertyDescriptor(y,w);if(x&&"value"in x){var E=h.get(w);E&&(x.value=get(E))}else if(x===void 0){var S=h.get(w),k=S==null?void 0:S.v;if(S!==void 0&&k!==UNINITIALIZED)return{enumerable:!0,configurable:!0,value:k,writable:!0}}return x},has(y,w){var k;if(w===STATE_SYMBOL)return!0;var x=h.get(w),E=x!==void 0&&x.v!==UNINITIALIZED||Reflect.has(y,w);if(x!==void 0||active_effect!==null&&(!E||(k=get_descriptor(y,w))!=null&&k.writable)){x===void 0&&(x=b(()=>{var I=E?proxy(y[w]):UNINITIALIZED,R=state(I);return R}),h.set(w,x));var S=get(x);if(S===UNINITIALIZED)return!1}return E},set(y,w,x,E){var $;var S=h.get(w),k=w in y;if(g&&w==="length")for(var I=x;I<S.v;I+=1){var R=h.get(I+"");R!==void 0?set(R,UNINITIALIZED):I in y&&(R=b(()=>state(UNINITIALIZED)),h.set(I+"",R))}if(S===void 0)(!k||($=get_descriptor(y,w))!=null&&$.writable)&&(S=b(()=>state(void 0)),set(S,proxy(x)),h.set(w,S));else{k=S.v!==UNINITIALIZED;var M=b(()=>proxy(x));set(S,M)}var A=Reflect.getOwnPropertyDescriptor(y,w);if(A!=null&&A.set&&A.set.call(E,x),!k){if(g&&typeof w=="string"){var C=h.get("length"),N=Number(w);Number.isInteger(N)&&N>=C.v&&set(C,N+1)}increment(m)}return!0},ownKeys(y){get(m);var w=Reflect.ownKeys(y).filter(S=>{var k=h.get(S);return k===void 0||k.v!==UNINITIALIZED});for(var[x,E]of h)E.v!==UNINITIALIZED&&!(x in y)&&w.push(x);return w},setPrototypeOf(){state_prototype_fixed()}})}function get_proxied_value(d){try{if(d!==null&&typeof d=="object"&&STATE_SYMBOL in d)return d[STATE_SYMBOL]}catch{}return d}function is(d,p){return Object.is(get_proxied_value(d),get_proxied_value(p))}var $window,is_firefox,first_child_getter,next_sibling_getter;function init_operations(){if($window===void 0){$window=window,is_firefox=/Firefox/.test(navigator.userAgent);var d=Element.prototype,p=Node.prototype,h=Text.prototype;first_child_getter=get_descriptor(p,"firstChild").get,next_sibling_getter=get_descriptor(p,"nextSibling").get,is_extensible(d)&&(d.__click=void 0,d.__className=void 0,d.__attributes=null,d.__style=void 0,d.__e=void 0),is_extensible(h)&&(h.__t=void 0)}}function create_text(d=""){return document.createTextNode(d)}function get_first_child(d){return first_child_getter.call(d)}function get_next_sibling(d){return next_sibling_getter.call(d)}function child(d,p){if(!hydrating)return get_first_child(d);var h=get_first_child(hydrate_node);if(h===null)h=hydrate_node.appendChild(create_text());else if(p&&h.nodeType!==TEXT_NODE){var g=create_text();return h==null||h.before(g),set_hydrate_node(g),g}return p&&merge_text_nodes(h),set_hydrate_node(h),h}function first_child(d,p=!1){if(!hydrating){var h=get_first_child(d);return h instanceof Comment&&h.data===""?get_next_sibling(h):h}if(p){if((hydrate_node==null?void 0:hydrate_node.nodeType)!==TEXT_NODE){var g=create_text();return hydrate_node==null||hydrate_node.before(g),set_hydrate_node(g),g}merge_text_nodes(hydrate_node)}return hydrate_node}function sibling(d,p=1,h=!1){let g=hydrating?hydrate_node:d;for(var m;p--;)m=g,g=get_next_sibling(g);if(!hydrating)return g;if(h){if((g==null?void 0:g.nodeType)!==TEXT_NODE){var _=create_text();return g===null?m==null||m.after(_):g.before(_),set_hydrate_node(_),_}merge_text_nodes(g)}return set_hydrate_node(g),g}function clear_text_content(d){d.textContent=""}function should_defer_append(){return!1}function create_element(d,p,h){return document.createElementNS(NAMESPACE_HTML,d,void 0)}function merge_text_nodes(d){if(d.nodeValue.length<65536)return;let p=d.nextSibling;for(;p!==null&&p.nodeType===TEXT_NODE;)p.remove(),d.nodeValue+=p.nodeValue,p=d.nextSibling}function remove_textarea_child(d){hydrating&&get_first_child(d)!==null&&clear_text_content(d)}let listening_to_form_reset=!1;function add_form_reset_listener(){listening_to_form_reset||(listening_to_form_reset=!0,document.addEventListener("reset",d=>{Promise.resolve().then(()=>{var p;if(!d.defaultPrevented)for(const h of d.target.elements)(p=h.__on_r)==null||p.call(h)})},{capture:!0}))}function without_reactive_context(d){var p=active_reaction,h=active_effect;set_active_reaction(null),set_active_effect(null);try{return d()}finally{set_active_reaction(p),set_active_effect(h)}}function listen_to_event_and_reset_event(d,p,h,g=h){d.addEventListener(p,()=>without_reactive_context(h));const m=d.__on_r;m?d.__on_r=()=>{m(),g(!0)}:d.__on_r=()=>g(!0),add_form_reset_listener()}function validate_effect(d){active_effect===null&&(active_reaction===null&&effect_orphan(),effect_in_unowned_derived()),is_destroying_effect&&effect_in_teardown()}function push_effect(d,p){var h=p.last;h===null?p.last=p.first=d:(h.next=d,d.prev=h,p.last=d)}function create_effect(d,p,h){var g=active_effect;g!==null&&(g.f&INERT)!==0&&(d|=INERT);var m={ctx:component_context,deps:null,nodes:null,f:d|DIRTY|CONNECTED,first:null,fn:p,last:null,next:null,parent:g,b:g&&g.b,prev:null,teardown:null,wv:0,ac:null};if(h)try{update_effect(m)}catch(y){throw destroy_effect(m),y}else p!==null&&schedule_effect(m);var _=m;if(h&&_.deps===null&&_.teardown===null&&_.nodes===null&&_.first===_.last&&(_.f&EFFECT_PRESERVED)===0&&(_=_.first,(d&BLOCK_EFFECT)!==0&&(d&EFFECT_TRANSPARENT)!==0&&_!==null&&(_.f|=EFFECT_TRANSPARENT)),_!==null&&(_.parent=g,g!==null&&push_effect(_,g),active_reaction!==null&&(active_reaction.f&DERIVED)!==0&&(d&ROOT_EFFECT)===0)){var b=active_reaction;(b.effects??(b.effects=[])).push(_)}return m}function effect_tracking(){return active_reaction!==null&&!untracking}function teardown(d){const p=create_effect(RENDER_EFFECT,null,!1);return set_signal_status(p,CLEAN),p.teardown=d,p}function user_effect(d){validate_effect();var p=active_effect.f,h=!active_reaction&&(p&BRANCH_EFFECT)!==0&&(p&REACTION_RAN)===0;if(h){var g=component_context;(g.e??(g.e=[])).push(d)}else return create_user_effect(d)}function create_user_effect(d){return create_effect(EFFECT|USER_EFFECT,d,!1)}function effect_root(d){Batch.ensure();const p=create_effect(ROOT_EFFECT|EFFECT_PRESERVED,d,!0);return()=>{destroy_effect(p)}}function component_root(d){Batch.ensure();const p=create_effect(ROOT_EFFECT|EFFECT_PRESERVED,d,!0);return(h={})=>new Promise(g=>{h.outro?pause_effect(p,()=>{destroy_effect(p),g(void 0)}):(destroy_effect(p),g(void 0))})}function effect(d){return create_effect(EFFECT,d,!1)}function async_effect(d){return create_effect(ASYNC|EFFECT_PRESERVED,d,!0)}function render_effect(d,p=0){return create_effect(RENDER_EFFECT|p,d,!0)}function template_effect(d,p=[],h=[],g=[]){flatten(g,p,h,m=>{create_effect(RENDER_EFFECT,()=>d(...m.map(get)),!0)})}function block(d,p=0){var h=create_effect(BLOCK_EFFECT|p,d,!0);return h}function branch(d){return create_effect(BRANCH_EFFECT|EFFECT_PRESERVED,d,!0)}function execute_effect_teardown(d){var p=d.teardown;if(p!==null){const h=is_destroying_effect,g=active_reaction;set_is_destroying_effect(!0),set_active_reaction(null);try{p.call(null)}finally{set_is_destroying_effect(h),set_active_reaction(g)}}}function destroy_effect_children(d,p=!1){var h=d.first;for(d.first=d.last=null;h!==null;){const m=h.ac;m!==null&&without_reactive_context(()=>{m.abort(STALE_REACTION)});var g=h.next;(h.f&ROOT_EFFECT)!==0?h.parent=null:destroy_effect(h,p),h=g}}function destroy_block_effect_children(d){for(var p=d.first;p!==null;){var h=p.next;(p.f&BRANCH_EFFECT)===0&&destroy_effect(p),p=h}}function destroy_effect(d,p=!0){var h=!1;(p||(d.f&HEAD_EFFECT)!==0)&&d.nodes!==null&&d.nodes.end!==null&&(remove_effect_dom(d.nodes.start,d.nodes.end),h=!0),destroy_effect_children(d,p&&!h),remove_reactions(d,0),set_signal_status(d,DESTROYED);var g=d.nodes&&d.nodes.t;if(g!==null)for(const _ of g)_.stop();execute_effect_teardown(d);var m=d.parent;m!==null&&m.first!==null&&unlink_effect(d),d.next=d.prev=d.teardown=d.ctx=d.deps=d.fn=d.nodes=d.ac=null}function remove_effect_dom(d,p){for(;d!==null;){var h=d===p?null:get_next_sibling(d);d.remove(),d=h}}function unlink_effect(d){var p=d.parent,h=d.prev,g=d.next;h!==null&&(h.next=g),g!==null&&(g.prev=h),p!==null&&(p.first===d&&(p.first=g),p.last===d&&(p.last=h))}function pause_effect(d,p,h=!0){var g=[];pause_children(d,g,!0);var m=()=>{h&&destroy_effect(d),p&&p()},_=g.length;if(_>0){var b=()=>--_||m();for(var y of g)y.out(b)}else m()}function pause_children(d,p,h){if((d.f&INERT)===0){d.f^=INERT;var g=d.nodes&&d.nodes.t;if(g!==null)for(const y of g)(y.is_global||h)&&p.push(y);for(var m=d.first;m!==null;){var _=m.next,b=(m.f&EFFECT_TRANSPARENT)!==0||(m.f&BRANCH_EFFECT)!==0&&(d.f&BLOCK_EFFECT)!==0;pause_children(m,p,b?h:!1),m=_}}}function resume_effect(d){resume_children(d,!0)}function resume_children(d,p){if((d.f&INERT)!==0){d.f^=INERT,(d.f&CLEAN)===0&&(set_signal_status(d,DIRTY),schedule_effect(d));for(var h=d.first;h!==null;){var g=h.next,m=(h.f&EFFECT_TRANSPARENT)!==0||(h.f&BRANCH_EFFECT)!==0;resume_children(h,m?p:!1),h=g}var _=d.nodes&&d.nodes.t;if(_!==null)for(const b of _)(b.is_global||p)&&b.in()}}function move_effect(d,p){if(d.nodes)for(var h=d.nodes.start,g=d.nodes.end;h!==null;){var m=h===g?null:get_next_sibling(h);p.append(h),h=m}}let is_updating_effect=!1,is_destroying_effect=!1;function set_is_destroying_effect(d){is_destroying_effect=d}let active_reaction=null,untracking=!1;function set_active_reaction(d){active_reaction=d}let active_effect=null;function set_active_effect(d){active_effect=d}let current_sources=null;function push_reaction_value(d){active_reaction!==null&&(current_sources===null?current_sources=[d]:current_sources.push(d))}let new_deps=null,skipped_deps=0,untracked_writes=null;function set_untracked_writes(d){untracked_writes=d}let write_version=1,read_version=0,update_version=read_version;function set_update_version(d){update_version=d}function increment_write_version(){return++write_version}function is_dirty(d){var p=d.f;if((p&DIRTY)!==0)return!0;if(p&DERIVED&&(d.f&=~WAS_MARKED),(p&MAYBE_DIRTY)!==0){for(var h=d.deps,g=h.length,m=0;m<g;m++){var _=h[m];if(is_dirty(_)&&update_derived(_),_.wv>d.wv)return!0}(p&CONNECTED)!==0&&batch_values===null&&set_signal_status(d,CLEAN)}return!1}function schedule_possible_effect_self_invalidation(d,p,h=!0){var g=d.reactions;if(g!==null&&!(current_sources!==null&&includes.call(current_sources,d)))for(var m=0;m<g.length;m++){var _=g[m];(_.f&DERIVED)!==0?schedule_possible_effect_self_invalidation(_,p,!1):p===_&&(h?set_signal_status(_,DIRTY):(_.f&CLEAN)!==0&&set_signal_status(_,MAYBE_DIRTY),schedule_effect(_))}}function update_reaction(d){var M;var p=new_deps,h=skipped_deps,g=untracked_writes,m=active_reaction,_=current_sources,b=component_context,y=untracking,w=update_version,x=d.f;new_deps=null,skipped_deps=0,untracked_writes=null,active_reaction=(x&(BRANCH_EFFECT|ROOT_EFFECT))===0?d:null,current_sources=null,set_component_context(d.ctx),untracking=!1,update_version=++read_version,d.ac!==null&&(without_reactive_context(()=>{d.ac.abort(STALE_REACTION)}),d.ac=null);try{d.f|=REACTION_IS_UPDATING;var E=d.fn,S=E();d.f|=REACTION_RAN;var k=d.deps,I=current_batch==null?void 0:current_batch.is_fork;if(new_deps!==null){var R;if(I||remove_reactions(d,skipped_deps),k!==null&&skipped_deps>0)for(k.length=skipped_deps+new_deps.length,R=0;R<new_deps.length;R++)k[skipped_deps+R]=new_deps[R];else d.deps=k=new_deps;if(effect_tracking()&&(d.f&CONNECTED)!==0)for(R=skipped_deps;R<k.length;R++)((M=k[R]).reactions??(M.reactions=[])).push(d)}else!I&&k!==null&&skipped_deps<k.length&&(remove_reactions(d,skipped_deps),k.length=skipped_deps);if(is_runes()&&untracked_writes!==null&&!untracking&&k!==null&&(d.f&(DERIVED|MAYBE_DIRTY|DIRTY))===0)for(R=0;R<untracked_writes.length;R++)schedule_possible_effect_self_invalidation(untracked_writes[R],d);if(m!==null&&m!==d){if(read_version++,m.deps!==null)for(let A=0;A<h;A+=1)m.deps[A].rv=read_version;if(p!==null)for(const A of p)A.rv=read_version;untracked_writes!==null&&(g===null?g=untracked_writes:g.push(...untracked_writes))}return(d.f&ERROR_VALUE)!==0&&(d.f^=ERROR_VALUE),S}catch(A){return handle_error(A)}finally{d.f^=REACTION_IS_UPDATING,new_deps=p,skipped_deps=h,untracked_writes=g,active_reaction=m,current_sources=_,set_component_context(b),untracking=y,update_version=w}}function remove_reaction(d,p){let h=p.reactions;if(h!==null){var g=index_of.call(h,d);if(g!==-1){var m=h.length-1;m===0?h=p.reactions=null:(h[g]=h[m],h.pop())}}if(h===null&&(p.f&DERIVED)!==0&&(new_deps===null||!includes.call(new_deps,p))){var _=p;(_.f&CONNECTED)!==0&&(_.f^=CONNECTED,_.f&=~WAS_MARKED),update_derived_status(_),freeze_derived_effects(_),remove_reactions(_,0)}}function remove_reactions(d,p){var h=d.deps;if(h!==null)for(var g=p;g<h.length;g++)remove_reaction(d,h[g])}function update_effect(d){var p=d.f;if((p&DESTROYED)===0){set_signal_status(d,CLEAN);var h=active_effect,g=is_updating_effect;active_effect=d,is_updating_effect=!0;try{(p&(BLOCK_EFFECT|MANAGED_EFFECT))!==0?destroy_block_effect_children(d):destroy_effect_children(d),execute_effect_teardown(d);var m=update_reaction(d);d.teardown=typeof m=="function"?m:null,d.wv=write_version;var _;DEV&&tracing_mode_flag&&(d.f&DIRTY)!==0&&d.deps}finally{is_updating_effect=g,active_effect=h}}}async function tick(){await Promise.resolve(),flushSync()}function get(d){var p=d.f,h=(p&DERIVED)!==0;if(active_reaction!==null&&!untracking){var g=active_effect!==null&&(active_effect.f&DESTROYED)!==0;if(!g&&(current_sources===null||!includes.call(current_sources,d))){var m=active_reaction.deps;if((active_reaction.f&REACTION_IS_UPDATING)!==0)d.rv<read_version&&(d.rv=read_version,new_deps===null&&m!==null&&m[skipped_deps]===d?skipped_deps++:new_deps===null?new_deps=[d]:new_deps.push(d));else{(active_reaction.deps??(active_reaction.deps=[])).push(d);var _=d.reactions;_===null?d.reactions=[active_reaction]:includes.call(_,active_reaction)||_.push(active_reaction)}}}if(is_destroying_effect&&old_values.has(d))return old_values.get(d);if(h){var b=d;if(is_destroying_effect){var y=b.v;return((b.f&CLEAN)===0&&b.reactions!==null||depends_on_old_values(b))&&(y=execute_derived(b)),old_values.set(b,y),y}var w=(b.f&CONNECTED)===0&&!untracking&&active_reaction!==null&&(is_updating_effect||(active_reaction.f&CONNECTED)!==0),x=(b.f&REACTION_RAN)===0;is_dirty(b)&&(w&&(b.f|=CONNECTED),update_derived(b)),w&&!x&&(unfreeze_derived_effects(b),reconnect(b))}if(batch_values!=null&&batch_values.has(d))return batch_values.get(d);if((d.f&ERROR_VALUE)!==0)throw d.v;return d.v}function reconnect(d){if(d.f|=CONNECTED,d.deps!==null)for(const p of d.deps)(p.reactions??(p.reactions=[])).push(d),(p.f&DERIVED)!==0&&(p.f&CONNECTED)===0&&(unfreeze_derived_effects(p),reconnect(p))}function depends_on_old_values(d){if(d.v===UNINITIALIZED)return!0;if(d.deps===null)return!1;for(const p of d.deps)if(old_values.has(p)||(p.f&DERIVED)!==0&&depends_on_old_values(p))return!0;return!1}function untrack(d){var p=untracking;try{return untracking=!0,d()}finally{untracking=p}}const PASSIVE_EVENTS=["touchstart","touchmove"];function is_passive_event(d){return PASSIVE_EVENTS.includes(d)}const event_symbol=Symbol("events"),all_registered_events=new Set,root_event_handles=new Set;function create_event(d,p,h,g={}){function m(_){if(g.capture||handle_event_propagation.call(p,_),!_.cancelBubble)return without_reactive_context(()=>h==null?void 0:h.call(this,_))}return d.startsWith("pointer")||d.startsWith("touch")||d==="wheel"?queue_micro_task(()=>{p.addEventListener(d,m,g)}):p.addEventListener(d,m,g),m}function event(d,p,h,g,m){var _={capture:g,passive:m},b=create_event(d,p,h,_);(p===document.body||p===window||p===document||p instanceof HTMLMediaElement)&&teardown(()=>{p.removeEventListener(d,b,_)})}function delegated(d,p,h){(p[event_symbol]??(p[event_symbol]={}))[d]=h}function delegate(d){for(var p=0;p<d.length;p++)all_registered_events.add(d[p]);for(var h of root_event_handles)h(d)}let last_propagated_event=null;function handle_event_propagation(d){var A,C;var p=this,h=p.ownerDocument,g=d.type,m=((A=d.composedPath)==null?void 0:A.call(d))||[],_=m[0]||d.target;last_propagated_event=d;var b=0,y=last_propagated_event===d&&d.__root;if(y){var w=m.indexOf(y);if(w!==-1&&(p===document||p===window)){d.__root=p;return}var x=m.indexOf(p);if(x===-1)return;w<=x&&(b=w)}if(_=m[b]||d.target,_!==p){define_property(d,"currentTarget",{configurable:!0,get(){return _||h}});var E=active_reaction,S=active_effect;set_active_reaction(null),set_active_effect(null);try{for(var k,I=[];_!==null;){var R=_.assignedSlot||_.parentNode||_.host||null;try{var M=(C=_[event_symbol])==null?void 0:C[g];M!=null&&(!_.disabled||d.target===_)&&M.call(_,d)}catch(N){k?I.push(N):k=N}if(d.cancelBubble||R===p||R===null)break;_=R}if(k){for(let N of I)queueMicrotask(()=>{throw N});throw k}}finally{d.__root=p,delete d.currentTarget,set_active_reaction(E),set_active_effect(S)}}}const policy=(kr=(Sr=globalThis==null?void 0:globalThis.window)==null?void 0:Sr.trustedTypes)==null?void 0:kr.createPolicy("svelte-trusted-html",{createHTML:d=>d});function create_trusted_html(d){return(policy==null?void 0:policy.createHTML(d))??d}function create_fragment_from_html(d,p=!1){var h=create_element("template");return d=d.replaceAll("<!>","<!---->"),h.innerHTML=p?create_trusted_html(d):d,h.content}function assign_nodes(d,p){var h=active_effect;h.nodes===null&&(h.nodes={start:d,end:p,a:null,t:null})}function from_html(d,p){var h=(p&TEMPLATE_FRAGMENT)!==0,g=(p&TEMPLATE_USE_IMPORT_NODE)!==0,m,_=!d.startsWith("<!>");return()=>{if(hydrating)return assign_nodes(hydrate_node,null),hydrate_node;m===void 0&&(m=create_fragment_from_html(_?d:"<!>"+d,!0),h||(m=get_first_child(m)));var b=g||is_firefox?document.importNode(m,!0):m.cloneNode(!0);if(h){var y=get_first_child(b),w=b.lastChild;assign_nodes(y,w)}else assign_nodes(b,b);return b}}function from_namespace(d,p,h="svg"){var g=!d.startsWith("<!>"),m=(p&TEMPLATE_FRAGMENT)!==0,_=`<${h}>${g?d:"<!>"+d}</${h}>`,b;return()=>{if(hydrating)return assign_nodes(hydrate_node,null),hydrate_node;if(!b){var y=create_fragment_from_html(_,!0),w=get_first_child(y);if(m)for(b=document.createDocumentFragment();get_first_child(w);)b.appendChild(get_first_child(w));else b=get_first_child(w)}var x=b.cloneNode(!0);if(m){var E=get_first_child(x),S=x.lastChild;assign_nodes(E,S)}else assign_nodes(x,x);return x}}function from_svg(d,p){return from_namespace(d,p,"svg")}function text(d=""){if(!hydrating){var p=create_text(d+"");return assign_nodes(p,p),p}var h=hydrate_node;return h.nodeType!==TEXT_NODE?(h.before(h=create_text()),set_hydrate_node(h)):merge_text_nodes(h),assign_nodes(h,h),h}function comment(){if(hydrating)return assign_nodes(hydrate_node,null),hydrate_node;var d=document.createDocumentFragment(),p=document.createComment(""),h=create_text();return d.append(p,h),assign_nodes(p,h),d}function append(d,p){if(hydrating){var h=active_effect;((h.f&REACTION_RAN)===0||h.nodes.end===null)&&(h.nodes.end=hydrate_node),hydrate_next();return}d!==null&&d.before(p)}let should_intro=!0;function set_text(d,p){var h=p==null?"":typeof p=="object"?p+"":p;h!==(d.__t??(d.__t=d.nodeValue))&&(d.__t=h,d.nodeValue=h+"")}function mount(d,p){return _mount(d,p)}function hydrate(d,p){init_operations(),p.intro=p.intro??!1;const h=p.target,g=hydrating,m=hydrate_node;try{for(var _=get_first_child(h);_&&(_.nodeType!==COMMENT_NODE||_.data!==HYDRATION_START);)_=get_next_sibling(_);if(!_)throw HYDRATION_ERROR;set_hydrating(!0),set_hydrate_node(_);const b=_mount(d,{...p,anchor:_});return set_hydrating(!1),b}catch(b){if(b instanceof Error&&b.message.split(`
|
|
2
2
|
`).some(y=>y.startsWith("https://svelte.dev/e/")))throw b;return b!==HYDRATION_ERROR&&console.warn("Failed to hydrate: ",b),p.recover===!1&&hydration_failed(),init_operations(),clear_text_content(h),set_hydrating(!1),mount(d,p)}finally{set_hydrating(g),set_hydrate_node(m)}}const listeners=new Map;function _mount(d,{target:p,anchor:h,props:g={},events:m,context:_,intro:b=!0}){init_operations();var y=new Set,w=S=>{for(var k=0;k<S.length;k++){var I=S[k];if(!y.has(I)){y.add(I);var R=is_passive_event(I);for(const C of[p,document]){var M=listeners.get(C);M===void 0&&(M=new Map,listeners.set(C,M));var A=M.get(I);A===void 0?(C.addEventListener(I,handle_event_propagation,{passive:R}),M.set(I,1)):M.set(I,A+1)}}}};w(array_from(all_registered_events)),root_event_handles.add(w);var x=void 0,E=component_root(()=>{var S=h??p.appendChild(create_text());return boundary(S,{pending:()=>{}},k=>{push({});var I=component_context;if(_&&(I.c=_),m&&(g.$$events=m),hydrating&&assign_nodes(k,null),should_intro=b,x=d(k,g)||{},should_intro=!0,hydrating&&(active_effect.nodes.end=hydrate_node,hydrate_node===null||hydrate_node.nodeType!==COMMENT_NODE||hydrate_node.data!==HYDRATION_END))throw hydration_mismatch(),HYDRATION_ERROR;pop()}),()=>{var M;for(var k of y)for(const A of[p,document]){var I=listeners.get(A),R=I.get(k);--R==0?(A.removeEventListener(k,handle_event_propagation),I.delete(k),I.size===0&&listeners.delete(A)):I.set(k,R)}root_event_handles.delete(w),S!==h&&((M=S.parentNode)==null||M.removeChild(S))}});return mounted_components.set(x,E),x}let mounted_components=new WeakMap;function unmount(d,p){const h=mounted_components.get(d);return h?(mounted_components.delete(d),h(p)):Promise.resolve()}class BranchManager{constructor(p,h=!0){Ie(this,"anchor");ze(this,zt,new Map);ze(this,jt,new Map);ze(this,Tt,new Map);ze(this,pn,new Set);ze(this,Dn,!0);ze(this,Ln,()=>{var p=current_batch;if(U(this,zt).has(p)){var h=U(this,zt).get(p),g=U(this,jt).get(h);if(g)resume_effect(g),U(this,pn).delete(h);else{var m=U(this,Tt).get(h);m&&(U(this,jt).set(h,m.effect),U(this,Tt).delete(h),m.fragment.lastChild.remove(),this.anchor.before(m.fragment),g=m.effect)}for(const[_,b]of U(this,zt)){if(U(this,zt).delete(_),_===p)break;const y=U(this,Tt).get(b);y&&(destroy_effect(y.effect),U(this,Tt).delete(b))}for(const[_,b]of U(this,jt)){if(_===h||U(this,pn).has(_))continue;const y=()=>{if(Array.from(U(this,zt).values()).includes(_)){var x=document.createDocumentFragment();move_effect(b,x),x.append(create_text()),U(this,Tt).set(_,{effect:b,fragment:x})}else destroy_effect(b);U(this,pn).delete(_),U(this,jt).delete(_)};U(this,Dn)||!g?(U(this,pn).add(_),pause_effect(b,y,!1)):y()}}});ze(this,Yn,p=>{U(this,zt).delete(p);const h=Array.from(U(this,zt).values());for(const[g,m]of U(this,Tt))h.includes(g)||(destroy_effect(m.effect),U(this,Tt).delete(g))});this.anchor=p,$e(this,Dn,h)}ensure(p,h){var g=current_batch,m=should_defer_append();if(h&&!U(this,jt).has(p)&&!U(this,Tt).has(p))if(m){var _=document.createDocumentFragment(),b=create_text();_.append(b),U(this,Tt).set(p,{effect:branch(()=>h(b)),fragment:_})}else U(this,jt).set(p,branch(()=>h(this.anchor)));if(U(this,zt).set(g,p),m){for(const[y,w]of U(this,jt))y===p?g.unskip_effect(w):g.skip_effect(w);for(const[y,w]of U(this,Tt))y===p?g.unskip_effect(w.effect):g.skip_effect(w.effect);g.oncommit(U(this,Ln)),g.ondiscard(U(this,Yn))}else hydrating&&(this.anchor=hydrate_node),U(this,Ln).call(this)}}zt=new WeakMap,jt=new WeakMap,Tt=new WeakMap,pn=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,Yn=new WeakMap;function onMount(d){component_context===null&&lifecycle_outside_component(),user_effect(()=>{const p=untrack(d);if(typeof p=="function")return p})}function onDestroy(d){component_context===null&&lifecycle_outside_component(),onMount(()=>()=>untrack(d))}function if_block(d,p,h=!1){hydrating&&hydrate_next();var g=new BranchManager(d),m=h?EFFECT_TRANSPARENT:0;function _(b,y){if(hydrating){const E=read_hydration_instruction(d);var w;if(E===HYDRATION_START?w=0:E===HYDRATION_START_ELSE?w=!1:w=parseInt(E.substring(1)),b!==w){var x=skip_nodes();set_hydrate_node(x),g.anchor=x,set_hydrating(!1),g.ensure(b,y),set_hydrating(!0);return}}g.ensure(b,y)}block(()=>{var b=!1;p((y,w=0)=>{b=!0,_(w,y)}),b||_(!1,null)},m)}const NAN=Symbol("NaN");function key(d,p,h){hydrating&&hydrate_next();var g=new BranchManager(d);block(()=>{var m=p();m!==m&&(m=NAN),g.ensure(m,h)})}function index(d,p){return p}function pause_effects(d,p,h){for(var g=[],m=p.length,_,b=p.length,y=0;y<m;y++){let S=p[y];pause_effect(S,()=>{if(_){if(_.pending.delete(S),_.done.add(S),_.pending.size===0){var k=d.outrogroups;destroy_effects(array_from(_.done)),k.delete(_),k.size===0&&(d.outrogroups=null)}}else b-=1},!1)}if(b===0){var w=g.length===0&&h!==null;if(w){var x=h,E=x.parentNode;clear_text_content(E),E.append(x),d.items.clear()}destroy_effects(p,!w)}else _={pending:new Set(p),done:new Set},(d.outrogroups??(d.outrogroups=new Set)).add(_)}function destroy_effects(d,p=!0){for(var h=0;h<d.length;h++)destroy_effect(d[h],p)}var offscreen_anchor;function each(d,p,h,g,m,_=null){var b=d,y=new Map,w=(p&EACH_IS_CONTROLLED)!==0;if(w){var x=d;b=hydrating?set_hydrate_node(get_first_child(x)):x.appendChild(create_text())}hydrating&&hydrate_next();var E=null,S=derived_safe_equal(()=>{var C=h();return is_array(C)?C:C==null?[]:array_from(C)}),k,I=!0;function R(){A.fallback=E,reconcile(A,k,b,p,g),E!==null&&(k.length===0?(E.f&EFFECT_OFFSCREEN)===0?resume_effect(E):(E.f^=EFFECT_OFFSCREEN,move(E,null,b)):pause_effect(E,()=>{E=null}))}var M=block(()=>{k=get(S);var C=k.length;let N=!1;if(hydrating){var $=read_hydration_instruction(b)===HYDRATION_START_ELSE;$!==(C===0)&&(b=skip_nodes(),set_hydrate_node(b),set_hydrating(!1),N=!0)}for(var O=new Set,F=current_batch,j=should_defer_append(),Y=0;Y<C;Y+=1){hydrating&&hydrate_node.nodeType===COMMENT_NODE&&hydrate_node.data===HYDRATION_END&&(b=hydrate_node,N=!0,set_hydrating(!1));var q=k[Y],ue=g(q,Y),oe=I?null:y.get(ue);oe?(oe.v&&internal_set(oe.v,q),oe.i&&internal_set(oe.i,Y),j&&F.unskip_effect(oe.e)):(oe=create_item(y,I?b:offscreen_anchor??(offscreen_anchor=create_text()),q,ue,Y,m,p,h),I||(oe.e.f|=EFFECT_OFFSCREEN),y.set(ue,oe)),O.add(ue)}if(C===0&&_&&!E&&(I?E=branch(()=>_(b)):(E=branch(()=>_(offscreen_anchor??(offscreen_anchor=create_text()))),E.f|=EFFECT_OFFSCREEN)),C>O.size&&each_key_duplicate(),hydrating&&C>0&&set_hydrate_node(skip_nodes()),!I)if(j){for(const[ce,se]of y)O.has(ce)||F.skip_effect(se.e);F.oncommit(R),F.ondiscard(()=>{})}else R();N&&set_hydrating(!0),get(S)}),A={effect:M,items:y,outrogroups:null,fallback:E};I=!1,hydrating&&(b=hydrate_node)}function skip_to_branch(d){for(;d!==null&&(d.f&BRANCH_EFFECT)===0;)d=d.next;return d}function reconcile(d,p,h,g,m){var oe,ce,se,xe,ve,Re,ke,me,Ce;var _=(g&EACH_IS_ANIMATED)!==0,b=p.length,y=d.items,w=skip_to_branch(d.effect.first),x,E=null,S,k=[],I=[],R,M,A,C;if(_)for(C=0;C<b;C+=1)R=p[C],M=m(R,C),A=y.get(M).e,(A.f&EFFECT_OFFSCREEN)===0&&((ce=(oe=A.nodes)==null?void 0:oe.a)==null||ce.measure(),(S??(S=new Set)).add(A));for(C=0;C<b;C+=1){if(R=p[C],M=m(R,C),A=y.get(M).e,d.outrogroups!==null)for(const T of d.outrogroups)T.pending.delete(A),T.done.delete(A);if((A.f&EFFECT_OFFSCREEN)!==0)if(A.f^=EFFECT_OFFSCREEN,A===w)move(A,null,h);else{var N=E?E.next:w;A===d.effect.last&&(d.effect.last=A.prev),A.prev&&(A.prev.next=A.next),A.next&&(A.next.prev=A.prev),link(d,E,A),link(d,A,N),move(A,N,h),E=A,k=[],I=[],w=skip_to_branch(E.next);continue}if((A.f&INERT)!==0&&(resume_effect(A),_&&((xe=(se=A.nodes)==null?void 0:se.a)==null||xe.unfix(),(S??(S=new Set)).delete(A))),A!==w){if(x!==void 0&&x.has(A)){if(k.length<I.length){var $=I[0],O;E=$.prev;var F=k[0],j=k[k.length-1];for(O=0;O<k.length;O+=1)move(k[O],$,h);for(O=0;O<I.length;O+=1)x.delete(I[O]);link(d,F.prev,j.next),link(d,E,F),link(d,j,$),w=$,E=j,C-=1,k=[],I=[]}else x.delete(A),move(A,w,h),link(d,A.prev,A.next),link(d,A,E===null?d.effect.first:E.next),link(d,E,A),E=A;continue}for(k=[],I=[];w!==null&&w!==A;)(x??(x=new Set)).add(w),I.push(w),w=skip_to_branch(w.next);if(w===null)continue}(A.f&EFFECT_OFFSCREEN)===0&&k.push(A),E=A,w=skip_to_branch(A.next)}if(d.outrogroups!==null){for(const T of d.outrogroups)T.pending.size===0&&(destroy_effects(array_from(T.done)),(ve=d.outrogroups)==null||ve.delete(T));d.outrogroups.size===0&&(d.outrogroups=null)}if(w!==null||x!==void 0){var Y=[];if(x!==void 0)for(A of x)(A.f&INERT)===0&&Y.push(A);for(;w!==null;)(w.f&INERT)===0&&w!==d.fallback&&Y.push(w),w=skip_to_branch(w.next);var q=Y.length;if(q>0){var ue=(g&EACH_IS_CONTROLLED)!==0&&b===0?h:null;if(_){for(C=0;C<q;C+=1)(ke=(Re=Y[C].nodes)==null?void 0:Re.a)==null||ke.measure();for(C=0;C<q;C+=1)(Ce=(me=Y[C].nodes)==null?void 0:me.a)==null||Ce.fix()}pause_effects(d,Y,ue)}}_&&queue_micro_task(()=>{var T,z;if(S!==void 0)for(A of S)(z=(T=A.nodes)==null?void 0:T.a)==null||z.apply()})}function create_item(d,p,h,g,m,_,b,y){var w=(b&EACH_ITEM_REACTIVE)!==0?(b&EACH_ITEM_IMMUTABLE)===0?mutable_source(h,!1,!1):source(h):null,x=(b&EACH_INDEX_REACTIVE)!==0?source(m):null;return{v:w,i:x,e:branch(()=>(_(p,w??h,x??m,y),()=>{d.delete(g)}))}}function move(d,p,h){if(d.nodes)for(var g=d.nodes.start,m=d.nodes.end,_=p&&(p.f&EFFECT_OFFSCREEN)===0?p.nodes.start:h;g!==null;){var b=get_next_sibling(g);if(_.before(g),g===m)return;g=b}}function link(d,p,h){p===null?d.effect.first=h:p.next=h,h===null?d.effect.last=p:h.prev=p}function html(d,p,h=!1,g=!1,m=!1){var _=d,b="";template_effect(()=>{var y=active_effect;if(b===(b=p()??"")){hydrating&&hydrate_next();return}if(y.nodes!==null&&(remove_effect_dom(y.nodes.start,y.nodes.end),y.nodes=null),b!==""){if(hydrating){hydrate_node.data;for(var w=hydrate_next(),x=w;w!==null&&(w.nodeType!==COMMENT_NODE||w.data!=="");)x=w,w=get_next_sibling(w);if(w===null)throw hydration_mismatch(),HYDRATION_ERROR;assign_nodes(hydrate_node,x),_=set_hydrate_node(w);return}var E=b+"";h?E=`<svg>${E}</svg>`:g&&(E=`<math>${E}</math>`);var S=create_fragment_from_html(E);if((h||g)&&(S=get_first_child(S)),assign_nodes(get_first_child(S),S.lastChild),h||g)for(;get_first_child(S);)_.before(get_first_child(S));else _.before(S)}})}const now=()=>performance.now(),raf={tick:d=>requestAnimationFrame(d),now:()=>now(),tasks:new Set};function run_tasks(){const d=raf.now();raf.tasks.forEach(p=>{p.c(d)||(raf.tasks.delete(p),p.f())}),raf.tasks.size!==0&&raf.tick(run_tasks)}function loop(d){let p;return raf.tasks.size===0&&raf.tick(run_tasks),{promise:new Promise(h=>{raf.tasks.add(p={c:d,f:h})}),abort(){raf.tasks.delete(p)}}}function dispatch_event(d,p){without_reactive_context(()=>{d.dispatchEvent(new CustomEvent(p))})}function css_property_to_camelcase(d){if(d==="float")return"cssFloat";if(d==="offset")return"cssOffset";if(d.startsWith("--"))return d;const p=d.split("-");return p.length===1?p[0]:p[0]+p.slice(1).map(h=>h[0].toUpperCase()+h.slice(1)).join("")}function css_to_keyframe(d){const p={},h=d.split(";");for(const g of h){const[m,_]=g.split(":");if(!m||_===void 0)break;const b=css_property_to_camelcase(m.trim());p[b]=_.trim()}return p}const linear=d=>d;function transition(d,p,h,g){var A;var m=(d&TRANSITION_GLOBAL)!==0,_="both",b,y=p.inert,w=p.style.overflow,x,E;function S(){return without_reactive_context(()=>b??(b=h()(p,(g==null?void 0:g())??{},{direction:_})))}var k={is_global:m,in(){p.inert=y,x=animate(p,S(),E,1,()=>{dispatch_event(p,"introend"),x==null||x.abort(),x=b=void 0,p.style.overflow=w})},out(C){p.inert=!0,E=animate(p,S(),x,0,()=>{dispatch_event(p,"outroend"),C==null||C()})},stop:()=>{x==null||x.abort(),E==null||E.abort()}},I=active_effect;if(((A=I.nodes).t??(A.t=[])).push(k),should_intro){var R=m;if(!R){for(var M=I.parent;M&&(M.f&EFFECT_TRANSPARENT)!==0;)for(;(M=M.parent)&&(M.f&BLOCK_EFFECT)===0;);R=!M||(M.f&REACTION_RAN)!==0}R&&effect(()=>{untrack(()=>k.in())})}}function animate(d,p,h,g,m){var _=g===1;if(is_function(p)){var b,y=!1;return queue_micro_task(()=>{if(!y){var A=p({direction:_?"in":"out"});b=animate(d,A,h,g,m)}}),{abort:()=>{y=!0,b==null||b.abort()},deactivate:()=>b.deactivate(),reset:()=>b.reset(),t:()=>b.t()}}if(h==null||h.deactivate(),!(p!=null&&p.duration)&&!(p!=null&&p.delay))return dispatch_event(d,_?"introstart":"outrostart"),m(),{abort:noop,deactivate:noop,reset:noop,t:()=>g};const{delay:w=0,css:x,tick:E,easing:S=linear}=p;var k=[];if(_&&h===void 0&&(E&&E(0,1),x)){var I=css_to_keyframe(x(0,1));k.push(I,I)}var R=()=>1-g,M=d.animate(k,{duration:w,fill:"forwards"});return M.onfinish=()=>{M.cancel(),dispatch_event(d,_?"introstart":"outrostart");var A=(h==null?void 0:h.t())??1-g;h==null||h.abort();var C=g-A,N=p.duration*Math.abs(C),$=[];if(N>0){var O=!1;if(x)for(var F=Math.ceil(N/16.666666666666668),j=0;j<=F;j+=1){var Y=A+C*S(j/F),q=css_to_keyframe(x(Y,1-Y));$.push(q),O||(O=q.overflow==="hidden")}O&&(d.style.overflow="hidden"),R=()=>{var ue=M.currentTime;return A+C*S(ue/N)},E&&loop(()=>{if(M.playState!=="running")return!1;var ue=R();return E(ue,1-ue),!0})}M=d.animate($,{duration:N,fill:"forwards"}),M.onfinish=()=>{R=()=>g,E==null||E(g,1-g),m()}},{abort:()=>{M&&(M.cancel(),M.effect=null,M.onfinish=noop)},deactivate:()=>{m=noop},reset:()=>{g===0&&(E==null||E(1,0))},t:()=>R()}}function append_styles(d,p){effect(()=>{var h=d.getRootNode(),g=h.host?h:h.head??h.ownerDocument.head;if(!g.querySelector("#"+p.hash)){const m=create_element("style");m.id=p.hash,m.textContent=p.code,g.appendChild(m)}})}const whitespace=[...`
|
|
3
3
|
\r\f \v\uFEFF`];function to_class(d,p,h){var g=d==null?"":""+d;if(p&&(g=g?g+" "+p:p),h){for(var m in h)if(h[m])g=g?g+" "+m:m;else if(g.length)for(var _=m.length,b=0;(b=g.indexOf(m,b))>=0;){var y=b+_;(b===0||whitespace.includes(g[b-1]))&&(y===g.length||whitespace.includes(g[y]))?g=(b===0?"":g.substring(0,b))+g.substring(y+1):b=y}}return g===""?null:g}function to_style(d,p){return d==null?null:String(d)}function set_class(d,p,h,g,m,_){var b=d.__className;if(hydrating||b!==h||b===void 0){var y=to_class(h,g,_);(!hydrating||y!==d.getAttribute("class"))&&(y==null?d.removeAttribute("class"):p?d.className=y:d.setAttribute("class",y)),d.__className=h}else if(_&&m!==_)for(var w in _){var x=!!_[w];(m==null||x!==!!m[w])&&d.classList.toggle(w,x)}return _}function set_style(d,p,h,g){var m=d.__style;if(hydrating||m!==p){var _=to_style(p);(!hydrating||_!==d.getAttribute("style"))&&(_==null?d.removeAttribute("style"):d.style.cssText=_),d.__style=p}return g}function select_option(d,p,h=!1){if(d.multiple){if(p==null)return;if(!is_array(p))return select_multiple_invalid_value();for(var g of d.options)g.selected=p.includes(get_option_value(g));return}for(g of d.options){var m=get_option_value(g);if(is(m,p)){g.selected=!0;return}}(!h||p!==void 0)&&(d.selectedIndex=-1)}function init_select(d){var p=new MutationObserver(()=>{select_option(d,d.__value)});p.observe(d,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),teardown(()=>{p.disconnect()})}function bind_select_value(d,p,h=p){var g=new WeakSet,m=!0;listen_to_event_and_reset_event(d,"change",_=>{var b=_?"[selected]":":checked",y;if(d.multiple)y=[].map.call(d.querySelectorAll(b),get_option_value);else{var w=d.querySelector(b)??d.querySelector("option:not([disabled])");y=w&&get_option_value(w)}h(y),current_batch!==null&&g.add(current_batch)}),effect(()=>{var _=p();if(d===document.activeElement){var b=previous_batch??current_batch;if(g.has(b))return}if(select_option(d,_,m),m&&_===void 0){var y=d.querySelector(":checked");y!==null&&(_=get_option_value(y),h(_))}d.__value=_,m=!1}),init_select(d)}function get_option_value(d){return"__value"in d?d.__value:d.value}const IS_CUSTOM_ELEMENT=Symbol("is custom element"),IS_HTML=Symbol("is html"),LINK_TAG=IS_XHTML?"link":"LINK";function remove_input_defaults(d){if(hydrating){var p=!1,h=()=>{if(!p){if(p=!0,d.hasAttribute("value")){var g=d.value;set_attribute(d,"value",null),d.value=g}if(d.hasAttribute("checked")){var m=d.checked;set_attribute(d,"checked",null),d.checked=m}}};d.__on_r=h,queue_micro_task(h),add_form_reset_listener()}}function set_checked(d,p){var h=get_attributes(d);h.checked!==(h.checked=p??void 0)&&(d.checked=p)}function set_attribute(d,p,h,g){var m=get_attributes(d);hydrating&&(m[p]=d.getAttribute(p),p==="src"||p==="srcset"||p==="href"&&d.nodeName===LINK_TAG)||m[p]!==(m[p]=h)&&(p==="loading"&&(d[LOADING_ATTR_SYMBOL]=h),h==null?d.removeAttribute(p):typeof h!="string"&&get_setters(d).includes(p)?d[p]=h:d.setAttribute(p,h))}function get_attributes(d){return d.__attributes??(d.__attributes={[IS_CUSTOM_ELEMENT]:d.nodeName.includes("-"),[IS_HTML]:d.namespaceURI===NAMESPACE_HTML})}var setters_cache=new Map;function get_setters(d){var p=d.getAttribute("is")||d.nodeName,h=setters_cache.get(p);if(h)return h;setters_cache.set(p,h=[]);for(var g,m=d,_=Element.prototype;_!==m;){g=get_descriptors(m);for(var b in g)g[b].set&&h.push(b);m=get_prototype_of(m)}return h}function bind_value(d,p,h=p){var g=new WeakSet;listen_to_event_and_reset_event(d,"input",async m=>{var _=m?d.defaultValue:d.value;if(_=is_numberlike_input(d)?to_number(_):_,h(_),current_batch!==null&&g.add(current_batch),await tick(),_!==(_=p())){var b=d.selectionStart,y=d.selectionEnd,w=d.value.length;if(d.value=_??"",y!==null){var x=d.value.length;b===y&&y===w&&x>w?(d.selectionStart=x,d.selectionEnd=x):(d.selectionStart=b,d.selectionEnd=Math.min(y,x))}}}),(hydrating&&d.defaultValue!==d.value||untrack(p)==null&&d.value)&&(h(is_numberlike_input(d)?to_number(d.value):d.value),current_batch!==null&&g.add(current_batch)),render_effect(()=>{var m=p();if(d===document.activeElement){var _=previous_batch??current_batch;if(g.has(_))return}is_numberlike_input(d)&&m===to_number(d.value)||d.type==="date"&&!m&&!d.value||m!==d.value&&(d.value=m??"")})}function is_numberlike_input(d){var p=d.type;return p==="number"||p==="range"}function to_number(d){return d===""?null:+d}function is_bound_this(d,p){return d===p||(d==null?void 0:d[STATE_SYMBOL])===p}function bind_this(d={},p,h,g){return effect(()=>{var m,_;return render_effect(()=>{m=_,_=[],untrack(()=>{d!==h(..._)&&(p(d,..._),m&&is_bound_this(h(...m),d)&&p(null,...m))})}),()=>{queue_micro_task(()=>{_&&is_bound_this(h(..._),d)&&p(null,..._)})}}),d}let is_store_binding=!1;function capture_store_binding(d){var p=is_store_binding;try{return is_store_binding=!1,[d(),is_store_binding]}finally{is_store_binding=p}}function prop(d,p,h,g){var N;var m=(h&PROPS_IS_BINDABLE)!==0,_=(h&PROPS_IS_LAZY_INITIAL)!==0,b=g,y=!0,w=()=>(y&&(y=!1,b=_?untrack(g):g),b),x;if(m){var E=STATE_SYMBOL in d||LEGACY_PROPS in d;x=((N=get_descriptor(d,p))==null?void 0:N.set)??(E&&p in d?$=>d[p]=$:void 0)}var S,k=!1;m?[S,k]=capture_store_binding(()=>d[p]):S=d[p],S===void 0&&g!==void 0&&(S=w(),x&&(props_invalid_value(),x(S)));var I;if(I=()=>{var $=d[p];return $===void 0?w():(y=!0,$)},(h&PROPS_IS_UPDATED)===0)return I;if(x){var R=d.$$legacy;return(function($,O){return arguments.length>0?((!O||R||k)&&x(O?I():$),$):I()})}var M=!1,A=((h&PROPS_IS_IMMUTABLE)!==0?derived:derived_safe_equal)(()=>(M=!1,I()));m&&get(A);var C=active_effect;return(function($,O){if(arguments.length>0){const F=O?get(A):m?proxy($):$;return set(A,F),M=!0,b!==void 0&&(b=F),$}return is_destroying_effect&&M||(C.f&DESTROYED)!==0?A.v:get(A)})}function createClassComponent(d){return new Svelte4Component(d)}class Svelte4Component{constructor(p){ze(this,Jt);ze(this,Mt);var _;var h=new Map,g=(b,y)=>{var w=mutable_source(y,!1,!1);return h.set(b,w),w};const m=new Proxy({...p.props||{},$$events:{}},{get(b,y){return get(h.get(y)??g(y,Reflect.get(b,y)))},has(b,y){return y===LEGACY_PROPS?!0:(get(h.get(y)??g(y,Reflect.get(b,y))),Reflect.has(b,y))},set(b,y,w){return set(h.get(y)??g(y,w),w),Reflect.set(b,y,w)}});$e(this,Mt,(p.hydrate?hydrate:mount)(p.component,{target:p.target,anchor:p.anchor,props:m,context:p.context,intro:p.intro??!1,recover:p.recover})),(!((_=p==null?void 0:p.props)!=null&&_.$$host)||p.sync===!1)&&flushSync(),$e(this,Jt,m.$$events);for(const b of Object.keys(U(this,Mt)))b==="$set"||b==="$destroy"||b==="$on"||define_property(this,b,{get(){return U(this,Mt)[b]},set(y){U(this,Mt)[b]=y},enumerable:!0});U(this,Mt).$set=b=>{Object.assign(m,b)},U(this,Mt).$destroy=()=>{unmount(U(this,Mt))}}$set(p){U(this,Mt).$set(p)}$on(p,h){U(this,Jt)[p]=U(this,Jt)[p]||[];const g=(...m)=>h.call(this,...m);return U(this,Jt)[p].push(g),()=>{U(this,Jt)[p]=U(this,Jt)[p].filter(m=>m!==g)}}$destroy(){U(this,Mt).$destroy()}}Jt=new WeakMap,Mt=new WeakMap;let SvelteElement;typeof HTMLElement=="function"&&(SvelteElement=class extends HTMLElement{constructor(p,h,g){super();Ie(this,"$$ctor");Ie(this,"$$s");Ie(this,"$$c");Ie(this,"$$cn",!1);Ie(this,"$$d",{});Ie(this,"$$r",!1);Ie(this,"$$p_d",{});Ie(this,"$$l",{});Ie(this,"$$l_u",new Map);Ie(this,"$$me");Ie(this,"$$shadowRoot",null);this.$$ctor=p,this.$$s=h,g&&(this.$$shadowRoot=this.attachShadow(g))}addEventListener(p,h,g){if(this.$$l[p]=this.$$l[p]||[],this.$$l[p].push(h),this.$$c){const m=this.$$c.$on(p,h);this.$$l_u.set(h,m)}super.addEventListener(p,h,g)}removeEventListener(p,h,g){if(super.removeEventListener(p,h,g),this.$$c){const m=this.$$l_u.get(h);m&&(m(),this.$$l_u.delete(h))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let p=function(m){return _=>{const b=create_element("slot");m!=="default"&&(b.name=m),append(_,b)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const h={},g=get_custom_elements_slots(this);for(const m of this.$$s)m in g&&(m==="default"&&!this.$$d.children?(this.$$d.children=p(m),h.default=!0):h[m]=p(m));for(const m of this.attributes){const _=this.$$g_p(m.name);_ in this.$$d||(this.$$d[_]=get_custom_element_value(_,m.value,this.$$p_d,"toProp"))}for(const m in this.$$p_d)!(m in this.$$d)&&this[m]!==void 0&&(this.$$d[m]=this[m],delete this[m]);this.$$c=createClassComponent({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:h,$$host:this}}),this.$$me=effect_root(()=>{render_effect(()=>{var m;this.$$r=!0;for(const _ of object_keys(this.$$c)){if(!((m=this.$$p_d[_])!=null&&m.reflect))continue;this.$$d[_]=this.$$c[_];const b=get_custom_element_value(_,this.$$d[_],this.$$p_d,"toAttribute");b==null?this.removeAttribute(this.$$p_d[_].attribute||_):this.setAttribute(this.$$p_d[_].attribute||_,b)}this.$$r=!1})});for(const m in this.$$l)for(const _ of this.$$l[m]){const b=this.$$c.$on(m,_);this.$$l_u.set(_,b)}this.$$l={}}}attributeChangedCallback(p,h,g){var m;this.$$r||(p=this.$$g_p(p),this.$$d[p]=get_custom_element_value(p,g,this.$$p_d,"toProp"),(m=this.$$c)==null||m.$set({[p]:this.$$d[p]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(p){return object_keys(this.$$p_d).find(h=>this.$$p_d[h].attribute===p||!this.$$p_d[h].attribute&&h.toLowerCase()===p)||p}});function get_custom_element_value(d,p,h,g){var _;const m=(_=h[d])==null?void 0:_.type;if(p=m==="Boolean"&&typeof p!="boolean"?p!=null:p,!g||!h[d])return p;if(g==="toAttribute")switch(m){case"Object":case"Array":return p==null?null:JSON.stringify(p);case"Boolean":return p?"":null;case"Number":return p??null;default:return p}else switch(m){case"Object":case"Array":return p&&JSON.parse(p);case"Boolean":return p;case"Number":return p!=null?+p:p;default:return p}}function get_custom_elements_slots(d){const p={};return d.childNodes.forEach(h=>{p[h.slot||"default"]=!0}),p}function create_custom_element(d,p,h,g,m,_){let b=class extends SvelteElement{constructor(){super(d,h,m),this.$$p_d=p}static get observedAttributes(){return object_keys(p).map(y=>(p[y].attribute||y).toLowerCase())}};return object_keys(p).forEach(y=>{define_property(b.prototype,y,{get(){return this.$$c&&y in this.$$c?this.$$c[y]:this.$$d[y]},set(w){var S;w=get_custom_element_value(y,w,p),this.$$d[y]=w;var x=this.$$c;if(x){var E=(S=get_descriptor(x,y))==null?void 0:S.get;E?x[y]=w:x.$set({[y]:w})}}})}),g.forEach(y=>{define_property(b.prototype,y,{get(){var w;return(w=this.$$c)==null?void 0:w[y]}})}),d.element=b,b}const DEFAULT_CONFIG={endpoint:"",position:"bottom-right",theme:"dark",buttonColor:"#3b82f6",maxScreenshots:5,maxConsoleLogs:50,captureConsole:!0},SENSITIVE_PATTERNS=[/\b(api[_-]?key|apikey|api[_-]?token|access[_-]?token|auth[_-]?token|bearer)\s*[:=]\s*["']?[\w\-\.]+["']?/gi,/\bBearer\s+[\w\-\.]+/gi,/\b(sk|pk|rk)[_-][a-zA-Z0-9]{20,}/gi,/\bghp_[a-zA-Z0-9]{36,}/gi,/\bsk-[a-zA-Z0-9]{20,}/gi,/\b(password|passwd|pwd|secret|credential)\s*[:=]\s*["']?[^"'\s,}{]+["']?/gi,/\beyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*/gi,/\b\d{4}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}\b/g,/\b(email|e-mail)\s*[:=]\s*["']?[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}["']?/gi,/-----BEGIN\s+(RSA\s+)?PRIVATE\s+KEY-----[\s\S]*?-----END\s+(RSA\s+)?PRIVATE\s+KEY-----/gi,/\b(AKIA|ABIA|ACCA|AGPA|AIDA|AIPA|AKIA|ANPA|ANVA|AROA|APKA|ASCA|ASIA)[A-Z0-9]{16}\b/g,/\b(aws[_-]?secret[_-]?access[_-]?key|aws[_-]?access[_-]?key[_-]?id)\s*[:=]\s*["']?[\w\/\+]+["']?/gi],REDACTED="[REDACTED]";function filterSensitiveData(d){let p=d;for(const h of SENSITIVE_PATTERNS)h.lastIndex=0,p=p.replace(h,REDACTED);return p}let maxEntries=50;const capturedLogs=[];let capturing$1=!1;const originalConsole={log:console.log,error:console.error,warn:console.warn,info:console.info,debug:console.debug,trace:console.trace};function safeStringify(d){if(d===null)return"null";if(d===void 0)return"undefined";if(typeof d=="string")return d;if(typeof d=="number"||typeof d=="boolean")return String(d);if(typeof d=="symbol")return d.toString();if(typeof d=="function")return`[Function: ${d.name||"anonymous"}]`;if(d instanceof Error)return`${d.name}: ${d.message}${d.stack?`
|
|
4
4
|
`+d.stack:""}`;if(typeof d=="object")try{const p=new WeakSet;return JSON.stringify(d,(h,g)=>{if(typeof g=="object"&&g!==null){if(p.has(g))return"[Circular]";p.add(g)}return typeof g=="function"?`[Function: ${g.name||"anonymous"}]`:g instanceof Error?`${g.name}: ${g.message}`:g},2)}catch{return"[Object - stringify failed]"}return String(d)}function captureStackInfo(){const d=new Error().stack;if(!d)return{};const h=d.split(`
|
|
@@ -76,7 +76,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
76
76
|
***************************************************************************** */function t(d,p){var h=typeof Symbol=="function"&&d[Symbol.iterator];if(!h)return d;var g,m,_=h.call(d),b=[];try{for(;(p===void 0||p-- >0)&&!(g=_.next()).done;)b.push(g.value)}catch(y){m={error:y}}finally{try{g&&!g.done&&(h=_.return)&&h.call(_)}finally{if(m)throw m.error}}return b}var n;(function(d){d[d.NotStarted=0]="NotStarted",d[d.Running=1]="Running",d[d.Stopped=2]="Stopped"})(n||(n={}));var e={type:"xstate.init"};function r(d){return d===void 0?[]:[].concat(d)}function o(d){return{type:"xstate.assign",assignment:d}}function i(d,p){return typeof(d=typeof d=="string"&&p&&p[d]?p[d]:d)=="string"?{type:d}:typeof d=="function"?{type:d.name,exec:d}:d}function a(d){return function(p){return d===p}}function u(d){return typeof d=="string"?{type:d}:d}function c(d,p){return{value:d,context:p,actions:[],changed:!1,matches:a(d)}}function f(d,p,h){var g=p,m=!1;return[d.filter((function(_){if(_.type==="xstate.assign"){m=!0;var b=Object.assign({},g);return typeof _.assignment=="function"?b=_.assignment(g,h):Object.keys(_.assignment).forEach((function(y){b[y]=typeof _.assignment[y]=="function"?_.assignment[y](g,h):_.assignment[y]})),g=b,!1}return!0})),g,m]}function s(d,p){p===void 0&&(p={});var h=t(f(r(d.states[d.initial].entry).map((function(b){return i(b,p.actions)})),d.context,e),2),g=h[0],m=h[1],_={config:d,_options:p,initialState:{value:d.initial,actions:g,context:m,matches:a(d.initial)},transition:function(b,y){var w,x,E=typeof b=="string"?{value:b,context:d.context}:b,S=E.value,k=E.context,I=u(y),R=d.states[S];if(R.on){var M=r(R.on[I.type]);try{for(var A=(function(me){var Ce=typeof Symbol=="function"&&Symbol.iterator,T=Ce&&me[Ce],z=0;if(T)return T.call(me);if(me&&typeof me.length=="number")return{next:function(){return me&&z>=me.length&&(me=void 0),{value:me&&me[z++],done:!me}}};throw new TypeError(Ce?"Object is not iterable.":"Symbol.iterator is not defined.")})(M),C=A.next();!C.done;C=A.next()){var N=C.value;if(N===void 0)return c(S,k);var $=typeof N=="string"?{target:N}:N,O=$.target,F=$.actions,j=F===void 0?[]:F,Y=$.cond,q=Y===void 0?function(){return!0}:Y,ue=O===void 0,oe=O??S,ce=d.states[oe];if(q(k,I)){var se=t(f((ue?r(j):[].concat(R.exit,j,ce.entry).filter((function(me){return me}))).map((function(me){return i(me,_._options.actions)})),k,I),3),xe=se[0],ve=se[1],Re=se[2],ke=O??S;return{value:ke,context:ve,actions:xe,changed:O!==S||xe.length>0||Re,matches:a(ke)}}}}catch(me){w={error:me}}finally{try{C&&!C.done&&(x=A.return)&&x.call(A)}finally{if(w)throw w.error}}}return c(S,k)}};return _}var l=function(d,p){return d.actions.forEach((function(h){var g=h.exec;return g&&g(d.context,p)}))};function v(d){var p=d.initialState,h=n.NotStarted,g=new Set,m={_machine:d,send:function(_){h===n.Running&&(p=d.transition(p,_),l(p,u(_)),g.forEach((function(b){return b(p)})))},subscribe:function(_){return g.add(_),_(p),{unsubscribe:function(){return g.delete(_)}}},start:function(_){if(_){var b=typeof _=="object"?_:{context:d.config.context,value:_};p={value:b.value,actions:[],context:b.context,matches:a(b.value)}}return h=n.Running,l(p,e),m},stop:function(){return h=n.Stopped,g.clear(),m},get state(){return p},get status(){return h}};return m}function discardPriorSnapshots(d,p){for(let h=d.length-1;h>=0;h--){const g=d[h];if(g.type===EventType.Meta&&g.timestamp<=p)return d.slice(h)}return d}function createPlayerService(d,{getCastFn:p,applyEventsSynchronously:h,emitter:g}){const m=s({id:"player",context:d,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:o({lastPlayedEvent:(_,b)=>b.type==="CAST_EVENT"?b.payload.event:_.lastPlayedEvent}),recordTimeOffset:o((_,b)=>{let y=_.timeOffset;return"payload"in b&&"timeOffset"in b.payload&&(y=b.payload.timeOffset),Object.assign(Object.assign({},_),{timeOffset:y,baselineTime:_.events[0].timestamp+y})}),play(_){var b;const{timer:y,events:w,baselineTime:x,lastPlayedEvent:E}=_;y.clear();for(const R of w)addDelay(R,x);const S=discardPriorSnapshots(w,x);let k=E==null?void 0:E.timestamp;(E==null?void 0:E.type)===EventType.IncrementalSnapshot&&E.data.source===IncrementalSource.MouseMove&&(k=E.timestamp+((b=E.data.positions[0])===null||b===void 0?void 0:b.timeOffset)),x<(k||0)&&g.emit(ReplayerEvents.PlayBack);const I=new Array;for(const R of S)if(!(k&&k<x&&(R.timestamp<=k||R===E)))if(R.timestamp<x)I.push(R);else{const M=p(R,!1);y.addAction({doAction:()=>{M()},delay:R.delay})}h(I),g.emit(ReplayerEvents.Flush),y.start()},pause(_){_.timer.clear()},resetLastPlayedEvent:o(_=>Object.assign(Object.assign({},_),{lastPlayedEvent:null})),startLive:o({baselineTime:(_,b)=>(_.timer.toggleLiveMode(!0),_.timer.start(),b.type==="TO_LIVE"&&b.payload.baselineTime?b.payload.baselineTime:Date.now())}),addEvent:o((_,b)=>{const{baselineTime:y,timer:w,events:x}=_;if(b.type==="ADD_EVENT"){const{event:E}=b.payload;addDelay(E,y);let S=x.length-1;if(!x[S]||x[S].timestamp<=E.timestamp)x.push(E);else{let R=-1,M=0;for(;M<=S;){const A=Math.floor((M+S)/2);x[A].timestamp<=E.timestamp?M=A+1:S=A-1}R===-1&&(R=M),x.splice(R,0,E)}const k=E.timestamp<y,I=p(E,k);k?I():w.isActive()&&w.addAction({doAction:()=>{I()},delay:E.delay})}return Object.assign(Object.assign({},_),{events:x})})}});return v(m)}function createSpeedService(d){const p=s({id:"speed",context:d,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(h,g)=>{"payload"in g&&h.timer.setSpeed(g.payload.speed)},recordSpeed:o({normalSpeed:h=>h.timer.speed}),restoreSpeed:h=>{h.timer.setSpeed(h.normalSpeed)}}});return v(p)}const rules=d=>[`.${d} { background: currentColor }`,"noscript { display: none !important; }"],webGLVarMap=new Map;function variableListFor(d,p){let h=webGLVarMap.get(d);return h||(h=new Map,webGLVarMap.set(d,h)),h.has(p)||h.set(p,[]),h.get(p)}function deserializeArg(d,p,h){return g=>__awaiter(this,void 0,void 0,function*(){if(g&&typeof g=="object"&&"rr_type"in g)if(h&&(h.isUnchanged=!1),g.rr_type==="ImageBitmap"&&"args"in g){const m=yield deserializeArg(d,p,h)(g.args);return yield createImageBitmap.apply(null,m)}else if("index"in g){if(h||p===null)return g;const{rr_type:m,index:_}=g;return variableListFor(p,m)[_]}else if("args"in g){const{rr_type:m,args:_}=g,b=window[m];return new b(...yield Promise.all(_.map(deserializeArg(d,p,h))))}else{if("base64"in g)return decode(g.base64);if("src"in g){const m=d.get(g.src);if(m)return m;{const _=new Image;return _.src=g.src,d.set(g.src,_),_}}else if("data"in g&&g.rr_type==="Blob"){const m=yield Promise.all(g.data.map(deserializeArg(d,p,h)));return new Blob(m,{type:g.type})}}else if(Array.isArray(g))return yield Promise.all(g.map(deserializeArg(d,p,h)));return g})}function getContext(d,p){try{return p===CanvasContext.WebGL?d.getContext("webgl")||d.getContext("experimental-webgl"):d.getContext("webgl2")}catch{return null}}const WebGLVariableConstructorsNames=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function saveToWebGLVarMap(d,p){if(!(p!=null&&p.constructor))return;const{name:h}=p.constructor;if(!WebGLVariableConstructorsNames.includes(h))return;const g=variableListFor(d,h);g.includes(p)||g.push(p)}function webglMutation({mutation:d,target:p,type:h,imageMap:g,errorHandler:m}){return __awaiter(this,void 0,void 0,function*(){try{const _=getContext(p,h);if(!_)return;if(d.setter){_[d.property]=d.args[0];return}const b=_[d.property],y=yield Promise.all(d.args.map(deserializeArg(g,_))),w=b.apply(_,y);saveToWebGLVarMap(_,w);const x=!1}catch(_){m(d,_)}})}function canvasMutation$1({event:d,mutation:p,target:h,imageMap:g,errorHandler:m}){return __awaiter(this,void 0,void 0,function*(){try{const _=h.getContext("2d");if(p.setter){_[p.property]=p.args[0];return}const b=_[p.property];if(p.property==="drawImage"&&typeof p.args[0]=="string")g.get(d),b.apply(_,p.args);else{const y=yield Promise.all(p.args.map(deserializeArg(g,_)));b.apply(_,y)}}catch(_){m(p,_)}})}function canvasMutation({event:d,mutation:p,target:h,imageMap:g,canvasEventMap:m,errorHandler:_}){return __awaiter(this,void 0,void 0,function*(){try{const b=m.get(d)||p,y="commands"in b?b.commands:[b];if([CanvasContext.WebGL,CanvasContext.WebGL2].includes(p.type)){for(let w=0;w<y.length;w++){const x=y[w];yield webglMutation({mutation:x,type:p.type,target:h,imageMap:g,errorHandler:_})}return}for(let w=0;w<y.length;w++){const x=y[w];yield canvasMutation$1({event:d,mutation:x,target:h,imageMap:g,errorHandler:_})}}catch(b){_(p,b)}})}const SKIP_TIME_THRESHOLD=10*1e3,SKIP_TIME_INTERVAL=5*1e3,mitt=mitt$1||mitt$1$1,REPLAY_CONSOLE_PREFIX="[replayer]",defaultMouseTailConfig={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function indicatesTouchDevice(d){return d.type==EventType.IncrementalSnapshot&&(d.data.source==IncrementalSource.TouchMove||d.data.source==IncrementalSource.MouseInteraction&&d.data.type==MouseInteractions.TouchStart)}class Replayer{constructor(p,h){if(this.usingVirtualDom=!1,this.virtualDom=new RRDocument,this.mouseTail=null,this.tailPositions=[],this.emitter=mitt(),this.legacy_missingNodeRetryMap={},this.cache=createCache(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=createMirror$2(),this.styleMirror=new StyleSheetMirror,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=y=>{this.iframe.style.display="inherit";for(const w of[this.mouseTail,this.iframe])w&&(w.setAttribute("width",String(y.width)),w.setAttribute("height",String(y.height)))},this.applyEventsSynchronously=y=>{for(const w of y){switch(w.type){case EventType.DomContentLoaded:case EventType.Load:case EventType.Custom:continue;case EventType.FullSnapshot:case EventType.Meta:case EventType.Plugin:case EventType.IncrementalSnapshot:break}this.getCastFn(w,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(y,w=!1)=>{let x;switch(y.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Custom:x=()=>{this.emitter.emit(ReplayerEvents.CustomEvent,y)};break;case EventType.Meta:x=()=>this.emitter.emit(ReplayerEvents.Resize,{width:y.data.width,height:y.data.height});break;case EventType.FullSnapshot:x=()=>{var S;if(this.firstFullSnapshot){if(this.firstFullSnapshot===y){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(y,w),(S=this.iframe.contentWindow)===null||S===void 0||S.scrollTo(y.data.initialOffset),this.styleMirror.reset()};break;case EventType.IncrementalSnapshot:x=()=>{if(this.applyIncremental(y,w),!w&&(y===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const S of this.service.state.context.events)if(!(S.timestamp<=y.timestamp)&&this.isUserInteraction(S)){S.delay-y.delay>SKIP_TIME_THRESHOLD*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=S);break}if(this.nextUserInteractionEvent){const S=this.nextUserInteractionEvent.delay-y.delay,k={speed:Math.min(Math.round(S/SKIP_TIME_INTERVAL),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:k}),this.emitter.emit(ReplayerEvents.SkipStart,k)}}};break}return()=>{x&&x();for(const k of this.config.plugins||[])k.handler&&k.handler(y,w,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:y}});const S=this.service.state.context.events.length-1;if(y===this.service.state.context.events[S]){const k=()=>{S<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(ReplayerEvents.Finish))};y.type===EventType.IncrementalSnapshot&&y.data.source===IncrementalSource.MouseMove&&y.data.positions.length?setTimeout(()=>{k()},Math.max(0,-y.data.positions[0].timeOffset+50)):k()}this.emitter.emit(ReplayerEvents.EventCast,y)}},!(h!=null&&h.liveMode)&&p.length<2)throw new Error("Replayer need at least 2 events.");const g={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:defaultMouseTailConfig,useVirtualDom:!0};this.config=Object.assign({},g,h),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(ReplayerEvents.Resize,this.handleResize),this.setupDom();for(const y of this.config.plugins||[])y.getMirror&&y.getMirror({nodeMirror:this.mirror});this.emitter.on(ReplayerEvents.Flush,()=>{if(this.usingVirtualDom){const y={mirror:this.mirror,applyCanvas:(w,x,E)=>{canvasMutation({event:w,mutation:x,target:E,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(w,x)=>{w.source===IncrementalSource.StyleSheetRule?this.applyStyleSheetRule(w,x):w.source===IncrementalSource.StyleDeclaration&&this.applyStyleDeclaration(w,x)}};if(this.iframe.contentDocument&&diff(this.iframe.contentDocument,this.virtualDom,y,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const w in this.legacy_missingNodeRetryMap)try{const x=this.legacy_missingNodeRetryMap[w],E=createOrGetNode(x.node,this.mirror,this.virtualDom.mirror);diff(E,x.node,y,this.virtualDom.mirror),x.node=E}catch(x){this.config.showWarning&&console.warn(x)}this.constructedStyleMutations.forEach(w=>{this.applyStyleSheetMutation(w)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(w=>{this.applyAdoptedStyleSheet(w)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(ReplayerEvents.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});const m=new Timer([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=createPlayerService({events:p.map(y=>h&&h.unpackFn?h.unpackFn(y):y).sort((y,w)=>y.timestamp-w.timestamp),timer:m,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(y=>{this.emitter.emit(ReplayerEvents.StateChange,{player:y})}),this.speedService=createSpeedService({normalSpeed:-1,timer:m}),this.speedService.start(),this.speedService.subscribe(y=>{this.emitter.emit(ReplayerEvents.StateChange,{speed:y})});const _=this.service.state.context.events.find(y=>y.type===EventType.Meta),b=this.service.state.context.events.find(y=>y.type===EventType.FullSnapshot);if(_){const{width:y,height:w}=_.data;setTimeout(()=>{this.emitter.emit(ReplayerEvents.Resize,{width:y,height:w})},0)}b&&setTimeout(()=>{var y;this.firstFullSnapshot||(this.firstFullSnapshot=b,this.rebuildFullSnapshot(b),(y=this.iframe.contentWindow)===null||y===void 0||y.scrollTo(b.data.initialOffset))},1),this.service.state.context.events.find(indicatesTouchDevice)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(p,h){return this.emitter.on(p,h),this}off(p,h){return this.emitter.off(p,h),this}setConfig(p){Object.keys(p).forEach(h=>{p[h],this.config[h]=p[h]}),this.config.skipInactive||this.backToNormal(),typeof p.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:p.speed}}),typeof p.mouseTail<"u"&&(p.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const p=this.service.state.context.events[0],h=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:p.timestamp,endTime:h.timestamp,totalTime:h.timestamp-p.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:p,events:h}=this.service.state.context;return p-h[0].timestamp}getMirror(){return this.mirror}play(p=0){var h,g;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:p}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:p}})),(g=(h=this.iframe.contentDocument)===null||h===void 0?void 0:h.getElementsByTagName("html")[0])===null||g===void 0||g.classList.remove("rrweb-paused"),this.emitter.emit(ReplayerEvents.Start)}pause(p){var h,g;p===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof p=="number"&&(this.play(p),this.service.send({type:"PAUSE"})),(g=(h=this.iframe.contentDocument)===null||h===void 0?void 0:h.getElementsByTagName("html")[0])===null||g===void 0||g.classList.add("rrweb-paused"),this.emitter.emit(ReplayerEvents.Pause)}resume(p=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(p),this.emitter.emit(ReplayerEvents.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(ReplayerEvents.Destroy)}startLive(p){this.service.send({type:"TO_LIVE",payload:{baselineTime:p}})}addEvent(p){const h=this.config.unpackFn?this.config.unpackFn(p):p;indicatesTouchDevice(h)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:h}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=createCache()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const p=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&p.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",p.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(polyfill(this.iframe.contentWindow,this.iframe.contentDocument),polyfill$1(this.iframe.contentWindow))}rebuildFullSnapshot(p,h=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const g=[],m=(y,w)=>{this.collectIframeAndAttachDocument(g,y);for(const x of this.config.plugins||[])x.onBuild&&x.onBuild(y,{id:w,replayer:this})};rebuild(p.data.node,{doc:this.iframe.contentDocument,afterAppend:m,cache:this.cache,mirror:this.mirror}),m(this.iframe.contentDocument,p.data.node.id);for(const{mutationInQueue:y,builtNode:w}of g)this.attachDocumentToIframe(y,w),this.newDocumentQueue=this.newDocumentQueue.filter(x=>x!==y);const{documentElement:_,head:b}=this.iframe.contentDocument;this.insertStyleRules(_,b),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded,p),h||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(p,h){var g;const m=rules(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&m.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const _=this.virtualDom.createElement("style");this.virtualDom.mirror.add(_,getDefaultSN(_,this.virtualDom.unserializedId)),p.insertBefore(_,h),_.rules.push({source:IncrementalSource.StyleSheetRule,adds:m.map((b,y)=>({rule:b,index:y}))})}else{const _=document.createElement("style");p.insertBefore(_,h);for(let b=0;b<m.length;b++)(g=_.sheet)===null||g===void 0||g.insertRule(m[b],b)}}attachDocumentToIframe(p,h){const g=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,m=[],_=(b,y)=>{this.collectIframeAndAttachDocument(m,b);const w=g.getMeta(b);if((w==null?void 0:w.type)===NodeType$2.Element&&(w==null?void 0:w.tagName.toUpperCase())==="HTML"){const{documentElement:x,head:E}=h.contentDocument;this.insertStyleRules(x,E)}for(const x of this.config.plugins||[])x.onBuild&&x.onBuild(b,{id:y,replayer:this})};buildNodeWithSN(p.node,{doc:h.contentDocument,mirror:g,hackCss:!0,skipChild:!1,afterAppend:_,cache:this.cache}),_(h.contentDocument,p.node.id);for(const{mutationInQueue:b,builtNode:y}of m)this.attachDocumentToIframe(b,y),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==b)}collectIframeAndAttachDocument(p,h){if(isSerializedIframe(h,this.mirror)){const g=this.newDocumentQueue.find(m=>m.parentId===this.mirror.getId(h));g&&p.push({mutationInQueue:g,builtNode:h})}}waitForStylesheetLoad(){var p;const h=(p=this.iframe.contentDocument)===null||p===void 0?void 0:p.head;if(h){const g=new Set;let m,_=this.service.state;const b=()=>{_=this.service.state};this.emitter.on(ReplayerEvents.Start,b),this.emitter.on(ReplayerEvents.Pause,b);const y=()=>{this.emitter.off(ReplayerEvents.Start,b),this.emitter.off(ReplayerEvents.Pause,b)};h.querySelectorAll('link[rel="stylesheet"]').forEach(w=>{w.sheet||(g.add(w),w.addEventListener("load",()=>{g.delete(w),g.size===0&&m!==-1&&(_.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(ReplayerEvents.LoadStylesheetEnd),m&&clearTimeout(m),y())}))}),g.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(ReplayerEvents.LoadStylesheetStart),m=setTimeout(()=>{_.matches("playing")&&this.play(this.getCurrentTime()),m=-1,y()},this.config.loadTimeout))}}preloadAllImages(){return __awaiter(this,void 0,void 0,function*(){this.service.state;const p=()=>{this.service.state};this.emitter.on(ReplayerEvents.Start,p),this.emitter.on(ReplayerEvents.Pause,p);const h=[];for(const g of this.service.state.context.events)g.type===EventType.IncrementalSnapshot&&g.data.source===IncrementalSource.CanvasMutation&&(h.push(this.deserializeAndPreloadCanvasEvents(g.data,g)),("commands"in g.data?g.data.commands:[g.data]).forEach(_=>{this.preloadImages(_,g)}));return Promise.all(h)})}preloadImages(p,h){if(p.property==="drawImage"&&typeof p.args[0]=="string"&&!this.imageMap.has(h)){const g=document.createElement("canvas"),m=g.getContext("2d"),_=m==null?void 0:m.createImageData(g.width,g.height);_==null||_.data,JSON.parse(p.args[0]),m==null||m.putImageData(_,0,0)}}deserializeAndPreloadCanvasEvents(p,h){return __awaiter(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(h)){const g={isUnchanged:!0};if("commands"in p){const m=yield Promise.all(p.commands.map(_=>__awaiter(this,void 0,void 0,function*(){const b=yield Promise.all(_.args.map(deserializeArg(this.imageMap,null,g)));return Object.assign(Object.assign({},_),{args:b})})));g.isUnchanged===!1&&this.canvasEventMap.set(h,Object.assign(Object.assign({},p),{commands:m}))}else{const m=yield Promise.all(p.args.map(deserializeArg(this.imageMap,null,g)));g.isUnchanged===!1&&this.canvasEventMap.set(h,Object.assign(Object.assign({},p),{args:m}))}}})}applyIncremental(p,h){var g,m,_;const{data:b}=p;switch(b.source){case IncrementalSource.Mutation:{try{this.applyMutation(b,h)}catch(y){this.warn(`Exception in mutation ${y.message||y}`,b)}break}case IncrementalSource.Drag:case IncrementalSource.TouchMove:case IncrementalSource.MouseMove:if(h){const y=b.positions[b.positions.length-1];this.mousePos={x:y.x,y:y.y,id:y.id,debugData:b}}else b.positions.forEach(y=>{const w={doAction:()=>{this.moveAndHover(y.x,y.y,y.id,h,b)},delay:y.timeOffset+p.timestamp-this.service.state.context.baselineTime};this.timer.addAction(w)}),this.timer.addAction({doAction(){},delay:p.delay-((g=b.positions[0])===null||g===void 0?void 0:g.timeOffset)});break;case IncrementalSource.MouseInteraction:{if(b.id===-1||h)break;const y=new Event(MouseInteractions[b.type].toLowerCase()),w=this.mirror.getNode(b.id);if(!w)return this.debugNodeNotFound(b,b.id);this.emitter.emit(ReplayerEvents.MouseInteraction,{type:b.type,target:w});const{triggerFocus:x}=this.config;switch(b.type){case MouseInteractions.Blur:"blur"in w&&w.blur();break;case MouseInteractions.Focus:x&&w.focus&&w.focus({preventScroll:!0});break;case MouseInteractions.Click:case MouseInteractions.TouchStart:case MouseInteractions.TouchEnd:h?(b.type===MouseInteractions.TouchStart?this.touchActive=!0:b.type===MouseInteractions.TouchEnd&&(this.touchActive=!1),this.mousePos={x:b.x,y:b.y,id:b.id,debugData:b}):(b.type===MouseInteractions.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(b.x,b.y,b.id,h,b),b.type===MouseInteractions.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):b.type===MouseInteractions.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):b.type===MouseInteractions.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case MouseInteractions.TouchCancel:h?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:w.dispatchEvent(y)}break}case IncrementalSource.Scroll:{if(b.id===-1)break;if(this.usingVirtualDom){const y=this.virtualDom.mirror.getNode(b.id);if(!y)return this.debugNodeNotFound(b,b.id);y.scrollData=b;break}this.applyScroll(b,h);break}case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:b.width,height:b.height});break;case IncrementalSource.Input:{if(b.id===-1)break;if(this.usingVirtualDom){const y=this.virtualDom.mirror.getNode(b.id);if(!y)return this.debugNodeNotFound(b,b.id);y.inputData=b;break}this.applyInput(b);break}case IncrementalSource.MediaInteraction:{const y=this.usingVirtualDom?this.virtualDom.mirror.getNode(b.id):this.mirror.getNode(b.id);if(!y)return this.debugNodeNotFound(b,b.id);const w=y;try{b.currentTime&&(w.currentTime=b.currentTime),b.volume&&(w.volume=b.volume),b.muted&&(w.muted=b.muted),b.type===1&&w.pause(),b.type===0&&w.play(),b.type===4&&(w.playbackRate=b.playbackRate)}catch(x){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${x.message||x}`)}break}case IncrementalSource.StyleSheetRule:case IncrementalSource.StyleDeclaration:{this.usingVirtualDom?b.styleId?this.constructedStyleMutations.push(b):b.id&&((m=this.virtualDom.mirror.getNode(b.id))===null||m===void 0||m.rules.push(b)):this.applyStyleSheetMutation(b);break}case IncrementalSource.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const y=this.virtualDom.mirror.getNode(b.id);if(!y)return this.debugNodeNotFound(b,b.id);y.canvasMutations.push({event:p,mutation:b})}else{const y=this.mirror.getNode(b.id);if(!y)return this.debugNodeNotFound(b,b.id);canvasMutation({event:p,mutation:b,target:y,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case IncrementalSource.Font:{try{const y=new FontFace(b.family,b.buffer?new Uint8Array(JSON.parse(b.fontSource)):b.fontSource,b.descriptors);(_=this.iframe.contentDocument)===null||_===void 0||_.fonts.add(y)}catch(y){this.config.showWarning&&console.warn(y)}break}case IncrementalSource.Selection:{if(h){this.lastSelectionData=b;break}this.applySelection(b);break}case IncrementalSource.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(b):this.applyAdoptedStyleSheet(b);break}}}applyMutation(p,h){if(this.config.useVirtualDom&&!this.usingVirtualDom&&h&&(this.usingVirtualDom=!0,buildFromDom(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const x in this.legacy_missingNodeRetryMap)try{const E=this.legacy_missingNodeRetryMap[x],S=buildFromNode(E.node,this.virtualDom,this.mirror);S&&(E.node=S)}catch(E){this.config.showWarning&&console.warn(E)}const g=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;p.removes.forEach(x=>{var E;const S=g.getNode(x.id);if(!S)return p.removes.find(I=>I.id===x.parentId)?void 0:this.warnNodeNotFound(p,x.id);let k=g.getNode(x.parentId);if(!k)return this.warnNodeNotFound(p,x.parentId);if(x.isShadow&&hasShadowRoot(k)&&(k=k.shadowRoot),g.removeNodeFromMap(S),k)try{k.removeChild(S),this.usingVirtualDom&&S.nodeName==="#text"&&k.nodeName==="STYLE"&&((E=k.rules)===null||E===void 0?void 0:E.length)>0&&(k.rules=[])}catch(I){if(I instanceof DOMException)this.warn("parent could not remove child in mutation",k,S,p);else throw I}});const m=Object.assign({},this.legacy_missingNodeRetryMap),_=[],b=x=>{let E=null;return x.nextId&&(E=g.getNode(x.nextId)),x.nextId!==null&&x.nextId!==void 0&&x.nextId!==-1&&!E},y=x=>{var E;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let S=g.getNode(x.parentId);if(!S)return x.node.type===NodeType$2.Document?this.newDocumentQueue.push(x):_.push(x);x.node.isShadow&&(hasShadowRoot(S)||S.attachShadow({mode:"open"}),S=S.shadowRoot);let k=null,I=null;if(x.previousId&&(k=g.getNode(x.previousId)),x.nextId&&(I=g.getNode(x.nextId)),b(x))return _.push(x);if(x.node.rootId&&!g.getNode(x.node.rootId))return;const R=x.node.rootId?g.getNode(x.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(isSerializedIframe(S,g)){this.attachDocumentToIframe(x,S);return}const M=(N,$)=>{for(const O of this.config.plugins||[])O.onBuild&&O.onBuild(N,{id:$,replayer:this})},A=buildNodeWithSN(x.node,{doc:R,mirror:g,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:M});if(x.previousId===-1||x.nextId===-1){m[x.node.id]={node:A,mutation:x};return}const C=g.getMeta(S);if(C&&C.type===NodeType$2.Element&&C.tagName==="textarea"&&x.node.type===NodeType$2.Text){const N=Array.isArray(S.childNodes)?S.childNodes:Array.from(S.childNodes);for(const $ of N)$.nodeType===S.TEXT_NODE&&S.removeChild($)}if(k&&k.nextSibling&&k.nextSibling.parentNode)S.insertBefore(A,k.nextSibling);else if(I&&I.parentNode)S.contains(I)?S.insertBefore(A,I):S.insertBefore(A,null);else{if(S===R)for(;R.firstChild;)R.removeChild(R.firstChild);S.appendChild(A)}if(M(A,x.node.id),this.usingVirtualDom&&A.nodeName==="#text"&&S.nodeName==="STYLE"&&((E=S.rules)===null||E===void 0?void 0:E.length)>0&&(S.rules=[]),isSerializedIframe(A,this.mirror)){const N=this.mirror.getId(A),$=this.newDocumentQueue.find(O=>O.parentId===N);$&&(this.attachDocumentToIframe($,A),this.newDocumentQueue=this.newDocumentQueue.filter(O=>O!==$))}(x.previousId||x.nextId)&&this.legacy_resolveMissingNode(m,S,A,x)};p.adds.forEach(x=>{y(x)});const w=Date.now();for(;_.length;){const x=queueToResolveTrees(_);if(_.length=0,Date.now()-w>500){this.warn("Timeout in the loop, please check the resolve tree data:",x);break}for(const E of x)g.getNode(E.value.parentId)?iterateResolveTree(E,k=>{y(k)}):this.debug("Drop resolve tree since there is no parent for the root node.",E)}Object.keys(m).length&&Object.assign(this.legacy_missingNodeRetryMap,m),uniqueTextMutations(p.texts).forEach(x=>{var E;const S=g.getNode(x.id);if(!S)return p.removes.find(k=>k.id===x.id)?void 0:this.warnNodeNotFound(p,x.id);if(S.textContent=x.value,this.usingVirtualDom){const k=S.parentNode;((E=k==null?void 0:k.rules)===null||E===void 0?void 0:E.length)>0&&(k.rules=[])}}),p.attributes.forEach(x=>{const E=g.getNode(x.id);if(!E)return p.removes.find(S=>S.id===x.id)?void 0:this.warnNodeNotFound(p,x.id);for(const S in x.attributes)if(typeof S=="string"){const k=x.attributes[S];if(k===null)E.removeAttribute(S);else if(typeof k=="string")try{if(S==="_cssText"&&(E.nodeName==="LINK"||E.nodeName==="STYLE"))try{const I=g.getMeta(E);Object.assign(I.attributes,x.attributes);const R=buildNodeWithSN(I,{doc:E.ownerDocument,mirror:g,skipChild:!0,hackCss:!0,cache:this.cache}),M=E.nextSibling,A=E.parentNode;if(R&&A){A.removeChild(E),A.insertBefore(R,M),g.replace(x.id,R);break}}catch{}E.setAttribute(S,k)}catch(I){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",I)}else if(S==="style"){const I=k,R=E;for(const M in I)if(I[M]===!1)R.style.removeProperty(M);else if(I[M]instanceof Array){const A=I[M];R.style.setProperty(M,A[0],A[1])}else{const A=I[M];R.style.setProperty(M,A)}}}})}applyScroll(p,h){var g,m;const _=this.mirror.getNode(p.id);if(!_)return this.debugNodeNotFound(p,p.id);const b=this.mirror.getMeta(_);if(_===this.iframe.contentDocument)(g=this.iframe.contentWindow)===null||g===void 0||g.scrollTo({top:p.y,left:p.x,behavior:h?"auto":"smooth"});else if((b==null?void 0:b.type)===NodeType$2.Document)(m=_.defaultView)===null||m===void 0||m.scrollTo({top:p.y,left:p.x,behavior:h?"auto":"smooth"});else try{_.scrollTo({top:p.y,left:p.x,behavior:h?"auto":"smooth"})}catch{}}applyInput(p){const h=this.mirror.getNode(p.id);if(!h)return this.debugNodeNotFound(p,p.id);try{h.checked=p.isChecked,h.value=p.text}catch{}}applySelection(p){try{const h=new Set,g=p.ranges.map(({start:m,startOffset:_,end:b,endOffset:y})=>{const w=this.mirror.getNode(m),x=this.mirror.getNode(b);if(!w||!x)return;const E=new Range;E.setStart(w,_),E.setEnd(x,y);const S=w.ownerDocument,k=S==null?void 0:S.getSelection();return k&&h.add(k),{range:E,selection:k}});h.forEach(m=>m.removeAllRanges()),g.forEach(m=>{var _;return m&&((_=m.selection)===null||_===void 0?void 0:_.addRange(m.range))})}catch{}}applyStyleSheetMutation(p){var h;let g=null;p.styleId?g=this.styleMirror.getStyle(p.styleId):p.id&&(g=((h=this.mirror.getNode(p.id))===null||h===void 0?void 0:h.sheet)||null),g&&(p.source===IncrementalSource.StyleSheetRule?this.applyStyleSheetRule(p,g):p.source===IncrementalSource.StyleDeclaration&&this.applyStyleDeclaration(p,g))}applyStyleSheetRule(p,h){var g,m,_,b;if((g=p.adds)===null||g===void 0||g.forEach(({rule:y,index:w})=>{try{if(Array.isArray(w)){const{positions:x,index:E}=getPositionsAndIndex(w);getNestedRule(h.cssRules,x).insertRule(y,E)}else{const x=w===void 0?void 0:Math.min(w,h.cssRules.length);h==null||h.insertRule(y,x)}}catch{}}),(m=p.removes)===null||m===void 0||m.forEach(({index:y})=>{try{if(Array.isArray(y)){const{positions:w,index:x}=getPositionsAndIndex(y);getNestedRule(h.cssRules,w).deleteRule(x||0)}else h==null||h.deleteRule(y)}catch{}}),p.replace)try{(_=h.replace)===null||_===void 0||_.call(h,p.replace)}catch{}if(p.replaceSync)try{(b=h.replaceSync)===null||b===void 0||b.call(h,p.replaceSync)}catch{}}applyStyleDeclaration(p,h){p.set&&getNestedRule(h.rules,p.index).style.setProperty(p.set.property,p.set.value,p.set.priority),p.remove&&getNestedRule(h.rules,p.index).style.removeProperty(p.remove.property)}applyAdoptedStyleSheet(p){var h;const g=this.mirror.getNode(p.id);if(!g)return;(h=p.styles)===null||h===void 0||h.forEach(y=>{var w;let x=null,E=null;if(hasShadowRoot(g)?E=((w=g.ownerDocument)===null||w===void 0?void 0:w.defaultView)||null:g.nodeName==="#document"&&(E=g.defaultView),!!E)try{x=new E.CSSStyleSheet,this.styleMirror.add(x,y.styleId),this.applyStyleSheetRule({source:IncrementalSource.StyleSheetRule,adds:y.rules},x)}catch{}});const m=10;let _=0;const b=(y,w)=>{const x=w.map(E=>this.styleMirror.getStyle(E)).filter(E=>E!==null);hasShadowRoot(y)?y.shadowRoot.adoptedStyleSheets=x:y.nodeName==="#document"&&(y.adoptedStyleSheets=x),x.length!==w.length&&_<m&&(setTimeout(()=>b(y,w),0+100*_),_++)};b(g,p.styleIds)}legacy_resolveMissingNode(p,h,g,m){const{previousId:_,nextId:b}=m,y=_&&p[_],w=b&&p[b];if(y){const{node:x,mutation:E}=y;h.insertBefore(x,g),delete p[E.node.id],delete this.legacy_missingNodeRetryMap[E.node.id],(E.previousId||E.nextId)&&this.legacy_resolveMissingNode(p,h,x,E)}if(w){const{node:x,mutation:E}=w;h.insertBefore(x,g.nextSibling),delete p[E.node.id],delete this.legacy_missingNodeRetryMap[E.node.id],(E.previousId||E.nextId)&&this.legacy_resolveMissingNode(p,h,x,E)}}moveAndHover(p,h,g,m,_){const b=this.mirror.getNode(g);if(!b)return this.debugNodeNotFound(_,g);const y=getBaseDimension(b,this.iframe),w=p*y.absoluteScale+y.x,x=h*y.absoluteScale+y.y;this.mouse.style.left=`${w}px`,this.mouse.style.top=`${x}px`,m||this.drawMouseTail({x:w,y:x}),this.hoverElements(b)}drawMouseTail(p){if(!this.mouseTail)return;const{lineCap:h,lineWidth:g,strokeStyle:m,duration:_}=this.config.mouseTail===!0?defaultMouseTailConfig:Object.assign({},defaultMouseTailConfig,this.config.mouseTail),b=()=>{if(!this.mouseTail)return;const y=this.mouseTail.getContext("2d");!y||!this.tailPositions.length||(y.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),y.beginPath(),y.lineWidth=g,y.lineCap=h,y.strokeStyle=m,y.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(w=>y.lineTo(w.x,w.y)),y.stroke())};this.tailPositions.push(p),b(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(y=>y!==p),b()},_/this.speedService.state.context.timer.speed)}hoverElements(p){var h;(h=this.iframe.contentDocument)===null||h===void 0||h.querySelectorAll(".\\:hover").forEach(m=>{m.classList.remove(":hover")});let g=p;for(;g;)g.classList&&g.classList.add(":hover"),g=g.parentElement}isUserInteraction(p){return p.type!==EventType.IncrementalSnapshot?!1:p.data.source>IncrementalSource.Mutation&&p.data.source<=IncrementalSource.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(ReplayerEvents.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(p,h){this.warn(`Node with id '${h}' not found. `,p)}warnCanvasMutationFailed(p,h){this.warn("Has error on canvas update",h,"canvas mutation:",p)}debugNodeNotFound(p,h){this.debug(REPLAY_CONSOLE_PREFIX,`Node with id '${h}' not found. `,p)}warn(...p){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,...p)}debug(...p){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,...p)}}let stopFn=null,events=[];function startRecording(){stopFn||(events=[],clearCapturedRequests(),stopFn=record$1({emit(d){events.push(d)},recordCrossOriginIframes:!1})||null)}function stopRecording(){if(!stopFn)return[];stopFn(),stopFn=null;const d=[...events];return events=[],d}function cubic_out(d){const p=d-1;return p*p*p+1}function slide(d,{delay:p=0,duration:h=400,easing:g=cubic_out,axis:m="y"}={}){const _=getComputedStyle(d),b=+_.opacity,y=m==="y"?"height":"width",w=parseFloat(_[y]),x=m==="y"?["top","bottom"]:["left","right"],E=x.map(C=>`${C[0].toUpperCase()}${C.slice(1)}`),S=parseFloat(_[`padding${E[0]}`]),k=parseFloat(_[`padding${E[1]}`]),I=parseFloat(_[`margin${E[0]}`]),R=parseFloat(_[`margin${E[1]}`]),M=parseFloat(_[`border${E[0]}Width`]),A=parseFloat(_[`border${E[1]}Width`]);return{delay:p,duration:h,easing:g,css:C=>`overflow: hidden;opacity: ${Math.min(C*20,1)*b};${y}: ${C*w}px;padding-${x[0]}: ${C*S}px;padding-${x[1]}: ${C*k}px;margin-${x[0]}: ${C*I}px;margin-${x[1]}: ${C*R}px;border-${x[0]}-width: ${C*M}px;border-${x[1]}-width: ${C*A}px;min-${y}: 0`}}var root_3$7=from_html('<button class="thumb-edit svelte-1dhybq8" aria-label="Edit screenshot"><svg width="10" height="10" viewBox="0 0 24 24" fill="none"><path d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button>'),root_2$8=from_html('<div class="thumb-wrap svelte-1dhybq8"><img class="thumb svelte-1dhybq8"/> <!> <button class="thumb-remove svelte-1dhybq8" aria-label="Remove screenshot">×</button></div>'),root_4$5=from_html('<span class="more-badge svelte-1dhybq8"> </span>'),root_1$8=from_html('<div class="thumb-strip svelte-1dhybq8"><!> <!></div>');const $$css$9={hash:"svelte-1dhybq8",code:".thumb-strip.svelte-1dhybq8 {display:flex;gap:6px;align-items:center;}.thumb-wrap.svelte-1dhybq8 {position:relative;}.thumb.svelte-1dhybq8 {width:60px;height:42px;object-fit:cover;border-radius:4px;border:1px solid #374151;}.thumb-edit.svelte-1dhybq8 {position:absolute;bottom:2px;right:2px;width:20px;height:20px;border-radius:3px;background:rgba(59, 130, 246, 0.85);color:white;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;opacity:0;transition:opacity 0.15s;}.thumb-wrap.svelte-1dhybq8:hover .thumb-edit:where(.svelte-1dhybq8) {opacity:1;}.thumb-edit.svelte-1dhybq8:hover {background:#2563eb;}.thumb-remove.svelte-1dhybq8 {position:absolute;top:-4px;right:-4px;width:16px;height:16px;border-radius:50%;background:#ef4444;color:white;border:none;cursor:pointer;font-size:10px;display:flex;align-items:center;justify-content:center;line-height:1;padding:0;}.more-badge.svelte-1dhybq8 {font-size:11px;color:#6b7280;padding:0 4px;}"};function ScreenshotPreview(d,p){push(p,!0),append_styles(d,$$css$9);let h=prop(p,"screenshots",23,()=>[]),g=prop(p,"capturing",7,!1),m=prop(p,"oncapture",7),_=prop(p,"onremove",7),b=prop(p,"onedit",7);var y={get screenshots(){return h()},set screenshots(S=[]){h(S),flushSync()},get capturing(){return g()},set capturing(S=!1){g(S),flushSync()},get oncapture(){return m()},set oncapture(S){m(S),flushSync()},get onremove(){return _()},set onremove(S){_(S),flushSync()},get onedit(){return b()},set onedit(S){b(S),flushSync()}},w=comment(),x=first_child(w);{var E=S=>{var k=root_1$8(),I=child(k);each(I,17,()=>h().slice(-3),index,(A,C,N)=>{const $=user_derived(()=>h().length>3?h().length-3+N:N);var O=root_2$8(),F=child(O);set_attribute(F,"alt",`Screenshot ${N+1}`);var j=sibling(F,2);{var Y=ue=>{var oe=root_3$7();delegated("click",oe,()=>b()(get($))),append(ue,oe)};if_block(j,ue=>{b()&&ue(Y)})}var q=sibling(j,2);reset(O),template_effect(()=>set_attribute(F,"src",get(C))),delegated("click",q,()=>_()(get($))),append(A,O)});var R=sibling(I,2);{var M=A=>{var C=root_4$5(),N=child(C);reset(C),template_effect(()=>set_text(N,`+${h().length-3}`)),append(A,C)};if_block(R,A=>{h().length>3&&A(M)})}reset(k),append(S,k)};if_block(x,S=>{h().length>0&&S(E)})}return append(d,w),pop(y)}delegate(["click"]),create_custom_element(ScreenshotPreview,{screenshots:{},capturing:{},oncapture:{},onremove:{},onedit:{}},[],[],{mode:"open"});var root_2$7=from_svg('<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><ellipse cx="12" cy="12" rx="10" ry="7" stroke="currentColor" stroke-width="2" fill="none"></ellipse></svg>'),root_3$6=from_svg('<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"></path></svg>'),root_1$7=from_html('<button><!> <span class="tool-label svelte-yff65c"> </span></button>'),root_4$4=from_html("<button></button>"),root_5$4=from_html('<canvas class="base-canvas svelte-yff65c"></canvas> <canvas></canvas>',1),root_6$5=from_html('<div class="loading svelte-yff65c">Loading image...</div>'),root_7$5=from_html('<input type="text" class="text-overlay-input svelte-yff65c" placeholder="Type here..."/>'),root$6=from_html('<div class="annotation-backdrop svelte-yff65c"><div class="annotation-toolbar svelte-yff65c"><div class="tool-group svelte-yff65c"></div> <div class="divider svelte-yff65c"></div> <div class="color-group svelte-yff65c"></div> <div class="divider svelte-yff65c"></div> <div class="action-group svelte-yff65c"><button class="action-btn svelte-yff65c" title="Undo (Ctrl+Z)"><svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M3 10h10a5 5 0 015 5v0a5 5 0 01-5 5H8M3 10l4-4M3 10l4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> Undo</button> <button class="action-btn svelte-yff65c" title="Clear all"><svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M3 6h18M8 6V4h8v2M10 11v6M14 11v6M5 6l1 14h12l1-14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> Clear</button></div> <div class="spacer svelte-yff65c"></div> <div class="commit-group svelte-yff65c"><button class="cancel-btn svelte-yff65c">Cancel</button> <button class="done-btn svelte-yff65c">Done</button></div></div> <div class="canvas-container svelte-yff65c"><!></div> <!></div>');const $$css$8={hash:"svelte-yff65c",code:`.annotation-backdrop.svelte-yff65c {position:fixed;inset:0;z-index:2147483647;background:rgba(0, 0, 0, 0.85);display:flex;flex-direction:column;align-items:center;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;}.annotation-toolbar.svelte-yff65c {display:flex;align-items:center;gap:6px;padding:8px 12px;background:#1f2937;border-bottom:1px solid #374151;width:100%;flex-shrink:0;flex-wrap:wrap;}.tool-group.svelte-yff65c, .color-group.svelte-yff65c, .action-group.svelte-yff65c, .commit-group.svelte-yff65c {display:flex;align-items:center;gap:4px;}.divider.svelte-yff65c {width:1px;height:24px;background:#374151;margin:0 4px;}.spacer.svelte-yff65c {flex:1;}.tool-btn.svelte-yff65c {display:flex;align-items:center;gap:4px;padding:5px 8px;background:transparent;border:1px solid transparent;border-radius:4px;color:#9ca3af;font-size:11px;cursor:pointer;font-family:inherit;transition:all 0.15s;}.tool-btn.svelte-yff65c:hover {color:#e5e7eb;background:#374151;}.tool-btn.active.svelte-yff65c {color:#fff;background:#3b82f6;border-color:#3b82f6;}.tool-label.svelte-yff65c {display:none;}
|
|
77
77
|
@media (min-width: 640px) {.tool-label.svelte-yff65c {display:inline;}
|
|
78
78
|
}.color-swatch.svelte-yff65c {width:20px;height:20px;border-radius:50%;border:2px solid transparent;cursor:pointer;transition:transform 0.1s, border-color 0.1s;padding:0;}.color-swatch.svelte-yff65c:hover {transform:scale(1.15);}.color-swatch.active.svelte-yff65c {border-color:#fff;transform:scale(1.2);}.action-btn.svelte-yff65c {display:flex;align-items:center;gap:4px;padding:5px 8px;background:transparent;border:1px solid #374151;border-radius:4px;color:#9ca3af;font-size:11px;cursor:pointer;font-family:inherit;transition:all 0.15s;}.action-btn.svelte-yff65c:hover:not(:disabled) {color:#e5e7eb;background:#374151;}.action-btn.svelte-yff65c:disabled {opacity:0.4;cursor:not-allowed;}.cancel-btn.svelte-yff65c {padding:6px 14px;background:#374151;border:1px solid #4b5563;border-radius:5px;color:#d1d5db;font-size:12px;cursor:pointer;font-family:inherit;transition:background 0.15s;}.cancel-btn.svelte-yff65c:hover {background:#4b5563;}.done-btn.svelte-yff65c {padding:6px 16px;background:#3b82f6;border:none;border-radius:5px;color:white;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:background 0.15s;}.done-btn.svelte-yff65c:hover {background:#2563eb;}.canvas-container.svelte-yff65c {flex:1;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;padding:20px;}.base-canvas.svelte-yff65c, .overlay-canvas.svelte-yff65c {max-width:calc(100vw - 80px);max-height:calc(100vh - 120px);object-fit:contain;border-radius:4px;}.base-canvas.svelte-yff65c {display:block;}.overlay-canvas.svelte-yff65c {position:absolute;
|
|
79
|
-
/* Overlays exactly on base-canvas — sized by max-width/max-height */}.cursor-crosshair.svelte-yff65c {cursor:crosshair;}.cursor-text.svelte-yff65c {cursor:text;}.text-overlay-input.svelte-yff65c {position:fixed;background:transparent;border:1px dashed rgba(255,255,255,0.5);outline:none;font-size:16px;font-weight:bold;font-family:sans-serif;padding:2px 4px;z-index:2147483647;min-width:80px;}.loading.svelte-yff65c {color:#9ca3af;font-size:14px;}`};function AnnotationEditor(d,p){push(p,!0),append_styles(d,$$css$8);let h=prop(p,"imageDataUrl",7),g=prop(p,"onsave",7),m=prop(p,"oncancel",7),_=state("arrow"),b=state(proxy(ANNOTATION_COLORS[0])),y=state(proxy([])),w=state(void 0),x=state(void 0),E=state(0),S=state(0),k=state(!1),I=state("idle"),R={x:0,y:0},M=[],A=state(void 0),C=state(proxy({x:0,y:0})),N=state(proxy({left:"0px",top:"0px"})),$=state("");onMount(()=>{setAnnotationEditorOpen(!0);const V=new Image;V.onload=()=>{set(E,V.naturalWidth,!0),set(S,V.naturalHeight,!0),set(k,!0),requestAnimationFrame(()=>F(V))},V.src=h()}),onDestroy(()=>{setAnnotationEditorOpen(!1)});function O(){return new Promise((V,D)=>{const H=new Image;H.onload=()=>V(H),H.onerror=D,H.src=h()})}async function F(V){if(!get(w))return;const D=get(w).getContext("2d");D&&(V||(V=await O()),get(w).width=get(E),get(w).height=get(S),D.drawImage(V,0,0,get(E),get(S)),renderAllShapes(D,get(y)))}function j(){if(!get(x))return;const V=get(x).getContext("2d");V&&(get(x).width=get(E),get(x).height=get(S),V.clearRect(0,0,get(E),get(S)))}function Y(V){if(!get(x))return{x:0,y:0};const D=get(x).getBoundingClientRect(),H=get(E)/D.width,X=get(S)/D.height;return{x:(V.clientX-D.left)*H,y:(V.clientY-D.top)*X}}function q(V){if(!get(x))return{left:"0px",top:"0px"};const D=get(x).getBoundingClientRect();return{left:`${D.left+V.x/(get(E)/D.width)}px`,top:`${D.top+V.y/(get(S)/D.height)}px`}}function ue(V){const D={color:get(b),strokeWidth:DEFAULT_STROKE_WIDTH};switch(get(_)){case"arrow":return{...D,id:nextShapeId(),type:"arrow",start:R,end:V};case"rectangle":return{...D,id:nextShapeId(),type:"rectangle",start:R,end:V};case"ellipse":return{...D,id:nextShapeId(),type:"ellipse",start:R,end:V};case"freehand":return{...D,id:nextShapeId(),type:"freehand",points:[...M,V]};default:return null}}function oe(V){if(get(I)==="typing"){xe();return}const D=Y(V);if(get(_)==="text"){set(I,"typing"),set(C,D,!0),set(N,q(D),!0),set($,""),requestAnimationFrame(()=>{var H;return(H=get(A))==null?void 0:H.focus()});return}set(I,"drawing"),R=D,M=[D]}function ce(V){if(get(I)!=="drawing")return;const D=Y(V);get(_)==="freehand"&&M.push(D),j();const H=ue(D);if(H&&get(x)){const X=get(x).getContext("2d");X&&renderShape(X,H)}}function se(V){if(get(I)!=="drawing")return;const D=Y(V),H=ue(D);H&&set(y,[...get(y),H],!0),set(I,"idle"),M=[],j(),F()}function xe(){if(get($).trim()){const V={id:nextShapeId(),type:"text",color:get(b),strokeWidth:DEFAULT_STROKE_WIDTH,position:get(C),content:get($).trim(),fontSize:20};set(y,[...get(y),V],!0),F()}set($,""),set(I,"idle")}function ve(V){V.key==="Enter"?(V.preventDefault(),xe()):V.key==="Escape"&&(V.preventDefault(),set($,""),set(I,"idle"))}function Re(){get(y).length!==0&&(set(y,get(y).slice(0,-1),!0),F())}function ke(){set(y,[],!0),F()}async function me(){if(get(y).length===0){g()(h());return}const V=await mergeAnnotation(h(),get(y),get(E),get(S));g()(V)}function Ce(){m()()}function T(V){V.stopPropagation(),V.key==="Escape"&&get(I)!=="typing"&&Ce(),(V.ctrlKey||V.metaKey)&&V.key==="z"&&(V.preventDefault(),Re())}const z={arrow:"M5 19L19 5M19 5H9M19 5V15",rectangle:"M3 3h18v18H3z",ellipse:"",freehand:"M3 17c1-2 3-6 5-6s3 4 5 4 3-6 5-6 2 4 3 4",text:"M6 4v16M18 4v16M6 12h12M8 4h-4M20 4h-4M8 20h-4M20 20h-4"},L={arrow:"Arrow",rectangle:"Rect",ellipse:"Ellipse",freehand:"Draw",text:"Text"},P=["arrow","rectangle","ellipse","freehand","text"];var G={get imageDataUrl(){return h()},set imageDataUrl(V){h(V),flushSync()},get onsave(){return g()},set onsave(V){g(V),flushSync()},get oncancel(){return m()},set oncancel(V){m(V),flushSync()}},W=root$6(),ie=child(W),J=child(ie);each(J,21,()=>P,index,(V,D)=>{var H=root_1$7();let X;var fe=child(H);{var Q=Te=>{var
|
|
79
|
+
/* Overlays exactly on base-canvas — sized by max-width/max-height */}.cursor-crosshair.svelte-yff65c {cursor:crosshair;}.cursor-text.svelte-yff65c {cursor:text;}.text-overlay-input.svelte-yff65c {position:fixed;background:transparent;border:1px dashed rgba(255,255,255,0.5);outline:none;font-size:16px;font-weight:bold;font-family:sans-serif;padding:2px 4px;z-index:2147483647;min-width:80px;}.loading.svelte-yff65c {color:#9ca3af;font-size:14px;}`};function AnnotationEditor(d,p){push(p,!0),append_styles(d,$$css$8);let h=prop(p,"imageDataUrl",7),g=prop(p,"onsave",7),m=prop(p,"oncancel",7),_=state("arrow"),b=state(proxy(ANNOTATION_COLORS[0])),y=state(proxy([])),w=state(void 0),x=state(void 0),E=state(0),S=state(0),k=state(!1),I=state("idle"),R={x:0,y:0},M=[],A=state(void 0),C=state(proxy({x:0,y:0})),N=state(proxy({left:"0px",top:"0px"})),$=state("");onMount(()=>{setAnnotationEditorOpen(!0);const V=new Image;V.onload=()=>{set(E,V.naturalWidth,!0),set(S,V.naturalHeight,!0),set(k,!0),requestAnimationFrame(()=>F(V))},V.src=h()}),onDestroy(()=>{setAnnotationEditorOpen(!1)});function O(){return new Promise((V,D)=>{const H=new Image;H.onload=()=>V(H),H.onerror=D,H.src=h()})}async function F(V){if(!get(w))return;const D=get(w).getContext("2d");D&&(V||(V=await O()),get(w).width=get(E),get(w).height=get(S),D.drawImage(V,0,0,get(E),get(S)),renderAllShapes(D,get(y)))}function j(){if(!get(x))return;const V=get(x).getContext("2d");V&&(get(x).width=get(E),get(x).height=get(S),V.clearRect(0,0,get(E),get(S)))}function Y(V){if(!get(x))return{x:0,y:0};const D=get(x).getBoundingClientRect(),H=get(E)/D.width,X=get(S)/D.height;return{x:(V.clientX-D.left)*H,y:(V.clientY-D.top)*X}}function q(V){if(!get(x))return{left:"0px",top:"0px"};const D=get(x).getBoundingClientRect();return{left:`${D.left+V.x/(get(E)/D.width)}px`,top:`${D.top+V.y/(get(S)/D.height)}px`}}function ue(V){const D={color:get(b),strokeWidth:DEFAULT_STROKE_WIDTH};switch(get(_)){case"arrow":return{...D,id:nextShapeId(),type:"arrow",start:R,end:V};case"rectangle":return{...D,id:nextShapeId(),type:"rectangle",start:R,end:V};case"ellipse":return{...D,id:nextShapeId(),type:"ellipse",start:R,end:V};case"freehand":return{...D,id:nextShapeId(),type:"freehand",points:[...M,V]};default:return null}}function oe(V){if(get(I)==="typing"){xe();return}const D=Y(V);if(get(_)==="text"){set(I,"typing"),set(C,D,!0),set(N,q(D),!0),set($,""),requestAnimationFrame(()=>{var H;return(H=get(A))==null?void 0:H.focus()});return}set(I,"drawing"),R=D,M=[D]}function ce(V){if(get(I)!=="drawing")return;const D=Y(V);get(_)==="freehand"&&M.push(D),j();const H=ue(D);if(H&&get(x)){const X=get(x).getContext("2d");X&&renderShape(X,H)}}function se(V){if(get(I)!=="drawing")return;const D=Y(V),H=ue(D);H&&set(y,[...get(y),H],!0),set(I,"idle"),M=[],j(),F()}function xe(){if(get($).trim()){const V={id:nextShapeId(),type:"text",color:get(b),strokeWidth:DEFAULT_STROKE_WIDTH,position:get(C),content:get($).trim(),fontSize:20};set(y,[...get(y),V],!0),F()}set($,""),set(I,"idle")}function ve(V){V.key==="Enter"?(V.preventDefault(),xe()):V.key==="Escape"&&(V.preventDefault(),set($,""),set(I,"idle"))}function Re(){get(y).length!==0&&(set(y,get(y).slice(0,-1),!0),F())}function ke(){set(y,[],!0),F()}async function me(){if(get(y).length===0){g()(h());return}const V=await mergeAnnotation(h(),get(y),get(E),get(S));g()(V)}function Ce(){m()()}function T(V){V.stopPropagation(),V.key==="Escape"&&get(I)!=="typing"&&Ce(),(V.ctrlKey||V.metaKey)&&V.key==="z"&&(V.preventDefault(),Re())}const z={arrow:"M5 19L19 5M19 5H9M19 5V15",rectangle:"M3 3h18v18H3z",ellipse:"",freehand:"M3 17c1-2 3-6 5-6s3 4 5 4 3-6 5-6 2 4 3 4",text:"M6 4v16M18 4v16M6 12h12M8 4h-4M20 4h-4M8 20h-4M20 20h-4"},L={arrow:"Arrow",rectangle:"Rect",ellipse:"Ellipse",freehand:"Draw",text:"Text"},P=["arrow","rectangle","ellipse","freehand","text"];var G={get imageDataUrl(){return h()},set imageDataUrl(V){h(V),flushSync()},get onsave(){return g()},set onsave(V){g(V),flushSync()},get oncancel(){return m()},set oncancel(V){m(V),flushSync()}},W=root$6(),ie=child(W),J=child(ie);each(J,21,()=>P,index,(V,D)=>{var H=root_1$7();let X;var fe=child(H);{var Q=Te=>{var Fe=root_2$7();append(Te,Fe)},de=Te=>{var Fe=root_3$6(),Oe=child(Fe);reset(Fe),template_effect(()=>set_attribute(Oe,"d",z[get(D)])),append(Te,Fe)};if_block(fe,Te=>{get(D)==="ellipse"?Te(Q):Te(de,!1)})}var we=sibling(fe,2),Ze=child(we,!0);reset(we),reset(H),template_effect(()=>{X=set_class(H,1,"tool-btn svelte-yff65c",null,X,{active:get(_)===get(D)}),set_attribute(H,"title",L[get(D)]),set_text(Ze,L[get(D)])}),delegated("click",H,()=>{set(_,get(D),!0)}),append(V,H)}),reset(J);var ne=sibling(J,4);each(ne,21,()=>ANNOTATION_COLORS,index,(V,D)=>{var H=root_4$4();let X;template_effect(()=>{X=set_class(H,1,"color-swatch svelte-yff65c",null,X,{active:get(b)===get(D)}),set_style(H,`background: ${get(D)??""}; ${get(D)==="#111827"?"border-color: #6b7280;":""}`),set_attribute(H,"title",get(D))}),delegated("click",H,()=>{set(b,get(D),!0)}),append(V,H)}),reset(ne);var ge=sibling(ne,4),ee=child(ge),he=sibling(ee,2);reset(ge);var B=sibling(ge,4),K=child(B),pe=sibling(K,2);reset(B),reset(ie);var le=sibling(ie,2),Ee=child(le);{var Me=V=>{var D=root_5$4(),H=first_child(D);bind_this(H,Q=>set(w,Q),()=>get(w));var X=sibling(H,2);let fe;bind_this(X,Q=>set(x,Q),()=>get(x)),template_effect(()=>{set_attribute(H,"width",get(E)),set_attribute(H,"height",get(S)),set_attribute(X,"width",get(E)),set_attribute(X,"height",get(S)),fe=set_class(X,1,"overlay-canvas svelte-yff65c",null,fe,{"cursor-crosshair":get(_)!=="text","cursor-text":get(_)==="text"})}),delegated("mousedown",X,oe),delegated("mousemove",X,ce),delegated("mouseup",X,se),append(V,D)},Se=V=>{var D=root_6$5();append(V,D)};if_block(Ee,V=>{get(k)?V(Me):V(Se,!1)})}reset(le);var We=sibling(le,2);{var ae=V=>{var D=root_7$5();remove_input_defaults(D),bind_this(D,H=>set(A,H),()=>get(A)),template_effect(()=>set_style(D,`left: ${get(N).left??""}; top: ${get(N).top??""}; color: ${get(b)??""};`)),delegated("keydown",D,ve),event("blur",D,xe),bind_value(D,()=>get($),H=>set($,H)),append(V,D)};if_block(We,V=>{get(I)==="typing"&&V(ae)})}return reset(W),template_effect(()=>{ee.disabled=get(y).length===0,he.disabled=get(y).length===0}),delegated("keydown",W,T),delegated("keyup",W,V=>V.stopPropagation()),event("keypress",W,V=>V.stopPropagation()),delegated("click",ee,Re),delegated("click",he,ke),delegated("click",K,Ce),delegated("click",pe,me),append(d,W),pop(G)}delegate(["keydown","keyup","click","mousedown","mousemove","mouseup"]),create_custom_element(AnnotationEditor,{imageDataUrl:{},onsave:{},oncancel:{}},[],[],{mode:"open"});var root_2$6=from_html('<div class="log-entry svelte-x1hlqn"><span class="log-type svelte-x1hlqn"> </span> <span class="log-msg svelte-x1hlqn"> </span></div>'),root_3$5=from_html('<div class="log-more svelte-x1hlqn"> </div>'),root_1$6=from_html('<div class="log-list svelte-x1hlqn"><div class="log-header svelte-x1hlqn"> </div> <div class="log-scroll svelte-x1hlqn"><!> <!></div></div>');const $$css$7={hash:"svelte-x1hlqn",code:".log-list.svelte-x1hlqn {border:1px solid #374151;border-radius:6px;overflow:hidden;}.log-header.svelte-x1hlqn {padding:6px 10px;background:#1f2937;font-size:11px;font-weight:600;color:#d1d5db;border-bottom:1px solid #374151;}.log-scroll.svelte-x1hlqn {max-height:140px;overflow-y:auto;background:#111827;}.log-entry.svelte-x1hlqn {padding:4px 10px;font-size:11px;font-family:'SF Mono', 'Fira Code', 'Cascadia Code', monospace;display:flex;gap:8px;border-bottom:1px solid #1f293780;line-height:1.4;}.log-type.svelte-x1hlqn {font-weight:600;text-transform:uppercase;font-size:10px;min-width:40px;flex-shrink:0;}.log-msg.svelte-x1hlqn {color:#d1d5db;word-break:break-word;}.log-more.svelte-x1hlqn {padding:4px 10px;font-size:10px;color:#6b7280;text-align:center;}"};function ConsoleLogList(d,p){push(p,!0),append_styles(d,$$css$7);let h=prop(p,"logs",23,()=>[]);const g={error:"#ef4444",warn:"#f59e0b",info:"#3b82f6",log:"#9ca3af",debug:"#8b5cf6",trace:"#6b7280"};var m={get logs(){return h()},set logs(w=[]){h(w),flushSync()}},_=comment(),b=first_child(_);{var y=w=>{var x=root_1$6(),E=child(x),S=child(E);reset(E);var k=sibling(E,2),I=child(k);each(I,17,()=>h().slice(-10),index,(A,C)=>{var N=root_2$6(),$=child(N),O=child($,!0);reset($);var F=sibling($,2),j=child(F);reset(F),reset(N),template_effect(Y=>{set_style($,`color: ${(g[get(C).type]||"#9ca3af")??""}`),set_text(O,get(C).type),set_text(j,`${Y??""}${get(C).message.length>120?"...":""}`)},[()=>get(C).message.substring(0,120)]),append(A,N)});var R=sibling(I,2);{var M=A=>{var C=root_3$5(),N=child(C);reset(C),template_effect(()=>set_text(N,`+${h().length-10} more`)),append(A,C)};if_block(R,A=>{h().length>10&&A(M)})}reset(k),reset(x),template_effect(()=>set_text(S,`Console Logs (${h().length??""})`)),append(w,x)};if_block(b,w=>{h().length>0&&w(y)})}return append(d,_),pop(m)}create_custom_element(ConsoleLogList,{logs:{}},[],[],{mode:"open"});var root_2$5=from_svg('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M3 8L6.5 11.5L13 4.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),root_3$4=from_svg('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="8" r="6" stroke="currentColor" stroke-width="1.5"></circle><path d="M8 5V8.5M8 10.5V11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>'),root_1$5=from_html('<div><span class="icon svelte-1f5s7q1"><!></span> <span class="msg"> </span></div>');const $$css$6={hash:"svelte-1f5s7q1",code:`.jat-toast.svelte-1f5s7q1 {position:absolute;bottom:70px;right:0;padding:10px 16px;border-radius:8px;font-size:13px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;display:flex;align-items:center;gap:8px;box-shadow:0 4px 12px rgba(0,0,0,0.2);
|
|
80
80
|
animation: svelte-1f5s7q1-toast-in 0.3s ease;white-space:nowrap;}.success.svelte-1f5s7q1 {background:#065f46;color:#d1fae5;border:1px solid #10b981;}.error.svelte-1f5s7q1 {background:#7f1d1d;color:#fecaca;border:1px solid #ef4444;}.info.svelte-1f5s7q1 {background:#1e3a5f;color:#bfdbfe;border:1px solid #3b82f6;}.icon.svelte-1f5s7q1 {display:flex;align-items:center;}
|
|
81
81
|
@keyframes svelte-1f5s7q1-toast-in {
|
|
82
82
|
from { opacity: 0; transform: translateY(8px); }
|
|
@@ -117,7 +117,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
117
117
|
|
|
118
118
|
/* Thread container */.thread.svelte-1fnmin5 {margin-top:6px;display:flex;flex-direction:column;gap:4px;}.thread-entry.svelte-1fnmin5 {padding:6px 8px;border-radius:5px;font-size:12px;border-left:2px solid;}.thread-user.svelte-1fnmin5 {background:#111827;border-left-color:#6b7280;}.thread-dev.svelte-1fnmin5 {background:#0f172a;border-left-color:#3b82f6;}.thread-entry-header.svelte-1fnmin5 {display:flex;align-items:center;gap:6px;margin-bottom:3px;}.thread-from.svelte-1fnmin5 {font-weight:600;font-size:11px;color:#d1d5db;}.thread-type-badge.svelte-1fnmin5 {font-size:9px;font-weight:600;padding:1px 5px;border-radius:3px;text-transform:uppercase;letter-spacing:0.3px;}.thread-type-badge.submission.svelte-1fnmin5 {background:#6b728020;color:#9ca3af;}.thread-type-badge.completion.svelte-1fnmin5 {background:#3b82f620;color:#60a5fa;}.thread-type-badge.rejection.svelte-1fnmin5 {background:#ef444420;color:#f87171;}.thread-type-badge.acceptance.svelte-1fnmin5 {background:#10b98120;color:#34d399;}.thread-time.svelte-1fnmin5 {font-size:10px;color:#4b5563;margin-left:auto;}.thread-message.svelte-1fnmin5 {color:#d1d5db;line-height:1.5;margin:0;word-break:break-word;}.thread-summary.svelte-1fnmin5 {margin:4px 0 0 0;padding:0 0 0 16px;font-size:11px;color:#9ca3af;}.thread-summary.svelte-1fnmin5 li:where(.svelte-1fnmin5) {margin:1px 0;}.thread-screenshots.svelte-1fnmin5 {display:flex;gap:4px;margin-top:4px;}.thread-elements.svelte-1fnmin5 {display:flex;gap:3px;flex-wrap:wrap;margin-top:4px;}.element-badge.svelte-1fnmin5 {font-size:10px;font-family:'SF Mono', 'Fira Code', 'Consolas', monospace;padding:1px 5px;background:#1e293b;border:1px solid #334155;border-radius:3px;color:#94a3b8;}.element-badge.removable.svelte-1fnmin5 {display:inline-flex;align-items:center;gap:3px;}.element-remove.svelte-1fnmin5 {background:none;border:none;color:#6b7280;cursor:pointer;padding:0;font-size:12px;line-height:1;}.element-remove.svelte-1fnmin5:hover {color:#ef4444;}
|
|
119
119
|
|
|
120
|
-
/* Enhanced rejection form */.reject-attachments.svelte-1fnmin5 {display:flex;gap:6px;margin-top:6px;}.attach-btn.svelte-1fnmin5 {display:flex;align-items:center;gap:4px;padding:3px 8px;background:#111827;border:1px solid #374151;border-radius:4px;color:#9ca3af;font-size:11px;cursor:pointer;font-family:inherit;transition:border-color 0.15s, color 0.15s;}.attach-btn.svelte-1fnmin5:hover:not(:disabled) {border-color:#60a5fa;color:#d1d5db;}.attach-btn.svelte-1fnmin5:disabled {opacity:0.5;cursor:not-allowed;}.reject-preview-strip.svelte-1fnmin5 {display:flex;gap:4px;margin-top:6px;overflow-x:auto;}.reject-preview-item.svelte-1fnmin5 {position:relative;flex-shrink:0;width:52px;height:36px;border-radius:4px;overflow:hidden;border:1px solid #374151;}.reject-preview-item.svelte-1fnmin5 img:where(.svelte-1fnmin5) {width:100%;height:100%;object-fit:cover;display:block;}.reject-preview-remove.svelte-1fnmin5 {position:absolute;top:1px;right:1px;width:14px;height:14px;border-radius:50%;background:rgba(0,0,0,0.7);color:#e5e7eb;border:none;cursor:pointer;font-size:10px;line-height:1;display:flex;align-items:center;justify-content:center;}.reject-preview-remove.svelte-1fnmin5:hover {background:#ef4444;}.reject-element-strip.svelte-1fnmin5 {display:flex;gap:3px;flex-wrap:wrap;margin-top:6px;}.report-footer.svelte-1fnmin5 {display:flex;align-items:center;justify-content:space-between;margin-top:8px;}.report-time.svelte-1fnmin5 {font-size:11px;color:#6b7280;}.status-pill.svelte-1fnmin5 {font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;}.status-pill.accepted.svelte-1fnmin5 {color:#10b981;background:#10b98118;}.status-pill.rejected.svelte-1fnmin5 {color:#ef4444;background:#ef444418;}.response-actions.svelte-1fnmin5 {display:flex;gap:6px;}.accept-btn.svelte-1fnmin5, .reject-btn.svelte-1fnmin5 {padding:3px 10px;border-radius:4px;font-size:11px;font-weight:600;cursor:pointer;border:1px solid;font-family:inherit;transition:background 0.15s;}.accept-btn.svelte-1fnmin5 {background:#10b98118;color:#10b981;border-color:#10b98140;}.accept-btn.svelte-1fnmin5:hover:not(:disabled) {background:#10b98130;}.reject-btn.svelte-1fnmin5 {background:#ef444418;color:#ef4444;border-color:#ef444440;}.reject-btn.svelte-1fnmin5:hover:not(:disabled) {background:#ef444430;}.accept-btn.svelte-1fnmin5:disabled, .reject-btn.svelte-1fnmin5:disabled {opacity:0.5;cursor:not-allowed;}.reject-reason-form.svelte-1fnmin5 {width:100%;margin-top:6px;}.reject-reason-input.svelte-1fnmin5 {width:100%;padding:6px 8px;background:#111827;border:1px solid #374151;border-radius:5px;color:#d1d5db;font-size:12px;font-family:inherit;resize:vertical;min-height:40px;}.reject-reason-input.svelte-1fnmin5:focus {outline:none;border-color:#ef4444;}.reject-reason-actions.svelte-1fnmin5 {display:flex;justify-content:flex-end;gap:6px;margin-top:6px;}.cancel-btn.svelte-1fnmin5 {padding:3px 10px;border-radius:4px;font-size:11px;font-weight:600;cursor:pointer;border:1px solid #374151;background:#1f2937;color:#9ca3af;font-family:inherit;transition:background 0.15s;}.cancel-btn.svelte-1fnmin5:hover {background:#374151;}.confirm-reject-btn.svelte-1fnmin5 {padding:3px 10px;border-radius:4px;font-size:11px;font-weight:600;cursor:pointer;border:1px solid #ef444440;background:#ef444418;color:#ef4444;font-family:inherit;transition:background 0.15s;}.confirm-reject-btn.svelte-1fnmin5:hover:not(:disabled) {background:#ef444430;}.confirm-reject-btn.svelte-1fnmin5:disabled {opacity:0.5;cursor:not-allowed;}.char-hint.svelte-1fnmin5 {display:block;font-size:10px;color:#6b7280;margin-top:3px;}`};function RequestList(d,p){push(p,!0),append_styles(d,$$css$4);let h=prop(p,"endpoint",7),g=prop(p,"reports",31,()=>proxy([])),m=prop(p,"loading",7),_=prop(p,"error",7),b=prop(p,"onreload",7),y=state(null),w=state(null),x=state(null),E=state(void 0),S=state(""),k=state(""),I=state(""),R=state(proxy([])),M=state(proxy([])),A=state(!1),C=state("active"),N=state("all"),$=user_derived(()=>get(N)==="all"?g():g().filter(D=>(D.source||"feedback")===get(N))),O=user_derived(()=>get(C)==="active"?get($).filter(D=>["submitted","in_progress","rejected","completed","wontfix"].includes(D.status)):get($).filter(D=>D.status==="accepted"||D.status==="closed")),F=user_derived(()=>get($).filter(D=>["submitted","in_progress","rejected","completed","wontfix"].includes(D.status)).length),j=user_derived(()=>get($).filter(D=>D.status==="accepted"||D.status==="closed").length),Y=user_derived(()=>g().filter(D=>(D.source||"feedback")==="feedback").length),q=user_derived(()=>g().filter(D=>D.source==="jat").length),ue=user_derived(()=>get(Y)>0&&get(q)>0);function oe(D){return D?D.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/^#{1,3} (.+)$/gm,'<strong style="display:block;margin-top:6px;color:#f3f4f6">$1</strong>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/^[-*] (.+)$/gm,'<span style="display:block;padding-left:10px">• $1</span>').replace(/\n/g,"<br>"):""}function ce(D){const H=get(x)===D;set(x,H?null:D,!0),H?(get(w)===D&&set(w,null),set(y,null)):setTimeout(()=>{if(!get(E))return;const X=get(E).querySelector(`[data-card-id="${D}"]`);X&&X.scrollIntoView({behavior:"smooth",block:"nearest"})},220)}function se(D){set(k,D,!0),set(I,""),set(R,[],!0),set(M,[],!0)}function xe(){set(k,""),set(I,""),set(R,[],!0),set(M,[],!0)}async function ve(){if(!get(A)){set(A,!0);try{const D=await captureViewport();set(R,[...get(R),D],!0)}catch(D){console.error("Screenshot capture failed:",D)}set(A,!1)}}function Re(D){set(R,get(R).filter((H,X)=>X!==D),!0)}function ke(){startElementPicker(D=>{set(M,[...get(M),{tagName:D.tagName,className:D.className,id:D.id,selector:D.selector,textContent:D.textContent}],!0)})}function me(D){set(M,get(M).filter((H,X)=>X!==D),!0)}async function Ce(D,H,X){set(S,D,!0);const fe=H==="rejected"?{screenshots:get(R).length>0?get(R):void 0,elements:get(M).length>0?get(M):void 0}:void 0;(await respondToReport(h(),D,H,X,fe)).ok?(g(g().map(de=>de.id===D?{...de,status:H==="rejected"?"submitted":"accepted",responded_at:new Date().toISOString(),...H==="rejected"?{revision_count:(de.revision_count||0)+1}:{}}:de)),set(k,""),set(I,""),set(R,[],!0),set(M,[],!0),b()()):set(k,""),set(S,"")}function T(D){set(w,get(w)===D?null:D,!0)}function z(D){return D?D.length:0}function L(D){return{submission:"Submitted",completion:"Completed",rejection:"Rejected",acceptance:"Accepted",note:"Note"}[D.type]||D.type}function P(D){return{submitted:"Submitted",in_progress:"Working On It",completed:"Ready for Review",accepted:"Done",rejected:"Revising",wontfix:"Won't Fix",closed:"Closed"}[D]||D}function G(D){return{submitted:"#6b7280",in_progress:"#3b82f6",completed:"#f59e0b",accepted:"#10b981",rejected:"#f59e0b",wontfix:"#6b7280",closed:"#6b7280"}[D]||"#6b7280"}function W(D){const H=D.issue_type||D.type;return H==="bug"?"🐛":H==="enhancement"||H==="feature"?"✨":H==="task"?"✅":H==="epic"?"🎯":"📝"}function ie(D){const H=Date.now(),X=new Date(D).getTime(),fe=H-X,Q=Math.floor(fe/6e4);if(Q<1)return"just now";if(Q<60)return`${Q}m ago`;const de=Math.floor(Q/60);if(de<24)return`${de}h ago`;const we=Math.floor(de/24);return we<30?`${we}d ago`:new Date(D).toLocaleDateString()}var J={get endpoint(){return h()},set endpoint(D){h(D),flushSync()},get reports(){return g()},set reports(D=[]){g(D),flushSync()},get loading(){return m()},set loading(D){m(D),flushSync()},get error(){return _()},set error(D){_(D),flushSync()},get onreload(){return b()},set onreload(D){b(D),flushSync()}},ne=root$4(),ge=child(ne);{var ee=D=>{var H=root_1$3(),X=child(H);let fe;var Q=sibling(child(X)),de=child(Q,!0);reset(Q),reset(X);var we=sibling(X,2);let Ze;var Te=sibling(child(we)),Le=child(Te,!0);reset(Te),reset(we);var Oe=sibling(we,2);let te;var Qe=sibling(child(Oe)),wt=child(Qe,!0);reset(Qe),reset(Oe),reset(H),template_effect(()=>{fe=set_class(X,1,"source-pill svelte-1fnmin5",null,fe,{active:get(N)==="all"}),set_text(de,g().length),Ze=set_class(we,1,"source-pill svelte-1fnmin5",null,Ze,{active:get(N)==="feedback"}),set_text(Le,get(Y)),te=set_class(Oe,1,"source-pill svelte-1fnmin5",null,te,{active:get(N)==="jat"}),set_text(wt,get(q))}),delegated("click",X,()=>set(N,"all")),delegated("click",we,()=>set(N,"feedback")),delegated("click",Oe,()=>set(N,"jat")),append(D,H)};if_block(ge,D=>{get(ue)&&D(ee)})}var he=sibling(ge,2),B=child(he);let K;var pe=sibling(child(B));{var le=D=>{var H=root_2$3(),X=child(H,!0);reset(H),template_effect(()=>set_text(X,get(F))),append(D,H)};if_block(pe,D=>{get(F)>0&&D(le)})}reset(B);var Ee=sibling(B,2);let Me;var Se=sibling(child(Ee));{var We=D=>{var H=root_3$2(),X=child(H,!0);reset(H),template_effect(()=>set_text(X,get(j))),append(D,H)};if_block(Se,D=>{get(j)>0&&D(We)})}reset(Ee),reset(he);var ae=sibling(he,2),V=child(ae);return key(V,()=>get(C),D=>{var H=root_4$2(),X=child(H);{var fe=Te=>{var Le=root_5$2();append(Te,Le)},Q=Te=>{var Le=root_6$3(),Oe=child(Le),te=child(Oe,!0);reset(Oe);var Qe=sibling(Oe,2);reset(Le),template_effect(()=>set_text(te,_())),delegated("click",Qe,function(...wt){var Ge;(Ge=b())==null||Ge.apply(this,wt)}),append(Te,Le)},de=Te=>{var Le=root_7$3(),Oe=child(Le);Oe.textContent="📋",next(4),reset(Le),append(Te,Le)},we=Te=>{var Le=root_8$3(),Oe=child(Le),te=child(Oe,!0);reset(Oe),reset(Le),template_effect(()=>set_text(te,get(C)==="submitted"?"No submitted requests":get(C)==="review"?"Nothing to review right now":"No completed requests yet")),append(Te,Le)},Ze=Te=>{var Le=root_9$2();each(Le,21,()=>get(O),Oe=>Oe.id,(Oe,te)=>{var Qe=root_10$2();let wt;var Ge=child(Qe),Ve=child(Ge),yt=child(Ve,!0);reset(Ve);var Ot=sibling(Ve,2),Cn=child(Ot,!0);reset(Ot);var Be=sibling(Ot,2),He=child(Be,!0);reset(Be);var xt=sibling(Be,2);let dt;reset(Ge);var Wt=sibling(Ge,2);{var ar=hn=>{var nn=root_11$2(),In=child(nn);{var Fn=Ne=>{var De=root_12$2(),et=sibling(child(De),2),pt=child(et,!0);reset(et),reset(De),template_effect(Rt=>{set_attribute(De,"href",get(te).page_url),set_text(pt,Rt)},[()=>get(te).page_url.replace(/^https?:\/\//,"").split("?")[0]]),append(Ne,De)};if_block(In,Ne=>{get(te).page_url&&Ne(Fn)})}var gn=sibling(In,2);{var lr=Ne=>{var De=root_13$2(),et=child(De);reset(De),template_effect(()=>set_text(et,`Revision ${get(te).revision_count??""}`)),append(Ne,De)};if_block(gn,Ne=>{get(te).revision_count>0&&get(te).status!=="accepted"&&Ne(lr)})}var Kn=sibling(gn,2);{var Pn=Ne=>{var De=root_14$3(),et=first_child(De),pt=child(et);let Rt;var it=sibling(pt,2),rt=child(it);reset(it),reset(et);var qe=sibling(et,2);{var ht=Ye=>{var Et=root_15$3();each(Et,21,()=>get(te).thread,Qt=>Qt.id,(Qt,Xe)=>{var sn=root_16$3();let an;var _n=child(sn),Vt=child(_n),Rn=child(Vt,!0);reset(Vt);var Dt=sibling(Vt,2);let An;var Un=child(Dt,!0);reset(Dt);var Z=sibling(Dt,2),re=child(Z,!0);reset(Z),reset(_n);var _e=sibling(_n,2),ye=child(_e);html(ye,()=>oe(get(Xe).message)),reset(_e);var Fe=sibling(_e,2);{var Ue=st=>{var mt=root_17$3();each(mt,21,()=>get(Xe).summary,index,(je,Pe)=>{var tt=root_18$2(),bt=child(tt,!0);reset(tt),template_effect(()=>set_text(bt,get(Pe))),append(je,tt)}),reset(mt),append(st,mt)};if_block(Fe,st=>{get(Xe).summary&&get(Xe).summary.length>0&&st(Ue)})}var ut=sibling(Fe,2);{var gt=st=>{var mt=root_19$2(),je=first_child(mt);each(je,21,()=>get(Xe).screenshots,index,(bt,kt,At)=>{var Nn=comment(),jn=first_child(Nn);{var en=Ct=>{var Lt=root_21$2();set_attribute(Lt,"aria-label",`Screenshot ${At+1}`);var $n=child(Lt);set_attribute($n,"alt",`Screenshot ${At+1}`),reset(Lt),template_effect(()=>set_attribute($n,"src",`${h()??""}${get(kt).url??""}`)),delegated("click",Lt,()=>set(y,get(y)===get(kt).url?null:get(kt).url,!0)),append(Ct,Lt)};if_block(jn,Ct=>{get(kt).url&&Ct(en)})}append(bt,Nn)}),reset(je);var Pe=sibling(je,2);{var tt=bt=>{const kt=user_derived(()=>get(Xe).screenshots.find(en=>en.url===get(y)));var At=comment(),Nn=first_child(At);{var jn=en=>{var Ct=root_23$2(),Lt=child(Ct),$n=sibling(Lt,2);reset(Ct),template_effect(()=>set_attribute(Lt,"src",`${h()??""}${get(y)??""}`)),delegated("click",$n,()=>set(y,null)),append(en,Ct)};if_block(Nn,en=>{get(kt)&&en(jn)})}append(bt,At)};if_block(Pe,bt=>{get(y)&&bt(tt)})}append(st,mt)};if_block(ut,st=>{get(Xe).screenshots&&get(Xe).screenshots.length>0&&st(gt)})}var _t=sibling(ut,2);{var Gt=st=>{var mt=root_24$1();each(mt,21,()=>get(Xe).elements,index,(je,Pe)=>{var tt=root_25$1(),bt=child(tt);reset(tt),template_effect((kt,At)=>{set_attribute(tt,"title",get(Pe).selector),set_text(bt,`<${kt??""}${get(Pe).id?`#${get(Pe).id}`:""}${At??""}>`)},[()=>get(Pe).tagName.toLowerCase(),()=>get(Pe).className?`.${get(Pe).className.split(" ")[0]}`:""]),append(je,tt)}),reset(mt),append(st,mt)};if_block(_t,st=>{get(Xe).elements&&get(Xe).elements.length>0&&st(Gt)})}reset(sn),template_effect((st,mt)=>{an=set_class(sn,1,"thread-entry svelte-1fnmin5",null,an,{"thread-user":get(Xe).from==="user","thread-dev":get(Xe).from==="dev"}),set_text(Rn,get(Xe).from==="user"?"You":"Dev"),An=set_class(Dt,1,"thread-type-badge svelte-1fnmin5",null,An,{submission:get(Xe).type==="submission",completion:get(Xe).type==="completion",rejection:get(Xe).type==="rejection",acceptance:get(Xe).type==="acceptance"}),set_text(Un,st),set_text(re,mt)},[()=>L(get(Xe)),()=>ie(get(Xe).at)]),append(Qt,sn)}),reset(Et),append(Ye,Et)};if_block(qe,Ye=>{get(w)===get(te).id&&Ye(ht)})}template_effect((Ye,Et)=>{Rt=set_class(pt,0,"thread-toggle-icon svelte-1fnmin5",null,Rt,{expanded:get(w)===get(te).id}),set_text(rt,`${Ye??""} ${Et??""}`)},[()=>z(get(te).thread),()=>z(get(te).thread)===1?"message":"messages"]),delegated("click",et,()=>T(get(te).id)),append(Ne,De)},cr=Ne=>{var De=root_26(),et=child(De,!0);reset(De),template_effect(pt=>set_text(et,pt),[()=>get(te).description.length>120?get(te).description.slice(0,120)+"...":get(te).description]),append(Ne,De)};if_block(Kn,Ne=>{get(te).thread&&get(te).thread.length>0?Ne(Pn):get(te).description&&Ne(cr,1)})}var Xn=sibling(Kn,2);{var Zn=Ne=>{var De=root_27$1(),et=first_child(De);each(et,21,()=>get(te).screenshot_urls,index,(rt,qe,ht)=>{var Ye=root_28$1();set_attribute(Ye,"aria-label",`Screenshot ${ht+1}`);var Et=child(Ye);set_attribute(Et,"alt",`Screenshot ${ht+1}`),reset(Ye),template_effect(()=>set_attribute(Et,"src",`${h()??""}${get(qe)??""}`)),delegated("click",Ye,()=>set(y,get(y)===get(qe)?null:get(qe),!0)),append(rt,Ye)}),reset(et);var pt=sibling(et,2);{var Rt=rt=>{var qe=root_29$1(),ht=child(qe),Ye=sibling(ht,2);reset(qe),template_effect(()=>set_attribute(ht,"src",`${h()??""}${get(y)??""}`)),delegated("click",Ye,()=>set(y,null)),append(rt,qe)},it=user_derived(()=>get(y)&&get(te).screenshot_urls.includes(get(y)));if_block(pt,rt=>{get(it)&&rt(Rt)})}append(Ne,De)};if_block(Xn,Ne=>{!get(te).thread&&get(te).screenshot_urls&&get(te).screenshot_urls.length>0&&Ne(Zn)})}var Jn=sibling(Xn,2);{var Qn=Ne=>{const De=user_derived(()=>{var it,rt;return get(te).recording_url??((rt=(it=get(te).thread)==null?void 0:it.find(qe=>qe.recordingUrl))==null?void 0:rt.recordingUrl)??null});var et=comment(),pt=first_child(et);{var Rt=it=>{var rt=root_31$1(),qe=first_child(rt),ht=sibling(child(qe),2);reset(qe);var Ye=sibling(qe,2);{let Et=user_derived(()=>get(te).console_logs??null),Qt=user_derived(()=>get(te).network_requests??null);TimelineViewer(Ye,{get recordingUrl(){return get(De)},get endpoint(){return h()},get consoleLogs(){return get(Et)},get networkRequests(){return get(Qt)}})}template_effect(()=>set_attribute(ht,"href",`${h()??""}/feedback/replay.html?id=${get(te).id??""}`)),append(it,rt)};if_block(pt,it=>{get(De)&&it(Rt)})}append(Ne,et)},rn=user_derived(()=>get(te).recording_url||get(te).thread&&get(te).thread.some(Ne=>Ne.recordingUrl));if_block(Jn,Ne=>{get(rn)&&Ne(Qn)})}var Tn=sibling(Jn,2);{var er=Ne=>{var De=root_32$1(),et=sibling(child(De),2),pt=child(et);html(pt,()=>oe(get(te).dev_notes)),reset(et),reset(De),append(Ne,De)};if_block(Tn,Ne=>{get(te).dev_notes&&!get(te).thread&&get(te).status!=="in_progress"&&Ne(er)})}var tr=sibling(Tn,2),mn=child(tr),Bn=child(mn,!0);reset(mn);var nr=sibling(mn,2);{var vn=Ne=>{var De=root_33$1();De.textContent="✓ Accepted",append(Ne,De)},rr=Ne=>{var De=root_34$1();De.textContent="✗ Rejected",append(Ne,De)},dr=Ne=>{var De=comment(),et=first_child(De);{var pt=it=>{var rt=root_36$1(),qe=child(rt);remove_textarea_child(qe);var ht=sibling(qe,2),Ye=child(ht),Et=sibling(child(Ye));reset(Ye);var Qt=sibling(Ye,2);reset(ht);var Xe=sibling(ht,2);{var sn=_e=>{var ye=root_37$1();each(ye,21,()=>get(R),index,(Fe,Ue,ut)=>{var gt=root_38(),_t=child(gt);set_attribute(_t,"alt",`Screenshot ${ut+1}`);var Gt=sibling(_t,2);reset(gt),template_effect(()=>set_attribute(_t,"src",get(Ue))),delegated("click",Gt,()=>Re(ut)),append(Fe,gt)}),reset(ye),append(_e,ye)};if_block(Xe,_e=>{get(R).length>0&&_e(sn)})}var an=sibling(Xe,2);{var _n=_e=>{var ye=root_39();each(ye,21,()=>get(M),index,(Fe,Ue,ut)=>{var gt=root_40(),_t=child(gt),Gt=sibling(_t);reset(gt),template_effect(st=>set_text(_t,`<${st??""}${get(Ue).id?`#${get(Ue).id}`:""}> `),[()=>get(Ue).tagName.toLowerCase()]),delegated("click",Gt,()=>me(ut)),append(Fe,gt)}),reset(ye),append(_e,ye)};if_block(an,_e=>{get(M).length>0&&_e(_n)})}var Vt=sibling(an,2),Rn=child(Vt),Dt=sibling(Rn,2),An=child(Dt,!0);reset(Dt),reset(Vt);var Un=sibling(Vt,2);{var Z=_e=>{var ye=root_41(),Fe=child(ye);reset(ye),template_effect(Ue=>set_text(Fe,`${Ue??""} more characters needed`),[()=>10-get(I).trim().length]),append(_e,ye)},re=user_derived(()=>get(I).trim().length>0&&get(I).trim().length<10);if_block(Un,_e=>{get(re)&&_e(Z)})}reset(rt),template_effect(_e=>{Ye.disabled=get(A),set_text(Et,` ${get(A)?"...":"Screenshot"}`),Dt.disabled=_e,set_text(An,get(S)===get(te).id?"...":"✗ Reject")},[()=>get(I).trim().length<10||get(S)===get(te).id]),bind_value(qe,()=>get(I),_e=>set(I,_e)),delegated("click",Ye,ve),delegated("click",Qt,ke),delegated("click",Rn,xe),delegated("click",Dt,()=>Ce(get(te).id,"rejected",get(I).trim())),append(it,rt)},Rt=it=>{var rt=root_42(),qe=child(rt),ht=child(qe,!0);reset(qe);var Ye=sibling(qe,2);Ye.textContent="✗ Reject",reset(rt),template_effect(()=>{qe.disabled=get(S)===get(te).id,set_text(ht,get(S)===get(te).id?"...":"✓ Accept"),Ye.disabled=get(S)===get(te).id}),delegated("click",qe,()=>Ce(get(te).id,"accepted")),delegated("click",Ye,()=>se(get(te).id)),append(it,rt)};if_block(et,it=>{get(k)===get(te).id?it(pt):it(Rt,!1)})}append(Ne,De)};if_block(nr,Ne=>{get(te).status==="accepted"?Ne(vn):get(te).status==="rejected"?Ne(rr,1):(get(te).status==="completed"||get(te).status==="wontfix")&&Ne(dr,2)})}reset(tr),reset(nn),template_effect(Ne=>set_text(Bn,Ne),[()=>ie(get(te).created_at)]),transition(3,nn,()=>slide,()=>({duration:200})),append(hn,nn)};if_block(Wt,hn=>{get(x)===get(te).id&&hn(ar)})}reset(Qe),template_effect((hn,nn,In,Fn,gn)=>{wt=set_class(Qe,1,"report-card svelte-1fnmin5",null,wt,{awaiting:get(te).status==="completed",expanded:get(x)===get(te).id}),set_attribute(Qe,"data-card-id",get(te).id),set_text(yt,hn),set_text(Cn,get(te).title),set_style(Be,`background: ${nn??""}20; color: ${In??""}; border-color: ${Fn??""}40;`),set_text(He,gn),dt=set_class(xt,0,"chevron svelte-1fnmin5",null,dt,{"chevron-open":get(x)===get(te).id})},[()=>W(get(te)),()=>G(get(te).status),()=>G(get(te).status),()=>G(get(te).status),()=>P(get(te).status)]),delegated("click",Ge,()=>ce(get(te).id)),append(Oe,Qe)}),reset(Le),append(Te,Le)};if_block(X,Te=>{m()?Te(fe):_()&&g().length===0?Te(Q,1):g().length===0?Te(de,2):get(O).length===0?Te(we,3):Te(Ze,!1)})}reset(H),transition(3,H,()=>slide,()=>({duration:200})),append(D,H)}),reset(ae),bind_this(ae,D=>set(E,D),()=>get(E)),reset(ne),template_effect(()=>{K=set_class(B,1,"subtab svelte-1fnmin5",null,K,{active:get(C)==="active"}),Me=set_class(Ee,1,"subtab svelte-1fnmin5",null,Me,{active:get(C)==="done"})}),delegated("click",B,()=>set(C,"active")),delegated("click",Ee,()=>set(C,"done")),append(d,ne),pop(J)}delegate(["click"]),create_custom_element(RequestList,{endpoint:{},reports:{},loading:{},error:{},onreload:{}},[],[],{mode:"open"});var root_6$2=from_html('<span class="step-counter svelte-bez0nz"> </span>'),root_7$2=from_html('<div class="empty-state svelte-bez0nz"><div class="empty-icon svelte-bez0nz"><svg width="32" height="32" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor" opacity="0.3" class="svelte-bez0nz"></path><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" class="svelte-bez0nz"></path></svg></div> <p class="empty-text svelte-bez0nz">Tell the agent what to do on this page</p> <p class="empty-hint svelte-bez0nz">e.g. "Fill in the contact form" or "Click the sign up button"</p></div>'),root_14$2=from_html('<span class="msg-tool svelte-bez0nz"> </span>'),root_15$2=from_html('<div class="approval-buttons svelte-bez0nz"><button class="approve-btn svelte-bez0nz"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M20 6L9 17l-5-5" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-bez0nz"></path></svg> Approve</button> <button class="skip-btn svelte-bez0nz"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M5 5l14 14M19 5L5 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="svelte-bez0nz"></path></svg> Skip</button></div>'),root_16$2=from_html("<span> </span>"),root_17$2=from_html('<span class="msg-step svelte-bez0nz"> </span>'),root_10$1=from_html('<div><span class="msg-icon svelte-bez0nz"><!></span> <div class="msg-body svelte-bez0nz"><!> <span class="msg-text svelte-bez0nz"> </span> <!></div> <!></div>'),root_19$1=from_html('<span class="msg-tool svelte-bez0nz"> </span>'),root_20$1=from_html('<span class="msg-duration svelte-bez0nz"> </span>'),root_21$1=from_html('<span class="msg-step svelte-bez0nz"> </span>'),root_18$1=from_html('<div><span class="msg-icon svelte-bez0nz"> </span> <div class="msg-body svelte-bez0nz"><!> <span class="msg-text svelte-bez0nz"> </span> <!></div> <!></div>'),root_22$1=from_html('<div class="message msg-thinking live svelte-bez0nz"><span class="msg-icon svelte-bez0nz">…</span> <div class="msg-body svelte-bez0nz"><span class="thinking-dots svelte-bez0nz"><span class="dot svelte-bez0nz"></span> <span class="dot svelte-bez0nz"></span> <span class="dot svelte-bez0nz"></span></span></div></div>'),root_8$2=from_html("<!> <!>",1),root_23$1=from_html('<button class="stop-btn svelte-bez0nz" aria-label="Stop agent"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" class="svelte-bez0nz"><rect x="6" y="6" width="12" height="12" rx="1" class="svelte-bez0nz"></rect></svg> Stop</button>'),root$3=from_html('<div class="agent-panel svelte-bez0nz"><div class="status-bar svelte-bez0nz"><div><span class="status-dot svelte-bez0nz"></span> <span class="status-text svelte-bez0nz"><!></span></div> <div class="status-right svelte-bez0nz"><!> <label class="auto-approve-toggle svelte-bez0nz" title="Auto-approve all actions"><input type="checkbox" class="svelte-bez0nz"/> <span class="toggle-label svelte-bez0nz">Auto</span></label></div></div> <div class="messages svelte-bez0nz"><!></div> <div class="input-area svelte-bez0nz"><!> <div class="input-row svelte-bez0nz"><input type="text" class="chat-input svelte-bez0nz"/> <button class="send-btn svelte-bez0nz" aria-label="Send"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-bez0nz"></path></svg></button></div></div></div>');const $$css$3={hash:"svelte-bez0nz",code:`.agent-panel.svelte-bez0nz {display:flex;flex-direction:column;height:100%;min-height:0;font-family:inherit;color:#e5e7eb;}
|
|
120
|
+
/* Enhanced rejection form */.reject-attachments.svelte-1fnmin5 {display:flex;gap:6px;margin-top:6px;}.attach-btn.svelte-1fnmin5 {display:flex;align-items:center;gap:4px;padding:3px 8px;background:#111827;border:1px solid #374151;border-radius:4px;color:#9ca3af;font-size:11px;cursor:pointer;font-family:inherit;transition:border-color 0.15s, color 0.15s;}.attach-btn.svelte-1fnmin5:hover:not(:disabled) {border-color:#60a5fa;color:#d1d5db;}.attach-btn.svelte-1fnmin5:disabled {opacity:0.5;cursor:not-allowed;}.reject-preview-strip.svelte-1fnmin5 {display:flex;gap:4px;margin-top:6px;overflow-x:auto;}.reject-preview-item.svelte-1fnmin5 {position:relative;flex-shrink:0;width:52px;height:36px;border-radius:4px;overflow:hidden;border:1px solid #374151;}.reject-preview-item.svelte-1fnmin5 img:where(.svelte-1fnmin5) {width:100%;height:100%;object-fit:cover;display:block;}.reject-preview-remove.svelte-1fnmin5 {position:absolute;top:1px;right:1px;width:14px;height:14px;border-radius:50%;background:rgba(0,0,0,0.7);color:#e5e7eb;border:none;cursor:pointer;font-size:10px;line-height:1;display:flex;align-items:center;justify-content:center;}.reject-preview-remove.svelte-1fnmin5:hover {background:#ef4444;}.reject-element-strip.svelte-1fnmin5 {display:flex;gap:3px;flex-wrap:wrap;margin-top:6px;}.report-footer.svelte-1fnmin5 {display:flex;align-items:center;justify-content:space-between;margin-top:8px;}.report-time.svelte-1fnmin5 {font-size:11px;color:#6b7280;}.status-pill.svelte-1fnmin5 {font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;}.status-pill.accepted.svelte-1fnmin5 {color:#10b981;background:#10b98118;}.status-pill.rejected.svelte-1fnmin5 {color:#ef4444;background:#ef444418;}.response-actions.svelte-1fnmin5 {display:flex;gap:6px;}.accept-btn.svelte-1fnmin5, .reject-btn.svelte-1fnmin5 {padding:3px 10px;border-radius:4px;font-size:11px;font-weight:600;cursor:pointer;border:1px solid;font-family:inherit;transition:background 0.15s;}.accept-btn.svelte-1fnmin5 {background:#10b98118;color:#10b981;border-color:#10b98140;}.accept-btn.svelte-1fnmin5:hover:not(:disabled) {background:#10b98130;}.reject-btn.svelte-1fnmin5 {background:#ef444418;color:#ef4444;border-color:#ef444440;}.reject-btn.svelte-1fnmin5:hover:not(:disabled) {background:#ef444430;}.accept-btn.svelte-1fnmin5:disabled, .reject-btn.svelte-1fnmin5:disabled {opacity:0.5;cursor:not-allowed;}.reject-reason-form.svelte-1fnmin5 {width:100%;margin-top:6px;}.reject-reason-input.svelte-1fnmin5 {width:100%;padding:6px 8px;background:#111827;border:1px solid #374151;border-radius:5px;color:#d1d5db;font-size:12px;font-family:inherit;resize:vertical;min-height:40px;}.reject-reason-input.svelte-1fnmin5:focus {outline:none;border-color:#ef4444;}.reject-reason-actions.svelte-1fnmin5 {display:flex;justify-content:flex-end;gap:6px;margin-top:6px;}.cancel-btn.svelte-1fnmin5 {padding:3px 10px;border-radius:4px;font-size:11px;font-weight:600;cursor:pointer;border:1px solid #374151;background:#1f2937;color:#9ca3af;font-family:inherit;transition:background 0.15s;}.cancel-btn.svelte-1fnmin5:hover {background:#374151;}.confirm-reject-btn.svelte-1fnmin5 {padding:3px 10px;border-radius:4px;font-size:11px;font-weight:600;cursor:pointer;border:1px solid #ef444440;background:#ef444418;color:#ef4444;font-family:inherit;transition:background 0.15s;}.confirm-reject-btn.svelte-1fnmin5:hover:not(:disabled) {background:#ef444430;}.confirm-reject-btn.svelte-1fnmin5:disabled {opacity:0.5;cursor:not-allowed;}.char-hint.svelte-1fnmin5 {display:block;font-size:10px;color:#6b7280;margin-top:3px;}`};function RequestList(d,p){push(p,!0),append_styles(d,$$css$4);let h=prop(p,"endpoint",7),g=prop(p,"reports",31,()=>proxy([])),m=prop(p,"loading",7),_=prop(p,"error",7),b=prop(p,"onreload",7),y=state(null),w=state(null),x=state(null),E=state(void 0),S=state(""),k=state(""),I=state(""),R=state(proxy([])),M=state(proxy([])),A=state(!1),C=state("active"),N=state("all"),$=user_derived(()=>get(N)==="all"?g():g().filter(D=>(D.source||"feedback")===get(N))),O=user_derived(()=>get(C)==="active"?get($).filter(D=>["submitted","in_progress","rejected","completed","wontfix"].includes(D.status)):get($).filter(D=>D.status==="accepted"||D.status==="closed")),F=user_derived(()=>get($).filter(D=>["submitted","in_progress","rejected","completed","wontfix"].includes(D.status)).length),j=user_derived(()=>get($).filter(D=>D.status==="accepted"||D.status==="closed").length),Y=user_derived(()=>g().filter(D=>(D.source||"feedback")==="feedback").length),q=user_derived(()=>g().filter(D=>D.source==="jat").length),ue=user_derived(()=>get(Y)>0&&get(q)>0);function oe(D){return D?D.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/^#{1,3} (.+)$/gm,'<strong style="display:block;margin-top:6px;color:#f3f4f6">$1</strong>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/^[-*] (.+)$/gm,'<span style="display:block;padding-left:10px">• $1</span>').replace(/\n/g,"<br>"):""}function ce(D){const H=get(x)===D;set(x,H?null:D,!0),H?(get(w)===D&&set(w,null),set(y,null)):setTimeout(()=>{if(!get(E))return;const X=get(E).querySelector(`[data-card-id="${D}"]`);X&&X.scrollIntoView({behavior:"smooth",block:"nearest"})},220)}function se(D){set(k,D,!0),set(I,""),set(R,[],!0),set(M,[],!0)}function xe(){set(k,""),set(I,""),set(R,[],!0),set(M,[],!0)}async function ve(){if(!get(A)){set(A,!0);try{const D=await captureViewport();set(R,[...get(R),D],!0)}catch(D){console.error("Screenshot capture failed:",D)}set(A,!1)}}function Re(D){set(R,get(R).filter((H,X)=>X!==D),!0)}function ke(){startElementPicker(D=>{set(M,[...get(M),{tagName:D.tagName,className:D.className,id:D.id,selector:D.selector,textContent:D.textContent}],!0)})}function me(D){set(M,get(M).filter((H,X)=>X!==D),!0)}async function Ce(D,H,X){set(S,D,!0);const fe=H==="rejected"?{screenshots:get(R).length>0?get(R):void 0,elements:get(M).length>0?get(M):void 0}:void 0;(await respondToReport(h(),D,H,X,fe)).ok?(g(g().map(de=>de.id===D?{...de,status:H==="rejected"?"submitted":"accepted",responded_at:new Date().toISOString(),...H==="rejected"?{revision_count:(de.revision_count||0)+1}:{}}:de)),set(k,""),set(I,""),set(R,[],!0),set(M,[],!0),b()()):set(k,""),set(S,"")}function T(D){set(w,get(w)===D?null:D,!0)}function z(D){return D?D.length:0}function L(D){return{submission:"Submitted",completion:"Completed",rejection:"Rejected",acceptance:"Accepted",note:"Note"}[D.type]||D.type}function P(D){return{submitted:"Submitted",in_progress:"Working On It",completed:"Ready for Review",accepted:"Done",rejected:"Revising",wontfix:"Won't Fix",closed:"Closed"}[D]||D}function G(D){return{submitted:"#6b7280",in_progress:"#3b82f6",completed:"#f59e0b",accepted:"#10b981",rejected:"#f59e0b",wontfix:"#6b7280",closed:"#6b7280"}[D]||"#6b7280"}function W(D){const H=D.issue_type||D.type;return H==="bug"?"🐛":H==="enhancement"||H==="feature"?"✨":H==="task"?"✅":H==="epic"?"🎯":"📝"}function ie(D){const H=Date.now(),X=new Date(D).getTime(),fe=H-X,Q=Math.floor(fe/6e4);if(Q<1)return"just now";if(Q<60)return`${Q}m ago`;const de=Math.floor(Q/60);if(de<24)return`${de}h ago`;const we=Math.floor(de/24);return we<30?`${we}d ago`:new Date(D).toLocaleDateString()}var J={get endpoint(){return h()},set endpoint(D){h(D),flushSync()},get reports(){return g()},set reports(D=[]){g(D),flushSync()},get loading(){return m()},set loading(D){m(D),flushSync()},get error(){return _()},set error(D){_(D),flushSync()},get onreload(){return b()},set onreload(D){b(D),flushSync()}},ne=root$4(),ge=child(ne);{var ee=D=>{var H=root_1$3(),X=child(H);let fe;var Q=sibling(child(X)),de=child(Q,!0);reset(Q),reset(X);var we=sibling(X,2);let Ze;var Te=sibling(child(we)),Fe=child(Te,!0);reset(Te),reset(we);var Oe=sibling(we,2);let te;var Qe=sibling(child(Oe)),wt=child(Qe,!0);reset(Qe),reset(Oe),reset(H),template_effect(()=>{fe=set_class(X,1,"source-pill svelte-1fnmin5",null,fe,{active:get(N)==="all"}),set_text(de,g().length),Ze=set_class(we,1,"source-pill svelte-1fnmin5",null,Ze,{active:get(N)==="feedback"}),set_text(Fe,get(Y)),te=set_class(Oe,1,"source-pill svelte-1fnmin5",null,te,{active:get(N)==="jat"}),set_text(wt,get(q))}),delegated("click",X,()=>set(N,"all")),delegated("click",we,()=>set(N,"feedback")),delegated("click",Oe,()=>set(N,"jat")),append(D,H)};if_block(ge,D=>{get(ue)&&D(ee)})}var he=sibling(ge,2),B=child(he);let K;var pe=sibling(child(B));{var le=D=>{var H=root_2$3(),X=child(H,!0);reset(H),template_effect(()=>set_text(X,get(F))),append(D,H)};if_block(pe,D=>{get(F)>0&&D(le)})}reset(B);var Ee=sibling(B,2);let Me;var Se=sibling(child(Ee));{var We=D=>{var H=root_3$2(),X=child(H,!0);reset(H),template_effect(()=>set_text(X,get(j))),append(D,H)};if_block(Se,D=>{get(j)>0&&D(We)})}reset(Ee),reset(he);var ae=sibling(he,2),V=child(ae);return key(V,()=>get(C),D=>{var H=root_4$2(),X=child(H);{var fe=Te=>{var Fe=root_5$2();append(Te,Fe)},Q=Te=>{var Fe=root_6$3(),Oe=child(Fe),te=child(Oe,!0);reset(Oe);var Qe=sibling(Oe,2);reset(Fe),template_effect(()=>set_text(te,_())),delegated("click",Qe,function(...wt){var Ge;(Ge=b())==null||Ge.apply(this,wt)}),append(Te,Fe)},de=Te=>{var Fe=root_7$3(),Oe=child(Fe);Oe.textContent="📋",next(4),reset(Fe),append(Te,Fe)},we=Te=>{var Fe=root_8$3(),Oe=child(Fe),te=child(Oe,!0);reset(Oe),reset(Fe),template_effect(()=>set_text(te,get(C)==="submitted"?"No submitted requests":get(C)==="review"?"Nothing to review right now":"No completed requests yet")),append(Te,Fe)},Ze=Te=>{var Fe=root_9$2();each(Fe,21,()=>get(O),Oe=>Oe.id,(Oe,te)=>{var Qe=root_10$2();let wt;var Ge=child(Qe),Ve=child(Ge),yt=child(Ve,!0);reset(Ve);var Ot=sibling(Ve,2),Cn=child(Ot,!0);reset(Ot);var Be=sibling(Ot,2),He=child(Be,!0);reset(Be);var xt=sibling(Be,2);let dt;reset(Ge);var Wt=sibling(Ge,2);{var lr=hn=>{var nn=root_11$2(),In=child(nn);{var Fn=Ne=>{var Le=root_12$2(),et=sibling(child(Le),2),pt=child(et,!0);reset(et),reset(Le),template_effect(Rt=>{set_attribute(Le,"href",get(te).page_url),set_text(pt,Rt)},[()=>get(te).page_url.replace(/^https?:\/\//,"").split("?")[0]]),append(Ne,Le)};if_block(In,Ne=>{get(te).page_url&&Ne(Fn)})}var gn=sibling(In,2);{var cr=Ne=>{var Le=root_13$2(),et=child(Le);reset(Le),template_effect(()=>set_text(et,`Revision ${get(te).revision_count??""}`)),append(Ne,Le)};if_block(gn,Ne=>{get(te).revision_count>0&&get(te).status!=="accepted"&&Ne(cr)})}var Kn=sibling(gn,2);{var Pn=Ne=>{var Le=root_14$3(),et=first_child(Le),pt=child(et);let Rt;var it=sibling(pt,2),rt=child(it);reset(it),reset(et);var qe=sibling(et,2);{var ht=Ye=>{var Et=root_15$3();each(Et,21,()=>get(te).thread,Qt=>Qt.id,(Qt,Xe)=>{var sn=root_16$3();let an;var _n=child(sn),Vt=child(_n),Rn=child(Vt,!0);reset(Vt);var Dt=sibling(Vt,2);let An;var Un=child(Dt,!0);reset(Dt);var Z=sibling(Dt,2),re=child(Z,!0);reset(Z),reset(_n);var _e=sibling(_n,2),ye=child(_e);html(ye,()=>oe(get(Xe).message)),reset(_e);var De=sibling(_e,2);{var Ue=st=>{var mt=root_17$3();each(mt,21,()=>get(Xe).summary,index,(je,Pe)=>{var tt=root_18$2(),bt=child(tt,!0);reset(tt),template_effect(()=>set_text(bt,get(Pe))),append(je,tt)}),reset(mt),append(st,mt)};if_block(De,st=>{get(Xe).summary&&get(Xe).summary.length>0&&st(Ue)})}var ut=sibling(De,2);{var gt=st=>{var mt=root_19$2(),je=first_child(mt);each(je,21,()=>get(Xe).screenshots,index,(bt,kt,At)=>{var Nn=comment(),jn=first_child(Nn);{var en=Ct=>{var Lt=root_21$2();set_attribute(Lt,"aria-label",`Screenshot ${At+1}`);var $n=child(Lt);set_attribute($n,"alt",`Screenshot ${At+1}`),reset(Lt),template_effect(()=>set_attribute($n,"src",`${h()??""}${get(kt).url??""}`)),delegated("click",Lt,()=>set(y,get(y)===get(kt).url?null:get(kt).url,!0)),append(Ct,Lt)};if_block(jn,Ct=>{get(kt).url&&Ct(en)})}append(bt,Nn)}),reset(je);var Pe=sibling(je,2);{var tt=bt=>{const kt=user_derived(()=>get(Xe).screenshots.find(en=>en.url===get(y)));var At=comment(),Nn=first_child(At);{var jn=en=>{var Ct=root_23$2(),Lt=child(Ct),$n=sibling(Lt,2);reset(Ct),template_effect(()=>set_attribute(Lt,"src",`${h()??""}${get(y)??""}`)),delegated("click",$n,()=>set(y,null)),append(en,Ct)};if_block(Nn,en=>{get(kt)&&en(jn)})}append(bt,At)};if_block(Pe,bt=>{get(y)&&bt(tt)})}append(st,mt)};if_block(ut,st=>{get(Xe).screenshots&&get(Xe).screenshots.length>0&&st(gt)})}var _t=sibling(ut,2);{var Gt=st=>{var mt=root_24$1();each(mt,21,()=>get(Xe).elements,index,(je,Pe)=>{var tt=root_25$1(),bt=child(tt);reset(tt),template_effect((kt,At)=>{set_attribute(tt,"title",get(Pe).selector),set_text(bt,`<${kt??""}${get(Pe).id?`#${get(Pe).id}`:""}${At??""}>`)},[()=>get(Pe).tagName.toLowerCase(),()=>get(Pe).className?`.${get(Pe).className.split(" ")[0]}`:""]),append(je,tt)}),reset(mt),append(st,mt)};if_block(_t,st=>{get(Xe).elements&&get(Xe).elements.length>0&&st(Gt)})}reset(sn),template_effect((st,mt)=>{an=set_class(sn,1,"thread-entry svelte-1fnmin5",null,an,{"thread-user":get(Xe).from==="user","thread-dev":get(Xe).from==="dev"}),set_text(Rn,get(Xe).from==="user"?"You":"Dev"),An=set_class(Dt,1,"thread-type-badge svelte-1fnmin5",null,An,{submission:get(Xe).type==="submission",completion:get(Xe).type==="completion",rejection:get(Xe).type==="rejection",acceptance:get(Xe).type==="acceptance"}),set_text(Un,st),set_text(re,mt)},[()=>L(get(Xe)),()=>ie(get(Xe).at)]),append(Qt,sn)}),reset(Et),append(Ye,Et)};if_block(qe,Ye=>{get(w)===get(te).id&&Ye(ht)})}template_effect((Ye,Et)=>{Rt=set_class(pt,0,"thread-toggle-icon svelte-1fnmin5",null,Rt,{expanded:get(w)===get(te).id}),set_text(rt,`${Ye??""} ${Et??""}`)},[()=>z(get(te).thread),()=>z(get(te).thread)===1?"message":"messages"]),delegated("click",et,()=>T(get(te).id)),append(Ne,Le)},dr=Ne=>{var Le=root_26(),et=child(Le,!0);reset(Le),template_effect(pt=>set_text(et,pt),[()=>get(te).description.length>120?get(te).description.slice(0,120)+"...":get(te).description]),append(Ne,Le)};if_block(Kn,Ne=>{get(te).thread&&get(te).thread.length>0?Ne(Pn):get(te).description&&Ne(dr,1)})}var Xn=sibling(Kn,2);{var Zn=Ne=>{var Le=root_27$1(),et=first_child(Le);each(et,21,()=>get(te).screenshot_urls,index,(rt,qe,ht)=>{var Ye=root_28$1();set_attribute(Ye,"aria-label",`Screenshot ${ht+1}`);var Et=child(Ye);set_attribute(Et,"alt",`Screenshot ${ht+1}`),reset(Ye),template_effect(()=>set_attribute(Et,"src",`${h()??""}${get(qe)??""}`)),delegated("click",Ye,()=>set(y,get(y)===get(qe)?null:get(qe),!0)),append(rt,Ye)}),reset(et);var pt=sibling(et,2);{var Rt=rt=>{var qe=root_29$1(),ht=child(qe),Ye=sibling(ht,2);reset(qe),template_effect(()=>set_attribute(ht,"src",`${h()??""}${get(y)??""}`)),delegated("click",Ye,()=>set(y,null)),append(rt,qe)},it=user_derived(()=>get(y)&&get(te).screenshot_urls.includes(get(y)));if_block(pt,rt=>{get(it)&&rt(Rt)})}append(Ne,Le)};if_block(Xn,Ne=>{!get(te).thread&&get(te).screenshot_urls&&get(te).screenshot_urls.length>0&&Ne(Zn)})}var Jn=sibling(Xn,2);{var Qn=Ne=>{const Le=user_derived(()=>{var it,rt;return get(te).recording_url??((rt=(it=get(te).thread)==null?void 0:it.find(qe=>qe.recordingUrl))==null?void 0:rt.recordingUrl)??null});var et=comment(),pt=first_child(et);{var Rt=it=>{var rt=root_31$1(),qe=first_child(rt),ht=sibling(child(qe),2);reset(qe);var Ye=sibling(qe,2);{let Et=user_derived(()=>get(te).console_logs??null),Qt=user_derived(()=>get(te).network_requests??null);TimelineViewer(Ye,{get recordingUrl(){return get(Le)},get endpoint(){return h()},get consoleLogs(){return get(Et)},get networkRequests(){return get(Qt)}})}template_effect(()=>set_attribute(ht,"href",`${h()??""}/feedback/replay.html?id=${get(te).id??""}`)),append(it,rt)};if_block(pt,it=>{get(Le)&&it(Rt)})}append(Ne,et)},rn=user_derived(()=>get(te).recording_url||get(te).thread&&get(te).thread.some(Ne=>Ne.recordingUrl));if_block(Jn,Ne=>{get(rn)&&Ne(Qn)})}var Tn=sibling(Jn,2);{var er=Ne=>{var Le=root_32$1(),et=sibling(child(Le),2),pt=child(et);html(pt,()=>oe(get(te).dev_notes)),reset(et),reset(Le),append(Ne,Le)};if_block(Tn,Ne=>{get(te).dev_notes&&!get(te).thread&&get(te).status!=="in_progress"&&Ne(er)})}var tr=sibling(Tn,2),mn=child(tr),Bn=child(mn,!0);reset(mn);var nr=sibling(mn,2);{var vn=Ne=>{var Le=root_33$1();Le.textContent="✓ Accepted",append(Ne,Le)},rr=Ne=>{var Le=root_34$1();Le.textContent="✗ Rejected",append(Ne,Le)},ur=Ne=>{var Le=comment(),et=first_child(Le);{var pt=it=>{var rt=root_36$1(),qe=child(rt);remove_textarea_child(qe);var ht=sibling(qe,2),Ye=child(ht),Et=sibling(child(Ye));reset(Ye);var Qt=sibling(Ye,2);reset(ht);var Xe=sibling(ht,2);{var sn=_e=>{var ye=root_37$1();each(ye,21,()=>get(R),index,(De,Ue,ut)=>{var gt=root_38(),_t=child(gt);set_attribute(_t,"alt",`Screenshot ${ut+1}`);var Gt=sibling(_t,2);reset(gt),template_effect(()=>set_attribute(_t,"src",get(Ue))),delegated("click",Gt,()=>Re(ut)),append(De,gt)}),reset(ye),append(_e,ye)};if_block(Xe,_e=>{get(R).length>0&&_e(sn)})}var an=sibling(Xe,2);{var _n=_e=>{var ye=root_39();each(ye,21,()=>get(M),index,(De,Ue,ut)=>{var gt=root_40(),_t=child(gt),Gt=sibling(_t);reset(gt),template_effect(st=>set_text(_t,`<${st??""}${get(Ue).id?`#${get(Ue).id}`:""}> `),[()=>get(Ue).tagName.toLowerCase()]),delegated("click",Gt,()=>me(ut)),append(De,gt)}),reset(ye),append(_e,ye)};if_block(an,_e=>{get(M).length>0&&_e(_n)})}var Vt=sibling(an,2),Rn=child(Vt),Dt=sibling(Rn,2),An=child(Dt,!0);reset(Dt),reset(Vt);var Un=sibling(Vt,2);{var Z=_e=>{var ye=root_41(),De=child(ye);reset(ye),template_effect(Ue=>set_text(De,`${Ue??""} more characters needed`),[()=>10-get(I).trim().length]),append(_e,ye)},re=user_derived(()=>get(I).trim().length>0&&get(I).trim().length<10);if_block(Un,_e=>{get(re)&&_e(Z)})}reset(rt),template_effect(_e=>{Ye.disabled=get(A),set_text(Et,` ${get(A)?"...":"Screenshot"}`),Dt.disabled=_e,set_text(An,get(S)===get(te).id?"...":"✗ Reject")},[()=>get(I).trim().length<10||get(S)===get(te).id]),bind_value(qe,()=>get(I),_e=>set(I,_e)),delegated("click",Ye,ve),delegated("click",Qt,ke),delegated("click",Rn,xe),delegated("click",Dt,()=>Ce(get(te).id,"rejected",get(I).trim())),append(it,rt)},Rt=it=>{var rt=root_42(),qe=child(rt),ht=child(qe,!0);reset(qe);var Ye=sibling(qe,2);Ye.textContent="✗ Reject",reset(rt),template_effect(()=>{qe.disabled=get(S)===get(te).id,set_text(ht,get(S)===get(te).id?"...":"✓ Accept"),Ye.disabled=get(S)===get(te).id}),delegated("click",qe,()=>Ce(get(te).id,"accepted")),delegated("click",Ye,()=>se(get(te).id)),append(it,rt)};if_block(et,it=>{get(k)===get(te).id?it(pt):it(Rt,!1)})}append(Ne,Le)};if_block(nr,Ne=>{get(te).status==="accepted"?Ne(vn):get(te).status==="rejected"?Ne(rr,1):(get(te).status==="completed"||get(te).status==="wontfix")&&Ne(ur,2)})}reset(tr),reset(nn),template_effect(Ne=>set_text(Bn,Ne),[()=>ie(get(te).created_at)]),transition(3,nn,()=>slide,()=>({duration:200})),append(hn,nn)};if_block(Wt,hn=>{get(x)===get(te).id&&hn(lr)})}reset(Qe),template_effect((hn,nn,In,Fn,gn)=>{wt=set_class(Qe,1,"report-card svelte-1fnmin5",null,wt,{awaiting:get(te).status==="completed",expanded:get(x)===get(te).id}),set_attribute(Qe,"data-card-id",get(te).id),set_text(yt,hn),set_text(Cn,get(te).title),set_style(Be,`background: ${nn??""}20; color: ${In??""}; border-color: ${Fn??""}40;`),set_text(He,gn),dt=set_class(xt,0,"chevron svelte-1fnmin5",null,dt,{"chevron-open":get(x)===get(te).id})},[()=>W(get(te)),()=>G(get(te).status),()=>G(get(te).status),()=>G(get(te).status),()=>P(get(te).status)]),delegated("click",Ge,()=>ce(get(te).id)),append(Oe,Qe)}),reset(Fe),append(Te,Fe)};if_block(X,Te=>{m()?Te(fe):_()&&g().length===0?Te(Q,1):g().length===0?Te(de,2):get(O).length===0?Te(we,3):Te(Ze,!1)})}reset(H),transition(3,H,()=>slide,()=>({duration:200})),append(D,H)}),reset(ae),bind_this(ae,D=>set(E,D),()=>get(E)),reset(ne),template_effect(()=>{K=set_class(B,1,"subtab svelte-1fnmin5",null,K,{active:get(C)==="active"}),Me=set_class(Ee,1,"subtab svelte-1fnmin5",null,Me,{active:get(C)==="done"})}),delegated("click",B,()=>set(C,"active")),delegated("click",Ee,()=>set(C,"done")),append(d,ne),pop(J)}delegate(["click"]),create_custom_element(RequestList,{endpoint:{},reports:{},loading:{},error:{},onreload:{}},[],[],{mode:"open"});var root_6$2=from_html('<span class="step-counter svelte-bez0nz"> </span>'),root_7$2=from_html('<div class="empty-state svelte-bez0nz"><div class="empty-icon svelte-bez0nz"><svg width="32" height="32" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor" opacity="0.3" class="svelte-bez0nz"></path><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" class="svelte-bez0nz"></path></svg></div> <p class="empty-text svelte-bez0nz">Tell the agent what to do on this page</p> <p class="empty-hint svelte-bez0nz">e.g. "Fill in the contact form" or "Click the sign up button"</p></div>'),root_14$2=from_html('<span class="msg-tool svelte-bez0nz"> </span>'),root_15$2=from_html('<div class="approval-buttons svelte-bez0nz"><button class="approve-btn svelte-bez0nz"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M20 6L9 17l-5-5" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-bez0nz"></path></svg> Approve</button> <button class="skip-btn svelte-bez0nz"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M5 5l14 14M19 5L5 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="svelte-bez0nz"></path></svg> Skip</button></div>'),root_16$2=from_html("<span> </span>"),root_17$2=from_html('<span class="msg-step svelte-bez0nz"> </span>'),root_10$1=from_html('<div><span class="msg-icon svelte-bez0nz"><!></span> <div class="msg-body svelte-bez0nz"><!> <span class="msg-text svelte-bez0nz"> </span> <!></div> <!></div>'),root_19$1=from_html('<span class="msg-tool svelte-bez0nz"> </span>'),root_20$1=from_html('<span class="msg-duration svelte-bez0nz"> </span>'),root_21$1=from_html('<span class="msg-step svelte-bez0nz"> </span>'),root_18$1=from_html('<div><span class="msg-icon svelte-bez0nz"> </span> <div class="msg-body svelte-bez0nz"><!> <span class="msg-text svelte-bez0nz"> </span> <!></div> <!></div>'),root_22$1=from_html('<div class="message msg-thinking live svelte-bez0nz"><span class="msg-icon svelte-bez0nz">…</span> <div class="msg-body svelte-bez0nz"><span class="thinking-dots svelte-bez0nz"><span class="dot svelte-bez0nz"></span> <span class="dot svelte-bez0nz"></span> <span class="dot svelte-bez0nz"></span></span></div></div>'),root_8$2=from_html("<!> <!>",1),root_23$1=from_html('<button class="stop-btn svelte-bez0nz" aria-label="Stop agent"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" class="svelte-bez0nz"><rect x="6" y="6" width="12" height="12" rx="1" class="svelte-bez0nz"></rect></svg> Stop</button>'),root$3=from_html('<div class="agent-panel svelte-bez0nz"><div class="status-bar svelte-bez0nz"><div><span class="status-dot svelte-bez0nz"></span> <span class="status-text svelte-bez0nz"><!></span></div> <div class="status-right svelte-bez0nz"><!> <label class="auto-approve-toggle svelte-bez0nz" title="Auto-approve all actions"><input type="checkbox" class="svelte-bez0nz"/> <span class="toggle-label svelte-bez0nz">Auto</span></label></div></div> <div class="messages svelte-bez0nz"><!></div> <div class="input-area svelte-bez0nz"><!> <div class="input-row svelte-bez0nz"><input type="text" class="chat-input svelte-bez0nz"/> <button class="send-btn svelte-bez0nz" aria-label="Send"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" class="svelte-bez0nz"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-bez0nz"></path></svg></button></div></div></div>');const $$css$3={hash:"svelte-bez0nz",code:`.agent-panel.svelte-bez0nz {display:flex;flex-direction:column;height:100%;min-height:0;font-family:inherit;color:#e5e7eb;}
|
|
121
121
|
|
|
122
122
|
/* Status bar */.status-bar.svelte-bez0nz {display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid #1f2937;flex-shrink:0;}.status-indicator.svelte-bez0nz {display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;}.status-dot.svelte-bez0nz {width:7px;height:7px;border-radius:50%;flex-shrink:0;}.status-indicator.idle.svelte-bez0nz .status-dot:where(.svelte-bez0nz) {background:#6b7280;}.status-indicator.idle.svelte-bez0nz .status-text:where(.svelte-bez0nz) {color:#9ca3af;}.status-indicator.thinking.svelte-bez0nz .status-dot:where(.svelte-bez0nz) {background:#f59e0b;
|
|
123
123
|
animation: svelte-bez0nz-pulse-dot 1.2s ease-in-out infinite;}.status-indicator.thinking.svelte-bez0nz .status-text:where(.svelte-bez0nz) {color:#fcd34d;}.status-indicator.acting.svelte-bez0nz .status-dot:where(.svelte-bez0nz) {background:#3b82f6;
|
|
@@ -165,7 +165,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
165
165
|
40% { transform: scale(1); opacity: 1; }
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
/* Input area */.input-area.svelte-bez0nz {flex-shrink:0;padding:8px 12px 12px;border-top:1px solid #1f2937;display:flex;flex-direction:column;gap:6px;}.input-row.svelte-bez0nz {display:flex;gap:6px;}.chat-input.svelte-bez0nz {flex:1;padding:8px 10px;border:1px solid #374151;border-radius:6px;font-size:13px;font-family:inherit;color:#e5e7eb;background:#1f2937;transition:border-color 0.15s;}.chat-input.svelte-bez0nz:focus {outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59, 130, 246, 0.2);}.chat-input.svelte-bez0nz:disabled {opacity:0.5;cursor:not-allowed;}.chat-input.svelte-bez0nz::placeholder {color:#6b7280;}.send-btn.svelte-bez0nz {display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:6px;background:#3b82f6;color:white;cursor:pointer;flex-shrink:0;transition:background 0.15s;}.send-btn.svelte-bez0nz:hover:not(:disabled) {background:#2563eb;}.send-btn.svelte-bez0nz:disabled {opacity:0.3;cursor:not-allowed;}.stop-btn.svelte-bez0nz {display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px solid #ef4444;border-radius:6px;background:rgba(239, 68, 68, 0.1);color:#f87171;font-size:12px;font-family:inherit;cursor:pointer;transition:background 0.15s;}.stop-btn.svelte-bez0nz:hover {background:rgba(239, 68, 68, 0.2);}`};function AgentPanel(d,p){push(p,!0),append_styles(d,$$css$3);let h=prop(p,"messages",23,()=>[]),g=prop(p,"agentState",7,"idle"),m=prop(p,"currentStep",7,0),_=prop(p,"maxSteps",7,40),b=prop(p,"autoApprove",7,!1),y=prop(p,"onsend",7),w=prop(p,"onstop",7),x=prop(p,"onapprove",7),E=prop(p,"onskip",7),S=prop(p,"onautoapprovechange",7),k=state(""),I=state(void 0);user_effect(()=>{h().length&&get(I)&&requestAnimationFrame(()=>{get(I).scrollTop=get(I).scrollHeight})});function R(){var K;const B=get(k).trim();!B||g()==="thinking"||g()==="acting"||(set(k,""),(K=y())==null||K(B))}function M(B){var K;B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),R()),B.key==="Escape"&&(g()==="thinking"||g()==="acting")&&((K=w())==null||K())}function A(){var B;(B=w())==null||B()}const C=user_derived(()=>g()==="thinking"||g()==="acting"||g()==="awaiting_approval");function N(B){switch(B){case"user":return"›";case"thinking":return"…";case"action":return"⚡";case"result":return"✓";case"error":return"✕";case"info":return"●";case"approval":return"?"}}function $(B){return B<1e3?`${B}ms`:`${(B/1e3).toFixed(1)}s`}var O={get messages(){return h()},set messages(B=[]){h(B),flushSync()},get agentState(){return g()},set agentState(B="idle"){g(B),flushSync()},get currentStep(){return m()},set currentStep(B=0){m(B),flushSync()},get maxSteps(){return _()},set maxSteps(B=40){_(B),flushSync()},get autoApprove(){return b()},set autoApprove(B=!1){b(B),flushSync()},get onsend(){return y()},set onsend(B){y(B),flushSync()},get onstop(){return w()},set onstop(B){w(B),flushSync()},get onapprove(){return x()},set onapprove(B){x(B),flushSync()},get onskip(){return E()},set onskip(B){E(B),flushSync()},get onautoapprovechange(){return S()},set onautoapprovechange(B){S(B),flushSync()}},F=root$3(),j=child(F),Y=child(j);let q;var ue=sibling(child(Y),2),oe=child(ue);{var ce=B=>{var K=text("Ready");append(B,K)},se=B=>{var K=text("Thinking...");append(B,K)},xe=B=>{var K=text("Acting...");append(B,K)},ve=B=>{var K=text("Awaiting approval");append(B,K)},Re=B=>{var K=text("Error");append(B,K)};if_block(oe,B=>{g()==="idle"?B(ce):g()==="thinking"?B(se,1):g()==="acting"?B(xe,2):g()==="awaiting_approval"?B(ve,3):B(Re,!1)})}reset(ue),reset(Y);var ke=sibling(Y,2),me=child(ke);{var Ce=B=>{var K=root_6$2(),pe=child(K);reset(K),template_effect(()=>set_text(pe,`Step ${m()??""}/${_()??""}`)),append(B,K)};if_block(me,B=>{m()>0&&B(Ce)})}var T=sibling(me,2),z=child(T);remove_input_defaults(z),next(2),reset(T),reset(ke),reset(j);var L=sibling(j,2),P=child(L);{var G=B=>{var K=root_7$2();append(B,K)},W=B=>{var K=root_8$2(),pe=first_child(K);each(pe,17,h,Me=>Me.id,(Me,Se)=>{var We=comment(),ae=first_child(We);{var V=H=>{var X=root_10$1();let fe;var Q=child(X),de=child(Q);{var we=Be=>{var He=text("✓");append(Be,He)},Ze=Be=>{var He=text("⏭");append(Be,He)},Te=Be=>{var He=text("?");append(Be,He)};if_block(de,Be=>{get(Se).approvalStatus==="approved"?Be(we):get(Se).approvalStatus==="skipped"?Be(Ze,1):Be(Te,!1)})}reset(Q);var Le=sibling(Q,2),Oe=child(Le);{var te=Be=>{var He=root_14$2(),xt=child(He,!0);reset(He),template_effect(()=>set_text(xt,get(Se).tool)),append(Be,He)};if_block(Oe,Be=>{get(Se).tool&&Be(te)})}var Qe=sibling(Oe,2),wt=child(Qe,!0);reset(Qe);var Ge=sibling(Qe,2);{var Ve=Be=>{var He=root_15$2(),xt=child(He),dt=sibling(xt,2);reset(He),delegated("click",xt,()=>{var Wt;return(Wt=x())==null?void 0:Wt(get(Se).id)}),delegated("click",dt,()=>{var Wt;return(Wt=E())==null?void 0:Wt(get(Se).id)}),append(Be,He)},yt=Be=>{var He=root_16$2();let xt;var dt=child(He,!0);reset(He),template_effect(()=>{xt=set_class(He,1,"approval-badge svelte-bez0nz",null,xt,{"badge-approved":get(Se).approvalStatus==="approved","badge-skipped":get(Se).approvalStatus==="skipped"}),set_text(dt,get(Se).approvalStatus)}),append(Be,He)};if_block(Ge,Be=>{get(Se).approvalStatus==="pending"?Be(Ve):Be(yt,!1)})}reset(Le);var Ot=sibling(Le,2);{var Cn=Be=>{var He=root_17$2(),xt=child(He,!0);reset(He),template_effect(()=>set_text(xt,get(Se).step)),append(Be,He)};if_block(Ot,Be=>{get(Se).step&&Be(Cn)})}reset(X),template_effect(()=>{fe=set_class(X,1,"message msg-approval svelte-bez0nz",null,fe,{pending:get(Se).approvalStatus==="pending",approved:get(Se).approvalStatus==="approved",skipped:get(Se).approvalStatus==="skipped"}),set_text(wt,get(Se).text)}),append(H,X)},D=H=>{var X=root_18$1(),fe=child(X),Q=child(fe,!0);reset(fe);var de=sibling(fe,2),we=child(de);{var Ze=Ge=>{var Ve=root_19$1(),yt=child(Ve,!0);reset(Ve),template_effect(()=>set_text(yt,get(Se).tool)),append(Ge,Ve)};if_block(we,Ge=>{get(Se).role==="action"&&get(Se).tool&&Ge(Ze)})}var Te=sibling(we,2),Le=child(Te,!0);reset(Te);var Oe=sibling(Te,2);{var te=Ge=>{var Ve=root_20$1(),yt=child(Ve,!0);reset(Ve),template_effect(Ot=>set_text(yt,Ot),[()=>$(get(Se).duration)]),append(Ge,Ve)};if_block(Oe,Ge=>{get(Se).duration!=null&&Ge(te)})}reset(de);var Qe=sibling(de,2);{var wt=Ge=>{var Ve=root_21$1(),yt=child(Ve,!0);reset(Ve),template_effect(()=>set_text(yt,get(Se).step)),append(Ge,Ve)};if_block(Qe,Ge=>{get(Se).step&&Ge(wt)})}reset(X),template_effect(Ge=>{set_class(X,1,`message msg-${get(Se).role??""}`,"svelte-bez0nz"),set_text(Q,Ge),set_text(Le,get(Se).text)},[()=>N(get(Se).role)]),append(H,X)};if_block(ae,H=>{get(Se).role==="approval"?H(V):H(D,!1)})}append(Me,We)});var le=sibling(pe,2);{var Ee=Me=>{var Se=root_22$1();append(Me,Se)};if_block(le,Me=>{g()==="thinking"&&Me(Ee)})}append(B,K)};if_block(P,B=>{h().length===0?B(G):B(W,!1)})}reset(L),bind_this(L,B=>set(I,B),()=>get(I));var ie=sibling(L,2),J=child(ie);{var ne=B=>{var K=root_23$1();delegated("click",K,A),append(B,K)};if_block(J,B=>{get(C)&&B(ne)})}var ge=sibling(J,2),ee=child(ge);remove_input_defaults(ee);var he=sibling(ee,2);return reset(ge),reset(ie),reset(F),template_effect(B=>{q=set_class(Y,1,"status-indicator svelte-bez0nz",null,q,{idle:g()==="idle",thinking:g()==="thinking",acting:g()==="acting",awaiting:g()==="awaiting_approval",error:g()==="error"}),set_checked(z,b()),set_attribute(ee,"placeholder",get(C)?"Agent is working...":"Type a command..."),ee.disabled=get(C),he.disabled=B},[()=>get(C)||!get(k).trim()]),delegated("change",z,B=>{var K;return(K=S())==null?void 0:K(B.target.checked)}),delegated("keydown",ee,M),bind_value(ee,()=>get(k),B=>set(k,B)),delegated("click",he,R),append(d,F),pop(O)}delegate(["change","click","keydown"]),create_custom_element(AgentPanel,{messages:{},agentState:{},currentStep:{},maxSteps:{},autoApprove:{},onsend:{},onstop:{},onapprove:{},onskip:{},onautoapprovechange:{}},[],[],{mode:"open"});var root_2$2=from_html('<div class="loading svelte-zp32f3"><span class="spinner svelte-zp32f3"></span> Loading notes...</div>'),root_3$1=from_html('<div class="error-msg svelte-zp32f3"> <button class="retry-btn svelte-zp32f3">Retry</button></div>'),root_5$1=from_html('<button class="note-row site-note svelte-zp32f3"><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.8"></circle><path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10A15.3 15.3 0 0112 2" stroke="currentColor" stroke-width="1.8"></path></svg> <div class="note-info svelte-zp32f3"><span class="note-name svelte-zp32f3"> </span> <span class="note-preview svelte-zp32f3"> </span></div></div> <span class="note-edit-hint svelte-zp32f3">edit</span></button>'),root_6$1=from_html('<button class="note-row site-note empty svelte-zp32f3"><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.8"></circle><path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10A15.3 15.3 0 0112 2" stroke="currentColor" stroke-width="1.8"></path></svg> <span class="note-name add-prompt svelte-zp32f3">Add site-wide notes</span></div> <svg width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"></path></svg></button>'),root_7$1=from_html('<div class="section-divider svelte-zp32f3"><span>Routes</span></div>'),root_9$1=from_html('<span class="current-badge svelte-zp32f3">current</span>'),root_8$1=from_html('<button><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z" stroke="currentColor" stroke-width="1.8"></path><path d="M13 2v7h7" stroke="currentColor" stroke-width="1.8"></path></svg> <div class="note-info svelte-zp32f3"><span class="note-name svelte-zp32f3"> <!></span> <span class="note-preview svelte-zp32f3"> </span></div></div> <span class="note-edit-hint svelte-zp32f3">edit</span></button>'),root_10=from_html('<button class="note-row add-route svelte-zp32f3"><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg> <span class="note-name add-prompt svelte-zp32f3"> </span></div></button>'),root_11$1=from_html('<div class="empty-state svelte-zp32f3"><svg width="28" height="28" viewBox="0 0 24 24" fill="none"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" stroke="currentColor" stroke-width="1.5"></path><path d="M14 2v6h6M16 13H8M16 17H8M10 9H8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg> <p class="svelte-zp32f3">No notes yet</p> <p class="empty-hint svelte-zp32f3">Notes give context to the page agent about your app</p></div>'),root_4$1=from_html("<!> <!> <!> <!> <!>",1),root_1$2=from_html('<div class="notes-list svelte-zp32f3"><div class="list-header svelte-zp32f3"><span class="list-title svelte-zp32f3">Notes</span> <button class="new-btn svelte-zp32f3" title="New site-wide note"><svg width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"></path></svg> New</button></div> <!></div>'),root_13$1=from_html('<div class="preview-area svelte-zp32f3"><!></div>'),root_14$1=from_html('<div class="field svelte-zp32f3"><label for="note-content" class="svelte-zp32f3">Content <span class="label-hint svelte-zp32f3">(markdown)</span></label> <textarea id="note-content" placeholder="Describe this page/app for the agent... Supports **bold**, *italic*, # headers, - lists, `code`" rows="12" class="svelte-zp32f3"></textarea></div>'),root_15$1=from_html('<div class="error-msg compact svelte-zp32f3"> </div>'),root_16$1=from_html("<button> </button>"),root_17$1=from_html('<span class="spinner svelte-zp32f3"></span>'),root_12$1=from_html('<div class="note-editor svelte-zp32f3"><div class="editor-header svelte-zp32f3"><button class="back-btn svelte-zp32f3" title="Back to list"><svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M19 12H5M12 19l-7-7 7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <span class="editor-route svelte-zp32f3"> </span> <button> </button></div> <div class="editor-body svelte-zp32f3"><div class="field svelte-zp32f3"><label for="note-title" class="svelte-zp32f3">Title</label> <input id="note-title" type="text" placeholder="Note title" class="svelte-zp32f3"/></div> <!> <!></div> <div class="editor-actions svelte-zp32f3"><!> <div class="action-spacer svelte-zp32f3"></div> <button class="cancel-btn svelte-zp32f3">Cancel</button> <button class="save-btn svelte-zp32f3"><!> </button></div></div>'),root$2=from_html('<div class="notes-panel svelte-zp32f3"><!></div>');const $$css$2={hash:"svelte-zp32f3",code:`.notes-panel.svelte-zp32f3 {display:flex;flex-direction:column;height:100%;overflow:hidden;}
|
|
168
|
+
/* Input area */.input-area.svelte-bez0nz {flex-shrink:0;padding:8px 12px 12px;border-top:1px solid #1f2937;display:flex;flex-direction:column;gap:6px;}.input-row.svelte-bez0nz {display:flex;gap:6px;}.chat-input.svelte-bez0nz {flex:1;padding:8px 10px;border:1px solid #374151;border-radius:6px;font-size:13px;font-family:inherit;color:#e5e7eb;background:#1f2937;transition:border-color 0.15s;}.chat-input.svelte-bez0nz:focus {outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59, 130, 246, 0.2);}.chat-input.svelte-bez0nz:disabled {opacity:0.5;cursor:not-allowed;}.chat-input.svelte-bez0nz::placeholder {color:#6b7280;}.send-btn.svelte-bez0nz {display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:6px;background:#3b82f6;color:white;cursor:pointer;flex-shrink:0;transition:background 0.15s;}.send-btn.svelte-bez0nz:hover:not(:disabled) {background:#2563eb;}.send-btn.svelte-bez0nz:disabled {opacity:0.3;cursor:not-allowed;}.stop-btn.svelte-bez0nz {display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px solid #ef4444;border-radius:6px;background:rgba(239, 68, 68, 0.1);color:#f87171;font-size:12px;font-family:inherit;cursor:pointer;transition:background 0.15s;}.stop-btn.svelte-bez0nz:hover {background:rgba(239, 68, 68, 0.2);}`};function AgentPanel(d,p){push(p,!0),append_styles(d,$$css$3);let h=prop(p,"messages",23,()=>[]),g=prop(p,"agentState",7,"idle"),m=prop(p,"currentStep",7,0),_=prop(p,"maxSteps",7,40),b=prop(p,"autoApprove",7,!1),y=prop(p,"onsend",7),w=prop(p,"onstop",7),x=prop(p,"onapprove",7),E=prop(p,"onskip",7),S=prop(p,"onautoapprovechange",7),k=state(""),I=state(void 0);user_effect(()=>{h().length&&get(I)&&requestAnimationFrame(()=>{get(I).scrollTop=get(I).scrollHeight})});function R(){var K;const B=get(k).trim();!B||g()==="thinking"||g()==="acting"||(set(k,""),(K=y())==null||K(B))}function M(B){var K;B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),R()),B.key==="Escape"&&(g()==="thinking"||g()==="acting")&&((K=w())==null||K())}function A(){var B;(B=w())==null||B()}const C=user_derived(()=>g()==="thinking"||g()==="acting"||g()==="awaiting_approval");function N(B){switch(B){case"user":return"›";case"thinking":return"…";case"action":return"⚡";case"result":return"✓";case"error":return"✕";case"info":return"●";case"approval":return"?"}}function $(B){return B<1e3?`${B}ms`:`${(B/1e3).toFixed(1)}s`}var O={get messages(){return h()},set messages(B=[]){h(B),flushSync()},get agentState(){return g()},set agentState(B="idle"){g(B),flushSync()},get currentStep(){return m()},set currentStep(B=0){m(B),flushSync()},get maxSteps(){return _()},set maxSteps(B=40){_(B),flushSync()},get autoApprove(){return b()},set autoApprove(B=!1){b(B),flushSync()},get onsend(){return y()},set onsend(B){y(B),flushSync()},get onstop(){return w()},set onstop(B){w(B),flushSync()},get onapprove(){return x()},set onapprove(B){x(B),flushSync()},get onskip(){return E()},set onskip(B){E(B),flushSync()},get onautoapprovechange(){return S()},set onautoapprovechange(B){S(B),flushSync()}},F=root$3(),j=child(F),Y=child(j);let q;var ue=sibling(child(Y),2),oe=child(ue);{var ce=B=>{var K=text("Ready");append(B,K)},se=B=>{var K=text("Thinking...");append(B,K)},xe=B=>{var K=text("Acting...");append(B,K)},ve=B=>{var K=text("Awaiting approval");append(B,K)},Re=B=>{var K=text("Error");append(B,K)};if_block(oe,B=>{g()==="idle"?B(ce):g()==="thinking"?B(se,1):g()==="acting"?B(xe,2):g()==="awaiting_approval"?B(ve,3):B(Re,!1)})}reset(ue),reset(Y);var ke=sibling(Y,2),me=child(ke);{var Ce=B=>{var K=root_6$2(),pe=child(K);reset(K),template_effect(()=>set_text(pe,`Step ${m()??""}/${_()??""}`)),append(B,K)};if_block(me,B=>{m()>0&&B(Ce)})}var T=sibling(me,2),z=child(T);remove_input_defaults(z),next(2),reset(T),reset(ke),reset(j);var L=sibling(j,2),P=child(L);{var G=B=>{var K=root_7$2();append(B,K)},W=B=>{var K=root_8$2(),pe=first_child(K);each(pe,17,h,Me=>Me.id,(Me,Se)=>{var We=comment(),ae=first_child(We);{var V=H=>{var X=root_10$1();let fe;var Q=child(X),de=child(Q);{var we=Be=>{var He=text("✓");append(Be,He)},Ze=Be=>{var He=text("⏭");append(Be,He)},Te=Be=>{var He=text("?");append(Be,He)};if_block(de,Be=>{get(Se).approvalStatus==="approved"?Be(we):get(Se).approvalStatus==="skipped"?Be(Ze,1):Be(Te,!1)})}reset(Q);var Fe=sibling(Q,2),Oe=child(Fe);{var te=Be=>{var He=root_14$2(),xt=child(He,!0);reset(He),template_effect(()=>set_text(xt,get(Se).tool)),append(Be,He)};if_block(Oe,Be=>{get(Se).tool&&Be(te)})}var Qe=sibling(Oe,2),wt=child(Qe,!0);reset(Qe);var Ge=sibling(Qe,2);{var Ve=Be=>{var He=root_15$2(),xt=child(He),dt=sibling(xt,2);reset(He),delegated("click",xt,()=>{var Wt;return(Wt=x())==null?void 0:Wt(get(Se).id)}),delegated("click",dt,()=>{var Wt;return(Wt=E())==null?void 0:Wt(get(Se).id)}),append(Be,He)},yt=Be=>{var He=root_16$2();let xt;var dt=child(He,!0);reset(He),template_effect(()=>{xt=set_class(He,1,"approval-badge svelte-bez0nz",null,xt,{"badge-approved":get(Se).approvalStatus==="approved","badge-skipped":get(Se).approvalStatus==="skipped"}),set_text(dt,get(Se).approvalStatus)}),append(Be,He)};if_block(Ge,Be=>{get(Se).approvalStatus==="pending"?Be(Ve):Be(yt,!1)})}reset(Fe);var Ot=sibling(Fe,2);{var Cn=Be=>{var He=root_17$2(),xt=child(He,!0);reset(He),template_effect(()=>set_text(xt,get(Se).step)),append(Be,He)};if_block(Ot,Be=>{get(Se).step&&Be(Cn)})}reset(X),template_effect(()=>{fe=set_class(X,1,"message msg-approval svelte-bez0nz",null,fe,{pending:get(Se).approvalStatus==="pending",approved:get(Se).approvalStatus==="approved",skipped:get(Se).approvalStatus==="skipped"}),set_text(wt,get(Se).text)}),append(H,X)},D=H=>{var X=root_18$1(),fe=child(X),Q=child(fe,!0);reset(fe);var de=sibling(fe,2),we=child(de);{var Ze=Ge=>{var Ve=root_19$1(),yt=child(Ve,!0);reset(Ve),template_effect(()=>set_text(yt,get(Se).tool)),append(Ge,Ve)};if_block(we,Ge=>{get(Se).role==="action"&&get(Se).tool&&Ge(Ze)})}var Te=sibling(we,2),Fe=child(Te,!0);reset(Te);var Oe=sibling(Te,2);{var te=Ge=>{var Ve=root_20$1(),yt=child(Ve,!0);reset(Ve),template_effect(Ot=>set_text(yt,Ot),[()=>$(get(Se).duration)]),append(Ge,Ve)};if_block(Oe,Ge=>{get(Se).duration!=null&&Ge(te)})}reset(de);var Qe=sibling(de,2);{var wt=Ge=>{var Ve=root_21$1(),yt=child(Ve,!0);reset(Ve),template_effect(()=>set_text(yt,get(Se).step)),append(Ge,Ve)};if_block(Qe,Ge=>{get(Se).step&&Ge(wt)})}reset(X),template_effect(Ge=>{set_class(X,1,`message msg-${get(Se).role??""}`,"svelte-bez0nz"),set_text(Q,Ge),set_text(Fe,get(Se).text)},[()=>N(get(Se).role)]),append(H,X)};if_block(ae,H=>{get(Se).role==="approval"?H(V):H(D,!1)})}append(Me,We)});var le=sibling(pe,2);{var Ee=Me=>{var Se=root_22$1();append(Me,Se)};if_block(le,Me=>{g()==="thinking"&&Me(Ee)})}append(B,K)};if_block(P,B=>{h().length===0?B(G):B(W,!1)})}reset(L),bind_this(L,B=>set(I,B),()=>get(I));var ie=sibling(L,2),J=child(ie);{var ne=B=>{var K=root_23$1();delegated("click",K,A),append(B,K)};if_block(J,B=>{get(C)&&B(ne)})}var ge=sibling(J,2),ee=child(ge);remove_input_defaults(ee);var he=sibling(ee,2);return reset(ge),reset(ie),reset(F),template_effect(B=>{q=set_class(Y,1,"status-indicator svelte-bez0nz",null,q,{idle:g()==="idle",thinking:g()==="thinking",acting:g()==="acting",awaiting:g()==="awaiting_approval",error:g()==="error"}),set_checked(z,b()),set_attribute(ee,"placeholder",get(C)?"Agent is working...":"Type a command..."),ee.disabled=get(C),he.disabled=B},[()=>get(C)||!get(k).trim()]),delegated("change",z,B=>{var K;return(K=S())==null?void 0:K(B.target.checked)}),delegated("keydown",ee,M),bind_value(ee,()=>get(k),B=>set(k,B)),delegated("click",he,R),append(d,F),pop(O)}delegate(["change","click","keydown"]),create_custom_element(AgentPanel,{messages:{},agentState:{},currentStep:{},maxSteps:{},autoApprove:{},onsend:{},onstop:{},onapprove:{},onskip:{},onautoapprovechange:{}},[],[],{mode:"open"});var root_2$2=from_html('<div class="loading svelte-zp32f3"><span class="spinner svelte-zp32f3"></span> Loading notes...</div>'),root_3$1=from_html('<div class="error-msg svelte-zp32f3"> <button class="retry-btn svelte-zp32f3">Retry</button></div>'),root_5$1=from_html('<button class="note-row site-note svelte-zp32f3"><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.8"></circle><path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10A15.3 15.3 0 0112 2" stroke="currentColor" stroke-width="1.8"></path></svg> <div class="note-info svelte-zp32f3"><span class="note-name svelte-zp32f3"> </span> <span class="note-preview svelte-zp32f3"> </span></div></div> <span class="note-edit-hint svelte-zp32f3">edit</span></button>'),root_6$1=from_html('<button class="note-row site-note empty svelte-zp32f3"><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.8"></circle><path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10A15.3 15.3 0 0112 2" stroke="currentColor" stroke-width="1.8"></path></svg> <span class="note-name add-prompt svelte-zp32f3">Add site-wide notes</span></div> <svg width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"></path></svg></button>'),root_7$1=from_html('<div class="section-divider svelte-zp32f3"><span>Routes</span></div>'),root_9$1=from_html('<span class="current-badge svelte-zp32f3">current</span>'),root_8$1=from_html('<button><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z" stroke="currentColor" stroke-width="1.8"></path><path d="M13 2v7h7" stroke="currentColor" stroke-width="1.8"></path></svg> <div class="note-info svelte-zp32f3"><span class="note-name svelte-zp32f3"> <!></span> <span class="note-preview svelte-zp32f3"> </span></div></div> <span class="note-edit-hint svelte-zp32f3">edit</span></button>'),root_10=from_html('<button class="note-row add-route svelte-zp32f3"><div class="note-row-left svelte-zp32f3"><svg class="note-icon svelte-zp32f3" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg> <span class="note-name add-prompt svelte-zp32f3"> </span></div></button>'),root_11$1=from_html('<div class="empty-state svelte-zp32f3"><svg width="28" height="28" viewBox="0 0 24 24" fill="none"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" stroke="currentColor" stroke-width="1.5"></path><path d="M14 2v6h6M16 13H8M16 17H8M10 9H8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg> <p class="svelte-zp32f3">No notes yet</p> <p class="empty-hint svelte-zp32f3">Notes give context to the page agent about your app</p></div>'),root_4$1=from_html("<!> <!> <!> <!> <!>",1),root_1$2=from_html('<div class="notes-list svelte-zp32f3"><div class="list-header svelte-zp32f3"><span class="list-title svelte-zp32f3">Notes</span> <button class="new-btn svelte-zp32f3" title="New site-wide note"><svg width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"></path></svg> New</button></div> <!></div>'),root_13$1=from_html('<div class="preview-area svelte-zp32f3"><!></div>'),root_14$1=from_html('<div class="field svelte-zp32f3"><label for="note-content" class="svelte-zp32f3">Content <span class="label-hint svelte-zp32f3">(markdown)</span></label> <textarea id="note-content" placeholder="Describe this page/app for the agent... Supports **bold**, *italic*, # headers, - lists, `code`" rows="12" class="svelte-zp32f3"></textarea></div>'),root_15$1=from_html('<div class="error-msg compact svelte-zp32f3"> </div>'),root_16$1=from_html("<button> </button>"),root_17$1=from_html('<span class="spinner svelte-zp32f3"></span>'),root_12$1=from_html('<div class="note-editor svelte-zp32f3"><div class="editor-header svelte-zp32f3"><button class="back-btn svelte-zp32f3" title="Back to list"><svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M19 12H5M12 19l-7-7 7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <span class="editor-route svelte-zp32f3"> </span> <button> </button></div> <div class="editor-body svelte-zp32f3"><div class="field svelte-zp32f3"><label for="note-title" class="svelte-zp32f3">Title</label> <input id="note-title" type="text" placeholder="Note title" class="svelte-zp32f3"/></div> <!> <!></div> <div class="editor-actions svelte-zp32f3"><!> <div class="action-spacer svelte-zp32f3"></div> <button class="cancel-btn svelte-zp32f3">Cancel</button> <button class="save-btn svelte-zp32f3"><!> </button></div></div>'),root$2=from_html('<div class="notes-panel svelte-zp32f3"><!></div>');const $$css$2={hash:"svelte-zp32f3",code:`.notes-panel.svelte-zp32f3 {display:flex;flex-direction:column;height:100%;overflow:hidden;}
|
|
169
169
|
|
|
170
170
|
/* List view */.notes-list.svelte-zp32f3 {display:flex;flex-direction:column;overflow-y:auto;padding:0;}.list-header.svelte-zp32f3 {display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid #1f2937;}.list-title.svelte-zp32f3 {font-size:13px;font-weight:600;color:#e5e7eb;}.new-btn.svelte-zp32f3 {display:inline-flex;align-items:center;gap:4px;padding:4px 10px;background:#1f2937;border:1px solid #374151;border-radius:5px;color:#d1d5db;font-size:11px;font-family:inherit;cursor:pointer;transition:background 0.15s;}.new-btn.svelte-zp32f3:hover:not(:disabled) {background:#374151;}.new-btn.svelte-zp32f3:disabled {opacity:0.4;cursor:not-allowed;}
|
|
171
171
|
|
|
@@ -178,7 +178,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
178
178
|
@keyframes svelte-zp32f3-notes-spin {
|
|
179
179
|
to { transform: rotate(360deg); }
|
|
180
180
|
}`};function NotesPanel(d,p){push(p,!0),append_styles(d,$$css$2);let h=prop(p,"endpoint",7),g=prop(p,"project",7),m=prop(p,"onnoteschanged",7),_=state(proxy([])),b=state(!1),y=state(""),w=state(!1),x=state(proxy(window.location.pathname)),E=state("list"),S=state(null),k=state(!1),I=state(""),R=state(""),M=state(null),A=state(!1),C=state(!1),N=user_derived(()=>get(_).find(z=>z.route===null)),$=user_derived(()=>get(_).filter(z=>z.route!==null).sort((z,L)=>(z.route||"").localeCompare(L.route||""))),O=user_derived(()=>get(_).some(z=>z.route===get(x)));async function F(){set(b,!0),set(y,"");const z=await fetchNotes(h(),g());set(_,z.notes,!0),z.error&&set(y,z.error,!0),set(b,!1)}user_effect(()=>{h()&&g()&&F()}),user_effect(()=>{const z=setInterval(()=>{window.location.pathname!==get(x)&&set(x,window.location.pathname,!0)},1e3);return()=>clearInterval(z)});function j(z){set(S,z,!0),set(k,!1),set(I,z.title,!0),set(R,z.content,!0),set(M,z.route,!0),set(A,!1),set(C,!1),set(E,"edit")}function Y(z){set(S,null),set(k,!0),set(I,z?ce(z):"Site-wide notes",!0),set(R,""),set(M,z,!0),set(A,!1),set(C,!1),set(E,"edit")}function q(){set(E,"list"),set(S,null),set(k,!1),set(C,!1)}async function ue(){var z,L;if(get(I).trim()){if(set(w,!0),get(k)){const P=await createNote(h(),{project:g(),route:get(M),title:get(I).trim(),content:get(R)});P.ok&&P.note?(set(_,[...get(_),P.note],!0),(z=m())==null||z(),q()):set(y,P.error||"Failed to create note",!0)}else if(get(S)){const P=await updateNote(h(),get(S).id,{title:get(I).trim(),content:get(R)});P.ok?(set(_,get(_).map(G=>G.id===get(S).id?{...G,title:get(I).trim(),content:get(R),updated_at:new Date().toISOString()}:G),!0),(L=m())==null||L(),q()):set(y,P.error||"Failed to update note",!0)}set(w,!1)}}async function oe(){var L;if(!get(S))return;if(!get(C)){set(C,!0);return}set(w,!0);const z=await deleteNote(h(),get(S).id);z.ok?(set(_,get(_).filter(P=>P.id!==get(S).id),!0),(L=m())==null||L(),q()):set(y,z.error||"Failed to delete note",!0),set(w,!1)}function ce(z){return z||"Site-wide"}function se(z){return z?z.split(`
|
|
181
|
-
`).filter(L=>L.trim()).length:0}function xe(z){if(!z)return'<span style="color:#6b7280;font-style:italic">No content</span>';let L=z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return L=L.replace(/```([^`]*?)```/gs,'<pre style="background:#1f2937;padding:8px;border-radius:4px;font-size:11px;overflow-x:auto;margin:4px 0">$1</pre>'),L=L.replace(/`([^`]+)`/g,'<code style="background:#1f2937;padding:1px 4px;border-radius:3px;font-size:11px">$1</code>'),L=L.replace(/^### (.+)$/gm,'<strong style="display:block;margin-top:8px;font-size:12px;color:#d1d5db">$1</strong>'),L=L.replace(/^## (.+)$/gm,'<strong style="display:block;margin-top:8px;font-size:13px;color:#e5e7eb">$1</strong>'),L=L.replace(/^# (.+)$/gm,'<strong style="display:block;margin-top:8px;font-size:14px;color:#f3f4f6">$1</strong>'),L=L.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),L=L.replace(/\*(.+?)\*/g,"<em>$1</em>"),L=L.replace(/^- (.+)$/gm,'<span style="display:block;padding-left:12px">• $1</span>'),L=L.replace(/^(\d+)\. (.+)$/gm,'<span style="display:block;padding-left:12px">$1. $2</span>'),L=L.replace(/\n(?!<)/g,"<br>"),L}function ve(z){z.key==="Escape"&&get(E)==="edit"&&(z.stopPropagation(),q())}var Re={get endpoint(){return h()},set endpoint(z){h(z),flushSync()},get project(){return g()},set project(z){g(z),flushSync()},get onnoteschanged(){return m()},set onnoteschanged(z){m(z),flushSync()}},ke=root$2(),me=child(ke);{var Ce=z=>{var L=root_1$2(),P=child(L),G=sibling(child(P),2);reset(P);var W=sibling(P,2);{var ie=ge=>{var ee=root_2$2();append(ge,ee)},J=ge=>{var ee=root_3$1(),he=child(ee),B=sibling(he);reset(ee),template_effect(()=>set_text(he,`${get(y)??""} `)),delegated("click",B,F),append(ge,ee)},ne=ge=>{var ee=root_4$1(),he=first_child(ee);{var B=V=>{var D=root_5$1(),H=child(D),X=sibling(child(H),2),fe=child(X),Q=child(fe,!0);reset(fe);var de=sibling(fe,2),we=child(de);reset(de),reset(X),reset(H),next(2),reset(D),template_effect((Ze,Te)=>{set_text(Q,get(N).title||"Site-wide notes"),set_text(we,`${Ze??""} line${Te??""}`)},[()=>se(get(N).content),()=>se(get(N).content)!==1?"s":""]),delegated("click",D,()=>j(get(N))),append(V,D)},K=V=>{var D=root_6$1();delegated("click",D,()=>Y(null)),append(V,D)};if_block(he,V=>{get(N)?V(B):V(K,!1)})}var pe=sibling(he,2);{var le=V=>{var D=root_7$1();append(V,D)};if_block(pe,V=>{(get($).length>0||!get(O))&&V(le)})}var Ee=sibling(pe,2);each(Ee,17,()=>get($),index,(V,D)=>{var H=root_8$1();let X;var fe=child(H),Q=sibling(child(fe),2),de=child(Q),we=child(de),Ze=sibling(we);{var Te=te=>{var Qe=root_9$1();append(te,Qe)};if_block(Ze,te=>{get(D).route===get(x)&&te(Te)})}reset(de);var Le=sibling(de,2),Oe=child(Le);reset(Le),reset(Q),reset(fe),next(2),reset(H),template_effect((te,Qe)=>{X=set_class(H,1,"note-row svelte-zp32f3",null,X,{current:get(D).route===get(x)}),set_text(we,`${get(D).route??""} `),set_text(Oe,`${te??""} line${Qe??""}`)},[()=>se(get(D).content),()=>se(get(D).content)!==1?"s":""]),delegated("click",H,()=>j(get(D))),append(V,H)});var Me=sibling(Ee,2);{var Se=V=>{var D=root_10(),H=child(D),X=sibling(child(H),2),fe=child(X);reset(X),reset(H),reset(D),template_effect(()=>set_text(fe,`Add note for ${get(x)??""}`)),delegated("click",D,()=>Y(get(x))),append(V,D)};if_block(Me,V=>{get(O)||V(Se)})}var We=sibling(Me,2);{var ae=V=>{var D=root_11$1();append(V,D)};if_block(We,V=>{get(_).length===0&&!get(b)&&V(ae)})}append(ge,ee)};if_block(W,ge=>{get(b)?ge(ie):get(y)?ge(J,1):ge(ne,!1)})}reset(L),template_effect(()=>G.disabled=!!get(N)),delegated("click",G,()=>Y(null)),transition(3,L,()=>slide,()=>({duration:200})),append(z,L)},T=z=>{var L=root_12$1(),P=child(L),G=child(P),W=sibling(G,2),ie=child(W,!0);reset(W);var J=sibling(W,2);let ne;var ge=child(J,!0);reset(J),reset(P);var ee=sibling(P,2),he=child(ee),B=sibling(child(he),2);remove_input_defaults(B),reset(he);var K=sibling(he,2);{var pe=Q=>{var de=root_13$1(),we=child(de);html(we,()=>xe(get(R))),reset(de),append(Q,de)},le=Q=>{var de=root_14$1(),we=sibling(child(de),2);remove_textarea_child(we),reset(de),template_effect(()=>we.disabled=get(w)),bind_value(we,()=>get(R),Ze=>set(R,Ze)),append(Q,de)};if_block(K,Q=>{get(A)?Q(pe):Q(le,!1)})}var Ee=sibling(K,2);{var Me=Q=>{var de=root_15$1(),we=child(de,!0);reset(de),template_effect(()=>set_text(we,get(y))),append(Q,de)};if_block(Ee,Q=>{get(y)&&Q(Me)})}reset(ee);var Se=sibling(ee,2),We=child(Se);{var ae=Q=>{var de=root_16$1();let we;var Ze=child(de,!0);reset(de),template_effect(()=>{we=set_class(de,1,"delete-btn svelte-zp32f3",null,we,{confirm:get(C)}),de.disabled=get(w),set_text(Ze,get(C)?"Confirm delete?":"Delete")}),delegated("click",de,oe),append(Q,de)};if_block(We,Q=>{get(k)||Q(ae)})}var V=sibling(We,4),D=sibling(V,2),H=child(D);{var X=Q=>{var de=root_17$1();append(Q,de)};if_block(H,Q=>{get(w)&&Q(X)})}var fe=sibling(H);reset(D),reset(Se),reset(L),template_effect(Q=>{set_text(ie,get(M)?get(M):"Site-wide"),ne=set_class(J,1,"preview-toggle svelte-zp32f3",null,ne,{active:get(A)}),set_text(ge,get(A)?"Edit":"Preview"),B.disabled=get(w),V.disabled=get(w),D.disabled=Q,set_text(fe,` ${get(k)?"Create":"Save"}`)},[()=>get(w)||!get(I).trim()]),delegated("click",G,q),delegated("click",J,()=>set(A,!get(A))),bind_value(B,()=>get(I),Q=>set(I,Q)),delegated("click",V,q),delegated("click",D,ue),transition(3,L,()=>slide,()=>({duration:200})),append(z,L)};if_block(me,z=>{get(E)==="list"?z(Ce):get(E)==="edit"&&z(T,1)})}return reset(ke),delegated("keydown",ke,ve),append(d,ke),pop(Re)}delegate(["keydown","click"]),create_custom_element(NotesPanel,{endpoint:{},project:{},onnoteschanged:{}},[],[],{mode:"open"});function $constructor(d,p,h){function g(y,w){var x;Object.defineProperty(y,"_zod",{value:y._zod??{},enumerable:!1}),(x=y._zod).traits??(x.traits=new Set),y._zod.traits.add(d),p(y,w);for(const E in b.prototype)E in y||Object.defineProperty(y,E,{value:b.prototype[E].bind(y)});y._zod.constr=b,y._zod.def=w}const m=(h==null?void 0:h.Parent)??Object;class _ extends m{}Object.defineProperty(_,"name",{value:d});function b(y){var w;const x=h!=null&&h.Parent?new _:this;g(x,y),(w=x._zod).deferred??(w.deferred=[]);for(const E of x._zod.deferred)E();return x}return Object.defineProperty(b,"init",{value:g}),Object.defineProperty(b,Symbol.hasInstance,{value:y=>{var w,x;return h!=null&&h.Parent&&y instanceof h.Parent?!0:(x=(w=y==null?void 0:y._zod)==null?void 0:w.traits)==null?void 0:x.has(d)}}),Object.defineProperty(b,"name",{value:d}),b}class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const globalConfig={};function config(d){return globalConfig}function getEnumValues(d){const p=Object.values(d).filter(g=>typeof g=="number");return Object.entries(d).filter(([g,m])=>p.indexOf(+g)===-1).map(([g,m])=>m)}function jsonStringifyReplacer(d,p){return typeof p=="bigint"?p.toString():p}function cached(d){return{get value(){{const p=d();return Object.defineProperty(this,"value",{value:p}),p}}}}function nullish(d){return d==null}function cleanRegex(d){const p=d.startsWith("^")?1:0,h=d.endsWith("$")?d.length-1:d.length;return d.slice(p,h)}function floatSafeRemainder(d,p){const h=(d.toString().split(".")[1]||"").length,g=(p.toString().split(".")[1]||"").length,m=h>g?h:g,_=Number.parseInt(d.toFixed(m).replace(".","")),b=Number.parseInt(p.toFixed(m).replace(".",""));return _%b/10**m}function defineLazy(d,p,h){Object.defineProperty(d,p,{get(){{const g=h();return d[p]=g,g}},set(g){Object.defineProperty(d,p,{value:g})},configurable:!0})}function assignProp(d,p,h){Object.defineProperty(d,p,{value:h,writable:!0,enumerable:!0,configurable:!0})}function esc(d){return JSON.stringify(d)}const captureStackTrace=Error.captureStackTrace?Error.captureStackTrace:(...d)=>{};function isObject(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)}const allowsEval=cached(()=>{var d;if(typeof navigator<"u"&&((d=navigator==null?void 0:navigator.userAgent)!=null&&d.includes("Cloudflare")))return!1;try{const p=Function;return new p(""),!0}catch{return!1}});function isPlainObject(d){if(isObject(d)===!1)return!1;const p=d.constructor;if(p===void 0)return!0;const h=p.prototype;return!(isObject(h)===!1||Object.prototype.hasOwnProperty.call(h,"isPrototypeOf")===!1)}const propertyKeyTypes=new Set(["string","number","symbol"]);function escapeRegex(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone(d,p,h){const g=new d._zod.constr(p??d._zod.def);return(!p||h!=null&&h.parent)&&(g._zod.parent=d),g}function normalizeParams(d){const p=d;if(!p)return{};if(typeof p=="string")return{error:()=>p};if((p==null?void 0:p.message)!==void 0){if((p==null?void 0:p.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");p.error=p.message}return delete p.message,typeof p.error=="string"?{...p,error:()=>p.error}:p}function optionalKeys(d){return Object.keys(d).filter(p=>d[p]._zod.optin==="optional"&&d[p]._zod.optout==="optional")}const NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pick(d,p){const h={},g=d._zod.def;for(const m in p){if(!(m in g.shape))throw new Error(`Unrecognized key: "${m}"`);p[m]&&(h[m]=g.shape[m])}return clone(d,{...d._zod.def,shape:h,checks:[]})}function omit(d,p){const h={...d._zod.def.shape},g=d._zod.def;for(const m in p){if(!(m in g.shape))throw new Error(`Unrecognized key: "${m}"`);p[m]&&delete h[m]}return clone(d,{...d._zod.def,shape:h,checks:[]})}function extend(d,p){if(!isPlainObject(p))throw new Error("Invalid input to extend: expected a plain object");const h={...d._zod.def,get shape(){const g={...d._zod.def.shape,...p};return assignProp(this,"shape",g),g},checks:[]};return clone(d,h)}function merge(d,p){return clone(d,{...d._zod.def,get shape(){const h={...d._zod.def.shape,...p._zod.def.shape};return assignProp(this,"shape",h),h},catchall:p._zod.def.catchall,checks:[]})}function partial(d,p,h){const g=p._zod.def.shape,m={...g};if(h)for(const _ in h){if(!(_ in g))throw new Error(`Unrecognized key: "${_}"`);h[_]&&(m[_]=d?new d({type:"optional",innerType:g[_]}):g[_])}else for(const _ in g)m[_]=d?new d({type:"optional",innerType:g[_]}):g[_];return clone(p,{...p._zod.def,shape:m,checks:[]})}function required(d,p,h){const g=p._zod.def.shape,m={...g};if(h)for(const _ in h){if(!(_ in m))throw new Error(`Unrecognized key: "${_}"`);h[_]&&(m[_]=new d({type:"nonoptional",innerType:g[_]}))}else for(const _ in g)m[_]=new d({type:"nonoptional",innerType:g[_]});return clone(p,{...p._zod.def,shape:m,checks:[]})}function aborted(d,p=0){var h;for(let g=p;g<d.issues.length;g++)if(((h=d.issues[g])==null?void 0:h.continue)!==!0)return!0;return!1}function prefixIssues(d,p){return p.map(h=>{var g;return(g=h).path??(g.path=[]),h.path.unshift(d),h})}function unwrapMessage(d){return typeof d=="string"?d:d==null?void 0:d.message}function finalizeIssue(d,p,h){var m,_,b,y,w,x;const g={...d,path:d.path??[]};if(!d.message){const E=unwrapMessage((b=(_=(m=d.inst)==null?void 0:m._zod.def)==null?void 0:_.error)==null?void 0:b.call(_,d))??unwrapMessage((y=p==null?void 0:p.error)==null?void 0:y.call(p,d))??unwrapMessage((w=h.customError)==null?void 0:w.call(h,d))??unwrapMessage((x=h.localeError)==null?void 0:x.call(h,d))??"Invalid input";g.message=E}return delete g.inst,delete g.continue,p!=null&&p.reportInput||delete g.input,g}function getLengthableOrigin(d){return Array.isArray(d)?"array":typeof d=="string"?"string":"unknown"}function issue(...d){const[p,h,g]=d;return typeof p=="string"?{message:p,code:"custom",input:h,inst:g}:{...p}}const initializer$1=(d,p)=>{d.name="$ZodError",Object.defineProperty(d,"_zod",{value:d._zod,enumerable:!1}),Object.defineProperty(d,"issues",{value:p,enumerable:!1}),Object.defineProperty(d,"message",{get(){return JSON.stringify(p,jsonStringifyReplacer,2)},enumerable:!0}),Object.defineProperty(d,"toString",{value:()=>d.message,enumerable:!1})},$ZodError=$constructor("$ZodError",initializer$1),$ZodRealError=$constructor("$ZodError",initializer$1,{Parent:Error});function flattenError(d,p=h=>h.message){const h={},g=[];for(const m of d.issues)m.path.length>0?(h[m.path[0]]=h[m.path[0]]||[],h[m.path[0]].push(p(m))):g.push(p(m));return{formErrors:g,fieldErrors:h}}function formatError(d,p){const h=p||function(_){return _.message},g={_errors:[]},m=_=>{for(const b of _.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map(y=>m({issues:y}));else if(b.code==="invalid_key")m({issues:b.issues});else if(b.code==="invalid_element")m({issues:b.issues});else if(b.path.length===0)g._errors.push(h(b));else{let y=g,w=0;for(;w<b.path.length;){const x=b.path[w];w===b.path.length-1?(y[x]=y[x]||{_errors:[]},y[x]._errors.push(h(b))):y[x]=y[x]||{_errors:[]},y=y[x],w++}}};return m(d),g}function toDotPath(d){const p=[];for(const h of d)typeof h=="number"?p.push(`[${h}]`):typeof h=="symbol"?p.push(`[${JSON.stringify(String(h))}]`):/[^\w$]/.test(h)?p.push(`[${JSON.stringify(h)}]`):(p.length&&p.push("."),p.push(h));return p.join("")}function prettifyError(d){var g;const p=[],h=[...d.issues].sort((m,_)=>m.path.length-_.path.length);for(const m of h)p.push(`✖ ${m.message}`),(g=m.path)!=null&&g.length&&p.push(` → at ${toDotPath(m.path)}`);return p.join(`
|
|
181
|
+
`).filter(L=>L.trim()).length:0}function xe(z){if(!z)return'<span style="color:#6b7280;font-style:italic">No content</span>';let L=z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return L=L.replace(/```([^`]*?)```/gs,'<pre style="background:#1f2937;padding:8px;border-radius:4px;font-size:11px;overflow-x:auto;margin:4px 0">$1</pre>'),L=L.replace(/`([^`]+)`/g,'<code style="background:#1f2937;padding:1px 4px;border-radius:3px;font-size:11px">$1</code>'),L=L.replace(/^### (.+)$/gm,'<strong style="display:block;margin-top:8px;font-size:12px;color:#d1d5db">$1</strong>'),L=L.replace(/^## (.+)$/gm,'<strong style="display:block;margin-top:8px;font-size:13px;color:#e5e7eb">$1</strong>'),L=L.replace(/^# (.+)$/gm,'<strong style="display:block;margin-top:8px;font-size:14px;color:#f3f4f6">$1</strong>'),L=L.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),L=L.replace(/\*(.+?)\*/g,"<em>$1</em>"),L=L.replace(/^- (.+)$/gm,'<span style="display:block;padding-left:12px">• $1</span>'),L=L.replace(/^(\d+)\. (.+)$/gm,'<span style="display:block;padding-left:12px">$1. $2</span>'),L=L.replace(/\n(?!<)/g,"<br>"),L}function ve(z){z.key==="Escape"&&get(E)==="edit"&&(z.stopPropagation(),q())}var Re={get endpoint(){return h()},set endpoint(z){h(z),flushSync()},get project(){return g()},set project(z){g(z),flushSync()},get onnoteschanged(){return m()},set onnoteschanged(z){m(z),flushSync()}},ke=root$2(),me=child(ke);{var Ce=z=>{var L=root_1$2(),P=child(L),G=sibling(child(P),2);reset(P);var W=sibling(P,2);{var ie=ge=>{var ee=root_2$2();append(ge,ee)},J=ge=>{var ee=root_3$1(),he=child(ee),B=sibling(he);reset(ee),template_effect(()=>set_text(he,`${get(y)??""} `)),delegated("click",B,F),append(ge,ee)},ne=ge=>{var ee=root_4$1(),he=first_child(ee);{var B=V=>{var D=root_5$1(),H=child(D),X=sibling(child(H),2),fe=child(X),Q=child(fe,!0);reset(fe);var de=sibling(fe,2),we=child(de);reset(de),reset(X),reset(H),next(2),reset(D),template_effect((Ze,Te)=>{set_text(Q,get(N).title||"Site-wide notes"),set_text(we,`${Ze??""} line${Te??""}`)},[()=>se(get(N).content),()=>se(get(N).content)!==1?"s":""]),delegated("click",D,()=>j(get(N))),append(V,D)},K=V=>{var D=root_6$1();delegated("click",D,()=>Y(null)),append(V,D)};if_block(he,V=>{get(N)?V(B):V(K,!1)})}var pe=sibling(he,2);{var le=V=>{var D=root_7$1();append(V,D)};if_block(pe,V=>{(get($).length>0||!get(O))&&V(le)})}var Ee=sibling(pe,2);each(Ee,17,()=>get($),index,(V,D)=>{var H=root_8$1();let X;var fe=child(H),Q=sibling(child(fe),2),de=child(Q),we=child(de),Ze=sibling(we);{var Te=te=>{var Qe=root_9$1();append(te,Qe)};if_block(Ze,te=>{get(D).route===get(x)&&te(Te)})}reset(de);var Fe=sibling(de,2),Oe=child(Fe);reset(Fe),reset(Q),reset(fe),next(2),reset(H),template_effect((te,Qe)=>{X=set_class(H,1,"note-row svelte-zp32f3",null,X,{current:get(D).route===get(x)}),set_text(we,`${get(D).route??""} `),set_text(Oe,`${te??""} line${Qe??""}`)},[()=>se(get(D).content),()=>se(get(D).content)!==1?"s":""]),delegated("click",H,()=>j(get(D))),append(V,H)});var Me=sibling(Ee,2);{var Se=V=>{var D=root_10(),H=child(D),X=sibling(child(H),2),fe=child(X);reset(X),reset(H),reset(D),template_effect(()=>set_text(fe,`Add note for ${get(x)??""}`)),delegated("click",D,()=>Y(get(x))),append(V,D)};if_block(Me,V=>{get(O)||V(Se)})}var We=sibling(Me,2);{var ae=V=>{var D=root_11$1();append(V,D)};if_block(We,V=>{get(_).length===0&&!get(b)&&V(ae)})}append(ge,ee)};if_block(W,ge=>{get(b)?ge(ie):get(y)?ge(J,1):ge(ne,!1)})}reset(L),template_effect(()=>G.disabled=!!get(N)),delegated("click",G,()=>Y(null)),transition(3,L,()=>slide,()=>({duration:200})),append(z,L)},T=z=>{var L=root_12$1(),P=child(L),G=child(P),W=sibling(G,2),ie=child(W,!0);reset(W);var J=sibling(W,2);let ne;var ge=child(J,!0);reset(J),reset(P);var ee=sibling(P,2),he=child(ee),B=sibling(child(he),2);remove_input_defaults(B),reset(he);var K=sibling(he,2);{var pe=Q=>{var de=root_13$1(),we=child(de);html(we,()=>xe(get(R))),reset(de),append(Q,de)},le=Q=>{var de=root_14$1(),we=sibling(child(de),2);remove_textarea_child(we),reset(de),template_effect(()=>we.disabled=get(w)),bind_value(we,()=>get(R),Ze=>set(R,Ze)),append(Q,de)};if_block(K,Q=>{get(A)?Q(pe):Q(le,!1)})}var Ee=sibling(K,2);{var Me=Q=>{var de=root_15$1(),we=child(de,!0);reset(de),template_effect(()=>set_text(we,get(y))),append(Q,de)};if_block(Ee,Q=>{get(y)&&Q(Me)})}reset(ee);var Se=sibling(ee,2),We=child(Se);{var ae=Q=>{var de=root_16$1();let we;var Ze=child(de,!0);reset(de),template_effect(()=>{we=set_class(de,1,"delete-btn svelte-zp32f3",null,we,{confirm:get(C)}),de.disabled=get(w),set_text(Ze,get(C)?"Confirm delete?":"Delete")}),delegated("click",de,oe),append(Q,de)};if_block(We,Q=>{get(k)||Q(ae)})}var V=sibling(We,4),D=sibling(V,2),H=child(D);{var X=Q=>{var de=root_17$1();append(Q,de)};if_block(H,Q=>{get(w)&&Q(X)})}var fe=sibling(H);reset(D),reset(Se),reset(L),template_effect(Q=>{set_text(ie,get(M)?get(M):"Site-wide"),ne=set_class(J,1,"preview-toggle svelte-zp32f3",null,ne,{active:get(A)}),set_text(ge,get(A)?"Edit":"Preview"),B.disabled=get(w),V.disabled=get(w),D.disabled=Q,set_text(fe,` ${get(k)?"Create":"Save"}`)},[()=>get(w)||!get(I).trim()]),delegated("click",G,q),delegated("click",J,()=>set(A,!get(A))),bind_value(B,()=>get(I),Q=>set(I,Q)),delegated("click",V,q),delegated("click",D,ue),transition(3,L,()=>slide,()=>({duration:200})),append(z,L)};if_block(me,z=>{get(E)==="list"?z(Ce):get(E)==="edit"&&z(T,1)})}return reset(ke),delegated("keydown",ke,ve),append(d,ke),pop(Re)}delegate(["keydown","click"]),create_custom_element(NotesPanel,{endpoint:{},project:{},onnoteschanged:{}},[],[],{mode:"open"});function $constructor(d,p,h){function g(y,w){var x;Object.defineProperty(y,"_zod",{value:y._zod??{},enumerable:!1}),(x=y._zod).traits??(x.traits=new Set),y._zod.traits.add(d),p(y,w);for(const E in b.prototype)E in y||Object.defineProperty(y,E,{value:b.prototype[E].bind(y)});y._zod.constr=b,y._zod.def=w}const m=(h==null?void 0:h.Parent)??Object;class _ extends m{}Object.defineProperty(_,"name",{value:d});function b(y){var w;const x=h!=null&&h.Parent?new _:this;g(x,y),(w=x._zod).deferred??(w.deferred=[]);for(const E of x._zod.deferred)E();return x}return Object.defineProperty(b,"init",{value:g}),Object.defineProperty(b,Symbol.hasInstance,{value:y=>{var w,x;return h!=null&&h.Parent&&y instanceof h.Parent?!0:(x=(w=y==null?void 0:y._zod)==null?void 0:w.traits)==null?void 0:x.has(d)}}),Object.defineProperty(b,"name",{value:d}),b}class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const globalConfig={};function config(d){return globalConfig}function getEnumValues(d){const p=Object.values(d).filter(g=>typeof g=="number");return Object.entries(d).filter(([g,m])=>p.indexOf(+g)===-1).map(([g,m])=>m)}function jsonStringifyReplacer(d,p){return typeof p=="bigint"?p.toString():p}function cached(d){return{get value(){{const p=d();return Object.defineProperty(this,"value",{value:p}),p}}}}function nullish(d){return d==null}function cleanRegex(d){const p=d.startsWith("^")?1:0,h=d.endsWith("$")?d.length-1:d.length;return d.slice(p,h)}function floatSafeRemainder(d,p){const h=(d.toString().split(".")[1]||"").length,g=(p.toString().split(".")[1]||"").length,m=h>g?h:g,_=Number.parseInt(d.toFixed(m).replace(".","")),b=Number.parseInt(p.toFixed(m).replace(".",""));return _%b/10**m}function defineLazy(d,p,h){Object.defineProperty(d,p,{get(){{const g=h();return d[p]=g,g}},set(g){Object.defineProperty(d,p,{value:g})},configurable:!0})}function assignProp(d,p,h){Object.defineProperty(d,p,{value:h,writable:!0,enumerable:!0,configurable:!0})}function esc(d){return JSON.stringify(d)}const captureStackTrace=Error.captureStackTrace?Error.captureStackTrace:(...d)=>{};function isObject(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)}const allowsEval=cached(()=>{var d;if(typeof navigator<"u"&&((d=navigator==null?void 0:navigator.userAgent)!=null&&d.includes("Cloudflare")))return!1;try{const p=Function;return new p(""),!0}catch{return!1}});function isPlainObject(d){if(isObject(d)===!1)return!1;const p=d.constructor;if(p===void 0)return!0;const h=p.prototype;return!(isObject(h)===!1||Object.prototype.hasOwnProperty.call(h,"isPrototypeOf")===!1)}const propertyKeyTypes=new Set(["string","number","symbol"]);function escapeRegex(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone(d,p,h){const g=new d._zod.constr(p??d._zod.def);return(!p||h!=null&&h.parent)&&(g._zod.parent=d),g}function normalizeParams(d){const p=d;if(!p)return{};if(typeof p=="string")return{error:()=>p};if((p==null?void 0:p.message)!==void 0){if((p==null?void 0:p.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");p.error=p.message}return delete p.message,typeof p.error=="string"?{...p,error:()=>p.error}:p}function optionalKeys(d){return Object.keys(d).filter(p=>d[p]._zod.optin==="optional"&&d[p]._zod.optout==="optional")}const NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pick(d,p){const h={},g=d._zod.def;for(const m in p){if(!(m in g.shape))throw new Error(`Unrecognized key: "${m}"`);p[m]&&(h[m]=g.shape[m])}return clone(d,{...d._zod.def,shape:h,checks:[]})}function omit(d,p){const h={...d._zod.def.shape},g=d._zod.def;for(const m in p){if(!(m in g.shape))throw new Error(`Unrecognized key: "${m}"`);p[m]&&delete h[m]}return clone(d,{...d._zod.def,shape:h,checks:[]})}function extend(d,p){if(!isPlainObject(p))throw new Error("Invalid input to extend: expected a plain object");const h={...d._zod.def,get shape(){const g={...d._zod.def.shape,...p};return assignProp(this,"shape",g),g},checks:[]};return clone(d,h)}function merge(d,p){return clone(d,{...d._zod.def,get shape(){const h={...d._zod.def.shape,...p._zod.def.shape};return assignProp(this,"shape",h),h},catchall:p._zod.def.catchall,checks:[]})}function partial(d,p,h){const g=p._zod.def.shape,m={...g};if(h)for(const _ in h){if(!(_ in g))throw new Error(`Unrecognized key: "${_}"`);h[_]&&(m[_]=d?new d({type:"optional",innerType:g[_]}):g[_])}else for(const _ in g)m[_]=d?new d({type:"optional",innerType:g[_]}):g[_];return clone(p,{...p._zod.def,shape:m,checks:[]})}function required(d,p,h){const g=p._zod.def.shape,m={...g};if(h)for(const _ in h){if(!(_ in m))throw new Error(`Unrecognized key: "${_}"`);h[_]&&(m[_]=new d({type:"nonoptional",innerType:g[_]}))}else for(const _ in g)m[_]=new d({type:"nonoptional",innerType:g[_]});return clone(p,{...p._zod.def,shape:m,checks:[]})}function aborted(d,p=0){var h;for(let g=p;g<d.issues.length;g++)if(((h=d.issues[g])==null?void 0:h.continue)!==!0)return!0;return!1}function prefixIssues(d,p){return p.map(h=>{var g;return(g=h).path??(g.path=[]),h.path.unshift(d),h})}function unwrapMessage(d){return typeof d=="string"?d:d==null?void 0:d.message}function finalizeIssue(d,p,h){var m,_,b,y,w,x;const g={...d,path:d.path??[]};if(!d.message){const E=unwrapMessage((b=(_=(m=d.inst)==null?void 0:m._zod.def)==null?void 0:_.error)==null?void 0:b.call(_,d))??unwrapMessage((y=p==null?void 0:p.error)==null?void 0:y.call(p,d))??unwrapMessage((w=h.customError)==null?void 0:w.call(h,d))??unwrapMessage((x=h.localeError)==null?void 0:x.call(h,d))??"Invalid input";g.message=E}return delete g.inst,delete g.continue,p!=null&&p.reportInput||delete g.input,g}function getLengthableOrigin(d){return Array.isArray(d)?"array":typeof d=="string"?"string":"unknown"}function issue(...d){const[p,h,g]=d;return typeof p=="string"?{message:p,code:"custom",input:h,inst:g}:{...p}}const initializer$1=(d,p)=>{d.name="$ZodError",Object.defineProperty(d,"_zod",{value:d._zod,enumerable:!1}),Object.defineProperty(d,"issues",{value:p,enumerable:!1}),Object.defineProperty(d,"message",{get(){return JSON.stringify(p,jsonStringifyReplacer,2)},enumerable:!0}),Object.defineProperty(d,"toString",{value:()=>d.message,enumerable:!1})},$ZodError=$constructor("$ZodError",initializer$1),$ZodRealError=$constructor("$ZodError",initializer$1,{Parent:Error});function flattenError(d,p=h=>h.message){const h={},g=[];for(const m of d.issues)m.path.length>0?(h[m.path[0]]=h[m.path[0]]||[],h[m.path[0]].push(p(m))):g.push(p(m));return{formErrors:g,fieldErrors:h}}function formatError(d,p){const h=p||function(_){return _.message},g={_errors:[]},m=_=>{for(const b of _.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map(y=>m({issues:y}));else if(b.code==="invalid_key")m({issues:b.issues});else if(b.code==="invalid_element")m({issues:b.issues});else if(b.path.length===0)g._errors.push(h(b));else{let y=g,w=0;for(;w<b.path.length;){const x=b.path[w];w===b.path.length-1?(y[x]=y[x]||{_errors:[]},y[x]._errors.push(h(b))):y[x]=y[x]||{_errors:[]},y=y[x],w++}}};return m(d),g}function toDotPath(d){const p=[];for(const h of d)typeof h=="number"?p.push(`[${h}]`):typeof h=="symbol"?p.push(`[${JSON.stringify(String(h))}]`):/[^\w$]/.test(h)?p.push(`[${JSON.stringify(h)}]`):(p.length&&p.push("."),p.push(h));return p.join("")}function prettifyError(d){var g;const p=[],h=[...d.issues].sort((m,_)=>m.path.length-_.path.length);for(const m of h)p.push(`✖ ${m.message}`),(g=m.path)!=null&&g.length&&p.push(` → at ${toDotPath(m.path)}`);return p.join(`
|
|
182
182
|
`)}const _parse=d=>(p,h,g,m)=>{const _=g?Object.assign(g,{async:!1}):{async:!1},b=p._zod.run({value:h,issues:[]},_);if(b instanceof Promise)throw new $ZodAsyncError;if(b.issues.length){const y=new((m==null?void 0:m.Err)??d)(b.issues.map(w=>finalizeIssue(w,_,config())));throw captureStackTrace(y,m==null?void 0:m.callee),y}return b.value},_parseAsync=d=>async(p,h,g,m)=>{const _=g?Object.assign(g,{async:!0}):{async:!0};let b=p._zod.run({value:h,issues:[]},_);if(b instanceof Promise&&(b=await b),b.issues.length){const y=new((m==null?void 0:m.Err)??d)(b.issues.map(w=>finalizeIssue(w,_,config())));throw captureStackTrace(y,m==null?void 0:m.callee),y}return b.value},_safeParse=d=>(p,h,g)=>{const m=g?{...g,async:!1}:{async:!1},_=p._zod.run({value:h,issues:[]},m);if(_ instanceof Promise)throw new $ZodAsyncError;return _.issues.length?{success:!1,error:new(d??$ZodError)(_.issues.map(b=>finalizeIssue(b,m,config())))}:{success:!0,data:_.value}},safeParse$1=_safeParse($ZodRealError),_safeParseAsync=d=>async(p,h,g)=>{const m=g?Object.assign(g,{async:!0}):{async:!0};let _=p._zod.run({value:h,issues:[]},m);return _ instanceof Promise&&(_=await _),_.issues.length?{success:!1,error:new d(_.issues.map(b=>finalizeIssue(b,m,config())))}:{success:!0,data:_.value}},safeParseAsync$1=_safeParseAsync($ZodRealError),cuid=/^[cC][^\s-]{8,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/,duration$1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,uuid=d=>d?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${d}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_emoji$1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function emoji(){return new RegExp(_emoji$1,"u")}const ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,base64url=/^[A-Za-z0-9_-]*$/,hostname=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,e164=/^\+(?:[0-9]){6,14}[0-9]$/,dateSource="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",date$1=new RegExp(`^${dateSource}$`);function timeSource(d){const p="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof d.precision=="number"?d.precision===-1?`${p}`:d.precision===0?`${p}:[0-5]\\d`:`${p}:[0-5]\\d\\.\\d{${d.precision}}`:`${p}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time$1(d){return new RegExp(`^${timeSource(d)}$`)}function datetime$1(d){const p=timeSource({precision:d.precision}),h=["Z"];d.local&&h.push(""),d.offset&&h.push("([+-]\\d{2}:\\d{2})");const g=`${p}(?:${h.join("|")})`;return new RegExp(`^${dateSource}T(?:${g})$`)}const string$1=d=>{const p=d?`[\\s\\S]{${(d==null?void 0:d.minimum)??0},${(d==null?void 0:d.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${p}$`)},integer=/^\d+$/,number$1=/^-?\d+(?:\.\d+)?/i,boolean$1=/true|false/i,lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/,$ZodCheck=$constructor("$ZodCheck",(d,p)=>{var h;d._zod??(d._zod={}),d._zod.def=p,(h=d._zod).onattach??(h.onattach=[])}),numericOriginMap={number:"number",bigint:"bigint",object:"date"},$ZodCheckLessThan=$constructor("$ZodCheckLessThan",(d,p)=>{$ZodCheck.init(d,p);const h=numericOriginMap[typeof p.value];d._zod.onattach.push(g=>{const m=g._zod.bag,_=(p.inclusive?m.maximum:m.exclusiveMaximum)??Number.POSITIVE_INFINITY;p.value<_&&(p.inclusive?m.maximum=p.value:m.exclusiveMaximum=p.value)}),d._zod.check=g=>{(p.inclusive?g.value<=p.value:g.value<p.value)||g.issues.push({origin:h,code:"too_big",maximum:p.value,input:g.value,inclusive:p.inclusive,inst:d,continue:!p.abort})}}),$ZodCheckGreaterThan=$constructor("$ZodCheckGreaterThan",(d,p)=>{$ZodCheck.init(d,p);const h=numericOriginMap[typeof p.value];d._zod.onattach.push(g=>{const m=g._zod.bag,_=(p.inclusive?m.minimum:m.exclusiveMinimum)??Number.NEGATIVE_INFINITY;p.value>_&&(p.inclusive?m.minimum=p.value:m.exclusiveMinimum=p.value)}),d._zod.check=g=>{(p.inclusive?g.value>=p.value:g.value>p.value)||g.issues.push({origin:h,code:"too_small",minimum:p.value,input:g.value,inclusive:p.inclusive,inst:d,continue:!p.abort})}}),$ZodCheckMultipleOf=$constructor("$ZodCheckMultipleOf",(d,p)=>{$ZodCheck.init(d,p),d._zod.onattach.push(h=>{var g;(g=h._zod.bag).multipleOf??(g.multipleOf=p.value)}),d._zod.check=h=>{if(typeof h.value!=typeof p.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof h.value=="bigint"?h.value%p.value===BigInt(0):floatSafeRemainder(h.value,p.value)===0)||h.issues.push({origin:typeof h.value,code:"not_multiple_of",divisor:p.value,input:h.value,inst:d,continue:!p.abort})}}),$ZodCheckNumberFormat=$constructor("$ZodCheckNumberFormat",(d,p)=>{var b;$ZodCheck.init(d,p),p.format=p.format||"float64";const h=(b=p.format)==null?void 0:b.includes("int"),g=h?"int":"number",[m,_]=NUMBER_FORMAT_RANGES[p.format];d._zod.onattach.push(y=>{const w=y._zod.bag;w.format=p.format,w.minimum=m,w.maximum=_,h&&(w.pattern=integer)}),d._zod.check=y=>{const w=y.value;if(h){if(!Number.isInteger(w)){y.issues.push({expected:g,format:p.format,code:"invalid_type",input:w,inst:d});return}if(!Number.isSafeInteger(w)){w>0?y.issues.push({input:w,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:d,origin:g,continue:!p.abort}):y.issues.push({input:w,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:d,origin:g,continue:!p.abort});return}}w<m&&y.issues.push({origin:"number",input:w,code:"too_small",minimum:m,inclusive:!0,inst:d,continue:!p.abort}),w>_&&y.issues.push({origin:"number",input:w,code:"too_big",maximum:_,inst:d})}}),$ZodCheckMaxLength=$constructor("$ZodCheckMaxLength",(d,p)=>{var h;$ZodCheck.init(d,p),(h=d._zod.def).when??(h.when=g=>{const m=g.value;return!nullish(m)&&m.length!==void 0}),d._zod.onattach.push(g=>{const m=g._zod.bag.maximum??Number.POSITIVE_INFINITY;p.maximum<m&&(g._zod.bag.maximum=p.maximum)}),d._zod.check=g=>{const m=g.value;if(m.length<=p.maximum)return;const b=getLengthableOrigin(m);g.issues.push({origin:b,code:"too_big",maximum:p.maximum,inclusive:!0,input:m,inst:d,continue:!p.abort})}}),$ZodCheckMinLength=$constructor("$ZodCheckMinLength",(d,p)=>{var h;$ZodCheck.init(d,p),(h=d._zod.def).when??(h.when=g=>{const m=g.value;return!nullish(m)&&m.length!==void 0}),d._zod.onattach.push(g=>{const m=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;p.minimum>m&&(g._zod.bag.minimum=p.minimum)}),d._zod.check=g=>{const m=g.value;if(m.length>=p.minimum)return;const b=getLengthableOrigin(m);g.issues.push({origin:b,code:"too_small",minimum:p.minimum,inclusive:!0,input:m,inst:d,continue:!p.abort})}}),$ZodCheckLengthEquals=$constructor("$ZodCheckLengthEquals",(d,p)=>{var h;$ZodCheck.init(d,p),(h=d._zod.def).when??(h.when=g=>{const m=g.value;return!nullish(m)&&m.length!==void 0}),d._zod.onattach.push(g=>{const m=g._zod.bag;m.minimum=p.length,m.maximum=p.length,m.length=p.length}),d._zod.check=g=>{const m=g.value,_=m.length;if(_===p.length)return;const b=getLengthableOrigin(m),y=_>p.length;g.issues.push({origin:b,...y?{code:"too_big",maximum:p.length}:{code:"too_small",minimum:p.length},inclusive:!0,exact:!0,input:g.value,inst:d,continue:!p.abort})}}),$ZodCheckStringFormat=$constructor("$ZodCheckStringFormat",(d,p)=>{var h,g;$ZodCheck.init(d,p),d._zod.onattach.push(m=>{const _=m._zod.bag;_.format=p.format,p.pattern&&(_.patterns??(_.patterns=new Set),_.patterns.add(p.pattern))}),p.pattern?(h=d._zod).check??(h.check=m=>{p.pattern.lastIndex=0,!p.pattern.test(m.value)&&m.issues.push({origin:"string",code:"invalid_format",format:p.format,input:m.value,...p.pattern?{pattern:p.pattern.toString()}:{},inst:d,continue:!p.abort})}):(g=d._zod).check??(g.check=()=>{})}),$ZodCheckRegex=$constructor("$ZodCheckRegex",(d,p)=>{$ZodCheckStringFormat.init(d,p),d._zod.check=h=>{p.pattern.lastIndex=0,!p.pattern.test(h.value)&&h.issues.push({origin:"string",code:"invalid_format",format:"regex",input:h.value,pattern:p.pattern.toString(),inst:d,continue:!p.abort})}}),$ZodCheckLowerCase=$constructor("$ZodCheckLowerCase",(d,p)=>{p.pattern??(p.pattern=lowercase),$ZodCheckStringFormat.init(d,p)}),$ZodCheckUpperCase=$constructor("$ZodCheckUpperCase",(d,p)=>{p.pattern??(p.pattern=uppercase),$ZodCheckStringFormat.init(d,p)}),$ZodCheckIncludes=$constructor("$ZodCheckIncludes",(d,p)=>{$ZodCheck.init(d,p);const h=escapeRegex(p.includes),g=new RegExp(typeof p.position=="number"?`^.{${p.position}}${h}`:h);p.pattern=g,d._zod.onattach.push(m=>{const _=m._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(g)}),d._zod.check=m=>{m.value.includes(p.includes,p.position)||m.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:p.includes,input:m.value,inst:d,continue:!p.abort})}}),$ZodCheckStartsWith=$constructor("$ZodCheckStartsWith",(d,p)=>{$ZodCheck.init(d,p);const h=new RegExp(`^${escapeRegex(p.prefix)}.*`);p.pattern??(p.pattern=h),d._zod.onattach.push(g=>{const m=g._zod.bag;m.patterns??(m.patterns=new Set),m.patterns.add(h)}),d._zod.check=g=>{g.value.startsWith(p.prefix)||g.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:p.prefix,input:g.value,inst:d,continue:!p.abort})}}),$ZodCheckEndsWith=$constructor("$ZodCheckEndsWith",(d,p)=>{$ZodCheck.init(d,p);const h=new RegExp(`.*${escapeRegex(p.suffix)}$`);p.pattern??(p.pattern=h),d._zod.onattach.push(g=>{const m=g._zod.bag;m.patterns??(m.patterns=new Set),m.patterns.add(h)}),d._zod.check=g=>{g.value.endsWith(p.suffix)||g.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:p.suffix,input:g.value,inst:d,continue:!p.abort})}}),$ZodCheckOverwrite=$constructor("$ZodCheckOverwrite",(d,p)=>{$ZodCheck.init(d,p),d._zod.check=h=>{h.value=p.tx(h.value)}});class Doc{constructor(p=[]){this.content=[],this.indent=0,this&&(this.args=p)}indented(p){this.indent+=1,p(this),this.indent-=1}write(p){if(typeof p=="function"){p(this,{execution:"sync"}),p(this,{execution:"async"});return}const g=p.split(`
|
|
183
183
|
`).filter(b=>b),m=Math.min(...g.map(b=>b.length-b.trimStart().length)),_=g.map(b=>b.slice(m)).map(b=>" ".repeat(this.indent*2)+b);for(const b of _)this.content.push(b)}compile(){const p=Function,h=this==null?void 0:this.args,m=[...((this==null?void 0:this.content)??[""]).map(_=>` ${_}`)];return new p(...h,m.join(`
|
|
184
184
|
`))}}const version={major:4,minor:0,patch:0},$ZodType=$constructor("$ZodType",(d,p)=>{var m;var h;d??(d={}),d._zod.def=p,d._zod.bag=d._zod.bag||{},d._zod.version=version;const g=[...d._zod.def.checks??[]];d._zod.traits.has("$ZodCheck")&&g.unshift(d);for(const _ of g)for(const b of _._zod.onattach)b(d);if(g.length===0)(h=d._zod).deferred??(h.deferred=[]),(m=d._zod.deferred)==null||m.push(()=>{d._zod.run=d._zod.parse});else{const _=(b,y,w)=>{let x=aborted(b),E;for(const S of y){if(S._zod.def.when){if(!S._zod.def.when(b))continue}else if(x)continue;const k=b.issues.length,I=S._zod.check(b);if(I instanceof Promise&&(w==null?void 0:w.async)===!1)throw new $ZodAsyncError;if(E||I instanceof Promise)E=(E??Promise.resolve()).then(async()=>{await I,b.issues.length!==k&&(x||(x=aborted(b,k)))});else{if(b.issues.length===k)continue;x||(x=aborted(b,k))}}return E?E.then(()=>b):b};d._zod.run=(b,y)=>{const w=d._zod.parse(b,y);if(w instanceof Promise){if(y.async===!1)throw new $ZodAsyncError;return w.then(x=>_(x,g,y))}return _(w,g,y)}}d["~standard"]={validate:_=>{var b;try{const y=safeParse$1(d,_);return y.success?{value:y.data}:{issues:(b=y.error)==null?void 0:b.issues}}catch{return safeParseAsync$1(d,_).then(w=>{var x;return w.success?{value:w.data}:{issues:(x=w.error)==null?void 0:x.issues}})}},vendor:"zod",version:1}}),$ZodString=$constructor("$ZodString",(d,p)=>{var h;$ZodType.init(d,p),d._zod.pattern=[...((h=d==null?void 0:d._zod.bag)==null?void 0:h.patterns)??[]].pop()??string$1(d._zod.bag),d._zod.parse=(g,m)=>{if(p.coerce)try{g.value=String(g.value)}catch{}return typeof g.value=="string"||g.issues.push({expected:"string",code:"invalid_type",input:g.value,inst:d}),g}}),$ZodStringFormat=$constructor("$ZodStringFormat",(d,p)=>{$ZodCheckStringFormat.init(d,p),$ZodString.init(d,p)}),$ZodGUID=$constructor("$ZodGUID",(d,p)=>{p.pattern??(p.pattern=guid),$ZodStringFormat.init(d,p)}),$ZodUUID=$constructor("$ZodUUID",(d,p)=>{if(p.version){const g={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[p.version];if(g===void 0)throw new Error(`Invalid UUID version: "${p.version}"`);p.pattern??(p.pattern=uuid(g))}else p.pattern??(p.pattern=uuid());$ZodStringFormat.init(d,p)}),$ZodEmail=$constructor("$ZodEmail",(d,p)=>{p.pattern??(p.pattern=email),$ZodStringFormat.init(d,p)}),$ZodURL=$constructor("$ZodURL",(d,p)=>{$ZodStringFormat.init(d,p),d._zod.check=h=>{try{const g=h.value,m=new URL(g),_=m.href;p.hostname&&(p.hostname.lastIndex=0,p.hostname.test(m.hostname)||h.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:hostname.source,input:h.value,inst:d,continue:!p.abort})),p.protocol&&(p.protocol.lastIndex=0,p.protocol.test(m.protocol.endsWith(":")?m.protocol.slice(0,-1):m.protocol)||h.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:p.protocol.source,input:h.value,inst:d,continue:!p.abort})),!g.endsWith("/")&&_.endsWith("/")?h.value=_.slice(0,-1):h.value=_;return}catch{h.issues.push({code:"invalid_format",format:"url",input:h.value,inst:d,continue:!p.abort})}}}),$ZodEmoji=$constructor("$ZodEmoji",(d,p)=>{p.pattern??(p.pattern=emoji()),$ZodStringFormat.init(d,p)}),$ZodNanoID=$constructor("$ZodNanoID",(d,p)=>{p.pattern??(p.pattern=nanoid),$ZodStringFormat.init(d,p)}),$ZodCUID=$constructor("$ZodCUID",(d,p)=>{p.pattern??(p.pattern=cuid),$ZodStringFormat.init(d,p)}),$ZodCUID2=$constructor("$ZodCUID2",(d,p)=>{p.pattern??(p.pattern=cuid2),$ZodStringFormat.init(d,p)}),$ZodULID=$constructor("$ZodULID",(d,p)=>{p.pattern??(p.pattern=ulid),$ZodStringFormat.init(d,p)}),$ZodXID=$constructor("$ZodXID",(d,p)=>{p.pattern??(p.pattern=xid),$ZodStringFormat.init(d,p)}),$ZodKSUID=$constructor("$ZodKSUID",(d,p)=>{p.pattern??(p.pattern=ksuid),$ZodStringFormat.init(d,p)}),$ZodISODateTime=$constructor("$ZodISODateTime",(d,p)=>{p.pattern??(p.pattern=datetime$1(p)),$ZodStringFormat.init(d,p)}),$ZodISODate=$constructor("$ZodISODate",(d,p)=>{p.pattern??(p.pattern=date$1),$ZodStringFormat.init(d,p)}),$ZodISOTime=$constructor("$ZodISOTime",(d,p)=>{p.pattern??(p.pattern=time$1(p)),$ZodStringFormat.init(d,p)}),$ZodISODuration=$constructor("$ZodISODuration",(d,p)=>{p.pattern??(p.pattern=duration$1),$ZodStringFormat.init(d,p)}),$ZodIPv4=$constructor("$ZodIPv4",(d,p)=>{p.pattern??(p.pattern=ipv4),$ZodStringFormat.init(d,p),d._zod.onattach.push(h=>{const g=h._zod.bag;g.format="ipv4"})}),$ZodIPv6=$constructor("$ZodIPv6",(d,p)=>{p.pattern??(p.pattern=ipv6),$ZodStringFormat.init(d,p),d._zod.onattach.push(h=>{const g=h._zod.bag;g.format="ipv6"}),d._zod.check=h=>{try{new URL(`http://[${h.value}]`)}catch{h.issues.push({code:"invalid_format",format:"ipv6",input:h.value,inst:d,continue:!p.abort})}}}),$ZodCIDRv4=$constructor("$ZodCIDRv4",(d,p)=>{p.pattern??(p.pattern=cidrv4),$ZodStringFormat.init(d,p)}),$ZodCIDRv6=$constructor("$ZodCIDRv6",(d,p)=>{p.pattern??(p.pattern=cidrv6),$ZodStringFormat.init(d,p),d._zod.check=h=>{const[g,m]=h.value.split("/");try{if(!m)throw new Error;const _=Number(m);if(`${_}`!==m)throw new Error;if(_<0||_>128)throw new Error;new URL(`http://[${g}]`)}catch{h.issues.push({code:"invalid_format",format:"cidrv6",input:h.value,inst:d,continue:!p.abort})}}});function isValidBase64(d){if(d==="")return!0;if(d.length%4!==0)return!1;try{return atob(d),!0}catch{return!1}}const $ZodBase64=$constructor("$ZodBase64",(d,p)=>{p.pattern??(p.pattern=base64),$ZodStringFormat.init(d,p),d._zod.onattach.push(h=>{h._zod.bag.contentEncoding="base64"}),d._zod.check=h=>{isValidBase64(h.value)||h.issues.push({code:"invalid_format",format:"base64",input:h.value,inst:d,continue:!p.abort})}});function isValidBase64URL(d){if(!base64url.test(d))return!1;const p=d.replace(/[-_]/g,g=>g==="-"?"+":"/"),h=p.padEnd(Math.ceil(p.length/4)*4,"=");return isValidBase64(h)}const $ZodBase64URL=$constructor("$ZodBase64URL",(d,p)=>{p.pattern??(p.pattern=base64url),$ZodStringFormat.init(d,p),d._zod.onattach.push(h=>{h._zod.bag.contentEncoding="base64url"}),d._zod.check=h=>{isValidBase64URL(h.value)||h.issues.push({code:"invalid_format",format:"base64url",input:h.value,inst:d,continue:!p.abort})}}),$ZodE164=$constructor("$ZodE164",(d,p)=>{p.pattern??(p.pattern=e164),$ZodStringFormat.init(d,p)});function isValidJWT(d,p=null){try{const h=d.split(".");if(h.length!==3)return!1;const[g]=h;if(!g)return!1;const m=JSON.parse(atob(g));return!("typ"in m&&(m==null?void 0:m.typ)!=="JWT"||!m.alg||p&&(!("alg"in m)||m.alg!==p))}catch{return!1}}const $ZodJWT=$constructor("$ZodJWT",(d,p)=>{$ZodStringFormat.init(d,p),d._zod.check=h=>{isValidJWT(h.value,p.alg)||h.issues.push({code:"invalid_format",format:"jwt",input:h.value,inst:d,continue:!p.abort})}}),$ZodNumber=$constructor("$ZodNumber",(d,p)=>{$ZodType.init(d,p),d._zod.pattern=d._zod.bag.pattern??number$1,d._zod.parse=(h,g)=>{if(p.coerce)try{h.value=Number(h.value)}catch{}const m=h.value;if(typeof m=="number"&&!Number.isNaN(m)&&Number.isFinite(m))return h;const _=typeof m=="number"?Number.isNaN(m)?"NaN":Number.isFinite(m)?void 0:"Infinity":void 0;return h.issues.push({expected:"number",code:"invalid_type",input:m,inst:d,..._?{received:_}:{}}),h}}),$ZodNumberFormat=$constructor("$ZodNumber",(d,p)=>{$ZodCheckNumberFormat.init(d,p),$ZodNumber.init(d,p)}),$ZodBoolean=$constructor("$ZodBoolean",(d,p)=>{$ZodType.init(d,p),d._zod.pattern=boolean$1,d._zod.parse=(h,g)=>{if(p.coerce)try{h.value=!!h.value}catch{}const m=h.value;return typeof m=="boolean"||h.issues.push({expected:"boolean",code:"invalid_type",input:m,inst:d}),h}}),$ZodAny=$constructor("$ZodAny",(d,p)=>{$ZodType.init(d,p),d._zod.parse=h=>h}),$ZodUnknown=$constructor("$ZodUnknown",(d,p)=>{$ZodType.init(d,p),d._zod.parse=h=>h}),$ZodNever=$constructor("$ZodNever",(d,p)=>{$ZodType.init(d,p),d._zod.parse=(h,g)=>(h.issues.push({expected:"never",code:"invalid_type",input:h.value,inst:d}),h)});function handleArrayResult(d,p,h){d.issues.length&&p.issues.push(...prefixIssues(h,d.issues)),p.value[h]=d.value}const $ZodArray=$constructor("$ZodArray",(d,p)=>{$ZodType.init(d,p),d._zod.parse=(h,g)=>{const m=h.value;if(!Array.isArray(m))return h.issues.push({expected:"array",code:"invalid_type",input:m,inst:d}),h;h.value=Array(m.length);const _=[];for(let b=0;b<m.length;b++){const y=m[b],w=p.element._zod.run({value:y,issues:[]},g);w instanceof Promise?_.push(w.then(x=>handleArrayResult(x,h,b))):handleArrayResult(w,h,b)}return _.length?Promise.all(_).then(()=>h):h}});function handleObjectResult(d,p,h){d.issues.length&&p.issues.push(...prefixIssues(h,d.issues)),p.value[h]=d.value}function handleOptionalObjectResult(d,p,h,g){d.issues.length?g[h]===void 0?h in g?p.value[h]=void 0:p.value[h]=d.value:p.issues.push(...prefixIssues(h,d.issues)):d.value===void 0?h in g&&(p.value[h]=void 0):p.value[h]=d.value}const $ZodObject=$constructor("$ZodObject",(d,p)=>{$ZodType.init(d,p);const h=cached(()=>{const S=Object.keys(p.shape);for(const I of S)if(!(p.shape[I]instanceof $ZodType))throw new Error(`Invalid element at key "${I}": expected a Zod schema`);const k=optionalKeys(p.shape);return{shape:p.shape,keys:S,keySet:new Set(S),numKeys:S.length,optionalKeys:new Set(k)}});defineLazy(d._zod,"propValues",()=>{const S=p.shape,k={};for(const I in S){const R=S[I]._zod;if(R.values){k[I]??(k[I]=new Set);for(const M of R.values)k[I].add(M)}}return k});const g=S=>{const k=new Doc(["shape","payload","ctx"]),I=h.value,R=N=>{const $=esc(N);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};k.write("const input = payload.value;");const M=Object.create(null);let A=0;for(const N of I.keys)M[N]=`key_${A++}`;k.write("const newResult = {}");for(const N of I.keys)if(I.optionalKeys.has(N)){const $=M[N];k.write(`const ${$} = ${R(N)};`);const O=esc(N);k.write(`
|
|
@@ -441,7 +441,7 @@ Parameters: ${m}`,inputSchema:record(string(),any()),async execute(_){try{const
|
|
|
441
441
|
}.voice-recording-indicator.svelte-nv4d5v {display:flex;align-items:center;gap:4px;height:24px;}.voice-dot.svelte-nv4d5v {width:4px;height:16px;background:#ef4444;border-radius:2px;
|
|
442
442
|
animation: svelte-nv4d5v-voice-pulse 0.8s ease-in-out infinite;}.voice-dot.svelte-nv4d5v:nth-child(2) {animation-delay:0.15s;}.voice-dot.svelte-nv4d5v:nth-child(3) {animation-delay:0.3s;}.voice-processing.svelte-nv4d5v {display:flex;align-items:center;gap:0.5rem;color:#9ca3af;font-size:13px;}
|
|
443
443
|
@keyframes svelte-nv4d5v-voice-spin { to { transform: rotate(360deg); } }.voice-spinner.svelte-nv4d5v {width:16px;height:16px;border:2px solid #374151;border-top-color:#60a5fa;border-radius:50%;
|
|
444
|
-
animation: svelte-nv4d5v-voice-spin 0.7s linear infinite;flex-shrink:0;}.voice-status-text.svelte-nv4d5v {font-size:12px;color:#9ca3af;margin:0;}.voice-done.svelte-nv4d5v {color:#22c55e;}.voice-done-text.svelte-nv4d5v {color:#22c55e !important;font-weight:500;}.voice-error-icon.svelte-nv4d5v {width:36px;height:36px;border-radius:50%;background:#991b1b;color:white;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;}.voice-error-text.svelte-nv4d5v {color:#f87171 !important;}.voice-reset.svelte-nv4d5v {font-size:12px;color:#60a5fa;background:transparent;border:none;cursor:pointer;text-decoration:underline;font-family:inherit;padding:0;}.voice-footer.svelte-nv4d5v {font-size:11px;color:#4b5563;margin:0;line-height:1.5;}.voice-footer.svelte-nv4d5v strong:where(.svelte-nv4d5v) {color:#6b7280;}`};function FeedbackPanel(d,p){push(p,!0),append_styles(d,$$css$1);const h="3.3.0";let g=prop(p,"endpoint",7),m=prop(p,"project",7),_=prop(p,"isOpen",7,!1),b=prop(p,"userId",7,""),y=prop(p,"userEmail",7,""),w=prop(p,"userName",7,""),x=prop(p,"userRole",7,""),E=prop(p,"orgId",7,""),S=prop(p,"orgName",7,""),k=prop(p,"onclose",7),I=prop(p,"ongrip",7),R=prop(p,"agentProxy",7,""),M=prop(p,"agentModel",7,""),A=prop(p,"agentContext",7,""),C=prop(p,"registeredTools",23,()=>[]),N=state("new"),$=state(!1),O=state(!1),F=state(!1),j=state(proxy([]));function Y(){if(get(F)){const Z=stopRecording();set(j,Z,!0),set(F,!1),dt(`Session recorded (${Z.length} events)`,"success")}else startRecording(),set(j,[],!0),set(F,!0),dt("Recording session...","info")}let q=state(!1),ue=state(!1),oe=state("idle"),ce=state(""),se=state(null),xe=[];async function ve(){var Z;try{const re=await navigator.mediaDevices.getUserMedia({audio:!0}),_e=MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/ogg",ye=new MediaRecorder(re,{mimeType:_e});xe=[],ye.ondataavailable=Fe=>{Fe.data.size>0&&xe.push(Fe.data)},ye.onstop=()=>{re.getTracks().forEach(Fe=>Fe.stop()),ke(new Blob(xe,{type:_e}),_e)},ye.start(500),set(se,ye,!0),set(q,!0),set(oe,"recording"),set(ce,"Recording…")}catch(re){set(oe,"error"),set(ce,(Z=re.message)!=null&&Z.includes("Permission")?"Microphone permission denied":"Could not start recording",!0)}}function Re(){get(se)&&get(se).state!=="inactive"&&get(se).stop(),set(q,!1),set(oe,"processing"),set(ce,"Sending to JAT…")}async function ke(Z,re){set(ue,!0);try{const _e=re.includes("webm")?"webm":re.includes("ogg")?"ogg":"audio",ye=new FormData;ye.append("file",Z,`voice-note.${_e}`);const Fe=`${g()}/api/tasks/voice`,Ue=await fetch(Fe,{method:"POST",body:ye});if(Ue.ok)set(oe,"done"),set(ce,"Done! Tasks will appear in your Voice Inbox shortly.");else{const ut=await Ue.json().catch(()=>({}));set(oe,"error"),set(ce,ut.message||`Error ${Ue.status}`,!0)}}catch(_e){set(oe,"error"),set(ce,_e.message||"Failed to send recording",!0)}finally{set(ue,!1),xe=[]}}function me(){get(se)&&get(se).state!=="inactive"&&get(se).stop(),set(q,!1),set(ue,!1),set(oe,"idle"),set(ce,""),xe=[],set(se,null)}let Ce=state(proxy([])),T=state("idle"),z=state(0),L=state(!1),P=state(null);function G(){return get(P)||set(P,new AgentBridge({proxyUrl:R(),model:M()||void 0,maxSteps:20,appContext:A()||void 0,endpoint:g(),project:m(),registeredTools:C(),onMessagesChange:Z=>{set(Ce,Z,!0)},onStateChange:(Z,re)=>{set(T,Z,!0),set(z,re,!0)}}),!0),get(P)}function W(){var Z;(Z=get(P))==null||Z.invalidateNotesCache()}user_effect(()=>{get(N)==="agent"&&!get($)&&set($,!0)}),user_effect(()=>{get(N)==="notes"&&!get(O)&&set(O,!0)});function ie(Z){G().execute(Z)}function J(){var Z;(Z=get(P))==null||Z.stop()}function ne(Z){var re;(re=get(P))==null||re.approve(Z)}function ge(Z){var re;(re=get(P))==null||re.skip(Z)}function ee(Z){set(L,Z,!0),get(P)&&(get(P).autoApprove=Z)}onDestroy(()=>{var Z;(Z=get(P))==null||Z.dispose()});let he=state(proxy([])),B=state(!1),K=state(""),pe=user_derived(()=>get(he).filter(Z=>Z.status==="completed").length);async function le(){set(B,!0),set(K,"");const Z=await fetchReports(g());set(he,Z.reports,!0),Z.error&&set(K,Z.error,!0),set(B,!1)}user_effect(()=>{g()&&le()});let Ee=state(""),Me=state(""),Se=state("bug"),We=state("medium"),ae=state(proxy([])),V=state(proxy([])),D=state(proxy([])),H=state(proxy([])),X=state(proxy([])),fe=state(void 0);const Q=["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"];function de(){var Z;(Z=get(fe))==null||Z.click()}async function we(Z){const re=Z.target,_e=re.files;if(!(!_e||_e.length===0)){for(const ye of _e)try{const Fe=await Ze(ye);Q.includes(ye.type)?(set(ae,[...get(ae),Fe],!0),dt(`Image added: ${ye.name}`,"success")):(set(V,[...get(V),{name:ye.name,type:ye.type||"application/octet-stream",data:Fe,size:ye.size}],!0),dt(`File attached: ${ye.name}`,"success"))}catch{dt(`Failed to read: ${ye.name}`,"error")}re.value=""}}function Ze(Z){return new Promise((re,_e)=>{const ye=new FileReader;ye.onload=()=>re(ye.result),ye.onerror=()=>_e(ye.error),ye.readAsDataURL(Z)})}function Te(Z){set(V,get(V).filter((re,_e)=>_e!==Z),!0)}function Le(Z){return Z<1024?`${Z}B`:Z<1024*1024?`${(Z/1024).toFixed(1)}KB`:`${(Z/(1024*1024)).toFixed(1)}MB`}let Oe=state(!1),te=state(!1),Qe=state(!1),wt=state(null),Ge=state(!1),Ve=state(null),yt=state(""),Ot=state(void 0),Cn=!1;user_effect(()=>{_()&&!Cn&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{var Z;(Z=get(Ot))==null||Z.focus()})}),get(N)==="new"&&setTimeout(()=>{captureViewportQuick().then(Z=>{get(ae).length===0?set(ae,[Z],!0):set(ae,[Z,...get(ae).slice(1)],!0)}).catch(()=>{})},300)),Cn=_()});let Be=state(""),He=state("success"),xt=state(!1);function dt(Z,re){set(Be,Z,!0),set(He,re,!0),set(xt,!0),setTimeout(()=>{set(xt,!1)},3e3)}async function Wt(){set(te,!0);try{const Z=await captureViewport();set(yt,Z,!0),set(Ve,get(ae).length,!0)}catch(Z){console.error("[jat-feedback] Screenshot failed:",Z),dt("Screenshot failed: "+(Z instanceof Error?Z.message:"unknown error"),"error")}finally{set(te,!1)}}function ar(Z){set(ae,get(ae).filter((re,_e)=>_e!==Z),!0)}function hn(Z){set(yt,get(ae)[Z],!0),set(Ve,Z,!0)}function nn(Z){get(Ve)!==null&&(get(Ve)>=get(ae).length?(set(ae,[...get(ae),Z],!0),dt(`Screenshot captured (${get(ae).length})`,"success")):(set(ae,get(ae).map((re,_e)=>_e===get(Ve)?Z:re),!0),dt("Screenshot updated","success"))),set(Ve,null),set(yt,"")}function In(){get(Ve)!==null&&get(Ve)>=get(ae).length&&(set(ae,[...get(ae),get(yt)],!0),dt(`Screenshot captured (${get(ae).length})`,"success")),set(Ve,null),set(yt,"")}function Fn(){set(Qe,!0),startElementPicker(Z=>{set(D,[...get(D),Z],!0),set(Qe,!1),dt(`Element captured: <${Z.tagName.toLowerCase()}>`,"success")})}function gn(){set(H,getCapturedLogs(),!0),set(X,getCapturedRequests(),!0)}async function lr(Z){if(Z.preventDefault(),!get(Ee).trim())return;set(Oe,!0),gn();const re={};(b()||y()||w()||x())&&(re.reporter={},b()&&(re.reporter.userId=b()),y()&&(re.reporter.email=y()),w()&&(re.reporter.name=w()),x()&&(re.reporter.role=x())),(E()||S())&&(re.organization={},E()&&(re.organization.id=E()),S()&&(re.organization.name=S()));let _e;if(get(j).length>0){const Fe=crypto.randomUUID(),Ue=await uploadRecording(g(),get(j),Fe);Ue.ok&&Ue.recording_url&&(_e=Ue.recording_url)}const ye={title:get(Ee).trim(),description:get(Me).trim(),type:get(Se),priority:get(We),project:m()||"",page_url:window.location.href,user_agent:navigator.userAgent,console_logs:get(H).length>0?get(H):null,network_requests:get(X).length>0?get(X):null,selected_elements:get(D).length>0?get(D):null,recording_events:null,screenshots:get(ae).length>0?get(ae):null,attachments:get(V).length>0?get(V):null,metadata:Object.keys(re).length>0?re:null,recording_url:_e||null};try{const Fe=await submitReport(g(),ye);if(Fe.ok){if(ye.recording_url){const Ue={recording_url:ye.recording_url,console_logs:ye.console_logs,network_requests:ye.network_requests};G().setReportContext(Ue)}set(wt,Fe.id,!0),set(Ge,!!ye.recording_url),dt(`Report submitted (${Fe.id})`,"success"),Kn(),setTimeout(()=>{le(),set(N,"requests")},1200)}else enqueue(g(),ye),dt("Queued for retry (endpoint unreachable)","error")}catch{enqueue(g(),ye),dt("Queued for retry (endpoint unreachable)","error")}finally{set(Oe,!1)}}function Kn(){set(Ee,""),set(Me,""),set(Se,"bug"),set(We,"medium"),set(ae,[],!0),set(V,[],!0),set(D,[],!0),set(H,[],!0),set(X,[],!0),set(j,[],!0),get(F)&&(stopRecording(),set(F,!1))}user_effect(()=>{gn()});function Pn(Z){Z.stopPropagation()}const cr=[{value:"bug",label:"Bug"},{value:"enhancement",label:"Enhancement"},{value:"other",label:"Other"}],Xn=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"critical",label:"Critical"}];function Zn(){return get(ae).length+get(V).length+get(D).length}var Jn={get endpoint(){return g()},set endpoint(Z){g(Z),flushSync()},get project(){return m()},set project(Z){m(Z),flushSync()},get isOpen(){return _()},set isOpen(Z=!1){_(Z),flushSync()},get userId(){return b()},set userId(Z=""){b(Z),flushSync()},get userEmail(){return y()},set userEmail(Z=""){y(Z),flushSync()},get userName(){return w()},set userName(Z=""){w(Z),flushSync()},get userRole(){return x()},set userRole(Z=""){x(Z),flushSync()},get orgId(){return E()},set orgId(Z=""){E(Z),flushSync()},get orgName(){return S()},set orgName(Z=""){S(Z),flushSync()},get onclose(){return k()},set onclose(Z){k(Z),flushSync()},get ongrip(){return I()},set ongrip(Z){I(Z),flushSync()},get agentProxy(){return R()},set agentProxy(Z=""){R(Z),flushSync()},get agentModel(){return M()},set agentModel(Z=""){M(Z),flushSync()},get agentContext(){return A()},set agentContext(Z=""){A(Z),flushSync()},get registeredTools(){return C()},set registeredTools(Z=[]){C(Z),flushSync()}},Qn=root$1(),rn=first_child(Qn),Tn=child(rn),er=child(Tn);{var tr=Z=>{var re=root_1$1();delegated("mousedown",re,function(..._e){var ye;(ye=I())==null||ye.apply(this,_e)}),append(Z,re)};if_block(er,Z=>{I()&&Z(tr)})}var mn=sibling(er,2),Bn=child(mn);let nr;var vn=sibling(Bn,2);let rr;var dr=sibling(child(vn),2);{var Ne=Z=>{var re=root_2$1(),_e=child(re,!0);reset(re),template_effect(()=>set_text(_e,get(pe))),append(Z,re)};if_block(dr,Z=>{get(pe)>0&&Z(Ne)})}reset(vn);var De=sibling(vn,2);{var et=Z=>{var re=root_3();let _e;template_effect(()=>_e=set_class(re,1,"tab svelte-nv4d5v",null,_e,{active:get(N)==="agent"})),delegated("click",re,()=>{set(N,"agent"),set($,!0)}),append(Z,re)};if_block(De,Z=>{R()&&Z(et)})}var pt=sibling(De,2);let Rt;var it=sibling(pt,2);let rt;reset(mn);var qe=sibling(mn,2);reset(Tn);var ht=sibling(Tn,2);{var Ye=Z=>{var re=root_4(),_e=child(re),ye=sibling(child(_e),2);remove_input_defaults(ye),bind_this(ye,be=>set(Ot,be),()=>get(Ot)),reset(_e);var Fe=sibling(_e,2),Ue=sibling(child(Fe),2);remove_textarea_child(Ue),reset(Fe);var ut=sibling(Fe,2),gt=child(ut),_t=sibling(child(gt),2);each(_t,21,()=>cr,index,(be,Ae)=>{var nt=root_5(),at=child(nt,!0);reset(nt);var ot={};template_effect(()=>{set_text(at,get(Ae).label),ot!==(ot=get(Ae).value)&&(nt.value=(nt.__value=get(Ae).value)??"")}),append(be,nt)}),reset(_t),reset(gt);var Gt=sibling(gt,2),st=sibling(child(Gt),2);each(st,21,()=>Xn,index,(be,Ae)=>{var nt=root_6(),at=child(nt,!0);reset(nt);var ot={};template_effect(()=>{set_text(at,get(Ae).label),ot!==(ot=get(Ae).value)&&(nt.value=(nt.__value=get(Ae).value)??"")}),append(be,nt)}),reset(st),reset(Gt),reset(ut);var mt=sibling(ut,2),je=child(mt),Pe=child(je),tt=child(Pe);{var bt=be=>{var Ae=root_7();next(),append(be,Ae)},kt=be=>{var Ae=root_8(),nt=sibling(first_child(Ae),2);{var at=ot=>{var ft=root_9(),Nt=child(ft,!0);reset(ft),template_effect(()=>set_text(Nt,get(ae).length)),append(ot,ft)};if_block(nt,ot=>{get(ae).length>0&&ot(at)})}append(be,Ae)};if_block(tt,be=>{get(te)?be(bt):be(kt,!1)})}reset(Pe);var At=sibling(Pe,2),Nn=sibling(child(At),2);{var jn=be=>{var Ae=text("Click an element...");append(be,Ae)},en=be=>{var Ae=root_11(),nt=sibling(first_child(Ae));{var at=ot=>{var ft=root_12(),Nt=child(ft,!0);reset(ft),template_effect(()=>set_text(Nt,get(D).length)),append(ot,ft)};if_block(nt,ot=>{get(D).length>0&&ot(at)})}append(be,Ae)};if_block(Nn,be=>{get(Qe)?be(jn):be(en,!1)})}reset(At);var Ct=sibling(At,2);let Lt;var $n=child(Ct);{var Fr=be=>{var Ae=root_13();next(),append(be,Ae)},Pr=be=>{var Ae=root_14(),nt=sibling(first_child(Ae),2);{var at=ot=>{var ft=root_15(),Nt=child(ft,!0);reset(ft),template_effect(()=>set_text(Nt,get(j).length)),append(ot,ft)};if_block(nt,ot=>{get(j).length>0&&ot(at)})}append(be,Ae)};if_block($n,be=>{get(F)?be(Fr):be(Pr,!1)})}reset(Ct);var Wn=sibling(Ct,2),Zr=sibling(child(Wn),2);{var Br=be=>{var Ae=root_16(),nt=child(Ae,!0);reset(Ae),template_effect(()=>set_text(nt,get(V).length)),append(be,Ae)};if_block(Zr,be=>{get(V).length>0&&be(Br)})}reset(Wn);var Ir=sibling(Wn,2);bind_this(Ir,be=>set(fe,be),()=>get(fe)),reset(je);var Ur=sibling(je,2);ScreenshotPreview(Ur,{get screenshots(){return get(ae)},get capturing(){return get(te)},oncapture:Wt,onremove:ar,onedit:hn}),reset(mt);var Tr=sibling(mt,2);{var jr=be=>{var Ae=root_17();each(Ae,21,()=>get(V),index,(nt,at,ot)=>{var ft=root_18(),Nt=child(ft),hr=child(Nt);{var Vn=Ft=>{var Hn=root_19();append(Ft,Hn)},gr=user_derived(()=>get(at).type.includes("pdf")),mr=Ft=>{var Hn=root_20();append(Ft,Hn)},bn=user_derived(()=>get(at).type.includes("markdown")||get(at).name.endsWith(".md")),Gn=Ft=>{var Hn=root_21();append(Ft,Hn)};if_block(hr,Ft=>{get(gr)?Ft(Vn):get(bn)?Ft(mr,1):Ft(Gn,!1)})}reset(Nt);var vr=sibling(Nt,2),Xr=child(vr,!0);reset(vr);var _r=sibling(vr,2),Jr=child(_r,!0);reset(_r);var Qr=sibling(_r,2);reset(ft),template_effect(Ft=>{set_text(Xr,get(at).name),set_text(Jr,Ft)},[()=>Le(get(at).size)]),delegated("click",Qr,()=>Te(ot)),append(nt,ft)}),reset(Ae),append(be,Ae)};if_block(Tr,be=>{get(V).length>0&&be(jr)})}var Rr=sibling(Tr,2);{var Wr=be=>{var Ae=root_22();each(Ae,21,()=>get(D),index,(nt,at,ot)=>{var ft=root_23(),Nt=child(ft),hr=child(Nt);reset(Nt);var Vn=sibling(Nt,2),gr=child(Vn,!0);reset(Vn);var mr=sibling(Vn,2);reset(ft),template_effect((bn,Gn)=>{set_text(hr,`<${bn??""}>`),set_text(gr,Gn)},[()=>get(at).tagName.toLowerCase(),()=>{var bn;return((bn=get(at).textContent)==null?void 0:bn.substring(0,40))||get(at).selector}]),delegated("click",mr,()=>{set(D,get(D).filter((bn,Gn)=>Gn!==ot),!0)}),append(nt,ft)}),reset(Ae),append(be,Ae)};if_block(Rr,be=>{get(D).length>0&&be(Wr)})}var Ar=sibling(Rr,2);ConsoleLogList(Ar,{get logs(){return get(H)}});var Nr=sibling(Ar,2);{var Vr=be=>{var Ae=root_24(),nt=child(Ae);reset(Ae),template_effect((at,ot)=>set_text(nt,`${at??""} attachment${ot??""} will be included`),[Zn,()=>Zn()>1?"s":""]),append(be,Ae)},Gr=user_derived(()=>Zn()>0);if_block(Nr,be=>{get(Gr)&&be(Vr)})}var $r=sibling(Nr,2),ur=child($r),Hr=child(ur);reset(ur);var fr=sibling(ur,2),pr=sibling(fr,2),qr=child(pr);{var Yr=be=>{var Ae=root_25();next(),append(be,Ae)},Kr=be=>{var Ae=text("Submit");append(be,Ae)};if_block(qr,be=>{get(Oe)?be(Yr):be(Kr,!1)})}reset(pr),reset($r),reset(re),template_effect(be=>{ye.disabled=get(Oe),Ue.disabled=get(Oe),_t.disabled=get(Oe),st.disabled=get(Oe),Pe.disabled=get(te),At.disabled=get(Qe),Lt=set_class(Ct,1,"tool-btn svelte-nv4d5v",null,Lt,{"recording-active":get(F)}),Ct.disabled=get(Oe),Wn.disabled=get(Oe),set_text(Hr,`v${h}`),fr.disabled=get(Oe),pr.disabled=be},[()=>get(Oe)||!get(Ee).trim()]),event("submit",re,lr),bind_value(ye,()=>get(Ee),be=>set(Ee,be)),bind_value(Ue,()=>get(Me),be=>set(Me,be)),bind_select_value(_t,()=>get(Se),be=>set(Se,be)),bind_select_value(st,()=>get(We),be=>set(We,be)),delegated("click",Pe,Wt),delegated("click",At,Fn),delegated("click",Ct,Y),delegated("click",Wn,de),delegated("change",Ir,we),delegated("click",fr,function(...be){var Ae;(Ae=k())==null||Ae.apply(this,be)}),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(ht,Z=>{get(N)==="new"&&Z(Ye)})}var Et=sibling(ht,2);{var Qt=Z=>{var re=root_27(),_e=child(re);{var ye=Ue=>{var ut=root_28(),gt=sibling(child(ut),4),_t=sibling(gt,2);reset(ut),template_effect(()=>set_attribute(gt,"href",`${g()??""}/feedback/replay.html?id=${get(wt)??""}`)),delegated("click",_t,()=>{set(wt,null),set(Ge,!1)}),append(Ue,ut)};if_block(_e,Ue=>{get(wt)&&get(Ge)&&Ue(ye)})}var Fe=sibling(_e,2);RequestList(Fe,{get endpoint(){return g()},get loading(){return get(B)},get error(){return get(K)},onreload:le,get reports(){return get(he)},set reports(Ue){set(he,Ue,!0)}}),reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(Et,Z=>{get(N)==="requests"&&Z(Qt)})}var Xe=sibling(Et,2);{var sn=Z=>{var re=root_29(),_e=child(re);{let ye=user_derived(()=>{var Fe;return((Fe=get(P))==null?void 0:Fe.getMaxSteps())??20});AgentPanel(_e,{get messages(){return get(Ce)},get agentState(){return get(T)},get currentStep(){return get(z)},get maxSteps(){return get(ye)},get autoApprove(){return get(L)},onsend:ie,onstop:J,onapprove:ne,onskip:ge,onautoapprovechange:ee})}reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(Xe,Z=>{get(N)==="agent"&&get($)&&Z(sn)})}var an=sibling(Xe,2);{var _n=Z=>{var re=root_30(),_e=child(re);NotesPanel(_e,{get endpoint(){return g()},get project(){return m()},onnoteschanged:W}),reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(an,Z=>{get(N)==="notes"&&get(O)&&Z(_n)})}var Vt=sibling(an,2);{var Rn=Z=>{var re=root_31(),_e=child(re),ye=sibling(child(_e),2),Fe=child(ye);{var Ue=je=>{var Pe=root_32();delegated("click",Pe,ve),append(je,Pe)},ut=je=>{var Pe=root_33(),tt=first_child(Pe);next(2),delegated("click",tt,Re),append(je,Pe)},gt=je=>{var Pe=root_34(),tt=sibling(child(Pe),2),bt=child(tt,!0);reset(tt),reset(Pe),template_effect(()=>set_text(bt,get(ce))),append(je,Pe)},_t=je=>{var Pe=root_35(),tt=sibling(first_child(Pe),2),bt=child(tt,!0);reset(tt);var kt=sibling(tt,2);template_effect(()=>set_text(bt,get(ce))),delegated("click",kt,me),append(je,Pe)},Gt=je=>{var Pe=root_36(),tt=sibling(first_child(Pe),2),bt=child(tt,!0);reset(tt);var kt=sibling(tt,2);template_effect(()=>set_text(bt,get(ce))),delegated("click",kt,me),append(je,Pe)};if_block(Fe,je=>{get(oe)==="idle"?je(Ue):get(oe)==="recording"?je(ut,1):get(oe)==="processing"?je(gt,2):get(oe)==="done"?je(_t,3):get(oe)==="error"&&je(Gt,4)})}reset(ye);var st=sibling(ye,2);{var mt=je=>{var Pe=root_37();append(je,Pe)};if_block(st,je=>{get(oe)==="idle"&&je(mt)})}reset(_e),reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(Vt,Z=>{get(N)==="voice"&&Z(Rn)})}var Dt=sibling(Vt,2);StatusToast(Dt,{get message(){return get(Be)},get type(){return get(He)},get visible(){return get(xt)}}),reset(rn);var An=sibling(rn,2);{var Un=Z=>{AnnotationEditor(Z,{get imageDataUrl(){return get(yt)},onsave:nn,oncancel:In})};if_block(An,Z=>{get(Ve)!==null&&Z(Un)})}return template_effect(()=>{nr=set_class(Bn,1,"tab svelte-nv4d5v",null,nr,{active:get(N)==="new"}),rr=set_class(vn,1,"tab svelte-nv4d5v",null,rr,{active:get(N)==="requests"}),Rt=set_class(pt,1,"tab svelte-nv4d5v",null,Rt,{active:get(N)==="notes"}),rt=set_class(it,1,"tab svelte-nv4d5v",null,rt,{active:get(N)==="voice"})}),delegated("keydown",rn,Pn),delegated("keyup",rn,Pn),event("keypress",rn,Pn),delegated("click",Bn,()=>set(N,"new")),delegated("click",vn,()=>set(N,"requests")),delegated("click",pt,()=>{set(N,"notes"),set(O,!0)}),delegated("click",it,()=>set(N,"voice")),delegated("click",qe,function(...Z){var re;(re=k())==null||re.apply(this,Z)}),append(d,Qn),pop(Jn)}delegate(["keydown","keyup","mousedown","click","change"]),create_custom_element(FeedbackPanel,{endpoint:{},project:{},isOpen:{},userId:{},userEmail:{},userName:{},userRole:{},orgId:{},orgName:{},onclose:{},ongrip:{},agentProxy:{},agentModel:{},agentContext:{},registeredTools:{}},[],[],{mode:"open"});var root_1=from_html("<div><!></div>"),root_2=from_html('<div class="jat-feedback-panel svelte-qpyrvv"><div class="no-endpoint svelte-qpyrvv"><p class="svelte-qpyrvv">No endpoint configured.</p> <p class="svelte-qpyrvv">Add the <code class="svelte-qpyrvv">endpoint</code> attribute:</p> <code class="example svelte-qpyrvv"><jat-feedback endpoint="http://localhost:3333"></code></div></div>'),root=from_html('<div class="jat-feedback-root svelte-qpyrvv" data-page-agent-not-interactive=""><!> <!></div>');const $$css={hash:"svelte-qpyrvv",code:`.jat-feedback-root.svelte-qpyrvv {position:fixed;z-index:2147483647;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;}.jat-feedback-panel.svelte-qpyrvv {position:absolute;
|
|
444
|
+
animation: svelte-nv4d5v-voice-spin 0.7s linear infinite;flex-shrink:0;}.voice-status-text.svelte-nv4d5v {font-size:12px;color:#9ca3af;margin:0;}.voice-done.svelte-nv4d5v {color:#22c55e;}.voice-done-text.svelte-nv4d5v {color:#22c55e !important;font-weight:500;}.voice-error-icon.svelte-nv4d5v {width:36px;height:36px;border-radius:50%;background:#991b1b;color:white;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;}.voice-error-text.svelte-nv4d5v {color:#f87171 !important;}.voice-reset.svelte-nv4d5v {font-size:12px;color:#60a5fa;background:transparent;border:none;cursor:pointer;text-decoration:underline;font-family:inherit;padding:0;}.voice-footer.svelte-nv4d5v {font-size:11px;color:#4b5563;margin:0;line-height:1.5;}.voice-footer.svelte-nv4d5v strong:where(.svelte-nv4d5v) {color:#6b7280;}`};function FeedbackPanel(d,p){push(p,!0),append_styles(d,$$css$1);const h="3.3.1";let g=prop(p,"endpoint",7),m=prop(p,"project",7),_=prop(p,"isOpen",7,!1),b=prop(p,"userId",7,""),y=prop(p,"userEmail",7,""),w=prop(p,"userName",7,""),x=prop(p,"userRole",7,""),E=prop(p,"orgId",7,""),S=prop(p,"orgName",7,""),k=prop(p,"onclose",7),I=prop(p,"ongrip",7),R=prop(p,"agentProxy",7,""),M=prop(p,"agentModel",7,""),A=prop(p,"agentContext",7,""),C=prop(p,"registeredTools",23,()=>[]),N=state("new"),$=state(!1),O=state(!1),F=state(!1),j=state(proxy([]));function Y(){if(get(F)){const Z=stopRecording();set(j,Z,!0),set(F,!1),dt(`Session recorded (${Z.length} events)`,"success")}else startRecording(),set(j,[],!0),set(F,!0),dt("Recording session...","info")}let q=state(!1),ue=state(!1),oe=state("idle"),ce=state(""),se=state(null),xe=[];async function ve(){var Z;try{const re=await navigator.mediaDevices.getUserMedia({audio:!0}),_e=MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/ogg",ye=new MediaRecorder(re,{mimeType:_e});xe=[],ye.ondataavailable=De=>{De.data.size>0&&xe.push(De.data)},ye.onstop=()=>{re.getTracks().forEach(De=>De.stop()),ke(new Blob(xe,{type:_e}),_e)},ye.start(500),set(se,ye,!0),set(q,!0),set(oe,"recording"),set(ce,"Recording…")}catch(re){set(oe,"error"),set(ce,(Z=re.message)!=null&&Z.includes("Permission")?"Microphone permission denied":"Could not start recording",!0)}}function Re(){get(se)&&get(se).state!=="inactive"&&get(se).stop(),set(q,!1),set(oe,"processing"),set(ce,"Sending to JAT…")}async function ke(Z,re){set(ue,!0);try{const _e=re.includes("webm")?"webm":re.includes("ogg")?"ogg":"audio",ye=new FormData;ye.append("file",Z,`voice-note.${_e}`);const De=`${g()}/api/tasks/voice`,Ue=await fetch(De,{method:"POST",body:ye});if(Ue.ok)set(oe,"done"),set(ce,"Done! Tasks will appear in your Voice Inbox shortly.");else{const ut=await Ue.json().catch(()=>({}));set(oe,"error"),set(ce,ut.message||`Error ${Ue.status}`,!0)}}catch(_e){set(oe,"error"),set(ce,_e.message||"Failed to send recording",!0)}finally{set(ue,!1),xe=[]}}function me(){get(se)&&get(se).state!=="inactive"&&get(se).stop(),set(q,!1),set(ue,!1),set(oe,"idle"),set(ce,""),xe=[],set(se,null)}let Ce=state(proxy([])),T=state("idle"),z=state(0),L=state(!1),P=state(null);function G(){return get(P)||set(P,new AgentBridge({proxyUrl:R(),model:M()||void 0,maxSteps:20,appContext:A()||void 0,endpoint:g(),project:m(),registeredTools:C(),onMessagesChange:Z=>{set(Ce,Z,!0)},onStateChange:(Z,re)=>{set(T,Z,!0),set(z,re,!0)}}),!0),get(P)}function W(){var Z;(Z=get(P))==null||Z.invalidateNotesCache()}user_effect(()=>{get(N)==="agent"&&!get($)&&set($,!0)}),user_effect(()=>{get(N)==="notes"&&!get(O)&&set(O,!0)});function ie(Z){G().execute(Z)}function J(){var Z;(Z=get(P))==null||Z.stop()}function ne(Z){var re;(re=get(P))==null||re.approve(Z)}function ge(Z){var re;(re=get(P))==null||re.skip(Z)}function ee(Z){set(L,Z,!0),get(P)&&(get(P).autoApprove=Z)}onDestroy(()=>{var Z;(Z=get(P))==null||Z.dispose()});let he=state(proxy([])),B=state(!1),K=state(""),pe=user_derived(()=>get(he).filter(Z=>Z.status==="completed").length);async function le(){set(B,!0),set(K,"");const Z=await fetchReports(g());set(he,Z.reports,!0),Z.error&&set(K,Z.error,!0),set(B,!1)}user_effect(()=>{g()&&le()});let Ee=state(""),Me=state(""),Se=state("bug"),We=state("medium"),ae=state(proxy([])),V=state(proxy([])),D=state(proxy([])),H=state(proxy([])),X=state(proxy([])),fe=state(void 0);const Q=["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"];function de(){var Z;(Z=get(fe))==null||Z.click()}async function we(Z){const re=Z.target,_e=re.files;if(!(!_e||_e.length===0)){for(const ye of _e)try{const De=await Ze(ye);Q.includes(ye.type)?(set(ae,[...get(ae),De],!0),dt(`Image added: ${ye.name}`,"success")):(set(V,[...get(V),{name:ye.name,type:ye.type||"application/octet-stream",data:De,size:ye.size}],!0),dt(`File attached: ${ye.name}`,"success"))}catch{dt(`Failed to read: ${ye.name}`,"error")}re.value=""}}function Ze(Z){return new Promise((re,_e)=>{const ye=new FileReader;ye.onload=()=>re(ye.result),ye.onerror=()=>_e(ye.error),ye.readAsDataURL(Z)})}function Te(Z){set(V,get(V).filter((re,_e)=>_e!==Z),!0)}function Fe(Z){return Z<1024?`${Z}B`:Z<1024*1024?`${(Z/1024).toFixed(1)}KB`:`${(Z/(1024*1024)).toFixed(1)}MB`}let Oe=state(!1),te=state(!1),Qe=state(!1),wt=state(null),Ge=state(!1),Ve=state(null),yt=state(""),Ot=state(void 0),Cn=!1;user_effect(()=>{_()&&!Cn&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{var Z;(Z=get(Ot))==null||Z.focus()})}),get(N)==="new"&&setTimeout(()=>{captureViewportQuick().then(Z=>{get(ae).length===0?set(ae,[Z],!0):set(ae,[Z,...get(ae).slice(1)],!0)}).catch(()=>{})},300)),Cn=_()});let Be=state(""),He=state("success"),xt=state(!1);function dt(Z,re){set(Be,Z,!0),set(He,re,!0),set(xt,!0),setTimeout(()=>{set(xt,!1)},3e3)}async function Wt(){set(te,!0);try{const Z=await captureViewport();set(yt,Z,!0),set(Ve,get(ae).length,!0)}catch(Z){console.error("[jat-feedback] Screenshot failed:",Z),dt("Screenshot failed: "+(Z instanceof Error?Z.message:"unknown error"),"error")}finally{set(te,!1)}}function lr(Z){set(ae,get(ae).filter((re,_e)=>_e!==Z),!0)}function hn(Z){set(yt,get(ae)[Z],!0),set(Ve,Z,!0)}function nn(Z){get(Ve)!==null&&(get(Ve)>=get(ae).length?(set(ae,[...get(ae),Z],!0),dt(`Screenshot captured (${get(ae).length})`,"success")):(set(ae,get(ae).map((re,_e)=>_e===get(Ve)?Z:re),!0),dt("Screenshot updated","success"))),set(Ve,null),set(yt,"")}function In(){get(Ve)!==null&&get(Ve)>=get(ae).length&&(set(ae,[...get(ae),get(yt)],!0),dt(`Screenshot captured (${get(ae).length})`,"success")),set(Ve,null),set(yt,"")}function Fn(){set(Qe,!0),startElementPicker(Z=>{set(D,[...get(D),Z],!0),set(Qe,!1),dt(`Element captured: <${Z.tagName.toLowerCase()}>`,"success")})}function gn(){set(H,getCapturedLogs(),!0),set(X,getCapturedRequests(),!0)}async function cr(Z){if(Z.preventDefault(),!get(Ee).trim())return;set(Oe,!0),gn();const re={};if((b()||y()||w()||x())&&(re.reporter={},b()&&(re.reporter.userId=b()),y()&&(re.reporter.email=y()),w()&&(re.reporter.name=w()),x()&&(re.reporter.role=x())),(E()||S())&&(re.organization={},E()&&(re.organization.id=E()),S()&&(re.organization.name=S())),get(F)){const De=stopRecording();set(j,De,!0),set(F,!1)}let _e;if(get(j).length>0){const De=crypto.randomUUID(),Ue=await uploadRecording(g(),get(j),De);Ue.ok&&Ue.recording_url&&(_e=Ue.recording_url)}const ye={title:get(Ee).trim(),description:get(Me).trim(),type:get(Se),priority:get(We),project:m()||"",page_url:window.location.href,user_agent:navigator.userAgent,console_logs:get(H).length>0?get(H):null,network_requests:get(X).length>0?get(X):null,selected_elements:get(D).length>0?get(D):null,recording_events:null,screenshots:get(ae).length>0?get(ae):null,attachments:get(V).length>0?get(V):null,metadata:Object.keys(re).length>0?re:null,recording_url:_e||null};try{const De=await submitReport(g(),ye);if(De.ok){if(ye.recording_url){const Ue={recording_url:ye.recording_url,console_logs:ye.console_logs,network_requests:ye.network_requests};G().setReportContext(Ue)}set(wt,De.id,!0),set(Ge,!!ye.recording_url),dt(`Report submitted (${De.id})`,"success"),Kn(),setTimeout(()=>{le(),set(N,"requests")},1200)}else enqueue(g(),ye),dt("Queued for retry (endpoint unreachable)","error")}catch{enqueue(g(),ye),dt("Queued for retry (endpoint unreachable)","error")}finally{set(Oe,!1)}}function Kn(){set(Ee,""),set(Me,""),set(Se,"bug"),set(We,"medium"),set(ae,[],!0),set(V,[],!0),set(D,[],!0),set(H,[],!0),set(X,[],!0),set(j,[],!0),get(F)&&(stopRecording(),set(F,!1))}user_effect(()=>{gn()});function Pn(Z){Z.stopPropagation()}const dr=[{value:"bug",label:"Bug"},{value:"enhancement",label:"Enhancement"},{value:"other",label:"Other"}],Xn=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"critical",label:"Critical"}];function Zn(){return get(ae).length+get(V).length+get(D).length}var Jn={get endpoint(){return g()},set endpoint(Z){g(Z),flushSync()},get project(){return m()},set project(Z){m(Z),flushSync()},get isOpen(){return _()},set isOpen(Z=!1){_(Z),flushSync()},get userId(){return b()},set userId(Z=""){b(Z),flushSync()},get userEmail(){return y()},set userEmail(Z=""){y(Z),flushSync()},get userName(){return w()},set userName(Z=""){w(Z),flushSync()},get userRole(){return x()},set userRole(Z=""){x(Z),flushSync()},get orgId(){return E()},set orgId(Z=""){E(Z),flushSync()},get orgName(){return S()},set orgName(Z=""){S(Z),flushSync()},get onclose(){return k()},set onclose(Z){k(Z),flushSync()},get ongrip(){return I()},set ongrip(Z){I(Z),flushSync()},get agentProxy(){return R()},set agentProxy(Z=""){R(Z),flushSync()},get agentModel(){return M()},set agentModel(Z=""){M(Z),flushSync()},get agentContext(){return A()},set agentContext(Z=""){A(Z),flushSync()},get registeredTools(){return C()},set registeredTools(Z=[]){C(Z),flushSync()}},Qn=root$1(),rn=first_child(Qn),Tn=child(rn),er=child(Tn);{var tr=Z=>{var re=root_1$1();delegated("mousedown",re,function(..._e){var ye;(ye=I())==null||ye.apply(this,_e)}),append(Z,re)};if_block(er,Z=>{I()&&Z(tr)})}var mn=sibling(er,2),Bn=child(mn);let nr;var vn=sibling(Bn,2);let rr;var ur=sibling(child(vn),2);{var Ne=Z=>{var re=root_2$1(),_e=child(re,!0);reset(re),template_effect(()=>set_text(_e,get(pe))),append(Z,re)};if_block(ur,Z=>{get(pe)>0&&Z(Ne)})}reset(vn);var Le=sibling(vn,2);{var et=Z=>{var re=root_3();let _e;template_effect(()=>_e=set_class(re,1,"tab svelte-nv4d5v",null,_e,{active:get(N)==="agent"})),delegated("click",re,()=>{set(N,"agent"),set($,!0)}),append(Z,re)};if_block(Le,Z=>{R()&&Z(et)})}var pt=sibling(Le,2);let Rt;var it=sibling(pt,2);let rt;reset(mn);var qe=sibling(mn,2);reset(Tn);var ht=sibling(Tn,2);{var Ye=Z=>{var re=root_4(),_e=child(re),ye=sibling(child(_e),2);remove_input_defaults(ye),bind_this(ye,be=>set(Ot,be),()=>get(Ot)),reset(_e);var De=sibling(_e,2),Ue=sibling(child(De),2);remove_textarea_child(Ue),reset(De);var ut=sibling(De,2),gt=child(ut),_t=sibling(child(gt),2);each(_t,21,()=>dr,index,(be,Ae)=>{var nt=root_5(),at=child(nt,!0);reset(nt);var ot={};template_effect(()=>{set_text(at,get(Ae).label),ot!==(ot=get(Ae).value)&&(nt.value=(nt.__value=get(Ae).value)??"")}),append(be,nt)}),reset(_t),reset(gt);var Gt=sibling(gt,2),st=sibling(child(Gt),2);each(st,21,()=>Xn,index,(be,Ae)=>{var nt=root_6(),at=child(nt,!0);reset(nt);var ot={};template_effect(()=>{set_text(at,get(Ae).label),ot!==(ot=get(Ae).value)&&(nt.value=(nt.__value=get(Ae).value)??"")}),append(be,nt)}),reset(st),reset(Gt),reset(ut);var mt=sibling(ut,2),je=child(mt),Pe=child(je),tt=child(Pe);{var bt=be=>{var Ae=root_7();next(),append(be,Ae)},kt=be=>{var Ae=root_8(),nt=sibling(first_child(Ae),2);{var at=ot=>{var ft=root_9(),Nt=child(ft,!0);reset(ft),template_effect(()=>set_text(Nt,get(ae).length)),append(ot,ft)};if_block(nt,ot=>{get(ae).length>0&&ot(at)})}append(be,Ae)};if_block(tt,be=>{get(te)?be(bt):be(kt,!1)})}reset(Pe);var At=sibling(Pe,2),Nn=sibling(child(At),2);{var jn=be=>{var Ae=text("Click an element...");append(be,Ae)},en=be=>{var Ae=root_11(),nt=sibling(first_child(Ae));{var at=ot=>{var ft=root_12(),Nt=child(ft,!0);reset(ft),template_effect(()=>set_text(Nt,get(D).length)),append(ot,ft)};if_block(nt,ot=>{get(D).length>0&&ot(at)})}append(be,Ae)};if_block(Nn,be=>{get(Qe)?be(jn):be(en,!1)})}reset(At);var Ct=sibling(At,2);let Lt;var $n=child(Ct);{var Fr=be=>{var Ae=root_13();next(),append(be,Ae)},Pr=be=>{var Ae=root_14(),nt=sibling(first_child(Ae),2);{var at=ot=>{var ft=root_15(),Nt=child(ft,!0);reset(ft),template_effect(()=>set_text(Nt,get(j).length)),append(ot,ft)};if_block(nt,ot=>{get(j).length>0&&ot(at)})}append(be,Ae)};if_block($n,be=>{get(F)?be(Fr):be(Pr,!1)})}reset(Ct);var Wn=sibling(Ct,2),Zr=sibling(child(Wn),2);{var Br=be=>{var Ae=root_16(),nt=child(Ae,!0);reset(Ae),template_effect(()=>set_text(nt,get(V).length)),append(be,Ae)};if_block(Zr,be=>{get(V).length>0&&be(Br)})}reset(Wn);var Ir=sibling(Wn,2);bind_this(Ir,be=>set(fe,be),()=>get(fe)),reset(je);var Ur=sibling(je,2);ScreenshotPreview(Ur,{get screenshots(){return get(ae)},get capturing(){return get(te)},oncapture:Wt,onremove:lr,onedit:hn}),reset(mt);var Tr=sibling(mt,2);{var jr=be=>{var Ae=root_17();each(Ae,21,()=>get(V),index,(nt,at,ot)=>{var ft=root_18(),Nt=child(ft),hr=child(Nt);{var Vn=Ft=>{var Hn=root_19();append(Ft,Hn)},gr=user_derived(()=>get(at).type.includes("pdf")),mr=Ft=>{var Hn=root_20();append(Ft,Hn)},bn=user_derived(()=>get(at).type.includes("markdown")||get(at).name.endsWith(".md")),Gn=Ft=>{var Hn=root_21();append(Ft,Hn)};if_block(hr,Ft=>{get(gr)?Ft(Vn):get(bn)?Ft(mr,1):Ft(Gn,!1)})}reset(Nt);var vr=sibling(Nt,2),Xr=child(vr,!0);reset(vr);var _r=sibling(vr,2),Jr=child(_r,!0);reset(_r);var Qr=sibling(_r,2);reset(ft),template_effect(Ft=>{set_text(Xr,get(at).name),set_text(Jr,Ft)},[()=>Fe(get(at).size)]),delegated("click",Qr,()=>Te(ot)),append(nt,ft)}),reset(Ae),append(be,Ae)};if_block(Tr,be=>{get(V).length>0&&be(jr)})}var Rr=sibling(Tr,2);{var Wr=be=>{var Ae=root_22();each(Ae,21,()=>get(D),index,(nt,at,ot)=>{var ft=root_23(),Nt=child(ft),hr=child(Nt);reset(Nt);var Vn=sibling(Nt,2),gr=child(Vn,!0);reset(Vn);var mr=sibling(Vn,2);reset(ft),template_effect((bn,Gn)=>{set_text(hr,`<${bn??""}>`),set_text(gr,Gn)},[()=>get(at).tagName.toLowerCase(),()=>{var bn;return((bn=get(at).textContent)==null?void 0:bn.substring(0,40))||get(at).selector}]),delegated("click",mr,()=>{set(D,get(D).filter((bn,Gn)=>Gn!==ot),!0)}),append(nt,ft)}),reset(Ae),append(be,Ae)};if_block(Rr,be=>{get(D).length>0&&be(Wr)})}var Ar=sibling(Rr,2);ConsoleLogList(Ar,{get logs(){return get(H)}});var Nr=sibling(Ar,2);{var Vr=be=>{var Ae=root_24(),nt=child(Ae);reset(Ae),template_effect((at,ot)=>set_text(nt,`${at??""} attachment${ot??""} will be included`),[Zn,()=>Zn()>1?"s":""]),append(be,Ae)},Gr=user_derived(()=>Zn()>0);if_block(Nr,be=>{get(Gr)&&be(Vr)})}var $r=sibling(Nr,2),fr=child($r),Hr=child(fr);reset(fr);var pr=sibling(fr,2),or=sibling(pr,2),qr=child(or);{var Yr=be=>{var Ae=root_25();next(),append(be,Ae)},Kr=be=>{var Ae=text("Submit");append(be,Ae)};if_block(qr,be=>{get(Oe)?be(Yr):be(Kr,!1)})}reset(or),reset($r),reset(re),template_effect(be=>{ye.disabled=get(Oe),Ue.disabled=get(Oe),_t.disabled=get(Oe),st.disabled=get(Oe),Pe.disabled=get(te),At.disabled=get(Qe),Lt=set_class(Ct,1,"tool-btn svelte-nv4d5v",null,Lt,{"recording-active":get(F)}),Ct.disabled=get(Oe),Wn.disabled=get(Oe),set_text(Hr,`v${h}`),pr.disabled=get(Oe),or.disabled=be,set_attribute(or,"title",get(F)?"Stop recording first, or click Submit to auto-stop":"")},[()=>get(Oe)||!get(Ee).trim()]),event("submit",re,cr),bind_value(ye,()=>get(Ee),be=>set(Ee,be)),bind_value(Ue,()=>get(Me),be=>set(Me,be)),bind_select_value(_t,()=>get(Se),be=>set(Se,be)),bind_select_value(st,()=>get(We),be=>set(We,be)),delegated("click",Pe,Wt),delegated("click",At,Fn),delegated("click",Ct,Y),delegated("click",Wn,de),delegated("change",Ir,we),delegated("click",pr,function(...be){var Ae;(Ae=k())==null||Ae.apply(this,be)}),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(ht,Z=>{get(N)==="new"&&Z(Ye)})}var Et=sibling(ht,2);{var Qt=Z=>{var re=root_27(),_e=child(re);{var ye=Ue=>{var ut=root_28(),gt=sibling(child(ut),4),_t=sibling(gt,2);reset(ut),template_effect(()=>set_attribute(gt,"href",`${g()??""}/feedback/replay.html?id=${get(wt)??""}`)),delegated("click",_t,()=>{set(wt,null),set(Ge,!1)}),append(Ue,ut)};if_block(_e,Ue=>{get(wt)&&get(Ge)&&Ue(ye)})}var De=sibling(_e,2);RequestList(De,{get endpoint(){return g()},get loading(){return get(B)},get error(){return get(K)},onreload:le,get reports(){return get(he)},set reports(Ue){set(he,Ue,!0)}}),reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(Et,Z=>{get(N)==="requests"&&Z(Qt)})}var Xe=sibling(Et,2);{var sn=Z=>{var re=root_29(),_e=child(re);{let ye=user_derived(()=>{var De;return((De=get(P))==null?void 0:De.getMaxSteps())??20});AgentPanel(_e,{get messages(){return get(Ce)},get agentState(){return get(T)},get currentStep(){return get(z)},get maxSteps(){return get(ye)},get autoApprove(){return get(L)},onsend:ie,onstop:J,onapprove:ne,onskip:ge,onautoapprovechange:ee})}reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(Xe,Z=>{get(N)==="agent"&&get($)&&Z(sn)})}var an=sibling(Xe,2);{var _n=Z=>{var re=root_30(),_e=child(re);NotesPanel(_e,{get endpoint(){return g()},get project(){return m()},onnoteschanged:W}),reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(an,Z=>{get(N)==="notes"&&get(O)&&Z(_n)})}var Vt=sibling(an,2);{var Rn=Z=>{var re=root_31(),_e=child(re),ye=sibling(child(_e),2),De=child(ye);{var Ue=je=>{var Pe=root_32();delegated("click",Pe,ve),append(je,Pe)},ut=je=>{var Pe=root_33(),tt=first_child(Pe);next(2),delegated("click",tt,Re),append(je,Pe)},gt=je=>{var Pe=root_34(),tt=sibling(child(Pe),2),bt=child(tt,!0);reset(tt),reset(Pe),template_effect(()=>set_text(bt,get(ce))),append(je,Pe)},_t=je=>{var Pe=root_35(),tt=sibling(first_child(Pe),2),bt=child(tt,!0);reset(tt);var kt=sibling(tt,2);template_effect(()=>set_text(bt,get(ce))),delegated("click",kt,me),append(je,Pe)},Gt=je=>{var Pe=root_36(),tt=sibling(first_child(Pe),2),bt=child(tt,!0);reset(tt);var kt=sibling(tt,2);template_effect(()=>set_text(bt,get(ce))),delegated("click",kt,me),append(je,Pe)};if_block(De,je=>{get(oe)==="idle"?je(Ue):get(oe)==="recording"?je(ut,1):get(oe)==="processing"?je(gt,2):get(oe)==="done"?je(_t,3):get(oe)==="error"&&je(Gt,4)})}reset(ye);var st=sibling(ye,2);{var mt=je=>{var Pe=root_37();append(je,Pe)};if_block(st,je=>{get(oe)==="idle"&&je(mt)})}reset(_e),reset(re),transition(3,re,()=>slide,()=>({duration:200})),append(Z,re)};if_block(Vt,Z=>{get(N)==="voice"&&Z(Rn)})}var Dt=sibling(Vt,2);StatusToast(Dt,{get message(){return get(Be)},get type(){return get(He)},get visible(){return get(xt)}}),reset(rn);var An=sibling(rn,2);{var Un=Z=>{AnnotationEditor(Z,{get imageDataUrl(){return get(yt)},onsave:nn,oncancel:In})};if_block(An,Z=>{get(Ve)!==null&&Z(Un)})}return template_effect(()=>{nr=set_class(Bn,1,"tab svelte-nv4d5v",null,nr,{active:get(N)==="new"}),rr=set_class(vn,1,"tab svelte-nv4d5v",null,rr,{active:get(N)==="requests"}),Rt=set_class(pt,1,"tab svelte-nv4d5v",null,Rt,{active:get(N)==="notes"}),rt=set_class(it,1,"tab svelte-nv4d5v",null,rt,{active:get(N)==="voice"})}),delegated("keydown",rn,Pn),delegated("keyup",rn,Pn),event("keypress",rn,Pn),delegated("click",Bn,()=>set(N,"new")),delegated("click",vn,()=>set(N,"requests")),delegated("click",pt,()=>{set(N,"notes"),set(O,!0)}),delegated("click",it,()=>set(N,"voice")),delegated("click",qe,function(...Z){var re;(re=k())==null||re.apply(this,Z)}),append(d,Qn),pop(Jn)}delegate(["keydown","keyup","mousedown","click","change"]),create_custom_element(FeedbackPanel,{endpoint:{},project:{},isOpen:{},userId:{},userEmail:{},userName:{},userRole:{},orgId:{},orgName:{},onclose:{},ongrip:{},agentProxy:{},agentModel:{},agentContext:{},registeredTools:{}},[],[],{mode:"open"});var root_1=from_html("<div><!></div>"),root_2=from_html('<div class="jat-feedback-panel svelte-qpyrvv"><div class="no-endpoint svelte-qpyrvv"><p class="svelte-qpyrvv">No endpoint configured.</p> <p class="svelte-qpyrvv">Add the <code class="svelte-qpyrvv">endpoint</code> attribute:</p> <code class="example svelte-qpyrvv"><jat-feedback endpoint="http://localhost:3333"></code></div></div>'),root=from_html('<div class="jat-feedback-root svelte-qpyrvv" data-page-agent-not-interactive=""><!> <!></div>');const $$css={hash:"svelte-qpyrvv",code:`.jat-feedback-root.svelte-qpyrvv {position:fixed;z-index:2147483647;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;}.jat-feedback-panel.svelte-qpyrvv {position:absolute;
|
|
445
445
|
animation: svelte-qpyrvv-panel-in 0.2s ease;}.jat-feedback-panel.hidden.svelte-qpyrvv {display:none;}.jat-feedback-panel.dragging.svelte-qpyrvv {pointer-events:none;opacity:0.9;}.no-endpoint.svelte-qpyrvv {width:320px;background:#111827;border:1px solid #374151;border-radius:12px;padding:20px;color:#d1d5db;font-size:13px;box-shadow:0 20px 60px rgba(0,0,0,0.4);}.no-endpoint.svelte-qpyrvv p:where(.svelte-qpyrvv) {margin:0 0 8px;}.no-endpoint.svelte-qpyrvv code:where(.svelte-qpyrvv) {font-family:'SF Mono', 'Fira Code', monospace;font-size:11px;color:#93c5fd;}.no-endpoint.svelte-qpyrvv code.example:where(.svelte-qpyrvv) {display:block;background:#1f2937;padding:8px 10px;border-radius:4px;margin-top:4px;}
|
|
446
446
|
@keyframes svelte-qpyrvv-panel-in {
|
|
447
447
|
from { opacity: 0; transform: translateY(8px) scale(0.96); }
|