import{r as t,h as s,H as i}from"./p-bace3d90.js";import"./p-7bff44eb.js";import{c as r}from"./p-053ca481.js";import"./p-0bc4f624.js";import{s as a}from"./p-e2d30bd7.js";const e=class{constructor(s){t(this,s),this.data=null}async componentWillLoad(){this.query&&this.fetchData()}async fetchData(){this.data=await r.client.query({query:a(this.query)})}renderData(){if(!this.query)return"No query.";if(this.renderer)this.data||this.renderer({loading:!0}),this.data&&this.renderer({loading:!1,data:this.data});else{if(!this.data)return"Loading...";if(this.data)return JSON.stringify(this.data)}}render(){return s(i,null,this.renderData())}static get watchers(){return{query:["fetchData"]}}};export{e as corejam_data_fetcher}