@quidgest/chatbot 0.5.5 → 0.5.7
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/index.js +5 -5
- package/dist/index.mjs +68 -61
- package/dist/utils/string.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ChatToolBar/ChatToolBar.vue +1 -0
- package/src/components/FieldPreview/FieldPreview.vue +5 -1
- package/src/components/FieldPreview/__tests__/__snapshots__/FieldPreview.spec.ts.snap +1 -1
- package/src/utils/string.ts +6 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(e,K){typeof exports=="object"&&typeof module<"u"?module.exports=K(require("vue"),require("axios"),require("markdown-it")):typeof define=="function"&&define.amd?define(["vue","axios","markdown-it"],K):(e=typeof globalThis<"u"?globalThis:e||self,e.ChatBotFrontend=K(e.vue,e.axios,e.MarkdownIt))})(this,function(e,K,st){"use strict";function he(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}function Ae(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ye(t={},o={}){const n={},a=new Set([...Object.keys(t),...Object.keys(o)]);for(const l of a){if(l==="__proto__"||l==="constructor"||l==="prototype")continue;const r=t[l],i=o[l];Ae(r)&&Ae(i)?n[l]=ye(r,i):n[l]=i!==void 0?i:r}return n}const Ie="q-defaults";function ct(){var t,o;const n=e.getCurrentInstance();if(!n)throw new Error("[Quidgest UI] useDefaults must be called from inside a setup function");const a=n.type.name??n.type.__name;if(!a)throw new Error("[Quidgest UI] Could not determine component name");const l=De(),r=(t=l.value)==null?void 0:t.Global,i=(o=l.value)==null?void 0:o[a];return e.computed(()=>ye(r,i))}function dt(t){if(he(t))return;const o=De(),n=e.ref(t),a=e.computed(()=>he(n.value)?o.value:ye(o.value,n.value));e.provide(Ie,a)}function De(){const t=e.inject(Ie,void 0);if(!t)throw new Error("[Quidgest UI] Could not find defaults instance");return t}const ut=["id"],pt=e.defineComponent({__name:"QSpinnerLoader",props:{id:{},class:{},size:{default:48}},setup(t){const o=t,n=e.computed(()=>({"font-size":o.size!==48?`${o.size}px`:void 0}));return(a,l)=>(e.openBlock(),e.createElementBlock("div",{id:o.id,class:e.normalizeClass(["q-spinner-loader",o.class]),style:e.normalizeStyle(n.value)},null,14,ut))}});function ft(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([0-9])([a-zA-Z])/g,"$1 $2").replace(/([a-zA-Z])([0-9])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").trim().split(/\s+/)}function mt(t){return ft(t).join("-").toLowerCase()}function gt(t,o){var n;const a=mt(o);return a?typeof((n=t.props)==null?void 0:n[a])<"u":!1}function T(t){const o=t,n=o.setup;return n&&(o.setup=(a,l)=>{const r=ct();if(he(r.value))return n(a,l);const i=e.getCurrentInstance();if(i===null)return n(a,l);const s=new Proxy(a,{get(u,d){var f;const c=Reflect.get(u,d),m=(f=r.value)==null?void 0:f[d];return typeof d=="string"&&!gt(i.vnode,d)?m??c:c}});return n(s,l)}),t}const bt=T(pt);function ht(t,o=!1){return o?/^#[a-fA-F0-9]{6}$/.test(t):/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t)}function yt(t){const o=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(o){const n=parseInt(o[1],10),a=parseInt(o[2],10),l=parseInt(o[3],10);return{r:n,g:a,b:l}}}function wt(t){if(ht(t)){t.length===4&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const o=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return{r:o,g:n,b:a}}else{const o=yt(t);if(o)return o}throw new Error("Invalid color format")}function kt(t,o){const n=Re(t),a=o/100;return n.l=n.l-a*n.l,_t(n)}function Bt(t){const o=t.r.toString(16).padStart(2,"0"),n=t.g.toString(16).padStart(2,"0"),a=t.b.toString(16).padStart(2,"0");return`#${o}${n}${a}`}function Ve(t){return`${t.r} ${t.g} ${t.b}`}function Re(t){const o=t.r/255,n=t.g/255,a=t.b/255,l=Math.max(o,n,a),r=Math.min(o,n,a);let i=0,s;const u=(l+r)/2;if(l===r)i=s=0;else{const d=l-r;switch(s=u>.5?d/(2-l-r):d/(l+r),l){case o:i=(n-a)/d+(n<a?6:0);break;case n:i=(a-o)/d+2;break;case a:i=(o-n)/d+4;break}i/=6}return{h:Math.round(i*360),s:Math.round(s*100),l:Math.round(u*100)}}function _t(t){const o=t.h/360,n=t.s/100,a=t.l/100;let l,r,i;if(n===0)l=r=i=a;else{const s=a<.5?a*(1+n):a+n-a*n,u=2*a-s;l=we(u,s,o+1/3),r=we(u,s,o),i=we(u,s,o-1/3)}return{r:Math.round(l*255),g:Math.round(r*255),b:Math.round(i*255)}}function we(t,o,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(o-t)*6*n:n<1/2?o:n<2/3?t+(o-t)*(2/3-n)*6:t}function Ct(t){return t>50?"#000":"#fff"}const xt=Symbol.for("q-theme");function Me(){const t=e.inject(xt);if(!t)throw new Error("[Quidgest UI] Could not find theme instance");return t}function Le(t){const o=e.computed(()=>e.unref(t)),n=e.computed(()=>o.value?!Et(o.value):!1),a=e.computed(()=>{const l=o.value;if(!l)return;let r=l;const i=Me();if(n.value){const m=l;r=i.current.value.scheme[m]??l}let s;try{if(s=wt(r),!s)return}catch(m){console.error("Failed to parse color:",m);return}const u=Re(s),d=Ct(u.l),f=kt(s,25),c=Bt(f);return{mainColor:r,mainColorRgb:Ve(s),onMainColor:d,hoverColor:c,hoverColorRgb:Ve(f),onHoverColor:d}});return{isUtilityColor:n,style:a}}function Et(t){return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")}const vt=["id","disabled"],St={key:0,class:"q-button__spinner"},$t={class:"q-button__content"},j=T(e.defineComponent({__name:"QButton",props:{id:{},class:{},label:{},variant:{default:"outlined"},color:{default:"primary"},disabled:{type:Boolean},borderless:{type:Boolean},elevated:{type:Boolean},block:{type:Boolean},loading:{type:Boolean},size:{default:"regular"},iconPos:{default:"start"},pill:{type:Boolean}},emits:["click"],setup(t,{emit:o}){const n=t,a=o,l=e.computed(()=>n.disabled||n.loading);function r(f){l.value||a("click",f)}const{isUtilityColor:i,style:s}=Le(e.toRef(n,"color")),u=e.computed(()=>{const f=i.value?`q-button--${n.color}`:void 0,c=n.size!=="regular"?`q-button--${n.size}`:void 0,m=n.iconPos!=="start"?`q-button--icon-${n.iconPos}`:void 0;return["q-button",`q-button--${n.variant}`,f,c,m,{"q-button--borderless":n.borderless,"q-button--elevated":n.elevated,"q-button--block":n.block,"q-button--loading":n.loading,"q-button--pill":n.pill},n.class]}),d=e.computed(()=>{var f,c,m,h,b,w;if(!i.value)return{"--q-button-main-color":(f=s.value)==null?void 0:f.mainColor,"--q-button-main-color-rgb":(c=s.value)==null?void 0:c.mainColorRgb,"--q-button-on-main-color":(m=s.value)==null?void 0:m.onMainColor,"--q-button-hover-color":(h=s.value)==null?void 0:h.hoverColor,"--q-button-hover-color-rgb":(b=s.value)==null?void 0:b.hoverColorRgb,"--q-button-on-hover-color":(w=s.value)==null?void 0:w.onHoverColor}});return(f,c)=>(e.openBlock(),e.createElementBlock("button",{id:n.id,type:"button",class:e.normalizeClass(u.value),disabled:l.value,style:e.normalizeStyle(d.value),onClick:e.withModifiers(r,["stop","prevent"])},[n.loading?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(e.unref(bt))])):e.createCommentVNode("v-if",!0),e.createElementVNode("span",$t,[e.renderSlot(f.$slots,"default"),e.createTextVNode(" "+e.toDisplayString(n.label),1)])],14,vt))}})),Nt=e.defineComponent({__name:"QIcon",props:{id:{},class:{},icon:{},type:{default:"svg"},size:{},color:{}},setup(t){const o=t,n=e.computed(()=>{switch(o.type){case"svg":return Pt;case"font":return Tt;case"img":return Ft;default:return}}),{style:a}=Le(e.toRef(o,"color")),l=e.computed(()=>{var r;return{"font-size":o.size!==void 0?`${o.size}px`:void 0,color:o.color!==void 0&&o.color!=="primary"?(r=a.value)==null?void 0:r.mainColor:void 0}});return(r,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{id:o.id,class:e.normalizeClass(o.class),icon:o.icon,style:e.normalizeStyle(l.value)},null,8,["id","class","icon","style"]))}}),At=["id"],It=e.defineComponent({__name:"QIconFont",props:{id:{},class:{},icon:{},library:{default:""},variant:{}},setup(t){const o=t,n=e.computed(()=>o.variant?`${o.library}-${o.variant}`:o.library),a=e.computed(()=>o.library&&o.icon?`${o.library}-${o.icon}`:o.icon);return(l,r)=>(e.openBlock(),e.createElementBlock("i",{id:o.id,class:e.normalizeClass(["q-icon","q-icon__font",n.value,a.value,o.class])},null,10,At))}}),Dt=["id","src"],Vt=e.defineComponent({__name:"QIconImg",props:{id:{},class:{},icon:{}},setup(t){const o=t;return(n,a)=>(e.openBlock(),e.createElementBlock("img",{id:o.id,src:o.icon,class:e.normalizeClass(["q-icon","q-icon__img",o.class])},null,10,Dt))}}),ae={},Rt=e.defineComponent({name:"InlineSvg",inheritAttrs:!1,props:{src:{type:String,required:!0},symbol:{type:String,default:""},title:{type:String,default:""},transformSource:{type:Function,default:void 0},keepDuringLoading:{type:Boolean,default:!0}},emits:{loaded:t=>typeof t=="object",unloaded:()=>!0,error:t=>typeof t=="object"},data(){return{svgElSource:null}},watch:{src(t){this.getSource(t)}},async mounted(){await this.getSource(this.src)},methods:{copySvgAttrs(t,o){const n=o.attributes;if(n)for(const a of n)t[a.name]=a.value},copyComponentAttrs(t,o){for(const[n,a]of Object.entries(o))a!==!1&&a!==null&&a!==void 0&&(t[n]=a)},getSvgContent(t){return this.symbol&&(t=t.getElementById(this.symbol),!t)?null:(this.transformSource&&(t=t.cloneNode(!0),t=this.transformSource(t)),this.title&&(this.transformSource||(t=t.cloneNode(!0)),Mt(t,this.title)),t)},async getSource(t){try{ae[t]||(ae[t]=Lt(this.download(t))),this.svgElSource&&ae[t].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded"));const o=await ae[t];this.svgElSource=o,await this.$nextTick(),this.$emit("loaded",this.$el)}catch(o){this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete ae[t],this.$emit("error",o)}},async download(t){const o=await fetch(t);if(!o.ok)throw new Error("Error loading SVG");const n=await o.text(),a=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("svg")[0];if(!a)throw new Error("Loaded file is not a valid SVG");return a}},render(){if(!this.svgElSource)return null;const t=this.getSvgContent(this.svgElSource);if(!t)return e.h("div",this.$attrs);const o={};return this.copySvgAttrs(o,this.svgElSource),this.copySvgAttrs(o,t),this.copyComponentAttrs(o,this.$attrs),o.innerHTML=t.innerHTML,e.h("svg",o)},expose:[]});function Mt(t,o){const n=t.getElementsByTagName("title");if(n.length)n[0].textContent=o;else{const a=document.createElementNS("http://www.w3.org/2000/svg","title");a.textContent=o,t.insertBefore(a,t.firstChild)}}function Lt(t){if(t.getIsPending)return t;let o=!0;const n=t.then(a=>(o=!1,a),a=>{throw o=!1,a});return n.getIsPending=()=>o,n}const qt=e.defineComponent({__name:"QIconSvg",props:{id:{},class:{},icon:{},bundle:{default:""}},emits:["loaded","unloaded"],setup(t,{emit:o}){const n=t,a=o;function l(i){a("loaded",i)}function r(){a("unloaded")}return(i,s)=>(e.openBlock(),e.createBlock(e.unref(Rt),{id:n.id,class:e.normalizeClass(["q-icon","q-icon__svg",n.class]),src:n.bundle,symbol:n.icon,onLoaded:l,onUnloaded:r},null,8,["id","class","src","symbol"]))}}),F=T(Nt),Tt=T(It),Ft=T(Vt),Pt=T(qt);let Ot=0;function ke(t){return e.unref(t)||`uid-${++Ot}`}const Ut=["id"],qe=T(e.defineComponent({__name:"QButtonGroup",props:{id:{},class:{},disabled:{type:Boolean},borderless:{type:Boolean},elevated:{type:Boolean}},setup(t){const o=t;return dt({QButton:{disabled:e.toRef(o,"disabled"),borderless:e.toRef(o,"borderless")}}),(n,a)=>(e.openBlock(),e.createElementBlock("div",{id:o.id,class:e.normalizeClass(["q-button-group",{"q-button-group--elevated":o.elevated},o.class]),role:"group"},[e.renderSlot(n.$slots,"default")],10,Ut))}})),zt=["id"],jt=["for"],Te=T(e.defineComponent({inheritAttrs:!1,__name:"QLabel",props:{id:{},class:{},label:{},for:{},required:{type:Boolean}},setup(t){const o=t,n=e.computed(()=>["q-label",{"q-label--required":o.required},o.class]);return(a,l)=>(e.openBlock(),e.createElementBlock("div",{id:o.id,class:e.normalizeClass(n.value)},[e.renderSlot(a.$slots,"prepend"),e.createElementVNode("label",e.mergeProps({for:o.for},a.$attrs),[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.label),1)])],16,jt),e.renderSlot(a.$slots,"append")],10,zt))}})),Gt=["id"],Ht={key:0,class:"q-field__prepend"},Qt={key:1,class:"q-field__append"},Zt={key:1,class:"q-field__extras"},Fe=T(e.defineComponent({inheritAttrs:!1,__name:"QField",props:{id:{},class:{},label:{},for:{},required:{type:Boolean},size:{default:"medium"},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean}},setup(t,{expose:o}){const n=t,a=e.useTemplateRef("field"),l=e.computed(()=>n.required&&!n.readonly&&!n.disabled),r=e.computed(()=>["q-field",`q-field--${n.size}`,{"q-field--readonly":n.readonly,"q-field--disabled":n.disabled,"q-field--required":l.value,"q-field--invalid":n.invalid},n.class]);return o({fieldRef:a}),(i,s)=>(e.openBlock(),e.createElementBlock("div",{id:n.id,class:e.normalizeClass(r.value)},[n.label?(e.openBlock(),e.createBlock(e.unref(Te),{key:0,class:"q-field__label",label:n.label,for:n.for,required:n.required},{prepend:e.withCtx(()=>[e.renderSlot(i.$slots,"label.prepend")]),append:e.withCtx(()=>[e.renderSlot(i.$slots,"label.append")]),_:3},8,["label","for","required"])):e.createCommentVNode("v-if",!0),e.renderSlot(i.$slots,"control",{},()=>[e.createElementVNode("div",e.mergeProps({ref:"field",class:"q-field__control"},i.$attrs),[i.$slots.prepend?(e.openBlock(),e.createElementBlock("div",Ht,[e.renderSlot(i.$slots,"prepend")])):e.createCommentVNode("v-if",!0),e.renderSlot(i.$slots,"default"),i.$slots.append?(e.openBlock(),e.createElementBlock("div",Qt,[e.renderSlot(i.$slots,"append")])):e.createCommentVNode("v-if",!0)],16)]),i.$slots.extras?(e.openBlock(),e.createElementBlock("div",Zt,[e.renderSlot(i.$slots,"extras")])):e.createCommentVNode("v-if",!0)],10,Gt))}})),Jt={clearValue:"Clear value"},Wt={clear:{icon:"close"}},Yt=T(e.defineComponent({__name:"QClearButton",props:{id:{},class:{},icons:{default:()=>Wt},texts:{default:()=>Jt}},emits:["click"],setup(t,{emit:o}){const n=t,a=o;function l(r){a("click",r)}return(r,i)=>(e.openBlock(),e.createBlock(e.unref(j),{id:n.id,class:e.normalizeClass(["q-clear-btn",n.class]),"aria-label":n.texts.clearValue,variant:"ghost",color:"neutral",borderless:"",tabindex:"-1",onClick:l},{default:e.withCtx(()=>[e.createVNode(e.unref(F),e.normalizeProps(e.guardReactiveProps(n.icons.clear)),null,16)]),_:1},8,["id","class","aria-label"]))}})),Xt=["id","type","maxlength","required","placeholder","readonly","disabled"],Pe=T(e.defineComponent({inheritAttrs:!1,__name:"QTextField",props:e.mergeModels({id:{},class:{},label:{},for:{},required:{type:Boolean},size:{},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean},placeholder:{},maxLength:{},clearable:{type:Boolean},type:{default:"text"},texts:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["click:clear"],["update:modelValue"]),setup(t,{expose:o,emit:n}){const a=t,l=n,r=e.useModel(t,"modelValue"),i=e.computed({get:()=>r.value,set:b=>{const w=a.maxLength;r.value=w?b==null?void 0:b.slice(0,w):b}});e.watch(r,b=>i.value=b,{immediate:!0});const s=ke(a.id),u=e.ref(null),d=e.ref(null),f=e.computed(()=>a.readonly||a.disabled?void 0:a.placeholder),c=e.computed(()=>a.clearable&&!a.readonly&&!a.disabled),m=e.computed(()=>c.value&&r.value);function h(b){c.value&&(r.value="",l("click:clear",b))}return o({fieldRef:e.computed(()=>{var b;return(b=u.value)==null?void 0:b.fieldRef}),inputRef:d}),(b,w)=>(e.openBlock(),e.createBlock(e.unref(Fe),{ref_key:"fieldRef",ref:u,class:e.normalizeClass(["q-text-field",a.class]),for:e.unref(s),label:a.label,size:a.size,readonly:a.readonly,disabled:a.disabled,required:a.required,invalid:a.invalid},e.createSlots({"label.prepend":e.withCtx(()=>[e.renderSlot(b.$slots,"label.prepend")]),"label.append":e.withCtx(()=>[e.renderSlot(b.$slots,"label.append")]),default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(s),ref_key:"inputRef",ref:d,"onUpdate:modelValue":w[0]||(w[0]=v=>i.value=v),class:"q-text-field__input",type:a.type,maxlength:a.maxLength,required:a.required,placeholder:f.value,readonly:a.readonly,disabled:a.disabled},b.$attrs),null,16,Xt),[[e.vModelDynamic,i.value]])]),_:2},[b.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(b.$slots,"prepend")]),key:"0"}:void 0,b.$slots.append||m.value?{name:"append",fn:e.withCtx(()=>[e.renderSlot(b.$slots,"append"),m.value?(e.openBlock(),e.createBlock(e.unref(Yt),{key:0,"data-testid":"q-text-field__clear-button",texts:a.texts,onClick:h},null,8,["texts"])):e.createCommentVNode("v-if",!0)]),key:"1"}:void 0,b.$slots.extras?{name:"extras",fn:e.withCtx(()=>[e.renderSlot(b.$slots,"extras")]),key:"2"}:void 0]),1032,["class","for","label","size","readonly","disabled","required","invalid"]))}})),Kt=Symbol("DismissibleLayer");function en(t){const o=e.inject(Kt);if(!o)throw new Error("useDismissibleLayerStackItem must be used within a dismissible layer stack context.");return{register:()=>o.register(t),unregister:()=>o.unregister(t),isTop:()=>o.isTop(t)}}const tn={ref:"layer"},nn=T(e.defineComponent({__name:"QDismissibleLayer",emits:["escape-key-down","pointer-down-outside","focus-outside","interact-outside","dismiss"],setup(t,{emit:o}){const n=o,a=e.useTemplateRef("layer"),l=e.useId(),r=en(l);let i=[];function s(c){c.key==="Escape"&&r!=null&&r.isTop()&&(n("escape-key-down",c),c.defaultPrevented||n("dismiss",c))}function u(c){if(!a.value)return;const m=c.target;if(!a.value.contains(m)&&r!=null&&r.isTop()){const h=new CustomEvent("focus-outside",{bubbles:!1,cancelable:!0,detail:{originalEvent:c}});n("focus-outside",h),n("interact-outside",h),h.defaultPrevented||n("dismiss",h)}}function d(c){if(!a.value||!(r!=null&&r.isTop()))return;const m=c.target;if(!a.value.contains(m)){const h=new CustomEvent("pointer-down-outside",{bubbles:!1,cancelable:!0,detail:{originalEvent:c}});n("pointer-down-outside",h),n("interact-outside",h),h.defaultPrevented||n("dismiss",h)}}function f(){["mousedown","touchstart"].forEach(c=>{document.addEventListener(c,d,{passive:!0,capture:!0}),i.push(()=>{document.removeEventListener(c,d,{capture:!0})})})}return e.onMounted(()=>{r==null||r.register(),document.addEventListener("keydown",s),i.push(()=>{document.removeEventListener("keydown",s)}),document.addEventListener("focusin",u),i.push(()=>{document.removeEventListener("focusin",u)}),f()}),e.onUnmounted(()=>{r==null||r.unregister(),i.forEach(c=>c()),i=[]}),(c,m)=>(e.openBlock(),e.createElementBlock("div",tn,[e.renderSlot(c.$slots,"default")],512))}}));function on(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}const an=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const rn=()=>{};function Oe(...t){if(t.length!==1)return e.toRef(...t);const o=t[0];return typeof o=="function"?e.readonly(e.customRef(()=>({get:o,set:rn}))):e.ref(o)}const Be=an?window:void 0;function _e(t){var o;const n=e.toValue(t);return(o=n==null?void 0:n.$el)!=null?o:n}function ln(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function sn(t){const o=ln();return e.computed(()=>(o.value,!!t()))}function cn(t,o,n={}){const{window:a=Be,...l}=n;let r;const i=sn(()=>a&&"ResizeObserver"in a),s=()=>{r&&(r.disconnect(),r=void 0)},u=e.computed(()=>{const c=e.toValue(t);return Array.isArray(c)?c.map(m=>_e(m)):[_e(c)]}),d=e.watch(u,c=>{if(s(),i.value&&a){r=new ResizeObserver(o);for(const m of c)m&&r.observe(m,l)}},{immediate:!0,flush:"post"}),f=()=>{s(),d()};return on(f),{isSupported:i,stop:f}}function dn(t=Be,o){t&&typeof t.requestAnimationFrame=="function"?t.requestAnimationFrame(o):o()}function un(t={}){var o,n;const{window:a=Be}=t,l=Oe(t==null?void 0:t.element),r=Oe((o=t==null?void 0:t.input)!=null?o:""),i=(n=t==null?void 0:t.styleProp)!=null?n:"height",s=e.shallowRef(1),u=e.shallowRef(0);function d(){var f;if(!l.value)return;let c="";l.value.style[i]="1px",s.value=(f=l.value)==null?void 0:f.scrollHeight;const m=e.toValue(t==null?void 0:t.styleTarget);m?m.style[i]=`${s.value}px`:c=`${s.value}px`,l.value.style[i]=c}return e.watch([r,l],()=>e.nextTick(d),{immediate:!0}),e.watch(s,()=>{var f;return(f=t==null?void 0:t.onResize)==null?void 0:f.call(t)}),cn(l,([{contentRect:f}])=>{u.value!==f.width&&dn(a,()=>{u.value=f.width,d()})}),t!=null&&t.watch&&e.watch(t.watch,d,{immediate:!0,deep:!0}),{textarea:l,input:r,triggerResize:d}}/*!
|
|
1
|
+
(function(e,K){typeof exports=="object"&&typeof module<"u"?module.exports=K(require("vue"),require("axios"),require("markdown-it")):typeof define=="function"&&define.amd?define(["vue","axios","markdown-it"],K):(e=typeof globalThis<"u"?globalThis:e||self,e.ChatBotFrontend=K(e.vue,e.axios,e.MarkdownIt))})(this,function(e,K,st){"use strict";function he(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}function Ae(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ye(t={},o={}){const n={},a=new Set([...Object.keys(t),...Object.keys(o)]);for(const l of a){if(l==="__proto__"||l==="constructor"||l==="prototype")continue;const r=t[l],i=o[l];Ae(r)&&Ae(i)?n[l]=ye(r,i):n[l]=i!==void 0?i:r}return n}const Ie="q-defaults";function ct(){var t,o;const n=e.getCurrentInstance();if(!n)throw new Error("[Quidgest UI] useDefaults must be called from inside a setup function");const a=n.type.name??n.type.__name;if(!a)throw new Error("[Quidgest UI] Could not determine component name");const l=De(),r=(t=l.value)==null?void 0:t.Global,i=(o=l.value)==null?void 0:o[a];return e.computed(()=>ye(r,i))}function dt(t){if(he(t))return;const o=De(),n=e.ref(t),a=e.computed(()=>he(n.value)?o.value:ye(o.value,n.value));e.provide(Ie,a)}function De(){const t=e.inject(Ie,void 0);if(!t)throw new Error("[Quidgest UI] Could not find defaults instance");return t}const ut=["id"],pt=e.defineComponent({__name:"QSpinnerLoader",props:{id:{},class:{},size:{default:48}},setup(t){const o=t,n=e.computed(()=>({"font-size":o.size!==48?`${o.size}px`:void 0}));return(a,l)=>(e.openBlock(),e.createElementBlock("div",{id:o.id,class:e.normalizeClass(["q-spinner-loader",o.class]),style:e.normalizeStyle(n.value)},null,14,ut))}});function ft(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([0-9])([a-zA-Z])/g,"$1 $2").replace(/([a-zA-Z])([0-9])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").trim().split(/\s+/)}function mt(t){return ft(t).join("-").toLowerCase()}function gt(t,o){var n;const a=mt(o);return a?typeof((n=t.props)==null?void 0:n[a])<"u":!1}function T(t){const o=t,n=o.setup;return n&&(o.setup=(a,l)=>{const r=ct();if(he(r.value))return n(a,l);const i=e.getCurrentInstance();if(i===null)return n(a,l);const s=new Proxy(a,{get(u,d){var f;const c=Reflect.get(u,d),m=(f=r.value)==null?void 0:f[d];return typeof d=="string"&&!gt(i.vnode,d)?m??c:c}});return n(s,l)}),t}const bt=T(pt);function ht(t,o=!1){return o?/^#[a-fA-F0-9]{6}$/.test(t):/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t)}function yt(t){const o=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(o){const n=parseInt(o[1],10),a=parseInt(o[2],10),l=parseInt(o[3],10);return{r:n,g:a,b:l}}}function wt(t){if(ht(t)){t.length===4&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const o=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return{r:o,g:n,b:a}}else{const o=yt(t);if(o)return o}throw new Error("Invalid color format")}function kt(t,o){const n=Re(t),a=o/100;return n.l=n.l-a*n.l,_t(n)}function Bt(t){const o=t.r.toString(16).padStart(2,"0"),n=t.g.toString(16).padStart(2,"0"),a=t.b.toString(16).padStart(2,"0");return`#${o}${n}${a}`}function Ve(t){return`${t.r} ${t.g} ${t.b}`}function Re(t){const o=t.r/255,n=t.g/255,a=t.b/255,l=Math.max(o,n,a),r=Math.min(o,n,a);let i=0,s;const u=(l+r)/2;if(l===r)i=s=0;else{const d=l-r;switch(s=u>.5?d/(2-l-r):d/(l+r),l){case o:i=(n-a)/d+(n<a?6:0);break;case n:i=(a-o)/d+2;break;case a:i=(o-n)/d+4;break}i/=6}return{h:Math.round(i*360),s:Math.round(s*100),l:Math.round(u*100)}}function _t(t){const o=t.h/360,n=t.s/100,a=t.l/100;let l,r,i;if(n===0)l=r=i=a;else{const s=a<.5?a*(1+n):a+n-a*n,u=2*a-s;l=we(u,s,o+1/3),r=we(u,s,o),i=we(u,s,o-1/3)}return{r:Math.round(l*255),g:Math.round(r*255),b:Math.round(i*255)}}function we(t,o,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(o-t)*6*n:n<1/2?o:n<2/3?t+(o-t)*(2/3-n)*6:t}function Ct(t){return t>50?"#000":"#fff"}const xt=Symbol.for("q-theme");function Me(){const t=e.inject(xt);if(!t)throw new Error("[Quidgest UI] Could not find theme instance");return t}function Le(t){const o=e.computed(()=>e.unref(t)),n=e.computed(()=>o.value?!Et(o.value):!1),a=e.computed(()=>{const l=o.value;if(!l)return;let r=l;const i=Me();if(n.value){const m=l;r=i.current.value.scheme[m]??l}let s;try{if(s=wt(r),!s)return}catch(m){console.error("Failed to parse color:",m);return}const u=Re(s),d=Ct(u.l),f=kt(s,25),c=Bt(f);return{mainColor:r,mainColorRgb:Ve(s),onMainColor:d,hoverColor:c,hoverColorRgb:Ve(f),onHoverColor:d}});return{isUtilityColor:n,style:a}}function Et(t){return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")}const vt=["id","disabled"],St={key:0,class:"q-button__spinner"},$t={class:"q-button__content"},j=T(e.defineComponent({__name:"QButton",props:{id:{},class:{},label:{},variant:{default:"outlined"},color:{default:"primary"},disabled:{type:Boolean},borderless:{type:Boolean},elevated:{type:Boolean},block:{type:Boolean},loading:{type:Boolean},size:{default:"regular"},iconPos:{default:"start"},pill:{type:Boolean}},emits:["click"],setup(t,{emit:o}){const n=t,a=o,l=e.computed(()=>n.disabled||n.loading);function r(f){l.value||a("click",f)}const{isUtilityColor:i,style:s}=Le(e.toRef(n,"color")),u=e.computed(()=>{const f=i.value?`q-button--${n.color}`:void 0,c=n.size!=="regular"?`q-button--${n.size}`:void 0,m=n.iconPos!=="start"?`q-button--icon-${n.iconPos}`:void 0;return["q-button",`q-button--${n.variant}`,f,c,m,{"q-button--borderless":n.borderless,"q-button--elevated":n.elevated,"q-button--block":n.block,"q-button--loading":n.loading,"q-button--pill":n.pill},n.class]}),d=e.computed(()=>{var f,c,m,h,b,w;if(!i.value)return{"--q-button-main-color":(f=s.value)==null?void 0:f.mainColor,"--q-button-main-color-rgb":(c=s.value)==null?void 0:c.mainColorRgb,"--q-button-on-main-color":(m=s.value)==null?void 0:m.onMainColor,"--q-button-hover-color":(h=s.value)==null?void 0:h.hoverColor,"--q-button-hover-color-rgb":(b=s.value)==null?void 0:b.hoverColorRgb,"--q-button-on-hover-color":(w=s.value)==null?void 0:w.onHoverColor}});return(f,c)=>(e.openBlock(),e.createElementBlock("button",{id:n.id,type:"button",class:e.normalizeClass(u.value),disabled:l.value,style:e.normalizeStyle(d.value),onClick:e.withModifiers(r,["stop","prevent"])},[n.loading?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(e.unref(bt))])):e.createCommentVNode("v-if",!0),e.createElementVNode("span",$t,[e.renderSlot(f.$slots,"default"),e.createTextVNode(" "+e.toDisplayString(n.label),1)])],14,vt))}})),Nt=e.defineComponent({__name:"QIcon",props:{id:{},class:{},icon:{},type:{default:"svg"},size:{},color:{}},setup(t){const o=t,n=e.computed(()=>{switch(o.type){case"svg":return Pt;case"font":return Tt;case"img":return Ft;default:return}}),{style:a}=Le(e.toRef(o,"color")),l=e.computed(()=>{var r;return{"font-size":o.size!==void 0?`${o.size}px`:void 0,color:o.color!==void 0&&o.color!=="primary"?(r=a.value)==null?void 0:r.mainColor:void 0}});return(r,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{id:o.id,class:e.normalizeClass(o.class),icon:o.icon,style:e.normalizeStyle(l.value)},null,8,["id","class","icon","style"]))}}),At=["id"],It=e.defineComponent({__name:"QIconFont",props:{id:{},class:{},icon:{},library:{default:""},variant:{}},setup(t){const o=t,n=e.computed(()=>o.variant?`${o.library}-${o.variant}`:o.library),a=e.computed(()=>o.library&&o.icon?`${o.library}-${o.icon}`:o.icon);return(l,r)=>(e.openBlock(),e.createElementBlock("i",{id:o.id,class:e.normalizeClass(["q-icon","q-icon__font",n.value,a.value,o.class])},null,10,At))}}),Dt=["id","src"],Vt=e.defineComponent({__name:"QIconImg",props:{id:{},class:{},icon:{}},setup(t){const o=t;return(n,a)=>(e.openBlock(),e.createElementBlock("img",{id:o.id,src:o.icon,class:e.normalizeClass(["q-icon","q-icon__img",o.class])},null,10,Dt))}}),ae={},Rt=e.defineComponent({name:"InlineSvg",inheritAttrs:!1,props:{src:{type:String,required:!0},symbol:{type:String,default:""},title:{type:String,default:""},transformSource:{type:Function,default:void 0},keepDuringLoading:{type:Boolean,default:!0}},emits:{loaded:t=>typeof t=="object",unloaded:()=>!0,error:t=>typeof t=="object"},data(){return{svgElSource:null}},watch:{src(t){this.getSource(t)}},async mounted(){await this.getSource(this.src)},methods:{copySvgAttrs(t,o){const n=o.attributes;if(n)for(const a of n)t[a.name]=a.value},copyComponentAttrs(t,o){for(const[n,a]of Object.entries(o))a!==!1&&a!==null&&a!==void 0&&(t[n]=a)},getSvgContent(t){return this.symbol&&(t=t.getElementById(this.symbol),!t)?null:(this.transformSource&&(t=t.cloneNode(!0),t=this.transformSource(t)),this.title&&(this.transformSource||(t=t.cloneNode(!0)),Mt(t,this.title)),t)},async getSource(t){try{ae[t]||(ae[t]=Lt(this.download(t))),this.svgElSource&&ae[t].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded"));const o=await ae[t];this.svgElSource=o,await this.$nextTick(),this.$emit("loaded",this.$el)}catch(o){this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete ae[t],this.$emit("error",o)}},async download(t){const o=await fetch(t);if(!o.ok)throw new Error("Error loading SVG");const n=await o.text(),a=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("svg")[0];if(!a)throw new Error("Loaded file is not a valid SVG");return a}},render(){if(!this.svgElSource)return null;const t=this.getSvgContent(this.svgElSource);if(!t)return e.h("div",this.$attrs);const o={};return this.copySvgAttrs(o,this.svgElSource),this.copySvgAttrs(o,t),this.copyComponentAttrs(o,this.$attrs),o.innerHTML=t.innerHTML,e.h("svg",o)},expose:[]});function Mt(t,o){const n=t.getElementsByTagName("title");if(n.length)n[0].textContent=o;else{const a=document.createElementNS("http://www.w3.org/2000/svg","title");a.textContent=o,t.insertBefore(a,t.firstChild)}}function Lt(t){if(t.getIsPending)return t;let o=!0;const n=t.then(a=>(o=!1,a),a=>{throw o=!1,a});return n.getIsPending=()=>o,n}const qt=e.defineComponent({__name:"QIconSvg",props:{id:{},class:{},icon:{},bundle:{default:""}},emits:["loaded","unloaded"],setup(t,{emit:o}){const n=t,a=o;function l(i){a("loaded",i)}function r(){a("unloaded")}return(i,s)=>(e.openBlock(),e.createBlock(e.unref(Rt),{id:n.id,class:e.normalizeClass(["q-icon","q-icon__svg",n.class]),src:n.bundle,symbol:n.icon,onLoaded:l,onUnloaded:r},null,8,["id","class","src","symbol"]))}}),F=T(Nt),Tt=T(It),Ft=T(Vt),Pt=T(qt);let Ot=0;function ke(t){return e.unref(t)||`uid-${++Ot}`}const Ut=["id"],qe=T(e.defineComponent({__name:"QButtonGroup",props:{id:{},class:{},disabled:{type:Boolean},borderless:{type:Boolean},elevated:{type:Boolean}},setup(t){const o=t;return dt({QButton:{disabled:e.toRef(o,"disabled"),borderless:e.toRef(o,"borderless")}}),(n,a)=>(e.openBlock(),e.createElementBlock("div",{id:o.id,class:e.normalizeClass(["q-button-group",{"q-button-group--elevated":o.elevated},o.class]),role:"group"},[e.renderSlot(n.$slots,"default")],10,Ut))}})),zt=["id"],jt=["for"],Te=T(e.defineComponent({inheritAttrs:!1,__name:"QLabel",props:{id:{},class:{},label:{},for:{},required:{type:Boolean}},setup(t){const o=t,n=e.computed(()=>["q-label",{"q-label--required":o.required},o.class]);return(a,l)=>(e.openBlock(),e.createElementBlock("div",{id:o.id,class:e.normalizeClass(n.value)},[e.renderSlot(a.$slots,"prepend"),e.createElementVNode("label",e.mergeProps({for:o.for},a.$attrs),[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.label),1)])],16,jt),e.renderSlot(a.$slots,"append")],10,zt))}})),Gt=["id"],Ht={key:0,class:"q-field__prepend"},Zt={key:1,class:"q-field__append"},Qt={key:1,class:"q-field__extras"},Fe=T(e.defineComponent({inheritAttrs:!1,__name:"QField",props:{id:{},class:{},label:{},for:{},required:{type:Boolean},size:{default:"medium"},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean}},setup(t,{expose:o}){const n=t,a=e.useTemplateRef("field"),l=e.computed(()=>n.required&&!n.readonly&&!n.disabled),r=e.computed(()=>["q-field",`q-field--${n.size}`,{"q-field--readonly":n.readonly,"q-field--disabled":n.disabled,"q-field--required":l.value,"q-field--invalid":n.invalid},n.class]);return o({fieldRef:a}),(i,s)=>(e.openBlock(),e.createElementBlock("div",{id:n.id,class:e.normalizeClass(r.value)},[n.label?(e.openBlock(),e.createBlock(e.unref(Te),{key:0,class:"q-field__label",label:n.label,for:n.for,required:n.required},{prepend:e.withCtx(()=>[e.renderSlot(i.$slots,"label.prepend")]),append:e.withCtx(()=>[e.renderSlot(i.$slots,"label.append")]),_:3},8,["label","for","required"])):e.createCommentVNode("v-if",!0),e.renderSlot(i.$slots,"control",{},()=>[e.createElementVNode("div",e.mergeProps({ref:"field",class:"q-field__control"},i.$attrs),[i.$slots.prepend?(e.openBlock(),e.createElementBlock("div",Ht,[e.renderSlot(i.$slots,"prepend")])):e.createCommentVNode("v-if",!0),e.renderSlot(i.$slots,"default"),i.$slots.append?(e.openBlock(),e.createElementBlock("div",Zt,[e.renderSlot(i.$slots,"append")])):e.createCommentVNode("v-if",!0)],16)]),i.$slots.extras?(e.openBlock(),e.createElementBlock("div",Qt,[e.renderSlot(i.$slots,"extras")])):e.createCommentVNode("v-if",!0)],10,Gt))}})),Jt={clearValue:"Clear value"},Wt={clear:{icon:"close"}},Yt=T(e.defineComponent({__name:"QClearButton",props:{id:{},class:{},icons:{default:()=>Wt},texts:{default:()=>Jt}},emits:["click"],setup(t,{emit:o}){const n=t,a=o;function l(r){a("click",r)}return(r,i)=>(e.openBlock(),e.createBlock(e.unref(j),{id:n.id,class:e.normalizeClass(["q-clear-btn",n.class]),"aria-label":n.texts.clearValue,variant:"ghost",color:"neutral",borderless:"",tabindex:"-1",onClick:l},{default:e.withCtx(()=>[e.createVNode(e.unref(F),e.normalizeProps(e.guardReactiveProps(n.icons.clear)),null,16)]),_:1},8,["id","class","aria-label"]))}})),Xt=["id","type","maxlength","required","placeholder","readonly","disabled"],Pe=T(e.defineComponent({inheritAttrs:!1,__name:"QTextField",props:e.mergeModels({id:{},class:{},label:{},for:{},required:{type:Boolean},size:{},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean},placeholder:{},maxLength:{},clearable:{type:Boolean},type:{default:"text"},texts:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["click:clear"],["update:modelValue"]),setup(t,{expose:o,emit:n}){const a=t,l=n,r=e.useModel(t,"modelValue"),i=e.computed({get:()=>r.value,set:b=>{const w=a.maxLength;r.value=w?b==null?void 0:b.slice(0,w):b}});e.watch(r,b=>i.value=b,{immediate:!0});const s=ke(a.id),u=e.ref(null),d=e.ref(null),f=e.computed(()=>a.readonly||a.disabled?void 0:a.placeholder),c=e.computed(()=>a.clearable&&!a.readonly&&!a.disabled),m=e.computed(()=>c.value&&r.value);function h(b){c.value&&(r.value="",l("click:clear",b))}return o({fieldRef:e.computed(()=>{var b;return(b=u.value)==null?void 0:b.fieldRef}),inputRef:d}),(b,w)=>(e.openBlock(),e.createBlock(e.unref(Fe),{ref_key:"fieldRef",ref:u,class:e.normalizeClass(["q-text-field",a.class]),for:e.unref(s),label:a.label,size:a.size,readonly:a.readonly,disabled:a.disabled,required:a.required,invalid:a.invalid},e.createSlots({"label.prepend":e.withCtx(()=>[e.renderSlot(b.$slots,"label.prepend")]),"label.append":e.withCtx(()=>[e.renderSlot(b.$slots,"label.append")]),default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(s),ref_key:"inputRef",ref:d,"onUpdate:modelValue":w[0]||(w[0]=v=>i.value=v),class:"q-text-field__input",type:a.type,maxlength:a.maxLength,required:a.required,placeholder:f.value,readonly:a.readonly,disabled:a.disabled},b.$attrs),null,16,Xt),[[e.vModelDynamic,i.value]])]),_:2},[b.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(b.$slots,"prepend")]),key:"0"}:void 0,b.$slots.append||m.value?{name:"append",fn:e.withCtx(()=>[e.renderSlot(b.$slots,"append"),m.value?(e.openBlock(),e.createBlock(e.unref(Yt),{key:0,"data-testid":"q-text-field__clear-button",texts:a.texts,onClick:h},null,8,["texts"])):e.createCommentVNode("v-if",!0)]),key:"1"}:void 0,b.$slots.extras?{name:"extras",fn:e.withCtx(()=>[e.renderSlot(b.$slots,"extras")]),key:"2"}:void 0]),1032,["class","for","label","size","readonly","disabled","required","invalid"]))}})),Kt=Symbol("DismissibleLayer");function en(t){const o=e.inject(Kt);if(!o)throw new Error("useDismissibleLayerStackItem must be used within a dismissible layer stack context.");return{register:()=>o.register(t),unregister:()=>o.unregister(t),isTop:()=>o.isTop(t)}}const tn={ref:"layer"},nn=T(e.defineComponent({__name:"QDismissibleLayer",emits:["escape-key-down","pointer-down-outside","focus-outside","interact-outside","dismiss"],setup(t,{emit:o}){const n=o,a=e.useTemplateRef("layer"),l=e.useId(),r=en(l);let i=[];function s(c){c.key==="Escape"&&r!=null&&r.isTop()&&(n("escape-key-down",c),c.defaultPrevented||n("dismiss",c))}function u(c){if(!a.value)return;const m=c.target;if(!a.value.contains(m)&&r!=null&&r.isTop()){const h=new CustomEvent("focus-outside",{bubbles:!1,cancelable:!0,detail:{originalEvent:c}});n("focus-outside",h),n("interact-outside",h),h.defaultPrevented||n("dismiss",h)}}function d(c){if(!a.value||!(r!=null&&r.isTop()))return;const m=c.target;if(!a.value.contains(m)){const h=new CustomEvent("pointer-down-outside",{bubbles:!1,cancelable:!0,detail:{originalEvent:c}});n("pointer-down-outside",h),n("interact-outside",h),h.defaultPrevented||n("dismiss",h)}}function f(){["mousedown","touchstart"].forEach(c=>{document.addEventListener(c,d,{passive:!0,capture:!0}),i.push(()=>{document.removeEventListener(c,d,{capture:!0})})})}return e.onMounted(()=>{r==null||r.register(),document.addEventListener("keydown",s),i.push(()=>{document.removeEventListener("keydown",s)}),document.addEventListener("focusin",u),i.push(()=>{document.removeEventListener("focusin",u)}),f()}),e.onUnmounted(()=>{r==null||r.unregister(),i.forEach(c=>c()),i=[]}),(c,m)=>(e.openBlock(),e.createElementBlock("div",tn,[e.renderSlot(c.$slots,"default")],512))}}));function on(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}const an=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const rn=()=>{};function Oe(...t){if(t.length!==1)return e.toRef(...t);const o=t[0];return typeof o=="function"?e.readonly(e.customRef(()=>({get:o,set:rn}))):e.ref(o)}const Be=an?window:void 0;function _e(t){var o;const n=e.toValue(t);return(o=n==null?void 0:n.$el)!=null?o:n}function ln(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function sn(t){const o=ln();return e.computed(()=>(o.value,!!t()))}function cn(t,o,n={}){const{window:a=Be,...l}=n;let r;const i=sn(()=>a&&"ResizeObserver"in a),s=()=>{r&&(r.disconnect(),r=void 0)},u=e.computed(()=>{const c=e.toValue(t);return Array.isArray(c)?c.map(m=>_e(m)):[_e(c)]}),d=e.watch(u,c=>{if(s(),i.value&&a){r=new ResizeObserver(o);for(const m of c)m&&r.observe(m,l)}},{immediate:!0,flush:"post"}),f=()=>{s(),d()};return on(f),{isSupported:i,stop:f}}function dn(t=Be,o){t&&typeof t.requestAnimationFrame=="function"?t.requestAnimationFrame(o):o()}function un(t={}){var o,n;const{window:a=Be}=t,l=Oe(t==null?void 0:t.element),r=Oe((o=t==null?void 0:t.input)!=null?o:""),i=(n=t==null?void 0:t.styleProp)!=null?n:"height",s=e.shallowRef(1),u=e.shallowRef(0);function d(){var f;if(!l.value)return;let c="";l.value.style[i]="1px",s.value=(f=l.value)==null?void 0:f.scrollHeight;const m=e.toValue(t==null?void 0:t.styleTarget);m?m.style[i]=`${s.value}px`:c=`${s.value}px`,l.value.style[i]=c}return e.watch([r,l],()=>e.nextTick(d),{immediate:!0}),e.watch(s,()=>{var f;return(f=t==null?void 0:t.onResize)==null?void 0:f.call(t)}),cn(l,([{contentRect:f}])=>{u.value!==f.width&&dn(a,()=>{u.value=f.width,d()})}),t!=null&&t.watch&&e.watch(t.watch,d,{immediate:!0,deep:!0}),{textarea:l,input:r,triggerResize:d}}/*!
|
|
2
2
|
* tabbable 6.2.0
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var Ue=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],se=Ue.join(","),ze=typeof Element>"u",
|
|
4
|
+
*/var Ue=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],se=Ue.join(","),ze=typeof Element>"u",Q=ze?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ce=!ze&&Element.prototype.getRootNode?function(t){var o;return t==null||(o=t.getRootNode)===null||o===void 0?void 0:o.call(t)}:function(t){return t==null?void 0:t.ownerDocument},de=function t(o,n){var a;n===void 0&&(n=!0);var l=o==null||(a=o.getAttribute)===null||a===void 0?void 0:a.call(o,"inert"),r=l===""||l==="true",i=r||n&&o&&t(o.parentNode);return i},pn=function(t){var o,n=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"contenteditable");return n===""||n==="true"},je=function(t,o,n){if(de(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(se));return o&&Q.call(t,se)&&a.unshift(t),a=a.filter(n),a},Ge=function t(o,n,a){for(var l=[],r=Array.from(o);r.length;){var i=r.shift();if(!de(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),u=s.length?s:i.children,d=t(u,!0,a);a.flatten?l.push.apply(l,d):l.push({scopeParent:i,candidates:d})}else{var f=Q.call(i,se);f&&a.filter(i)&&(n||!o.includes(i))&&l.push(i);var c=i.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(i),m=!de(c,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(i));if(c&&m){var h=t(c===!0?i.children:c.children,!0,a);a.flatten?l.push.apply(l,h):l.push({scopeParent:i,candidates:h})}else r.unshift.apply(r,i.children)}}return l},He=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},J=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||pn(t))&&!He(t)?0:t.tabIndex},fn=function(t,o){var n=J(t);return n<0&&o&&!He(t)?0:n},mn=function(t,o){return t.tabIndex===o.tabIndex?t.documentOrder-o.documentOrder:t.tabIndex-o.tabIndex},Ze=function(t){return t.tagName==="INPUT"},gn=function(t){return Ze(t)&&t.type==="hidden"},bn=function(t){var o=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return o},hn=function(t,o){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===o)return t[n]},yn=function(t){if(!t.name)return!0;var o=t.form||ce(t),n=function(r){return o.querySelectorAll('input[type="radio"][name="'+r+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=n(window.CSS.escape(t.name));else try{a=n(t.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var l=hn(a,t.form);return!l||l===t},wn=function(t){return Ze(t)&&t.type==="radio"},kn=function(t){return wn(t)&&!yn(t)},Bn=function(t){var o,n=t&&ce(t),a=(o=n)===null||o===void 0?void 0:o.host,l=!1;if(n&&n!==t){var r,i,s;for(l=!!((r=a)!==null&&r!==void 0&&(i=r.ownerDocument)!==null&&i!==void 0&&i.contains(a)||t!=null&&(s=t.ownerDocument)!==null&&s!==void 0&&s.contains(t));!l&&a;){var u,d,f;n=ce(a),a=(u=n)===null||u===void 0?void 0:u.host,l=!!((d=a)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(a))}}return l},Qe=function(t){var o=t.getBoundingClientRect(),n=o.width,a=o.height;return n===0&&a===0},_n=function(t,o){var n=o.displayCheck,a=o.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var l=Q.call(t,"details>summary:first-of-type"),r=l?t.parentElement:t;if(Q.call(r,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof a=="function"){for(var i=t;t;){var s=t.parentElement,u=ce(t);if(s&&!s.shadowRoot&&a(s)===!0)return Qe(t);t.assignedSlot?t=t.assignedSlot:!s&&u!==t.ownerDocument?t=u.host:t=s}t=i}if(Bn(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return Qe(t);return!1},Cn=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var o=t.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var n=0;n<o.children.length;n++){var a=o.children.item(n);if(a.tagName==="LEGEND")return Q.call(o,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}o=o.parentElement}return!1},ue=function(t,o){return!(o.disabled||de(o)||gn(o)||_n(o,t)||bn(o)||Cn(o))},Ce=function(t,o){return!(kn(o)||J(o)<0||!ue(t,o))},xn=function(t){var o=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(o)||o>=0)},En=function t(o){var n=[],a=[];return o.forEach(function(l,r){var i=!!l.scopeParent,s=i?l.scopeParent:l,u=fn(s,i),d=i?t(l.candidates):s;u===0?i?n.push.apply(n,d):n.push(s):a.push({documentOrder:r,tabIndex:u,item:l,isScope:i,content:d})}),a.sort(mn).reduce(function(l,r){return r.isScope?l.push.apply(l,r.content):l.push(r.content),l},[]).concat(n)},vn=function(t,o){o=o||{};var n;return o.getShadowRoot?n=Ge([t],o.includeContainer,{filter:Ce.bind(null,o),flatten:!1,getShadowRoot:o.getShadowRoot,shadowRootFilter:xn}):n=je(t,o.includeContainer,Ce.bind(null,o)),En(n)},Sn=function(t,o){o=o||{};var n;return o.getShadowRoot?n=Ge([t],o.includeContainer,{filter:ue.bind(null,o),flatten:!0,getShadowRoot:o.getShadowRoot}):n=je(t,o.includeContainer,ue.bind(null,o)),n},ee=function(t,o){if(o=o||{},!t)throw new Error("No node provided");return Q.call(t,se)===!1?!1:Ce(o,t)},$n=Ue.concat("iframe").join(","),xe=function(t,o){if(o=o||{},!t)throw new Error("No node provided");return Q.call(t,$n)===!1?!1:ue(o,t)};/*!
|
|
5
5
|
* focus-trap 7.6.4
|
|
6
6
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
7
7
|
*/function Ee(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,a=Array(o);n<o;n++)a[n]=t[n];return a}function Nn(t){if(Array.isArray(t))return Ee(t)}function An(t,o,n){return(o=Mn(o))in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}function In(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Dn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function We(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Je(Object(n),!0).forEach(function(a){An(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Vn(t){return Nn(t)||In(t)||Ln(t)||Dn()}function Rn(t,o){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,o);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}function Mn(t){var o=Rn(t,"string");return typeof o=="symbol"?o:o+""}function Ln(t,o){if(t){if(typeof t=="string")return Ee(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(t,o):void 0}}var Ye={activateTrap:function(t,o){if(t.length>0){var n=t[t.length-1];n!==o&&n._setPausedState(!0)}var a=t.indexOf(o);a===-1||t.splice(a,1),t.push(o)},deactivateTrap:function(t,o){var n=t.indexOf(o);n!==-1&&t.splice(n,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},qn=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Tn=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},re=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Fn=function(t){return re(t)&&!t.shiftKey},Pn=function(t){return re(t)&&t.shiftKey},Xe=function(t){return setTimeout(t,0)},le=function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,n):t},pe=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},On=[],Un=function(t,o){var n=(o==null?void 0:o.document)||document,a=(o==null?void 0:o.trapStack)||On,l=We({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Fn,isKeyBackward:Pn},o),r={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i,s=function(p,g,k){return p&&p[g]!==void 0?p[g]:l[k||g]},u=function(p,g){var k=typeof(g==null?void 0:g.composedPath)=="function"?g.composedPath():void 0;return r.containerGroups.findIndex(function(S){var x=S.container,A=S.tabbableNodes;return x.contains(p)||(k==null?void 0:k.includes(x))||A.find(function(E){return E===p})})},d=function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=g.hasFallback,S=k===void 0?!1:k,x=g.params,A=x===void 0?[]:x,E=l[p];if(typeof E=="function"&&(E=E.apply(void 0,Vn(A))),E===!0&&(E=void 0),!E){if(E===void 0||E===!1)return E;throw new Error("`".concat(p,"` was specified but was not a node, or did not return a node"))}var q=E;if(typeof E=="string"){try{q=n.querySelector(E)}catch(y){throw new Error("`".concat(p,'` appears to be an invalid selector; error="').concat(y.message,'"'))}if(!q&&!S)throw new Error("`".concat(p,"` as selector refers to no known node"))}return q},f=function(){var p=d("initialFocus",{hasFallback:!0});if(p===!1)return!1;if(p===void 0||p&&!xe(p,l.tabbableOptions))if(u(n.activeElement)>=0)p=n.activeElement;else{var g=r.tabbableGroups[0],k=g&&g.firstTabbableNode;p=k||d("fallbackFocus")}else p===null&&(p=d("fallbackFocus"));if(!p)throw new Error("Your focus-trap needs to have at least one focusable element");return p},c=function(){if(r.containerGroups=r.containers.map(function(p){var g=vn(p,l.tabbableOptions),k=Sn(p,l.tabbableOptions),S=g.length>0?g[0]:void 0,x=g.length>0?g[g.length-1]:void 0,A=k.find(function(y){return ee(y)}),E=k.slice().reverse().find(function(y){return ee(y)}),q=!!g.find(function(y){return J(y)>0});return{container:p,tabbableNodes:g,focusableNodes:k,posTabIndexesFound:q,firstTabbableNode:S,lastTabbableNode:x,firstDomTabbableNode:A,lastDomTabbableNode:E,nextTabbableNode:function(y){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,$=g.indexOf(y);return $<0?B?k.slice(k.indexOf(y)+1).find(function(N){return ee(N)}):k.slice(0,k.indexOf(y)).reverse().find(function(N){return ee(N)}):g[$+(B?1:-1)]}}}),r.tabbableGroups=r.containerGroups.filter(function(p){return p.tabbableNodes.length>0}),r.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(r.containerGroups.find(function(p){return p.posTabIndexesFound})&&r.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function(p){var g=p.activeElement;if(g)return g.shadowRoot&&g.shadowRoot.activeElement!==null?m(g.shadowRoot):g},h=function(p){if(p!==!1&&p!==m(document)){if(!p||!p.focus){h(f());return}p.focus({preventScroll:!!l.preventScroll}),r.mostRecentlyFocusedNode=p,qn(p)&&p.select()}},b=function(p){var g=d("setReturnFocus",{params:[p]});return g||(g===!1?!1:p)},w=function(p){var g=p.target,k=p.event,S=p.isBackward,x=S===void 0?!1:S;g=g||pe(k),c();var A=null;if(r.tabbableGroups.length>0){var E=u(g,k),q=E>=0?r.containerGroups[E]:void 0;if(E<0)x?A=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:A=r.tabbableGroups[0].firstTabbableNode;else if(x){var y=r.tabbableGroups.findIndex(function(oe){var ie=oe.firstTabbableNode;return g===ie});if(y<0&&(q.container===g||xe(g,l.tabbableOptions)&&!ee(g,l.tabbableOptions)&&!q.nextTabbableNode(g,!1))&&(y=E),y>=0){var B=y===0?r.tabbableGroups.length-1:y-1,$=r.tabbableGroups[B];A=J(g)>=0?$.lastTabbableNode:$.lastDomTabbableNode}else re(k)||(A=q.nextTabbableNode(g,!1))}else{var N=r.tabbableGroups.findIndex(function(oe){var ie=oe.lastTabbableNode;return g===ie});if(N<0&&(q.container===g||xe(g,l.tabbableOptions)&&!ee(g,l.tabbableOptions)&&!q.nextTabbableNode(g))&&(N=E),N>=0){var G=N===r.tabbableGroups.length-1?0:N+1,Q=r.tabbableGroups[G];A=J(g)>=0?Q.firstTabbableNode:Q.firstDomTabbableNode}else re(k)||(A=q.nextTabbableNode(g))}}else A=d("fallbackFocus");return A},v=function(p){var g=pe(p);if(!(u(g,p)>=0)){if(le(l.clickOutsideDeactivates,p)){i.deactivate({returnFocus:l.returnFocusOnDeactivate});return}le(l.allowOutsideClick,p)||p.preventDefault()}},P=function(p){var g=pe(p),k=u(g,p)>=0;if(k||g instanceof Document)k&&(r.mostRecentlyFocusedNode=g);else{p.stopImmediatePropagation();var S,x=!0;if(r.mostRecentlyFocusedNode)if(J(r.mostRecentlyFocusedNode)>0){var A=u(r.mostRecentlyFocusedNode),E=r.containerGroups[A].tabbableNodes;if(E.length>0){var q=E.findIndex(function(y){return y===r.mostRecentlyFocusedNode});q>=0&&(l.isKeyForward(r.recentNavEvent)?q+1<E.length&&(S=E[q+1],x=!1):q-1>=0&&(S=E[q-1],x=!1))}}else r.containerGroups.some(function(y){return y.tabbableNodes.some(function(B){return J(B)>0})})||(x=!1);else x=!1;x&&(S=w({target:r.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(r.recentNavEvent)})),h(S||r.mostRecentlyFocusedNode||f())}r.recentNavEvent=void 0},D=function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r.recentNavEvent=p;var k=w({event:p,isBackward:g});k&&(re(p)&&p.preventDefault(),h(k))},V=function(p){(l.isKeyForward(p)||l.isKeyBackward(p))&&D(p,l.isKeyBackward(p))},R=function(p){Tn(p)&&le(l.escapeDeactivates,p)!==!1&&(p.preventDefault(),i.deactivate())},M=function(p){var g=pe(p);u(g,p)>=0||le(l.clickOutsideDeactivates,p)||le(l.allowOutsideClick,p)||(p.preventDefault(),p.stopImmediatePropagation())},_=function(){if(r.active)return Ye.activateTrap(a,i),r.delayInitialFocusTimer=l.delayInitialFocus?Xe(function(){h(f())}):h(f()),n.addEventListener("focusin",P,!0),n.addEventListener("mousedown",v,{capture:!0,passive:!1}),n.addEventListener("touchstart",v,{capture:!0,passive:!1}),n.addEventListener("click",M,{capture:!0,passive:!1}),n.addEventListener("keydown",V,{capture:!0,passive:!1}),n.addEventListener("keydown",R),i},L=function(){if(r.active)return n.removeEventListener("focusin",P,!0),n.removeEventListener("mousedown",v,!0),n.removeEventListener("touchstart",v,!0),n.removeEventListener("click",M,!0),n.removeEventListener("keydown",V,!0),n.removeEventListener("keydown",R),i},I=function(p){var g=p.some(function(k){var S=Array.from(k.removedNodes);return S.some(function(x){return x===r.mostRecentlyFocusedNode})});g&&h(f())},U=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,z=function(){U&&(U.disconnect(),r.active&&!r.paused&&r.containers.map(function(p){U.observe(p,{subtree:!0,childList:!0})}))};return i={get active(){return r.active},get paused(){return r.paused},activate:function(p){if(r.active)return this;var g=s(p,"onActivate"),k=s(p,"onPostActivate"),S=s(p,"checkCanFocusTrap");S||c(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=n.activeElement,g==null||g();var x=function(){S&&c(),_(),z(),k==null||k()};return S?(S(r.containers.concat()).then(x,x),this):(x(),this)},deactivate:function(p){if(!r.active)return this;var g=We({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},p);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,L(),r.active=!1,r.paused=!1,z(),Ye.deactivateTrap(a,i);var k=s(g,"onDeactivate"),S=s(g,"onPostDeactivate"),x=s(g,"checkCanReturnFocus"),A=s(g,"returnFocus","returnFocusOnDeactivate");k==null||k();var E=function(){Xe(function(){A&&h(b(r.nodeFocusedBeforeActivation)),S==null||S()})};return A&&x?(x(b(r.nodeFocusedBeforeActivation)).then(E,E),this):(E(),this)},pause:function(p){return r.active?(r.manuallyPaused=!0,this._setPausedState(!0,p)):this},unpause:function(p){return r.active?(r.manuallyPaused=!1,a[a.length-1]!==this?this:this._setPausedState(!1,p)):this},updateContainerElements:function(p){var g=[].concat(p).filter(Boolean);return r.containers=g.map(function(k){return typeof k=="string"?n.querySelector(k):k}),r.active&&c(),z(),this}},Object.defineProperties(i,{_isManuallyPaused:{value:function(){return r.manuallyPaused}},_setPausedState:{value:function(p,g){if(r.paused===p)return this;if(r.paused=p,p){var k=s(g,"onPause"),S=s(g,"onPostPause");k==null||k(),L(),z(),S==null||S()}else{var x=s(g,"onUnpause"),A=s(g,"onPostUnpause");x==null||x(),c(),_(),z(),A==null||A()}return this}}}),i.updateContainerElements(t),i};const zn=e.defineComponent({name:"UseFocusTrap",props:["as","options"],setup(t,{slots:o}){let n;const a=e.ref(),l=()=>n&&n.activate(),r=()=>n&&n.deactivate();return e.watch(()=>_e(a),i=>{i&&(n=Un(i,t.options||{}),l())},{flush:"post"}),e.onScopeDispose(()=>r()),()=>{if(o.default)return e.h(t.as||"div",{ref:a},o.default())}}}),jn=T(e.defineComponent({__name:"QFocusTrap",props:e.mergeModels({options:{},as:{}},{disabled:{type:Boolean},disabledModifiers:{}}),emits:["update:disabled"],setup(t){const o=t,n=e.useModel(t,"disabled");return(a,l)=>n.value?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createBlock(e.unref(zn),e.normalizeProps(e.mergeProps({key:1},o)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16))}})),te="data-scroll-locked",ve="right-scroll-bar-position",Se="width-before-scroll-bar",Gn="with-scroll-bars-hidden",Hn="--removed-body-scroll-bar-size",Qn={left:0,top:0,right:0,gap:0},$e=t=>parseInt(t||"",10)||0,Zn=t=>{const o=window.getComputedStyle(document.body),n=o[t==="padding"?"paddingLeft":"marginLeft"],a=o[t==="padding"?"paddingTop":"marginTop"],l=o[t==="padding"?"paddingRight":"marginRight"];return[$e(n),$e(a),$e(l)]},Jn=(t="margin")=>{if(typeof window>"u")return Qn;const o=Zn(t),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,a-n+o[2]-o[0])}};function Wn(){return document?document.createElement("style"):null}function Yn(t,o){t.appendChild(document.createTextNode(o))}function Xn(t){(document.head||document.getElementsByTagName("head")[0]).appendChild(t)}const Kn=()=>{let t=0,o=null;return{add:n=>{t===0&&(o=Wn())&&(Yn(o,n),Xn(o)),t++},remove:()=>{var n;t--,!t&&o&&((n=o.parentNode)==null||n.removeChild(o),o=null)}}},eo=T(e.defineComponent({__name:"QRemoveScrollBar",props:{noRelative:{type:Boolean},noImportant:{type:Boolean},gapMode:{default:"margin"}},setup(t){const o=t,n=Kn(),a=()=>{const r=parseInt(document.body.getAttribute(te)||"0",10);return isFinite(r)?r:0},l=({left:r,top:i,right:s,gap:u},d,f="margin",c)=>`
|
|
8
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function We(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Je(Object(n),!0).forEach(function(a){An(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Vn(t){return Nn(t)||In(t)||Ln(t)||Dn()}function Rn(t,o){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,o);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}function Mn(t){var o=Rn(t,"string");return typeof o=="symbol"?o:o+""}function Ln(t,o){if(t){if(typeof t=="string")return Ee(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(t,o):void 0}}var Ye={activateTrap:function(t,o){if(t.length>0){var n=t[t.length-1];n!==o&&n._setPausedState(!0)}var a=t.indexOf(o);a===-1||t.splice(a,1),t.push(o)},deactivateTrap:function(t,o){var n=t.indexOf(o);n!==-1&&t.splice(n,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},qn=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Tn=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},re=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Fn=function(t){return re(t)&&!t.shiftKey},Pn=function(t){return re(t)&&t.shiftKey},Xe=function(t){return setTimeout(t,0)},le=function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,n):t},pe=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},On=[],Un=function(t,o){var n=(o==null?void 0:o.document)||document,a=(o==null?void 0:o.trapStack)||On,l=We({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Fn,isKeyBackward:Pn},o),r={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i,s=function(p,g,k){return p&&p[g]!==void 0?p[g]:l[k||g]},u=function(p,g){var k=typeof(g==null?void 0:g.composedPath)=="function"?g.composedPath():void 0;return r.containerGroups.findIndex(function(S){var x=S.container,A=S.tabbableNodes;return x.contains(p)||(k==null?void 0:k.includes(x))||A.find(function(E){return E===p})})},d=function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=g.hasFallback,S=k===void 0?!1:k,x=g.params,A=x===void 0?[]:x,E=l[p];if(typeof E=="function"&&(E=E.apply(void 0,Vn(A))),E===!0&&(E=void 0),!E){if(E===void 0||E===!1)return E;throw new Error("`".concat(p,"` was specified but was not a node, or did not return a node"))}var q=E;if(typeof E=="string"){try{q=n.querySelector(E)}catch(y){throw new Error("`".concat(p,'` appears to be an invalid selector; error="').concat(y.message,'"'))}if(!q&&!S)throw new Error("`".concat(p,"` as selector refers to no known node"))}return q},f=function(){var p=d("initialFocus",{hasFallback:!0});if(p===!1)return!1;if(p===void 0||p&&!xe(p,l.tabbableOptions))if(u(n.activeElement)>=0)p=n.activeElement;else{var g=r.tabbableGroups[0],k=g&&g.firstTabbableNode;p=k||d("fallbackFocus")}else p===null&&(p=d("fallbackFocus"));if(!p)throw new Error("Your focus-trap needs to have at least one focusable element");return p},c=function(){if(r.containerGroups=r.containers.map(function(p){var g=vn(p,l.tabbableOptions),k=Sn(p,l.tabbableOptions),S=g.length>0?g[0]:void 0,x=g.length>0?g[g.length-1]:void 0,A=k.find(function(y){return ee(y)}),E=k.slice().reverse().find(function(y){return ee(y)}),q=!!g.find(function(y){return J(y)>0});return{container:p,tabbableNodes:g,focusableNodes:k,posTabIndexesFound:q,firstTabbableNode:S,lastTabbableNode:x,firstDomTabbableNode:A,lastDomTabbableNode:E,nextTabbableNode:function(y){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,$=g.indexOf(y);return $<0?B?k.slice(k.indexOf(y)+1).find(function(N){return ee(N)}):k.slice(0,k.indexOf(y)).reverse().find(function(N){return ee(N)}):g[$+(B?1:-1)]}}}),r.tabbableGroups=r.containerGroups.filter(function(p){return p.tabbableNodes.length>0}),r.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(r.containerGroups.find(function(p){return p.posTabIndexesFound})&&r.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function(p){var g=p.activeElement;if(g)return g.shadowRoot&&g.shadowRoot.activeElement!==null?m(g.shadowRoot):g},h=function(p){if(p!==!1&&p!==m(document)){if(!p||!p.focus){h(f());return}p.focus({preventScroll:!!l.preventScroll}),r.mostRecentlyFocusedNode=p,qn(p)&&p.select()}},b=function(p){var g=d("setReturnFocus",{params:[p]});return g||(g===!1?!1:p)},w=function(p){var g=p.target,k=p.event,S=p.isBackward,x=S===void 0?!1:S;g=g||pe(k),c();var A=null;if(r.tabbableGroups.length>0){var E=u(g,k),q=E>=0?r.containerGroups[E]:void 0;if(E<0)x?A=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:A=r.tabbableGroups[0].firstTabbableNode;else if(x){var y=r.tabbableGroups.findIndex(function(oe){var ie=oe.firstTabbableNode;return g===ie});if(y<0&&(q.container===g||xe(g,l.tabbableOptions)&&!ee(g,l.tabbableOptions)&&!q.nextTabbableNode(g,!1))&&(y=E),y>=0){var B=y===0?r.tabbableGroups.length-1:y-1,$=r.tabbableGroups[B];A=J(g)>=0?$.lastTabbableNode:$.lastDomTabbableNode}else re(k)||(A=q.nextTabbableNode(g,!1))}else{var N=r.tabbableGroups.findIndex(function(oe){var ie=oe.lastTabbableNode;return g===ie});if(N<0&&(q.container===g||xe(g,l.tabbableOptions)&&!ee(g,l.tabbableOptions)&&!q.nextTabbableNode(g))&&(N=E),N>=0){var G=N===r.tabbableGroups.length-1?0:N+1,Z=r.tabbableGroups[G];A=J(g)>=0?Z.firstTabbableNode:Z.firstDomTabbableNode}else re(k)||(A=q.nextTabbableNode(g))}}else A=d("fallbackFocus");return A},v=function(p){var g=pe(p);if(!(u(g,p)>=0)){if(le(l.clickOutsideDeactivates,p)){i.deactivate({returnFocus:l.returnFocusOnDeactivate});return}le(l.allowOutsideClick,p)||p.preventDefault()}},P=function(p){var g=pe(p),k=u(g,p)>=0;if(k||g instanceof Document)k&&(r.mostRecentlyFocusedNode=g);else{p.stopImmediatePropagation();var S,x=!0;if(r.mostRecentlyFocusedNode)if(J(r.mostRecentlyFocusedNode)>0){var A=u(r.mostRecentlyFocusedNode),E=r.containerGroups[A].tabbableNodes;if(E.length>0){var q=E.findIndex(function(y){return y===r.mostRecentlyFocusedNode});q>=0&&(l.isKeyForward(r.recentNavEvent)?q+1<E.length&&(S=E[q+1],x=!1):q-1>=0&&(S=E[q-1],x=!1))}}else r.containerGroups.some(function(y){return y.tabbableNodes.some(function(B){return J(B)>0})})||(x=!1);else x=!1;x&&(S=w({target:r.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(r.recentNavEvent)})),h(S||r.mostRecentlyFocusedNode||f())}r.recentNavEvent=void 0},D=function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r.recentNavEvent=p;var k=w({event:p,isBackward:g});k&&(re(p)&&p.preventDefault(),h(k))},V=function(p){(l.isKeyForward(p)||l.isKeyBackward(p))&&D(p,l.isKeyBackward(p))},R=function(p){Tn(p)&&le(l.escapeDeactivates,p)!==!1&&(p.preventDefault(),i.deactivate())},M=function(p){var g=pe(p);u(g,p)>=0||le(l.clickOutsideDeactivates,p)||le(l.allowOutsideClick,p)||(p.preventDefault(),p.stopImmediatePropagation())},_=function(){if(r.active)return Ye.activateTrap(a,i),r.delayInitialFocusTimer=l.delayInitialFocus?Xe(function(){h(f())}):h(f()),n.addEventListener("focusin",P,!0),n.addEventListener("mousedown",v,{capture:!0,passive:!1}),n.addEventListener("touchstart",v,{capture:!0,passive:!1}),n.addEventListener("click",M,{capture:!0,passive:!1}),n.addEventListener("keydown",V,{capture:!0,passive:!1}),n.addEventListener("keydown",R),i},L=function(){if(r.active)return n.removeEventListener("focusin",P,!0),n.removeEventListener("mousedown",v,!0),n.removeEventListener("touchstart",v,!0),n.removeEventListener("click",M,!0),n.removeEventListener("keydown",V,!0),n.removeEventListener("keydown",R),i},I=function(p){var g=p.some(function(k){var S=Array.from(k.removedNodes);return S.some(function(x){return x===r.mostRecentlyFocusedNode})});g&&h(f())},U=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,z=function(){U&&(U.disconnect(),r.active&&!r.paused&&r.containers.map(function(p){U.observe(p,{subtree:!0,childList:!0})}))};return i={get active(){return r.active},get paused(){return r.paused},activate:function(p){if(r.active)return this;var g=s(p,"onActivate"),k=s(p,"onPostActivate"),S=s(p,"checkCanFocusTrap");S||c(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=n.activeElement,g==null||g();var x=function(){S&&c(),_(),z(),k==null||k()};return S?(S(r.containers.concat()).then(x,x),this):(x(),this)},deactivate:function(p){if(!r.active)return this;var g=We({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},p);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,L(),r.active=!1,r.paused=!1,z(),Ye.deactivateTrap(a,i);var k=s(g,"onDeactivate"),S=s(g,"onPostDeactivate"),x=s(g,"checkCanReturnFocus"),A=s(g,"returnFocus","returnFocusOnDeactivate");k==null||k();var E=function(){Xe(function(){A&&h(b(r.nodeFocusedBeforeActivation)),S==null||S()})};return A&&x?(x(b(r.nodeFocusedBeforeActivation)).then(E,E),this):(E(),this)},pause:function(p){return r.active?(r.manuallyPaused=!0,this._setPausedState(!0,p)):this},unpause:function(p){return r.active?(r.manuallyPaused=!1,a[a.length-1]!==this?this:this._setPausedState(!1,p)):this},updateContainerElements:function(p){var g=[].concat(p).filter(Boolean);return r.containers=g.map(function(k){return typeof k=="string"?n.querySelector(k):k}),r.active&&c(),z(),this}},Object.defineProperties(i,{_isManuallyPaused:{value:function(){return r.manuallyPaused}},_setPausedState:{value:function(p,g){if(r.paused===p)return this;if(r.paused=p,p){var k=s(g,"onPause"),S=s(g,"onPostPause");k==null||k(),L(),z(),S==null||S()}else{var x=s(g,"onUnpause"),A=s(g,"onPostUnpause");x==null||x(),c(),_(),z(),A==null||A()}return this}}}),i.updateContainerElements(t),i};const zn=e.defineComponent({name:"UseFocusTrap",props:["as","options"],setup(t,{slots:o}){let n;const a=e.ref(),l=()=>n&&n.activate(),r=()=>n&&n.deactivate();return e.watch(()=>_e(a),i=>{i&&(n=Un(i,t.options||{}),l())},{flush:"post"}),e.onScopeDispose(()=>r()),()=>{if(o.default)return e.h(t.as||"div",{ref:a},o.default())}}}),jn=T(e.defineComponent({__name:"QFocusTrap",props:e.mergeModels({options:{},as:{}},{disabled:{type:Boolean},disabledModifiers:{}}),emits:["update:disabled"],setup(t){const o=t,n=e.useModel(t,"disabled");return(a,l)=>n.value?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createBlock(e.unref(zn),e.normalizeProps(e.mergeProps({key:1},o)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16))}})),te="data-scroll-locked",ve="right-scroll-bar-position",Se="width-before-scroll-bar",Gn="with-scroll-bars-hidden",Hn="--removed-body-scroll-bar-size",Zn={left:0,top:0,right:0,gap:0},$e=t=>parseInt(t||"",10)||0,Qn=t=>{const o=window.getComputedStyle(document.body),n=o[t==="padding"?"paddingLeft":"marginLeft"],a=o[t==="padding"?"paddingTop":"marginTop"],l=o[t==="padding"?"paddingRight":"marginRight"];return[$e(n),$e(a),$e(l)]},Jn=(t="margin")=>{if(typeof window>"u")return Zn;const o=Qn(t),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,a-n+o[2]-o[0])}};function Wn(){return document?document.createElement("style"):null}function Yn(t,o){t.appendChild(document.createTextNode(o))}function Xn(t){(document.head||document.getElementsByTagName("head")[0]).appendChild(t)}const Kn=()=>{let t=0,o=null;return{add:n=>{t===0&&(o=Wn())&&(Yn(o,n),Xn(o)),t++},remove:()=>{var n;t--,!t&&o&&((n=o.parentNode)==null||n.removeChild(o),o=null)}}},eo=T(e.defineComponent({__name:"QRemoveScrollBar",props:{noRelative:{type:Boolean},noImportant:{type:Boolean},gapMode:{default:"margin"}},setup(t){const o=t,n=Kn(),a=()=>{const r=parseInt(document.body.getAttribute(te)||"0",10);return isFinite(r)?r:0},l=({left:r,top:i,right:s,gap:u},d,f="margin",c)=>`
|
|
9
9
|
.${Gn} {
|
|
10
10
|
overflow: hidden ${c};
|
|
11
11
|
padding-right: ${u}px ${c};
|
|
@@ -42,5 +42,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
42
42
|
body[${te}] {
|
|
43
43
|
${Hn}: ${u}px;
|
|
44
44
|
}
|
|
45
|
-
`;return e.onMounted(()=>{document.body.setAttribute(te,(a()+1).toString());const r=Jn(o.gapMode);n.add(l(r,!o.noRelative,o.gapMode,o.noImportant?"":"!important"))}),e.onUnmounted(()=>{const r=a()-1;r<=0?document.body.removeAttribute(te):document.body.setAttribute(te,r.toString()),n.remove()}),(r,i)=>e.renderSlot(r.$slots,"default")}}));function to(t,o,n,a){const l=(a==null?void 0:a.offset)??0,r=(a==null?void 0:a.crossOffset)??0,i=(a==null?void 0:a.placement)??"bottom",s=t.getBoundingClientRect(),u=o.getBoundingClientRect(),d=n==null?void 0:n.getBoundingClientRect(),f=no(s,u,i,l),c=io(s,u,f),m=ao(c,f,l),h=ro(m,f,r),b=oo(h,u,f);let w;if(a!=null&&a.arrow){if(!d)throw new Error("[Quidgest UI] The arrow element must exist to compute its position");w=lo(b,s,u,d,f)}return{overlayCoords:b,arrowCoords:w,placement:f}}function no(t,o,n,a){const l=Ke(t,o,n,a);if(et(l)){const r=ne(n),i={top:"bottom",bottom:"top",left:"right",right:"left"}[r],s=Ke(t,o,i,a);if(et(s))return n;const u=uo(n);return u?`${i}-${u}`:i}return n}function oo(t,o,n){const a=fe(n),l=(i,s,u)=>Math.min(Math.max(i,s),u),r={...t};return a==="x"?r.x=l(t.x,8,window.innerWidth-o.width-8):r.y=l(t.y,8,window.innerHeight-o.height-8),r}function ao(t,o,n){const a=ne(o);return{x:t.x+(a==="left"?-n:a==="right"?n:0),y:t.y+(a==="top"?-n:a==="bottom"?n:0)}}function ro(t,o,n){const a=ne(o);return{x:t.x+(a==="top"||a==="bottom"?n:0),y:t.y+(a==="right"||a==="left"?n:0)}}function lo(t,o,n,a,l){if(fe(l)==="y"){const r=o.top+o.height/2,i=t.y+n.height/2,s=i-r,u=n.height/2-s-a.height/2+2;if(u>0&&u<n.height-a.height)return{y:u}}else{const r=o.left+o.width/2,i=t.x+n.width/2,s=i-r,u=n.width/2-s-a.width/2+2;if(u>0&&u<n.width-a.width)return{x:u}}}function io(t,o,n){const[a,l]=n.split("-"),r=t.x+t.width/2-o.width/2,i=t.y+t.height/2-o.height/2;let s;switch(a){case"top":s={x:r,y:t.y-o.height};break;case"bottom":s={x:r,y:t.y+t.height};break;case"left":s={x:t.x-o.width,y:i};break;case"right":s={x:t.x+t.width,y:i};break;default:throw new Error(`[Quidgest UI] Invalid placement value: ${n}`)}if(!l)return s;const u=fe(n)==="y"?"height":"width",d=fe(n),f=t[u]/2-o[u]/2;switch(l){case"start":s[d]-=f;break;case"end":s[d]+=f;break;default:throw new Error(`[Quidgest UI] Invalid alignment value: ${l}`)}return s}function Ke(t,o,n,a){const l=ne(n);let r=0;switch(l){case"top":r=t.top-(o.height+a);break;case"bottom":r=window.innerHeight-t.bottom-(o.height+a);break;case"left":r=t.left-(o.width+a);break;case"right":r=window.innerWidth-t.right-(o.width+a);break;default:throw new Error(`[Quidgest UI] Invalid side value: ${l}`)}return r}function so(t){return t==="x"?"y":"x"}function co(t){const o=ne(t);return["left","right"].includes(o)?"x":"y"}function fe(t){return so(co(t))}function ne(t){const[o]=t.split("-");return o}function uo(t){const[,o]=t.split("-");return o}function et(t){return t<0}function po(t){return typeof t=="string"?document.querySelector(t):t}const fo=["id"],mo=["role"],go=T(e.defineComponent({inheritAttrs:!1,__name:"QOverlay",props:e.mergeModels({id:{},class:{},anchor:{},appearance:{default:"regular"},arrow:{type:Boolean},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean},backdropClass:{},delay:{default:500},nonModal:{type:Boolean},scrollLock:{type:Boolean},offset:{default:8},crossOffset:{default:0},persistent:{type:Boolean},placement:{default:"right"},spy:{type:Boolean},transition:{default:"fade"},trigger:{default:"click"},width:{default:"auto"},focusTrap:{type:Boolean},centerVertically:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),{class:r}=Me(),i=e.computed(()=>["q-overlay",`q-overlay--${ne(c.placement)}`,r.value,{"q-overlay--independent":s.value,"q-overlay--inverted":n.appearance==="inverted","q-overlay--center":n.centerVertically},n.class]),s=e.computed(()=>n.anchor===void 0),u=e.computed(()=>l.value&&!n.nonModal),d=e.computed(()=>(l.value||c.animating)&&n.scrollLock),f=e.computed(()=>!n.inline&&(l.value||c.animating)),c=e.reactive({animating:!1,top:0,left:0,width:0,placement:n.placement}),m=e.reactive({top:void 0,left:void 0,hidden:!0});e.watch(l,k);const h=e.computed(()=>{if(s.value)return;const C=x(),X=n.width==="anchor",H=X?C==null?void 0:C.getBoundingClientRect().width:void 0;return{top:`${c.top}px`,left:`${c.left}px`,width:H!==void 0?`${H}px`:void 0}}),b=e.computed(()=>{if(n.arrow)return{top:m.top!==void 0?`${m.top}px`:void 0,left:m.left!==void 0?`${m.left}px`:void 0,opacity:m.hidden?0:1}}),w=e.ref(null),v=e.ref(null),P=e.ref(null);function D(){const C=x();if(!C||!v.value)return;const X={placement:n.placement,width:n.width,offset:n.offset,crossOffset:n.crossOffset,arrow:n.arrow},H=to(C,v.value,(w==null?void 0:w.value)??void 0,X);c.left=H.overlayCoords.x,c.top=H.overlayCoords.y,c.placement=H.placement,m.hidden=H.arrowCoords===void 0,H.arrowCoords&&(m.top=H.arrowCoords.y,m.left=H.arrowCoords.x)}e.watch(()=>n.placement,()=>e.nextTick(D));let V;function R(){_(0)}function M(){_(n.delay)}function _(C){V&&I(),V=window.setTimeout(()=>{l.value=!0},C)}function L(){if(V&&I(),l.value=!1,n.anchor&&n.trigger==="click"){const C=x();e.nextTick(()=>C==null?void 0:C.focus())}}function I(){clearTimeout(V),V=void 0}function U(){e.nextTick(ie),a("enter")}function z(){S()}function p(){a("leave")}function g(){S(),Ea()}function k(){c.animating=!0}function S(){c.animating=!1}function x(){return n.anchor?po(n.anchor):null}function A(C){n.persistent&&C.preventDefault()}function E(C){var X;if(n.persistent){C.preventDefault();return}let H=!1;C.defaultPrevented||C.detail.originalEvent.type==="pointerdown"&&(H=!0);const va=C.detail.originalEvent.target;if((X=x())!=null&&X.contains(va)){C.preventDefault();return}C.detail.originalEvent.type==="focusin"&&H&&C.preventDefault()}function q(){L()}let y;function B(){const C=x();if(C)switch(y=new MutationObserver(D),y.observe(C,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),n.trigger){case"click":C.addEventListener("click",R);break;case"hover":C.addEventListener("mouseenter",M),C.addEventListener("mouseleave",L),C.addEventListener("focusin",R),C.addEventListener("focusout",L);break}}function $(){const C=x();if(C)switch(y==null||y.disconnect(),n.trigger){case"click":C.removeEventListener("click",R);break;case"hover":C.removeEventListener("mouseenter",M),C.removeEventListener("mouseleave",L),C.removeEventListener("focusin",R),C.removeEventListener("focusout",L);break}}function N(){window.addEventListener("resize",D),n.scrollLock||window.addEventListener("scroll",D)}function G(){window.removeEventListener("resize",D),n.scrollLock||window.removeEventListener("scroll",D)}let Q;function oe(){x()?(D(),Q=window.setTimeout(oe,100)):L()}function ie(){var C;s.value||(N(),n.spy?oe():D()),(s.value||n.trigger==="click")&&((C=v.value)==null||C.focus())}function Ea(){s.value||G(),n.spy&&(clearTimeout(Q),Q=void 0)}return e.onMounted(()=>{e.nextTick(B)}),e.onBeforeUnmount($),(C,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!f.value,to:n.attach},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([n.backdropClass,"q-overlay__underlay",{"q-overlay__underlay--blur":n.backdropBlur}])},null,2)):e.createCommentVNode("v-if",!0)]),_:1}),e.createVNode(e.Transition,{name:n.transition,appear:"",onEnter:U,onAfterEnter:z,onLeave:p,onAfterLeave:g},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:n.id,ref_key:"overlayContainerRef",ref:P,tabindex:"-1",class:e.normalizeClass(i.value),style:e.normalizeStyle(h.value)},[e.createVNode(e.unref(nn),{onDismiss:q,onInteractOutside:E,onPointerDownOutside:A},{default:e.withCtx(()=>[P.value?(e.openBlock(),e.createBlock(e.unref(jn),{key:0,disabled:n.nonModal||!l.value,options:{fallbackFocus:P.value}},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"overlayRef",ref:v,class:"q-overlay__content",tabindex:"-1",role:u.value?"dialog":void 0},C.$attrs),[n.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowRef",ref:w,role:"presentation",class:"q-overlay__arrow",style:e.normalizeStyle(b.value)},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(C.$slots,"default")],16,mo)]),_:3},8,["disabled","options"])):e.createCommentVNode("v-if",!0)]),_:3})],14,fo)):e.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"])),d.value?(e.openBlock(),e.createBlock(e.unref(eo),{key:0})):e.createCommentVNode("v-if",!0)],64))}})),bo=[{id:"button",icon:{icon:"check"},props:{variant:"bold",label:"Ok"}}],ho={icon:"check-circle-outline"},yo={close:{icon:"close"}},wo={key:0,class:"q-dialog__header"},ko={key:0,class:"q-dialog__header-title"},Bo={key:1,class:"q-dialog__body"},_o={key:0,class:"q-dialog__body-icon"},Co={class:"q-dialog__body-text"},xo=["innerHTML"],Eo={key:1},vo={key:0,class:"q-dialog__input"},So={key:2,class:"q-dialog__footer"},$o={key:0,class:"q-dialog__footer-buttons"},No=e.defineComponent({__name:"QDialog",props:e.mergeModels({id:{},class:{},title:{},text:{},icon:{default:()=>ho},buttons:{default:()=>bo},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean,default:!0},dismissible:{type:Boolean},html:{type:Boolean,default:!0},icons:{default:()=>yo},size:{default:"small"},centerVertically:{type:Boolean},input:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),r=e.ref(""),i=e.ref(""),s=e.computed(()=>["q-dialog",n.class]),u=e.computed(()=>`q-overlay--${n.size}`);function d(){l.value=!1}function f(h){var b,w;if(h.action){if((b=n.input)!=null&&b.validator&&(i.value=n.input.validator(e.unref(r)),e.unref(i)))return;(w=h.action)==null||w.call(h,e.unref(r))}d()}function c(){a("enter")}function m(){a("leave")}return(h,b)=>(e.openBlock(),e.createBlock(e.unref(go),{id:n.id,modelValue:l.value,"onUpdate:modelValue":b[1]||(b[1]=w=>l.value=w),"backdrop-class":"q-dialog__underlay","scroll-lock":"",persistent:"",inline:n.inline,attach:n.attach,"backdrop-blur":n.backdropBlur,"center-vertically":n.centerVertically,class:e.normalizeClass(u.value),onEnter:c,onLeave:m},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(s.value)},[n.title||h.$slots.header||h.$slots["header.prepend"]||h.$slots["header.append"]?(e.openBlock(),e.createElementBlock("div",wo,[e.renderSlot(h.$slots,"header",{},()=>[e.renderSlot(h.$slots,"header.prepend"),n.title?(e.openBlock(),e.createElementBlock("span",ko,e.toDisplayString(n.title),1)):e.createCommentVNode("v-if",!0),e.renderSlot(h.$slots,"header.append")])])):e.createCommentVNode("v-if",!0),n.icon||n.text||h.$slots.body?(e.openBlock(),e.createElementBlock("div",Bo,[e.renderSlot(h.$slots,"body",{},()=>{var w;return[e.renderSlot(h.$slots,"body.icon",{},()=>[n.icon?(e.openBlock(),e.createElementBlock("span",_o,[e.createVNode(e.unref(F),e.normalizeProps(e.guardReactiveProps(n.icon)),null,16)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Co,[n.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:n.text},null,8,xo)):(e.openBlock(),e.createElementBlock("div",Eo,e.toDisplayString(n.text),1))]),n.input?(e.openBlock(),e.createElementBlock("div",vo,[e.createVNode(e.unref(Pe),{modelValue:r.value,"onUpdate:modelValue":b[0]||(b[0]=v=>r.value=v),invalid:!!i.value,placeholder:(w=n.input)==null?void 0:w.placeholder,size:"block"},{extras:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(F),{key:0,icon:"exclamation-sign"})):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(i.value),1)]),_:1},8,["modelValue","invalid","placeholder"])])):e.createCommentVNode("v-if",!0),e.renderSlot(h.$slots,"body.append")]})])):e.createCommentVNode("v-if",!0),n.buttons||h.$slots["footer.append"]?(e.openBlock(),e.createElementBlock("div",So,[n.buttons?(e.openBlock(),e.createElementBlock("span",$o,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.buttons,w=>(e.openBlock(),e.createBlock(e.unref(j),e.mergeProps({ref_for:!0},w.props,{key:w.id,onClick:()=>f(w)}),{default:e.withCtx(()=>[w.icon?(e.openBlock(),e.createBlock(e.unref(F),e.mergeProps({key:0,ref_for:!0},w.icon),null,16)):e.createCommentVNode("v-if",!0)]),_:2},1040,["onClick"]))),128))])):e.createCommentVNode("v-if",!0),e.renderSlot(h.$slots,"footer.append")])):e.createCommentVNode("v-if",!0),n.dismissible?(e.openBlock(),e.createBlock(e.unref(j),{key:3,class:"q-dialog__close",variant:"text",onClick:d},{default:e.withCtx(()=>[e.createVNode(e.unref(F),e.normalizeProps(e.guardReactiveProps(n.icons.close)),null,16)]),_:1})):e.createCommentVNode("v-if",!0)],2)]),_:3},8,["id","modelValue","inline","attach","backdrop-blur","center-vertically","class"]))}}),me=e.reactive({dialogs:[]});function Ao(){function t(n,a,l){const r=ke(a);return me.dialogs.push({id:r,props:n,options:l}),r}function o(n){const a=me.dialogs.findIndex(l=>l.id===n);a!==-1&&me.dialogs.splice(a,1)}return{...me,addDialog:t,removeDialog:o}}const Io=e.defineComponent({inheritAttrs:!1,__name:"QDialogProvider",props:{inline:{type:Boolean}},emits:["leave"],setup(t,{emit:o}){const n=t,a=o,{dialogs:l,removeDialog:r}=Ao();function i(s){r(s),a("leave",s)}return(s,u)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),d=>(e.openBlock(),e.createBlock(e.unref(tt),e.mergeProps({key:d.id,ref_for:!0},d.props,{"model-value":"",inline:n.inline,onLeave:()=>i(d.id)}),null,16,["inline","onLeave"]))),128))}}),tt=T(No);T(Io);const Do=["id","required","placeholder","readonly","disabled","maxlength","rows","cols","resize","wrap"],Vo=T(e.defineComponent({inheritAttrs:!1,__name:"QTextArea",props:e.mergeModels({id:{},class:{},label:{},for:{},required:{type:Boolean},size:{},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean},placeholder:{},maxLength:{},rows:{default:3},cols:{},resize:{default:"vertical"},wrap:{default:"soft"},autosize:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),a=e.computed({get:()=>n.value,set:d=>{const f=o.maxLength;n.value=f?d==null?void 0:d.slice(0,f):d}});e.watch(n,d=>a.value=d,{immediate:!0});const l=ke(o.id),r=e.computed(()=>o.readonly||o.disabled?void 0:o.placeholder),i=e.computed(()=>({input:o.autosize?u:null})),s=e.ref(),{triggerResize:u}=un({element:e.computed(()=>o.autosize?s.value:void 0),styleProp:"minHeight"});return(d,f)=>(e.openBlock(),e.createBlock(e.unref(Fe),{class:e.normalizeClass(["q-text-area",o.class]),for:e.unref(l),label:o.label,size:o.size,readonly:o.readonly,disabled:o.disabled,required:o.required},e.createSlots({"label.prepend":e.withCtx(()=>[e.renderSlot(d.$slots,"label.prepend")]),"label.append":e.withCtx(()=>[e.renderSlot(d.$slots,"label.append")]),default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(l),ref_key:"textareaRef",ref:s,"onUpdate:modelValue":f[0]||(f[0]=c=>a.value=c),class:"q-text-area__input",required:o.required,placeholder:r.value,readonly:o.readonly,disabled:o.disabled,maxlength:o.maxLength,rows:o.rows,cols:o.cols,resize:o.resize,wrap:o.wrap},d.$attrs,e.toHandlers(i.value,!0)),null,16,Do),[[e.vModelText,a.value]])]),_:2},[d.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"prepend")]),key:"0"}:void 0,d.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"append")]),key:"1"}:void 0,d.$slots.extras?{name:"extras",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"extras")]),key:"2"}:void 0]),1032,["class","for","label","size","readonly","disabled","required"]))}}));function W(){return{copy:"Copy",apply:"Apply",applyAll:"Apply all",chatbotTitle:"ChatBot",sendMessage:"Send message",clearChat:"Clear chat",inputLabel:"What can I help with?",imageUpload:"Upload Image",imageUploadQButton:"Upload Image",goodResponse:"Good response",badResponse:"Bad response",initialMessage:"Howdy! I am GenioBot 👋, Quidgest's personal AI assistant! How can I help you?",initialAgentMessage:"Just a temporary message while we are working on the agent mode",loginError:"Uh oh, I could not authenticate with the Quidgest API endpoint 😓",botIsSick:"*cough cough* GenioBot is not feeling alright 🥴️🤒, looks like something failed!",commentDialogTitle:"Would you like to add a comment?",commentPlaceholder:"Type your comment here (optional)...",copyResponse:"Copy response",submitButton:"Submit",cancelButton:"Cancel",senderImage:"Sender Image",imagePreview:"Image preview",regenerateResponsePrompt:"Regenerate a new response for field {0}",regenerateResponse:"Regenerate response",generatingResponse:"Generating",suggestionsForField:"Suggestions for field:",fileUpload:"Upload File"}}async function nt(t,o){var u,d,f,c,m,h;const n=new AbortController,a=n.signal,r=(await K({...t,headers:{Accept:"text/event-stream"},responseType:"stream",signal:a,adapter:"fetch"})).data;if(!r||!(r instanceof ReadableStream))throw new Error("Invalid stream response");const i=r.getReader(),s=new TextDecoder;for(;;){const{done:b,value:w}=await i.read();if(b){(u=o.onDone)==null||u.call(o);break}const P=s.decode(w,{stream:!0}).split(/\n\n+/);for(const D of P){const V=D.trim().split(`
|
|
46
|
-
`);let R="",M="";for(const _ of V)_.startsWith("event:")?R=_.replace("event:","").trim():_.startsWith("data:")&&(M=_.replace("data:","").trim());if(R||(R="message"),!!M)try{const _=JSON.parse(M);switch(R){case"message":(d=o.onMessage)==null||d.call(o,_.value);break;case"error":(f=o.onError)==null||f.call(o,new Error(_.value));break;case"field_metadata":(c=o.onFieldMetadata)==null||c.call(o,_);break;case"done":(m=o.onDone)==null||m.call(o);break;default:console.warn(`Unknown event type: ${R}`)}}catch(_){(h=o.onError)==null||h.call(o,_),console.error("Error processing event:",_);continue}finally{b&&(i.releaseLock(),n.abort())}}}}function ot(t){const o=e.ref(!1),n=e.ref(null);async function a(d){o.value=!0,n.value=null;try{return{data:(await K({...d,baseURL:t})).data,error:null}}catch(f){if(f instanceof Error)return n.value=f,console.error("Error in API request:",f),{data:null,error:f}}finally{o.value=!1}return{data:null,error:new Error("Unknown error occurred in baseRequest")}}async function l(d,f,c,m){return await a({method:"POST",url:"/prompt/load",data:{username:d,project:f,agentID:c,formId:m}})}async function r(d,f,c){o.value=!0;try{return await nt({method:"POST",url:`${t}/prompt/submit`,data:d},{onMessage:m=>{f(m)},onDone:()=>o.value=!1})}catch(m){throw o.value=!1,c==null||c(m),console.error("Error in sendPrompt:",m),m}}async function i(d,f,c,m){o.value=!0;try{return await nt({method:"POST",url:`${t}/get-job-result`,data:{jobId:d}},{onMessage:h=>f(h),onFieldMetadata:h=>c(h),onDone:()=>o.value=!1})}catch(h){n.value=h,m==null||m(h),o.value=!1}}async function s(d,f,c,m){return await a({method:"POST",url:"/prompt/clear",data:{username:d,project:f,agentID:c,formId:m}})}async function u(d,f,c){return await a({method:"POST",url:"/prompt/feedback",data:{messageSessionID:c,feedbackValue:d,feedbackComment:f}})}return{isLoading:o,lastError:n,getChatData:l,clearChatData:s,getJobResultData:i,sendPrompt:r,handleFeedback:u}}const Ro=["innerHTML"],ge=e.defineComponent({__name:"MarkdownRender",props:{source:{},options:{},plugins:{}},setup(t){const o=t,n=e.ref(new st({html:!0,breaks:!0,...o.options??{}}));o.plugins&&o.plugins.forEach(l=>n.value.use(l));const a=e.computed(()=>n.value.render(o.source));return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:"markdown-renderer",innerHTML:a.value},null,8,Ro))}});function at(t,o){switch(t){case"date":return new Date(o).toLocaleDateString();case"number":return parseFloat(o);case"boolean":return o.toLowerCase()==="true";default:return o.toString()}}const Mo={class:"q-field-preview"},Lo={class:"q-field-preview__toolbar"},qo={class:"q-field-preview__footer"},To=e.defineComponent({__name:"FieldPreview",props:{name:{},text:{},type:{},disabled:{type:Boolean},applied:{type:Boolean}},emits:["apply","regenerate"],setup(t,{emit:o}){const n=t,a=o,l=W(),r=e.ref(n.applied),i=e.ref(!1),s=e.computed(()=>n.disabled||r.value),u=e.computed(()=>n.disabled||i.value),d=e.computed(()=>n.type==="text"||n.type==="multiline_text"?ge:"div"),f=e.computed(()=>{const b={};return d.value===ge?b.source=n.text:b.innerHTML=n.text,b}),c=e.computed(()=>{const b=["q-field-preview__content"];return d.value!==ge&&b.push("preserve-whitespace"),b});function m(){if(r.value)return;r.value=!0;const b=at(n.type,n.text);a("apply",b)}function h(){i.value||(i.value=!0,a("regenerate",n.name))}return(b,w)=>(e.openBlock(),e.createElementBlock("div",Mo,[e.createElementVNode("div",Lo,[e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString(e.unref(l).suggestionsForField)+" ",1),e.createElementVNode("b",null,e.toDisplayString(n.name),1)])]),e.createElementVNode("div",{class:e.normalizeClass(c.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.normalizeProps(e.guardReactiveProps(f.value)),null,16))],2),e.createElementVNode("div",qo,[e.createVNode(e.unref(qe),{borderless:""},{default:e.withCtx(()=>[e.createVNode(e.unref(j),{title:e.unref(l).regenerateResponse,disabled:u.value,readonly:u.value,borderless:"",onClick:h},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"reset"})]),_:1},8,["title","disabled","readonly"]),e.createVNode(e.unref(j),{label:e.unref(l).apply,"data-testid":"apply-button",disabled:s.value,readonly:s.value,onClick:m},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"apply"})]),_:1},8,["label","disabled","readonly"])]),_:1})])]))}}),Fo={class:"pulsing-dots"},Po={class:"generating-text"},Oo={class:"dots-container"},Uo=e.defineComponent({__name:"PulseDots",setup(t){const o=[1,2,3],n=W();return(a,l)=>(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("span",Po,e.toDisplayString(e.unref(n).generatingResponse),1),e.createElementVNode("div",Oo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(r,i)=>e.createElementVNode("span",{key:i,class:"dot",style:e.normalizeStyle({animationDelay:i*.2+"s"})}," • ",4)),64))])]))}}),zo={class:"q-chatbot__message-container"},jo={class:"q-chatbot__message-wrapper"},Go={key:0,class:"q-chatbot__image-preview"},Ho=["src","alt"],Qo={key:1,class:"q-chatbot__file-preview-container"},Zo={class:"q-chatbot__file-icon-container"},Jo={class:"q-chatbot__file-info"},Wo={class:"q-chatbot__file-name"},Yo={class:"q-chatbot__file-extension"},Xo={class:"q-chatbot__message"},Ko={key:1,class:"q-chatbot__text q-chatbot__user-text"},ea=e.defineComponent({__name:"ChatBotMessage",props:{sender:{default:"user"},message:{},date:{default:()=>new Date},loading:{type:Boolean},dateFormat:{},file:{},apiEndpoint:{},sessionID:{},userImage:{default:void 0},chatbotImage:{},isWelcomeMessage:{type:Boolean},fields:{default:()=>[]}},emits:["apply-fields","regenerate"],setup(t,{emit:o}){const n=t,a=o,l=W(),{handleFeedback:r}=ot(n.apiEndpoint),i=e.computed(()=>n.sender==="bot"&&!Object.values(l||{}).includes(n.message||"")&&!n.isWelcomeMessage),s=e.computed(()=>{var b;return((b=n.file)==null?void 0:b.fileData.type.startsWith("image/"))??!1}),u=e.computed(()=>n.sender==="bot"?n.chatbotImage:n.userImage),d=e.computed(()=>{var w,v;return(w=n.file)!=null&&w.fileData?((v=n.file.fileData.name.split(".").pop())==null?void 0:v.toUpperCase())??"":""});function f(){n.message&&navigator.clipboard.writeText(n.message).then(()=>{console.log("Response copied to clipboard")}).catch(b=>{console.error("Failed to copy response: ",b)})}function c(b,w){a("apply-fields",[{id:w.id,text:b}])}function m(){if(!n.fields||n.fields.length===0)return;const b=n.fields.map(w=>({id:w.id,text:at(w.type,w.text)}));a("apply-fields",b)}function h(b,w){b===null||w===null||!n.sessionID||r(b,w,n.sessionID)}return(b,w)=>{var v,P,D;return e.openBlock(),e.createElementBlock("div",zo,[e.createVNode(e.unref(F),{type:"img",icon:u.value,alt:e.unref(l).senderImage,class:"q-chatbot__profile"},null,8,["icon","alt"]),e.createElementVNode("div",jo,[s.value?(e.openBlock(),e.createElementBlock("div",Go,[e.createElementVNode("img",{src:(v=n.file)==null?void 0:v.previewUrl,alt:e.unref(l).imagePreview},null,8,Ho)])):(P=n.file)!=null&&P.fileData&&!s.value?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("div",Zo,[e.createVNode(e.unref(F),{icon:"file",class:"q-chatbot__file-icon"})]),e.createElementVNode("div",Jo,[e.createElementVNode("span",Wo,e.toDisplayString((D=n.file)==null?void 0:D.fileData.name),1),e.createElementVNode("span",Yo,e.toDisplayString(d.value),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Xo,[b.loading?(e.openBlock(),e.createBlock(Uo,{key:0})):n.sender==="bot"&&n.fields.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.fields,(V,R)=>(e.openBlock(),e.createBlock(e.unref(To),{key:R,class:"q-chatbot__text",text:V.text||"",name:V.name,type:V.type,disabled:b.loading,onRegenerate:()=>a("regenerate",V.name),onApply:M=>c(M,V)},null,8,["text","name","type","disabled","onRegenerate","onApply"]))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.sender==="bot"?(e.openBlock(),e.createBlock(e.unref(ge),{key:0,class:"q-chatbot__text",source:n.message||""},null,8,["source"])):(e.openBlock(),e.createElementBlock("div",Ko,e.toDisplayString(n.message),1))],64))])]),e.createVNode(e.unref(ia),{"show-buttons":i.value,loading:n.loading,"date-format":n.dateFormat,onCopyResponse:f,onSubmitFeedback:h,onApplyAll:m},null,8,["show-buttons","loading","date-format"])])}}}),O=[];for(let t=0;t<256;++t)O.push((t+256).toString(16).slice(1));function ta(t,o=0){return(O[t[o+0]]+O[t[o+1]]+O[t[o+2]]+O[t[o+3]]+"-"+O[t[o+4]]+O[t[o+5]]+"-"+O[t[o+6]]+O[t[o+7]]+"-"+O[t[o+8]]+O[t[o+9]]+"-"+O[t[o+10]]+O[t[o+11]]+O[t[o+12]]+O[t[o+13]]+O[t[o+14]]+O[t[o+15]]).toLowerCase()}let Ne;const na=new Uint8Array(16);function oa(){if(!Ne){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ne=crypto.getRandomValues.bind(crypto)}return Ne(na)}const rt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function lt(t,o,n){var l;if(rt.randomUUID&&!o&&!t)return rt.randomUUID();t=t||{};const a=t.random??((l=t.rng)==null?void 0:l.call(t))??oa();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,ta(a)}const Y=e.ref([]),be=e.ref(1);function it(){function t(r,i,s,u,d){const f={id:be.value++,message:r,date:new Date,sender:i||"bot",sessionID:u||lt(),file:s,isWelcomeMessage:d,fields:[]};return Y.value.push(f),f}function o(){return Y.value.find(r=>r.id===be.value-1)}function n(){Y.value=[],be.value=1}function a(r){Y.value=Y.value.filter(i=>i.id!==r)}function l(){return Y.value}return{messages:Y,nextMessageId:be,addChatMessage:t,getLastMessage:o,clearMessages:n,getMessages:l,deleteMessageById:a}}const aa={class:"q-chatbot__dialog-title"},ra={key:0,class:"q-chatbot__feedback-buttons"},la={class:"q-chatbot__sender"},ia=e.defineComponent({__name:"ChatBotMessageButtons",props:{loading:{type:Boolean},showButtons:{type:Boolean},dateFormat:{},date:{}},emits:["submit-feedback","copy-response","apply-all"],setup(t,{emit:o}){const n=t,a=o,l=W(),{getLastMessage:r}=it(),i=e.ref(!1),s=e.ref(""),u=e.ref(null),d=e.ref(!1),f=e.computed(()=>n.loading||d.value),c=n.date||new Date,m=r(),h=e.computed(()=>m?m.fields&&m.fields.length>1:!1),b=[{id:"confirm-btn",action:_,props:{label:l.submitButton,class:"q-chatbot__dialog-confirm-button"},icon:{icon:"submit"}},{id:"cancel-btn",props:{label:l.cancelButton,class:"q-chatbot__dialog-cancel-button"},icon:{icon:"cancel"}}],w=e.computed(()=>n.dateFormat?P(c,"HH:mm"):c.toLocaleString()),v=e.computed(()=>`${w.value}`);function P(I,U){const z=I.getDate().toString().padStart(2,"0"),p=(I.getMonth()+1).toString().padStart(2,"0"),g=I.getFullYear().toString().padStart(2,"0"),k=I.getHours().toString().padStart(2,"0"),S=I.getMinutes().toString().padStart(2,"0"),x=I.getSeconds().toString().padStart(2,"0");return U.replace("dd",z).replace("MM",p).replace("yyyy",g).replace("HH",k).replace("mm",S).replace("ss",x)}function D(I){i.value=!0,s.value="",u.value=I}function V(){D(0)}function R(){D(1)}function M(){d.value||(d.value=!0,a("apply-all"))}function _(){u.value&&(a("submit-feedback",u.value,s.value),i.value=!1,s.value="",u.value=null)}function L(){a("copy-response")}return(I,U)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(tt),{modelValue:i.value,"onUpdate:modelValue":U[1]||(U[1]=z=>i.value=z),inline:"",buttons:b},{body:e.withCtx(()=>[e.createElementVNode("div",aa,e.toDisplayString(e.unref(l).commentDialogTitle),1),e.createVNode(e.unref(Pe),{modelValue:s.value,"onUpdate:modelValue":U[0]||(U[0]=z=>s.value=z),class:"q-chatbot__dialog-comment-input","max-length":150,size:"large",placeholder:e.unref(l).commentPlaceholder},null,8,["modelValue","placeholder"])]),_:1},8,["modelValue"]),I.showButtons?(e.openBlock(),e.createElementBlock("div",ra,[e.createVNode(e.unref(qe),null,{default:e.withCtx(()=>[e.createVNode(e.unref(j),{title:e.unref(l).goodResponse,class:"q-chatbot__good-response-button",borderless:"",disabled:n.loading,onClick:R},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"thumb-up"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(j),{title:e.unref(l).badResponse,class:"q-chatbot__bad-response-button",borderless:"",disabled:n.loading,onClick:V},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"thumb-down"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(j),{title:e.unref(l).copyResponse,class:"q-chatbot__copy-button",borderless:"",disabled:n.loading,onClick:L},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"copy-content"})]),_:1},8,["title","disabled"]),h.value?(e.openBlock(),e.createBlock(e.unref(j),{key:0,title:e.unref(l).applyAll,class:"q-chatbot__apply-all-button",borderless:"",disabled:f.value,readonly:f.value,label:e.unref(l).applyAll,onClick:M},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"apply-all"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",la,e.toDisplayString(v.value),1)],64))}}),sa={class:"q-chatbot__tools"},ca={class:"q-chatbot__tools__select"},da=e.defineComponent({__name:"ChatToolBar",props:{disabled:{type:Boolean},availableAgents:{default:()=>[]},selectedAgentKey:{}},emits:["clear","change-chat"],setup(t,{emit:o}){const n=t,a=o,{clearChat:l}=W(),r={key:"",value:"Default Chat",formId:""},i=e.computed(()=>n.availableAgents&&n.availableAgents.length>0),s=e.ref(n.selectedAgentKey||r.key);e.watch(()=>n.selectedAgentKey,c=>{s.value=c||r.key});const u=e.computed(()=>{var m;const c=(m=n.availableAgents)==null?void 0:m.map(h=>({key:h.key,value:h.value,formId:h.formId}));return c==null||c.push(r),c||[r]});function d(){a("clear")}function f(c){const m=u.value.find(h=>h.key===c);if(m){if(m.key===r.key){a("change-chat",{key:"",formId:""});return}a("change-chat",m)}}return(c,m)=>{const h=e.resolveComponent("q-select");return e.openBlock(),e.createElementBlock("div",sa,[e.createElementVNode("div",ca,[i.value?(e.openBlock(),e.createBlock(h,{key:0,modelValue:s.value,"onUpdate:modelValue":[m[0]||(m[0]=b=>s.value=b),f],inline:"",class:"q-chatbot__tools-select-input",size:"medium",items:u.value},null,8,["modelValue","items"])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(j),{title:e.unref(l),disabled:n.disabled,class:"q-chatbot__tools-clear",borderless:"",onClick:d},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"bin"})]),_:1},8,["title","disabled"])])}}}),ua={class:"q-chatbot__input-wrapper"},pa={key:0,class:"q-chatbot__file-preview"},fa=["src","alt"],ma={key:1,class:"q-chatbot__file-preview",tabindex:"0"},ga={class:"q-chatbot__file-name"},ba={class:"q-chatbot__input"},ha={class:"q-chatbot__send-container"},ya=["accept"],wa=e.defineComponent({__name:"ChatBotInput",props:{disabled:{type:Boolean},loading:{type:Boolean},userPrompt:{},agentId:{}},emits:["send-message"],setup(t,{emit:o}){const n=t,a=o,l=W(),r=e.ref(null),i=e.ref(null),s=e.ref(""),u=e.ref(!1),d=e.computed(()=>".png,.jpeg,.jpg,.svg,.webp,.pdf,.doc,.docx"),f=e.computed(()=>i.value?i.value.type.startsWith("image/")??!1:!1),c=e.ref(n.userPrompt??""),m=e.computed(()=>n.disabled||n.loading||c.value.trim().length===0);function h(_){_.preventDefault(),n.disabled||(u.value=!0)}const b=e.computed(()=>({"q-chatbot__footer-disabled":n.disabled,"drag-over":u.value&&!i.value}));function w(_){_.preventDefault(),u.value=!1}function v(_){var I;if(_.preventDefault(),u.value=!1,n.disabled||i.value)return;const L=(I=_.dataTransfer)==null?void 0:I.files;L&&P(L[0])}function P(_){i.value=_,_.type.startsWith("image/")?s.value=URL.createObjectURL(_):s.value=""}function D(){if(!(c.value.trim()===""||n.loading||n.disabled)){if(i.value){const _={fileData:i.value,previewUrl:s.value??""};a("send-message",c.value,_),V()}else a("send-message",c.value);c.value=""}}function V(){i.value=null,s.value="",r.value&&(r.value.value="",r.value.files=null)}function R(){var _;(_=r.value)==null||_.click()}function M(_){var I;const L=_.target;(I=L.files)!=null&&I[0]&&P(L.files[0])}return(_,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(Te),{label:e.unref(l).inputLabel},null,8,["label"]),e.createElementVNode("div",{class:e.normalizeClass(["q-chatbot__footer",b.value]),onDragover:e.withModifiers(h,["prevent"]),onDragleave:e.withModifiers(w,["prevent"]),onDrop:e.withModifiers(v,["prevent"])},[e.createElementVNode("div",ua,[i.value?(e.openBlock(),e.createElementBlock("div",pa,[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"q-chatbot__image-preview",src:s.value,tabindex:"0",alt:e.unref(l).imagePreview},null,8,fa)):(e.openBlock(),e.createElementBlock("div",ma,[e.createVNode(e.unref(F),{icon:"file",class:"q-chatbot__file-icon"}),e.createElementVNode("span",ga,e.toDisplayString(i.value.name),1)])),e.createVNode(e.unref(j),{class:"q-chatbot__remove-file",tabindex:"0",flat:"",round:"",onClick:V},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"remove"})]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",ba,[e.createVNode(e.unref(Vo),{id:"chatbot-input",modelValue:c.value,"onUpdate:modelValue":L[0]||(L[0]=I=>c.value=I),size:"block",autosize:"",resize:"none",rows:2,disabled:n.disabled,onKeyup:e.withKeys(D,["enter"])},null,8,["modelValue","disabled"])]),e.createElementVNode("div",ha,[e.createVNode(e.unref(j),{title:e.unref(l).imageUpload,class:"q-chatbot__upload",disabled:n.disabled||n.loading||!!i.value,onClick:R},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"upload"})]),_:1},8,["title","disabled"]),e.createElementVNode("input",{id:"file-upload",ref_key:"fileInput",ref:r,type:"file",accept:d.value,class:"hidden-input",onChange:M},null,40,ya),e.createVNode(e.unref(j),{title:e.unref(l).sendMessage,variant:"bold",class:"q-chatbot__send",disabled:m.value,readonly:m.value,onClick:D},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"send"})]),_:1},8,["title","disabled","readonly"])])])],34)],64))}}),ka="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20126.25%20110.36'%3e%3cdefs%3e%3cradialGradient%20id='radial-gradient'%20cx='45.24'%20cy='38.05'%20fx='45.24'%20fy='38.05'%20r='59.09'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%2331319e'/%3e%3cstop%20offset='.19'%20stop-color='%232e2e97'/%3e%3cstop%20offset='.45'%20stop-color='%23292985'/%3e%3cstop%20offset='.75'%20stop-color='%23202067'/%3e%3cstop%20offset='1'%20stop-color='%2317174a'/%3e%3c/radialGradient%3e%3clinearGradient%20id='linear-gradient'%20x1='82.65'%20y1='50.41'%20x2='82.65'%20y2='77.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.02'%20stop-color='%2366ebfe'/%3e%3cstop%20offset='.96'%20stop-color='%2300bfdb'/%3e%3c/linearGradient%3e%3clinearGradient%20id='linear-gradient-2'%20x1='44.6'%20y1='50.01'%20x2='44.6'%20y2='77.1'%20xlink:href='%23linear-gradient'/%3e%3c/defs%3e%3cg%20isolation='isolate'%3e%3cg%20id='Layer_1'%3e%3cpath%20d='M126.2,61.4c-.2-3.69-2.61-17.39-5.92-22.09-2.42-3.44-5.89-4.03-7.96-4.38-.13-.02-.27-.05-.41-.07-.16-.28-.32-.58-.45-.81-.63-1.14-1.03-1.87-1.44-2.44-6.96-9.88-14.91-16.51-24.85-20.69-.25-2.29-.84-5.24-3.37-7.44-2.93-2.55-7.58-2.9-11.68-3.21-.93-.07-1.82-.14-2.4-.22l-.33-.05h-8.61l-.36.05c-.65.1-1.61.17-2.63.24-3.75.27-8.01.57-10.98,2.85-2.94,2.26-3.58,5.55-3.79,7.84-9.71,3.94-17.86,10.71-24.85,20.62-.4.57-.81,1.3-1.43,2.44-.13.23-.29.53-.45.81-.14.02-.28.05-.4.07-2.07.35-5.54.94-7.96,4.39-2.25,3.19-3.84,9.89-4.58,13.59-.6,2.97-1.9,10.3-1.08,14.26.79,3.78,3.66,5.6,5.37,6.68.12.08.26.16.39.25,1.65,10.03,6.98,18.56,15.52,24.77,9.23,6.72,20.2,9.43,27.78,10.52,4.49.65,9.15.97,13.85.97,9.67,0,23.77-1.39,36-8.02,11.58-6.27,18.81-16,21.04-28.24,4.52-2.76,6.36-5.67,5.98-12.71Z'%20fill='%2317174a'/%3e%3cpath%20d='M67.15,4.69c2.98.42,9.31.31,11.62,2.31,1.99,1.73,1.65,4.82,2.06,7.22,10.77,3.89,18.73,10.59,25.39,20.04.64.91,2.13,3.95,2.58,4.33,1.71,1.46,5.54.35,7.67,3.37,2.29,3.25,4.83,15.41,5.06,19.59.31,5.82-.76,6.9-5.58,9.44-3.28,26.16-29.7,34.5-52.68,34.5-4.6,0-9.06-.33-13.17-.93-18.13-2.61-37.11-12.11-39.51-33.08-1.7-1.92-4.96-2.54-5.55-5.39-.95-4.56,2.21-20.32,4.89-24.14,2.13-3.02,5.96-1.91,7.67-3.37.46-.39,1.94-3.42,2.58-4.33,6.54-9.28,14.55-16.22,25.21-19.87.85-.87-.3-5.45,2.43-7.55,2.52-1.94,8.35-1.69,11.42-2.16h7.91'%20fill='%23fff'/%3e%3cpath%20d='M121.86,61.51c-.22-4.2-2.78-16.43-5.07-19.7-1.77-2.51-4.71-2.18-6.64-2.83.1,1.18.16,2.37.16,3.57,0,26.85-25.96,48.61-57.98,48.61-15.83,0-30.17-5.32-40.63-13.94,4.91,17.1,22.06,25.14,38.51,27.52,4.12.59,8.6.93,13.21.93,23.06,0,49.57-8.38,52.85-34.68,4.83-2.56,5.91-3.63,5.6-9.49Z'%20fill='%23d0d7e2'%20mix-blend-mode='multiply'%20opacity='.4'/%3e%3cpath%20d='M62.91,97.68c5.82,0,11.67-.53,16.72-1.56,13.1-2.67,22.09-8.06,26.72-16.03,4.43-7.63,4.75-17.33.96-28.84-4.28-13-13.22-22.77-24.7-27.89-.13,4.51-3.84,8.16-8.38,8.16h-20.89c-4.61,0-8.39-3.78-8.39-8.39v-.14c-5.36,2.25-10.29,5.49-14.5,9.61-8.23,8.06-13.16,19.02-13.9,30.84-.59,9.44,2.67,17.53,9.43,23.42,6.27,5.46,15.68,9.02,27.2,10.3,3.13.35,6.43.52,9.73.52'%20fill='url(%23radial-gradient)'/%3e%3crect%20x='74.34'%20y='50.41'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient)'/%3e%3crect%20x='36.29'%20y='50.01'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient-2)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ba="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF2GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDggNzkuMTY0MDM2LCAyMDE5LzA4LzEzLTAx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ev/w+6IPetTo6+TraP74MnZHnFWClkuK/Zfbv8+j6UYcaR8xh6JOAB9eovwIYH0VoU2QP5F3P7wxMRj9BiarSSzuwCvjA/L3VtdrFvPYE9ie6qqYb0Omgfh3VKcvIIy5czz8YfQbnFJpLbegDeZGmjqxbSI3r+ScCtwL9GhzsS+jQ1tn1aLxuNRvMBR8OTCD4MZk4SJprO6JecOs6govcn88GfggcEXOwz5uZaboN2Qysi3p0Pf8Y40A4lfgUY96IduzcoaR4xqaOWRvW6nr+3sZJcg4wxNJuLjSOl2lKirU2djAWccvGkX+6cTYcE+G2pti26xnjZJkZhwcisQtMN6kCW4Ch5jUYyNSoufeMU2IBOtxmnpJiQ5zs1RAnD0xS837orHIHAb2MAyODDgzcs8j9fKNxgKwzIFehE8G9gT6fu1RJsSrutvk/GdqIAV0smzEAAAAASUVORK5CYII=",_a={class:"q-chatbot"},Ca={class:"q-chatbot__content"},xa={class:"q-chatbot__footer-container"};return e.defineComponent({name:"ChatBot",__name:"ChatBot",props:{apiEndpoint:{default:"http://localhost:3000"},controllerEndpoint:{},username:{},projectPath:{},userImage:{default:Ba},chatbotImage:{default:ka},dateFormat:{},agentData:{default:()=>({id:"",formId:"",jobId:""})},availableAgents:{default:()=>[]}},emits:["apply-fields","direct-agent-chat"],setup(t,{emit:o}){const n=t,a=o,l=e.ref(!0),r=e.ref(null),i=e.ref(!0),s=e.ref(n.agentData.id),u=e.ref(n.agentData.formId),d=W(),{isLoading:f,clearChatData:c,getChatData:m,getJobResultData:h,sendPrompt:b}=ot(n.apiEndpoint),{messages:w,addChatMessage:v,clearMessages:P,getLastMessage:D,deleteMessageById:V}=it(),R=e.computed(()=>l.value||f.value);e.onBeforeMount(()=>{var y;(y=r.value)==null||y.removeEventListener("scroll",z)}),e.onMounted(()=>{_()});function M(y){l.value=y}async function _(){try{await L()}catch(y){v(d.loginError),console.error("Error logging in: "+y)}}async function L(){M(!0);const{data:y,error:B}=await m(n.username,n.projectPath,s.value,u.value);if(B||!y||!y.success){M(!0),v(d.botIsSick),console.log("Error loading chat data: "+B);return}M(!1),I(),y.history.forEach(async $=>{v($.content,$.type==="ai"?"bot":"user",void 0,$.sessionID)})}function I(){const y=d.initialMessage;v(y,"bot",void 0,void 0,!0)}function U(){P(),M(!1),i.value=!0}function z(){if(r.value){const{scrollTop:B,clientHeight:$,scrollHeight:N}=r.value;i.value=B+$>=N-20}}async function p(y,B){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),v(y,"user",B),k(y,B==null?void 0:B.fileData)}async function g(y){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),v("","bot");const B=D();B&&await h(y,$=>{if(B.message+=$,B.fields||(B.fields=[]),B.fields.length>0){const N=B.fields[B.fields.length-1];N.text=B.message}},$=>{var G;B.message="";const N=$;(G=B.fields)==null||G.push({id:N.id,type:N.type,name:N.name,text:N.text})},$=>{M(!0),v(d.botIsSick),console.error("Error getting job result: "+$),V(B.id)})}async function k(y,B){const $=lt(),N=new FormData;if(B&&N.append("file",B),N.append("message",y),N.append("project",n.projectPath),N.append("user",n.username),N.append("sessionID",$),s.value!=="")a("direct-agent-chat",s.value,y);else{v("","bot");const G=D();if(!G)return;await b(N,Q=>{G&&(G.message+=Q)},Q=>{M(!0),v(d.botIsSick),console.error("Error sending message: "+Q),V(G.id)})}}async function S(){const{data:y,error:B}=await c(n.username,n.projectPath,s.value,u.value);if(B||!y||!y.success){M(!0),v(d.loginError),console.log("Error clearing chat: "+B);return}U(),I()}function x(y){const B=["q-chatbot__messages-wrapper"];return y==="user"&&B.push("q-chatbot__messages-wrapper_right"),B}async function A(y){s.value=y.key,u.value=y.formId,U(),await _()}function E(y){!y||y.length===0||a("apply-fields",y)}function q(y){const B=d.regenerateResponsePrompt.replace("{0}",y);a("direct-agent-chat",s.value,B)}return e.watch(()=>n.availableAgents,(y,B)=>{y.length===0&&B.length>0&&(s.value="",u.value="",U(),_())}),e.watch(()=>n.agentData,async(y,B)=>{if(R.value)return;const $=y.jobId,N=B.jobId,G=$!==N;y.id!==s.value&&await A({formId:y.formId,key:y.id}),$&&G&&await g($)},{deep:!0}),(y,B)=>(e.openBlock(),e.createElementBlock("div",_a,[e.createElementVNode("div",Ca,[e.createVNode(e.unref(da),{disabled:R.value,"available-agents":n.availableAgents,"selected-agent-key":s.value,onClear:S,onChangeChat:A},null,8,["disabled","available-agents","selected-agent-key"]),e.createElementVNode("div",{ref_key:"messagesContainer",ref:r,class:"q-chatbot__messages-container",onScroll:z},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),$=>(e.openBlock(),e.createElementBlock("div",{key:$.id,class:e.normalizeClass(x($.sender))},[e.createVNode(e.unref(ea),e.mergeProps({ref_for:!0},$,{"date-format":n.dateFormat,"user-image":n.userImage,"chatbot-image":n.chatbotImage,loading:e.unref(f)&&!$.message,file:$.file,"api-endpoint":n.apiEndpoint,"session-i-d":$.sessionID,fields:$.fields,onRegenerate:q,onApplyFields:E}),null,16,["date-format","user-image","chatbot-image","loading","file","api-endpoint","session-i-d","fields"])],2))),128))],544)]),e.createElementVNode("div",xa,[e.createVNode(e.unref(wa),{disabled:R.value,loading:e.unref(f),onSendMessage:p},null,8,["disabled","loading"])])]))}})});
|
|
45
|
+
`;return e.onMounted(()=>{document.body.setAttribute(te,(a()+1).toString());const r=Jn(o.gapMode);n.add(l(r,!o.noRelative,o.gapMode,o.noImportant?"":"!important"))}),e.onUnmounted(()=>{const r=a()-1;r<=0?document.body.removeAttribute(te):document.body.setAttribute(te,r.toString()),n.remove()}),(r,i)=>e.renderSlot(r.$slots,"default")}}));function to(t,o,n,a){const l=(a==null?void 0:a.offset)??0,r=(a==null?void 0:a.crossOffset)??0,i=(a==null?void 0:a.placement)??"bottom",s=t.getBoundingClientRect(),u=o.getBoundingClientRect(),d=n==null?void 0:n.getBoundingClientRect(),f=no(s,u,i,l),c=io(s,u,f),m=ao(c,f,l),h=ro(m,f,r),b=oo(h,u,f);let w;if(a!=null&&a.arrow){if(!d)throw new Error("[Quidgest UI] The arrow element must exist to compute its position");w=lo(b,s,u,d,f)}return{overlayCoords:b,arrowCoords:w,placement:f}}function no(t,o,n,a){const l=Ke(t,o,n,a);if(et(l)){const r=ne(n),i={top:"bottom",bottom:"top",left:"right",right:"left"}[r],s=Ke(t,o,i,a);if(et(s))return n;const u=uo(n);return u?`${i}-${u}`:i}return n}function oo(t,o,n){const a=fe(n),l=(i,s,u)=>Math.min(Math.max(i,s),u),r={...t};return a==="x"?r.x=l(t.x,8,window.innerWidth-o.width-8):r.y=l(t.y,8,window.innerHeight-o.height-8),r}function ao(t,o,n){const a=ne(o);return{x:t.x+(a==="left"?-n:a==="right"?n:0),y:t.y+(a==="top"?-n:a==="bottom"?n:0)}}function ro(t,o,n){const a=ne(o);return{x:t.x+(a==="top"||a==="bottom"?n:0),y:t.y+(a==="right"||a==="left"?n:0)}}function lo(t,o,n,a,l){if(fe(l)==="y"){const r=o.top+o.height/2,i=t.y+n.height/2,s=i-r,u=n.height/2-s-a.height/2+2;if(u>0&&u<n.height-a.height)return{y:u}}else{const r=o.left+o.width/2,i=t.x+n.width/2,s=i-r,u=n.width/2-s-a.width/2+2;if(u>0&&u<n.width-a.width)return{x:u}}}function io(t,o,n){const[a,l]=n.split("-"),r=t.x+t.width/2-o.width/2,i=t.y+t.height/2-o.height/2;let s;switch(a){case"top":s={x:r,y:t.y-o.height};break;case"bottom":s={x:r,y:t.y+t.height};break;case"left":s={x:t.x-o.width,y:i};break;case"right":s={x:t.x+t.width,y:i};break;default:throw new Error(`[Quidgest UI] Invalid placement value: ${n}`)}if(!l)return s;const u=fe(n)==="y"?"height":"width",d=fe(n),f=t[u]/2-o[u]/2;switch(l){case"start":s[d]-=f;break;case"end":s[d]+=f;break;default:throw new Error(`[Quidgest UI] Invalid alignment value: ${l}`)}return s}function Ke(t,o,n,a){const l=ne(n);let r=0;switch(l){case"top":r=t.top-(o.height+a);break;case"bottom":r=window.innerHeight-t.bottom-(o.height+a);break;case"left":r=t.left-(o.width+a);break;case"right":r=window.innerWidth-t.right-(o.width+a);break;default:throw new Error(`[Quidgest UI] Invalid side value: ${l}`)}return r}function so(t){return t==="x"?"y":"x"}function co(t){const o=ne(t);return["left","right"].includes(o)?"x":"y"}function fe(t){return so(co(t))}function ne(t){const[o]=t.split("-");return o}function uo(t){const[,o]=t.split("-");return o}function et(t){return t<0}function po(t){return typeof t=="string"?document.querySelector(t):t}const fo=["id"],mo=["role"],go=T(e.defineComponent({inheritAttrs:!1,__name:"QOverlay",props:e.mergeModels({id:{},class:{},anchor:{},appearance:{default:"regular"},arrow:{type:Boolean},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean},backdropClass:{},delay:{default:500},nonModal:{type:Boolean},scrollLock:{type:Boolean},offset:{default:8},crossOffset:{default:0},persistent:{type:Boolean},placement:{default:"right"},spy:{type:Boolean},transition:{default:"fade"},trigger:{default:"click"},width:{default:"auto"},focusTrap:{type:Boolean},centerVertically:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),{class:r}=Me(),i=e.computed(()=>["q-overlay",`q-overlay--${ne(c.placement)}`,r.value,{"q-overlay--independent":s.value,"q-overlay--inverted":n.appearance==="inverted","q-overlay--center":n.centerVertically},n.class]),s=e.computed(()=>n.anchor===void 0),u=e.computed(()=>l.value&&!n.nonModal),d=e.computed(()=>(l.value||c.animating)&&n.scrollLock),f=e.computed(()=>!n.inline&&(l.value||c.animating)),c=e.reactive({animating:!1,top:0,left:0,width:0,placement:n.placement}),m=e.reactive({top:void 0,left:void 0,hidden:!0});e.watch(l,k);const h=e.computed(()=>{if(s.value)return;const C=x(),X=n.width==="anchor",H=X?C==null?void 0:C.getBoundingClientRect().width:void 0;return{top:`${c.top}px`,left:`${c.left}px`,width:H!==void 0?`${H}px`:void 0}}),b=e.computed(()=>{if(n.arrow)return{top:m.top!==void 0?`${m.top}px`:void 0,left:m.left!==void 0?`${m.left}px`:void 0,opacity:m.hidden?0:1}}),w=e.ref(null),v=e.ref(null),P=e.ref(null);function D(){const C=x();if(!C||!v.value)return;const X={placement:n.placement,width:n.width,offset:n.offset,crossOffset:n.crossOffset,arrow:n.arrow},H=to(C,v.value,(w==null?void 0:w.value)??void 0,X);c.left=H.overlayCoords.x,c.top=H.overlayCoords.y,c.placement=H.placement,m.hidden=H.arrowCoords===void 0,H.arrowCoords&&(m.top=H.arrowCoords.y,m.left=H.arrowCoords.x)}e.watch(()=>n.placement,()=>e.nextTick(D));let V;function R(){_(0)}function M(){_(n.delay)}function _(C){V&&I(),V=window.setTimeout(()=>{l.value=!0},C)}function L(){if(V&&I(),l.value=!1,n.anchor&&n.trigger==="click"){const C=x();e.nextTick(()=>C==null?void 0:C.focus())}}function I(){clearTimeout(V),V=void 0}function U(){e.nextTick(ie),a("enter")}function z(){S()}function p(){a("leave")}function g(){S(),va()}function k(){c.animating=!0}function S(){c.animating=!1}function x(){return n.anchor?po(n.anchor):null}function A(C){n.persistent&&C.preventDefault()}function E(C){var X;if(n.persistent){C.preventDefault();return}let H=!1;C.defaultPrevented||C.detail.originalEvent.type==="pointerdown"&&(H=!0);const Sa=C.detail.originalEvent.target;if((X=x())!=null&&X.contains(Sa)){C.preventDefault();return}C.detail.originalEvent.type==="focusin"&&H&&C.preventDefault()}function q(){L()}let y;function B(){const C=x();if(C)switch(y=new MutationObserver(D),y.observe(C,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),n.trigger){case"click":C.addEventListener("click",R);break;case"hover":C.addEventListener("mouseenter",M),C.addEventListener("mouseleave",L),C.addEventListener("focusin",R),C.addEventListener("focusout",L);break}}function $(){const C=x();if(C)switch(y==null||y.disconnect(),n.trigger){case"click":C.removeEventListener("click",R);break;case"hover":C.removeEventListener("mouseenter",M),C.removeEventListener("mouseleave",L),C.removeEventListener("focusin",R),C.removeEventListener("focusout",L);break}}function N(){window.addEventListener("resize",D),n.scrollLock||window.addEventListener("scroll",D)}function G(){window.removeEventListener("resize",D),n.scrollLock||window.removeEventListener("scroll",D)}let Z;function oe(){x()?(D(),Z=window.setTimeout(oe,100)):L()}function ie(){var C;s.value||(N(),n.spy?oe():D()),(s.value||n.trigger==="click")&&((C=v.value)==null||C.focus())}function va(){s.value||G(),n.spy&&(clearTimeout(Z),Z=void 0)}return e.onMounted(()=>{e.nextTick(B)}),e.onBeforeUnmount($),(C,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!f.value,to:n.attach},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([n.backdropClass,"q-overlay__underlay",{"q-overlay__underlay--blur":n.backdropBlur}])},null,2)):e.createCommentVNode("v-if",!0)]),_:1}),e.createVNode(e.Transition,{name:n.transition,appear:"",onEnter:U,onAfterEnter:z,onLeave:p,onAfterLeave:g},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:n.id,ref_key:"overlayContainerRef",ref:P,tabindex:"-1",class:e.normalizeClass(i.value),style:e.normalizeStyle(h.value)},[e.createVNode(e.unref(nn),{onDismiss:q,onInteractOutside:E,onPointerDownOutside:A},{default:e.withCtx(()=>[P.value?(e.openBlock(),e.createBlock(e.unref(jn),{key:0,disabled:n.nonModal||!l.value,options:{fallbackFocus:P.value}},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"overlayRef",ref:v,class:"q-overlay__content",tabindex:"-1",role:u.value?"dialog":void 0},C.$attrs),[n.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowRef",ref:w,role:"presentation",class:"q-overlay__arrow",style:e.normalizeStyle(b.value)},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(C.$slots,"default")],16,mo)]),_:3},8,["disabled","options"])):e.createCommentVNode("v-if",!0)]),_:3})],14,fo)):e.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"])),d.value?(e.openBlock(),e.createBlock(e.unref(eo),{key:0})):e.createCommentVNode("v-if",!0)],64))}})),bo=[{id:"button",icon:{icon:"check"},props:{variant:"bold",label:"Ok"}}],ho={icon:"check-circle-outline"},yo={close:{icon:"close"}},wo={key:0,class:"q-dialog__header"},ko={key:0,class:"q-dialog__header-title"},Bo={key:1,class:"q-dialog__body"},_o={key:0,class:"q-dialog__body-icon"},Co={class:"q-dialog__body-text"},xo=["innerHTML"],Eo={key:1},vo={key:0,class:"q-dialog__input"},So={key:2,class:"q-dialog__footer"},$o={key:0,class:"q-dialog__footer-buttons"},No=e.defineComponent({__name:"QDialog",props:e.mergeModels({id:{},class:{},title:{},text:{},icon:{default:()=>ho},buttons:{default:()=>bo},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean,default:!0},dismissible:{type:Boolean},html:{type:Boolean,default:!0},icons:{default:()=>yo},size:{default:"small"},centerVertically:{type:Boolean},input:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),r=e.ref(""),i=e.ref(""),s=e.computed(()=>["q-dialog",n.class]),u=e.computed(()=>`q-overlay--${n.size}`);function d(){l.value=!1}function f(h){var b,w;if(h.action){if((b=n.input)!=null&&b.validator&&(i.value=n.input.validator(e.unref(r)),e.unref(i)))return;(w=h.action)==null||w.call(h,e.unref(r))}d()}function c(){a("enter")}function m(){a("leave")}return(h,b)=>(e.openBlock(),e.createBlock(e.unref(go),{id:n.id,modelValue:l.value,"onUpdate:modelValue":b[1]||(b[1]=w=>l.value=w),"backdrop-class":"q-dialog__underlay","scroll-lock":"",persistent:"",inline:n.inline,attach:n.attach,"backdrop-blur":n.backdropBlur,"center-vertically":n.centerVertically,class:e.normalizeClass(u.value),onEnter:c,onLeave:m},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(s.value)},[n.title||h.$slots.header||h.$slots["header.prepend"]||h.$slots["header.append"]?(e.openBlock(),e.createElementBlock("div",wo,[e.renderSlot(h.$slots,"header",{},()=>[e.renderSlot(h.$slots,"header.prepend"),n.title?(e.openBlock(),e.createElementBlock("span",ko,e.toDisplayString(n.title),1)):e.createCommentVNode("v-if",!0),e.renderSlot(h.$slots,"header.append")])])):e.createCommentVNode("v-if",!0),n.icon||n.text||h.$slots.body?(e.openBlock(),e.createElementBlock("div",Bo,[e.renderSlot(h.$slots,"body",{},()=>{var w;return[e.renderSlot(h.$slots,"body.icon",{},()=>[n.icon?(e.openBlock(),e.createElementBlock("span",_o,[e.createVNode(e.unref(F),e.normalizeProps(e.guardReactiveProps(n.icon)),null,16)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Co,[n.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:n.text},null,8,xo)):(e.openBlock(),e.createElementBlock("div",Eo,e.toDisplayString(n.text),1))]),n.input?(e.openBlock(),e.createElementBlock("div",vo,[e.createVNode(e.unref(Pe),{modelValue:r.value,"onUpdate:modelValue":b[0]||(b[0]=v=>r.value=v),invalid:!!i.value,placeholder:(w=n.input)==null?void 0:w.placeholder,size:"block"},{extras:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(F),{key:0,icon:"exclamation-sign"})):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(i.value),1)]),_:1},8,["modelValue","invalid","placeholder"])])):e.createCommentVNode("v-if",!0),e.renderSlot(h.$slots,"body.append")]})])):e.createCommentVNode("v-if",!0),n.buttons||h.$slots["footer.append"]?(e.openBlock(),e.createElementBlock("div",So,[n.buttons?(e.openBlock(),e.createElementBlock("span",$o,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.buttons,w=>(e.openBlock(),e.createBlock(e.unref(j),e.mergeProps({ref_for:!0},w.props,{key:w.id,onClick:()=>f(w)}),{default:e.withCtx(()=>[w.icon?(e.openBlock(),e.createBlock(e.unref(F),e.mergeProps({key:0,ref_for:!0},w.icon),null,16)):e.createCommentVNode("v-if",!0)]),_:2},1040,["onClick"]))),128))])):e.createCommentVNode("v-if",!0),e.renderSlot(h.$slots,"footer.append")])):e.createCommentVNode("v-if",!0),n.dismissible?(e.openBlock(),e.createBlock(e.unref(j),{key:3,class:"q-dialog__close",variant:"text",onClick:d},{default:e.withCtx(()=>[e.createVNode(e.unref(F),e.normalizeProps(e.guardReactiveProps(n.icons.close)),null,16)]),_:1})):e.createCommentVNode("v-if",!0)],2)]),_:3},8,["id","modelValue","inline","attach","backdrop-blur","center-vertically","class"]))}}),me=e.reactive({dialogs:[]});function Ao(){function t(n,a,l){const r=ke(a);return me.dialogs.push({id:r,props:n,options:l}),r}function o(n){const a=me.dialogs.findIndex(l=>l.id===n);a!==-1&&me.dialogs.splice(a,1)}return{...me,addDialog:t,removeDialog:o}}const Io=e.defineComponent({inheritAttrs:!1,__name:"QDialogProvider",props:{inline:{type:Boolean}},emits:["leave"],setup(t,{emit:o}){const n=t,a=o,{dialogs:l,removeDialog:r}=Ao();function i(s){r(s),a("leave",s)}return(s,u)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),d=>(e.openBlock(),e.createBlock(e.unref(tt),e.mergeProps({key:d.id,ref_for:!0},d.props,{"model-value":"",inline:n.inline,onLeave:()=>i(d.id)}),null,16,["inline","onLeave"]))),128))}}),tt=T(No);T(Io);const Do=["id","required","placeholder","readonly","disabled","maxlength","rows","cols","resize","wrap"],Vo=T(e.defineComponent({inheritAttrs:!1,__name:"QTextArea",props:e.mergeModels({id:{},class:{},label:{},for:{},required:{type:Boolean},size:{},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean},placeholder:{},maxLength:{},rows:{default:3},cols:{},resize:{default:"vertical"},wrap:{default:"soft"},autosize:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),a=e.computed({get:()=>n.value,set:d=>{const f=o.maxLength;n.value=f?d==null?void 0:d.slice(0,f):d}});e.watch(n,d=>a.value=d,{immediate:!0});const l=ke(o.id),r=e.computed(()=>o.readonly||o.disabled?void 0:o.placeholder),i=e.computed(()=>({input:o.autosize?u:null})),s=e.ref(),{triggerResize:u}=un({element:e.computed(()=>o.autosize?s.value:void 0),styleProp:"minHeight"});return(d,f)=>(e.openBlock(),e.createBlock(e.unref(Fe),{class:e.normalizeClass(["q-text-area",o.class]),for:e.unref(l),label:o.label,size:o.size,readonly:o.readonly,disabled:o.disabled,required:o.required},e.createSlots({"label.prepend":e.withCtx(()=>[e.renderSlot(d.$slots,"label.prepend")]),"label.append":e.withCtx(()=>[e.renderSlot(d.$slots,"label.append")]),default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(l),ref_key:"textareaRef",ref:s,"onUpdate:modelValue":f[0]||(f[0]=c=>a.value=c),class:"q-text-area__input",required:o.required,placeholder:r.value,readonly:o.readonly,disabled:o.disabled,maxlength:o.maxLength,rows:o.rows,cols:o.cols,resize:o.resize,wrap:o.wrap},d.$attrs,e.toHandlers(i.value,!0)),null,16,Do),[[e.vModelText,a.value]])]),_:2},[d.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"prepend")]),key:"0"}:void 0,d.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"append")]),key:"1"}:void 0,d.$slots.extras?{name:"extras",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"extras")]),key:"2"}:void 0]),1032,["class","for","label","size","readonly","disabled","required"]))}}));function W(){return{copy:"Copy",apply:"Apply",applyAll:"Apply all",chatbotTitle:"ChatBot",sendMessage:"Send message",clearChat:"Clear chat",inputLabel:"What can I help with?",imageUpload:"Upload Image",imageUploadQButton:"Upload Image",goodResponse:"Good response",badResponse:"Bad response",initialMessage:"Howdy! I am GenioBot 👋, Quidgest's personal AI assistant! How can I help you?",initialAgentMessage:"Just a temporary message while we are working on the agent mode",loginError:"Uh oh, I could not authenticate with the Quidgest API endpoint 😓",botIsSick:"*cough cough* GenioBot is not feeling alright 🥴️🤒, looks like something failed!",commentDialogTitle:"Would you like to add a comment?",commentPlaceholder:"Type your comment here (optional)...",copyResponse:"Copy response",submitButton:"Submit",cancelButton:"Cancel",senderImage:"Sender Image",imagePreview:"Image preview",regenerateResponsePrompt:"Regenerate a new response for field {0}",regenerateResponse:"Regenerate response",generatingResponse:"Generating",suggestionsForField:"Suggestions for field:",fileUpload:"Upload File"}}async function nt(t,o){var u,d,f,c,m,h;const n=new AbortController,a=n.signal,r=(await K({...t,headers:{Accept:"text/event-stream"},responseType:"stream",signal:a,adapter:"fetch"})).data;if(!r||!(r instanceof ReadableStream))throw new Error("Invalid stream response");const i=r.getReader(),s=new TextDecoder;for(;;){const{done:b,value:w}=await i.read();if(b){(u=o.onDone)==null||u.call(o);break}const P=s.decode(w,{stream:!0}).split(/\n\n+/);for(const D of P){const V=D.trim().split(`
|
|
46
|
+
`);let R="",M="";for(const _ of V)_.startsWith("event:")?R=_.replace("event:","").trim():_.startsWith("data:")&&(M=_.replace("data:","").trim());if(R||(R="message"),!!M)try{const _=JSON.parse(M);switch(R){case"message":(d=o.onMessage)==null||d.call(o,_.value);break;case"error":(f=o.onError)==null||f.call(o,new Error(_.value));break;case"field_metadata":(c=o.onFieldMetadata)==null||c.call(o,_);break;case"done":(m=o.onDone)==null||m.call(o);break;default:console.warn(`Unknown event type: ${R}`)}}catch(_){(h=o.onError)==null||h.call(o,_),console.error("Error processing event:",_);continue}finally{b&&(i.releaseLock(),n.abort())}}}}function ot(t){const o=e.ref(!1),n=e.ref(null);async function a(d){o.value=!0,n.value=null;try{return{data:(await K({...d,baseURL:t})).data,error:null}}catch(f){if(f instanceof Error)return n.value=f,console.error("Error in API request:",f),{data:null,error:f}}finally{o.value=!1}return{data:null,error:new Error("Unknown error occurred in baseRequest")}}async function l(d,f,c,m){return await a({method:"POST",url:"/prompt/load",data:{username:d,project:f,agentID:c,formId:m}})}async function r(d,f,c){o.value=!0;try{return await nt({method:"POST",url:`${t}/prompt/submit`,data:d},{onMessage:m=>{f(m)},onDone:()=>o.value=!1})}catch(m){throw o.value=!1,c==null||c(m),console.error("Error in sendPrompt:",m),m}}async function i(d,f,c,m){o.value=!0;try{return await nt({method:"POST",url:`${t}/get-job-result`,data:{jobId:d}},{onMessage:h=>f(h),onFieldMetadata:h=>c(h),onDone:()=>o.value=!1})}catch(h){n.value=h,m==null||m(h),o.value=!1}}async function s(d,f,c,m){return await a({method:"POST",url:"/prompt/clear",data:{username:d,project:f,agentID:c,formId:m}})}async function u(d,f,c){return await a({method:"POST",url:"/prompt/feedback",data:{messageSessionID:c,feedbackValue:d,feedbackComment:f}})}return{isLoading:o,lastError:n,getChatData:l,clearChatData:s,getJobResultData:i,sendPrompt:r,handleFeedback:u}}const Ro=["innerHTML"],ge=e.defineComponent({__name:"MarkdownRender",props:{source:{},options:{},plugins:{}},setup(t){const o=t,n=e.ref(new st({html:!0,breaks:!0,...o.options??{}}));o.plugins&&o.plugins.forEach(l=>n.value.use(l));const a=e.computed(()=>n.value.render(o.source));return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:"markdown-renderer",innerHTML:a.value},null,8,Ro))}});function at(t,o){switch(t){case"date":return new Date(o).toLocaleDateString();case"number":return parseFloat(o);case"boolean":return o.toLowerCase()==="true";default:return o.toString()}}function Mo(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}const Lo=["data-testid"],qo={class:"q-field-preview__toolbar"},To={class:"q-field-preview__footer"},Fo=e.defineComponent({__name:"FieldPreview",props:{name:{},text:{},type:{},disabled:{type:Boolean},applied:{type:Boolean}},emits:["apply","regenerate"],setup(t,{emit:o}){const n=t,a=o,l=W(),r=e.ref(n.applied),i=e.ref(!1),s=e.computed(()=>n.disabled||r.value),u=e.computed(()=>n.disabled||i.value),d=e.computed(()=>n.type==="text"||n.type==="multiline_text"?ge:"div"),f=e.computed(()=>{const b={};return d.value===ge?b.source=n.text:b.innerHTML=n.text,b}),c=e.computed(()=>{const b=["q-field-preview__content"];return d.value!==ge&&b.push("preserve-whitespace"),b});function m(){if(r.value)return;r.value=!0;const b=at(n.type,n.text);a("apply",b)}function h(){i.value||(i.value=!0,a("regenerate",n.name))}return(b,w)=>(e.openBlock(),e.createElementBlock("div",{class:"q-field-preview","data-testid":e.unref(Mo)(n.name)},[e.createElementVNode("div",qo,[e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString(e.unref(l).suggestionsForField)+" ",1),e.createElementVNode("b",null,e.toDisplayString(n.name),1)])]),e.createElementVNode("div",{class:e.normalizeClass(c.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.normalizeProps(e.guardReactiveProps(f.value)),null,16))],2),e.createElementVNode("div",To,[e.createVNode(e.unref(qe),{borderless:""},{default:e.withCtx(()=>[e.createVNode(e.unref(j),{title:e.unref(l).regenerateResponse,disabled:u.value,readonly:u.value,borderless:"",onClick:h},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"reset"})]),_:1},8,["title","disabled","readonly"]),e.createVNode(e.unref(j),{label:e.unref(l).apply,"data-testid":"apply-button",disabled:s.value,readonly:s.value,onClick:m},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"apply"})]),_:1},8,["label","disabled","readonly"])]),_:1})])],8,Lo))}}),Po={class:"pulsing-dots"},Oo={class:"generating-text"},Uo={class:"dots-container"},zo=e.defineComponent({__name:"PulseDots",setup(t){const o=[1,2,3],n=W();return(a,l)=>(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("span",Oo,e.toDisplayString(e.unref(n).generatingResponse),1),e.createElementVNode("div",Uo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(r,i)=>e.createElementVNode("span",{key:i,class:"dot",style:e.normalizeStyle({animationDelay:i*.2+"s"})}," • ",4)),64))])]))}}),jo={class:"q-chatbot__message-container"},Go={class:"q-chatbot__message-wrapper"},Ho={key:0,class:"q-chatbot__image-preview"},Zo=["src","alt"],Qo={key:1,class:"q-chatbot__file-preview-container"},Jo={class:"q-chatbot__file-icon-container"},Wo={class:"q-chatbot__file-info"},Yo={class:"q-chatbot__file-name"},Xo={class:"q-chatbot__file-extension"},Ko={class:"q-chatbot__message"},ea={key:1,class:"q-chatbot__text q-chatbot__user-text"},ta=e.defineComponent({__name:"ChatBotMessage",props:{sender:{default:"user"},message:{},date:{default:()=>new Date},loading:{type:Boolean},dateFormat:{},file:{},apiEndpoint:{},sessionID:{},userImage:{default:void 0},chatbotImage:{},isWelcomeMessage:{type:Boolean},fields:{default:()=>[]}},emits:["apply-fields","regenerate"],setup(t,{emit:o}){const n=t,a=o,l=W(),{handleFeedback:r}=ot(n.apiEndpoint),i=e.computed(()=>n.sender==="bot"&&!Object.values(l||{}).includes(n.message||"")&&!n.isWelcomeMessage),s=e.computed(()=>{var b;return((b=n.file)==null?void 0:b.fileData.type.startsWith("image/"))??!1}),u=e.computed(()=>n.sender==="bot"?n.chatbotImage:n.userImage),d=e.computed(()=>{var w,v;return(w=n.file)!=null&&w.fileData?((v=n.file.fileData.name.split(".").pop())==null?void 0:v.toUpperCase())??"":""});function f(){n.message&&navigator.clipboard.writeText(n.message).then(()=>{console.log("Response copied to clipboard")}).catch(b=>{console.error("Failed to copy response: ",b)})}function c(b,w){a("apply-fields",[{id:w.id,text:b}])}function m(){if(!n.fields||n.fields.length===0)return;const b=n.fields.map(w=>({id:w.id,text:at(w.type,w.text)}));a("apply-fields",b)}function h(b,w){b===null||w===null||!n.sessionID||r(b,w,n.sessionID)}return(b,w)=>{var v,P,D;return e.openBlock(),e.createElementBlock("div",jo,[e.createVNode(e.unref(F),{type:"img",icon:u.value,alt:e.unref(l).senderImage,class:"q-chatbot__profile"},null,8,["icon","alt"]),e.createElementVNode("div",Go,[s.value?(e.openBlock(),e.createElementBlock("div",Ho,[e.createElementVNode("img",{src:(v=n.file)==null?void 0:v.previewUrl,alt:e.unref(l).imagePreview},null,8,Zo)])):(P=n.file)!=null&&P.fileData&&!s.value?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("div",Jo,[e.createVNode(e.unref(F),{icon:"file",class:"q-chatbot__file-icon"})]),e.createElementVNode("div",Wo,[e.createElementVNode("span",Yo,e.toDisplayString((D=n.file)==null?void 0:D.fileData.name),1),e.createElementVNode("span",Xo,e.toDisplayString(d.value),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ko,[b.loading?(e.openBlock(),e.createBlock(zo,{key:0})):n.sender==="bot"&&n.fields.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.fields,(V,R)=>(e.openBlock(),e.createBlock(e.unref(Fo),{key:R,class:"q-chatbot__text",text:V.text||"",name:V.name,type:V.type,disabled:b.loading,onRegenerate:()=>a("regenerate",V.name),onApply:M=>c(M,V)},null,8,["text","name","type","disabled","onRegenerate","onApply"]))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.sender==="bot"?(e.openBlock(),e.createBlock(e.unref(ge),{key:0,class:"q-chatbot__text",source:n.message||""},null,8,["source"])):(e.openBlock(),e.createElementBlock("div",ea,e.toDisplayString(n.message),1))],64))])]),e.createVNode(e.unref(sa),{"show-buttons":i.value,loading:n.loading,"date-format":n.dateFormat,onCopyResponse:f,onSubmitFeedback:h,onApplyAll:m},null,8,["show-buttons","loading","date-format"])])}}}),O=[];for(let t=0;t<256;++t)O.push((t+256).toString(16).slice(1));function na(t,o=0){return(O[t[o+0]]+O[t[o+1]]+O[t[o+2]]+O[t[o+3]]+"-"+O[t[o+4]]+O[t[o+5]]+"-"+O[t[o+6]]+O[t[o+7]]+"-"+O[t[o+8]]+O[t[o+9]]+"-"+O[t[o+10]]+O[t[o+11]]+O[t[o+12]]+O[t[o+13]]+O[t[o+14]]+O[t[o+15]]).toLowerCase()}let Ne;const oa=new Uint8Array(16);function aa(){if(!Ne){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ne=crypto.getRandomValues.bind(crypto)}return Ne(oa)}const rt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function lt(t,o,n){var l;if(rt.randomUUID&&!o&&!t)return rt.randomUUID();t=t||{};const a=t.random??((l=t.rng)==null?void 0:l.call(t))??aa();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,na(a)}const Y=e.ref([]),be=e.ref(1);function it(){function t(r,i,s,u,d){const f={id:be.value++,message:r,date:new Date,sender:i||"bot",sessionID:u||lt(),file:s,isWelcomeMessage:d,fields:[]};return Y.value.push(f),f}function o(){return Y.value.find(r=>r.id===be.value-1)}function n(){Y.value=[],be.value=1}function a(r){Y.value=Y.value.filter(i=>i.id!==r)}function l(){return Y.value}return{messages:Y,nextMessageId:be,addChatMessage:t,getLastMessage:o,clearMessages:n,getMessages:l,deleteMessageById:a}}const ra={class:"q-chatbot__dialog-title"},la={key:0,class:"q-chatbot__feedback-buttons"},ia={class:"q-chatbot__sender"},sa=e.defineComponent({__name:"ChatBotMessageButtons",props:{loading:{type:Boolean},showButtons:{type:Boolean},dateFormat:{},date:{}},emits:["submit-feedback","copy-response","apply-all"],setup(t,{emit:o}){const n=t,a=o,l=W(),{getLastMessage:r}=it(),i=e.ref(!1),s=e.ref(""),u=e.ref(null),d=e.ref(!1),f=e.computed(()=>n.loading||d.value),c=n.date||new Date,m=r(),h=e.computed(()=>m?m.fields&&m.fields.length>1:!1),b=[{id:"confirm-btn",action:_,props:{label:l.submitButton,class:"q-chatbot__dialog-confirm-button"},icon:{icon:"submit"}},{id:"cancel-btn",props:{label:l.cancelButton,class:"q-chatbot__dialog-cancel-button"},icon:{icon:"cancel"}}],w=e.computed(()=>n.dateFormat?P(c,"HH:mm"):c.toLocaleString()),v=e.computed(()=>`${w.value}`);function P(I,U){const z=I.getDate().toString().padStart(2,"0"),p=(I.getMonth()+1).toString().padStart(2,"0"),g=I.getFullYear().toString().padStart(2,"0"),k=I.getHours().toString().padStart(2,"0"),S=I.getMinutes().toString().padStart(2,"0"),x=I.getSeconds().toString().padStart(2,"0");return U.replace("dd",z).replace("MM",p).replace("yyyy",g).replace("HH",k).replace("mm",S).replace("ss",x)}function D(I){i.value=!0,s.value="",u.value=I}function V(){D(0)}function R(){D(1)}function M(){d.value||(d.value=!0,a("apply-all"))}function _(){u.value&&(a("submit-feedback",u.value,s.value),i.value=!1,s.value="",u.value=null)}function L(){a("copy-response")}return(I,U)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(tt),{modelValue:i.value,"onUpdate:modelValue":U[1]||(U[1]=z=>i.value=z),inline:"",buttons:b},{body:e.withCtx(()=>[e.createElementVNode("div",ra,e.toDisplayString(e.unref(l).commentDialogTitle),1),e.createVNode(e.unref(Pe),{modelValue:s.value,"onUpdate:modelValue":U[0]||(U[0]=z=>s.value=z),class:"q-chatbot__dialog-comment-input","max-length":150,size:"large",placeholder:e.unref(l).commentPlaceholder},null,8,["modelValue","placeholder"])]),_:1},8,["modelValue"]),I.showButtons?(e.openBlock(),e.createElementBlock("div",la,[e.createVNode(e.unref(qe),null,{default:e.withCtx(()=>[e.createVNode(e.unref(j),{title:e.unref(l).goodResponse,class:"q-chatbot__good-response-button",borderless:"",disabled:n.loading,onClick:R},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"thumb-up"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(j),{title:e.unref(l).badResponse,class:"q-chatbot__bad-response-button",borderless:"",disabled:n.loading,onClick:V},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"thumb-down"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(j),{title:e.unref(l).copyResponse,class:"q-chatbot__copy-button",borderless:"",disabled:n.loading,onClick:L},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"copy-content"})]),_:1},8,["title","disabled"]),h.value?(e.openBlock(),e.createBlock(e.unref(j),{key:0,title:e.unref(l).applyAll,class:"q-chatbot__apply-all-button",borderless:"",disabled:f.value,readonly:f.value,label:e.unref(l).applyAll,onClick:M},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"apply-all"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",ia,e.toDisplayString(v.value),1)],64))}}),ca={class:"q-chatbot__tools"},da={class:"q-chatbot__tools__select"},ua=e.defineComponent({__name:"ChatToolBar",props:{disabled:{type:Boolean},availableAgents:{default:()=>[]},selectedAgentKey:{}},emits:["clear","change-chat"],setup(t,{emit:o}){const n=t,a=o,{clearChat:l}=W(),r={key:"",value:"Default Chat",formId:""},i=e.computed(()=>n.availableAgents&&n.availableAgents.length>0),s=e.ref(n.selectedAgentKey||r.key);e.watch(()=>n.selectedAgentKey,c=>{s.value=c||r.key});const u=e.computed(()=>{var m;const c=(m=n.availableAgents)==null?void 0:m.map(h=>({key:h.key,value:h.value,formId:h.formId}));return c==null||c.push(r),c||[r]});function d(){a("clear")}function f(c){const m=u.value.find(h=>h.key===c);if(m){if(m.key===r.key){a("change-chat",{key:"",formId:""});return}a("change-chat",m)}}return(c,m)=>{const h=e.resolveComponent("q-select");return e.openBlock(),e.createElementBlock("div",ca,[e.createElementVNode("div",da,[i.value?(e.openBlock(),e.createBlock(h,{key:0,modelValue:s.value,"onUpdate:modelValue":[m[0]||(m[0]=b=>s.value=b),f],inline:"",required:"",class:"q-chatbot__tools-select-input",size:"medium",items:u.value},null,8,["modelValue","items"])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(j),{title:e.unref(l),disabled:n.disabled,class:"q-chatbot__tools-clear",borderless:"",onClick:d},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"bin"})]),_:1},8,["title","disabled"])])}}}),pa={class:"q-chatbot__input-wrapper"},fa={key:0,class:"q-chatbot__file-preview"},ma=["src","alt"],ga={key:1,class:"q-chatbot__file-preview",tabindex:"0"},ba={class:"q-chatbot__file-name"},ha={class:"q-chatbot__input"},ya={class:"q-chatbot__send-container"},wa=["accept"],ka=e.defineComponent({__name:"ChatBotInput",props:{disabled:{type:Boolean},loading:{type:Boolean},userPrompt:{},agentId:{}},emits:["send-message"],setup(t,{emit:o}){const n=t,a=o,l=W(),r=e.ref(null),i=e.ref(null),s=e.ref(""),u=e.ref(!1),d=e.computed(()=>".png,.jpeg,.jpg,.svg,.webp,.pdf,.doc,.docx"),f=e.computed(()=>i.value?i.value.type.startsWith("image/")??!1:!1),c=e.ref(n.userPrompt??""),m=e.computed(()=>n.disabled||n.loading||c.value.trim().length===0);function h(_){_.preventDefault(),n.disabled||(u.value=!0)}const b=e.computed(()=>({"q-chatbot__footer-disabled":n.disabled,"drag-over":u.value&&!i.value}));function w(_){_.preventDefault(),u.value=!1}function v(_){var I;if(_.preventDefault(),u.value=!1,n.disabled||i.value)return;const L=(I=_.dataTransfer)==null?void 0:I.files;L&&P(L[0])}function P(_){i.value=_,_.type.startsWith("image/")?s.value=URL.createObjectURL(_):s.value=""}function D(){if(!(c.value.trim()===""||n.loading||n.disabled)){if(i.value){const _={fileData:i.value,previewUrl:s.value??""};a("send-message",c.value,_),V()}else a("send-message",c.value);c.value=""}}function V(){i.value=null,s.value="",r.value&&(r.value.value="",r.value.files=null)}function R(){var _;(_=r.value)==null||_.click()}function M(_){var I;const L=_.target;(I=L.files)!=null&&I[0]&&P(L.files[0])}return(_,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(Te),{label:e.unref(l).inputLabel},null,8,["label"]),e.createElementVNode("div",{class:e.normalizeClass(["q-chatbot__footer",b.value]),onDragover:e.withModifiers(h,["prevent"]),onDragleave:e.withModifiers(w,["prevent"]),onDrop:e.withModifiers(v,["prevent"])},[e.createElementVNode("div",pa,[i.value?(e.openBlock(),e.createElementBlock("div",fa,[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"q-chatbot__image-preview",src:s.value,tabindex:"0",alt:e.unref(l).imagePreview},null,8,ma)):(e.openBlock(),e.createElementBlock("div",ga,[e.createVNode(e.unref(F),{icon:"file",class:"q-chatbot__file-icon"}),e.createElementVNode("span",ba,e.toDisplayString(i.value.name),1)])),e.createVNode(e.unref(j),{class:"q-chatbot__remove-file",tabindex:"0",flat:"",round:"",onClick:V},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"remove"})]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",ha,[e.createVNode(e.unref(Vo),{id:"chatbot-input",modelValue:c.value,"onUpdate:modelValue":L[0]||(L[0]=I=>c.value=I),size:"block",autosize:"",resize:"none",rows:2,disabled:n.disabled,onKeyup:e.withKeys(D,["enter"])},null,8,["modelValue","disabled"])]),e.createElementVNode("div",ya,[e.createVNode(e.unref(j),{title:e.unref(l).imageUpload,class:"q-chatbot__upload",disabled:n.disabled||n.loading||!!i.value,onClick:R},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"upload"})]),_:1},8,["title","disabled"]),e.createElementVNode("input",{id:"file-upload",ref_key:"fileInput",ref:r,type:"file",accept:d.value,class:"hidden-input",onChange:M},null,40,wa),e.createVNode(e.unref(j),{title:e.unref(l).sendMessage,variant:"bold",class:"q-chatbot__send",disabled:m.value,readonly:m.value,onClick:D},{default:e.withCtx(()=>[e.createVNode(e.unref(F),{icon:"send"})]),_:1},8,["title","disabled","readonly"])])])],34)],64))}}),Ba="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20126.25%20110.36'%3e%3cdefs%3e%3cradialGradient%20id='radial-gradient'%20cx='45.24'%20cy='38.05'%20fx='45.24'%20fy='38.05'%20r='59.09'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%2331319e'/%3e%3cstop%20offset='.19'%20stop-color='%232e2e97'/%3e%3cstop%20offset='.45'%20stop-color='%23292985'/%3e%3cstop%20offset='.75'%20stop-color='%23202067'/%3e%3cstop%20offset='1'%20stop-color='%2317174a'/%3e%3c/radialGradient%3e%3clinearGradient%20id='linear-gradient'%20x1='82.65'%20y1='50.41'%20x2='82.65'%20y2='77.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.02'%20stop-color='%2366ebfe'/%3e%3cstop%20offset='.96'%20stop-color='%2300bfdb'/%3e%3c/linearGradient%3e%3clinearGradient%20id='linear-gradient-2'%20x1='44.6'%20y1='50.01'%20x2='44.6'%20y2='77.1'%20xlink:href='%23linear-gradient'/%3e%3c/defs%3e%3cg%20isolation='isolate'%3e%3cg%20id='Layer_1'%3e%3cpath%20d='M126.2,61.4c-.2-3.69-2.61-17.39-5.92-22.09-2.42-3.44-5.89-4.03-7.96-4.38-.13-.02-.27-.05-.41-.07-.16-.28-.32-.58-.45-.81-.63-1.14-1.03-1.87-1.44-2.44-6.96-9.88-14.91-16.51-24.85-20.69-.25-2.29-.84-5.24-3.37-7.44-2.93-2.55-7.58-2.9-11.68-3.21-.93-.07-1.82-.14-2.4-.22l-.33-.05h-8.61l-.36.05c-.65.1-1.61.17-2.63.24-3.75.27-8.01.57-10.98,2.85-2.94,2.26-3.58,5.55-3.79,7.84-9.71,3.94-17.86,10.71-24.85,20.62-.4.57-.81,1.3-1.43,2.44-.13.23-.29.53-.45.81-.14.02-.28.05-.4.07-2.07.35-5.54.94-7.96,4.39-2.25,3.19-3.84,9.89-4.58,13.59-.6,2.97-1.9,10.3-1.08,14.26.79,3.78,3.66,5.6,5.37,6.68.12.08.26.16.39.25,1.65,10.03,6.98,18.56,15.52,24.77,9.23,6.72,20.2,9.43,27.78,10.52,4.49.65,9.15.97,13.85.97,9.67,0,23.77-1.39,36-8.02,11.58-6.27,18.81-16,21.04-28.24,4.52-2.76,6.36-5.67,5.98-12.71Z'%20fill='%2317174a'/%3e%3cpath%20d='M67.15,4.69c2.98.42,9.31.31,11.62,2.31,1.99,1.73,1.65,4.82,2.06,7.22,10.77,3.89,18.73,10.59,25.39,20.04.64.91,2.13,3.95,2.58,4.33,1.71,1.46,5.54.35,7.67,3.37,2.29,3.25,4.83,15.41,5.06,19.59.31,5.82-.76,6.9-5.58,9.44-3.28,26.16-29.7,34.5-52.68,34.5-4.6,0-9.06-.33-13.17-.93-18.13-2.61-37.11-12.11-39.51-33.08-1.7-1.92-4.96-2.54-5.55-5.39-.95-4.56,2.21-20.32,4.89-24.14,2.13-3.02,5.96-1.91,7.67-3.37.46-.39,1.94-3.42,2.58-4.33,6.54-9.28,14.55-16.22,25.21-19.87.85-.87-.3-5.45,2.43-7.55,2.52-1.94,8.35-1.69,11.42-2.16h7.91'%20fill='%23fff'/%3e%3cpath%20d='M121.86,61.51c-.22-4.2-2.78-16.43-5.07-19.7-1.77-2.51-4.71-2.18-6.64-2.83.1,1.18.16,2.37.16,3.57,0,26.85-25.96,48.61-57.98,48.61-15.83,0-30.17-5.32-40.63-13.94,4.91,17.1,22.06,25.14,38.51,27.52,4.12.59,8.6.93,13.21.93,23.06,0,49.57-8.38,52.85-34.68,4.83-2.56,5.91-3.63,5.6-9.49Z'%20fill='%23d0d7e2'%20mix-blend-mode='multiply'%20opacity='.4'/%3e%3cpath%20d='M62.91,97.68c5.82,0,11.67-.53,16.72-1.56,13.1-2.67,22.09-8.06,26.72-16.03,4.43-7.63,4.75-17.33.96-28.84-4.28-13-13.22-22.77-24.7-27.89-.13,4.51-3.84,8.16-8.38,8.16h-20.89c-4.61,0-8.39-3.78-8.39-8.39v-.14c-5.36,2.25-10.29,5.49-14.5,9.61-8.23,8.06-13.16,19.02-13.9,30.84-.59,9.44,2.67,17.53,9.43,23.42,6.27,5.46,15.68,9.02,27.2,10.3,3.13.35,6.43.52,9.73.52'%20fill='url(%23radial-gradient)'/%3e%3crect%20x='74.34'%20y='50.41'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient)'/%3e%3crect%20x='36.29'%20y='50.01'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient-2)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",_a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF2GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDggNzkuMTY0MDM2LCAyMDE5LzA4LzEzLTAxOjA2OjU3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjEuMCAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDE5LTExL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41eXQf4SorXgrZZUZYd09AogidwORFYYDb0zejEmF8B3HZgVCVwKwZsIM8FxhD80daXgcWu549tIrhj0R6qvgE/uhkYU03whBNC58cDD1T48QeBS5QU6xoUbA/gd8C5FX7FBCXFA9X0oWpvUyGfW5LOZFcDwyv4eH9gfDqTVYV8blmDwT0LeBxToKoCTVJSTK22H06IFzQBmFrFtP80cJmSYmnMwfYDfgscX+FXbAYuUFL8MYz+OCFf3AizSqw0B/UnwP3ATR2Dt2MC1kWfjDy/iplxg9llPB5Wv5waXOhQ4BGqq2/wMfAH4FYlxauWg/0icDn66Gg18eSrgdOUFKGe1XZqdNG9gFlUX+NoC/A34A7gSVsOgpsCWcOAi4GTQrDji8CpSorQz4Y5NTRCd+Bes5UKQ2+bVfdDwHP1qH7mev5X0CklziW8WhfTgO8G9VDVHXAHo0w0i44wa0PkzMh+ApirpHi3Rn3/AnAUuuDySUA2xK/fYBaV99XS/k5Ev/w+6IPetTo6+TraP74MnZHnFWClkuK/Zfbv8+j6UYcaR8xh6JOAB9eovwIYH0VoU2QP5F3P7wxMRj9BiarSSzuwCvjA/L3VtdrFvPYE9ie6qqYb0Omgfh3VKcvIIy5czz8YfQbnFJpLbegDeZGmjqxbSI3r+ScCtwL9GhzsS+jQ1tn1aLxuNRvMBR8OTCD4MZk4SJprO6JecOs6govcn88GfggcEXOwz5uZaboN2Qysi3p0Pf8Y40A4lfgUY96IduzcoaR4xqaOWRvW6nr+3sZJcg4wxNJuLjSOl2lKirU2djAWccvGkX+6cTYcE+G2pti26xnjZJkZhwcisQtMN6kCW4Ch5jUYyNSoufeMU2IBOtxmnpJiQ5zs1RAnD0xS837orHIHAb2MAyODDgzcs8j9fKNxgKwzIFehE8G9gT6fu1RJsSrutvk/GdqIAV0smzEAAAAASUVORK5CYII=",Ca={class:"q-chatbot"},xa={class:"q-chatbot__content"},Ea={class:"q-chatbot__footer-container"};return e.defineComponent({name:"ChatBot",__name:"ChatBot",props:{apiEndpoint:{default:"http://localhost:3000"},controllerEndpoint:{},username:{},projectPath:{},userImage:{default:_a},chatbotImage:{default:Ba},dateFormat:{},agentData:{default:()=>({id:"",formId:"",jobId:""})},availableAgents:{default:()=>[]}},emits:["apply-fields","direct-agent-chat"],setup(t,{emit:o}){const n=t,a=o,l=e.ref(!0),r=e.ref(null),i=e.ref(!0),s=e.ref(n.agentData.id),u=e.ref(n.agentData.formId),d=W(),{isLoading:f,clearChatData:c,getChatData:m,getJobResultData:h,sendPrompt:b}=ot(n.apiEndpoint),{messages:w,addChatMessage:v,clearMessages:P,getLastMessage:D,deleteMessageById:V}=it(),R=e.computed(()=>l.value||f.value);e.onBeforeMount(()=>{var y;(y=r.value)==null||y.removeEventListener("scroll",z)}),e.onMounted(()=>{_()});function M(y){l.value=y}async function _(){try{await L()}catch(y){v(d.loginError),console.error("Error logging in: "+y)}}async function L(){M(!0);const{data:y,error:B}=await m(n.username,n.projectPath,s.value,u.value);if(B||!y||!y.success){M(!0),v(d.botIsSick),console.log("Error loading chat data: "+B);return}M(!1),I(),y.history.forEach(async $=>{v($.content,$.type==="ai"?"bot":"user",void 0,$.sessionID)})}function I(){const y=d.initialMessage;v(y,"bot",void 0,void 0,!0)}function U(){P(),M(!1),i.value=!0}function z(){if(r.value){const{scrollTop:B,clientHeight:$,scrollHeight:N}=r.value;i.value=B+$>=N-20}}async function p(y,B){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),v(y,"user",B),k(y,B==null?void 0:B.fileData)}async function g(y){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),v("","bot");const B=D();B&&await h(y,$=>{if(B.message+=$,B.fields||(B.fields=[]),B.fields.length>0){const N=B.fields[B.fields.length-1];N.text=B.message}},$=>{var G;B.message="";const N=$;(G=B.fields)==null||G.push({id:N.id,type:N.type,name:N.name,text:N.text})},$=>{M(!0),v(d.botIsSick),console.error("Error getting job result: "+$),V(B.id)})}async function k(y,B){const $=lt(),N=new FormData;if(B&&N.append("file",B),N.append("message",y),N.append("project",n.projectPath),N.append("user",n.username),N.append("sessionID",$),s.value!=="")a("direct-agent-chat",s.value,y);else{v("","bot");const G=D();if(!G)return;await b(N,Z=>{G&&(G.message+=Z)},Z=>{M(!0),v(d.botIsSick),console.error("Error sending message: "+Z),V(G.id)})}}async function S(){const{data:y,error:B}=await c(n.username,n.projectPath,s.value,u.value);if(B||!y||!y.success){M(!0),v(d.loginError),console.log("Error clearing chat: "+B);return}U(),I()}function x(y){const B=["q-chatbot__messages-wrapper"];return y==="user"&&B.push("q-chatbot__messages-wrapper_right"),B}async function A(y){s.value=y.key,u.value=y.formId,U(),await _()}function E(y){!y||y.length===0||a("apply-fields",y)}function q(y){const B=d.regenerateResponsePrompt.replace("{0}",y);a("direct-agent-chat",s.value,B)}return e.watch(()=>n.availableAgents,(y,B)=>{y.length===0&&B.length>0&&(s.value="",u.value="",U(),_())}),e.watch(()=>n.agentData,async(y,B)=>{if(R.value)return;const $=y.jobId,N=B.jobId,G=$!==N;y.id!==s.value&&await A({formId:y.formId,key:y.id}),$&&G&&await g($)},{deep:!0}),(y,B)=>(e.openBlock(),e.createElementBlock("div",Ca,[e.createElementVNode("div",xa,[e.createVNode(e.unref(ua),{disabled:R.value,"available-agents":n.availableAgents,"selected-agent-key":s.value,onClear:S,onChangeChat:A},null,8,["disabled","available-agents","selected-agent-key"]),e.createElementVNode("div",{ref_key:"messagesContainer",ref:r,class:"q-chatbot__messages-container",onScroll:z},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),$=>(e.openBlock(),e.createElementBlock("div",{key:$.id,class:e.normalizeClass(x($.sender))},[e.createVNode(e.unref(ta),e.mergeProps({ref_for:!0},$,{"date-format":n.dateFormat,"user-image":n.userImage,"chatbot-image":n.chatbotImage,loading:e.unref(f)&&!$.message,file:$.file,"api-endpoint":n.apiEndpoint,"session-i-d":$.sessionID,fields:$.fields,onRegenerate:q,onApplyFields:E}),null,16,["date-format","user-image","chatbot-image","loading","file","api-endpoint","session-i-d","fields"])],2))),128))],544)]),e.createElementVNode("div",Ea,[e.createVNode(e.unref(ka),{disabled:R.value,loading:e.unref(f),onSendMessage:p},null,8,["disabled","loading"])])]))}})});
|
package/dist/index.mjs
CHANGED
|
@@ -2835,7 +2835,10 @@ function Vt(e, n) {
|
|
|
2835
2835
|
return n.toString();
|
|
2836
2836
|
}
|
|
2837
2837
|
}
|
|
2838
|
-
|
|
2838
|
+
function Za(e) {
|
|
2839
|
+
return e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
2840
|
+
}
|
|
2841
|
+
const Ja = ["data-testid"], Qa = { class: "q-field-preview__toolbar" }, Wa = { class: "q-field-preview__footer" }, Ya = /* @__PURE__ */ T({
|
|
2839
2842
|
__name: "FieldPreview",
|
|
2840
2843
|
props: {
|
|
2841
2844
|
name: {},
|
|
@@ -2862,8 +2865,11 @@ const Za = { class: "q-field-preview" }, Ja = { class: "q-field-preview__toolbar
|
|
|
2862
2865
|
function b() {
|
|
2863
2866
|
i.value || (i.value = !0, o("regenerate", t.name));
|
|
2864
2867
|
}
|
|
2865
|
-
return (g, _) => (y(), $("div",
|
|
2866
|
-
|
|
2868
|
+
return (g, _) => (y(), $("div", {
|
|
2869
|
+
class: "q-field-preview",
|
|
2870
|
+
"data-testid": f(Za)(t.name)
|
|
2871
|
+
}, [
|
|
2872
|
+
R("div", Qa, [
|
|
2867
2873
|
R("span", null, [
|
|
2868
2874
|
Ge(ne(f(r).suggestionsForField) + " ", 1),
|
|
2869
2875
|
R("b", null, ne(t.name), 1)
|
|
@@ -2874,7 +2880,7 @@ const Za = { class: "q-field-preview" }, Ja = { class: "q-field-preview__toolbar
|
|
|
2874
2880
|
}, [
|
|
2875
2881
|
(y(), H(_t(c.value), Se(Ne(p.value)), null, 16))
|
|
2876
2882
|
], 2),
|
|
2877
|
-
R("div",
|
|
2883
|
+
R("div", Wa, [
|
|
2878
2884
|
D(f(qt), { borderless: "" }, {
|
|
2879
2885
|
default: E(() => [
|
|
2880
2886
|
D(f(re), {
|
|
@@ -2905,15 +2911,15 @@ const Za = { class: "q-field-preview" }, Ja = { class: "q-field-preview__toolbar
|
|
|
2905
2911
|
_: 1
|
|
2906
2912
|
})
|
|
2907
2913
|
])
|
|
2908
|
-
]));
|
|
2914
|
+
], 8, Ja));
|
|
2909
2915
|
}
|
|
2910
|
-
}),
|
|
2916
|
+
}), Xa = { class: "pulsing-dots" }, Ka = { class: "generating-text" }, er = { class: "dots-container" }, tr = /* @__PURE__ */ T({
|
|
2911
2917
|
__name: "PulseDots",
|
|
2912
2918
|
setup(e) {
|
|
2913
2919
|
const n = [1, 2, 3], t = me();
|
|
2914
|
-
return (o, r) => (y(), $("div",
|
|
2915
|
-
R("span",
|
|
2916
|
-
R("div",
|
|
2920
|
+
return (o, r) => (y(), $("div", Xa, [
|
|
2921
|
+
R("span", Ka, ne(f(t).generatingResponse), 1),
|
|
2922
|
+
R("div", er, [
|
|
2917
2923
|
(y(), $(ce, null, Ce(n, (a, i) => R("span", {
|
|
2918
2924
|
key: i,
|
|
2919
2925
|
class: "dot",
|
|
@@ -2922,16 +2928,16 @@ const Za = { class: "q-field-preview" }, Ja = { class: "q-field-preview__toolbar
|
|
|
2922
2928
|
])
|
|
2923
2929
|
]));
|
|
2924
2930
|
}
|
|
2925
|
-
}),
|
|
2931
|
+
}), nr = { class: "q-chatbot__message-container" }, or = { class: "q-chatbot__message-wrapper" }, ar = {
|
|
2926
2932
|
key: 0,
|
|
2927
2933
|
class: "q-chatbot__image-preview"
|
|
2928
|
-
},
|
|
2934
|
+
}, rr = ["src", "alt"], ir = {
|
|
2929
2935
|
key: 1,
|
|
2930
2936
|
class: "q-chatbot__file-preview-container"
|
|
2931
|
-
},
|
|
2937
|
+
}, lr = { class: "q-chatbot__file-icon-container" }, sr = { class: "q-chatbot__file-info" }, cr = { class: "q-chatbot__file-name" }, ur = { class: "q-chatbot__file-extension" }, dr = { class: "q-chatbot__message" }, pr = {
|
|
2932
2938
|
key: 1,
|
|
2933
2939
|
class: "q-chatbot__text q-chatbot__user-text"
|
|
2934
|
-
},
|
|
2940
|
+
}, fr = /* @__PURE__ */ T({
|
|
2935
2941
|
__name: "ChatBotMessage",
|
|
2936
2942
|
props: {
|
|
2937
2943
|
sender: { default: "user" },
|
|
@@ -2981,33 +2987,33 @@ const Za = { class: "q-field-preview" }, Ja = { class: "q-field-preview__toolbar
|
|
|
2981
2987
|
}
|
|
2982
2988
|
return (g, _) => {
|
|
2983
2989
|
var B, W, G;
|
|
2984
|
-
return y(), $("div",
|
|
2990
|
+
return y(), $("div", nr, [
|
|
2985
2991
|
D(f(Y), {
|
|
2986
2992
|
type: "img",
|
|
2987
2993
|
icon: u.value,
|
|
2988
2994
|
alt: f(r).senderImage,
|
|
2989
2995
|
class: "q-chatbot__profile"
|
|
2990
2996
|
}, null, 8, ["icon", "alt"]),
|
|
2991
|
-
R("div",
|
|
2992
|
-
l.value ? (y(), $("div",
|
|
2997
|
+
R("div", or, [
|
|
2998
|
+
l.value ? (y(), $("div", ar, [
|
|
2993
2999
|
R("img", {
|
|
2994
3000
|
src: (B = t.file) == null ? void 0 : B.previewUrl,
|
|
2995
3001
|
alt: f(r).imagePreview
|
|
2996
|
-
}, null, 8,
|
|
2997
|
-
])) : (W = t.file) != null && W.fileData && !l.value ? (y(), $("div",
|
|
2998
|
-
R("div",
|
|
3002
|
+
}, null, 8, rr)
|
|
3003
|
+
])) : (W = t.file) != null && W.fileData && !l.value ? (y(), $("div", ir, [
|
|
3004
|
+
R("div", lr, [
|
|
2999
3005
|
D(f(Y), {
|
|
3000
3006
|
icon: "file",
|
|
3001
3007
|
class: "q-chatbot__file-icon"
|
|
3002
3008
|
})
|
|
3003
3009
|
]),
|
|
3004
|
-
R("div",
|
|
3005
|
-
R("span",
|
|
3006
|
-
R("span",
|
|
3010
|
+
R("div", sr, [
|
|
3011
|
+
R("span", cr, ne((G = t.file) == null ? void 0 : G.fileData.name), 1),
|
|
3012
|
+
R("span", ur, ne(c.value), 1)
|
|
3007
3013
|
])
|
|
3008
3014
|
])) : P("", !0),
|
|
3009
|
-
R("div",
|
|
3010
|
-
g.loading ? (y(), H(
|
|
3015
|
+
R("div", dr, [
|
|
3016
|
+
g.loading ? (y(), H(tr, { key: 0 })) : t.sender === "bot" && t.fields.length > 0 ? (y(!0), $(ce, { key: 1 }, Ce(t.fields, (j, z) => (y(), H(f(Ya), {
|
|
3011
3017
|
key: z,
|
|
3012
3018
|
class: "q-chatbot__text",
|
|
3013
3019
|
text: j.text || "",
|
|
@@ -3021,11 +3027,11 @@ const Za = { class: "q-field-preview" }, Ja = { class: "q-field-preview__toolbar
|
|
|
3021
3027
|
key: 0,
|
|
3022
3028
|
class: "q-chatbot__text",
|
|
3023
3029
|
source: t.message || ""
|
|
3024
|
-
}, null, 8, ["source"])) : (y(), $("div",
|
|
3030
|
+
}, null, 8, ["source"])) : (y(), $("div", pr, ne(t.message), 1))
|
|
3025
3031
|
], 64))
|
|
3026
3032
|
])
|
|
3027
3033
|
]),
|
|
3028
|
-
D(f(
|
|
3034
|
+
D(f(_r), {
|
|
3029
3035
|
"show-buttons": i.value,
|
|
3030
3036
|
loading: t.loading,
|
|
3031
3037
|
"date-format": t.dateFormat,
|
|
@@ -3039,29 +3045,29 @@ const Za = { class: "q-field-preview" }, Ja = { class: "q-field-preview__toolbar
|
|
|
3039
3045
|
}), K = [];
|
|
3040
3046
|
for (let e = 0; e < 256; ++e)
|
|
3041
3047
|
K.push((e + 256).toString(16).slice(1));
|
|
3042
|
-
function
|
|
3048
|
+
function vr(e, n = 0) {
|
|
3043
3049
|
return (K[e[n + 0]] + K[e[n + 1]] + K[e[n + 2]] + K[e[n + 3]] + "-" + K[e[n + 4]] + K[e[n + 5]] + "-" + K[e[n + 6]] + K[e[n + 7]] + "-" + K[e[n + 8]] + K[e[n + 9]] + "-" + K[e[n + 10]] + K[e[n + 11]] + K[e[n + 12]] + K[e[n + 13]] + K[e[n + 14]] + K[e[n + 15]]).toLowerCase();
|
|
3044
3050
|
}
|
|
3045
3051
|
let Je;
|
|
3046
|
-
const
|
|
3047
|
-
function
|
|
3052
|
+
const mr = new Uint8Array(16);
|
|
3053
|
+
function gr() {
|
|
3048
3054
|
if (!Je) {
|
|
3049
3055
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
3050
3056
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
3051
3057
|
Je = crypto.getRandomValues.bind(crypto);
|
|
3052
3058
|
}
|
|
3053
|
-
return Je(
|
|
3059
|
+
return Je(mr);
|
|
3054
3060
|
}
|
|
3055
|
-
const
|
|
3061
|
+
const br = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), wt = { randomUUID: br };
|
|
3056
3062
|
function Ht(e, n, t) {
|
|
3057
3063
|
var r;
|
|
3058
3064
|
if (wt.randomUUID && !n && !e)
|
|
3059
3065
|
return wt.randomUUID();
|
|
3060
3066
|
e = e || {};
|
|
3061
|
-
const o = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ??
|
|
3067
|
+
const o = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ?? gr();
|
|
3062
3068
|
if (o.length < 16)
|
|
3063
3069
|
throw new Error("Random bytes length must be >= 16");
|
|
3064
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
3070
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, vr(o);
|
|
3065
3071
|
}
|
|
3066
3072
|
const pe = N([]), qe = N(1);
|
|
3067
3073
|
function Zt() {
|
|
@@ -3100,10 +3106,10 @@ function Zt() {
|
|
|
3100
3106
|
deleteMessageById: o
|
|
3101
3107
|
};
|
|
3102
3108
|
}
|
|
3103
|
-
const
|
|
3109
|
+
const hr = { class: "q-chatbot__dialog-title" }, yr = {
|
|
3104
3110
|
key: 0,
|
|
3105
3111
|
class: "q-chatbot__feedback-buttons"
|
|
3106
|
-
},
|
|
3112
|
+
}, wr = { class: "q-chatbot__sender" }, _r = /* @__PURE__ */ T({
|
|
3107
3113
|
__name: "ChatBotMessageButtons",
|
|
3108
3114
|
props: {
|
|
3109
3115
|
loading: { type: Boolean },
|
|
@@ -3166,7 +3172,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3166
3172
|
buttons: g
|
|
3167
3173
|
}, {
|
|
3168
3174
|
body: E(() => [
|
|
3169
|
-
R("div",
|
|
3175
|
+
R("div", hr, ne(f(r).commentDialogTitle), 1),
|
|
3170
3176
|
D(f(Nt), {
|
|
3171
3177
|
modelValue: l.value,
|
|
3172
3178
|
"onUpdate:modelValue": ee[0] || (ee[0] = (te) => l.value = te),
|
|
@@ -3178,7 +3184,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3178
3184
|
]),
|
|
3179
3185
|
_: 1
|
|
3180
3186
|
}, 8, ["modelValue"]),
|
|
3181
|
-
U.showButtons ? (y(), $("div",
|
|
3187
|
+
U.showButtons ? (y(), $("div", yr, [
|
|
3182
3188
|
D(f(qt), null, {
|
|
3183
3189
|
default: E(() => [
|
|
3184
3190
|
D(f(re), {
|
|
@@ -3236,10 +3242,10 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3236
3242
|
_: 1
|
|
3237
3243
|
})
|
|
3238
3244
|
])) : P("", !0),
|
|
3239
|
-
R("div",
|
|
3245
|
+
R("div", wr, ne(B.value), 1)
|
|
3240
3246
|
], 64));
|
|
3241
3247
|
}
|
|
3242
|
-
}),
|
|
3248
|
+
}), kr = { class: "q-chatbot__tools" }, $r = { class: "q-chatbot__tools__select" }, Ar = /* @__PURE__ */ T({
|
|
3243
3249
|
__name: "ChatToolBar",
|
|
3244
3250
|
props: {
|
|
3245
3251
|
disabled: { type: Boolean },
|
|
@@ -3283,8 +3289,8 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3283
3289
|
}
|
|
3284
3290
|
return (s, v) => {
|
|
3285
3291
|
const b = ln("q-select");
|
|
3286
|
-
return y(), $("div",
|
|
3287
|
-
R("div",
|
|
3292
|
+
return y(), $("div", kr, [
|
|
3293
|
+
R("div", $r, [
|
|
3288
3294
|
i.value ? (y(), H(b, {
|
|
3289
3295
|
key: 0,
|
|
3290
3296
|
modelValue: l.value,
|
|
@@ -3293,6 +3299,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3293
3299
|
p
|
|
3294
3300
|
],
|
|
3295
3301
|
inline: "",
|
|
3302
|
+
required: "",
|
|
3296
3303
|
class: "q-chatbot__tools-select-input",
|
|
3297
3304
|
size: "medium",
|
|
3298
3305
|
items: u.value
|
|
@@ -3313,14 +3320,14 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3313
3320
|
]);
|
|
3314
3321
|
};
|
|
3315
3322
|
}
|
|
3316
|
-
}),
|
|
3323
|
+
}), xr = { class: "q-chatbot__input-wrapper" }, Ir = {
|
|
3317
3324
|
key: 0,
|
|
3318
3325
|
class: "q-chatbot__file-preview"
|
|
3319
|
-
},
|
|
3326
|
+
}, Sr = ["src", "alt"], Dr = {
|
|
3320
3327
|
key: 1,
|
|
3321
3328
|
class: "q-chatbot__file-preview",
|
|
3322
3329
|
tabindex: "0"
|
|
3323
|
-
},
|
|
3330
|
+
}, Er = { class: "q-chatbot__file-name" }, Cr = { class: "q-chatbot__input" }, Br = { class: "q-chatbot__send-container" }, Rr = ["accept"], qr = /* @__PURE__ */ T({
|
|
3324
3331
|
__name: "ChatBotInput",
|
|
3325
3332
|
props: {
|
|
3326
3333
|
disabled: { type: Boolean },
|
|
@@ -3384,20 +3391,20 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3384
3391
|
onDragleave: Le(_, ["prevent"]),
|
|
3385
3392
|
onDrop: Le(B, ["prevent"])
|
|
3386
3393
|
}, [
|
|
3387
|
-
R("div",
|
|
3388
|
-
i.value ? (y(), $("div",
|
|
3394
|
+
R("div", xr, [
|
|
3395
|
+
i.value ? (y(), $("div", Ir, [
|
|
3389
3396
|
p.value ? (y(), $("img", {
|
|
3390
3397
|
key: 0,
|
|
3391
3398
|
class: "q-chatbot__image-preview",
|
|
3392
3399
|
src: l.value,
|
|
3393
3400
|
tabindex: "0",
|
|
3394
3401
|
alt: f(r).imagePreview
|
|
3395
|
-
}, null, 8,
|
|
3402
|
+
}, null, 8, Sr)) : (y(), $("div", Dr, [
|
|
3396
3403
|
D(f(Y), {
|
|
3397
3404
|
icon: "file",
|
|
3398
3405
|
class: "q-chatbot__file-icon"
|
|
3399
3406
|
}),
|
|
3400
|
-
R("span",
|
|
3407
|
+
R("span", Er, ne(i.value.name), 1)
|
|
3401
3408
|
])),
|
|
3402
3409
|
D(f(re), {
|
|
3403
3410
|
class: "q-chatbot__remove-file",
|
|
@@ -3412,7 +3419,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3412
3419
|
_: 1
|
|
3413
3420
|
})
|
|
3414
3421
|
])) : P("", !0),
|
|
3415
|
-
R("div",
|
|
3422
|
+
R("div", Cr, [
|
|
3416
3423
|
D(f(Va), {
|
|
3417
3424
|
id: "chatbot-input",
|
|
3418
3425
|
modelValue: s.value,
|
|
@@ -3425,7 +3432,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3425
3432
|
onKeyup: sn(G, ["enter"])
|
|
3426
3433
|
}, null, 8, ["modelValue", "disabled"])
|
|
3427
3434
|
]),
|
|
3428
|
-
R("div",
|
|
3435
|
+
R("div", Br, [
|
|
3429
3436
|
D(f(re), {
|
|
3430
3437
|
title: f(r).imageUpload,
|
|
3431
3438
|
class: "q-chatbot__upload",
|
|
@@ -3445,7 +3452,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3445
3452
|
accept: c.value,
|
|
3446
3453
|
class: "hidden-input",
|
|
3447
3454
|
onChange: V
|
|
3448
|
-
}, null, 40,
|
|
3455
|
+
}, null, 40, Rr),
|
|
3449
3456
|
D(f(re), {
|
|
3450
3457
|
title: f(r).sendMessage,
|
|
3451
3458
|
variant: "bold",
|
|
@@ -3464,7 +3471,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3464
3471
|
], 34)
|
|
3465
3472
|
], 64));
|
|
3466
3473
|
}
|
|
3467
|
-
}),
|
|
3474
|
+
}), Lr = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20126.25%20110.36'%3e%3cdefs%3e%3cradialGradient%20id='radial-gradient'%20cx='45.24'%20cy='38.05'%20fx='45.24'%20fy='38.05'%20r='59.09'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%2331319e'/%3e%3cstop%20offset='.19'%20stop-color='%232e2e97'/%3e%3cstop%20offset='.45'%20stop-color='%23292985'/%3e%3cstop%20offset='.75'%20stop-color='%23202067'/%3e%3cstop%20offset='1'%20stop-color='%2317174a'/%3e%3c/radialGradient%3e%3clinearGradient%20id='linear-gradient'%20x1='82.65'%20y1='50.41'%20x2='82.65'%20y2='77.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.02'%20stop-color='%2366ebfe'/%3e%3cstop%20offset='.96'%20stop-color='%2300bfdb'/%3e%3c/linearGradient%3e%3clinearGradient%20id='linear-gradient-2'%20x1='44.6'%20y1='50.01'%20x2='44.6'%20y2='77.1'%20xlink:href='%23linear-gradient'/%3e%3c/defs%3e%3cg%20isolation='isolate'%3e%3cg%20id='Layer_1'%3e%3cpath%20d='M126.2,61.4c-.2-3.69-2.61-17.39-5.92-22.09-2.42-3.44-5.89-4.03-7.96-4.38-.13-.02-.27-.05-.41-.07-.16-.28-.32-.58-.45-.81-.63-1.14-1.03-1.87-1.44-2.44-6.96-9.88-14.91-16.51-24.85-20.69-.25-2.29-.84-5.24-3.37-7.44-2.93-2.55-7.58-2.9-11.68-3.21-.93-.07-1.82-.14-2.4-.22l-.33-.05h-8.61l-.36.05c-.65.1-1.61.17-2.63.24-3.75.27-8.01.57-10.98,2.85-2.94,2.26-3.58,5.55-3.79,7.84-9.71,3.94-17.86,10.71-24.85,20.62-.4.57-.81,1.3-1.43,2.44-.13.23-.29.53-.45.81-.14.02-.28.05-.4.07-2.07.35-5.54.94-7.96,4.39-2.25,3.19-3.84,9.89-4.58,13.59-.6,2.97-1.9,10.3-1.08,14.26.79,3.78,3.66,5.6,5.37,6.68.12.08.26.16.39.25,1.65,10.03,6.98,18.56,15.52,24.77,9.23,6.72,20.2,9.43,27.78,10.52,4.49.65,9.15.97,13.85.97,9.67,0,23.77-1.39,36-8.02,11.58-6.27,18.81-16,21.04-28.24,4.52-2.76,6.36-5.67,5.98-12.71Z'%20fill='%2317174a'/%3e%3cpath%20d='M67.15,4.69c2.98.42,9.31.31,11.62,2.31,1.99,1.73,1.65,4.82,2.06,7.22,10.77,3.89,18.73,10.59,25.39,20.04.64.91,2.13,3.95,2.58,4.33,1.71,1.46,5.54.35,7.67,3.37,2.29,3.25,4.83,15.41,5.06,19.59.31,5.82-.76,6.9-5.58,9.44-3.28,26.16-29.7,34.5-52.68,34.5-4.6,0-9.06-.33-13.17-.93-18.13-2.61-37.11-12.11-39.51-33.08-1.7-1.92-4.96-2.54-5.55-5.39-.95-4.56,2.21-20.32,4.89-24.14,2.13-3.02,5.96-1.91,7.67-3.37.46-.39,1.94-3.42,2.58-4.33,6.54-9.28,14.55-16.22,25.21-19.87.85-.87-.3-5.45,2.43-7.55,2.52-1.94,8.35-1.69,11.42-2.16h7.91'%20fill='%23fff'/%3e%3cpath%20d='M121.86,61.51c-.22-4.2-2.78-16.43-5.07-19.7-1.77-2.51-4.71-2.18-6.64-2.83.1,1.18.16,2.37.16,3.57,0,26.85-25.96,48.61-57.98,48.61-15.83,0-30.17-5.32-40.63-13.94,4.91,17.1,22.06,25.14,38.51,27.52,4.12.59,8.6.93,13.21.93,23.06,0,49.57-8.38,52.85-34.68,4.83-2.56,5.91-3.63,5.6-9.49Z'%20fill='%23d0d7e2'%20mix-blend-mode='multiply'%20opacity='.4'/%3e%3cpath%20d='M62.91,97.68c5.82,0,11.67-.53,16.72-1.56,13.1-2.67,22.09-8.06,26.72-16.03,4.43-7.63,4.75-17.33.96-28.84-4.28-13-13.22-22.77-24.7-27.89-.13,4.51-3.84,8.16-8.38,8.16h-20.89c-4.61,0-8.39-3.78-8.39-8.39v-.14c-5.36,2.25-10.29,5.49-14.5,9.61-8.23,8.06-13.16,19.02-13.9,30.84-.59,9.44,2.67,17.53,9.43,23.42,6.27,5.46,15.68,9.02,27.2,10.3,3.13.35,6.43.52,9.73.52'%20fill='url(%23radial-gradient)'/%3e%3crect%20x='74.34'%20y='50.41'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient)'/%3e%3crect%20x='36.29'%20y='50.01'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient-2)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Mr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF2GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDggNzkuMTY0MDM2LCAyMDE5LzA4LzEzLTAxOjA2OjU3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh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L9GhzsS+jQ1tn1aLxuNRvMBR8OTCD4MZk4SJprO6JecOs6govcn88GfggcEXOwz5uZaboN2Qysi3p0Pf8Y40A4lfgUY96IduzcoaR4xqaOWRvW6nr+3sZJcg4wxNJuLjSOl2lKirU2djAWccvGkX+6cTYcE+G2pti26xnjZJkZhwcisQtMN6kCW4Ch5jUYyNSoufeMU2IBOtxmnpJiQ5zs1RAnD0xS837orHIHAb2MAyODDgzcs8j9fKNxgKwzIFehE8G9gT6fu1RJsSrutvk/GdqIAV0smzEAAAAASUVORK5CYII=", Nr = { class: "q-chatbot" }, Fr = { class: "q-chatbot__content" }, Tr = { class: "q-chatbot__footer-container" }, Gr = /* @__PURE__ */ T({
|
|
3468
3475
|
name: "ChatBot",
|
|
3469
3476
|
__name: "ChatBot",
|
|
3470
3477
|
props: {
|
|
@@ -3472,8 +3479,8 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3472
3479
|
controllerEndpoint: {},
|
|
3473
3480
|
username: {},
|
|
3474
3481
|
projectPath: {},
|
|
3475
|
-
userImage: { default:
|
|
3476
|
-
chatbotImage: { default:
|
|
3482
|
+
userImage: { default: Mr },
|
|
3483
|
+
chatbotImage: { default: Lr },
|
|
3477
3484
|
dateFormat: {},
|
|
3478
3485
|
agentData: { default: () => ({
|
|
3479
3486
|
id: "",
|
|
@@ -3633,9 +3640,9 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3633
3640
|
h.id !== l.value && await O({ formId: h.formId, key: h.id }), M && oe && await m(M);
|
|
3634
3641
|
},
|
|
3635
3642
|
{ deep: !0 }
|
|
3636
|
-
), (h, A) => (y(), $("div",
|
|
3637
|
-
R("div",
|
|
3638
|
-
D(f(
|
|
3643
|
+
), (h, A) => (y(), $("div", Nr, [
|
|
3644
|
+
R("div", Fr, [
|
|
3645
|
+
D(f(Ar), {
|
|
3639
3646
|
disabled: z.value,
|
|
3640
3647
|
"available-agents": t.availableAgents,
|
|
3641
3648
|
"selected-agent-key": l.value,
|
|
@@ -3652,7 +3659,7 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3652
3659
|
key: M.id,
|
|
3653
3660
|
class: Q(S(M.sender))
|
|
3654
3661
|
}, [
|
|
3655
|
-
D(f(
|
|
3662
|
+
D(f(fr), se({ ref_for: !0 }, M, {
|
|
3656
3663
|
"date-format": t.dateFormat,
|
|
3657
3664
|
"user-image": t.userImage,
|
|
3658
3665
|
"chatbot-image": t.chatbotImage,
|
|
@@ -3667,8 +3674,8 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3667
3674
|
], 2))), 128))
|
|
3668
3675
|
], 544)
|
|
3669
3676
|
]),
|
|
3670
|
-
R("div",
|
|
3671
|
-
D(f(
|
|
3677
|
+
R("div", Tr, [
|
|
3678
|
+
D(f(qr), {
|
|
3672
3679
|
disabled: z.value,
|
|
3673
3680
|
loading: f(p),
|
|
3674
3681
|
onSendMessage: d
|
|
@@ -3678,5 +3685,5 @@ const br = { class: "q-chatbot__dialog-title" }, hr = {
|
|
|
3678
3685
|
}
|
|
3679
3686
|
});
|
|
3680
3687
|
export {
|
|
3681
|
-
|
|
3688
|
+
Gr as default
|
|
3682
3689
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toKebabCase(str: string): string;
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="q-field-preview"
|
|
4
|
+
:data-testid="toKebabCase(props.name)">
|
|
3
5
|
<div class="q-field-preview__toolbar">
|
|
4
6
|
<span>
|
|
5
7
|
{{ texts.suggestionsForField }} <b>{{ props.name }}</b>
|
|
@@ -39,7 +41,9 @@
|
|
|
39
41
|
import { FieldPreviewProps } from './types'
|
|
40
42
|
import { useTexts } from '@/composables/useTexts'
|
|
41
43
|
import { computed, ref } from 'vue'
|
|
44
|
+
|
|
42
45
|
import { parseFieldValue } from '@/utils/parseFieldValue'
|
|
46
|
+
import { toKebabCase } from '@/utils/string'
|
|
43
47
|
|
|
44
48
|
const props = defineProps<FieldPreviewProps>()
|
|
45
49
|
const emit = defineEmits<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`FieldPreview > renders correctly with default props 1`] = `
|
|
4
|
-
"<div class="q-field-preview">
|
|
4
|
+
"<div class="q-field-preview" data-testid="test-field">
|
|
5
5
|
<div class="q-field-preview__toolbar"><span>Suggestions for field: <b>Test Field</b></span></div>
|
|
6
6
|
<div class="q-field-preview__content">
|
|
7
7
|
<div class="markdown-renderer">
|