-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservicestack-vue.umd.cjs
2 lines (2 loc) · 207 KB
/
servicestack-vue.umd.cjs
1
2
(function(ie,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@servicestack/client")):typeof define=="function"&&define.amd?define(["exports","vue","@servicestack/client"],e):(ie=typeof globalThis<"u"?globalThis:ie||self,e(ie.ServiceStackVue={},ie.Vue,ie.Servicestack))})(this,function(ie,e,i){"use strict";var tf=Object.defineProperty;var nf=(ie,e,i)=>e in ie?tf(ie,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):ie[e]=i;var oe=(ie,e,i)=>(nf(ie,typeof e!="symbol"?e+"":e,i),i);const xo={class:"flex items-center"},Vo={key:0,class:"flex-shrink-0 mr-3"},$o={key:0,class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Eo=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)],Bo={key:1,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},_o=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1)],No={key:2,class:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},So=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)],Lo={key:3,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Mo=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)],Do=e.defineComponent({__name:"Alert",props:{type:{default:"warn"},hideIcon:{type:Boolean}},setup(t){const o=t,n=e.computed(()=>o.type=="info"?"bg-blue-50 dark:bg-blue-200":o.type=="error"?"bg-red-50 dark:bg-red-200":o.type=="success"?"bg-green-50 dark:bg-green-200":"bg-yellow-50 dark:bg-yellow-200"),l=e.computed(()=>o.type=="info"?"border-blue-400":o.type=="error"?"border-red-400":o.type=="success"?"border-green-400":"border-yellow-400"),a=e.computed(()=>o.type=="info"?"text-blue-700":o.type=="error"?"text-red-700":o.type=="success"?"text-green-700":"text-yellow-700");return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(n),e.unref(l),"border-l-4 p-4"])},[e.createElementVNode("div",xo,[t.hideIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vo,[t.type=="warn"?(e.openBlock(),e.createElementBlock("svg",$o,Eo)):t.type=="error"?(e.openBlock(),e.createElementBlock("svg",Bo,_o)):t.type=="info"?(e.openBlock(),e.createElementBlock("svg",No,So)):t.type=="success"?(e.openBlock(),e.createElementBlock("svg",Lo,Mo)):e.createCommentVNode("",!0)])),e.createElementVNode("div",null,[e.createElementVNode("p",{class:e.normalizeClass([e.unref(a),"text-sm"])},[e.renderSlot(s.$slots,"default")],2)])])],2))}}),Ao={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},zo={class:"flex"},To=e.createElementVNode("div",{class:"flex-shrink-0"},[e.createElementVNode("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1),Po={class:"ml-3"},Fo={class:"text-sm font-medium text-green-800"},Io={key:0},jo={class:"ml-auto pl-3"},Oo={class:"-mx-1.5 -my-1.5"},Ro=[e.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),e.createElementVNode("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1)],Ho=e.defineComponent({__name:"AlertSuccess",props:{message:null},setup(t){const o=e.ref(!1);return(n,l)=>o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("div",zo,[To,e.createElementVNode("div",Po,[e.createElementVNode("h3",Fo,[t.message?(e.openBlock(),e.createElementBlock("span",Io,e.toDisplayString(t.message),1)):e.renderSlot(n.$slots,"default",{key:1})])]),e.createElementVNode("div",jo,[e.createElementVNode("div",Oo,[e.createElementVNode("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",onClick:l[0]||(l[0]=a=>o.value=!0)},Ro)])])])]))}}),Uo={class:"flex"},qo=e.createElementVNode("div",{class:"flex-shrink-0"},[e.createElementVNode("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1),Qo={class:"ml-3"},Go={class:"text-sm text-red-700 dark:text-red-200"},Ko=e.defineComponent({__name:"ErrorSummary",props:{status:null,except:null,class:null},setup(t){const o=t;let n=e.inject("ApiState",void 0);const l=e.computed(()=>o.status||n!=null&&n.error.value?i.errorResponseExcept.call({responseStatus:o.status??(n==null?void 0:n.error.value)},o.except??[]):null);return(a,s)=>e.unref(l)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 ${a.$props.class}`)},[e.createElementVNode("div",Uo,[qo,e.createElementVNode("div",Qo,[e.createElementVNode("p",Go,e.toDisplayString(e.unref(l)),1)])])],2)):e.createCommentVNode("",!0)}}),Wo=["id","aria-describedby"],Zo=e.defineComponent({__name:"InputDescription",props:{id:null,description:null},setup(t){return(o,n)=>t.description?(e.openBlock(),e.createElementBlock("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:`${t.id}-description`,"aria-describedby":`${t.id}-description`},[e.createElementVNode("div",null,e.toDisplayString(t.description),1)],8,Wo)):e.createCommentVNode("",!0)}});function ht(t){return i.dateFmt(t).replace(/\//g,"-")}function yn(t){return t==null?"":i.toTime(t)}function kn(t,o){t.value=null,e.nextTick(()=>t.value=o)}function Qe(t){return Object.keys(t).forEach(o=>{const n=t[o];t[o]=e.isRef(n)?e.unref(n):n}),t}function Ge(t,o,n){n?(o.value=t.entering.cls+" "+t.entering.from,setTimeout(()=>o.value=t.entering.cls+" "+t.entering.to,0)):(o.value=t.leaving.cls+" "+t.leaving.from,setTimeout(()=>o.value=t.leaving.cls+" "+t.leaving.to,0))}function gt(){if(typeof document>"u")return;let t=document.activeElement,o=t&&t.form;if(o){let n=':not([disabled]):not([tabindex="-1"])',l=o.querySelectorAll(`a:not([disabled]), button${n}, input[type=text]${n}, [tabindex]${n}`),a=Array.prototype.filter.call(l,r=>r.offsetWidth>0||r.offsetHeight>0||r===t),s=a.indexOf(t);s>-1&&(a[s+1]||a[0]).focus()}}function Ke(t){if(!t)return null;if(typeof t=="string")return t;const o=typeof t=="function"?new t:typeof t=="object"?t:null;if(!o)throw new Error(`Invalid DTO Type '${typeof t}'`);if(typeof o.getTypeName!="function")throw new Error(`${JSON.stringify(o)} is not a Request DTO`);const n=o.getTypeName();if(!n)throw new Error("DTO Required");return n}function Le(t,o,n){n||(n={});let l=n.cls||n.className||n.class;return l&&(n=i.omit(n,["cls","class","className"]),n.class=l),o==null?`<${t}`+Tt(n)+"/>":`<${t}`+Tt(n)+`>${o||""}</${t}>`}function Tt(t){return Object.keys(t).reduce((o,n)=>`${o} ${n}="${i.enc(t[n])}"`,"")}function yt(t){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},t)}function We(t){return Ot(t)}let Jo=["string","number","boolean","null","undefined"];function Oe(t){return Jo.indexOf(typeof t)>=0||t instanceof Date}function tt(t){return!Oe(t)}class bn{get length(){return typeof localStorage>"u"?0:localStorage.length}getItem(o){return typeof localStorage>"u"?null:localStorage.getItem(o)}setItem(o,n){typeof localStorage>"u"||localStorage.setItem(o,n)}removeItem(o){typeof localStorage>"u"||localStorage.removeItem(o)}clear(){typeof localStorage>"u"||localStorage.clear()}key(o){return typeof localStorage>"u"?null:localStorage.key(o)}}function kt(t){return typeof t=="string"?JSON.parse(t):null}function Pt(t){if(typeof history<"u"){const o=i.setQueryString(location.href,t);history.pushState({},"",o)}}function Ft(t,o){if(["function","Function","eval","=>",";"].some(a=>t.includes(a)))throw new Error(`Unsafe script: '${t}'`);const l=Object.assign(Object.keys(globalThis).reduce((a,s)=>(a[s]=void 0,a),{}),o);return new Function("with(this) { return ("+t+") }").call(l)}function It(t){typeof navigator<"u"&&navigator.clipboard.writeText(t)}function wn(t){const o=q.config.storage.getItem(t);return o?JSON.parse(o):null}function jt(t,o){return i.appendQueryString(`swr.${i.nameOf(t)}`,o?Object.assign({},t,o):t)}function Xo(t){if(t.request){const o=jt(t.request,t.args);q.config.storage.removeItem(o)}}async function Cn(t,o,n,l,a){const s=jt(o,l);n(new i.ApiResult({response:wn(s)}));const r=await t.api(o,l,a);if(r.succeeded&&r.response){r.response._date=new Date().valueOf();const m=JSON.stringify(r.response);q.config.storage.setItem(s,m),n(r)}return r}function xn(){return{LocalStore:bn,dateInputFormat:ht,timeInputFormat:yn,setRef:kn,unRefs:Qe,transition:Ge,focusNextElement:gt,getTypeName:Ke,htmlTag:Le,htmlAttrs:Tt,linkAttrs:yt,toAppUrl:We,isPrimitive:Oe,isComplexType:tt,pushState:Pt,scopedExpr:Ft,copyText:It,fromCache:wn,swrCacheKey:jt,swrClear:Xo,swrApi:Cn}}class q{}oe(q,"config",{redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:o=>location.href=o,assetsPathResolver:o=>o,fallbackPathResolver:o=>o,storage:new bn,tableIcon:{svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g fill='none' stroke='currentColor' stroke-width='1.5'><path d='M5 12v6s0 3 7 3s7-3 7-3v-6'/><path d='M5 6v6s0 3 7 3s7-3 7-3V6'/><path d='M12 3c7 0 7 3 7 3s0 3-7 3s-7-3-7-3s0-3 7-3Z'/></g></svg>"}}),oe(q,"autoQueryGridDefaults",{deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150}),oe(q,"user",e.ref(null)),oe(q,"metadata",e.ref(null));function Yo(t){q.config=Object.assign(q.config,t)}function vo(t){q.autoQueryGridDefaults=Object.assign(q.autoQueryGridDefaults,t)}function Ot(t){return t&&q.config.assetsPathResolver?q.config.assetsPathResolver(t):t}function el(t){return t&&q.config.fallbackPathResolver?q.config.fallbackPathResolver(t):t}function Fe(){const t=e.computed(()=>q.config),o=e.computed(()=>q.autoQueryGridDefaults);return{config:t,setConfig:Yo,autoQueryGridDefaults:o,setAutoQueryGridDefaults:vo,assetsPathResolver:Ot,fallbackPathResolver:el}}const Vn="png,jpg,jpeg,jfif,gif,svg,webp".split(","),$n={img:"png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),vid:"avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),aud:"mp3,mpa,ogg,wav,wma,mid,webm".split(","),ppt:"key,odp,pps,ppt,pptx".split(","),xls:"xls,xlsm,xlsx,ods,csv,tsv".split(","),doc:"doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),zip:"zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),exe:"exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),att:"bin,oct,dat".split(",")},En=Object.keys($n),Ae=(t,o)=>`<svg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' role='img' preserveAspectRatio='xMidYMid meet' viewBox='${t}'>${o}</svg>`,bt={img:Ae("4 4 16 16","<path fill='currentColor' d='M20 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2zm-2 0H6v6.38l2.19-2.19l5.23 5.23l1-1a1.59 1.59 0 0 1 2.11.11L18 16V6zm-5 3.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z'/>"),vid:Ae("0 0 24 24","<path fill='currentColor' d='m14 2l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8m4 18V9h-5V4H6v16h12m-2-2l-2.5-1.7V18H8v-5h5.5v1.7L16 13v5Z'/>"),aud:Ae("0 0 24 24","<path fill='currentColor' d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm10-9h-4v3.88a2.247 2.247 0 0 0-3.5 1.87c0 1.24 1.01 2.25 2.25 2.25S13 17.99 13 16.75V13h3v-2z'/>"),ppt:Ae("0 0 48 48","<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'><path d='M4 8h40'/><path d='M8 8h32v26H8V8Z' clip-rule='evenodd'/><path d='m22 16l5 5l-5 5m-6 16l8-8l8 8'/></g>"),xls:Ae("0 0 256 256","<path fill='currentColor' d='M200 26H72a14 14 0 0 0-14 14v26H40a14 14 0 0 0-14 14v96a14 14 0 0 0 14 14h18v26a14 14 0 0 0 14 14h128a14 14 0 0 0 14-14V40a14 14 0 0 0-14-14Zm-42 76h44v52h-44Zm44-62v50h-44V80a14 14 0 0 0-14-14h-2V38h58a2 2 0 0 1 2 2ZM70 40a2 2 0 0 1 2-2h58v28H70ZM38 176V80a2 2 0 0 1 2-2h104a2 2 0 0 1 2 2v96a2 2 0 0 1-2 2H40a2 2 0 0 1-2-2Zm32 40v-26h60v28H72a2 2 0 0 1-2-2Zm130 2h-58v-28h2a14 14 0 0 0 14-14v-10h44v50a2 2 0 0 1-2 2ZM69.2 148.4L84.5 128l-15.3-20.4a6 6 0 1 1 9.6-7.2L92 118l13.2-17.6a6 6 0 0 1 9.6 7.2L99.5 128l15.3 20.4a6 6 0 0 1-9.6 7.2L92 138l-13.2 17.6a6 6 0 1 1-9.6-7.2Z'/>"),doc:Ae("0 0 32 32","<path fill='currentColor' d='M26 30H11a2.002 2.002 0 0 1-2-2v-6h2v6h15V6h-9V4h9a2.002 2.002 0 0 1 2 2v22a2.002 2.002 0 0 1-2 2Z'/><path fill='currentColor' d='M17 10h7v2h-7zm-1 5h8v2h-8zm-1 5h9v2h-9zm-6-1a5.005 5.005 0 0 1-5-5V3h2v11a3 3 0 0 0 6 0V5a1 1 0 0 0-2 0v10H8V5a3 3 0 0 1 6 0v9a5.005 5.005 0 0 1-5 5z'/>"),zip:Ae("0 0 16 16","<g fill='currentColor'><path d='M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598l.93.62l.93-.62l-.4-1.598a1 1 0 0 1-.03-.243V7.5z'/><path d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z'/></g>"),exe:Ae("0 0 16 16","<path fill='currentColor' fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM2.575 15.202H.785v-1.073H2.47v-.606H.785v-1.025h1.79v-.648H0v3.999h2.575v-.647ZM6.31 11.85h-.893l-.823 1.439h-.036l-.832-1.439h-.931l1.227 1.983l-1.239 2.016h.861l.853-1.415h.035l.85 1.415h.908l-1.254-1.992L6.31 11.85Zm1.025 3.352h1.79v.647H6.548V11.85h2.576v.648h-1.79v1.025h1.684v.606H7.334v1.073Z'/>"),att:Ae("0 0 24 24","<path fill='currentColor' d='M14 0a5 5 0 0 1 5 5v12a7 7 0 1 1-14 0V9h2v8a5 5 0 0 0 10 0V5a3 3 0 1 0-6 0v12a1 1 0 1 0 2 0V6h2v11a3 3 0 1 1-6 0V5a5 5 0 0 1 5-5Z'/>")},tl=/[\r\n%#()<>?[\\\]^`{|}]/g,Bn=1024,nl=["Bytes","KB","MB","GB","TB"],ol=(()=>{const t="application/",o=t+"vnd.openxmlformats-officedocument.",n="image/",l="text/",a="audio/",s="video/",r={jpg:n+"jpeg",tif:n+"tiff",svg:n+"svg+xml",ico:n+"x-icon",ts:l+"typescript",py:l+"x-python",sh:l+"x-sh",mp3:a+"mpeg3",mpg:s+"mpeg",ogv:s+"ogg",xlsx:o+"spreadsheetml.sheet",xltx:o+"spreadsheetml.template",docx:o+"wordprocessingml.document",dotx:o+"wordprocessingml.template",pptx:o+"presentationml.presentation",potx:o+"presentationml.template",ppsx:o+"presentationml.slideshow",mdb:t+"vnd.ms-access"};function m(d,u){d.split(",").forEach(p=>r[p]=u)}function c(d,u){d.split(",").forEach(p=>r[p]=u(p))}return c("jpeg,gif,png,tiff,bmp,webp",d=>n+d),c("jsx,csv,css",d=>l+d),c("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",d=>a+d),c("3gpp,avi,dv,divx,ogg,mp4,webm",d=>s+d),c("rtf,pdf",d=>t+d),m("htm,html,shtm",l+"html"),m("js,mjs,cjs",l+"javascript"),m("yml,yaml",t+"yaml"),m("bat,cmd",t+"bat"),m("xml,csproj,fsproj,vbproj",l+"xml"),m("txt,ps1",l+"plain"),m("qt,mov",s+"quicktime"),m("doc,dot",t+"msword"),m("xls,xlt,xla",t+"excel"),m("ppt,oit,pps,ppa",t+"vnd.ms-powerpoint"),m("cer,crt,der",t+"x-x509-ca-cert"),m("gz,tgz,zip,rar,lzh,z",t+"x-compressed"),m("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp",t+"octet-stream"),r})();let Rt=[];function _n(t){return t=t.replace(/"/g,"'"),t=t.replace(/>\s+</g,"><"),t=t.replace(/\s{2,}/g," "),t.replace(tl,encodeURIComponent)}function Ht(t){return"data:image/svg+xml;utf8,"+_n(t)}function Nn(t){let o=URL.createObjectURL(t);return Rt.push(o),o}function Sn(){Rt.forEach(t=>{try{URL.revokeObjectURL(t)}catch(o){console.error("URL.revokeObjectURL",o)}}),Rt=[]}function Ut(t){if(!t)return null;let o=i.leftPart(t,"?");return i.lastRightPart(o,"/")}function nt(t){let o=Ut(t);return o==null||o.indexOf(".")===-1?null:i.lastRightPart(o,".").toLowerCase()}function qt(t){let o=nt(t.name);return o&&Vn.indexOf(o)>=0?Nn(t):Re(t.name)}function Qt(t){if(!t)return!1;if(t.startsWith("blob:")||t.startsWith("data:"))return!0;let o=nt(t);return o&&Vn.indexOf(o)>=0||!1}function df(t){return t}function Re(t){if(!t)return null;let o=nt(t);return o==null||Qt(t)?t:ot(o)||Ht(bt.doc)}function ot(t){let o=Ln(t);return o&&Ht(o)||null}function Ln(t){if(bt[t])return bt[t];for(let o=0;o<En.length;o++){let n=En[o];if($n[n].indexOf(t)>=0)return bt[n]}return null}function Gt(t,o=2){if(t===0)return"0 Bytes";const n=o<0?0:o,l=Math.floor(Math.log(t)/Math.log(Bn));return parseFloat((t/Math.pow(Bn,l)).toFixed(n))+" "+nl[l]}function ll(t){return t.files&&Array.from(t.files).map(o=>({fileName:o.name,contentLength:o.size,filePath:qt(o)}))}function wt(t,o){t.onerror=null,t.src=Kt(t.src,o)||""}function Kt(t,o){return ot(i.lastRightPart(t,".").toLowerCase())||(o?ot(o)||o:null)||ot("doc")}function Wt(t){if(!t)throw new Error("fileNameOrExt required");const o=i.lastRightPart(t,".").toLowerCase();return ol[o]||"application/"+o}function al(){return{extSvg:Ln,extSrc:ot,getExt:nt,encodeSvg:_n,canPreview:Qt,getFileName:Ut,getMimeType:Wt,formatBytes:Gt,filePathUri:Re,svgToDataUri:Ht,fileImageUri:qt,objectUrl:Nn,flush:Sn,inputFiles:ll,iconOnError:wt,iconFallbackSrc:Kt}}class sl{constructor(o){oe(this,"view");oe(this,"includeTypes");Object.assign(this,o)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}const Ze="/metadata/app.json",rl={Boolean:"checkbox",DateTime:"date",DateOnly:"date",DateTimeOffset:"date",TimeSpan:"time",TimeOnly:"time",Byte:"number",Short:"number",Int64:"number",Int32:"number",UInt16:"number",UInt32:"number",UInt64:"number",Single:"number",Double:"number",Decimal:"number",String:"text",Guid:"text",Uri:"text"},il={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},Zt={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"};[...Object.keys(Zt),...Object.values(Zt)];const cl={String:"string",Boolean:"bool",...Zt};function Ct(t){return cl[t]||t}function Mn(t,o){return t?(o||(o=[]),t==="Nullable`1"?Ct(o[0])+"?":t.endsWith("[]")?`List<${Ct(t.substring(0,t.length-2))}>`:o.length===0?Ct(t):i.leftPart(Ct(t),"`")+"<"+o.join(",")+">"):""}function dl(t){return t&&Mn(t.name,t.genericArgs)}class Je{constructor(){oe(this,"Query");oe(this,"QueryInto");oe(this,"Create");oe(this,"Update");oe(this,"Patch");oe(this,"Delete")}get AnyQuery(){return this.Query||this.QueryInto}get AnyUpdate(){return this.Patch||this.Update}toArray(){return[this.Query,this.QueryInto,this.Create,this.Update,this.Patch,this.Delete].filter(n=>!!n).map(n=>n)}get empty(){return!this.Query&&!this.QueryInto&&!this.Create&&!this.Update&&!this.Patch&&!this.Delete}add(o){ue.isQueryInto(o)&&!this.QueryInto?this.QueryInto=o:ue.isQuery(o)&&!this.Query?this.Query=o:ue.isCreate(o)&&!this.Create?this.Create=o:ue.isUpdate(o)&&!this.Update?this.Update=o:ue.isPatch(o)&&!this.Patch?this.Patch=o:ue.isDelete(o)&&!this.Delete&&(this.Delete=o)}static from(o){const n=new Je;return o.forEach(l=>{n.add(l)}),n}static forType(o,n){var a;let l=new Je;return o&&(n??(n=(a=q.metadata.value)==null?void 0:a.api),n==null||n.operations.forEach(s=>{var r;((r=s.dataModel)==null?void 0:r.name)==o&&l.add(s)})),l}}const ue={Create:"ICreateDb`1",Update:"IUpdateDb`1",Patch:"IPatchDb`1",Delete:"IDeleteDb`1",AnyRead:["QueryDb`1","QueryDb`2"],AnyWrite:["ICreateDb`1","IUpdateDb`1","IPatchDb`1","IDeleteDb`1"],isAnyQuery:t=>i.map(t.request.inherits,o=>ue.AnyRead.indexOf(o.name)>=0),isQuery:t=>i.map(t.request.inherits,o=>o.name==="QueryDb`1"),isQueryInto:t=>i.map(t.request.inherits,o=>o.name==="QueryDb`2"),isCrud:t=>{var o;return(o=t.request.implements)==null?void 0:o.some(n=>ue.AnyWrite.indexOf(n.name)>=0)},isCreate:t=>Et(t,ue.Create),isUpdate:t=>Et(t,ue.Update),isPatch:t=>Et(t,ue.Patch),isDelete:t=>Et(t,ue.Delete),model:t=>{var o,n,l;return t?i.map(t.inherits,a=>ue.AnyRead.indexOf(a.name)>=0)?(o=t.inherits)==null?void 0:o.genericArgs[0]:(l=(n=t.implements)==null?void 0:n.find(a=>ue.AnyWrite.indexOf(a.name)>=0))==null?void 0:l.genericArgs[0]:null}};function ml(t){var o;return((o=t.input)==null?void 0:o.type)||xt(Jt(t))}function Dn(t){return t.endsWith("?")?i.chop(t,1):t}function xt(t){return rl[Dn(t)]}function fl(t){return t&&il[t]||"String"}function Jt(t){return t.type==="Nullable`1"?t.genericArgs[0]:t.type}function Xt(t){return t&&xt(t)=="number"||!1}function An(t){return t&&t.toLowerCase()=="string"||!1}function ul(t){return t=="List`1"||t.startsWith("List<")||t.endsWith("[]")}function zn(t){if(!(t!=null&&t.type))return!1;const o=Jt(t);return t.isValueType&&o.indexOf("`")==-1||t.isEnum?!1:xt(t.type)==null}function Tn(t){var n,l,a;if(!(t!=null&&t.type))return!1;const o=Jt(t);return t.isValueType&&o.indexOf("`")==-1||t.isEnum||((n=t.input)==null?void 0:n.type)=="file"||((l=t.input)==null?void 0:l.type)=="tag"||((a=t.input)==null?void 0:a.type)=="combobox"?!0:xt(t.type)!=null}function lt(t,o){let n=typeof t=="string"?$t(t):t;n||(console.warn(`Metadata not found for: ${t}`),n={request:{name:t}});let l=function(){return function(s){Object.assign(this,s)}}(),a=function(){function s(r){Object.assign(this,r)}return s.prototype.createResponse=function(){return n.returnsVoid?void 0:new l},s.prototype.getTypeName=function(){return n.request.name},s.prototype.getMethod=function(){return n.method||"POST"},s}();return new a(o)}function pl(t,o,n={}){let l=function(){return function(s){Object.assign(this,s)}}(),a=function(){function s(r){Object.assign(this,r)}return s.prototype.createResponse=function(){return typeof n.createResponse=="function"?n.createResponse():new l},s.prototype.getTypeName=function(){return t},s.prototype.getMethod=function(){return n.method||"POST"},s}();return new a(o)}function Vt(t,o){return t?(Object.keys(t).forEach(n=>{let l=t[n];typeof l=="string"&&l.startsWith("/Date")&&(t[n]=ht(i.toDate(l)))}),t):{}}function hl(t,o){let n={};return Array.from(t.elements).forEach(l=>{var u;let a=l;if(!a.id||a.value==null||a.value==="")return;const s=a.id.toLowerCase(),r=o&&o.find(p=>p.name.toLowerCase()==s);let m=r==null?void 0:r.type,c=(u=r==null?void 0:r.genericArgs)==null?void 0:u[0],d=a.type==="checkbox"?a.checked:a.value;Xt(m)?d=Number(d):m==="List`1"&&typeof d=="string"&&(d=d.split(",").map(p=>Xt(c)?Number(p):p)),n[a.id]=d}),n}function Yt(t){var o;return((o=t==null?void 0:t.api)==null?void 0:o.operations)&&t.api.operations.length>0}function gl(t){if(t!=null&&t.assert&&!q.metadata.value)throw new Error("useMetadata() not configured, see: https://docs.servicestack.net/vue/use-metadata");return q.metadata.value}function at(t){return t&&Yt(t)?(t.date=i.toDateTime(new Date),q.metadata.value=t,typeof localStorage<"u"&&localStorage.setItem(Ze,JSON.stringify(t)),!0):!1}function yl(){q.metadata.value=null,typeof localStorage<"u"&&localStorage.removeItem(Ze)}function Pn(){if(q.metadata.value!=null)return!0;let t=globalThis.Server;if(Yt(t))at(t);else{const o=typeof localStorage<"u"?localStorage.getItem(Ze):null;if(o)try{at(JSON.parse(o))}catch{console.error(`Could not JSON.parse ${Ze} from localStorage`)}}return q.metadata.value!=null}async function Fn(t,o){let n=o?await o():await fetch(t);if(n.ok){let l=await n.text();at(JSON.parse(l))}else console.error(`Could not download ${o?"AppMetadata":t}: ${n.statusText}`);Yt(q.metadata.value)||console.warn("AppMetadata is not available")}async function kl(t){var s;const{olderThan:o,resolvePath:n,resolve:l}=t||{};let a=Pn()&&o!==0;if(a&&o){let r=i.toDate((s=q.metadata.value)==null?void 0:s.date);(!r||new Date().getTime()-r.getTime()>o)&&(a=!1)}if(!a){if((n||l)&&await Fn(n||Ze,l),q.metadata.value!=null)return;const r=e.inject("client");if(r!=null){const m=await r.api(new sl);m.succeeded&&at(m.response)}if(q.metadata.value!=null)return;await Fn(Ze)}return q.metadata.value}function ze(t,o){var r;let n=(r=q.metadata.value)==null?void 0:r.api;if(!n||!t)return null;let l=n.types.find(m=>m.name.toLowerCase()===t.toLowerCase()&&(!o||m.namespace==o));if(l)return l;let a=$t(t);if(a)return a.request;let s=n.operations.find(m=>m.response&&m.response.name.toLowerCase()===t.toLowerCase()&&(!o||m.response.namespace==o));return s?s.response:null}function $t(t){var l;let o=(l=q.metadata.value)==null?void 0:l.api;return o?o.operations.find(a=>a.request.name.toLowerCase()===t.toLowerCase()):null}function bl({dataModel:t}){var l;const o=(l=q.metadata.value)==null?void 0:l.api;if(!o)return[];let n=o.operations;if(t){const a=typeof t=="string"?ze(t):t;n=n.filter(s=>In(s.dataModel,a))}return n}function vt(t){return t?ze(t.name,t.namespace):null}function In(t,o){return t&&o&&t.name===o.name&&(!t.namespace||!o.namespace||t.namespace===o.namespace)}function wl(t,o){let n=ze(t);return n&&n.properties&&n.properties.find(a=>a.name.toLowerCase()===o.toLowerCase())}function jn(t){return On(ze(t))}function On(t){if(t&&t.isEnum&&t.enumNames!=null){let o={};for(let n=0;n<t.enumNames.length;n++){const l=(t.enumDescriptions?t.enumDescriptions[n]:null)||t.enumNames[n],a=(t.enumValues!=null?t.enumValues[n]:null)||t.enumNames[n];o[a]=l}return o}return null}function Rn(t){if(!t)return null;let o={},n=t.input&&t.input.allowableEntries;if(n){for(let a=0;a<n.length;a++){let s=n[a];o[s.key]=s.value}return o}let l=t.allowableValues||(t.input?t.input.allowableValues:null);if(l){for(let a=0;a<l.length;a++){let s=l[a];o[s]=s}return o}if(t.isEnum){const a=t.genericArgs&&t.genericArgs.length==1?t.genericArgs[0]:t.type,s=ze(a);if(s)return On(s)}return null}function en(t){if(!t)return;const o=[];return Object.keys(t).forEach(n=>o.push({key:n,value:t[n]})),o}function Cl(t,o){const l=((a,s)=>Object.assign({id:a,name:a,type:s},o))(t.name,(o==null?void 0:o.type)||ml(t)||"text");return t.isEnum&&(l.type="select",l.allowableEntries=en(Rn(t))),l}function xl(t){let o=[];if(t){const n=$e(t),l=$t(t.name),a=vt(l==null?void 0:l.dataModel);n.forEach(s=>{var m,c,d;if(!Tn(s))return;const r=Cl(s,s.input);if(r.id=i.toCamelCase(r.id),r.type=="file"&&s.uploadTo&&!r.accept){const u=(c=(m=q.metadata.value)==null?void 0:m.plugins.filesUpload)==null?void 0:c.locations.find(p=>p.name==s.uploadTo);u&&!r.accept&&u.allowExtensions&&(r.accept=u.allowExtensions.map(p=>p.startsWith(".")?p:`.${p}`).join(","))}if(a){const u=(d=a.properties)==null?void 0:d.find(p=>p.name==s.name);s.ref||(s.ref=u==null?void 0:u.ref)}if(r.options)try{const u={$typeFields:n.map(f=>f.name),$dataModelFields:a?$e(a).map(f=>f.name):[]},p=Ft(r.options,u);Object.keys(p).forEach(f=>{r[f]=p[f]})}catch{console.error(`failed to evaluate '${r.options}'`)}o.push(r)})}return o}function $e(t){if(!t)return[];let o=[],n={};function l(a){a.forEach(s=>{n[s.name]||(n[s.name]=1,o.push(s))})}for(;t;)t.properties&&l(t.properties),t=t.inherits?vt(t.inherits):null;return o.map(a=>a.type.endsWith("[]")?{...a,type:"List`1",genericArgs:[a.type.substring(0,a.type.length-2)]}:a)}function Et(t,o){var n;return((n=t.request.implements)==null?void 0:n.some(l=>l.name===o))||!1}function st(t){return t?Hn(t,$e(t)):null}function Hn(t,o){let n=o.find(s=>s.name.toLowerCase()==="id");if(n&&n.isPrimaryKey)return n;let a=o.find(s=>s.isPrimaryKey)||n;if(!a){let s=ue.model(t);if(s)return i.map(ze(s),r=>st(r));console.error(`Primary Key not found in ${t.name}`)}return a||null}function Vl(t,o){return i.map(st(t),n=>i.mapGet(o,n.name))}function Un(t,o,n){return t&&t.valueType==="none"?"":n.key==="%In"||n.key==="%Between"?`(${n.value})`:$l(o,n.value)}function $l(t,o){return t?(t=Dn(t),Xt(t)||t==="Boolean"?o:ul(t)?`[${o}]`:`'${o}'`):o}function Ee(){const t=e.computed(()=>{var l;return((l=q.metadata.value)==null?void 0:l.app)||null}),o=e.computed(()=>{var l;return((l=q.metadata.value)==null?void 0:l.api)||null}),n=e.computed(()=>{var l;return((l=q.metadata.value)==null?void 0:l.plugins.autoQuery.viewerConventions)||[]});return Pn(),{loadMetadata:kl,getMetadata:gl,setMetadata:at,clearMetadata:yl,metadataApp:t,metadataApi:o,filterDefinitions:n,typeOf:ze,typeOfRef:vt,typeEquals:In,apiOf:$t,findApis:bl,typeName:dl,typeName2:Mn,property:wl,enumOptions:jn,propertyOptions:Rn,createFormLayout:xl,typeProperties:$e,supportsProp:Tn,Crud:ue,Apis:Je,getPrimaryKey:st,getPrimaryKeyByProps:Hn,getId:Vl,createDto:lt,makeDto:pl,toFormValues:Vt,formValues:hl,isComplexProp:zn,asKvps:en}}const Ne=class{static async getOrFetchValue(o,n,l,a,s,r,m){const c=Ne.getValue(l,m,s);return c??(await Ne.fetchLookupIds(o,n,l,a,s,r,[m]),Ne.getValue(l,m,s))}static getValue(o,n,l){const a=Ne.Lookup[o];if(a){const s=a[n];if(s)return l=l.toLowerCase(),s[l]}}static setValue(o,n,l,a){const s=Ne.Lookup[o]??(Ne.Lookup[o]={}),r=s[n]??(s[n]={});l=l.toLowerCase(),r[l]=a}static setRefValue(o,n){const l=i.mapGet(n,o.refId);if(l==null||o.refLabel==null)return null;const a=i.mapGet(n,o.refLabel);return Ne.setValue(o.model,l,o.refLabel,a),a}static async fetchLookupIds(o,n,l,a,s,r,m){const c=n.operations.find(d=>{var u;return ue.isAnyQuery(d)&&((u=d.dataModel)==null?void 0:u.name)==l});if(c){const d=Ne.Lookup[l]??(Ne.Lookup[l]={}),u=[];Object.keys(d).forEach(V=>{const S=d[V];i.mapGet(S,s)&&u.push(V)});const p=m.filter(V=>!u.includes(V));if(p.length==0)return;const f=r?null:`${a},${s}`,g={[a+"In"]:p.join(",")};f&&(g.fields=f);const k=lt(c,g),w=await o.api(k,{jsconfig:"edv,eccn"});if(w.succeeded)(i.mapGet(w.response,"results")||[]).forEach(S=>{if(!i.mapGet(S,a)){console.error(`result[${a}] == null`,S);return}const T=`${i.mapGet(S,a)}`,F=i.mapGet(S,s);s=s.toLowerCase();const I=d[T]??(d[T]={});I[s]=`${F}`});else{console.error(`Failed to call ${c.request.name}`);return}}}};let He=Ne;oe(He,"Lookup",{});const qn=e.defineComponent({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(t,{attrs:o}){return()=>{let n=t.image;if(t.type){const{typeOf:s}=Ee(),r=s(t.type);r||console.warn(`Type ${t.type} does not exist`),r!=null&&r.icon?n=r==null?void 0:r.icon:console.warn(`Type ${t.type} does not have a [Svg] icon`)}let l=t.svg||(n==null?void 0:n.svg)||"";if(l.startsWith("<svg ")){let r=i.leftPart(l,">").indexOf("class="),m=`${(n==null?void 0:n.cls)||""} ${o.class||""}`;if(r==-1)l=`<svg class="${m}" ${l.substring(4)}`;else{const c=r+6+1;l=`${l.substring(0,c)+m} ${l.substring(c)}`}return e.h("span",{innerHTML:l})}else return e.h("img",{class:[n==null?void 0:n.cls,o.class],src:Ot(t.src||(n==null?void 0:n.uri)),onError:s=>wt(s.target)})}}}),El={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},Bl={class:"flex"},_l=[e.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1)],Nl=e.defineComponent({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",El,[e.createElementVNode("div",Bl,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",t.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_l,2)),e.createElementVNode("span",null,[e.renderSlot(o.$slots,"default")])])]))}}),Sl=["href","onClick"],Ll=["type"],Ml=e.defineComponent({__name:"OutlineButton",props:{type:{default:"submit"},href:null},setup(t){const o="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black";return(n,l)=>{const a=e.resolveComponent("router-link");return t.href?(e.openBlock(),e.createBlock(a,{key:0,to:t.href},{default:e.withCtx(({navigate:s})=>[e.createElementVNode("button",{class:e.normalizeClass(o),href:t.href,onClick:s},[e.renderSlot(n.$slots,"default")],8,Sl)]),_:3},8,["to"])):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:t.type,class:o},n.$attrs),[e.renderSlot(n.$slots,"default")],16,Ll))}}}),Dl=["href","onClick"],Al=["type"],zl=e.defineComponent({__name:"PrimaryButton",props:{type:{default:"submit"},href:null,color:{default:"indigo"}},setup(t){const o=t,n={blue:"text-white bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"text-white bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",red:"focus:ring-red-500 text-white bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-300 text-white bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-300 text-white bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 focus:ring-sky-500 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-300 text-white bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 focus:ring-cyan-500 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-2 focus:ring-offset-2 text-white bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},l=e.computed(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black "+(n[o.color]||n.indigo));return(a,s)=>{const r=e.resolveComponent("router-link");return t.href?(e.openBlock(),e.createBlock(r,{key:0,to:t.href},{default:e.withCtx(({navigate:m})=>[e.createElementVNode("button",{class:e.normalizeClass(e.unref(l)),href:t.href,onClick:m},[e.renderSlot(a.$slots,"default")],10,Dl)]),_:3},8,["to"])):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:t.type,class:e.unref(l)},a.$attrs),[e.renderSlot(a.$slots,"default")],16,Al))}}}),Tl=["type","href","onClick"],Pl=["type"],Fl=e.defineComponent({__name:"SecondaryButton",props:{type:null,href:null},setup(t){const o="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black";return(n,l)=>{const a=e.resolveComponent("router-link");return t.href?(e.openBlock(),e.createBlock(a,{key:0,to:t.href},{default:e.withCtx(({navigate:s})=>[e.createElementVNode("button",{type:t.type??"button",class:e.normalizeClass(o),href:t.href,onClick:s},[e.renderSlot(n.$slots,"default")],8,Tl)]),_:3},8,["to"])):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:t.type??"button",class:o},n.$attrs),[e.renderSlot(n.$slots,"default")],16,Pl))}}});function ke(t,o){return Array.isArray(t)?t.indexOf(o)>=0:t==o||t.includes(o)}const Bt={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},Te={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},Ue={panelClass:"shadow sm:rounded-md",formClass:"space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6",headingClass:"text-lg font-medium leading-6 text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400"},rt={panelClass:"pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",formClass:"flex h-full flex-col divide-y divide-gray-200 dark:divide-gray-700 shadow-xl bg-white dark:bg-black",titlebarClass:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6",headingClass:"text-lg font-medium text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400",closeButtonClass:"rounded-md bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},Qn={sizeClass:"sm:max-w-prose lg:max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl sm:w-full"},Ce={panelClass(t="slideOver"){return t=="card"?Ue.panelClass:rt.panelClass},formClass(t="slideOver"){return t=="card"?Ue.formClass:rt.formClass},headingClass(t="slideOver"){return t=="card"?Ue.headingClass:rt.headingClass},subHeadingClass(t="slideOver"){return t=="card"?Ue.subHeadingClass:rt.subHeadingClass},buttonsClass:"mt-4 px-4 py-3 bg-gray-50 dark:bg-gray-900 sm:px-6 flex flex-wrap justify-between",legendClass:"text-base font-medium text-gray-900 dark:text-gray-100 text-center mb-4"},W={getGridClass(t="stripedRows"){return W.gridClass},getGrid2Class(t="stripedRows"){return ke(t,"fullWidth")?"overflow-x-auto":W.grid2Class},getGrid3Class(t="stripedRows"){return ke(t,"fullWidth")?"inline-block min-w-full py-2 align-middle":W.grid3Class},getGrid4Class(t="stripedRows"){return ke(t,"whiteBackground")?"":ke(t,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5":W.grid4Class},getTableClass(t="stripedRows"){return ke(t,"fullWidth")||ke(t,"verticalLines")?"min-w-full divide-y divide-gray-300":W.tableClass},getTheadClass(t="stripedRows"){return ke(t,"whiteBackground")?"":W.theadClass},getTheadRowClass(t="stripedRows"){return W.theadRowClass+(ke(t,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(t="stripedRows"){return W.theadCellClass+(ke(t,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(t="stripedRows"){return(ke(t,"whiteBackground")||ke(t,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":W.tableClass)+(ke(t,"verticalLines")?" bg-white":"")},getTableRowClass(t="stripedRows",o,n,l){return(l?"cursor-pointer ":"")+(n?"bg-indigo-100 dark:bg-blue-800":(l?"hover:bg-yellow-50 dark:hover:bg-blue-900 ":"")+(ke(t,"stripedRows")?o%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800":"bg-white dark:bg-black"))+(ke(t,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},gridClass:"flex flex-col",grid2Class:"",grid3Class:"inline-block min-w-full py-2 align-middle",grid4Class:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg",tableClass:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",theadClass:"bg-gray-50 dark:bg-gray-900",tableCellClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",theadRowClass:"select-none",theadCellClass:"px-6 py-4 text-left text-sm font-medium tracking-wider whitespace-nowrap",toolbarButtonClass:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:border-gray-700 shadow-sm text-sm font-medium rounded text-gray-700 dark:text-gray-300 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},Il=Object.freeze(Object.defineProperty({__proto__:null,a:Bt,card:Ue,form:Ce,grid:W,input:Te,modal:Qn,slideOver:rt},Symbol.toStringTag,{value:"Module"})),jl=e.defineComponent({__name:"TextLink",props:{color:{default:"blue"}},setup(t){const o=t,n=e.useAttrs(),l=e.computed(()=>(Bt[o.color]||Bt.blue)+(n.href?"":" cursor-pointer"));return(a,s)=>(e.openBlock(),e.createElementBlock("a",{class:e.normalizeClass(e.unref(l))},[e.renderSlot(a.$slots,"default")],2))}}),Ol={class:"flex","aria-label":"Breadcrumb"},Rl={role:"list",class:"flex items-center space-x-4"},Hl=["href","title"],Ul=e.createElementVNode("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1),ql={class:"sr-only"},Ql=e.defineComponent({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("nav",Ol,[e.createElementVNode("ol",Rl,[e.createElementVNode("li",null,[e.createElementVNode("div",null,[e.createElementVNode("a",{href:t.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:t.homeLabel},[Ul,e.createElementVNode("span",ql,e.toDisplayString(t.homeLabel),1)],8,Hl)])]),e.renderSlot(o.$slots,"default")])]))}}),Gl={class:"flex items-center"},Kl=e.createElementVNode("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1),Wl=["href","title"],Zl=["title"],Jl=e.defineComponent({__name:"Breadcrumb",props:{href:null,title:null},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("li",null,[e.createElementVNode("div",Gl,[Kl,t.href?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:t.title},[e.renderSlot(o.$slots,"default")],8,Wl)):(e.openBlock(),e.createElementBlock("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:t.title},[e.renderSlot(o.$slots,"default")],8,Zl))])]))}}),Xl={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},Yl={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},vl=e.defineComponent({__name:"NavList",props:{title:null},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",null,[t.title?(e.openBlock(),e.createElementBlock("h2",Xl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("ul",Yl,[e.renderSlot(o.$slots,"default")])]))}}),ea={class:"relative flex items-start space-x-4 py-6"},ta={class:"flex-shrink-0"},na={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},oa={class:"min-w-0 flex-1"},la={class:"text-base font-medium text-gray-900 dark:text-gray-100"},aa={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},sa=["href"],ra=e.createElementVNode("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),ia={class:"text-base text-gray-500"},ca=e.createElementVNode("div",{class:"flex-shrink-0 self-center"},[e.createElementVNode("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1),da=e.defineComponent({__name:"NavListItem",props:{title:null,href:null,icon:null,iconSvg:null,iconSrc:null,iconAlt:null},setup(t){return(o,n)=>{const l=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("li",ea,[e.createElementVNode("div",ta,[e.createElementVNode("span",na,[e.createVNode(l,{class:"w-6 h-6 text-indigo-700 dark:text-indigo-300",image:t.icon,src:t.iconSrc,svg:t.iconSvg,alt:t.iconAlt},null,8,["image","src","svg","alt"])])]),e.createElementVNode("div",oa,[e.createElementVNode("h3",la,[e.createElementVNode("span",aa,[e.createElementVNode("a",{href:t.href,class:"focus:outline-none"},[ra,e.createTextVNode(" "+e.toDisplayString(t.title),1)],8,sa)])]),e.createElementVNode("p",ia,[e.renderSlot(o.$slots,"default")])]),ca])}}});function ma(t){q.user.value=t}function fa(){q.user.value=null}function Gn(t){var o;return(((o=q.user.value)==null?void 0:o.roles)||[]).indexOf(t)>=0}function ua(t){var o;return(((o=q.user.value)==null?void 0:o.permissions)||[]).indexOf(t)>=0}function tn(){return Gn("Admin")}function _t(t){if(!t)return!1;if(!t.requiresAuth)return!0;const o=q.user.value;if(!o)return!1;if(tn())return!0;let[n,l]=[o.roles||[],o.permissions||[]],[a,s,r,m]=[t.requiredRoles||[],t.requiredPermissions||[],t.requiresAnyRole||[],t.requiresAnyPermission||[]];return!(!a.every(c=>n.indexOf(c)>=0)||r.length>0&&!r.some(c=>n.indexOf(c)>=0)||!s.every(c=>l.indexOf(c)>=0)||m.length>0&&!m.every(c=>l.indexOf(c)>=0))}function pa(t){if(!t||!t.requiresAuth)return null;const o=q.user.value;if(!o)return`<b>${t.request.name}</b> requires Authentication`;if(tn())return null;let[n,l]=[o.roles||[],o.permissions||[]],[a,s,r,m]=[t.requiredRoles||[],t.requiredPermissions||[],t.requiresAnyRole||[],t.requiresAnyPermission||[]],c=a.filter(u=>n.indexOf(u)<0);if(c.length>0)return`Requires ${c.map(u=>"<b>"+u+"</b>").join(", ")} Role`+(c.length>1?"s":"");let d=s.filter(u=>l.indexOf(u)<0);return d.length>0?`Requires ${d.map(u=>"<b>"+u+"</b>").join(", ")} Permission`+(d.length>1?"s":""):r.length>0&&!r.some(u=>n.indexOf(u)>=0)?`Requires any ${r.filter(u=>n.indexOf(u)<0).map(u=>"<b>"+u+"</b>").join(", ")} Role`+(c.length>1?"s":""):m.length>0&&!m.every(u=>l.indexOf(u)>=0)?`Requires any ${m.filter(u=>l.indexOf(u)<0).map(u=>"<b>"+u+"</b>").join(", ")} Permission`+(d.length>1?"s":""):null}function Nt(){const t=e.computed(()=>q.user.value||null),o=e.computed(()=>q.user.value!=null);return{signIn:ma,signOut:fa,user:t,isAuthenticated:o,hasRole:Gn,hasPermission:ua,isAdmin:tn,canAccess:_t,invalidAccessMessage:pa}}const ha={key:0},ga={class:"md:p-4"},Kn=e.defineComponent({__name:"EnsureAccess",props:{invalidAccess:null,alertClass:null},emits:["done"],setup(t){const{isAuthenticated:o}=Nt(),{config:n}=Fe(),l=()=>{let s=location.href.substring(location.origin.length)||"/";const r=i.appendQueryString(n.value.redirectSignIn,{redirect:s});n.value.navigate(r)},a=()=>{let s=location.href.substring(location.origin.length)||"/";const r=i.appendQueryString(n.value.redirectSignOut,{ReturnUrl:s});n.value.navigate(r)};return(s,r)=>{const m=e.resolveComponent("Alert"),c=e.resolveComponent("SecondaryButton");return t.invalidAccess?(e.openBlock(),e.createElementBlock("div",ha,[e.createVNode(m,{class:e.normalizeClass(t.alertClass),innerHTML:t.invalidAccess},null,8,["class","innerHTML"]),e.createElementVNode("div",ga,[e.unref(o)?(e.openBlock(),e.createBlock(c,{key:1,onClick:a},{default:e.withCtx(()=>[e.createTextVNode("Sign Out")]),_:1})):(e.openBlock(),e.createBlock(c,{key:0,onClick:l},{default:e.withCtx(()=>[e.createTextVNode("Sign In")]),_:1}))])])):e.createCommentVNode("",!0)}}}),ya={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},ka={class:"p-4"},ba=e.createElementVNode("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1),wa={class:"flex w-full justify-center"},Ca=[e.createElementVNode("svg",{class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[e.createElementVNode("g",{fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.082 5.629L9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),e.createElementVNode("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zm-8.46-.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1),e.createElementVNode("span",null,"ASC",-1)],xa=[e.createStaticVNode('<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g fill="currentColor"><path d="M12.96 7H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V7z"></path><path fill-rule="evenodd" d="M10.082 12.629L9.664 14H8.598l1.789-5.332h1.234L13.402 14h-1.12l-.419-1.371h-1.781zm1.57-.785L11 9.688h-.047l-.652 2.156h1.351z"></path><path d="M4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999l.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"></path></g></svg><span>DESC</span>',2)],Va=e.createElementVNode("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1),$a={key:0},Ea=["id","value"],Ba=["for"],_a={key:1},Na={class:"mb-2"},Sa={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},La=["onClick"],Ma=[e.createElementVNode("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)],Da={class:"flex"},Aa=[e.createElementVNode("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"})],-1)],za={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},nn=e.defineComponent({__name:"FilterColumn",props:{definitions:null,column:null,topLeft:null},emits:["done","save"],setup(t,{emit:o}){const n=t,l=e.ref(),a=e.ref(""),s=e.ref(""),r=e.ref([]),m=e.computed(()=>n.column.meta.isEnum==!0),c=e.computed(()=>n.column.meta.isEnum==!0?en(jn(n.column.type)):[]),d=e.computed(()=>{var b;return((b=f(n.column.type))==null?void 0:b.map(L=>({key:L.value,value:L.name})))||[]}),u=e.ref({filters:[]}),p=e.computed(()=>u.value.filters);e.watchEffect(()=>u.value=Object.assign({},n.column.settings,{filters:Array.from(n.column.settings.filters)})),e.watchEffect(()=>{var b,L,M;return r.value=((M=(L=(b=n.column.settings.filters)==null?void 0:b[0])==null?void 0:L.value)==null?void 0:M.split(","))||[]});function f(b){let L=n.definitions;return An(b)||(L=L.filter(M=>M.types!=="string")),L}function g(b,L){return f(b).find(M=>M.value===L)}function k(){var L;if(!a.value)return;let b=(L=g(n.column.type,a.value))==null?void 0:L.name;b&&(u.value.filters.push({key:a.value,name:b,value:s.value}),a.value=s.value="")}function w(b){u.value.filters.splice(b,1)}function V(b){return Un(g(n.column.type,b.key),n.column.type,b)}function S(){o("done")}function T(){var b;a.value="%",(b=l.value)==null||b.focus()}function F(){if(s.value&&k(),m.value){let b=Object.values(r.value).filter(L=>L);u.value.filters=b.length>0?[{key:"%In",name:"In",value:b.join(",")}]:[]}o("save",u.value),o("done")}function I(b){u.value.sort=b===u.value.sort?void 0:b,e.nextTick(F)}return(b,L)=>{var j;const M=e.resolveComponent("SelectInput"),N=e.resolveComponent("TextInput"),B=e.resolveComponent("PrimaryButton"),A=e.resolveComponent("SecondaryButton");return e.openBlock(),e.createElementBlock("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:S,onVnodeMounted:T},[e.createElementVNode("div",{class:"absolute",style:e.normalizeStyle(`top:${t.topLeft.y}px;left:${t.topLeft.x}px`),onClick:L[5]||(L[5]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ya,[e.createElementVNode("div",ka,[ba,e.createElementVNode("div",wa,[e.createElementVNode("button",{type:"button",title:"Sort Ascending",onClick:L[0]||(L[0]=O=>I("ASC")),class:e.normalizeClass(`${u.value.sort==="ASC"?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},Ca,2),e.createElementVNode("button",{type:"button",title:"Sort Descending",onClick:L[1]||(L[1]=O=>I("DESC")),class:e.normalizeClass(`${u.value.sort==="DESC"?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},xa,2)]),Va,e.unref(m)?(e.openBlock(),e.createElementBlock("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),O=>(e.openBlock(),e.createElementBlock("div",{key:O.key,class:"flex items-center"},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",id:O.key,value:O.key,"onUpdate:modelValue":L[2]||(L[2]=Q=>r.value=Q),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,Ea),[[e.vModelCheckbox,r.value]]),e.createElementVNode("label",{for:O.key,class:"ml-3"},e.toDisplayString(O.value),9,Ba)]))),128))])):(e.openBlock(),e.createElementBlock("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),(O,Q)=>(e.openBlock(),e.createElementBlock("div",Na,[e.createElementVNode("span",Sa,[e.createTextVNode(e.toDisplayString(t.column.name)+" "+e.toDisplayString(O.name)+" "+e.toDisplayString(V(O))+" ",1),e.createElementVNode("button",{type:"button",onClick:E=>w(Q),class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},Ma,8,La)])]))),256)),e.createElementVNode("div",Da,[e.createVNode(M,{id:"filterRule",class:"w-32 mr-1",modelValue:a.value,"onUpdate:modelValue":L[3]||(L[3]=O=>a.value=O),entries:e.unref(d),label:"",placeholder:""},null,8,["modelValue","entries"]),((j=g(t.column.type,a.value))==null?void 0:j.valueType)!=="none"?(e.openBlock(),e.createBlock(N,{key:0,ref_key:"txtFilter",ref:l,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:s.value,"onUpdate:modelValue":L[4]||(L[4]=O=>s.value=O),onKeyup:e.withKeys(k,["enter"]),label:"",placeholder:""},null,8,["modelValue","onKeyup"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"pt-1"},[e.createElementVNode("button",{type:"button",onClick:k,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Aa)])])]))]),e.createElementVNode("div",za,[e.createVNode(B,{onClick:F,color:"red",class:"ml-2"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1}),e.createVNode(A,{onClick:S},{default:e.withCtx(()=>[e.createTextVNode(" Cancel ")]),_:1})])])],4)],512)}}}),Ta={class:"px-4 sm:px-6 lg:px-8 text-sm"},Pa={class:"flex flex-wrap"},Fa={class:"group pr-4 sm:pr-6 lg:pr-8"},Ia={class:"flex justify-between w-full font-medium"},ja={class:"w-6 flex justify-end"},Oa={class:"hidden group-hover:inline"},Ra=["onClick","title"],Ha=[e.createElementVNode("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)],Ua={key:0,class:"pt-2"},qa={class:"ml-2"},Qa={key:1},Ga={class:"pt-2"},Ka={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},Wa=["onClick"],Za=[e.createElementVNode("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)],Ja=[e.createElementVNode("span",null,"Clear All",-1)],on=e.defineComponent({__name:"FilterViews",props:{definitions:null,columns:null},emits:["done","change"],setup(t,{emit:o}){const n=t,l=e.computed(()=>n.columns.filter(p=>p.settings.filters.length>0));function a(p){var f,g;return(g=(f=p==null?void 0:p[0])==null?void 0:f.value)==null?void 0:g.split(",")}function s(p){let f=n.definitions;return An(p)||(f=f.filter(g=>g.types!=="string")),f}function r(p,f){return s(p).find(g=>g.value===f)}function m(p,f){return Un(r(p.type,f.value),p.type,f)}function c(p){p.settings.filters=[],o("change",p)}function d(p,f){p.settings.filters.splice(f,1),o("change",p)}function u(){n.columns.forEach(p=>{p.settings.filters=[],o("change",p)}),o("done")}return(p,f)=>(e.openBlock(),e.createElementBlock("div",Ta,[e.createElementVNode("div",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),g=>(e.openBlock(),e.createElementBlock("fieldset",Fa,[e.createElementVNode("legend",Ia,[e.createElementVNode("span",null,e.toDisplayString(e.unref(i.humanize)(g.name)),1),e.createElementVNode("span",ja,[e.createElementVNode("span",Oa,[e.createElementVNode("button",{onClick:k=>c(g),title:`Clear all ${e.unref(i.humanize)(g.name)} filters`,class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-red-600 hover:bg-red-200 hover:text-red-500 focus:outline-none focus:bg-red-500 focus:text-white"},Ha,8,Ra)])])]),g.meta.isEnum?(e.openBlock(),e.createElementBlock("div",Ua,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a(g.settings.filters),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"flex items-center"},[e.createElementVNode("label",qa,e.toDisplayString(k),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",Qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.settings.filters,(k,w)=>(e.openBlock(),e.createElementBlock("div",Ga,[e.createElementVNode("span",Ka,[e.createTextVNode(e.toDisplayString(g.name)+" "+e.toDisplayString(k.name)+" "+e.toDisplayString(m(g,k))+" ",1),e.createElementVNode("button",{type:"button",onClick:V=>d(g,w),class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},Za,8,Wa)])]))),256))]))]))),256))]),e.createElementVNode("div",{class:"flex justify-center pt-4"},[e.createElementVNode("button",{type:"button",onClick:u,class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-sm font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Ja)])]))}}),Xa={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Ya={class:""},va={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},es=e.createElementVNode("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1),ts={class:"mt-4"},ns=["for"],os=["id"],ls=["value","selected"],as={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},ss=["id","checked"],rs=["for"],is={class:"mt-4"},cs={class:"pb-2 px-4"},ds={class:""},ms=["id","value"],fs=["for"],us={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},ln=e.defineComponent({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:null,prefs:null,maxLimit:null},emits:["done","save"],setup(t,{emit:o}){const n=t,{autoQueryGridDefaults:l}=Fe(),a=e.ref({});e.watchEffect(()=>a.value=Object.assign({take:l.value.take,selectedColumns:[]},n.prefs));const s=[10,25,50,100,250,500,1e3];function r(){o("done")}function m(){o("save",a.value)}return(c,d)=>{const u=e.resolveComponent("PrimaryButton"),p=e.resolveComponent("SecondaryButton"),f=e.resolveComponent("ModalDialog");return e.openBlock(),e.createBlock(f,{id:t.id,onDone:r,"size-class":"w-full sm:max-w-prose"},{default:e.withCtx(()=>[e.createElementVNode("div",Xa,[e.createElementVNode("div",Ya,[e.createElementVNode("div",va,[es,e.createElementVNode("div",ts,[e.createElementVNode("label",{for:`${t.id}-take`,class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,ns),e.withDirectives(e.createElementVNode("select",{id:`${t.id}-take`,"onUpdate:modelValue":d[0]||(d[0]=g=>a.value.take=g),class:"mt-1 block w-full pl-3 pr-10 py-2 text-base bg-white dark:bg-black border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.filter(g=>n.maxLimit==null||g<=n.maxLimit),g=>(e.openBlock(),e.createElementBlock("option",{value:g,selected:g===a.value.take},e.toDisplayString(g),9,ls))),256))],8,os),[[e.vModelSelect,a.value.take]])]),e.createElementVNode("div",as,[e.createElementVNode("input",{type:"radio",id:`${t.id}-allColumns`,onClick:d[1]||(d[1]=g=>a.value.selectedColumns=[]),checked:a.value.selectedColumns.length===0,class:"focus:ring-indigo-500 h-4 w-4 bg-white dark:bg-black text-indigo-600 dark:text-indigo-400 border-gray-300 dark:border-gray-700"},null,8,ss),e.createElementVNode("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:`${t.id}-allColumns`},"View all columns",8,rs)]),e.createElementVNode("div",is,[e.createElementVNode("div",cs,[e.createElementVNode("div",ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,g=>(e.openBlock(),e.createElementBlock("div",{key:g.name,class:"flex items-center"},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",id:g.name,value:g.name,"onUpdate:modelValue":d[2]||(d[2]=k=>a.value.selectedColumns=k),class:"h-4 w-4 bg-white dark:bg-black border-gray-300 dark:border-gray-700 rounded text-indigo-600 dark:text-indigo-400 focus:ring-indigo-500"},null,8,ms),[[e.vModelCheckbox,a.value.selectedColumns]]),e.createElementVNode("label",{for:g.name,class:"ml-3"},e.toDisplayString(g.name),9,fs)]))),128))])])])])])]),e.createElementVNode("div",us,[e.createVNode(u,{onClick:m,color:"red",class:"ml-2"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1}),e.createVNode(p,{onClick:r},{default:e.withCtx(()=>[e.createTextVNode(" Cancel ")]),_:1})])]),_:1},8,["id"])}}}),ps={key:0},hs={key:1},gs={key:2,class:"pt-1"},ys={key:0},ks={key:1},bs={key:3},ws={class:"pl-1 pt-1 flex flex-wrap"},Cs={class:"flex mt-1"},xs=["title"],Vs=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("g",{"stroke-width":"1.5",fill:"none"},[e.createElementVNode("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1)],$s=["disabled"],Es=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1)],Bs=["disabled"],_s=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1)],Ns=["disabled"],Ss=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1)],Ls=["disabled"],Ms=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1)],Ds={key:0,class:"flex mt-1"},As={class:"px-4 text-lg text-black dark:text-white"},zs={key:0},Ts={key:1},Ps=e.createElementVNode("span",{class:"hidden xl:inline"}," Showing Results ",-1),Fs={key:2},Is={class:"flex flex-wrap"},js={key:0,class:"pl-2 mt-1"},Os=[e.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 20v-5h-5M4 4v5h5m10.938 2A8.001 8.001 0 0 0 5.07 8m-1.008 5a8.001 8.001 0 0 0 14.868 3"})],-1)],Rs={key:1,class:"pl-2 mt-1"},Hs=[e.createStaticVNode('<svg class="w-5 h-5 mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M28.781 4.405h-10.13V2.018L2 4.588v22.527l16.651 2.868v-3.538h10.13A1.162 1.162 0 0 0 30 25.349V5.5a1.162 1.162 0 0 0-1.219-1.095zm.16 21.126H18.617l-.017-1.889h2.487v-2.2h-2.506l-.012-1.3h2.518v-2.2H18.55l-.012-1.3h2.549v-2.2H18.53v-1.3h2.557v-2.2H18.53v-1.3h2.557v-2.2H18.53v-2h10.411z" fill="#20744a" fill-rule="evenodd"></path><path fill="#20744a" d="M22.487 7.439h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 10.94h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 14.441h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 17.942h4.323v2.2h-4.323z"></path><path fill="#20744a" d="M22.487 21.443h4.323v2.2h-4.323z"></path><path fill="#fff" fill-rule="evenodd" d="M6.347 10.673l2.146-.123l1.349 3.709l1.594-3.862l2.146-.123l-2.606 5.266l2.606 5.279l-2.269-.153l-1.532-4.024l-1.533 3.871l-2.085-.184l2.422-4.663l-2.238-4.993z"></path></svg><span class="text-green-900 dark:text-green-100">Excel</span>',2)],Us={key:2,class:"pl-2 mt-1"},qs={key:0,class:"w-5 h-5 mr-1 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Qs=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)],Gs={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Ks=[e.createElementVNode("g",{fill:"none"},[e.createElementVNode("path",{d:"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)],Ws=e.createElementVNode("span",{class:"whitespace-nowrap"},"Copy URL",-1),Zs={key:3,class:"pl-2 mt-1"},Js=[e.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1)],Xs={key:4,class:"pl-2 mt-1"},Ys=e.createElementVNode("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),vs={class:"mr-1"},er={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},tr=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1)],nr={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},or=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1)],lr={key:5,class:"pl-2 mt-1"},ar=["title"],sr=e.createElementVNode("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1),rr={class:"whitespace-nowrap"},ir={key:7},cr={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},dr={class:"mr-1 select-none"},mr={key:1,class:"flex justify-between items-center"},fr={class:"mr-1 select-none"},ur=e.defineComponent({__name:"AutoQueryGrid",props:{filterDefinitions:null,id:{default:"AutoQueryGrid"},apis:null,type:null,prefs:null,deny:null,hide:null,selectedColumns:null,toolbarButtonClass:null,tableStyle:null,gridClass:null,grid2Class:null,grid3Class:null,grid4Class:null,tableClass:null,theadClass:null,tbodyClass:null,theadRowClass:null,theadCellClass:null,headerTitle:null,headerTitles:null,visibleFrom:null,rowClass:null,rowStyle:null,apiPrefs:null,canFilter:null,disableKeyBindings:null,configureField:null,skip:{default:0},create:{type:Boolean},edit:null},emits:["headerSelected","rowSelected"],setup(t,{expose:o,emit:n}){const l=t,{config:a,autoQueryGridDefaults:s}=Fe(),r=s,m=e.inject("client"),c=a.value.storage;o({update:Se,search:co,createRequestArgs:fn,reset:wo,createDone:ut,createSave:gn,editDone:ft,editSave:At});const d=y=>typeof y=="string"?y.split(","):y||[];function u(y,C){const U=d(C);return y.reduce((R,v)=>(R[v]=!U.includes(v),R),{})}const p="filtering,queryString,queryFilters".split(","),f="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar".split(","),g=e.computed(()=>l.deny?u(p,l.deny):u(p,r.value.deny)),k=e.computed(()=>l.hide?u(f,l.hide):u(f,r.value.hide));function w(y){return g.value[y]}function V(y){return k.value[y]}const S=e.computed(()=>l.tableStyle??r.value.tableStyle),T=e.computed(()=>l.gridClass??W.getGridClass(S.value)),F=e.computed(()=>l.grid2Class??W.getGrid2Class(S.value)),I=e.computed(()=>l.grid3Class??W.getGrid3Class(S.value)),b=e.computed(()=>l.grid4Class??W.getGrid4Class(S.value)),L=e.computed(()=>l.tableClass??W.getTableClass(S.value)),M=e.computed(()=>l.theadClass??W.getTheadClass(S.value)),N=e.computed(()=>l.theadRowClass??W.getTheadRowClass(S.value)),B=e.computed(()=>l.theadCellClass??W.getTheadCellClass(S.value)),A=e.computed(()=>l.toolbarButtonClass??W.toolbarButtonClass);function j(y,C){var ce;if(l.rowClass)return l.rowClass(y,C);const U=!!ee.value.AnyUpdate,v=((ce=Ve.value)!=null&&ce.name?i.mapGet(y,Ve.value.name):null)==z.value;return W.getTableRowClass(l.tableStyle,C,v,U)}const O=e.useSlots(),Q=e.computed(()=>{var y;return pn(((y=ee.value.AnyQuery.viewModel)==null?void 0:y.name)||ee.value.AnyQuery.dataModel.name)}),E=e.computed(()=>{const y=Object.keys(O).map(C=>C.toLowerCase());return $e(Q.value).filter(C=>y.includes(C.name.toLowerCase())||y.includes(C.name.toLowerCase()+"-header")).map(C=>C.name)});function h(){let y=d(l.selectedColumns);return y.length>0?y:E.value.length>0?E.value:[]}const $=e.computed(()=>{let C=h().map(R=>R.toLowerCase());const U=$e(Q.value);return C.length>0?C.map(R=>U.find(v=>v.name.toLowerCase()===R)).filter(R=>R!=null):U}),G=e.computed(()=>{let y=$.value.map(U=>U.name),C=d(te.value.selectedColumns).map(U=>U.toLowerCase());return C.length>0?y.filter(U=>C.includes(U.toLowerCase())):y}),x=e.ref([]),_=e.ref(new i.ApiResult),Y=e.ref(new i.ApiResult),J=e.ref(),K=e.ref(!1),z=e.ref(),H=e.ref(),ne=e.ref(!1),re=e.ref(),Z=e.ref(l.skip),ge=e.ref(!1),pe=25,te=e.ref({take:pe}),be=e.ref(!1),me=e.computed(()=>x.value.some(y=>y.settings.filters.length>0||!!y.settings.sort)||te.value.selectedColumns),xe=e.computed(()=>x.value.map(y=>y.settings.filters.length).reduce((y,C)=>y+C,0)),De=e.computed(()=>{var y;return $e(pn(et.value||((y=ee.value.AnyQuery)==null?void 0:y.dataModel.name)))}),Ve=e.computed(()=>{var y;return st(pn(et.value||((y=ee.value.AnyQuery)==null?void 0:y.dataModel.name)))}),D=e.computed(()=>te.value.take??pe),P=e.computed(()=>_.value.response?i.mapGet(_.value.response,"results"):[]),X=e.computed(()=>{var y;return((y=_.value.response)==null?void 0:y.total)??P.value.length??0}),ae=e.computed(()=>Z.value>0),le=e.computed(()=>Z.value>0),he=e.computed(()=>P.value.length>=D.value),Be=e.computed(()=>P.value.length>=D.value),se={NoQuery:"No Query API was found"};function we(y){if(y){if(l.canFilter)return l.canFilter(y);const C=De.value.find(U=>U.name.toLowerCase()==y.toLowerCase());if(C)return!zn(C)}return!1}function _e(y){w("queryString")&&Pt(y)}async function Ie(y){Z.value+=y,Z.value<0&&(Z.value=0);const C=Math.floor(X.value/D.value)*D.value;Z.value>C&&(Z.value=C),_e({skip:Z.value||void 0}),await Se()}async function mt(y,C){var v,ce;if(H.value=null,z.value=C,!y||!C)return;let U=lt(ee.value.AnyQuery,{[y]:C});const R=await m.api(U);if(R.succeeded){let fe=(v=i.mapGet(R.response,"results"))==null?void 0:v[0];fe||console.warn(`API ${(ce=ee.value.AnyQuery)==null?void 0:ce.request.name}(${y}:${C}) returned no results`),H.value=fe}}async function R0(y,C){var v;n("rowSelected",y,C);const U=(v=Ve.value)==null?void 0:v.name,R=U?i.mapGet(y,U):null;!U||!R||(_e({edit:R}),mt(U,R))}function H0(y,C){var R;if(!w("filtering"))return;let U=C.target;if(we(y)&&(U==null?void 0:U.tagName)!=="TD"){let v=(R=U==null?void 0:U.closest("TABLE"))==null?void 0:R.getBoundingClientRect(),ce=x.value.find(fe=>fe.name.toLowerCase()==y.toLowerCase());if(ce&&v){let fe=318,je=v.x+fe+10;re.value={column:ce,topLeft:{x:Math.max(Math.floor(C.clientX+fe/2),je),y:v.y+45}}}}n("headerSelected",y,C)}function U0(){re.value=null}async function q0(y){var U;let C=(U=re.value)==null?void 0:U.column;C&&(C.settings=y,c.setItem(Mt(C.name),JSON.stringify(C.settings)),await Se()),re.value=null}async function Q0(y){c.setItem(Mt(y.name),JSON.stringify(y.settings)),await Se()}async function G0(y){ne.value=!1,te.value=y,c.setItem(un(),JSON.stringify(y)),await Se()}async function Se(){await co(fn())}async function K0(){await Se()}async function co(y){const C=ee.value.AnyQuery;if(!C){console.error(se.NoQuery);return}let U=lt(C,y),R=i.delaySet(fe=>{_.value.response=_.value.error=void 0,be.value=fe}),v=await m.api(U);R(),e.nextTick(()=>_.value=v);let ce=i.mapGet(v.response,"results")||[];!v.succeeded||ce.label==0}function fn(){let y={include:"total",take:D.value},C=d(te.value.selectedColumns||l.selectedColumns);if(C.length>0){let R=Ve.value;R&&C.includes(R.name)&&(C=[R.name,...C]);const v=De.value,ce=[];C.forEach(fe=>{var zt;const je=v.find(de=>de.name.toLowerCase()==fe.toLowerCase());(zt=je==null?void 0:je.ref)!=null&&zt.selfId&&ce.push(je.ref.selfId),i.mapGet(O,fe)&&ce.push(...v.filter(de=>{var qe,pt;return((pt=(qe=de.ref)==null?void 0:qe.selfId)==null?void 0:pt.toLowerCase())==fe.toLowerCase()}).map(de=>de.name))}),ce.forEach(fe=>{C.includes(fe)||C.push(fe)}),y.fields=C.join(",")}let U=[];if(x.value.forEach(R=>{R.settings.sort&&U.push((R.settings.sort==="DESC"?"-":"")+R.name),R.settings.filters.forEach(v=>{let ce=v.key.replace("%",R.name);y[ce]=v.value})}),w("queryString")&&w("queryFilters")){let R=i.queryString(location.search);if(Object.keys(R).forEach(v=>{$.value.find(fe=>fe.name===v)&&(y[v]=R[v])}),typeof R.skip<"u"){const v=parseInt(R.skip);isNaN(v)||(Z.value=y.skip=v)}}return typeof y.skip>"u"&&Z.value>0&&(y.skip=Z.value),U.length>0&&(y.orderBy=U.join(",")),y}function W0(){const y=mo("csv");It(y),typeof window<"u"&&window.open(y)}function Z0(){const y=mo("json");It(y),ge.value=!0,setTimeout(()=>ge.value=!1,3e3)}function mo(y="json"){var ce;const C=fn(),U=`/api/${(ce=ee.value.AnyQuery)==null?void 0:ce.request.name}`,R=i.combinePaths(m.baseUrl,i.appendQueryString(U,{...C,jsconfig:"edv"}));return R.indexOf("?")>=0?i.leftPart(R,"?")+"."+y+"?"+i.rightPart(R,"?"):R+".json"}async function J0(){x.value.forEach(y=>{y.settings={filters:[]},c.removeItem(Mt(y.name))}),te.value={take:pe},c.removeItem(un()),await Se()}function X0(){K.value=!0,_e({create:null})}const et=e.computed(()=>Ke(l.type)),Pe=e.computed(()=>{var y;return et.value||((y=ee.value.AnyQuery)==null?void 0:y.dataModel.name)}),un=()=>{var y;return`${l.id}/ApiPrefs/${et.value||((y=ee.value.AnyQuery)==null?void 0:y.dataModel.name)}`},Mt=y=>{var C;return`Column/${l.id}:${et.value||((C=ee.value.AnyQuery)==null?void 0:C.dataModel.name)}.${y}`},{metadataApi:fo,typeOf:pn,apiOf:uo,filterDefinitions:Y0}=Ee(),{invalidAccessMessage:hn}=Nt(),po=e.computed(()=>l.filterDefinitions||Y0.value),ee=e.computed(()=>{let y=d(l.apis);return y.length>0?Je.from(y.map(C=>uo(C)).filter(C=>C!=null).map(C=>C)):Je.forType(et.value,fo.value)}),Dt=y=>`<span class="text-yellow-700">${y}</span>`,ho=e.computed(()=>{if(!fo.value)return Dt(`AppMetadata not loaded, see <a class="${Bt.blue}" href="https://docs.servicestack.net/vue/use-metadata" target="_blank">useMetadata()</a>`);let C=d(l.apis).map(R=>uo(R)==null?R:null).filter(R=>R!=null);if(C.length>0)return Dt(`Unknown API${C.length>1?"s":""}: ${C.join(", ")}`);let U=ee.value;return U.empty?Dt("Mising DataModel in property 'type' or AutoQuery APIs to use in property 'apis'"):U.AnyQuery?null:Dt(se.NoQuery)}),go=e.computed(()=>ee.value.AnyQuery&&hn(ee.value.AnyQuery)),yo=e.computed(()=>ee.value.Create&&hn(ee.value.Create)),ko=e.computed(()=>ee.value.AnyUpdate&&hn(ee.value.AnyUpdate)),v0=e.computed(()=>_t(ee.value.Create));e.computed(()=>_t(ee.value.AnyUpdate));const bo=e.computed(()=>_t(ee.value.Delete));function ft(){H.value=null,z.value=null,_e({edit:void 0})}function ut(){K.value=!1,_e({create:void 0})}async function At(){await Se(),ft()}async function gn(){await Se(),ut()}function wo(){var U;_.value=new i.ApiResult,Y.value=new i.ApiResult,K.value=!1,z.value=null,H.value=null,ne.value=!1,re.value=null,Z.value=l.skip,ge.value=!1,te.value={take:pe},be.value=!1;const y=l.prefs||kt(c.getItem(un()));y&&(te.value=y),x.value=$.value.map(R=>({name:R.name,type:R.type,meta:R,settings:Object.assign({filters:[]},kt(c.getItem(Mt(R.name))))})),isNaN(l.skip)||(Z.value=l.skip);let C=(U=Ve.value)==null?void 0:U.name;if(w("queryString")){const R=i.queryString(location.search);typeof R.create<"u"?K.value=typeof R.create<"u":C&&(typeof R.edit=="string"||typeof R.edit=="number")&&mt(C,R.edit)}l.create===!0&&(K.value=!0),C&&l.edit!=null&&mt(C,l.edit)}return e.onMounted(async()=>{wo(),await Se()}),(y,C)=>{const U=e.resolveComponent("Alert"),R=e.resolveComponent("EnsureAccessDialog"),v=e.resolveComponent("AutoCreateForm"),ce=e.resolveComponent("AutoEditForm"),fe=e.resolveComponent("ErrorSummary"),je=e.resolveComponent("Loading"),Co=e.resolveComponent("SettingsIcons"),zt=e.resolveComponent("DataGrid");return e.unref(ho)?(e.openBlock(),e.createElementBlock("div",ps,[e.createVNode(U,{innerHTML:e.unref(ho)},null,8,["innerHTML"])])):e.unref(go)?(e.openBlock(),e.createElementBlock("div",hs,[e.createVNode(Kn,{"invalid-access":e.unref(go)},null,8,["invalid-access"])])):(e.openBlock(),e.createElementBlock("div",gs,[K.value&&e.unref(ee).Create?(e.openBlock(),e.createElementBlock("div",ys,[e.unref(yo)?(e.openBlock(),e.createBlock(R,{key:0,title:`Create ${e.unref(Pe)}`,"invalid-access":e.unref(yo),"alert-class":"text-yellow-700",onDone:ut},null,8,["title","invalid-access"])):e.unref(O).createform?e.renderSlot(y.$slots,"createform",{key:1,type:e.unref(ee).Create.request.name,configure:t.configureField,done:ut,save:gn}):(e.openBlock(),e.createBlock(v,{key:2,type:e.unref(ee).Create.request.name,configure:t.configureField,onDone:ut,onSave:gn},{header:e.withCtx(()=>[e.renderSlot(y.$slots,"formheader",{form:"create",apis:e.unref(ee),type:e.unref(Pe)})]),footer:e.withCtx(()=>[e.renderSlot(y.$slots,"formfooter",{form:"create",apis:e.unref(ee),type:e.unref(Pe)})]),_:3},8,["type","configure"]))])):H.value&&e.unref(ee).AnyUpdate?(e.openBlock(),e.createElementBlock("div",ks,[e.unref(ko)?(e.openBlock(),e.createBlock(R,{key:0,title:`Update ${e.unref(Pe)}`,"invalid-access":e.unref(ko),"alert-class":"text-yellow-700",onDone:ft},null,8,["title","invalid-access"])):e.unref(O).editform?e.renderSlot(y.$slots,"editform",{key:1,model:H.value,type:e.unref(ee).AnyUpdate.request.name,deleteType:e.unref(bo)?e.unref(ee).Delete.request.name:null,configure:t.configureField,done:ft,save:At}):(e.openBlock(),e.createBlock(ce,{key:2,modelValue:H.value,"onUpdate:modelValue":C[0]||(C[0]=de=>H.value=de),type:e.unref(ee).AnyUpdate.request.name,deleteType:e.unref(bo)?e.unref(ee).Delete.request.name:null,configure:t.configureField,onDone:ft,onSave:At,onDelete:At},{header:e.withCtx(()=>[e.renderSlot(y.$slots,"formheader",{form:"edit",apis:e.unref(ee),type:e.unref(Pe),model:H.value,id:z.value})]),footer:e.withCtx(()=>[e.renderSlot(y.$slots,"formfooter",{form:"edit",apis:e.unref(ee),type:e.unref(Pe),model:H.value,id:z.value})]),_:3},8,["modelValue","type","deleteType","configure"]))])):e.createCommentVNode("",!0),e.unref(O).toolbar?e.renderSlot(y.$slots,"toolbar",{key:2}):V("toolbar")?(e.openBlock(),e.createElementBlock("div",bs,[ne.value?(e.openBlock(),e.createBlock(ln,{key:0,columns:e.unref($),prefs:te.value,onDone:C[1]||(C[1]=de=>ne.value=!1),onSave:G0},null,8,["columns","prefs"])):e.createCommentVNode("",!0),e.createElementVNode("div",ws,[e.createElementVNode("div",Cs,[V("preferences")?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:`${e.unref(Pe)} Preferences`,onClick:C[2]||(C[2]=de=>ne.value=!ne.value)},Vs,8,xs)):e.createCommentVNode("",!0),V("pagingNav")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["pl-2",e.unref(ae)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!e.unref(ae),onClick:C[3]||(C[3]=de=>Ie(-e.unref(X)))},Es,10,$s)):e.createCommentVNode("",!0),V("pagingNav")?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["pl-2",e.unref(le)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!e.unref(le),onClick:C[4]||(C[4]=de=>Ie(-e.unref(D)))},_s,10,Bs)):e.createCommentVNode("",!0),V("pagingNav")?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:e.normalizeClass(["pl-2",e.unref(he)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!e.unref(he),onClick:C[5]||(C[5]=de=>Ie(e.unref(D)))},Ss,10,Ns)):e.createCommentVNode("",!0),V("pagingNav")?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",class:e.normalizeClass(["pl-2",e.unref(Be)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!e.unref(Be),onClick:C[6]||(C[6]=de=>Ie(e.unref(X)))},Ms,10,Ls)):e.createCommentVNode("",!0)]),V("pagingInfo")?(e.openBlock(),e.createElementBlock("div",Ds,[e.createElementVNode("div",As,[be.value?(e.openBlock(),e.createElementBlock("span",zs,"Querying...")):e.createCommentVNode("",!0),e.unref(P).length?(e.openBlock(),e.createElementBlock("span",Ts,[Ps,e.createTextVNode(" "+e.toDisplayString(Z.value+1)+" - "+e.toDisplayString(Math.min(Z.value+e.unref(P).length,e.unref(X)))+" ",1),e.createElementVNode("span",null," of "+e.toDisplayString(e.unref(X)),1)])):_.value.completed?(e.openBlock(),e.createElementBlock("span",Fs,"No Results")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Is,[V("refresh")?(e.openBlock(),e.createElementBlock("div",js,[e.createElementVNode("button",{type:"button",onClick:K0,title:"Refresh",class:e.normalizeClass(e.unref(A))},Os,2)])):e.createCommentVNode("",!0),V("downloadCsv")?(e.openBlock(),e.createElementBlock("div",Rs,[e.createElementVNode("button",{type:"button",onClick:W0,title:"Download CSV",class:e.normalizeClass(e.unref(A))},Hs,2)])):e.createCommentVNode("",!0),V("copyApiUrl")?(e.openBlock(),e.createElementBlock("div",Us,[e.createElementVNode("button",{type:"button",onClick:Z0,title:"Copy API URL",class:e.normalizeClass(e.unref(A))},[ge.value?(e.openBlock(),e.createElementBlock("svg",qs,Qs)):(e.openBlock(),e.createElementBlock("svg",Gs,Ks)),Ws],2)])):e.createCommentVNode("",!0),e.unref(me)&&V("resetPreferences")?(e.openBlock(),e.createElementBlock("div",Zs,[e.createElementVNode("button",{type:"button",onClick:J0,title:"Reset Preferences & Filters",class:e.normalizeClass(e.unref(A))},Js,2)])):e.createCommentVNode("",!0),V("filtersView")&&e.unref(xe)>0?(e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("button",{type:"button",onClick:C[7]||(C[7]=de=>J.value=J.value=="filters"?null:"filters"),class:e.normalizeClass(e.unref(A)),"aria-expanded":"false"},[Ys,e.createElementVNode("span",vs,e.toDisplayString(e.unref(xe))+" "+e.toDisplayString(e.unref(xe)==1?"Filter":"Filters"),1),J.value!="filters"?(e.openBlock(),e.createElementBlock("svg",er,tr)):(e.openBlock(),e.createElementBlock("svg",nr,or))],2)])):e.createCommentVNode("",!0),V("newItem")&&e.unref(ee).Create&&e.unref(v0)?(e.openBlock(),e.createElementBlock("div",lr,[e.createElementVNode("button",{type:"button",onClick:X0,title:e.unref(Pe),class:e.normalizeClass(e.unref(A))},[sr,e.createElementVNode("span",rr,"New "+e.toDisplayString(e.unref(Pe)),1)],10,ar)])):e.createCommentVNode("",!0),e.unref(O).toolbarbuttons?e.renderSlot(y.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:e.unref(A)}):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),J.value=="filters"?(e.openBlock(),e.createBlock(on,{key:4,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:e.unref(po),columns:x.value,onDone:C[8]||(C[8]=de=>J.value=null),onChange:Q0},null,8,["definitions","columns"])):e.createCommentVNode("",!0),Y.value.error??_.value.error?(e.openBlock(),e.createBlock(fe,{key:5,status:Y.value.error??_.value.error},null,8,["status"])):be.value?(e.openBlock(),e.createBlock(je,{key:6,class:"p-2"})):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("div",ir,[e.createVNode(nn,{definitions:e.unref(po),column:re.value.column,"top-left":re.value.topLeft,onDone:U0,onSave:q0},null,8,["definitions","column","top-left"])])):e.createCommentVNode("",!0),e.unref(P).length?(e.openBlock(),e.createBlock(zt,{key:8,id:t.id,items:e.unref(P),type:t.type,"selected-columns":e.unref(G),class:"mt-1",onFiltersChanged:Se,tableStyle:e.unref(S),gridClass:e.unref(T),grid2Class:e.unref(F),grid3Class:e.unref(I),grid4Class:e.unref(b),tableClass:e.unref(L),theadClass:e.unref(M),theadRowClass:e.unref(N),theadCellClass:e.unref(B),tbodyClass:t.tbodyClass,rowClass:j,onRowSelected:R0,rowStyle:t.rowStyle,headerTitle:t.headerTitle,headerTitles:t.headerTitles,visibleFrom:t.visibleFrom,onHeaderSelected:H0},e.createSlots({header:e.withCtx(({column:de,label:qe})=>{var pt;return[w("filtering")&&we(de)?(e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("span",dr,e.toDisplayString(qe),1),e.createVNode(Co,{column:x.value.find(ef=>ef.name.toLowerCase()===de.toLowerCase()),"is-open":((pt=re.value)==null?void 0:pt.column.name)===de},null,8,["column","is-open"])])):(e.openBlock(),e.createElementBlock("div",mr,[e.createElementVNode("span",fr,e.toDisplayString(qe),1)]))]}),_:2},[e.renderList(Object.keys(e.unref(O)),de=>({name:de,fn:e.withCtx(qe=>[e.renderSlot(y.$slots,de,e.normalizeProps(e.guardReactiveProps(qe)))])}))]),1032,["id","items","type","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):e.createCommentVNode("",!0)]))}}}),pr={class:"flex"},hr={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},gr=[e.createElementVNode("g",{fill:"none"},[e.createElementVNode("path",{d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586V4z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)],yr=[e.createElementVNode("path",{d:"M505.5 658.7c3.2 4.4 9.7 4.4 12.9 0l178-246c3.8-5.3 0-12.7-6.5-12.7H643c-10.2 0-19.9 4.9-25.9 13.2L512 558.6L406.8 413.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1)],kr={key:2,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},br=[e.createElementVNode("g",{fill:"none"},[e.createElementVNode("path",{d:"M8.998 4.71L6.354 7.354a.5.5 0 1 1-.708-.707L9.115 3.18A.499.499 0 0 1 9.498 3H9.5a.5.5 0 0 1 .354.147l.01.01l3.49 3.49a.5.5 0 1 1-.707.707l-2.65-2.649V16.5a.5.5 0 0 1-1 0V4.71z",fill:"currentColor"})],-1)],wr={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Cr=[e.createElementVNode("g",{fill:"none"},[e.createElementVNode("path",{d:"M10.002 15.29l2.645-2.644a.5.5 0 0 1 .707.707L9.886 16.82a.5.5 0 0 1-.384.179h-.001a.5.5 0 0 1-.354-.147l-.01-.01l-3.49-3.49a.5.5 0 1 1 .707-.707l2.648 2.649V3.5a.5.5 0 0 1 1 0v11.79z",fill:"currentColor"})],-1)],xr=e.defineComponent({__name:"SettingsIcons",props:{column:null,isOpen:{type:Boolean}},setup(t){return(o,n)=>{var l,a,s,r,m,c,d;return e.openBlock(),e.createElementBlock("div",pr,[(s=(a=(l=t.column)==null?void 0:l.settings)==null?void 0:a.filters)!=null&&s.length?(e.openBlock(),e.createElementBlock("svg",hr,gr)):(e.openBlock(),e.createElementBlock("svg",{key:1,class:e.normalizeClass(["w-4 h-4 transition-transform",t.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},yr,2)),((m=(r=t.column)==null?void 0:r.settings)==null?void 0:m.sort)==="ASC"?(e.openBlock(),e.createElementBlock("svg",kr,br)):((d=(c=t.column)==null?void 0:c.settings)==null?void 0:d.sort)==="DESC"?(e.openBlock(),e.createElementBlock("svg",wr,Cr)):e.createCommentVNode("",!0)])}}}),Vr=e.defineComponent({__name:"EnsureAccessDialog",props:{title:null,subtitle:null,invalidAccess:null,alertClass:null},emits:["done"],setup(t){return(o,n)=>{const l=e.resolveComponent("EnsureAccess"),a=e.resolveComponent("SlideOver");return t.invalidAccess?(e.openBlock(),e.createBlock(a,{key:0,title:t.title,onDone:n[0]||(n[0]=s=>o.$emit("done")),"content-class":"relative flex-1"},e.createSlots({default:e.withCtx(()=>[e.createVNode(l,{alertClass:t.alertClass,invalidAccess:t.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[t.subtitle?{name:"subtitle",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):e.createCommentVNode("",!0)}}}),$r=["for"],Er={class:"mt-1 relative rounded-md shadow-sm"},Br=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],_r={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Nr=[e.createElementVNode("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)],Sr=["id"],Lr=["id"],Mr={inheritAttrs:!1},Dr=e.defineComponent({...Mr,__name:"TextInput",props:{status:null,id:null,type:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null},setup(t,{expose:o}){const n=t,l=f=>f.value;o({focus:s});const a=e.ref();function s(){var f;(f=a.value)==null||f.focus()}const r=e.computed(()=>n.type||"text"),m=e.computed(()=>n.label??i.humanize(i.toPascalCase(n.id))),c=e.computed(()=>n.placeholder??m.value);let d=e.inject("ApiState",void 0);const u=e.computed(()=>i.errorResponse.call({responseStatus:n.status??(d==null?void 0:d.error.value)},n.id)),p=e.computed(()=>[Te.base,u.value?Te.invalid:Te.valid,n.inputClass]);return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([f.$attrs.class])},[e.unref(m)?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:e.normalizeClass(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${t.labelClass??""}`)},e.toDisplayString(e.unref(m)),11,$r)):e.createCommentVNode("",!0),e.createElementVNode("div",Er,[e.createElementVNode("input",e.mergeProps({ref_key:"txtInput",ref:a,type:e.unref(r),name:t.id,id:t.id,class:e.unref(p),placeholder:e.unref(c),value:t.modelValue,onInput:g[0]||(g[0]=k=>f.$emit("update:modelValue",l(k.target))),"aria-invalid":e.unref(u)!=null,"aria-describedby":`${t.id}-error`,step:"any"},e.unref(i.omit)(f.$attrs,["class"])),null,16,Br),e.unref(u)?(e.openBlock(),e.createElementBlock("div",_r,Nr)):e.createCommentVNode("",!0)]),e.unref(u)?(e.openBlock(),e.createElementBlock("p",{key:1,class:"mt-2 text-sm text-red-500",id:`${t.id}-error`},e.toDisplayString(e.unref(u)),9,Sr)):t.help?(e.openBlock(),e.createElementBlock("p",{key:2,class:"mt-2 text-sm text-gray-500",id:`${t.id}-description`},e.toDisplayString(t.help),9,Lr)):e.createCommentVNode("",!0)],2))}}),Ar=["for"],zr={class:"mt-1 relative rounded-md shadow-sm"},Tr=["name","id","placeholder","aria-invalid","aria-describedby"],Pr=["id"],Fr=["id"],Ir={inheritAttrs:!1},jr=e.defineComponent({...Ir,__name:"TextareaInput",props:{status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null},setup(t){const o=t,n=c=>c.value,l=e.computed(()=>o.label??i.humanize(i.toPascalCase(o.id))),a=e.computed(()=>o.placeholder??l.value);let s=e.inject("ApiState",void 0);const r=e.computed(()=>i.errorResponse.call({responseStatus:o.status??(s==null?void 0:s.error.value)},o.id)),m=e.computed(()=>["shadow-sm "+Te.base,r.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+Te.valid,o.inputClass]);return(c,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([c.$attrs.class])},[e.unref(l)?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:e.normalizeClass(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${t.labelClass??""}`)},e.toDisplayString(e.unref(l)),11,Ar)):e.createCommentVNode("",!0),e.createElementVNode("div",zr,[e.createElementVNode("textarea",e.mergeProps({name:t.id,id:t.id,class:e.unref(m),placeholder:e.unref(a),onInput:d[0]||(d[0]=u=>c.$emit("update:modelValue",n(u.target))),"aria-invalid":e.unref(r)!=null,"aria-describedby":`${t.id}-error`},e.unref(i.omit)(c.$attrs,["class"])),e.toDisplayString(t.modelValue),17,Tr)]),e.unref(r)?(e.openBlock(),e.createElementBlock("p",{key:1,class:"mt-2 text-sm text-red-500",id:`${t.id}-error`},e.toDisplayString(e.unref(r)),9,Pr)):t.help?(e.openBlock(),e.createElementBlock("p",{key:2,class:"mt-2 text-sm text-gray-500",id:`${t.id}-description`},e.toDisplayString(t.help),9,Fr)):e.createCommentVNode("",!0)],2))}}),Or=["for"],Rr=["id","name","value","aria-invalid","aria-describedby"],Hr=["value"],Ur=["id"],qr={inheritAttrs:!1},Qr=e.defineComponent({...qr,__name:"SelectInput",props:{status:null,id:null,modelValue:null,inputClass:null,label:null,labelClass:null,options:null,values:null,entries:null},setup(t){const o=t,n=m=>m.value,l=e.computed(()=>o.label??i.humanize(i.toPascalCase(o.id)));let a=e.inject("ApiState",void 0);const s=e.computed(()=>i.errorResponse.call({responseStatus:o.status??(a==null?void 0:a.error.value)},o.id)),r=e.computed(()=>o.entries||(o.values?o.values.map(m=>({key:m,value:m})):o.options?Object.keys(o.options).map(m=>({key:m,value:o.options[m]})):[]));return(m,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([m.$attrs.class])},[e.unref(l)?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:e.normalizeClass(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${t.labelClass??""}`)},e.toDisplayString(e.unref(l)),11,Or)):e.createCommentVNode("",!0),e.createElementVNode("select",e.mergeProps({id:t.id,name:t.id,class:["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600",e.unref(s)?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",t.inputClass],value:t.modelValue,onInput:c[0]||(c[0]=d=>m.$emit("update:modelValue",n(d.target))),"aria-invalid":e.unref(s)!=null,"aria-describedby":`${t.id}-error`},e.unref(i.omit)(m.$attrs,["class"])),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),d=>(e.openBlock(),e.createElementBlock("option",{value:d.key},e.toDisplayString(d.value),9,Hr))),256))],16,Rr),e.unref(s)?(e.openBlock(),e.createElementBlock("p",{key:1,class:"mt-2 text-sm text-red-500",id:`${t.id}-error`},e.toDisplayString(e.unref(s)),9,Ur)):e.createCommentVNode("",!0)],2))}}),Gr={class:"flex items-center h-5"},Kr=["id","name","checked"],Wr={class:"ml-3 text-sm"},Zr=["for"],Jr={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},Xr={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},Yr={inheritAttrs:!1},vr=e.defineComponent({...Yr,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:null,id:null,inputClass:null,label:null,labelClass:null,help:null},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,l=e.computed(()=>n.label??i.humanize(i.toPascalCase(n.id)));let a=e.inject("ApiState",void 0);const s=e.computed(()=>i.errorResponse.call({responseStatus:n.status??(a==null?void 0:a.error.value)},n.id));return(r,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex items-start",r.$attrs.class])},[e.createElementVNode("div",Gr,[e.createElementVNode("input",e.mergeProps({id:t.id,name:t.id,type:"checkbox",checked:t.modelValue,onInput:m[0]||(m[0]=c=>r.$emit("update:modelValue",c.target.checked)),class:["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",t.inputClass]},e.unref(i.omit)(r.$attrs,["class"])),null,16,Kr)]),e.createElementVNode("div",Wr,[e.createElementVNode("label",{for:t.id,class:e.normalizeClass(`font-medium text-gray-700 dark:text-gray-300 ${t.labelClass??""}`)},e.toDisplayString(e.unref(l)),11,Zr),e.unref(s)?(e.openBlock(),e.createElementBlock("p",Jr,e.toDisplayString(e.unref(s)),1)):t.help?(e.openBlock(),e.createElementBlock("p",Xr,e.toDisplayString(t.help),1)):e.createCommentVNode("",!0)])],2))}}),ei=["id"],ti=["for"],ni={class:"mt-1 relative rounded-md shadow-sm"},oi=["id","name","value"],li=["onClick"],ai={class:"flex flex-wrap pb-1.5"},si={class:"pt-1.5 pl-1"},ri={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},ii=["onClick"],ci=[e.createElementVNode("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1)],di={class:"pt-1.5 pl-1 shrink"},mi=["type","name","id","aria-invalid","aria-describedby","onPaste"],fi=["id"],ui=["onMouseover","onClick"],pi={class:"block truncate"},hi={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},gi=[e.createElementVNode("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)],yi=["id"],ki=["id"],bi={inheritAttrs:!1},wi=e.defineComponent({...bi,__name:"TagInput",props:{status:null,id:null,type:null,inputClass:null,label:null,labelClass:null,help:null,modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:null,string:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,l=e.computed(()=>typeof n.modelValue=="string"?n.modelValue.trim().length==0?[]:n.modelValue.split(","):n.modelValue||[]),a=e.ref(),s=e.ref(!1),r=e.computed(()=>!n.allowableValues||n.allowableValues.length==0?[]:n.allowableValues.filter(h=>!l.value.includes(h)&&h.toLowerCase().includes(d.value.toLowerCase())));function m(h){a.value=h}const c=e.ref(null),d=e.ref(""),u=e.computed(()=>n.type||"text"),p=e.computed(()=>n.label??i.humanize(i.toPascalCase(n.id)));let f=e.inject("ApiState",void 0);const g=e.computed(()=>i.errorResponse.call({responseStatus:n.status??(f==null?void 0:f.error.value)},n.id)),k=e.computed(()=>["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",g.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",n.inputClass]),w=h=>b(l.value.filter($=>$!=h));function V(h){var $;document.activeElement===h.target&&(($=c.value)==null||$.focus())}const S=e.ref();function T(){s.value=!0,S.value=!0}function F(){T()}function I(){O(M()),S.value=!1,setTimeout(()=>{S.value||(s.value=!1)},200)}function b(h){const $=n.string?h.join(","):h;o("update:modelValue",$)}function L(h){if(h.key=="Backspace"&&d.value.length==0&&l.value.length>0&&w(l.value[l.value.length-1]),!(!n.allowableValues||n.allowableValues.length==0))if(h.code=="Escape"||h.code=="Tab")s.value=!1;else if(h.code=="Home")a.value=r.value[0],A();else if(h.code=="End")a.value=r.value[r.value.length-1],A();else if(h.code=="ArrowDown"){if(s.value=!0,!a.value)a.value=r.value[0];else{const $=r.value.indexOf(a.value);a.value=$+1<r.value.length?r.value[$+1]:r.value[0]}j()}else if(h.code=="ArrowUp"){if(!a.value)a.value=r.value[r.value.length-1];else{const $=r.value.indexOf(a.value);a.value=$-1>=0?r.value[$-1]:r.value[r.value.length-1]}j()}else h.code=="Enter"?a.value&&s.value?(O(a.value),h.preventDefault()):s.value=!1:s.value=r.value.length>0}function M(){if(d.value.length==0)return"";let h=i.trimEnd(d.value.trim(),",");return h[0]==","&&(h=h.substring(1)),h=h.trim(),h.length==0&&s.value&&r.value.length>0?a.value:h}function N(h){const $=M();if($.length>0){const G=n.delimiters.some(_=>_==h.key);if(G&&h.preventDefault(),h.key=="Enter"||h.key=="NumpadEnter"||h.key.length==1&&G){O($);return}}}const B={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function A(){setTimeout(()=>{let h=i.$1(`#${n.id}-tag li.active`);h&&h.scrollIntoView(B)},0)}function j(){setTimeout(()=>{let h=i.$1(`#${n.id}-tag li.active`);h&&("scrollIntoViewIfNeeded"in h?h.scrollIntoViewIfNeeded(B):h.scrollIntoView(B))},0)}function O(h){if(h.length===0)return;const $=Array.from(l.value);$.indexOf(h)==-1&&$.push(h),b($),d.value="",s.value=!1}function Q(h){var G;const $=(G=h.clipboardData)==null?void 0:G.getData("Text");E($)}function E(h){if(!h)return;const $=new RegExp(`\\n|\\t|${n.delimiters.join("|")}`),G=Array.from(l.value);h.split($).map(_=>_.trim()).forEach(_=>{G.indexOf(_)==-1&&G.push(_)}),b(G),d.value=""}return(h,$)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([h.$attrs.class]),id:`${t.id}-tag`,onmousemove:"cancelBlur=true"},[e.unref(p)?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:e.normalizeClass(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${t.labelClass??""}`)},e.toDisplayString(e.unref(p)),11,ti)):e.createCommentVNode("",!0),e.createElementVNode("div",ni,[e.createElementVNode("input",{type:"hidden",id:t.id,name:t.id,value:e.unref(l).join(",")},null,8,oi),e.createElementVNode("button",{class:e.normalizeClass(e.unref(k)),onClick:e.withModifiers(V,["prevent"]),onFocus:$[2]||($[2]=G=>s.value=!0),tabindex:"-1"},[e.createElementVNode("div",ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),G=>(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("span",ri,[e.createTextVNode(e.toDisplayString(G)+" ",1),e.createElementVNode("button",{type:"button",onClick:x=>w(G),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},ci,8,ii)])]))),256)),e.createElementVNode("div",di,[e.withDirectives(e.createElementVNode("input",e.mergeProps({ref_key:"txtInput",ref:c,type:e.unref(u),role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:t.id,id:t.id,class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${d.value.length+1}ch`,"onUpdate:modelValue":$[0]||($[0]=G=>d.value=G),"aria-invalid":e.unref(g)!=null,"aria-describedby":`${t.id}-error`,onKeydown:L,onKeypress:N,onPaste:e.withModifiers(Q,["prevent","stop"]),onFocus:F,onBlur:I,onClick:$[1]||($[1]=G=>s.value=!0)},e.unref(i.omit)(h.$attrs,["class"])),null,16,mi),[[e.vModelDynamic,d.value]])])])],42,li),s.value&&e.unref(r).length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:L,id:`${t.id}-options`,role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),G=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([G===a.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:x=>m(G),onClick:x=>O(G),role:"option",tabindex:"-1"},[e.createElementVNode("span",pi,e.toDisplayString(G),1)],42,ui))),256))],40,fi)):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("div",hi,gi)):e.createCommentVNode("",!0)]),e.unref(g)?(e.openBlock(),e.createElementBlock("p",{key:1,class:"mt-2 text-sm text-red-500",id:`${t.id}-error`},e.toDisplayString(e.unref(g)),9,yi)):t.help?(e.openBlock(),e.createElementBlock("p",{key:2,class:"mt-2 text-sm text-gray-500",id:`${t.id}-description`},e.toDisplayString(t.help),9,ki)):e.createCommentVNode("",!0)],10,ei))}}),Ci={class:"relative w-full"},xi=["for"],Vi={class:"block mt-2"},$i=e.createElementVNode("span",{class:"sr-only"},"help ?? useLabel",-1),Ei=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],Bi={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},_i=[e.createElementVNode("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)],Ni=["id"],Si=["id"],Li={key:0},Mi=["title"],Di=["alt","src"],Ai={key:1,class:"mt-3"},zi={class:"w-full"},Ti={class:"pr-6 align-bottom pb-2"},Pi=["title"],Fi=["src","onError"],Ii=["href"],ji={key:1,class:"overflow-hidden"},Oi={class:"align-top pb-2 whitespace-nowrap"},Ri={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},Hi=e.defineComponent({__name:"FileInput",props:{multiple:{type:Boolean},status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null,values:null,files:null},setup(t){var I;const o=t,n=e.ref(null),{assetsPathResolver:l,fallbackPathResolver:a}=Fe(),s={},r=e.ref(),m=e.ref(((I=o.files)==null?void 0:I.map(c))||[]);function c(b){return b.filePath=l(b.filePath),b}o.values&&o.values.length>0&&(m.value=o.values.map(b=>{let L=b.replace(/\\/g,"/");return{fileName:i.lastLeftPart(i.lastRightPart(L,"/"),"."),filePath:L,contentType:Wt(L)}}).map(c));const d=e.computed(()=>o.label??i.humanize(i.toPascalCase(o.id))),u=e.computed(()=>o.placeholder??d.value);let p=e.inject("ApiState",void 0);const f=e.computed(()=>i.errorResponse.call({responseStatus:o.status??(p==null?void 0:p.error.value)},o.id)),g=e.computed(()=>["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",f.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",o.inputClass]),k=b=>{let L=b.target;r.value="",m.value=Array.from(L.files||[]).map(M=>({fileName:M.name,filePath:qt(M),contentLength:M.size,contentType:M.type||Wt(M.name)}))},w=()=>{var b;return(b=n.value)==null?void 0:b.click()},V=b=>b==null?!1:b.startsWith("data:")||b.startsWith("blob:"),S=e.computed(()=>{if(m.value.length>0)return m.value[0].filePath;let b=typeof o.modelValue=="string"?o.modelValue:o.values&&o.values[0];return b&&Re(l(b))||null}),T=b=>!b||b.startsWith("data:")||b.endsWith(".svg")?"":"rounded-full object-cover";function F(b){r.value=a(S.value)}return e.onUnmounted(Sn),(b,L)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex",t.multiple?"flex-col":"justify-between"])},[e.createElementVNode("div",Ci,[e.unref(d)?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:e.normalizeClass(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${t.labelClass??""}`)},e.toDisplayString(e.unref(d)),11,xi)):e.createCommentVNode("",!0),e.createElementVNode("div",Vi,[$i,e.createElementVNode("input",e.mergeProps({ref_key:"input",ref:n,type:"file",multiple:t.multiple,name:t.id,id:t.id,class:e.unref(g),placeholder:e.unref(u),"aria-invalid":e.unref(f)!=null,"aria-describedby":`${t.id}-error`},b.$attrs,{onChange:k}),null,16,Ei),e.unref(f)?(e.openBlock(),e.createElementBlock("div",Bi,_i)):e.createCommentVNode("",!0)]),e.unref(f)?(e.openBlock(),e.createElementBlock("p",{key:1,class:"mt-2 text-sm text-red-500",id:`${t.id}-error`},e.toDisplayString(e.unref(f)),9,Ni)):t.help?(e.openBlock(),e.createElementBlock("p",{key:2,class:"mt-2 text-sm text-gray-500",id:`${t.id}-description`},e.toDisplayString(t.help),9,Si)):e.createCommentVNode("",!0)]),t.multiple?(e.openBlock(),e.createElementBlock("div",Ai,[e.createElementVNode("table",zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,M=>(e.openBlock(),e.createElementBlock("tr",null,[e.createElementVNode("td",Ti,[e.createElementVNode("div",{class:"flex w-full",title:V(M.filePath)?"":M.filePath},[e.createElementVNode("img",{src:s[e.unref(Re)(M.filePath)]||e.unref(l)(e.unref(Re)(M.filePath)),class:e.normalizeClass(["mr-2 h-8 w-8",T(M.filePath)]),onError:N=>s[e.unref(Re)(M.filePath)]=e.unref(a)(e.unref(Re)(M.filePath))},null,42,Fi),V(M.filePath)?(e.openBlock(),e.createElementBlock("span",ji,e.toDisplayString(M.fileName),1)):(e.openBlock(),e.createElementBlock("a",{key:0,href:e.unref(l)(M.filePath||""),target:"_blank",class:"overflow-hidden"},e.toDisplayString(M.fileName),9,Ii))],8,Pi)]),e.createElementVNode("td",Oi,[M.contentLength&&M.contentLength>0?(e.openBlock(),e.createElementBlock("span",Ri,e.toDisplayString(e.unref(Gt)(M.contentLength)),1)):e.createCommentVNode("",!0)])]))),256))])])):(e.openBlock(),e.createElementBlock("div",Li,[e.unref(S)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"shrink-0 cursor-pointer",title:V(e.unref(S))?"":e.unref(S)},[e.createElementVNode("img",{onClick:w,class:e.normalizeClass(["h-16 w-16",T(e.unref(S))]),alt:`Current ${e.unref(d)}`,src:r.value||e.unref(l)(e.unref(S)),onError:F},null,42,Di)],8,Mi)):e.createCommentVNode("",!0)]))],2))}}),Ui=["id"],qi=["for"],Qi={class:"relative mt-1"},Gi=["id","placeholder"],Ki=[e.createElementVNode("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z","clip-rule":"evenodd"})],-1)],Wi=["id"],Zi=["onMouseover","onClick"],Ji=[e.createElementVNode("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"})],-1)],Xi={key:2,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",tabindex:"-1"},Yi=[e.createElementVNode("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)],vi=["id"],ec=["id"],tc=e.defineComponent({__name:"Autocomplete",props:{status:null,id:null,type:null,label:null,help:null,placeholder:null,multiple:{type:Boolean,default:!1},options:{default:()=>[]},modelValue:null,match:null,viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(t,{expose:o,emit:n}){const l=t,a=e.ref(!1);o({toggle:A});function s(E){return Array.isArray(l.modelValue)&&l.modelValue.indexOf(E)>=0}const r=e.computed(()=>l.label??i.humanize(i.toPascalCase(l.id)));let m=e.inject("ApiState",void 0);const c=e.computed(()=>i.errorResponse.call({responseStatus:l.status??(m==null?void 0:m.error.value)},l.id)),d=e.computed(()=>[Te.base,c.value?Te.invalid:Te.valid]),u=e.ref(null),p=e.ref(""),f=e.ref(null),g=e.ref(l.viewCount),k=e.ref([]),w=e.computed(()=>p.value?l.options.filter(h=>l.match(h,p.value)).slice(0,g.value):l.options),V=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];function S(E){f.value=E,k.value.indexOf(E)>Math.floor(g.value*.9)&&(g.value+=l.viewCount,Q())}const T=[",",`
`," "];function F(E){var $;const h=($=E.clipboardData)==null?void 0:$.getData("Text");I(h)}function I(E){if(!E)return;const h=T.some($=>E.includes($));if(!l.multiple||!h){const $=l.options.filter(G=>l.match(G,E));$.length==1&&(O($[0]),a.value=!1,gt())}else if(h){const $=new RegExp("\\r|\\n|\\t|,"),x=E.split($).filter(_=>_.trim()).map(_=>l.options.find(Y=>l.match(Y,_))).filter(_=>!!_);if(x.length>0){p.value="",a.value=!1,f.value=null;let _=Array.from(l.modelValue||[]);x.forEach(Y=>{s(Y)?_=_.filter(J=>J!=Y):_.push(Y)}),n("update:modelValue",_),gt()}}}function b(E){V.indexOf(E.code)||j()}function L(E){if(!(E.shiftKey||E.ctrlKey||E.altKey)){if(!a.value){E.code=="ArrowDown"&&(a.value=!0,f.value=k.value[0]);return}if(E.code=="Escape"||E.code=="Tab")a.value=!1;else if(E.code=="Home")f.value=k.value[0],N();else if(E.code=="End")f.value=k.value[k.value.length-1],N();else if(E.code=="ArrowDown"){if(!f.value)f.value=k.value[0];else{const h=k.value.indexOf(f.value);f.value=h+1<k.value.length?k.value[h+1]:k.value[0]}B()}else if(E.code=="ArrowUp"){if(!f.value)f.value=k.value[k.value.length-1];else{const h=k.value.indexOf(f.value);f.value=h-1>=0?k.value[h-1]:k.value[k.value.length-1]}B()}else E.code=="Enter"&&(f.value?(O(f.value),l.multiple||(E.preventDefault(),gt())):a.value=!1)}}const M={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function N(){setTimeout(()=>{let E=i.$1(`#${l.id}-autocomplete li.active`);E&&E.scrollIntoView(M)},0)}function B(){setTimeout(()=>{let E=i.$1(`#${l.id}-autocomplete li.active`);E&&("scrollIntoViewIfNeeded"in E?E.scrollIntoViewIfNeeded(M):E.scrollIntoView(M))},0)}function A(E){var h;a.value=E,E&&(j(),(h=u.value)==null||h.focus())}function j(){a.value=!0,Q()}function O(E){if(p.value="",a.value=!1,l.multiple){let h=Array.from(l.modelValue||[]);s(E)?h=h.filter($=>$!=E):h.push(E),f.value=null,n("update:modelValue",h)}else{let h=E;l.modelValue==E&&(h=null),n("update:modelValue",h)}}function Q(){k.value=w.value}return e.watch(p,Q),(E,h)=>(e.openBlock(),e.createElementBlock("div",{id:`${t.id}-autocomplete`},[e.unref(r)?(e.openBlock(),e.createElementBlock("label",{key:0,for:`${t.id}-text`,class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},e.toDisplayString(e.unref(r)),9,qi)):e.createCommentVNode("",!0),e.createElementVNode("div",Qi,[e.withDirectives(e.createElementVNode("input",e.mergeProps({ref_key:"txtInput",ref:u,id:`${t.id}-text`,type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":h[0]||(h[0]=$=>p.value=$),class:e.unref(d),placeholder:t.multiple||!t.modelValue?t.placeholder:"",onFocus:h[1]||(h[1]=$=>a.value=!0),onKeydown:L,onKeyup:b,onClick:j,onPaste:F},E.$attrs),null,16,Gi),[[e.vModelText,p.value]]),e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=$=>A(!a.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},Ki),a.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:L,id:`${t.id}-options`,role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,$=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([$===f.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:G=>S($),onClick:G=>O($),role:"option",tabindex:"-1"},[e.renderSlot(E.$slots,"item",e.normalizeProps(e.guardReactiveProps($))),s($)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["absolute inset-y-0 right-0 flex items-center pr-4",$===f.value?"text-white":"text-indigo-600"])},Ji,2)):e.createCommentVNode("",!0)],42,Zi))),256))],40,Wi)):!t.multiple&&t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:1,onKeydown:L,onClick:h[3]||(h[3]=$=>A(!a.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[e.renderSlot(E.$slots,"item",e.normalizeProps(e.guardReactiveProps(t.modelValue)))],32)):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("div",Xi,Yi)):e.createCommentVNode("",!0)]),e.unref(c)?(e.openBlock(),e.createElementBlock("p",{key:1,class:"mt-2 text-sm text-red-500",id:`${t.id}-error`},e.toDisplayString(e.unref(c)),9,vi)):t.help?(e.openBlock(),e.createElementBlock("p",{key:2,class:"mt-2 text-sm text-gray-500",id:`${t.id}-description`},e.toDisplayString(t.help),9,ec)):e.createCommentVNode("",!0)],8,Ui))}}),nc=["id","name","value"],oc={class:"block truncate"},lc=e.defineComponent({__name:"Combobox",props:{id:null,modelValue:null,multiple:{type:Boolean},options:null,values:null,entries:null},emits:["update:modelValue"],setup(t,{expose:o,emit:n}){const l=t;o({toggle(p){var f;(f=r.value)==null||f.toggle(p)}});function a(p){n("update:modelValue",p)}const s=e.computed(()=>l.multiple!=null?l.multiple:Array.isArray(l.modelValue)),r=e.ref();function m(p,f){return!f||p.value.toLowerCase().includes(f.toLowerCase())}const c=e.computed(()=>l.entries||(l.values?l.values.map(p=>({key:p,value:p})):l.options?Object.keys(l.options).map(p=>({key:p,value:l.options[p]})):[])),d=e.ref(s.value?[]:null);e.onMounted(()=>{l.modelValue==null||l.modelValue===""?d.value=s.value?[]:null:typeof l.modelValue=="string"?d.value=c.value.find(p=>p.key===l.modelValue)||null:Array.isArray(l.modelValue)&&(d.value=c.value.filter(p=>l.modelValue.includes(p.key)))});const u=e.computed(()=>d.value==null?"":Array.isArray(d.value)?d.value.map(p=>encodeURIComponent(p.key)).join(","):d.value.key);return(p,f)=>{const g=e.resolveComponent("Autocomplete");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("input",{type:"hidden",id:t.id,name:t.id,value:e.unref(u)},null,8,nc),e.createVNode(g,e.mergeProps({ref_key:"input",ref:r,id:t.id,options:e.unref(c),match:m,multiple:e.unref(s)},p.$attrs,{modelValue:d.value,"onUpdate:modelValue":[f[0]||(f[0]=k=>d.value=k),a]}),{item:e.withCtx(({key:k,value:w})=>[e.createElementVNode("span",oc,e.toDisplayString(w),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),ac=e.defineComponent({__name:"DynamicInput",props:{input:null,modelValue:null,api:null},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,l=e.computed(()=>n.input.type||"text"),a="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),s=e.computed(()=>i.omit(n.input,a)),r=e.ref(i.map(n.modelValue[n.input.id],c=>n.input.type==="file"?null:n.input.type==="date"&&c instanceof Date?ht(c):n.input.type==="time"?yn(c):c));e.watch(r,()=>{n.modelValue[n.input.id]=r.value,o("update:modelValue",n.modelValue)});const m=e.computed(()=>{const c=n.modelValue[n.input.id];if(n.input.type!=="file"||!c)return[];if(typeof c=="string")return[{filePath:c,fileName:i.lastRightPart(c,"/")}];if(!Array.isArray(c)&&typeof c=="object")return c;if(Array.isArray(c)){const d=[];return c.forEach(u=>{typeof u=="string"?d.push({filePath:u,fileName:i.lastRightPart(u,"/")}):typeof u=="object"&&d.push(u)}),d}});return(c,d)=>{var S,T,F,I,b,L,M,N,B,A,j,O,Q,E,h,$,G,x,_,Y,J,K;const u=e.resolveComponent("SelectInput"),p=e.resolveComponent("CheckboxInput"),f=e.resolveComponent("TagInput"),g=e.resolveComponent("Combobox"),k=e.resolveComponent("FileInput"),w=e.resolveComponent("TextareaInput"),V=e.resolveComponent("TextInput");return e.unref(l)=="select"?(e.openBlock(),e.createBlock(u,e.mergeProps({key:0,id:t.input.id,modelValue:r.value,"onUpdate:modelValue":d[0]||(d[0]=z=>r.value=z),status:(S=t.api)==null?void 0:S.error,"input-class":(T=t.input.css)==null?void 0:T.input,"label-class":(F=t.input.css)==null?void 0:F.label,entries:t.input.allowableEntries,values:t.input.allowableValues},e.unref(s)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):e.unref(l)=="checkbox"?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1,id:t.input.id,modelValue:r.value,"onUpdate:modelValue":d[1]||(d[1]=z=>r.value=z),status:(I=t.api)==null?void 0:I.error,"input-class":(b=t.input.css)==null?void 0:b.input,"label-class":(L=t.input.css)==null?void 0:L.label},e.unref(s)),null,16,["id","modelValue","status","input-class","label-class"])):e.unref(l)=="tag"?(e.openBlock(),e.createBlock(f,e.mergeProps({key:2,id:t.input.id,modelValue:r.value,"onUpdate:modelValue":d[2]||(d[2]=z=>r.value=z),status:(M=t.api)==null?void 0:M.error,"input-class":(N=t.input.css)==null?void 0:N.input,"label-class":(B=t.input.css)==null?void 0:B.label,allowableValues:t.input.allowableValues,string:((A=t.input.prop)==null?void 0:A.type)=="String"},e.unref(s)),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):e.unref(l)=="combobox"?(e.openBlock(),e.createBlock(g,e.mergeProps({key:3,id:t.input.id,modelValue:r.value,"onUpdate:modelValue":d[3]||(d[3]=z=>r.value=z),status:(j=t.api)==null?void 0:j.error,"input-class":(O=t.input.css)==null?void 0:O.input,"label-class":(Q=t.input.css)==null?void 0:Q.label,entries:t.input.allowableEntries,values:t.input.allowableValues},e.unref(s)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):e.unref(l)=="file"?(e.openBlock(),e.createBlock(k,e.mergeProps({key:4,id:t.input.id,status:(E=t.api)==null?void 0:E.error,modelValue:r.value,"onUpdate:modelValue":d[4]||(d[4]=z=>r.value=z),"input-class":(h=t.input.css)==null?void 0:h.input,"label-class":($=t.input.css)==null?void 0:$.label,files:e.unref(m)},e.unref(s)),null,16,["id","status","modelValue","input-class","label-class","files"])):e.unref(l)=="textarea"?(e.openBlock(),e.createBlock(w,e.mergeProps({key:5,id:t.input.id,modelValue:r.value,"onUpdate:modelValue":d[5]||(d[5]=z=>r.value=z),status:(G=t.api)==null?void 0:G.error,"input-class":(x=t.input.css)==null?void 0:x.input,"label-class":(_=t.input.css)==null?void 0:_.label},e.unref(s)),null,16,["id","modelValue","status","input-class","label-class"])):(e.openBlock(),e.createBlock(V,e.mergeProps({key:6,type:e.unref(l),id:t.input.id,modelValue:r.value,"onUpdate:modelValue":d[6]||(d[6]=z=>r.value=z),status:(Y=t.api)==null?void 0:Y.error,"input-class":(J=t.input.css)==null?void 0:J.input,"label-class":(K=t.input.css)==null?void 0:K.label},e.unref(s)),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),sc={class:"lookup-field"},rc=["name","value"],ic={key:0,class:"flex justify-between"},cc=["for"],dc={key:0,class:"flex items-center"},mc={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},fc=[e.createElementVNode("span",{class:"sr-only"},"Clear",-1),e.createElementVNode("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)],uc={key:1,class:"mt-1 relative"},pc={class:"w-full inline-flex truncate"},hc={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},gc=e.createElementVNode("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[e.createElementVNode("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1),yc=["id"],kc=["id"],bc=e.defineComponent({__name:"LookupInput",props:{id:null,status:null,input:null,metadataType:null,modelValue:null,label:null,labelClass:null,help:null},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,{config:l}=Fe(),{metadataApi:a}=Ee(),s=e.computed(()=>n.id||n.input.id),r=e.computed(()=>n.label??i.humanize(i.toPascalCase(s.value)));let m=e.inject("ApiState",void 0);const c=e.inject("client"),d=e.computed(()=>i.errorResponse.call({responseStatus:n.status??(m==null?void 0:m.error.value)},s.value)),u=e.ref(""),p=e.ref(""),f=e.computed(()=>i.mapGet(n.modelValue,s.value)),g=e.computed(()=>$e(n.metadataType).find(T=>T.name.toLowerCase()==s.value.toLowerCase())),k=e.computed(()=>{var T,F,I;return((I=ze((F=(T=g.value)==null?void 0:T.ref)==null?void 0:F.model))==null?void 0:I.icon)||l.value.tableIcon});let w;function V(T){if(T){if(w==null){console.warn("No ModalProvider required by LookupInput");return}w.openModal({name:"ModalLookup",ref:T},F=>{if(console.debug("openModal",u.value," -> ",F,He.setRefValue(T,F),T),F){const I=i.mapGet(F,T.refId);u.value=He.setRefValue(T,F)||I;const b=e.unref(n.modelValue);b[s.value]=I,o("update:modelValue",b)}})}}function S(){n.modelValue[s.value]=null,u.value=""}return e.onMounted(async()=>{var N,B;w=e.inject("ModalProvider",void 0);const T=n.modelValue;n.modelValue[s.value]||(n.modelValue[s.value]=null);const F=g.value,I=F==null?void 0:F.ref;if(!I){console.warn(`No RefInfo for property '${s.value}'`);return}u.value="";let b=I.selfId==null?i.mapGet(T,F.name):i.mapGet(T,I.selfId);if(tt(b)&&(b=i.mapGet(T,I.refId)),b==null)return;if(((N=a.value)==null?void 0:N.operations.find(A=>{var j;return((j=A.dataModel)==null?void 0:j.name)==I.model}))!=null){const A=i.mapGet(T,F.name);if(tt(A))return;if(u.value=`${A}`,p.value=F.name,I.refLabel!=null){const j=$e(n.metadataType).find(Q=>Q.type==I.model);j==null&&console.warn(`Could not find ${I.model} Property on ${n.metadataType.name}`);const O=j!=null?i.mapGet(T,j.name):null;if(O!=null){let Q=i.mapGet(O,I.refLabel);Q&&(u.value=`${Q}`,He.setValue(I.model,b,I.refLabel,Q))}else{const Q=((B=F.attributes)==null?void 0:B.some(h=>h.name=="Computed"))==!0;let E=await He.getOrFetchValue(c,a.value,I.model,I.refId,I.refLabel,Q,b);u.value=E||`${I.model}: ${u.value}`}}}}),(T,F)=>{var b;const I=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("input",{type:"hidden",name:e.unref(s),value:e.unref(f)},null,8,rc),e.unref(r)?(e.openBlock(),e.createElementBlock("div",ic,[e.createElementVNode("label",{for:e.unref(s),class:e.normalizeClass(`block text-sm font-medium text-gray-700 dark:text-gray-300 ${t.labelClass??""}`)},e.toDisplayString(e.unref(r)),11,cc),e.unref(f)?(e.openBlock(),e.createElementBlock("div",dc,[e.createElementVNode("span",mc,e.toDisplayString(e.unref(f)),1),e.createElementVNode("button",{onClick:S,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},fc)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(b=e.unref(g))!=null&&b.ref?(e.openBlock(),e.createElementBlock("div",uc,[e.createElementVNode("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:F[0]||(F[0]=L=>V(e.unref(g).ref)),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[e.createElementVNode("span",pc,[e.createElementVNode("span",hc,[e.createVNode(I,{class:"mr-1 w-5 h-5",image:e.unref(k)},null,8,["image"]),e.createElementVNode("span",null,e.toDisplayString(u.value),1)])]),gc])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("p",{key:2,class:"mt-2 text-sm text-red-500",id:`${e.unref(s)}-error`},e.toDisplayString(e.unref(d)),9,yc)):t.help?(e.openBlock(),e.createElementBlock("p",{key:3,class:"mt-2 text-sm text-gray-500",id:`${e.unref(s)}-description`},e.toDisplayString(t.help),9,kc)):e.createCommentVNode("",!0)])}}}),wc=e.defineComponent({__name:"AutoFormFields",props:{modelValue:null,type:null,api:null,formLayout:null,configureField:null,hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t;function l(w,V){n.modelValue[w.id]=i.mapGet(V,w.id),o("update:modelValue",n.modelValue)}const{metadataApi:a,apiOf:s,typeOf:r,typeOfRef:m,createFormLayout:c,Crud:d}=Ee(),u=e.computed(()=>n.type||Ke(n.modelValue)),p=e.computed(()=>r(u.value)),f=e.computed(()=>{var w,V;return m((V=(w=a.value)==null?void 0:w.operations.find(S=>S.request.name==u.value))==null?void 0:V.dataModel)||p.value}),g=e.computed(()=>{const w=p.value;if(!w){if(n.formLayout)return n.formLayout.map(b=>{const L={name:b.id,type:fl(b.type)},M=Object.assign({prop:L},b);return n.configureField&&n.configureField(M),M});throw new Error(`MetadataType for ${u.value} not found`)}const V=$e(w),S=f.value,T=n.formLayout?n.formLayout:c(w),F=[],I=s(w.name);return T.forEach(b=>{var B;const L=V.find(A=>A.name==b.name);if(b.ignore)return;const M=((B=S==null?void 0:S.properties)==null?void 0:B.find(A=>{var j;return A.name.toLowerCase()==((j=b.name)==null?void 0:j.toLowerCase())}))??L,N=Object.assign({prop:M,op:I},b);n.configureField&&n.configureField(N),F.push(N)}),F}),k=e.computed(()=>g.value.filter(w=>w.type!="hidden").map(w=>w.id));return(w,V)=>{var I;const S=e.resolveComponent("ErrorSummary"),T=e.resolveComponent("LookupInput"),F=e.resolveComponent("DynamicInput");return e.openBlock(),e.createElementBlock(e.Fragment,null,[t.hideSummary?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(S,{key:0,status:(I=t.api)==null?void 0:I.error,except:e.unref(k)},null,8,["status","except"])),e.createElementVNode("div",{class:e.normalizeClass(t.flexClass)},[e.createElementVNode("div",{class:e.normalizeClass(t.divideClass)},[e.createElementVNode("div",{class:e.normalizeClass(t.spaceClass)},[e.createElementVNode("fieldset",{class:e.normalizeClass(t.fieldsetClass)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),b=>{var L,M,N;return e.openBlock(),e.createElementBlock("div",{key:"f.id",class:e.normalizeClass(["w-full",((L=b.css)==null?void 0:L.field)??(b.type=="textarea"?"col-span-12":"col-span-12 xl:col-span-6"+(b.type=="checkbox"?" flex items-center":"")),b.type=="hidden"?"hidden":""])},[((M=b.prop)==null?void 0:M.ref)!=null&&b.type!="file"&&!b.prop.isPrimaryKey?(e.openBlock(),e.createBlock(T,{key:0,metadataType:e.unref(f),input:b,modelValue:t.modelValue,"onUpdate:modelValue":B=>l(b,B),status:(N=t.api)==null?void 0:N.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"])):(e.openBlock(),e.createBlock(F,{key:1,input:b,modelValue:t.modelValue,"onUpdate:modelValue":V[0]||(V[0]=B=>w.$emit("update:modelValue",B)),api:t.api},null,8,["input","modelValue","api"]))],2)}),128))],2)],2)],2)],2)],64)}}});function it(){const t=e.ref(!1),o=e.ref(),n=e.ref(),l=e.inject("client");function a({message:f,errorCode:g,fieldName:k,errors:w}){return g||(g="Exception"),w||(w=[]),o.value=k?new i.ResponseStatus({errorCode:g,message:f,errors:[new i.ResponseError({fieldName:k,errorCode:g,message:f})]}):new i.ResponseStatus({errorCode:g,message:f,errors:w})}function s({fieldName:f,message:g,errorCode:k}){if(k||(k="Exception"),!o.value)a({fieldName:f,message:g,errorCode:k});else{let w=new i.ResponseStatus(o.value);w.errors=[...(w.errors||[]).filter(V=>{var S;return((S=V.fieldName)==null?void 0:S.toLowerCase())!==(f==null?void 0:f.toLowerCase())}),new i.ResponseError({fieldName:f,message:g,errorCode:k})],o.value=w}}async function r(f,g,k){t.value=!0;let w=await l.api(Qe(f),g,k);return t.value=!1,n.value=w.response,o.value=w.error,w}async function m(f,g,k){t.value=!0;let w=await l.apiVoid(Qe(f),g,k);return t.value=!1,n.value=w.response,o.value=w.error,w}async function c(f,g,k,w){t.value=!0;let V=await l.apiForm(Qe(f),g,k,w);return t.value=!1,n.value=V.response,o.value=V.error,V}async function d(f,g,k,w){t.value=!0;let V=await l.apiFormVoid(Qe(f),g,k,w);return t.value=!1,n.value=V.response,o.value=V.error,V}async function u(f,g,k,w){return Cn(l,f,g,k,w)}let p={setError:a,addFieldError:s,loading:t,error:o,api:r,apiVoid:m,apiForm:c,apiFormVoid:d,swr:u,unRefs:Qe,setRef:kn};return e.provide("ApiState",p),p}const Cc=["onSubmit"],xc={key:0},Vc={key:2},$c=["innerHTML"],Ec=e.createElementVNode("input",{type:"submit",class:"hidden"},null,-1),Bc={class:"flex justify-end"},_c=e.createElementVNode("div",null,null,-1),Nc=e.defineComponent({__name:"AutoForm",props:{type:null,modelValue:null,heading:null,subHeading:null,showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},configureField:null,bodyClass:null,formClass:{default:"shadow sm:rounded-md"},innerFormClass:null,headerClass:{default:"p-6"},buttonsClass:null,headingClass:null,subHeadingClass:null,submitLabel:{default:"Submit"}},emits:["success","error","update:modelValue"],setup(t,{emit:o}){const n=t,l={openModal:r};e.provide("ModalProvider",l);const a=e.ref(),s=e.ref();function r(B,A){a.value=B,s.value=A}async function m(B){s.value&&s.value(B),a.value=void 0,s.value=void 0}const c=it(),{getTypeName:d}=xn(),{typeOf:u,Crud:p,createDto:f}=Ee(),g=e.ref(new i.ApiResult),k=e.computed(()=>typeof n.buttonsClass=="string"?n.formClass:Ce.buttonsClass),w=e.computed(()=>typeof n.headingClass=="string"?n.formClass:Ue.headingClass),V=e.computed(()=>typeof n.subHeadingClass=="string"?n.subHeadingClass:Ue.subHeadingClass),S=e.computed(()=>{var B;return n.type?d(n.type):(B=n.modelValue)!=null&&B.getTypeName?n.modelValue.getTypeName():null}),T=e.computed(()=>u(S.value)),F=e.ref(n.modelValue||L()),I=e.computed(()=>c.loading.value),b=e.computed(()=>{var B;return n.heading||((B=u(S.value))==null?void 0:B.description)||i.humanize(S.value)});function L(){return typeof n.type=="string"?f(n.type):n.type?new n.type:n.modelValue}async function M(B){let A=B.target;const j=L();let O=i.map(j==null?void 0:j.getMethod,h=>typeof h=="function"?h():null)||"POST",Q=i.map(j==null?void 0:j.createResponse,h=>typeof h=="function"?h():null)==null;const E=n.jsconfig;if(i.HttpMethods.hasRequestBody(O)){let h=new j.constructor,$=new FormData(A);console.debug("AutoForm.submitForm",h,$),Q?g.value=await c.apiFormVoid(h,$,{jsconfig:E}):g.value=await c.apiForm(h,$,{jsconfig:E})}else{let h=new j.constructor(F.value);console.debug("AutoForm.submit",h),Q?g.value=await c.apiVoid(h,{jsconfig:E}):g.value=await c.api(h,{jsconfig:E})}g.value.succeeded?o("success",g.value.response):o("error",g.value.error)}function N(B){o("update:modelValue",B)}return(B,A)=>{var h,$,G;const j=e.resolveComponent("AutoFormFields"),O=e.resolveComponent("FormLoading"),Q=e.resolveComponent("PrimaryButton"),E=e.resolveComponent("ModalLookup");return e.unref(T)?(e.openBlock(),e.createElementBlock("form",{key:0,onSubmit:e.withModifiers(M,["prevent"]),autocomplete:"off",class:e.normalizeClass(t.formClass)},[e.createElementVNode("div",{class:e.normalizeClass(t.innerFormClass)},[e.createElementVNode("div",{class:e.normalizeClass(t.bodyClass)},[e.createElementVNode("div",{class:e.normalizeClass(t.headerClass)},[B.$slots.heading?(e.openBlock(),e.createElementBlock("div",xc,[e.renderSlot(B.$slots,"heading")])):(e.openBlock(),e.createElementBlock("h3",{key:1,class:e.normalizeClass(e.unref(w))},e.toDisplayString(e.unref(b)),3)),B.$slots.subheading?(e.openBlock(),e.createElementBlock("div",Vc,[e.renderSlot(B.$slots,"subheading")])):t.subHeading?(e.openBlock(),e.createElementBlock("p",{key:3,class:e.normalizeClass(e.unref(V))},e.toDisplayString(t.subHeading),3)):(h=e.unref(T))!=null&&h.notes?(e.openBlock(),e.createElementBlock("p",{key:4,class:e.normalizeClass(["notes",e.unref(V)]),innerHTML:($=e.unref(T))==null?void 0:$.notes},null,10,$c)):e.createCommentVNode("",!0)],2),e.renderSlot(B.$slots,"header"),Ec,e.createVNode(j,{type:t.type,modelValue:F.value,"onUpdate:modelValue":N,api:g.value,configureField:t.configureField},null,8,["type","modelValue","api","configureField"]),e.renderSlot(B.$slots,"footer")],2),e.renderSlot(B.$slots,"buttons",{},()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(k))},[e.createElementVNode("div",null,[t.showLoading&&e.unref(I)?(e.openBlock(),e.createBlock(O,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bc,[_c,e.createVNode(Q,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.submitLabel),1)]),_:1})])],2)])],2),((G=a.value)==null?void 0:G.name)=="ModalLookup"&&a.value.ref?(e.openBlock(),e.createBlock(E,{key:0,"ref-info":a.value.ref,onDone:m},null,8,["ref-info"])):e.createCommentVNode("",!0)],42,Cc)):e.createCommentVNode("",!0)}}}),Sc={key:0},Lc={class:"text-red-700"},Mc=e.createElementVNode("b",null,"type",-1),Dc=["onSubmit"],Ac={key:0},zc={key:2},Tc=["innerHTML"],Pc={class:"flex justify-end"},Fc={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Ic=e.createElementVNode("div",{class:"fixed inset-0"},null,-1),jc={class:"fixed inset-0 overflow-hidden"},Oc=["onSubmit"],Rc={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Hc={class:"flex-1"},Uc={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},qc={class:"flex items-start justify-between space-x-3"},Qc={class:"space-y-1"},Gc={key:0},Kc={key:2},Wc=["innerHTML"],Zc={class:"flex h-7 items-center"},Jc={class:"flex justify-end"},Xc=e.defineComponent({__name:"AutoCreateForm",props:{type:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,buttonsClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:null},emits:["done","save","error"],setup(t,{emit:o}){const n=t;function l(x){}const a={openModal:m};e.provide("ModalProvider",a);const s=e.ref(),r=e.ref();function m(x,_){s.value=x,r.value=_}async function c(x){r.value&&r.value(x),s.value=void 0,r.value=void 0}const{typeOf:d,typeProperties:u,Crud:p,createDto:f,formValues:g}=Ee(),k=e.computed(()=>Ke(n.type)),w=e.computed(()=>d(k.value)),V=e.ref(typeof n.type=="string"?f(n.type):n.type?new n.type:null),S=e.computed(()=>n.panelClass||Ce.panelClass(n.formStyle)),T=e.computed(()=>n.formClass||Ce.formClass(n.formStyle)),F=e.computed(()=>n.headingClass||Ce.headingClass(n.formStyle)),I=e.computed(()=>n.subHeadingClass||Ce.subHeadingClass(n.formStyle)),b=e.computed(()=>n.buttonsClass||Ce.buttonsClass),L=e.computed(()=>p.model(w.value)),M=e.computed(()=>{var x;return n.heading||((x=d(k.value))==null?void 0:x.description)||(L.value?`New ${i.humanize(L.value)}`:i.humanize(k.value))}),N=e.ref(new i.ApiResult);let B=it(),A=e.computed(()=>B.loading.value);async function j(x){var K,z;let _=x.target;if(!n.autosave){o("save",new V.value.constructor(g(_,u(w.value))));return}let Y=i.map((K=V.value)==null?void 0:K.getMethod,H=>typeof H=="function"?H():null)||"POST",J=i.map((z=V.value)==null?void 0:z.createResponse,H=>typeof H=="function"?H():null)==null;if(i.HttpMethods.hasRequestBody(Y)){let H=new V.value.constructor,ne=new FormData(_);J?N.value=await B.apiFormVoid(H,ne,{jsconfig:"eccn"}):N.value=await B.apiForm(H,ne,{jsconfig:"eccn"})}else{let H=g(_,u(w.value)),ne=new V.value.constructor(H);J?N.value=await B.apiVoid(ne,{jsconfig:"eccn"}):N.value=await B.api(ne,{jsconfig:"eccn"})}N.value.succeeded?(_.reset(),o("save",N.value.response)):o("error",N.value.error)}function O(){o("done")}const Q=e.ref(!1),E=e.ref(""),h={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};e.watch(Q,()=>{Ge(h,E,Q.value),Q.value||setTimeout(O,700)}),Q.value=!0;function $(){n.formStyle=="slideOver"?Q.value=!1:O()}const G=x=>{x.key==="Escape"&&$()};return e.onMounted(()=>window.addEventListener("keydown",G)),e.onUnmounted(()=>window.removeEventListener("keydown",G)),(x,_)=>{var re,Z,ge,pe,te;const Y=e.resolveComponent("AutoFormFields"),J=e.resolveComponent("FormLoading"),K=e.resolveComponent("SecondaryButton"),z=e.resolveComponent("PrimaryButton"),H=e.resolveComponent("CloseButton"),ne=e.resolveComponent("ModalLookup");return e.openBlock(),e.createElementBlock("div",null,[e.unref(w)?t.formStyle=="card"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(S))},[e.createElementVNode("form",{onSubmit:e.withModifiers(j,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(T))},[e.createElementVNode("div",null,[x.$slots.heading?(e.openBlock(),e.createElementBlock("div",Ac,[e.renderSlot(x.$slots,"heading")])):(e.openBlock(),e.createElementBlock("h3",{key:1,class:e.normalizeClass(e.unref(F))},e.toDisplayString(e.unref(M)),3)),x.$slots.subheading?(e.openBlock(),e.createElementBlock("div",zc,[e.renderSlot(x.$slots,"subheading")])):t.subHeading?(e.openBlock(),e.createElementBlock("p",{key:3,class:e.normalizeClass(e.unref(I))},e.toDisplayString(t.subHeading),3)):(re=e.unref(w))!=null&&re.notes?(e.openBlock(),e.createElementBlock("p",{key:4,class:e.normalizeClass(["notes",e.unref(I)]),innerHTML:(Z=e.unref(w))==null?void 0:Z.notes},null,10,Tc)):e.createCommentVNode("",!0)]),e.renderSlot(x.$slots,"header"),e.createVNode(Y,{modelValue:V.value,"onUpdate:modelValue":l,api:N.value,configureField:t.configureField},null,8,["modelValue","api","configureField"]),e.renderSlot(x.$slots,"footer")],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(b))},[e.createElementVNode("div",null,[t.showLoading&&e.unref(A)?(e.openBlock(),e.createBlock(J,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pc,[t.showCancel?(e.openBlock(),e.createBlock(K,{key:0,onClick:$,disabled:e.unref(A)},{default:e.withCtx(()=>[e.createTextVNode("Cancel")]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(z,{type:"submit",class:"ml-4",disabled:e.unref(A)},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1},8,["disabled"])])],2)],40,Dc)],2)):(e.openBlock(),e.createElementBlock("div",Fc,[Ic,e.createElementVNode("div",jc,[e.createElementVNode("div",{onMousedown:$,class:"absolute inset-0 overflow-hidden"},[e.createElementVNode("div",{onMousedown:_[0]||(_[0]=e.withModifiers(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[e.createElementVNode("div",{class:e.normalizeClass(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",E.value])},[e.createElementVNode("form",{class:e.normalizeClass(e.unref(T)),onSubmit:e.withModifiers(j,["prevent"])},[e.createElementVNode("div",Rc,[e.createElementVNode("div",Hc,[e.createElementVNode("div",Uc,[e.createElementVNode("div",qc,[e.createElementVNode("div",Qc,[x.$slots.heading?(e.openBlock(),e.createElementBlock("div",Gc,[e.renderSlot(x.$slots,"heading")])):(e.openBlock(),e.createElementBlock("h3",{key:1,class:e.normalizeClass(e.unref(F))},e.toDisplayString(e.unref(M)),3)),x.$slots.subheading?(e.openBlock(),e.createElementBlock("div",Kc,[e.renderSlot(x.$slots,"subheading")])):t.subHeading?(e.openBlock(),e.createElementBlock("p",{key:3,class:e.normalizeClass(e.unref(I))},e.toDisplayString(t.subHeading),3)):(ge=e.unref(w))!=null&&ge.notes?(e.openBlock(),e.createElementBlock("p",{key:4,class:e.normalizeClass(["notes",e.unref(I)]),innerHTML:(pe=e.unref(w))==null?void 0:pe.notes},null,10,Wc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zc,[e.createVNode(H,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:$})])])]),e.renderSlot(x.$slots,"header"),e.createVNode(Y,{modelValue:V.value,"onUpdate:modelValue":l,api:N.value,configureField:t.configureField},null,8,["modelValue","api","configureField"]),e.renderSlot(x.$slots,"footer")])]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(b))},[e.createElementVNode("div",null,[t.showLoading&&e.unref(A)?(e.openBlock(),e.createBlock(J,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Jc,[t.showCancel?(e.openBlock(),e.createBlock(K,{key:0,onClick:$,disabled:e.unref(A)},{default:e.withCtx(()=>[e.createTextVNode("Cancel")]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(z,{type:"submit",class:"ml-4",disabled:e.unref(A)},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1},8,["disabled"])])],2)],42,Oc)],2)],32)],32)])])):(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("p",Lc,[e.createTextVNode("Could not create form for unknown "),Mc,e.createTextVNode(" "+e.toDisplayString(e.unref(k)),1)])])),((te=s.value)==null?void 0:te.name)=="ModalLookup"&&s.value.ref?(e.openBlock(),e.createBlock(ne,{key:3,"ref-info":s.value.ref,onDone:c},null,8,["ref-info"])):e.createCommentVNode("",!0)])}}}),Yc={key:0},vc={class:"text-red-700"},ed=e.createElementVNode("b",null,"type",-1),td=["onSubmit"],nd={key:0},od={key:2},ld=["innerHTML"],ad={class:"flex justify-end"},sd={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},rd=e.createElementVNode("div",{class:"fixed inset-0"},null,-1),id={class:"fixed inset-0 overflow-hidden"},cd=["onSubmit"],dd={class:"flex min-h-0 flex-1 flex-col overflow-auto"},md={class:"flex-1"},fd={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},ud={class:"flex items-start justify-between space-x-3"},pd={class:"space-y-1"},hd={key:0},gd={key:2},yd=["innerHTML"],kd={class:"flex h-7 items-center"},bd={class:"flex justify-end"},wd=e.defineComponent({__name:"AutoEditForm",props:{modelValue:null,type:null,deleteType:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},configureField:null},emits:["done","save","delete","error"],setup(t,{emit:o}){const n=t;function l(z){}const a={openModal:m};e.provide("ModalProvider",a);const s=e.ref(),r=e.ref();function m(z,H){s.value=z,r.value=H}async function c(z){r.value&&r.value(z),s.value=void 0,r.value=void 0}const{typeOf:d,apiOf:u,typeProperties:p,createFormLayout:f,getPrimaryKey:g,Crud:k,createDto:w,formValues:V}=Ee(),S=e.computed(()=>Ke(n.type)),T=e.computed(()=>d(S.value)),F=e.ref(typeof n.type=="string"?w(n.type,Vt(n.modelValue)):n.type?new n.type(Vt(n.modelValue)):null),I=e.computed(()=>n.panelClass||Ce.panelClass(n.formStyle)),b=e.computed(()=>n.formClass||Ce.formClass(n.formStyle)),L=e.computed(()=>n.headingClass||Ce.headingClass(n.formStyle)),M=e.computed(()=>n.subHeadingClass||Ce.subHeadingClass(n.formStyle)),N=e.computed(()=>k.model(T.value)),B=e.computed(()=>{var z;return n.heading||((z=d(S.value))==null?void 0:z.description)||(N.value?`Update ${i.humanize(N.value)}`:i.humanize(S.value))}),A=e.ref(new i.ApiResult);let j=it(),O=e.computed(()=>j.loading.value);const Q=()=>i.map(d(k.model(T.value)),z=>g(z));function E(z){const{op:H,prop:ne}=z;H&&(k.isPatch(H)||k.isUpdate(H))&&(z.disabled=ne==null?void 0:ne.isPrimaryKey),n.configureField&&n.configureField(z)}async function h(z){var ge,pe;let H=z.target;if(!n.autosave){o("save",new F.value.constructor(V(H,p(T.value))));return}let ne=i.map((ge=F.value)==null?void 0:ge.getMethod,te=>typeof te=="function"?te():null)||"POST",re=i.map((pe=F.value)==null?void 0:pe.createResponse,te=>typeof te=="function"?te():null)==null,Z=Q();if(i.HttpMethods.hasRequestBody(ne)){let te=new F.value.constructor,be=i.mapGet(n.modelValue,Z.name),me=new FormData(H);Z&&!Array.from(me.keys()).some(D=>D.toLowerCase()==Z.name.toLowerCase())&&me.append(Z.name,be);let xe=[];const De=S.value&&u(S.value);if(De&&k.isPatch(De)){let D=Vt(n.modelValue),P=f(T.value),X={};if(Z&&(X[Z.name]=be),P.forEach(le=>{let he=le.id,Be=i.mapGet(D,he);if(Z&&Z.name.toLowerCase()===he.toLowerCase())return;let se=me.get(he),we=se!=null,_e=le.type==="checkbox"?we!==!!Be:le.type==="file"?we:se!=Be;!se&&!Be&&(_e=!1),_e&&(se?X[he]=se:le.type!=="file"&&xe.push(he))}),Array.from(me.keys()).filter(le=>!X[le]).forEach(le=>me.delete(le)),Array.from(me.keys()).filter(le=>le.toLowerCase()!=Z.name.toLowerCase()).length==0&&xe.length==0){J();return}}const Ve=xe.length>0?{jsconfig:"eccn",reset:xe}:{jsconfig:"eccn"};re?A.value=await j.apiFormVoid(te,me,Ve):A.value=await j.apiForm(te,me,Ve)}else{let te=V(H,p(T.value));Z&&!i.mapGet(te,Z.name)&&(te[Z.name]=i.mapGet(n.modelValue,Z.name));let be=new F.value.constructor(te);re?A.value=await j.apiVoid(be,{jsconfig:"eccn"}):A.value=await j.api(be,{jsconfig:"eccn"})}A.value.succeeded?(H.reset(),o("save",A.value.response)):o("error",A.value.error)}async function $(z){let H=Q();const ne=H?i.mapGet(n.modelValue,H.name):null;if(!ne){console.error(`Could not find Primary Key for Type ${S.value} (${N.value})`);return}const re={[H.name]:ne},Z=typeof n.deleteType=="string"?w(n.deleteType,re):n.deleteType?new n.deleteType(re):null;i.map(Z.createResponse,pe=>typeof pe=="function"?pe():null)==null?A.value=await j.apiVoid(Z):A.value=await j.api(Z),A.value.succeeded?o("delete",A.value.response):o("error",A.value.error)}function G(){o("done")}const x=e.ref(!1),_=e.ref(""),Y={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};e.watch(x,()=>{Ge(Y,_,x.value),x.value||setTimeout(G,700)}),x.value=!0;function J(){n.formStyle=="slideOver"?x.value=!1:G()}const K=z=>{z.key==="Escape"&&J()};return e.onMounted(()=>window.addEventListener("keydown",K)),e.onUnmounted(()=>window.removeEventListener("keydown",K)),(z,H)=>{var me,xe,De,Ve,D;const ne=e.resolveComponent("AutoFormFields"),re=e.resolveComponent("ConfirmDelete"),Z=e.resolveComponent("FormLoading"),ge=e.resolveComponent("SecondaryButton"),pe=e.resolveComponent("PrimaryButton"),te=e.resolveComponent("CloseButton"),be=e.resolveComponent("ModalLookup");return e.openBlock(),e.createElementBlock("div",null,[e.unref(T)?t.formStyle=="card"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(I))},[e.createElementVNode("form",{onSubmit:e.withModifiers(h,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b))},[e.createElementVNode("div",null,[z.$slots.heading?(e.openBlock(),e.createElementBlock("div",nd,[e.renderSlot(z.$slots,"heading")])):(e.openBlock(),e.createElementBlock("h3",{key:1,class:e.normalizeClass(e.unref(L))},e.toDisplayString(e.unref(B)),3)),z.$slots.subheading?(e.openBlock(),e.createElementBlock("div",od,[e.renderSlot(z.$slots,"subheading")])):t.subHeading?(e.openBlock(),e.createElementBlock("p",{key:3,class:e.normalizeClass(e.unref(M))},e.toDisplayString(t.subHeading),3)):(me=e.unref(T))!=null&&me.notes?(e.openBlock(),e.createElementBlock("p",{key:4,class:e.normalizeClass(["notes",e.unref(M)]),innerHTML:(xe=e.unref(T))==null?void 0:xe.notes},null,10,ld)):e.createCommentVNode("",!0)]),e.renderSlot(z.$slots,"header"),e.createVNode(ne,{modelValue:F.value,"onUpdate:modelValue":l,api:A.value,configureField:t.configureField},null,8,["modelValue","api","configureField"]),e.renderSlot(z.$slots,"footer")],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(Ce).buttonsClass)},[e.createElementVNode("div",null,[t.deleteType?(e.openBlock(),e.createBlock(re,{key:0,onDelete:$})):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[t.showLoading&&e.unref(O)?(e.openBlock(),e.createBlock(Z,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",ad,[e.createVNode(ge,{onClick:J,disabled:e.unref(O)},{default:e.withCtx(()=>[e.createTextVNode("Cancel")]),_:1},8,["disabled"]),e.createVNode(pe,{type:"submit",class:"ml-4",disabled:e.unref(O)},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1},8,["disabled"])])],2)],40,td)],2)):(e.openBlock(),e.createElementBlock("div",sd,[rd,e.createElementVNode("div",id,[e.createElementVNode("div",{onMousedown:J,class:"absolute inset-0 overflow-hidden"},[e.createElementVNode("div",{onMousedown:H[0]||(H[0]=e.withModifiers(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[e.createElementVNode("div",{class:e.normalizeClass(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",_.value])},[e.createElementVNode("form",{class:e.normalizeClass(e.unref(b)),onSubmit:e.withModifiers(h,["prevent"])},[e.createElementVNode("div",dd,[e.createElementVNode("div",md,[e.createElementVNode("div",fd,[e.createElementVNode("div",ud,[e.createElementVNode("div",pd,[z.$slots.heading?(e.openBlock(),e.createElementBlock("div",hd,[e.renderSlot(z.$slots,"heading")])):(e.openBlock(),e.createElementBlock("h3",{key:1,class:e.normalizeClass(e.unref(L))},e.toDisplayString(e.unref(B)),3)),z.$slots.subheading?(e.openBlock(),e.createElementBlock("div",gd,[e.renderSlot(z.$slots,"subheading")])):t.subHeading?(e.openBlock(),e.createElementBlock("p",{key:3,class:e.normalizeClass(e.unref(M))},e.toDisplayString(t.subHeading),3)):(De=e.unref(T))!=null&&De.notes?(e.openBlock(),e.createElementBlock("p",{key:4,class:e.normalizeClass(["notes",e.unref(M)]),innerHTML:(Ve=e.unref(T))==null?void 0:Ve.notes},null,10,yd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",kd,[e.createVNode(te,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:J})])])]),e.renderSlot(z.$slots,"header"),e.createVNode(ne,{modelValue:F.value,"onUpdate:modelValue":l,api:A.value,configureField:E},null,8,["modelValue","api"]),e.renderSlot(z.$slots,"footer")])]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(Ce).buttonsClass)},[e.createElementVNode("div",null,[t.deleteType?(e.openBlock(),e.createBlock(re,{key:0,onDelete:$})):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[t.showLoading&&e.unref(O)?(e.openBlock(),e.createBlock(Z,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",bd,[e.createVNode(ge,{onClick:J,disabled:e.unref(O)},{default:e.withCtx(()=>[e.createTextVNode("Cancel")]),_:1},8,["disabled"]),e.createVNode(pe,{type:"submit",class:"ml-4",disabled:e.unref(O)},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1},8,["disabled"])])],2)],42,cd)],2)],32)],32)])])):(e.openBlock(),e.createElementBlock("div",Yc,[e.createElementVNode("p",vc,[e.createTextVNode("Could not create form for unknown "),ed,e.createTextVNode(" "+e.toDisplayString(e.unref(S)),1)])])),((D=s.value)==null?void 0:D.name)=="ModalLookup"&&s.value.ref?(e.openBlock(),e.createBlock(be,{key:3,"ref-info":s.value.ref,onDone:c},null,8,["ref-info"])):e.createCommentVNode("",!0)])}}}),Cd=e.createElementVNode("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),xd=["onClick"],Vd=e.defineComponent({__name:"ConfirmDelete",emits:["delete"],setup(t,{emit:o}){let n=e.ref(!1);const l=()=>{n.value&&o("delete")},a=e.computed(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",n.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createElementVNode("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":r[0]||(r[0]=m=>e.isRef(n)?n.value=m:n=m)},null,512),[[e.vModelCheckbox,e.unref(n)]]),Cd,e.createElementVNode("span",e.mergeProps({onClick:e.withModifiers(l,["prevent"]),class:e.unref(a)},s.$attrs),[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode("Delete")])],16,xd)],64))}}),$d={class:"flex",title:"loading..."},Ed={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},Bd=[e.createStaticVNode('<rect x="0" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="8" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="16" y="10" width="4" height="10" fill="#333" opacity="0.2"><animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3)],_d={class:"ml-2 mt-1 text-gray-400"},Nd=e.defineComponent({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(t){return e.inject("ApiState",void 0),(o,n)=>(e.openBlock(),e.createElementBlock("div",$d,[t.icon?(e.openBlock(),e.createElementBlock("svg",Ed,Bd)):e.createCommentVNode("",!0),e.createElementVNode("span",_d,e.toDisplayString(t.text),1)]))}}),Sd=["onClick"],Ld={key:3,class:"flex justify-between items-center"},Md={class:"mr-1 select-none"},Dd=["onClick"],Ad=e.defineComponent({__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},type:null,tableStyle:{default:"stripedRows"},selectedColumns:null,gridClass:null,grid2Class:null,grid3Class:null,grid4Class:null,tableClass:null,theadClass:null,tbodyClass:null,theadRowClass:null,theadCellClass:null,isSelected:null,headerTitle:null,headerTitles:null,visibleFrom:null,rowClass:null,rowStyle:null},emits:["headerSelected","rowSelected"],setup(t,{emit:o}){const n=t,l=e.ref(),a=e.ref(null),s=x=>a.value===x,r=e.useSlots(),m=x=>Object.keys(r).find(_=>_.toLowerCase()==x.toLowerCase()+"-header"),c=x=>Object.keys(r).find(_=>_.toLowerCase()==x.toLowerCase()),d=e.computed(()=>i.uniqueKeys(n.items).filter(x=>!!(r[x]||r[x+"-header"]))),{typeOf:u,typeProperties:p}=Ee(),f=e.computed(()=>Ke(n.type)),g=e.computed(()=>u(f.value)),k=e.computed(()=>p(g.value));function w(x){const _=n.headerTitles&&i.mapGet(n.headerTitles,x)||x;return n.headerTitle?n.headerTitle(_):i.humanify(_)}function V(x){const _=x.toLowerCase();return k.value.find(Y=>Y.name.toLowerCase()==_)}function S(x){const _=V(x);return _!=null&&_.format?_.format:(_==null?void 0:_.type)=="TimeSpan"||(_==null?void 0:_.type)=="TimeOnly"?{method:"time"}:null}const T={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function F(x){const _=n.visibleFrom&&i.mapGet(n.visibleFrom,x);return _&&i.map(T[_],Y=>`hidden ${Y}`)}const I=e.computed(()=>n.gridClass??W.getGridClass(n.tableStyle)),b=e.computed(()=>n.grid2Class??W.getGrid2Class(n.tableStyle)),L=e.computed(()=>n.grid3Class??W.getGrid3Class(n.tableStyle)),M=e.computed(()=>n.grid4Class??W.getGrid4Class(n.tableStyle)),N=e.computed(()=>n.tableClass??W.getTableClass(n.tableStyle)),B=e.computed(()=>n.tbodyClass??W.getTbodyClass(n.tbodyClass)),A=e.computed(()=>n.theadClass??W.getTheadClass(n.tableStyle)),j=e.computed(()=>n.theadRowClass??W.getTheadRowClass(n.tableStyle)),O=e.computed(()=>n.theadCellClass??W.getTheadCellClass(n.tableStyle));function Q(x,_){return n.rowClass?n.rowClass(x,_):W.getTableRowClass(n.tableStyle,_,!!(n.isSelected&&n.isSelected(x)),n.isSelected!=null)}function E(x,_){return n.rowStyle?n.rowStyle(x,_):void 0}const h=e.computed(()=>{const x=(typeof n.selectedColumns=="string"?n.selectedColumns.split(","):n.selectedColumns)||(d.value.length>0?d.value:i.uniqueKeys(n.items)),_=k.value.reduce((Y,J)=>(Y[J.name.toLowerCase()]=J.format,Y),{});return x.filter(Y=>{var J;return((J=_[Y.toLowerCase()])==null?void 0:J.method)!="hidden"})});function $(x,_){o("headerSelected",_,x)}function G(x,_,Y){o("rowSelected",Y,x)}return(x,_)=>{const Y=e.resolveComponent("CellFormat"),J=e.resolveComponent("PreviewFormat");return t.items.length?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"refResults",ref:l,class:e.normalizeClass(e.unref(I))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(L))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(M))},[e.createElementVNode("table",{class:e.normalizeClass(e.unref(N))},[e.createElementVNode("thead",{class:e.normalizeClass(e.unref(A))},[e.createElementVNode("tr",{class:e.normalizeClass(e.unref(j))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),K=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass([F(K),e.unref(O),s(K)?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400"])},[e.createElementVNode("div",{onClick:z=>$(z,K)},[e.unref(r)[K+"-header"]?e.renderSlot(x.$slots,K+"-header",{key:0,column:K}):m(K)?e.renderSlot(x.$slots,m(K),{key:1,column:K}):e.unref(r).header?e.renderSlot(x.$slots,"header",{key:2,column:K,label:w(K)}):(e.openBlock(),e.createElementBlock("div",Ld,[e.createElementVNode("span",Md,e.toDisplayString(w(K)),1)]))],8,Sd)],2))),256))],2)],2),e.createElementVNode("tbody",{class:e.normalizeClass(e.unref(B))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(K,z)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(Q(K,z)),style:e.normalizeStyle(E(K,z)),onClick:H=>G(H,z,K)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),H=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass([F(H),e.unref(W).tableCellClass])},[e.unref(r)[H]?e.renderSlot(x.$slots,H,e.normalizeProps(e.mergeProps({key:0},K))):c(H)?e.renderSlot(x.$slots,c(H),e.normalizeProps(e.mergeProps({key:1},K))):V(H)?(e.openBlock(),e.createBlock(Y,{key:2,type:e.unref(g),propType:V(H),modelValue:K},null,8,["type","propType","modelValue"])):(e.openBlock(),e.createBlock(J,{key:3,value:e.unref(i.mapGet)(K,H),format:S(H)},null,8,["value","format"]))],2))),256))],14,Dd))),256))],2)],2)],2)],2)],2)],2)):e.createCommentVNode("",!0)}}});let an=()=>new Date().getTime(),zd=["/","T",":","-"],Me={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},Td=new Intl.RelativeTimeFormat(Me.locale,{}),Wn=24*60*60*1e3*365,sn={year:Wn,month:Wn/12,day:24*60*60*1e3,hour:60*60*1e3,minute:60*1e3,second:1e3},Xe={currency:Zn,bytes:Jn,link:Xn,linkTel:Yn,linkMailTo:vn,icon:eo,iconRounded:to,attachment:no,hidden:oo,time:lo,relativeTime:cn,relativeTimeFromMs:St,formatDate:Ye,formatNumber:rn};"iconOnError"in globalThis||(globalThis.iconOnError=wt);class ye{}oe(ye,"currency",{method:"currency"}),oe(ye,"bytes",{method:"bytes"}),oe(ye,"link",{method:"link"}),oe(ye,"linkTel",{method:"linkTel"}),oe(ye,"linkMailTo",{method:"linkMailTo"}),oe(ye,"icon",{method:"icon"}),oe(ye,"iconRounded",{method:"iconRounded"}),oe(ye,"attachment",{method:"attachment"}),oe(ye,"time",{method:"time"}),oe(ye,"relativeTime",{method:"relativeTime"}),oe(ye,"relativeTimeFromMs",{method:"relativeTimeFromMs"}),oe(ye,"date",{method:"formatDate"}),oe(ye,"number",{method:"formatNumber"}),oe(ye,"hidden",{method:"hidden"});function Pd(t){Me=Object.assign({},Me,t)}function Fd(t){Object.keys(t||{}).forEach(o=>{typeof t[o]=="function"&&(Xe[o]=t[o])})}function ct(t,o){return o?Le("span",t,o):t}function Zn(t,o){const n=i.omit(o,["currency"]);return ct(new Intl.NumberFormat(void 0,{style:"currency",currency:(o==null?void 0:o.currency)||"USD"}).format(t),n)}function Jn(t,o){return ct(Gt(t),o)}function Xn(t,o){return Le("a",t,yt({...o,href:t}))}function Yn(t,o){return Le("a",t,yt({...o,href:`tel:${t}`}))}function vn(t,o){o||(o={});let{subject:n,body:l}=o,a=i.omit(o,["subject","body"]),s={};return n&&(s.subject=n),l&&(s.body=l),Le("a",t,yt({...a,href:`mailto:${i.appendQueryString(t,s)}`}))}function eo(t,o){return Le("img",void 0,Object.assign({class:"w-6 h-6",title:t,src:We(t),onerror:"iconOnError(this)"},o))}function to(t,o){return Le("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:t,src:We(t),onerror:"iconOnError(this)"},o))}function no(t,o){let n=Ut(t),a=nt(n)==null||Qt(t)?We(t):Kt(t);const s=We(a);let r=o&&(o["icon-class"]||o.iconClass),m=Le("img",void 0,Object.assign({class:"w-6 h-6",src:s,onerror:"iconOnError(this,'att')"},r?{class:r}:null)),c=`<span class="pl-1">${n}</span>`;return Le("a",m+c,Object.assign({class:"flex",href:We(t),title:t},o?i.omit(o,["icon-class","iconClass"]):null))}function oo(t){return""}function lo(t,o){let n=typeof t=="string"?new Date(i.fromXsdDuration(t)*1e3):i.isDate(t)?i.toDate(t):null;return ct(n?i.timeFmt12(n):t,o)}function Ye(t,o){if(t==null)return"";let n=typeof t=="number"?new Date(t):typeof t=="string"?i.toDate(t):t;if(!i.isDate(n))return console.warn(`${n} is not a Date value`),t==null?"":`${t}`;let l=Me.date?Lt(Me.date):null;return ct(typeof l=="function"?l(n):i.dateFmt(n),o)}function rn(t,o){if(typeof t!="number")return t;let n=Me.number?Lt(Me.number):null,l=typeof n=="function"?n(t):`${t}`;return l===""&&(console.warn(`formatNumber(${t}) => ${l}`,n),l=`${t}`),ct(l,o)}function ao(t,o,n){let l=i.apiValue(t),a=o?Lt(o):null;if(typeof a=="function"){let r=n;if(o!=null&&o.options)try{r=Ft(o.options,n)}catch(m){console.error(`Could not evaluate '${o.options}'`,m,", with scope:",n)}return a(t,r)}let s=l!=null?i.isDate(l)?Ye(l,n):typeof l=="number"?rn(l,n):l:null;return s??""}function dt(t,o,n){return Oe(t)?ao(t,o,n):Hd(t,o,n)}function Id(t){if(t==null)return NaN;if(typeof t=="number")return t;if(i.isDate(t))return t.getTime()-an();if(typeof t=="string"){let o=Number(t);if(!isNaN(o))return o;if(t[0]==="P"||t.startsWith("-P"))return i.fromXsdDuration(t)*1e3*-1;if(i.indexOfAny(t,zd)>=0)return i.toDate(t).getTime()-an()}return NaN}function St(t,o){for(let n in sn)if(Math.abs(t)>sn[n]||n==="second")return(o||Td).format(Math.round(t/sn[n]),n)}function cn(t,o){let n=Id(t);return isNaN(n)?"":St(n,o)}function jd(t,o){return St(t.getTime()-(o?o.getTime():an()))}function Lt(t){if(!t)return null;let{method:o,options:n}=t,l=`${o}(${n})`,a=Xe[l]||Xe[o];if(typeof a=="function")return a;let s=t.locale||Me.locale;if(o.startsWith("Intl.")){let r=s?`'${s}'`:"undefined",m=`return new ${o}(${r},${n||"undefined"})`;try{let c=Function(m)();return a=o==="Intl.DateTimeFormat"?d=>c.format(i.toDate(d)):o==="Intl.NumberFormat"?d=>c.format(Number(d)):o==="Intl.RelativeTimeFormat"?d=>cn(d,c):d=>c.format(d),Xe[l]=a}catch(c){console.error(`Invalid format: ${m}`,c)}}else{let r=globalThis[o];if(typeof r=="function"){let m=n!=null?Function("return "+n)():void 0;return a=c=>r(c,m,s),Xe[l]=a}console.error(`No '${o}' function exists`,Object.keys(Xe))}return null}function so(t,o){return t?t.length>o?t.substring(0,o)+"...":t:""}function ro(t){return t.substring(0,6)==="/Date("?Ye(i.toDate(t)):t}function Od(t){return dn(ve(t)).replace(/"/g,"")}function io(t){if(t==null||t==="")return"";if(typeof t=="string")try{return JSON.parse(t)}catch{console.warn("couldn't parse as JSON",t)}return t}function dn(t,o=4){return t=io(t),typeof t!="object"?typeof t=="string"?t:`${t}`:JSON.stringify(t,void 0,o)}function Rd(t){return t=io(t),typeof t!="object"?typeof t=="string"?t:`${t}`:(t=Object.assign({},t),t=ve(t),dn(t))}function ve(t){if(t==null)return null;if(typeof t=="string")return ro(t);if(Oe(t))return t;if(t instanceof Date)return Ye(t);if(Array.isArray(t))return t.map(ve);if(typeof t=="object"){let o={};return Object.keys(t).forEach(n=>{n!="__type"&&(o[n]=ve(t[n]))}),o}return t}function Hd(t,o,n){let l=t;if(Array.isArray(t)){if(Oe(t[0]))return l.join(",");t[0]!=null&&(l=t[0])}if(l==null)return"";if(l instanceof Date)return Ye(l,n);let a=Object.keys(l),s=[];for(let r=0;r<Math.min(Me.maxNestedFields,a.length);r++){let m=a[r],c=`${ve(l[m])}`;s.push(`<b class="font-medium">${m}</b>: ${i.enc(so(ro(c),Me.maxNestedFieldLength))}`)}return a.length>2&&s.push("..."),Le("span","{ "+s.join(", ")+" }",Object.assign({title:i.enc(Od(t))},n))}function Ud(){return{Formats:ye,setDefaultFormats:Pd,setFormatters:Fd,formatValue:dt,formatter:Lt,dateInputFormat:ht,currency:Zn,bytes:Jn,link:Xn,linkTel:Yn,linkMailTo:vn,icon:eo,iconRounded:to,attachment:no,hidden:oo,time:lo,relativeTime:cn,relativeTimeFromDate:jd,relativeTimeFromMs:St,formatDate:Ye,formatNumber:rn,indentJson:dn,prettyJson:Rd,scrub:ve,truncate:so,apiValueFmt:ao,iconOnError:wt}}const qd=e.defineComponent({props:{type:Object,propType:Object,modelValue:Object},setup(t,{attrs:o}){const{typeOf:n}=Ee();function l(a){return a!=null&&a.format?a.format:(a==null?void 0:a.type)=="TimeSpan"||(a==null?void 0:a.type)=="TimeOnly"?{method:"time"}:null}return()=>{var S;const a=l(t.propType),s=i.mapGet(t.modelValue,t.propType.name),r=Object.assign({},t,o),m=e.h("span",{innerHTML:dt(s,a,r)}),c=tt(s)&&Array.isArray(s)?e.h("span",{},[e.h("span",{class:"mr-2"},`${s.length}`),m]):m,d=(S=t.propType)==null?void 0:S.ref;if(!d)return c;const p=$e(t.type).find(T=>T.type===d.model);if(!p)return c;const f=i.mapGet(t.modelValue,p.name),g=f&&d.refLabel&&i.mapGet(f,d.refLabel);if(!g)return c;const k=n(d.model),w=k==null?void 0:k.icon,V=w?e.h(qn,{image:w,class:"w-5 h-5 mr-1"}):null;return e.h("span",{class:"flex",title:`${d.model} ${s}`},[V,g])}}}),Qd={key:0},Gd={key:0,class:"mr-2"},Kd=["innerHTML"],Wd=["innerHTML"],Zd={inheritAttrs:!1},Jd=e.defineComponent({...Zd,__name:"PreviewFormat",props:{value:null,format:null,includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(t){const o=t,n=e.computed(()=>Array.isArray(o.value));return(l,a)=>e.unref(tt)(t.value)?(e.openBlock(),e.createElementBlock("span",Qd,[t.includeCount&&e.unref(n)?(e.openBlock(),e.createElementBlock("span",Gd,e.toDisplayString(t.value.length),1)):e.createCommentVNode("",!0),e.createElementVNode("span",{innerHTML:e.unref(dt)(t.value,t.format,l.$attrs)},null,8,Kd)])):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:e.unref(dt)(t.value,t.format,l.$attrs)},null,8,Wd))}}),Xd=["innerHTML"],Yd={key:0},vd=e.createElementVNode("b",null,null,-1),em={key:2},tm=e.defineComponent({__name:"HtmlFormat",props:{value:null,depth:{default:0},fieldAttrs:null,classes:{type:Function,default:(t,o,n,l,a)=>l}},setup(t){const o=t,n=e.computed(()=>Oe(o.value)),l=e.computed(()=>Array.isArray(o.value)),a=c=>i.humanify(c),s=c=>o.fieldAttrs?o.fieldAttrs(c):null,r=e.computed(()=>i.uniqueKeys(o.value)),m=c=>c?Object.keys(c).map(d=>({key:a(d),val:c[d]})):[];return(c,d)=>{const u=e.resolveComponent("HtmlFormat",!0);return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.depth==0?"prose html-format":"")},[e.unref(n)?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:e.unref(dt)(t.value)},null,8,Xd)):e.unref(l)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.classes("array","div",t.depth,e.unref(W).gridClass))},[e.unref(Oe)(t.value[0])?(e.openBlock(),e.createElementBlock("div",Yd,"[ "+e.toDisplayString(t.value.join(", "))+" ]",1)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.classes("array","div",t.depth,e.unref(W).grid2Class))},[e.createElementVNode("div",{class:e.normalizeClass(t.classes("array","div",t.depth,e.unref(W).grid3Class))},[e.createElementVNode("div",{class:e.normalizeClass(t.classes("array","div",t.depth,e.unref(W).grid4Class))},[e.createElementVNode("table",{class:e.normalizeClass(t.classes("object","table",t.depth,e.unref(W).tableClass))},[e.createElementVNode("thead",{class:e.normalizeClass(t.classes("array","thead",t.depth,e.unref(W).theadClass))},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),p=>(e.openBlock(),e.createElementBlock("th",{class:e.normalizeClass(t.classes("array","th",t.depth,e.unref(W).theadCellClass+" whitespace-nowrap"))},[vd,e.createTextVNode(e.toDisplayString(a(p)),1)],2))),256))])],2),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(p,f)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(t.classes("array","tr",t.depth,f%2==0?"bg-white":"bg-gray-50",f))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),g=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass(t.classes("array","td",t.depth,e.unref(W).tableCellClass))},[e.createVNode(u,e.mergeProps({value:p[g],"field-attrs":t.fieldAttrs,depth:t.depth+1,classes:t.classes},s(g)),null,16,["value","field-attrs","depth","classes"])],2))),256))],2))),256))])],2)],2)],2)],2))],2)):(e.openBlock(),e.createElementBlock("div",em,[e.createElementVNode("table",{class:e.normalizeClass(t.classes("object","table",t.depth,"table-object"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(t.value),p=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(t.classes("object","tr",t.depth,""))},[e.createElementVNode("th",{class:e.normalizeClass(t.classes("object","th",t.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},e.toDisplayString(p.key),3),e.createElementVNode("td",{class:e.normalizeClass(t.classes("object","td",t.depth,"align-top py-2 px-4 text-sm"))},[e.createVNode(u,e.mergeProps({value:p.val,"field-attrs":t.fieldAttrs,depth:t.depth+1,classes:t.classes},s(p.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2)}}}),nm={class:"absolute top-0 right-0 pt-4 pr-4"},om=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],lm=e.defineComponent({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(t,{emit:o}){return(n,l)=>(e.openBlock(),e.createElementBlock("div",nm,[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=a=>n.$emit("close")),class:e.normalizeClass([t.buttonClass,"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},om,2)]))}}),am=["id","aria-labelledby"],sm=e.createElementVNode("div",{class:"fixed inset-0"},null,-1),rm={class:"fixed inset-0 overflow-hidden"},im={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},cm={class:"flex min-h-0 flex-1 flex-col overflow-auto"},dm={class:"flex-1"},mm={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},fm={class:"flex items-start justify-between space-x-3"},um={class:"space-y-1"},pm=["id"],hm={key:1,class:"text-sm text-gray-500"},gm={class:"flex h-7 items-center"},ym={class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},km=e.defineComponent({__name:"SlideOver",props:{id:{default:"SlideOver"},title:null,contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(t,{emit:o}){const n=e.ref(!1),l=e.ref(""),a={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};e.watch(n,()=>{Ge(a,l,n.value),n.value||setTimeout(()=>o("done"),700)}),n.value=!0;const s=()=>n.value=!1,r=m=>{m.key==="Escape"&&s()};return e.onMounted(()=>window.addEventListener("keydown",r)),e.onUnmounted(()=>window.removeEventListener("keydown",r)),(m,c)=>{const d=e.resolveComponent("CloseButton");return e.openBlock(),e.createElementBlock("div",{id:t.id,class:"relative z-10","aria-labelledby":t.id+"-title",role:"dialog","aria-modal":"true"},[sm,e.createElementVNode("div",rm,[e.createElementVNode("div",{onMousedown:s,class:"absolute inset-0 overflow-hidden"},[e.createElementVNode("div",{onMousedown:c[0]||(c[0]=e.withModifiers(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[e.createElementVNode("div",{class:e.normalizeClass(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",l.value])},[e.createElementVNode("div",im,[e.createElementVNode("div",cm,[e.createElementVNode("div",dm,[e.createElementVNode("div",mm,[e.createElementVNode("div",fm,[e.createElementVNode("div",um,[t.title?(e.openBlock(),e.createElementBlock("h2",{key:0,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:t.id+"-title"},e.toDisplayString(t.title),9,pm)):e.createCommentVNode("",!0),m.$slots.subtitle?(e.openBlock(),e.createElementBlock("p",hm,[e.renderSlot(m.$slots,"subtitle")])):e.createCommentVNode("",!0)]),e.createElementVNode("div",gm,[e.createVNode(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:s})])])]),e.createElementVNode("div",{class:e.normalizeClass(t.contentClass)},[e.renderSlot(m.$slots,"default")],2)])]),e.createElementVNode("div",ym,[e.renderSlot(m.$slots,"footer")])])],2)],32)],32)])],8,am)}}}),bm=["id","data-transition-for","aria-labelledby"],wm={class:"fixed inset-0 z-10 overflow-y-auto"},Cm={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},xm=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],Vm=e.defineComponent({__name:"ModalDialog",props:{id:{default:"ModalDialog"},sizeClass:{default:Qn.sizeClass}},emits:["done"],setup(t,{emit:o}){const n=e.ref(!1),l=e.ref(""),a={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},s=e.ref(""),r={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}};e.watch(n,()=>{Ge(a,l,n.value),Ge(r,s,n.value),n.value||setTimeout(()=>o("done"),200)}),n.value=!0;const m=()=>n.value=!1,c={openModal:p};e.provide("ModalProvider",c);const d=e.ref(),u=e.ref();function p(k,w){d.value=k,u.value=w}async function f(k){u.value&&u.value(k),d.value=void 0,u.value=void 0}const g=k=>{k.key==="Escape"&&m()};return e.onMounted(()=>window.addEventListener("keydown",g)),e.onUnmounted(()=>window.removeEventListener("keydown",g)),(k,w)=>{var S;const V=e.resolveComponent("ModalLookup");return e.openBlock(),e.createElementBlock("div",{id:t.id,"data-transition-for":t.id,onMousedown:m,class:"relative z-10","aria-labelledby":`${t.id}-title`,role:"dialog","aria-modal":"true"},[e.createElementVNode("div",{class:e.normalizeClass(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",l.value])},null,2),e.createElementVNode("div",wm,[e.createElementVNode("div",Cm,[e.createElementVNode("div",{class:e.normalizeClass(["relative transform overflow-hidden rounded-lg bg-white dark:bg-black text-left shadow-xl transition-all sm:my-8",t.sizeClass,s.value]),onMousedown:w[0]||(w[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",null,[e.createElementVNode("div",{class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},[e.createElementVNode("button",{type:"button",onClick:m,class:"bg-white dark:bg-black rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},xm)]),e.renderSlot(k.$slots,"default")])],34)])]),((S=d.value)==null?void 0:S.name)=="ModalLookup"&&d.value.ref?(e.openBlock(),e.createBlock(V,{key:0,"ref-info":d.value.ref,onDone:f},null,8,["ref-info"])):e.createCommentVNode("",!0)],40,bm)}}}),$m={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},Em={class:"mt-3 pl-5 flex flex-wrap items-center"},Bm={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},_m={class:"hidden md:inline"},Nm={class:"flex pb-1 sm:pb-0"},Sm=["title"],Lm=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("g",{"stroke-width":"1.5",fill:"none"},[e.createElementVNode("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1)],Mm=["disabled"],Dm=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1)],Am=["disabled"],zm=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1)],Tm=["disabled"],Pm=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1)],Fm=["disabled"],Im=[e.createElementVNode("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1)],jm={key:0,class:"flex pb-1 sm:pb-0"},Om={class:"px-4 text-lg text-black dark:text-white"},Rm={key:0},Hm={key:1},Um=e.createElementVNode("span",{class:"hidden xl:inline"}," Showing Results ",-1),qm={key:2},Qm={key:1,class:"pl-2"},Gm=[e.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1)],Km={class:"flex pb-1 sm:pb-0"},Wm={key:0,class:"pl-2"},Zm=e.createElementVNode("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),Jm={class:"mr-1"},Xm={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Ym=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1)],vm={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e0=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1)],t0={key:1},n0={key:4},o0={key:0},l0={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},a0={class:"mr-1 select-none"},s0={key:1,class:"flex justify-between items-center"},r0={class:"mr-1 select-none"},i0=e.defineComponent({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:null,skip:{default:0},prefs:null,selectedColumns:null,allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:null,canFilter:null},emits:["done"],setup(t,{emit:o}){const n=t,l=e.useSlots(),{config:a}=Fe(),{metadataApi:s,filterDefinitions:r}=Ee(),m=e.inject("client"),c=a.value.storage,d=e.computed(()=>n.toolbarButtonClass??W.toolbarButtonClass),u=e.computed(()=>r.value),p=25,f=e.ref({take:p}),g=e.ref(new i.ApiResult),k=e.ref(n.skip),w=e.ref(!1),V=e.ref(),S=D=>typeof D=="string"?D.split(","):D||[];function T(D,P){return W.getTableRowClass("fullWidth",P,!1,!0)}function F(){let D=S(n.selectedColumns);return D.length>0?D:[]}const I=e.computed(()=>ze(n.refInfo.model)),b=e.computed(()=>{let P=F().map(ae=>ae.toLowerCase());const X=$e(I.value);return P.length>0?P.map(ae=>X.find(le=>le.name.toLowerCase()===ae)).filter(ae=>ae!=null):X}),L=e.computed(()=>{let D=b.value.map(X=>X.name),P=S(f.value.selectedColumns).map(X=>X.toLowerCase());return P.length>0?D.filter(X=>P.includes(X.toLowerCase())):D}),M=e.computed(()=>f.value.take??p),N=e.computed(()=>g.value.response?i.mapGet(g.value.response,"results"):[]),B=e.computed(()=>{var D;return((D=g.value.response)==null?void 0:D.total)??N.value.length??0}),A=e.computed(()=>k.value>0),j=e.computed(()=>k.value>0),O=e.computed(()=>N.value.length>=M.value),Q=e.computed(()=>N.value.length>=M.value),E=e.ref([]),h=e.computed(()=>E.value.some(D=>D.settings.filters.length>0||!!D.settings.sort)),$=e.computed(()=>E.value.map(D=>D.settings.filters.length).reduce((D,P)=>D+P,0)),G=e.computed(()=>st(I.value)),x=e.computed(()=>{var D;return(D=s.value)==null?void 0:D.operations.find(P=>{var X;return((X=P.dataModel)==null?void 0:X.name)==n.refInfo.model&&ue.isAnyQuery(P)})}),_=e.ref(),Y=e.ref(!1),J=e.ref(),K=()=>`${n.id}/ApiPrefs/${n.refInfo.model}`,z=D=>`Column/${n.id}:${n.refInfo.model}.${D}`;async function H(D){k.value+=D,k.value<0&&(k.value=0);var P=Math.floor(B.value/M.value)*M.value;k.value>P&&(k.value=P),await me()}async function ne(D,P){o("done",D)}function re(){o("done",null)}function Z(D,P){var ae,le,he;let X=P.target;if((X==null?void 0:X.tagName)!=="TD"){let Be=(ae=X==null?void 0:X.closest("TABLE"))==null?void 0:ae.getBoundingClientRect(),se=E.value.find(we=>we.name.toLowerCase()==D.toLowerCase());if(se&&Be){let we=318,Ie=(((le=P.target)==null?void 0:le.tagName)==="DIV"?P.target:(he=P.target)==null?void 0:he.closest("DIV")).getBoundingClientRect(),mt=we+25;J.value={column:se,topLeft:{x:Math.max(Math.floor(Ie.x+25),mt),y:Math.floor(115)}}}}}function ge(){J.value=null}async function pe(D){var X;let P=(X=J.value)==null?void 0:X.column;P&&(P.settings=D,c.setItem(z(P.name),JSON.stringify(P.settings)),await me()),J.value=null}async function te(D){c.setItem(z(D.name),JSON.stringify(D.settings)),await me()}async function be(D){Y.value=!1,f.value=D,c.setItem(K(),JSON.stringify(D)),await me()}async function me(){await xe(De())}async function xe(D){const P=x.value;if(!P){console.error(`No Query API was found for ${n.refInfo.model}`);return}let X=lt(P,D),ae=i.delaySet(Be=>{g.value.response=g.value.error=void 0,w.value=Be}),le=await m.api(X);ae(),e.nextTick(()=>g.value=le);let he=i.mapGet(le.response,"results")||[];!le.succeeded||he.label==0}function De(){let D={include:"total",take:M.value},P=S(f.value.selectedColumns||n.selectedColumns);if(P.length>0){let ae=G.value;ae&&P.includes(ae.name)&&(P=[ae.name,...P]),D.fields=P.join(",")}let X=[];return E.value.forEach(ae=>{ae.settings.sort&&X.push((ae.settings.sort==="DESC"?"-":"")+ae.name),ae.settings.filters.forEach(le=>{let he=le.key.replace("%",ae.name);D[he]=le.value})}),typeof D.skip>"u"&&k.value>0&&(D.skip=k.value),X.length>0&&(D.orderBy=X.join(",")),D}async function Ve(){E.value.forEach(D=>{D.settings={filters:[]},c.removeItem(z(D.name))}),await me()}return e.onMounted(async()=>{const D=n.prefs||kt(c.getItem(K()));D&&(f.value=D),E.value=b.value.map(P=>({name:P.name,type:P.type,meta:P,settings:Object.assign({filters:[]},kt(c.getItem(z(P.name))))})),isNaN(n.skip)||(k.value=n.skip),await me()}),(D,P)=>{const X=e.resolveComponent("ErrorSummary"),ae=e.resolveComponent("Loading"),le=e.resolveComponent("SettingsIcons"),he=e.resolveComponent("DataGrid"),Be=e.resolveComponent("ModalDialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[t.refInfo?(e.openBlock(),e.createBlock(Be,{key:0,ref_key:"modalDialog",ref:_,id:t.id,onDone:re},{default:e.withCtx(()=>[e.createElementVNode("div",$m,[e.createElementVNode("div",Em,[e.createElementVNode("h3",Bm,[e.createTextVNode(" Select "),e.createElementVNode("span",_m,e.toDisplayString(e.unref(i.humanize)(t.refInfo.model)),1)]),e.createElementVNode("div",Nm,[t.showPreferences?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:`${t.refInfo.model} Preferences`,onClick:P[0]||(P[0]=se=>Y.value=!Y.value)},Lm,8,Sm)):e.createCommentVNode("",!0),t.showPagingNav?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["pl-2",e.unref(A)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!e.unref(A),onClick:P[1]||(P[1]=se=>H(-e.unref(B)))},Dm,10,Mm)):e.createCommentVNode("",!0),t.showPagingNav?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["pl-2",e.unref(j)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!e.unref(j),onClick:P[2]||(P[2]=se=>H(-e.unref(M)))},zm,10,Am)):e.createCommentVNode("",!0),t.showPagingNav?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:e.normalizeClass(["pl-2",e.unref(O)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!e.unref(O),onClick:P[3]||(P[3]=se=>H(e.unref(M)))},Pm,10,Tm)):e.createCommentVNode("",!0),t.showPagingNav?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",class:e.normalizeClass(["pl-2",e.unref(Q)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!e.unref(Q),onClick:P[4]||(P[4]=se=>H(e.unref(B)))},Im,10,Fm)):e.createCommentVNode("",!0)]),t.showPagingInfo?(e.openBlock(),e.createElementBlock("div",jm,[e.createElementVNode("div",Om,[w.value?(e.openBlock(),e.createElementBlock("span",Rm,"Querying...")):e.createCommentVNode("",!0),e.unref(N).length?(e.openBlock(),e.createElementBlock("span",Hm,[Um,e.createTextVNode(" "+e.toDisplayString(k.value+1)+" - "+e.toDisplayString(Math.min(k.value+e.unref(N).length,e.unref(B)))+" ",1),e.createElementVNode("span",null," of "+e.toDisplayString(e.unref(B)),1)])):g.value.completed?(e.openBlock(),e.createElementBlock("span",qm,"No Results")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.unref(h)&&t.showResetPreferences?(e.openBlock(),e.createElementBlock("div",Qm,[e.createElementVNode("button",{type:"button",onClick:Ve,title:"Reset Preferences & Filters",class:e.normalizeClass(e.unref(d))},Gm,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Km,[t.showFiltersView&&e.unref($)>0?(e.openBlock(),e.createElementBlock("div",Wm,[e.createElementVNode("button",{type:"button",onClick:P[5]||(P[5]=se=>V.value=V.value=="filters"?null:"filters"),class:e.normalizeClass(e.unref(d)),"aria-expanded":"false"},[Zm,e.createElementVNode("span",Jm,e.toDisplayString(e.unref($))+" "+e.toDisplayString(e.unref($)==1?"Filter":"Filters"),1),V.value!="filters"?(e.openBlock(),e.createElementBlock("svg",Xm,Ym)):(e.openBlock(),e.createElementBlock("svg",vm,e0))],2)])):e.createCommentVNode("",!0)])]),V.value=="filters"?(e.openBlock(),e.createBlock(on,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:e.unref(u),columns:E.value,onDone:P[6]||(P[6]=se=>V.value=null),onChange:te},null,8,["definitions","columns"])):e.createCommentVNode("",!0),J.value?(e.openBlock(),e.createElementBlock("div",t0,[e.createVNode(nn,{definitions:e.unref(u),column:J.value.column,"top-left":J.value.topLeft,onDone:ge,onSave:pe},null,8,["definitions","column","top-left"])])):e.createCommentVNode("",!0),g.value.error?(e.openBlock(),e.createBlock(X,{key:2,status:g.value.error},null,8,["status"])):w.value?(e.openBlock(),e.createBlock(ae,{key:3})):(e.openBlock(),e.createElementBlock("div",n0,[e.unref(N).length?(e.openBlock(),e.createElementBlock("div",o0,[e.createVNode(he,{id:t.id,items:e.unref(N),type:t.refInfo.model,"selected-columns":e.unref(L),onFiltersChanged:me,tableStyle:"fullWidth",rowClass:T,onRowSelected:ne,onHeaderSelected:Z},e.createSlots({header:e.withCtx(({column:se,label:we})=>{var _e;return[t.allowFiltering&&(!n.canFilter||n.canFilter(se))?(e.openBlock(),e.createElementBlock("div",l0,[e.createElementVNode("span",a0,e.toDisplayString(we),1),e.createVNode(le,{column:E.value.find(Ie=>Ie.name.toLowerCase()===se.toLowerCase()),"is-open":((_e=J.value)==null?void 0:_e.column.name)===se},null,8,["column","is-open"])])):(e.openBlock(),e.createElementBlock("div",s0,[e.createElementVNode("span",r0,e.toDisplayString(we),1)]))]}),_:2},[e.renderList(Object.keys(e.unref(l)),se=>({name:se,fn:e.withCtx(we=>[e.renderSlot(D.$slots,se,e.normalizeProps(e.guardReactiveProps(we)))])}))]),1032,["id","items","type","selected-columns"])])):e.createCommentVNode("",!0)]))])]),_:3},8,["id"])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createBlock(ln,{key:1,columns:e.unref(b),prefs:f.value,onDone:P[7]||(P[7]=se=>Y.value=!1),onSave:be},null,8,["columns","prefs"])):e.createCommentVNode("",!0)],64)}}}),c0={class:"sm:hidden"},d0=["for"],m0=["id","name"],f0=["value"],u0={class:"hidden sm:block"},p0={class:"border-b border-gray-200"},h0={class:"-mb-px flex","aria-label":"Tabs"},g0=["onClick"],y0=e.defineComponent({__name:"Tabs",props:{tabs:null,id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:t=>i.humanize(t)},selected:null,tabClass:null,bodyClass:{default:"p-4"},url:{type:Boolean,default:!0}},setup(t){const o=t,n=e.computed(()=>Object.keys(o.tabs)),l=u=>o.label?o.label(u):i.humanize(u),a=e.computed(()=>o.id||"tabs"),s=e.computed(()=>o.param||"tab"),r=e.ref();function m(u){if(r.value=u,o.url){const p=n.value[0];Pt({tab:u===p?void 0:u})}}function c(u){return r.value===u}const d=e.computed(()=>`${100/Object.keys(o.tabs).length}%`);return e.onMounted(()=>{if(r.value=Object.keys(o.tabs)[0],o.url){const p=i.queryString(location.search)[s.value];p&&(r.value=p)}}),(u,p)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",c0,[e.createElementVNode("label",{for:e.unref(a),class:"sr-only"},"Select a tab",8,d0),e.createElementVNode("select",{id:e.unref(a),name:e.unref(a),class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:p[0]||(p[0]=f=>{var g;return m((g=f.target)==null?void 0:g.value)})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),f=>(e.openBlock(),e.createElementBlock("option",{key:f,value:f},e.toDisplayString(l(f)),9,f0))),128))],40,m0)]),e.createElementVNode("div",u0,[e.createElementVNode("div",p0,[e.createElementVNode("nav",h0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),f=>(e.openBlock(),e.createElementBlock("a",{href:"#",onClick:e.withModifiers(g=>m(f),["prevent"]),style:e.normalizeStyle({width:e.unref(d)}),class:e.normalizeClass([c(f)?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm",t.tabClass])},e.toDisplayString(l(f)),15,g0))),256))])])]),e.createElementVNode("div",{class:e.normalizeClass(t.bodyClass)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tabs[r.value])))],2)]))}}),k0=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[e.createElementVNode("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1)],b0=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[e.createElementVNode("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1)],w0=e.defineComponent({__name:"DarkModeToggle",setup(t){const o=typeof document<"u"?document.querySelector("html"):null;let n=e.ref(o==null?void 0:o.classList.contains("dark"));function l(){n.value?o==null||o.classList.remove("dark"):o==null||o.classList.add("dark"),n.value=!n.value,localStorage.setItem("color-scheme",n.value?"dark":"light")}return(a,s)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:s[0]||(s[0]=r=>l())},[e.createElementVNode("span",{class:e.normalizeClass(`${e.unref(n)?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[e.createElementVNode("span",{class:e.normalizeClass(`${e.unref(n)?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},k0,2),e.createElementVNode("span",{class:e.normalizeClass(`${e.unref(n)?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},b0,2)],2)]))}}),C0={key:0},x0={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},V0={class:"sm:mx-auto sm:w-full sm:max-w-md"},$0={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},E0={key:0,class:"mt-4 text-center text-sm text-gray-600"},B0={class:"relative z-0 inline-flex shadow-sm rounded-md"},_0={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},N0={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},S0=["onSubmit"],L0={class:"mt-8"},M0={key:1,class:"mt-6"},D0=e.createStaticVNode('<div class="relative"><div class="absolute inset-0 flex items-center"><div class="w-full border-t border-gray-300"></div></div><div class="relative flex justify-center text-sm"><span class="px-2 bg-white text-gray-500"> Or continue with </span></div></div>',1),A0={class:"mt-6 grid grid-cols-3 gap-3"},z0=["href","title"],T0={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},P0=[e.createElementVNode("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1)],F0={Alert:Do,AlertSuccess:Ho,ErrorSummary:Ko,InputDescription:Zo,Icon:qn,Loading:Nl,OutlineButton:Ml,PrimaryButton:zl,SecondaryButton:Fl,TextLink:jl,Breadcrumbs:Ql,Breadcrumb:Jl,NavList:vl,NavListItem:da,AutoQueryGrid:ur,SettingsIcons:xr,FilterViews:on,FilterColumn:nn,QueryPrefs:ln,EnsureAccess:Kn,EnsureAccessDialog:Vr,TextInput:Dr,TextareaInput:jr,SelectInput:Qr,CheckboxInput:vr,TagInput:wi,FileInput:Hi,Autocomplete:tc,Combobox:lc,DynamicInput:ac,LookupInput:bc,AutoFormFields:wc,AutoForm:Nc,AutoCreateForm:Xc,AutoEditForm:wd,ConfirmDelete:Vd,FormLoading:Nd,DataGrid:Ad,CellFormat:qd,PreviewFormat:Jd,HtmlFormat:tm,CloseButton:lm,SlideOver:km,ModalDialog:Vm,ModalLookup:i0,Tabs:y0,DarkModeToggle:w0,SignIn:e.defineComponent({__name:"SignIn",props:{provider:null,title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(t,{emit:o}){const n=t,{getMetadata:l,createDto:a}=Ee(),s=it(),{signIn:r}=Nt(),m=l({assert:!0}),c=m.plugins.auth,d=document.baseURI,u=m.app.baseUrl,p=e.ref(a("Authenticate")),f=e.ref(new i.ApiResult);e.onMounted(()=>{c==null||c.authProviders.map(N=>N.formLayout).filter(N=>N).forEach(N=>N.forEach(B=>p.value[B.id]=""))});const g=e.computed(()=>(c==null?void 0:c.authProviders.filter(N=>N.formLayout))||[]),k=e.computed(()=>g.value[0]||{}),w=e.computed(()=>g.value[Math.max(g.value.length-1,0)]||{}),V=e.computed(()=>(n.provider?c==null?void 0:c.authProviders.find(N=>N.name===n.provider):null)??k.value),S=N=>N===!1||N==="false";function T(N){return N.label||N.navItem&&N.navItem.label}const F=e.computed(()=>{var N;return(((N=V.value)==null?void 0:N.formLayout)||[]).map(B=>{var A,j;return Object.assign({},B,{type:(A=B.type)==null?void 0:A.toLowerCase(),autocomplete:B.autocomplete||(((j=B.type)==null?void 0:j.toLowerCase())==="password"?"current-password":void 0)||(B.id.toLowerCase()==="username"?"username":void 0),css:Object.assign({field:"col-span-12"},B.css)})})}),I=e.computed(()=>S(n.oauth)?[]:(c==null?void 0:c.authProviders.filter(N=>N.type==="oauth"))||[]),b=e.computed(()=>{let N=i.each(c==null?void 0:c.authProviders.filter(A=>A.formLayout&&A.formLayout.length>0),(A,j)=>{let O=T(j)||i.toPascalCase(j.name);A[O]=j.name===k.value.name?"":j.name});const B=V.value;return B&&S(n.tabs)&&(N={[T(B)||i.toPascalCase(B.name)]:B}),N}),L=e.computed(()=>{let N=F.value.map(B=>B.id).filter(B=>B);return f.value.summaryMessage(N)});async function M(){if(p.value.provider=V.value.name,f.value=await s.api(p.value),f.value.succeeded){const N=f.value.response;r(N),o("login",N),f.value=new i.ApiResult,p.value=a("Authenticate")}}return(N,B)=>{const A=e.resolveComponent("ErrorSummary"),j=e.resolveComponent("AutoFormFields"),O=e.resolveComponent("PrimaryButton"),Q=e.resolveComponent("Icon"),E=e.resolveDirective("href");return e.unref(c)?(e.openBlock(),e.createElementBlock("div",x0,[e.createElementVNode("div",V0,[e.createElementVNode("h2",$0,e.toDisplayString(t.title),1),Object.keys(e.unref(b)).length>1?(e.openBlock(),e.createElementBlock("p",E0,[e.createElementVNode("span",B0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(h,$)=>e.withDirectives((e.openBlock(),e.createElementBlock("a",{class:e.normalizeClass([h===""||h===e.unref(k).name?"rounded-l-md":h===e.unref(w).name?"rounded-r-md -ml-px":"-ml-px",t.provider===h?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"])},[e.createTextVNode(e.toDisplayString($),1)],2)),[[E,{provider:h}]])),256))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_0,[e.unref(L)?(e.openBlock(),e.createBlock(A,{key:0,class:"mb-3",errorSummary:e.unref(L)},null,8,["errorSummary"])):e.createCommentVNode("",!0),e.createElementVNode("div",N0,[e.unref(F).length?(e.openBlock(),e.createElementBlock("form",{key:0,onSubmit:e.withModifiers(M,["prevent"])},[e.createVNode(j,{modelValue:p.value,formLayout:e.unref(F),api:f.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),e.createElementVNode("div",L0,[e.createVNode(O,{class:"w-full"},{default:e.withCtx(()=>[e.createTextVNode("Sign In")]),_:1})])],40,S0)):e.createCommentVNode("",!0),e.unref(I).length?(e.openBlock(),e.createElementBlock("div",M0,[D0,e.createElementVNode("div",A0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(I),h=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("a",{href:e.unref(u)+h.navItem.href+"?continue="+e.unref(d),title:T(h),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"},[h.icon?(e.openBlock(),e.createBlock(Q,{key:0,image:h.icon,class:"h-5 w-5 text-gray-700"},null,8,["image"])):(e.openBlock(),e.createElementBlock("svg",T0,P0))],8,z0)]))),256))])])):e.createCommentVNode("",!0)])])])):(e.openBlock(),e.createElementBlock("div",C0,"No Auth Plugin"))}}})},I0=["onClick","title"],j0={RouterLink:e.defineComponent({__name:"RouterLink",props:{to:null},setup(t){const o=t,{config:n}=Fe(),l=()=>n.value.navigate(o.to??"/");return(a,s)=>(e.openBlock(),e.createElementBlock("a",e.mergeProps({onClick:e.withModifiers(l,["prevent"]),title:t.to,href:"javascript:void(0)"},a.$attrs),[e.renderSlot(a.$slots,"default")],16,I0))}})},mn=F0,O0={install(t){Object.keys(mn).forEach(o=>{t.component(o,mn[o])})},component(t){return t&&(mn[t]||j0[t])||null}};ie.css=Il,ie.default=O0,ie.useAuth=Nt,ie.useClient=it,ie.useConfig=Fe,ie.useFiles=al,ie.useFormatters=Ud,ie.useMetadata=Ee,ie.useUtils=xn,Object.defineProperties(ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});