|
import{b as y}from"./index.DPWiq6NR.js";import{s as S,e as C,k as O,c as b,a as d,o as A,d as h,f as o,i as B,g,C as N,u as k,n as T,F as E,y as p,z as w}from"./scheduler.DB3Sqaa-.js";import{S as q,i as z}from"./index.CidI1d1E.js";const G=async(s,t)=>{let e=null;const n=await fetch(`${y}/configs/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({config:t})}).then(async a=>{if(!a.ok)throw await a.json();return a.json()}).catch(a=>(console.log(a),e=a.detail,null));if(e)throw e;return n},F=async s=>{let t=null;const e=await fetch(`${y}/configs/export`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}}).then(async n=>{if(!n.ok)throw await n.json();return n.json()}).catch(n=>(console.log(n),t=n.detail,null));if(t)throw t;return e},L=async(s,t)=>{let e=null;const n=await fetch(`${y}/configs/default/models`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({models:t})}).then(async a=>{if(!a.ok)throw await a.json();return a.json()}).catch(a=>(console.log(a),e=a.detail,null));if(e)throw e;return n},R=async(s,t)=>{let e=null;const n=await fetch(`${y}/configs/default/suggestions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({suggestions:t})}).then(async a=>{if(!a.ok)throw await a.json();return a.json()}).catch(a=>(console.log(a),e=a.detail,null));if(e)throw e;return n},V=async s=>{let t=null;const e=await fetch(`${y}/configs/banners`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}}).then(async n=>{if(!n.ok)throw await n.json();return n.json()}).catch(n=>(console.log(n),t=n.detail,null));if(t)throw t;return e},W=async(s,t)=>{let e=null;const n=await fetch(`${y}/configs/banners`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({banners:t})}).then(async a=>{if(!a.ok)throw await a.json();return a.json()}).catch(a=>(console.log(a),e=a.detail,null));if(e)throw e;return n};function P(s){let t,e,n;return{c(){t=p("svg"),e=p("path"),n=p("path"),this.h()},l(a){t=w(a,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=d(t);e=w(i,"path",{d:!0}),d(e).forEach(h),n=w(i,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),d(n).forEach(h),i.forEach(h),this.h()},h(){o(e,"d","M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"),o(n,"fill-rule","evenodd"),o(n,"d","M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .566A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"),o(n,"clip-rule","evenodd"),o(t,"xmlns","http://www.w3.org/2000/svg"),o(t,"viewBox","0 0 16 16"),o(t,"fill","currentColor"),o(t,"class","w-4 h-4")},m(a,i){B(a,t,i),g(t,e),g(t,n)},d(a){a&&h(t)}}}function Z(s){let t,e,n;return{c(){t=p("svg"),e=p("path"),n=p("path"),this.h()},l(a){t=w(a,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=d(t);e=w(i,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),d(e).forEach(h),n=w(i,"path",{d:!0}),d(n).forEach(h),i.forEach(h),this.h()},h(){o(e,"fill-rule","evenodd"),o(e,"d","M3.28 2.22a.75.75 0 0 0-1.06 1.06l10.5 10.5a.75.75 0 1 0 1.06-1.06l-1.322-1.323a7.012 7.012 0 0 0 2.16-3.11.87.87 0 0 0 0-.567A7.003 7.003 0 0 0 4.82 3.76l-1.54-1.54Zm3.196 3.195 1.135 1.136A1.502 1.502 0 0 1 9.45 8.389l1.136 1.135a3 3 0 0 0-4.109-4.109Z"),o(e,"clip-rule","evenodd"),o(n,"d","m7.812 10.994 1.816 1.816A7.003 7.003 0 0 1 1.38 8.28a.87.87 0 0 1 0-.566 6.985 6.985 0 0 1 1.113-2.039l2.513 2.513a3 3 0 0 0 2.806 2.806Z"),o(t,"xmlns","http://www.w3.org/2000/svg"),o(t,"viewBox","0 0 16 16"),o(t,"fill","currentColor"),o(t,"class","w-4 h-4")},m(a,i){B(a,t,i),g(t,e),g(t,n)},d(a){a&&h(t)}}}function I(s){let t,e,n,a,i,u,m,_;function v(r,l){return r[7]?Z:P}let f=v(s),c=f(s);return{c(){t=C("div"),e=C("input"),i=O(),u=C("button"),c.c(),this.h()},l(r){t=b(r,"DIV",{class:!0});var l=d(t);e=b(l,"INPUT",{class:!0,placeholder:!0,autocomplete:!0,type:!0}),i=A(l),u=b(l,"BUTTON",{class:!0});var j=d(u);c.l(j),j.forEach(h),l.forEach(h),this.h()},h(){o(e,"class",n=`${s[5]} ${s[7]?"":"password"}`),o(e,"placeholder",s[1]),e.required=a=s[2]&&!s[3],e.disabled=s[3],o(e,"autocomplete","off"),o(e,"type","text"),o(u,"class",s[6]),o(t,"class",s[4])},m(r,l){B(r,t,l),g(t,e),N(e,s[0]),g(t,i),g(t,u),c.m(u,null),m||(_=[k(e,"input",s[8]),k(u,"click",s[9])],m=!0)},p(r,[l]){l&160&&n!==(n=`${r[5]} ${r[7]?"":"password"}`)&&o(e,"class",n),l&2&&o(e,"placeholder",r[1]),l&12&&a!==(a=r[2]&&!r[3])&&(e.required=a),l&8&&(e.disabled=r[3]),l&1&&e.value!==r[0]&&N(e,r[0]),f!==(f=v(r))&&(c.d(1),c=f(r),c&&(c.c(),c.m(u,null))),l&64&&o(u,"class",r[6]),l&16&&o(t,"class",r[4])},i:T,o:T,d(r){r&&h(t),c.d(),m=!1,E(_)}}}function M(s,t,e){let{value:n=""}=t,{placeholder:a=""}=t,{required:i=!0}=t,{readOnly:u=!1}=t,{outerClassName:m="flex flex-1"}=t,{inputClassName:_="w-full rounded-l-lg py-2 pl-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"}=t,{showButtonClassName:v="px-2 transition rounded-r-lg bg-gray-50 dark:bg-gray-850"}=t,f=!1;function c(){n=this.value,e(0,n)}const r=l=>{l.preventDefault(),e(7,f=!f)};return s.$$set=l=>{"value"in l&&e(0,n=l.value),"placeholder"in l&&e(1,a=l.placeholder),"required"in l&&e(2,i=l.required),"readOnly"in l&&e(3,u=l.readOnly),"outerClassName"in l&&e(4,m=l.outerClassName),"inputClassName"in l&&e(5,_=l.inputClassName),"showButtonClassName"in l&&e(6,v=l.showButtonClassName)},[n,a,i,u,m,_,v,f,c,r]}class H extends q{constructor(t){super(),z(this,t,M,I,S,{value:0,placeholder:1,required:2,readOnly:3,outerClassName:4,inputClassName:5,showButtonClassName:6})}}export{H as S,R as a,W as b,F as e,V as g,G as i,L as s}; |