fastapi-rtk 0.0.39 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fastapi-rtk.es.js +5 -12
- package/dist/fastapi-rtk.umd.js +2 -2
- package/package.json +1 -1
package/dist/fastapi-rtk.es.js
CHANGED
|
@@ -3455,14 +3455,7 @@ function Ah({ form: e, name: t, items: r, ...n }) {
|
|
|
3455
3455
|
);
|
|
3456
3456
|
}
|
|
3457
3457
|
function ks({ form: e, name: t, ...r }) {
|
|
3458
|
-
return t === "password" ? /* @__PURE__ */ d.jsx(kc, { ...e.getInputProps(t), ...r }) : /* @__PURE__ */ d.jsx(
|
|
3459
|
-
Ic,
|
|
3460
|
-
{
|
|
3461
|
-
...e.getInputProps(t),
|
|
3462
|
-
value: e.getInputProps(t).value || "",
|
|
3463
|
-
...r
|
|
3464
|
-
}
|
|
3465
|
-
);
|
|
3458
|
+
return t === "password" ? /* @__PURE__ */ d.jsx(kc, { ...e.getInputProps(t), value: e.getInputProps(t).value || "", ...r }) : /* @__PURE__ */ d.jsx(Ic, { ...e.getInputProps(t), value: e.getInputProps(t).value || "", ...r });
|
|
3466
3459
|
}
|
|
3467
3460
|
const $h = /choices=\[([^\]]*)\]/;
|
|
3468
3461
|
function Ph({ form: e, name: t, items: r, ...n }) {
|
|
@@ -4686,8 +4679,8 @@ function ya({
|
|
|
4686
4679
|
classNames: i,
|
|
4687
4680
|
styles: s,
|
|
4688
4681
|
props: c
|
|
4689
|
-
}), h = Be("FieldTitle", y, c), { hovered: b, ref: E } = zd(), C = r && f.order_column === r;
|
|
4690
|
-
return /* @__PURE__ */ d.jsx(
|
|
4682
|
+
}), h = Be("FieldTitle", y, c), { hovered: b, ref: E } = zd(), C = r && f.order_column === r, j = g("wrapper");
|
|
4683
|
+
return j.style.cursor = r ? j.style.cursor : "auto", /* @__PURE__ */ d.jsx(
|
|
4691
4684
|
Re.Th,
|
|
4692
4685
|
{
|
|
4693
4686
|
className: Ys.fieldTitleRoot,
|
|
@@ -4696,14 +4689,14 @@ function ya({
|
|
|
4696
4689
|
order_column: r,
|
|
4697
4690
|
order_direction: f.order_direction === "asc" ? "desc" : "asc"
|
|
4698
4691
|
}) : null,
|
|
4699
|
-
children: /* @__PURE__ */ d.jsx(De, { ref: E, ...
|
|
4692
|
+
children: /* @__PURE__ */ d.jsx(De, { ref: E, ...j, children: e === "Checkbox" ? /* @__PURE__ */ d.jsx(ui, { pb: 5, pl: 2, onChange: o, checked: a }) : /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
4700
4693
|
/* @__PURE__ */ d.jsx(
|
|
4701
4694
|
De,
|
|
4702
4695
|
{
|
|
4703
4696
|
w: "100%",
|
|
4704
4697
|
fw: h.fw,
|
|
4705
4698
|
size: "xl",
|
|
4706
|
-
c: b ? h.hoverColor : C ? h.selectedColor : h.color,
|
|
4699
|
+
c: b && r ? h.hoverColor : C ? h.selectedColor : h.color,
|
|
4707
4700
|
children: l || t || e
|
|
4708
4701
|
}
|
|
4709
4702
|
),
|
package/dist/fastapi-rtk.umd.js
CHANGED
|
@@ -32,7 +32,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
32
32
|
<%s key={someKey} {...props} />`,et,xe,ir,xe),Di[xe+et]=!0}}return m===n?Mi(j):Ri(j),j}}function Dr(m,E,I){return ot(m,E,I,!0)}function Ni(m,E,I){return ot(m,E,I,!1)}var Fi=Ni,Li=Dr;Lr.Fragment=n,Lr.jsx=Fi,Lr.jsxs=Li}()),Lr}process.env.NODE_ENV==="production"?Ui.exports=kd():Ui.exports=jd();var d=Ui.exports;function Be({path:e,method:t,body:r=void 0,queryParams:n=void 0}){Object.entries(n||{}).forEach(([a,o])=>{(Array.isArray(o)||typeof o=="object")&&(o=JSON.stringify(o)),e.includes("?")||(e+="?"),e+=`${a}=${o}&`}),e.endsWith("&")&&(e=e.slice(0,-1));const i={method:t,mode:"cors",credentials:"include",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:r?JSON.stringify(r):null};return{fetchPath:e,options:i}}function $d(e){const t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);e[0].match(/^[^/:]+:\/*$/)&&e.length>1&&(e[0]=e.shift()+e[0]),e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(let i=0;i<e.length;i++){let a=e[i];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(i>0&&(a=a.replace(/^[\/]+/,"")),i<e.length-1?a=a.replace(/[\/]+$/,""):a=a.replace(/[\/]+$/,"/"),t.push(a))}let r=t.join("/");r=r.replace(/\/(\?|&|#[^!])/g,"$1");const n=r.split("?");return r=n.shift()+(n.length>0?"?":"")+n.join("&"),r}function Pe(...e){const t=Array.from(Array.isArray(e[0])?e[0]:e);return $d(t)}function yn(e,{autoInvoke:t=!0,initialLoading:r=!1,clearDataOnRefetch:n=!1,...i}={}){const[a,o]=T.useState(null),[s,l]=T.useState(r),[u,f]=T.useState(null),c=T.useRef(null),p=T.useCallback(()=>{if(e)return n&&o(null),f(null),c.current&&c.current.abort(),c.current=new AbortController,l(!0),fetch(e,{signal:c.current.signal,...i}).then(async g=>{const h=await g.json();if(!g.ok)throw new Error(h.detail);return o(h),l(!1),h}).catch(g=>(g&&g.name!=="AbortError"&&(f(g),l(!1)),g))},[e]),y=T.useCallback(()=>{var g;c.current&&((g=c.current)==null||g.abort(""),l(!1))},[]);return T.useEffect(()=>(t&&p(),()=>{c.current&&c.current.abort("")}),[p,t]),{data:a,loading:s,error:u,refetch:p,abort:y}}function zo({path:e,autoInvoke:t=!0,initialLoading:r=!0}){const{fetchPath:n,options:i}=T.useMemo(()=>Be({path:Pe(e,"auth/user"),method:"GET"}),[e]),{data:a,loading:o,refetch:s,error:l}=yn(n,{autoInvoke:t,initialLoading:r,...i});return{user:a,loading:o,refetch:s,error:l}}function Uo({path:e,queryParams:t,autoInvoke:r=!0,clearDataOnRefetch:n=!1}){const{fetchPath:i,options:a}=T.useMemo(()=>Be({path:Pe(e,"/"),method:"GET",queryParams:t}),[e,t]),{data:o,loading:s,refetch:l,error:u}=yn(i,{autoInvoke:r,clearDataOnRefetch:n,...a});return{data:T.useMemo(()=>{if(!o)return null;const c=o.result.map((p,y)=>{const g=o.ids[y];return typeof g=="object"?{...p,...g}:{...p,id:g}});return{...o,result:c}},[o]),loading:s,refetch:l,error:u}}const Id=async(e,t)=>{const{fetchPath:r,options:n}=Be({path:Pe(e,"/"),method:"POST",body:t}),i=await fetch(r,n),a=await i.json();if(i.ok)return a;throw new Error(a.detail)},Rd=async(e,t)=>{const{fetchPath:r,options:n}=Be({path:Pe(e,t.toString()),method:"DELETE"}),i=await fetch(r,n),a=await i.json();if(i.ok)return a;throw new Error(a.detail)},Md=async(e,t)=>{const{fetchPath:r,options:n}=Be({path:Pe(e,t.toString()),method:"GET"}),i=await fetch(r,n),a=await i.json();if(i.ok)return a;throw new Error(a.detail)},Dd=async(e,t,r)=>{const{fetchPath:n,options:i}=Be({path:Pe(e,t.toString()),method:"PUT",body:r}),a=await fetch(n,i),o=await a.json();if(a.ok)return o;throw new Error(o.detail)},Fe=e=>e&&typeof e=="object"?JSON.stringify(e):e;function Bo(e,t){const r=e||{columns:[],filters:[],page:0,page_size:25};return t.hasOwnProperty("columns")&&(r.columns=t.columns),t.hasOwnProperty("filters")&&(r.filters=t.filters),t.hasOwnProperty("order_column")&&(r.order_column=t.order_column),t.hasOwnProperty("order_direction")&&(r.order_direction=t.order_direction),t.hasOwnProperty("page")&&(r.page=t.page),t.hasOwnProperty("page_size")&&(r.page_size=t.page_size),r}const Vo=e=>{const t={};for(const r of e)switch(r.type){case"RelatedList":t[r.name]=[];break;case"Related":t[r.name]=void 0;break;case"Boolean":t[r.name]="false";break;case"Date":case"DateTime":t[r.name]=void 0;break;case"Integer":case"Float":t[r.name]=void 0;break;default:t[r.name]=""}return t};function qt(e){this._maxSize=e,this.clear()}qt.prototype.clear=function(){this._size=0,this._values=Object.create(null)},qt.prototype.get=function(e){return this._values[e]},qt.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var Nd=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Wo=/^\d+$/,Fd=/^\d/,Ld=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,zd=/^\s*(['"]?)(.*?)(\1)\s*$/,Bi=512,Ho=new qt(Bi),Go=new qt(Bi),qo=new qt(Bi),Yt={Cache:qt,split:Wi,normalizePath:Vi,setter:function(e){var t=Vi(e);return Go.get(e)||Go.set(e,function(n,i){for(var a=0,o=t.length,s=n;a<o-1;){var l=t[a];if(l==="__proto__"||l==="constructor"||l==="prototype")return n;s=s[t[a++]]}s[t[a]]=i})},getter:function(e,t){var r=Vi(e);return qo.get(e)||qo.set(e,function(i){for(var a=0,o=r.length;a<o;)if(i!=null||!t)i=i[r[a++]];else return;return i})},join:function(e){return e.reduce(function(t,r){return t+(Hi(r)||Wo.test(r)?"["+r+"]":(t?".":"")+r)},"")},forEach:function(e,t,r){Ud(Array.isArray(e)?e:Wi(e),t,r)}};function Vi(e){return Ho.get(e)||Ho.set(e,Wi(e).map(function(t){return t.replace(zd,"$2")}))}function Wi(e){return e.match(Nd)||[""]}function Ud(e,t,r){var n=e.length,i,a,o,s;for(a=0;a<n;a++)i=e[a],i&&(Wd(i)&&(i='"'+i+'"'),s=Hi(i),o=!s&&/^\d+$/.test(i),t.call(r,i,s,o,a,e))}function Hi(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Bd(e){return e.match(Fd)&&!e.match(Wo)}function Vd(e){return Ld.test(e)}function Wd(e){return!Hi(e)&&(Bd(e)||Vd(e))}const Hd=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,vn=e=>e.match(Hd)||[],bn=e=>e[0].toUpperCase()+e.slice(1),Gi=(e,t)=>vn(e).join(t).toLowerCase(),Yo=e=>vn(e).reduce((t,r)=>`${t}${t?r[0].toUpperCase()+r.slice(1).toLowerCase():r.toLowerCase()}`,"");var qi={words:vn,upperFirst:bn,camelCase:Yo,pascalCase:e=>bn(Yo(e)),snakeCase:e=>Gi(e,"_"),kebabCase:e=>Gi(e,"-"),sentenceCase:e=>bn(Gi(e," ")),titleCase:e=>vn(e).map(bn).join(" ")},Yi={exports:{}};Yi.exports=function(e){return Ko(Gd(e),e)},Yi.exports.array=Ko;function Ko(e,t){var r=e.length,n=new Array(r),i={},a=r,o=qd(t),s=Yd(e);for(t.forEach(function(u){if(!s.has(u[0])||!s.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||l(e[a],a,new Set);return n;function l(u,f,c){if(c.has(u)){var p;try{p=", node was:"+JSON.stringify(u)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[f]){i[f]=!0;var y=o.get(u)||new Set;if(y=Array.from(y),f=y.length){c.add(u);do{var g=y[--f];l(g,s.get(g),c)}while(f);c.delete(u)}n[--r]=u}}}function Gd(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var i=e[r];t.add(i[0]),t.add(i[1])}return Array.from(t)}function qd(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var i=e[r];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function Yd(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}var Kd=Yi.exports;const Xd=Ot(Kd),Jd=Object.prototype.toString,Zd=Error.prototype.toString,Qd=RegExp.prototype.toString,ep=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",tp=/^Symbol\((.*)\)(.*)$/;function rp(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Xo(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return rp(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return ep.call(e).replace(tp,"Symbol($1)");const n=Jd.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+Zd.call(e)+"]":n==="RegExp"?Qd.call(e):null}function bt(e,t){let r=Xo(e,t);return r!==null?r:JSON.stringify(e,function(n,i){let a=Xo(this[n],t);return a!==null?a:i},2)}function Jo(e){return e==null?[]:[].concat(e)}let Zo,Qo,es,np=/\$\{\s*(\w+)\s*\}/g;Zo=Symbol.toStringTag;class ts{constructor(t,r,n,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Zo]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],Jo(t).forEach(a=>{if(Le.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Qo=Symbol.hasInstance,es=Symbol.toStringTag;class Le extends Error{static formatError(t,r){const n=r.label||r.path||"this";return n!==r.path&&(r=Object.assign({},r,{path:n})),typeof t=="string"?t.replace(np,(i,a)=>bt(r[a])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,i,a){const o=new ts(t,r,n,i);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[es]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Le)}static[Qo](t){return ts[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let xt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const i=n!=null&&n!==r?` (cast from the value \`${bt(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${bt(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${bt(r,!0)}\``+i}},Ke={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Dt={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Ki={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Xi={isValue:"${path} field must be ${value}"},Ji={noUnknown:"${path} field has unspecified keys: ${unknown}"},xn={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},rs={notType:e=>{const{path:t,value:r,spec:n}=e,i=n.types.length;if(Array.isArray(r)){if(r.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${r.length} for value: \`${bt(r,!0)}\``;if(r.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${r.length} for value: \`${bt(r,!0)}\``}return Le.formatError(xt.notType,e)}};var ns=Object.assign(Object.create(null),{mixed:xt,string:Ke,number:Dt,date:Ki,object:Ji,array:xn,boolean:Xi,tuple:rs});const Kt=e=>e&&e.__isYupSchema__;class _n{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:i,otherwise:a}=r,o=typeof n=="function"?n:(...s)=>s.every(l=>l===n);return new _n(t,(s,l)=>{var u;let f=o(...s)?i:a;return(u=f==null?void 0:f(l))!=null?u:l})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let n=this.refs.map(a=>a.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),i=this.fn(n,t,r);if(i===void 0||i===t)return t;if(!Kt(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}const Tn={context:"$",value:"."};function ip(e,t){return new Nt(e,t)}class Nt{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Tn.context,this.isValue=this.key[0]===Tn.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Tn.context:this.isValue?Tn.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&Yt.getter(this.path,!0),this.map=r.map}getValue(t,r,n){let i=this.isContext?n:this.isValue?t:r;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Nt.prototype.__isYupRef=!0;const pt=e=>e==null;function or(e){function t({value:r,path:n="",options:i,originalValue:a,schema:o},s,l){const{name:u,test:f,params:c,message:p,skipAbsent:y}=e;let{parent:g,context:h,abortEarly:x=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=i;function k(z){return Nt.isRef(z)?z.getValue(r,g,h):z}function M(z={}){const le=Object.assign({value:r,originalValue:a,label:o.spec.label,path:z.path||n,spec:o.spec,disableStackTrace:z.disableStackTrace||w},c,z.params);for(const ye of Object.keys(le))le[ye]=k(le[ye]);const me=new Le(Le.formatError(z.message||p,le),r,le.path,z.type||u,le.disableStackTrace);return me.params=le,me}const N=x?s:l;let _={path:n,parent:g,type:u,from:i.from,createError:M,resolve:k,options:i,originalValue:a,schema:o};const R=z=>{Le.isError(z)?N(z):z?l(null):N(M())},F=z=>{Le.isError(z)?N(z):s(z)};if(y&&pt(r))return R(!0);let ee;try{var ae;if(ee=f.call(_,r,_),typeof((ae=ee)==null?void 0:ae.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(ee).then(R,F)}}catch(z){F(z);return}R(ee)}return t.OPTIONS=e,t}function Zi(e,t,r,n=r){let i,a,o;return t?(Yt.forEach(t,(s,l,u)=>{let f=l?s.slice(1,s.length-1):s;e=e.resolve({context:n,parent:i,value:r});let c=e.type==="tuple",p=u?parseInt(f,10):0;if(e.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&p>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[p],e=c?e.spec.types[p]:e.innerType}if(!u){if(!e.fields||!e.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=r,r=r&&r[f],e=e.fields[f]}a=f,o=l?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}function ap(e,t,r,n){return Zi(e,t,r,n).schema}class En extends Set{describe(){const t=[];for(const r of this.values())t.push(Nt.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const n of this.values())r.push(t(n));return r}clone(){return new En(this.values())}merge(t,r){const n=this.clone();return t.forEach(i=>n.add(i)),r.forEach(i=>n.delete(i)),n}}function sr(e,t=new Map){if(Kt(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=sr(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,i]of e.entries())r.set(n,sr(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(sr(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=sr(i,t)}else throw Error(`Unable to clone ${e}`);return r}class ze{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new En,this._blacklist=new En,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(xt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=sr(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let n=t(this);return this._mutate=r,n}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,n=t.clone();const i=Object.assign({},r.spec,n.spec);return n.spec=i,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),n._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((i,a)=>a.resolve(i,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,n,i,a;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(n=t.abortEarly)!=null?n:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,r={}){let n=this.resolve(Object.assign({value:t},r)),i=r.assert==="ignore-optionality",a=n._cast(t,r);if(r.assert!==!1&&!n.isType(a)){if(i&&pt(a))return a;let o=bt(t),s=bt(a);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
|
33
33
|
|
|
34
34
|
attempted value: ${o}
|
|
35
|
-
`+(s!==o?`result of cast: ${s}`:""))}return a}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,i){let{path:a,originalValue:o=t,strict:s=this.spec.strict}=r,l=t;s||(l=this._cast(l,Object.assign({assert:!1},r)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:a,value:l,originalValue:o,options:r,tests:u},n,f=>{if(f.length)return i(f,l);this.runTests({path:a,value:l,originalValue:o,options:r,tests:this.tests},n,i)})}runTests(t,r,n){let i=!1,{tests:a,value:o,originalValue:s,path:l,options:u}=t,f=h=>{i||(i=!0,r(h,o))},c=h=>{i||(i=!0,n(h,o))},p=a.length,y=[];if(!p)return c([]);let g={value:o,originalValue:s,path:l,options:u,schema:this};for(let h=0;h<a.length;h++){const x=a[h];x(g,f,function(k){k&&(Array.isArray(k)?y.push(...k):y.push(k)),--p<=0&&c(y)})}}asNestedTest({key:t,index:r,parent:n,parentPath:i,originalParent:a,options:o}){const s=t??r;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let u=n[s];const f=Object.assign({},o,{strict:!0,parent:n,value:u,originalValue:a[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${i||""}[${l?s:`"${s}"`}]`:(i?`${i}.`:"")+t});return(c,p,y)=>this.resolve(f)._validate(u,f,p,y)}validate(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return new Promise((o,s)=>i._validate(t,r,(l,u)=>{Le.isError(l)&&(l.value=u),s(l)},(l,u)=>{l.length?s(new Le(l,u,void 0,void 0,a)):o(u)}))}validateSync(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a,o=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return i._validate(t,Object.assign({},r,{sync:!0}),(s,l)=>{throw Le.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new Le(s,t,void 0,void 0,o);a=l}),a}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(Le.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(Le.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):sr(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=or({message:r,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=or({message:r,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=xt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=xt.notNull){return this.nullability(!1,t)}required(t=xt.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=xt.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=or(r),a=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(o=>!(o.OPTIONS.name===r.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),n.tests.push(i),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),i=Jo(t).map(a=>new Nt(a));return i.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(typeof r=="function"?new _n(i,r):_n.fromOptions(i,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=or({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=xt.oneOf){let n=this.clone();return t.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n.internalTests.whiteList=or({message:r,name:"oneOf",skipAbsent:!0,test(i){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),n}notOneOf(t,r=xt.notOneOf){let n=this.clone();return t.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n.internalTests.blacklist=or({message:r,name:"notOneOf",test(i){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:i,optional:a,nullable:o}=r.spec;return{meta:i,label:n,optional:a,nullable:o,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,f)=>f.findIndex(c=>c.name===l.name)===u)}}}ze.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ze.prototype[`${e}At`]=function(t,r,n={}){const{parent:i,parentPath:a,schema:o}=Zi(this,t,r,n.context);return o[e](i&&i[a],Object.assign({},n,{parent:i,path:t}))};for(const e of["equals","is"])ze.prototype[e]=ze.prototype.oneOf;for(const e of["not","nope"])ze.prototype[e]=ze.prototype.notOneOf;const op=()=>!0;function Sn(e){return new Qi(e)}class Qi extends ze{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:op},t))}}Sn.prototype=Qi.prototype;function ea(){return new ta}class ta extends ze{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(n.spec.coerce&&!n.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Xi.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return pt(r)||r===!0}})}isFalse(t=Xi.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return pt(r)||r===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}ea.prototype=ta.prototype;const sp=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function lp(e){const t=ra(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function ra(e){var t,r;const n=sp.exec(e);return n?{year:At(n[1]),month:At(n[2],1)-1,day:At(n[3],1),hour:At(n[4]),minute:At(n[5]),second:At(n[6]),millisecond:n[7]?At(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:At(n[10]),minuteOffset:At(n[11])}:null}function At(e,t=0){return Number(e)||t}let up=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,cp=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,fp=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,dp="^\\d{4}-\\d{2}-\\d{2}",pp="\\d{2}:\\d{2}:\\d{2}",hp="(([+-]\\d{2}(:?\\d{2})?)|Z)",mp=new RegExp(`${dp}T${pp}(\\.\\d+)?${hp}$`),gp=e=>pt(e)||e===e.trim(),yp={}.toString();function wn(){return new na}class na extends ze{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===yp?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||xt.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=Ke.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=Ke.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=Ke.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,i,a;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:i,name:a}=r:i=r),this.test({name:a||"matches",message:i||Ke.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&n||o.search(t)!==-1})}email(t=Ke.email){return this.matches(up,{name:"email",message:t,excludeEmptyString:!0})}url(t=Ke.url){return this.matches(cp,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Ke.uuid){return this.matches(fp,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,i;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:i=void 0}=t:r=t),this.matches(mp,{name:"datetime",message:r||Ke.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||Ke.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:a=>{if(!a||n)return!0;const o=ra(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:r||Ke.datetime_precision,params:{precision:i},skipAbsent:!0,test:a=>{if(!a||i==null)return!0;const o=ra(a);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Ke.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:gp})}lowercase(t=Ke.lowercase){return this.transform(r=>pt(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>pt(r)||r===r.toLowerCase()})}uppercase(t=Ke.uppercase){return this.transform(r=>pt(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>pt(r)||r===r.toUpperCase()})}}wn.prototype=na.prototype;let vp=e=>e!=+e;function is(){return new ia}class ia extends ze{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!vp(t)}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return n.isType(i)||i===null?i:parseFloat(i)})})}min(t,r=Dt.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(t)}})}max(t,r=Dt.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(t)}})}lessThan(t,r=Dt.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(n){return n<this.resolve(t)}})}moreThan(t,r=Dt.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=Dt.positive){return this.moreThan(0,t)}negative(t=Dt.negative){return this.lessThan(0,t)}integer(t=Dt.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>pt(t)?t:t|0)}round(t){var r;let n=["ceil","floor","round","trunc"];if(t=((r=t)==null?void 0:r.toLowerCase())||"round",t==="trunc")return this.truncate();if(n.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(i=>pt(i)?i:Math[t](i))}}is.prototype=ia.prototype;let as=new Date(""),bp=e=>Object.prototype.toString.call(e)==="[object Date]";function aa(){return new lr}class lr extends ze{constructor(){super({type:"date",check(t){return bp(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=lp(t),isNaN(t)?lr.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(Nt.isRef(t))n=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=i}return n}min(t,r=Ki.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(n)}})}max(t,r=Ki.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(n)}})}}lr.INVALID_DATE=as,aa.prototype=lr.prototype,aa.INVALID_DATE=as;function xp(e,t=[]){let r=[],n=new Set,i=new Set(t.map(([o,s])=>`${o}-${s}`));function a(o,s){let l=Yt.split(o)[0];n.add(l),i.has(`${s}-${l}`)||r.push([s,l])}for(const o of Object.keys(e)){let s=e[o];n.add(o),Nt.isRef(s)&&s.isSibling?a(s.path,o):Kt(s)&&"deps"in s&&s.deps.forEach(l=>a(l,o))}return Xd.array(Array.from(n),r).reverse()}function os(e,t){let r=1/0;return e.some((n,i)=>{var a;if((a=t.path)!=null&&a.includes(n))return r=i,!0}),r}function ss(e){return(t,r)=>os(e,t)-os(e,r)}const ls=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function Cn(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Cn(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Cn(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Cn)}):"optional"in e?e.optional():e}const _p=(e,t)=>{const r=[...Yt.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),i=Yt.getter(Yt.join(r),!0)(e);return!!(i&&n in i)};let us=e=>Object.prototype.toString.call(e)==="[object Object]";function Tp(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const Ep=ss([]);function zr(e){return new oa(e)}class oa extends ze{constructor(t){super({type:"object",check(r){return us(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=Ep,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let i=super._cast(t,r);if(i===void 0)return this.getDefault(r);if(!this._typeCheck(i))return i;let a=this.fields,o=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(c=>!this._nodes.includes(c))),l={},u=Object.assign({},r,{parent:l,__validating:r.__validating||!1}),f=!1;for(const c of s){let p=a[c],y=c in i;if(p){let g,h=i[c];u.path=(r.path?`${r.path}.`:"")+c,p=p.resolve({value:h,context:r.context,parent:l});let x=p instanceof ze?p.spec:void 0,w=x==null?void 0:x.strict;if(x!=null&&x.strip){f=f||c in i;continue}g=!r.__validating||!w?p.cast(i[c],u):i[c],g!==void 0&&(l[c]=g)}else y&&!o&&(l[c]=i[c]);(y!==c in l||l[c]!==i[c])&&(f=!0)}return f?l:i}_validate(t,r={},n,i){let{from:a=[],originalValue:o=t,recursive:s=this.spec.recursive}=r;r.from=[{schema:this,value:o},...a],r.__validating=!0,r.originalValue=o,super._validate(t,r,n,(l,u)=>{if(!s||!us(u)){i(l,u);return}o=o||u;let f=[];for(let c of this._nodes){let p=this.fields[c];!p||Nt.isRef(p)||f.push(p.asNestedTest({options:r,key:c,parent:u,parentPath:r.path,originalParent:o}))}this.runTests({tests:f,value:u,originalValue:o,options:r},n,c=>{i(c.sort(this._sortErrors).concat(l),u)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[i,a]of Object.entries(this.fields)){const o=n[i];n[i]=o===void 0?a:o}return r.withMutation(i=>i.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var i;const a=this.fields[n];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[n]})),r[n]=a&&"getDefault"in a?a.getDefault(o):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=xp(t,r),n._sortErrors=ss(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let i=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),i=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),i)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return Cn(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,i])=>t.includes(n)&&t.includes(i)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let i=Yt.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return _p(a,t)&&(o=Object.assign({},a),n||delete o[t],o[r]=i(a)),o})}json(){return this.transform(ls)}noUnknown(t=!0,r=Ji.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(i){if(i==null)return!0;const a=Tp(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Ji.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const i of Object.keys(r))n[t(i)]=r[i];return n})}camelCase(){return this.transformKeys(qi.camelCase)}snakeCase(){return this.transformKeys(qi.snakeCase)}constantCase(){return this.transformKeys(t=>qi.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[a,o]of Object.entries(r.fields)){var i;let s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[a]})),n.fields[a]=o.describe(s)}return n}}zr.prototype=oa.prototype;function sa(e){return new la(e)}class la extends ze{constructor(t){super({type:"array",spec:{types:t},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=t}_cast(t,r){const n=super._cast(t,r);if(!this._typeCheck(n)||!this.innerType)return n;let i=!1;const a=n.map((o,s)=>{const l=this.innerType.cast(o,Object.assign({},r,{path:`${r.path||""}[${s}]`}));return l!==o&&(i=!0),l});return i?a:n}_validate(t,r={},n,i){var a;let o=this.innerType,s=(a=r.recursive)!=null?a:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(l,u)=>{var f;if(!s||!o||!this._typeCheck(u)){i(l,u);return}let c=new Array(u.length);for(let y=0;y<u.length;y++){var p;c[y]=o.asNestedTest({options:r,index:y,parent:u,parentPath:r.path,originalParent:(p=r.originalValue)!=null?p:t})}this.runTests({value:u,tests:c,originalValue:(f=r.originalValue)!=null?f:t,options:r},n,y=>i(y.concat(l),u))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(ls)}concat(t){let r=super.concat(t);return r.innerType=this.innerType,t.innerType&&(r.innerType=r.innerType?r.innerType.concat(t.innerType):t.innerType),r}of(t){let r=this.clone();if(!Kt(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+bt(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=xn.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r){return r=r||xn.min,this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r){return r=r||xn.max,this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,r)=>this._typeCheck(t)?t:r==null?[]:[].concat(r))}compact(t){let r=t?(n,i,a)=>!t(n,i,a):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);if(r.innerType){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[0]})),n.innerType=r.innerType.describe(a)}return n}}sa.prototype=la.prototype;function cs(e){return new ua(e)}class ua extends ze{constructor(t){super({type:"tuple",spec:{types:t},check(r){const n=this.spec.types;return Array.isArray(r)&&r.length===n.length}}),this.withMutation(()=>{this.typeError(rs.notType)})}_cast(t,r){const{types:n}=this.spec,i=super._cast(t,r);if(!this._typeCheck(i))return i;let a=!1;const o=n.map((s,l)=>{const u=s.cast(i[l],Object.assign({},r,{path:`${r.path||""}[${l}]`}));return u!==i[l]&&(a=!0),u});return a?o:i}_validate(t,r={},n,i){let a=this.spec.types;super._validate(t,r,n,(o,s)=>{var l;if(!this._typeCheck(s)){i(o,s);return}let u=[];for(let[c,p]of a.entries()){var f;u[c]=p.asNestedTest({options:r,index:c,parent:s,parentPath:r.path,originalParent:(f=r.originalValue)!=null?f:t})}this.runTests({value:s,tests:u,originalValue:(l=r.originalValue)!=null?l:t,options:r},n,c=>i(c.concat(o),s))})}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);return n.innerType=r.spec.types.map((i,a)=>{var o;let s=t;return(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[a]})),i.describe(s)}),n}}cs.prototype=ua.prototype;function Sp(e){return new ca(e)}class ca{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(r,n={})=>{let i=this.builder(r,n);if(!Kt(i))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(i=i.optional()),i.resolve(n)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const r=new ca(this.builder);return r.spec=Object.assign({},this.spec,t),r}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,r){return this._resolve(t,r).cast(t,r)}asNestedTest(t){let{key:r,index:n,parent:i,options:a}=t,o=i[n??r];return this._resolve(o,Object.assign({},a,{value:o,parent:i})).asNestedTest(t)}validate(t,r){return this._resolve(t,r).validate(t,r)}validateSync(t,r){return this._resolve(t,r).validateSync(t,r)}validateAt(t,r,n){return this._resolve(r,n).validateAt(t,r,n)}validateSyncAt(t,r,n){return this._resolve(r,n).validateSyncAt(t,r,n)}isValid(t,r){return this._resolve(t,r).isValid(t,r)}isValidSync(t,r){return this._resolve(t,r).isValidSync(t,r)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}}function wp(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(r=>{ns[t][r]=e[t][r]})})}function Cp(e,t,r){if(!e||!Kt(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof r!="function")throw new TypeError("Method function must be provided");e.prototype[t]=r}const fs=Object.freeze(Object.defineProperty({__proto__:null,ArraySchema:la,BooleanSchema:ta,DateSchema:lr,MixedSchema:Qi,NumberSchema:ia,ObjectSchema:oa,Schema:ze,StringSchema:na,TupleSchema:ua,ValidationError:Le,addMethod:Cp,array:sa,bool:ea,boolean:ea,date:aa,defaultLocale:ns,getIn:Zi,isSchema:Kt,lazy:Sp,mixed:Sn,number:is,object:zr,printValue:bt,reach:ap,ref:ip,setLocale:wp,string:wn,tuple:cs},Symbol.toStringTag,{value:"Module"})),ds=e=>{const t=e.reduce((r,n)=>{let{name:i,required:a,type:o}=n;switch(o){case"RelatedList":o="array";break;case"Related":o="object";break;case"Date":o="string";break;case"Integer":case"Float":o="number";break;default:o="string"}let s;try{a?s=fs[o]().typeError(`Field must be of type ${o}`).required("Field is required"):s=fs[o]().typeError(`Field must be of type ${o}`).nullable(!0)}catch(l){console.log(l)}return r[i]=s,r},{});return zr().shape(t)};function ps({path:e,autoInvoke:t=!0,clearDataOnRefetch:r=!1}){const{fetchPath:n,options:i}=T.useMemo(()=>Be({path:Pe(e,"_info"),method:"GET"}),[e]),{data:a,loading:o,refetch:s,error:l}=yn(n,{autoInvoke:t,clearDataOnRefetch:r,...i});return{info:T.useMemo(()=>a?{...a,add:{columns:a.add_columns,title:a.add_title,schema:ds(a.add_columns),defaultValues:Vo(a.add_columns)},edit:{columns:a.edit_columns,title:a.edit_title,schema:ds(a.edit_columns),defaultValues:Vo(a.edit_columns)}}:null,[a]),loading:o,refetch:s,error:l}}const hs={user:null,loading:!0,error:null};function Op(e,t){switch(t.type){case"initCall":return{...hs};case"setUser":return{...e,user:t.payload,error:null};case"setError":return{...e,loading:!1,error:t.payload};case"setLoading":return{...e,loading:t.payload};default:return e}}function Ap(e){const[t,r]=T.useReducer(Op,hs),{user:n,refetch:i,loading:a}=zo({path:e});T.useEffect(()=>{r({type:"setLoading",payload:a})},[a]),T.useEffect(()=>{r({type:"setUser",payload:n})},[n]);const o=T.useCallback(async({username:c,password:p})=>{r({type:"initCall"});try{const y=new FormData;y.append("username",c),y.append("password",p);const{fetchPath:g,options:h}=Be({path:Pe(e,"auth/login"),method:"POST"}),x=await fetch(g,{...h,headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(y)});x.ok||(x.status===400?r({type:"setError",payload:"Username or password wrong."}):r({type:"setError",payload:"Couldn't sign in user"})),i()}catch(y){console.error("signin error",y),r({type:"setError",payload:"Failed to fetch"})}},[e,i]),s=T.useCallback(async()=>{r({type:"initCall"});try{const{fetchPath:c,options:p}=Be({path:Pe(e,"auth/logout"),method:"POST"});(await fetch(c,p)).ok||r({type:"setError",payload:"Couldn't sign out user"}),r({type:"setUser",payload:null})}catch(c){console.error("signout error",c),r({type:"setError",payload:"Failed to fetch"})}finally{r({type:"setLoading",payload:!1})}},[e]),l=T.useCallback(async c=>{r({type:"initCall"});try{const{fetchPath:p,options:y}=Be({path:Pe(e,"auth/user"),method:"PUT",body:c});(await fetch(p,y)).ok||r({type:"setError",payload:"Couldn't update user data"}),i()}catch(p){console.error("update error",p),r({type:"setError",payload:"Failed to post"})}},[e,i]),u=T.useCallback(async c=>{if(!n.email)return r({type:"setError",payload:"No email found"});try{const{fetchPath:p,options:y}=Be({path:Pe(e,"auth/forgot-password"),method:"POST",body:{email:n.email}}),g=await fetch(p,y);if(!g.ok){r({type:"setError",payload:"Couldn't request token to reset password"});return}const h=await g.json(),{token:x}=h,{fetchPath:w,options:k}=Be({path:Pe(e,"auth/reset-password"),method:"POST",body:{token:x,password:c}});if(!(await fetch(w,k)).ok){r({type:"setError",payload:"Couldn't reset password"});return}i()}catch(p){console.error("resetPassword error",p),r({type:"setError",payload:"Failed to post"})}},[e,i,n==null?void 0:n.email]),f=T.useCallback((c,p)=>{const y=Pe(e,"auth/login",c);if(p){const x=window.screenLeft+window.outerWidth/2-250,w=window.screenTop+window.outerHeight/2-500/2,k=window.open(y+"?popup=true","auth",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=500, height=500, top=${w}, left=${x}`),M=window.setInterval(function(){k.closed!==!1&&(window.clearInterval(M),i())},200);return}window.location.href=Pe(e,"auth/login",c)},[e,i]);return{user:t.user,loading:t.loading,error:t.error,signin:o,signout:s,update:l,resetPassword:u,oauth_signin:f}}function Pp(e,t){const{user:r}=t,[n,i]=T.useState(null),[a,o]=T.useState(!0),[s,l]=T.useState({error:"401 Not authorized",message:"User is not logged in."});T.useEffect(()=>{r&&u(e)},[r]);const u=async f=>{o(!0);try{const{fetchPath:c,options:p}=Be({path:Pe(f,"info/"),method:"GET"}),y=await fetch(c,p);if(y.ok){const g=await y.json();i(g)}else l({error:"404 Not Found",message:"Couldn't fetch info"})}catch{l({error:"Network error",message:"Failed to fetch"})}finally{o(!1)}};return{info:n,loading:a,error:s}}const fa=T.createContext({auth:{user:null,loading:!1,error:null,signin:async(e,t)=>null,signout:async()=>null,update:async e=>null,resetPassword:async e=>null,oauth_signin:(e,t)=>null},info:{info:null,loading:!1,error:null}});function ms(){return T.useContext(fa).auth}function gs(){return T.useContext(fa).info}function kp(e){const t={baseUrl:new URL(document.baseURI).pathname+"/api/v1",inheritMantineTheme:!1},{baseUrl:r,children:n}={...t,...e},i=Ap(r),a={baseUrl:r,...Pp(r,i)};return d.jsx(fa.Provider,{value:{auth:i,info:a},children:n})}const jp=async(e,t,r)=>{const{fetchPath:n,options:i}=Be({path:Pe(t,"/download"),method:"POST"}),a=await fetch(n,{...i,body:JSON.stringify(r)});if(!a.ok)throw new Error(a.statusText);const o=await a.blob(),s=document.createElement("a"),l=URL.createObjectURL(o);s.href=l,s.download=e.toLowerCase()+".csv",s.click()},ys={queryParams:null,loading:!1,error:null};function $p(e,t){switch(t.type){case"setQueryParams":return{...e,queryParams:{...t.payload}};case"setLoading":return{...e,loading:t.payload};case"setError":return{...e,error:t.payload};default:throw new Error}}function Ip({path:e,initialQueryParams:t,relation:r,fetchInfo:n=!0,clearInfoOnRefetch:i=!1,clearDataOnRefetch:a=!1}){const[o,s]=T.useReducer($p,{...ys,queryParams:t?Bo(null,t):null}),l=T.useMemo(()=>r?{...o.queryParams,filters:[...o.queryParams.filters,{col:r.foreign_key,opr:r.type,value:Fe(r.id)}]}:o.queryParams,[o.queryParams,r]),u=T.useMemo(()=>l!=null,[l]),{info:f,loading:c,refetch:p,error:y}=ps({path:e,autoInvoke:n,clearDataOnRefetch:i}),{data:g,loading:h,refetch:x,error:w}=Uo({path:e,queryParams:l,autoInvoke:u,clearDataOnRefetch:a});T.useEffect(()=>{if(y){s({type:"setError",payload:{message:"Couldn't fetch info",originalError:y}});return}if(w){s({type:"setError",payload:{message:"Couldn't fetch list",originalError:w}});return}s({type:"setError",payload:ys.error})},[y,w]),T.useEffect(()=>{s({type:"setLoading",payload:c||h})},[h,c]);const k=T.useCallback(J=>{const ee=Bo(o.queryParams,J);s({type:"setQueryParams",payload:ee})},[o.queryParams]),M=T.useCallback(async J=>{try{return await Md(e,Fe(J))}catch(ee){s({type:"setError",payload:{message:`Couldn't fetch item with id ${J}`,originalError:ee}})}},[e]),N=T.useCallback(async(J,ee)=>{try{const ae=await Id(e,J);return ee||(p(),x()),ae}catch(ae){s({type:"setError",payload:{message:"Couldnt add item.",originalError:ae}})}},[x,p,e]),_=T.useCallback(async(J,ee,ae)=>{try{const z=await Dd(e,Fe(J),ee);return ae||(p(),x()),z}catch(z){s({type:"setError",payload:{message:`Couldn't update item with id ${J}`,originalError:z}})}},[x,p,e]),R=T.useCallback(async(J,ee)=>{try{const ae=await Rd(e,Fe(J));return ee||(p(),x()),ae}catch(ae){s({type:"setError",payload:{message:`Couldn't delete item with id ${J}`,originalError:ae}})}},[x,p,e]),F=T.useCallback(async J=>{try{await jp(J,e,o.queryParams)}catch(ee){s({type:"setError",payload:{message:"Couldn't download",originalError:ee}})}},[e,o.queryParams]);return{path:e,data:g,info:f,queryParams:o.queryParams,loading:o.loading,error:o.error,setQueryParams:k,refetch:x,refetchInfo:p,getEntry:M,addEntry:N,updateEntry:_,deleteEntry:R,download:F}}const Rp=async(e,t,r)=>{try{const{fetchPath:n,options:i}=Be({path:Pe(e,"/bulk",t),method:"POST",body:r}),a=await fetch(n,i);if(a.ok)return await a.json();throw new Error(a.statusText)}catch(n){throw new Error(n)}},Mp=({Api:e})=>{const[t,r]=T.useState([]),[n,i]=T.useState(null),a=T.useCallback(async(s,l)=>{try{i(null);const u=await Rp(e.path,s,t);return l?void 0:(e.refetch(),u)}catch(u){console.error(u),i({message:"Couldn't perform bulk action",originalError:u})}},[e,t]);return{bulkActions:T.useMemo(()=>({selectedIds:t,setSelectedIds:r}),[t,r]),dispatchBulkActions:a,error:n}},da=T.createContext({Api:{path:"",data:null,info:null,queryParams:null,loading:!1,error:null,setQueryParams:e=>null,refetch:()=>null,refetchInfo:()=>null,getEntry:async e=>({}),addEntry:async(e,t)=>({}),updateEntry:async(e,t,r)=>({}),deleteEntry:async(e,t)=>({}),download:async e=>null},BulkActions:{bulkActions:{selectedIds:[],setSelectedIds:()=>{}},dispatchBulkActions:async(e,t)=>{},error:null}});function Re(){const e=T.useContext(da);if(e===void 0)throw new Error("useApi must be used within a ApiProvider");return e.Api}function Dp(){const e=T.useContext(da);if(e===void 0)throw new Error("useBulkActions must be used within a ApiProvider");return e.BulkActions}function vs({resource_name:e="",initialQueryParams:t,relation:r,fetchInfo:n,clearInfoOnRefetch:i,clearDataOnRefetch:a,children:o}){const{baseUrl:s}=gs(),l=Ip({path:Pe(s,e),initialQueryParams:t,relation:r,fetchInfo:n,clearInfoOnRefetch:i,clearDataOnRefetch:a}),u=Mp({path:Pe(s,e),Api:l});return d.jsx(da.Provider,{value:{Api:l,BulkActions:u},children:o})}function pa(e){return t=>{try{return e.validateSync(t,{abortEarly:!1}),{}}catch(r){const n={};return r instanceof Le&&r.inner.forEach(i=>{n[i.path.replaceAll("[",".").replaceAll("]","")]=i.message}),n}}}function Np({form:e,name:t,...r}){return d.jsx(d.Fragment,{children:d.jsx(ar.DateInput,{...e.getInputProps(t),onChange:n=>{if(n instanceof Date){const i=new Date(n.getTime()-n.getTimezoneOffset()*6e4);e.setFieldValue(t,i.toISOString().substring(0,10))}},value:e.getInputProps(t).value?new Date(e.getInputProps(t).value):null,...r})})}function Fp({form:e,name:t,...r}){return d.jsx(d.Fragment,{children:d.jsx(ar.DateTimePicker,{...e.getInputProps(t),onChange:n=>{if(n instanceof Date){const i=new Date(n);e.setFieldValue(t,i.toISOString())}},value:e.getInputProps(t).value?new Date(e.getInputProps(t).value):null,...r})})}function Lp({form:e,name:t,items:r,filter:n,...i}){var o;const a=r.map(s=>({value:String(Fe(s.id)),label:s.value}));return d.jsx(v.Select,{data:a,searchable:!0,...e.getInputProps(t),onChange:s=>{if(n){e.setFieldValue(t,s);return}const l=r.find(u=>String(Fe(u.id))===s)||null;e.setFieldValue(t,l)},value:n?e.getInputProps(t).value:String(Fe((o=e.getInputProps(t).value)==null?void 0:o.id))||"",...i})}function zp({form:e,name:t,items:r,...n}){const i=r.map(o=>({value:String(Fe(o.id)),label:o.value})),a=Array.isArray(e.getInputProps(t).value)?e.getInputProps(t).value.map(o=>String(typeof o=="object"?Fe(o.id):o)):[];return d.jsx(v.MultiSelect,{data:i,searchable:!0,...e.getInputProps(t),value:a||[],...n})}function Up({form:e,name:t,items:r,...n}){return d.jsx(v.Select,{data:r,searchable:!0,...e.getInputProps(t),value:String(e.getInputProps(t).value)||"",...n})}function bs({form:e,name:t,...r}){return t==="password"?d.jsx(v.PasswordInput,{...e.getInputProps(t),...r}):d.jsx(v.TextInput,{...e.getInputProps(t),value:e.getInputProps(t).value||"",...r})}const Bp=/choices=\[([^\]]*)\]/;function Vp({form:e,name:t,items:r,...n}){const i=r[0].match(Bp)[1].replaceAll("'","").split(",").map(a=>(a=a.trim(),{label:a,value:a}));return d.jsx(v.Select,{data:i,searchable:!0,...e.getInputProps(t),...n,value:String(e.getInputProps(t).value)||""})}function ha({form:e,name:t,schema:r,filter:n,...i}){if(!r.type)return null;switch(r.type){case"Boolean":return d.jsx(Up,{form:e,name:t,items:[{label:"true",value:n?"1":"true"},{label:"false",value:n?"0":"false"}],...i});case"RelatedList":return d.jsx(zp,{form:e,name:t,items:r.values,...i});case"Related":return d.jsx(Lp,{form:e,name:t,items:r.values,filter:n,...i});case"DateTime":return d.jsx(Fp,{form:e,name:t,valueFormat:"DD.MM.YYYY HH:mm:ss",schema:r,...i});case"Date":return d.jsx(Np,{form:e,name:t,valueFormat:"DD.MM.YYYY",schema:r,...i});case"Field":return d.jsx(Vp,{form:e,name:t,items:r.validate,...i});case"Integer":case"Float":return d.jsx(bs,{form:e,name:t,...i});default:return d.jsx(bs,{form:e,name:t,...i})}}function xs({opened:e,onClose:t,...r}){const{info:n,addEntry:i}=Re(),a={modal:{},stack:{},addButton:{}},{addButton:o,modal:s,stack:l}=v.useProps("AddDialog",a,r),u=zi.useForm({initialValues:n.add.defaultValues,validate:pa(n.add.schema)}),f=async c=>{await i(c),u.reset(),t()};return T.useEffect(()=>{u.setInitialValues(n.add.defaultValues),u.reset()},[n.add.defaultValues]),d.jsx(v.Modal,{opened:e,onClose:()=>{u.reset(),t()},title:n.add.title,size:"lg",centered:!0,...s,children:d.jsx(v.Box,{component:"form",onSubmit:u.onSubmit(f),children:d.jsx(v.Stack,{spacing:"md",...l,children:d.jsxs(v.ScrollArea.Autosize,{mah:450,type:"auto",children:[n.add.columns.map((c,p)=>d.jsx(ha,{form:u,name:c.name,label:c.label,description:c.description,schema:c,withAsterisk:c.required},p)),d.jsx(v.Group,{position:"right",mt:"xl",children:d.jsx(v.Button,{type:"submit",...o,children:"Add"})})]})})})})}var ma={exports:{}},On={exports:{}},ue={};/** @license React v16.13.1
|
|
35
|
+
`+(s!==o?`result of cast: ${s}`:""))}return a}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,i){let{path:a,originalValue:o=t,strict:s=this.spec.strict}=r,l=t;s||(l=this._cast(l,Object.assign({assert:!1},r)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:a,value:l,originalValue:o,options:r,tests:u},n,f=>{if(f.length)return i(f,l);this.runTests({path:a,value:l,originalValue:o,options:r,tests:this.tests},n,i)})}runTests(t,r,n){let i=!1,{tests:a,value:o,originalValue:s,path:l,options:u}=t,f=h=>{i||(i=!0,r(h,o))},c=h=>{i||(i=!0,n(h,o))},p=a.length,y=[];if(!p)return c([]);let g={value:o,originalValue:s,path:l,options:u,schema:this};for(let h=0;h<a.length;h++){const x=a[h];x(g,f,function(k){k&&(Array.isArray(k)?y.push(...k):y.push(k)),--p<=0&&c(y)})}}asNestedTest({key:t,index:r,parent:n,parentPath:i,originalParent:a,options:o}){const s=t??r;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let u=n[s];const f=Object.assign({},o,{strict:!0,parent:n,value:u,originalValue:a[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${i||""}[${l?s:`"${s}"`}]`:(i?`${i}.`:"")+t});return(c,p,y)=>this.resolve(f)._validate(u,f,p,y)}validate(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return new Promise((o,s)=>i._validate(t,r,(l,u)=>{Le.isError(l)&&(l.value=u),s(l)},(l,u)=>{l.length?s(new Le(l,u,void 0,void 0,a)):o(u)}))}validateSync(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a,o=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return i._validate(t,Object.assign({},r,{sync:!0}),(s,l)=>{throw Le.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new Le(s,t,void 0,void 0,o);a=l}),a}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(Le.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(Le.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):sr(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=or({message:r,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=or({message:r,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=xt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=xt.notNull){return this.nullability(!1,t)}required(t=xt.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=xt.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=or(r),a=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(o=>!(o.OPTIONS.name===r.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),n.tests.push(i),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),i=Jo(t).map(a=>new Nt(a));return i.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(typeof r=="function"?new _n(i,r):_n.fromOptions(i,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=or({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=xt.oneOf){let n=this.clone();return t.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n.internalTests.whiteList=or({message:r,name:"oneOf",skipAbsent:!0,test(i){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),n}notOneOf(t,r=xt.notOneOf){let n=this.clone();return t.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n.internalTests.blacklist=or({message:r,name:"notOneOf",test(i){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:i,optional:a,nullable:o}=r.spec;return{meta:i,label:n,optional:a,nullable:o,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,f)=>f.findIndex(c=>c.name===l.name)===u)}}}ze.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ze.prototype[`${e}At`]=function(t,r,n={}){const{parent:i,parentPath:a,schema:o}=Zi(this,t,r,n.context);return o[e](i&&i[a],Object.assign({},n,{parent:i,path:t}))};for(const e of["equals","is"])ze.prototype[e]=ze.prototype.oneOf;for(const e of["not","nope"])ze.prototype[e]=ze.prototype.notOneOf;const op=()=>!0;function Sn(e){return new Qi(e)}class Qi extends ze{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:op},t))}}Sn.prototype=Qi.prototype;function ea(){return new ta}class ta extends ze{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(n.spec.coerce&&!n.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Xi.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return pt(r)||r===!0}})}isFalse(t=Xi.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return pt(r)||r===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}ea.prototype=ta.prototype;const sp=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function lp(e){const t=ra(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function ra(e){var t,r;const n=sp.exec(e);return n?{year:At(n[1]),month:At(n[2],1)-1,day:At(n[3],1),hour:At(n[4]),minute:At(n[5]),second:At(n[6]),millisecond:n[7]?At(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:At(n[10]),minuteOffset:At(n[11])}:null}function At(e,t=0){return Number(e)||t}let up=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,cp=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,fp=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,dp="^\\d{4}-\\d{2}-\\d{2}",pp="\\d{2}:\\d{2}:\\d{2}",hp="(([+-]\\d{2}(:?\\d{2})?)|Z)",mp=new RegExp(`${dp}T${pp}(\\.\\d+)?${hp}$`),gp=e=>pt(e)||e===e.trim(),yp={}.toString();function wn(){return new na}class na extends ze{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===yp?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||xt.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=Ke.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=Ke.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=Ke.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,i,a;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:i,name:a}=r:i=r),this.test({name:a||"matches",message:i||Ke.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&n||o.search(t)!==-1})}email(t=Ke.email){return this.matches(up,{name:"email",message:t,excludeEmptyString:!0})}url(t=Ke.url){return this.matches(cp,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Ke.uuid){return this.matches(fp,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,i;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:i=void 0}=t:r=t),this.matches(mp,{name:"datetime",message:r||Ke.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||Ke.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:a=>{if(!a||n)return!0;const o=ra(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:r||Ke.datetime_precision,params:{precision:i},skipAbsent:!0,test:a=>{if(!a||i==null)return!0;const o=ra(a);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Ke.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:gp})}lowercase(t=Ke.lowercase){return this.transform(r=>pt(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>pt(r)||r===r.toLowerCase()})}uppercase(t=Ke.uppercase){return this.transform(r=>pt(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>pt(r)||r===r.toUpperCase()})}}wn.prototype=na.prototype;let vp=e=>e!=+e;function is(){return new ia}class ia extends ze{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!vp(t)}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return n.isType(i)||i===null?i:parseFloat(i)})})}min(t,r=Dt.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(t)}})}max(t,r=Dt.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(t)}})}lessThan(t,r=Dt.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(n){return n<this.resolve(t)}})}moreThan(t,r=Dt.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=Dt.positive){return this.moreThan(0,t)}negative(t=Dt.negative){return this.lessThan(0,t)}integer(t=Dt.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>pt(t)?t:t|0)}round(t){var r;let n=["ceil","floor","round","trunc"];if(t=((r=t)==null?void 0:r.toLowerCase())||"round",t==="trunc")return this.truncate();if(n.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(i=>pt(i)?i:Math[t](i))}}is.prototype=ia.prototype;let as=new Date(""),bp=e=>Object.prototype.toString.call(e)==="[object Date]";function aa(){return new lr}class lr extends ze{constructor(){super({type:"date",check(t){return bp(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=lp(t),isNaN(t)?lr.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(Nt.isRef(t))n=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=i}return n}min(t,r=Ki.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(n)}})}max(t,r=Ki.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(n)}})}}lr.INVALID_DATE=as,aa.prototype=lr.prototype,aa.INVALID_DATE=as;function xp(e,t=[]){let r=[],n=new Set,i=new Set(t.map(([o,s])=>`${o}-${s}`));function a(o,s){let l=Yt.split(o)[0];n.add(l),i.has(`${s}-${l}`)||r.push([s,l])}for(const o of Object.keys(e)){let s=e[o];n.add(o),Nt.isRef(s)&&s.isSibling?a(s.path,o):Kt(s)&&"deps"in s&&s.deps.forEach(l=>a(l,o))}return Xd.array(Array.from(n),r).reverse()}function os(e,t){let r=1/0;return e.some((n,i)=>{var a;if((a=t.path)!=null&&a.includes(n))return r=i,!0}),r}function ss(e){return(t,r)=>os(e,t)-os(e,r)}const ls=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function Cn(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Cn(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Cn(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Cn)}):"optional"in e?e.optional():e}const _p=(e,t)=>{const r=[...Yt.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),i=Yt.getter(Yt.join(r),!0)(e);return!!(i&&n in i)};let us=e=>Object.prototype.toString.call(e)==="[object Object]";function Tp(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const Ep=ss([]);function zr(e){return new oa(e)}class oa extends ze{constructor(t){super({type:"object",check(r){return us(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=Ep,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let i=super._cast(t,r);if(i===void 0)return this.getDefault(r);if(!this._typeCheck(i))return i;let a=this.fields,o=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(c=>!this._nodes.includes(c))),l={},u=Object.assign({},r,{parent:l,__validating:r.__validating||!1}),f=!1;for(const c of s){let p=a[c],y=c in i;if(p){let g,h=i[c];u.path=(r.path?`${r.path}.`:"")+c,p=p.resolve({value:h,context:r.context,parent:l});let x=p instanceof ze?p.spec:void 0,w=x==null?void 0:x.strict;if(x!=null&&x.strip){f=f||c in i;continue}g=!r.__validating||!w?p.cast(i[c],u):i[c],g!==void 0&&(l[c]=g)}else y&&!o&&(l[c]=i[c]);(y!==c in l||l[c]!==i[c])&&(f=!0)}return f?l:i}_validate(t,r={},n,i){let{from:a=[],originalValue:o=t,recursive:s=this.spec.recursive}=r;r.from=[{schema:this,value:o},...a],r.__validating=!0,r.originalValue=o,super._validate(t,r,n,(l,u)=>{if(!s||!us(u)){i(l,u);return}o=o||u;let f=[];for(let c of this._nodes){let p=this.fields[c];!p||Nt.isRef(p)||f.push(p.asNestedTest({options:r,key:c,parent:u,parentPath:r.path,originalParent:o}))}this.runTests({tests:f,value:u,originalValue:o,options:r},n,c=>{i(c.sort(this._sortErrors).concat(l),u)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[i,a]of Object.entries(this.fields)){const o=n[i];n[i]=o===void 0?a:o}return r.withMutation(i=>i.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var i;const a=this.fields[n];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[n]})),r[n]=a&&"getDefault"in a?a.getDefault(o):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=xp(t,r),n._sortErrors=ss(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let i=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),i=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),i)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return Cn(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,i])=>t.includes(n)&&t.includes(i)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let i=Yt.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return _p(a,t)&&(o=Object.assign({},a),n||delete o[t],o[r]=i(a)),o})}json(){return this.transform(ls)}noUnknown(t=!0,r=Ji.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(i){if(i==null)return!0;const a=Tp(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Ji.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const i of Object.keys(r))n[t(i)]=r[i];return n})}camelCase(){return this.transformKeys(qi.camelCase)}snakeCase(){return this.transformKeys(qi.snakeCase)}constantCase(){return this.transformKeys(t=>qi.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[a,o]of Object.entries(r.fields)){var i;let s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[a]})),n.fields[a]=o.describe(s)}return n}}zr.prototype=oa.prototype;function sa(e){return new la(e)}class la extends ze{constructor(t){super({type:"array",spec:{types:t},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=t}_cast(t,r){const n=super._cast(t,r);if(!this._typeCheck(n)||!this.innerType)return n;let i=!1;const a=n.map((o,s)=>{const l=this.innerType.cast(o,Object.assign({},r,{path:`${r.path||""}[${s}]`}));return l!==o&&(i=!0),l});return i?a:n}_validate(t,r={},n,i){var a;let o=this.innerType,s=(a=r.recursive)!=null?a:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(l,u)=>{var f;if(!s||!o||!this._typeCheck(u)){i(l,u);return}let c=new Array(u.length);for(let y=0;y<u.length;y++){var p;c[y]=o.asNestedTest({options:r,index:y,parent:u,parentPath:r.path,originalParent:(p=r.originalValue)!=null?p:t})}this.runTests({value:u,tests:c,originalValue:(f=r.originalValue)!=null?f:t,options:r},n,y=>i(y.concat(l),u))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(ls)}concat(t){let r=super.concat(t);return r.innerType=this.innerType,t.innerType&&(r.innerType=r.innerType?r.innerType.concat(t.innerType):t.innerType),r}of(t){let r=this.clone();if(!Kt(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+bt(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=xn.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r){return r=r||xn.min,this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r){return r=r||xn.max,this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,r)=>this._typeCheck(t)?t:r==null?[]:[].concat(r))}compact(t){let r=t?(n,i,a)=>!t(n,i,a):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);if(r.innerType){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[0]})),n.innerType=r.innerType.describe(a)}return n}}sa.prototype=la.prototype;function cs(e){return new ua(e)}class ua extends ze{constructor(t){super({type:"tuple",spec:{types:t},check(r){const n=this.spec.types;return Array.isArray(r)&&r.length===n.length}}),this.withMutation(()=>{this.typeError(rs.notType)})}_cast(t,r){const{types:n}=this.spec,i=super._cast(t,r);if(!this._typeCheck(i))return i;let a=!1;const o=n.map((s,l)=>{const u=s.cast(i[l],Object.assign({},r,{path:`${r.path||""}[${l}]`}));return u!==i[l]&&(a=!0),u});return a?o:i}_validate(t,r={},n,i){let a=this.spec.types;super._validate(t,r,n,(o,s)=>{var l;if(!this._typeCheck(s)){i(o,s);return}let u=[];for(let[c,p]of a.entries()){var f;u[c]=p.asNestedTest({options:r,index:c,parent:s,parentPath:r.path,originalParent:(f=r.originalValue)!=null?f:t})}this.runTests({value:s,tests:u,originalValue:(l=r.originalValue)!=null?l:t,options:r},n,c=>i(c.concat(o),s))})}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);return n.innerType=r.spec.types.map((i,a)=>{var o;let s=t;return(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[a]})),i.describe(s)}),n}}cs.prototype=ua.prototype;function Sp(e){return new ca(e)}class ca{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(r,n={})=>{let i=this.builder(r,n);if(!Kt(i))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(i=i.optional()),i.resolve(n)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const r=new ca(this.builder);return r.spec=Object.assign({},this.spec,t),r}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,r){return this._resolve(t,r).cast(t,r)}asNestedTest(t){let{key:r,index:n,parent:i,options:a}=t,o=i[n??r];return this._resolve(o,Object.assign({},a,{value:o,parent:i})).asNestedTest(t)}validate(t,r){return this._resolve(t,r).validate(t,r)}validateSync(t,r){return this._resolve(t,r).validateSync(t,r)}validateAt(t,r,n){return this._resolve(r,n).validateAt(t,r,n)}validateSyncAt(t,r,n){return this._resolve(r,n).validateSyncAt(t,r,n)}isValid(t,r){return this._resolve(t,r).isValid(t,r)}isValidSync(t,r){return this._resolve(t,r).isValidSync(t,r)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}}function wp(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(r=>{ns[t][r]=e[t][r]})})}function Cp(e,t,r){if(!e||!Kt(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof r!="function")throw new TypeError("Method function must be provided");e.prototype[t]=r}const fs=Object.freeze(Object.defineProperty({__proto__:null,ArraySchema:la,BooleanSchema:ta,DateSchema:lr,MixedSchema:Qi,NumberSchema:ia,ObjectSchema:oa,Schema:ze,StringSchema:na,TupleSchema:ua,ValidationError:Le,addMethod:Cp,array:sa,bool:ea,boolean:ea,date:aa,defaultLocale:ns,getIn:Zi,isSchema:Kt,lazy:Sp,mixed:Sn,number:is,object:zr,printValue:bt,reach:ap,ref:ip,setLocale:wp,string:wn,tuple:cs},Symbol.toStringTag,{value:"Module"})),ds=e=>{const t=e.reduce((r,n)=>{let{name:i,required:a,type:o}=n;switch(o){case"RelatedList":o="array";break;case"Related":o="object";break;case"Date":o="string";break;case"Integer":case"Float":o="number";break;default:o="string"}let s;try{a?s=fs[o]().typeError(`Field must be of type ${o}`).required("Field is required"):s=fs[o]().typeError(`Field must be of type ${o}`).nullable(!0)}catch(l){console.log(l)}return r[i]=s,r},{});return zr().shape(t)};function ps({path:e,autoInvoke:t=!0,clearDataOnRefetch:r=!1}){const{fetchPath:n,options:i}=T.useMemo(()=>Be({path:Pe(e,"_info"),method:"GET"}),[e]),{data:a,loading:o,refetch:s,error:l}=yn(n,{autoInvoke:t,clearDataOnRefetch:r,...i});return{info:T.useMemo(()=>a?{...a,add:{columns:a.add_columns,title:a.add_title,schema:ds(a.add_columns),defaultValues:Vo(a.add_columns)},edit:{columns:a.edit_columns,title:a.edit_title,schema:ds(a.edit_columns),defaultValues:Vo(a.edit_columns)}}:null,[a]),loading:o,refetch:s,error:l}}const hs={user:null,loading:!0,error:null};function Op(e,t){switch(t.type){case"initCall":return{...hs};case"setUser":return{...e,user:t.payload,error:null};case"setError":return{...e,loading:!1,error:t.payload};case"setLoading":return{...e,loading:t.payload};default:return e}}function Ap(e){const[t,r]=T.useReducer(Op,hs),{user:n,refetch:i,loading:a}=zo({path:e});T.useEffect(()=>{r({type:"setLoading",payload:a})},[a]),T.useEffect(()=>{r({type:"setUser",payload:n})},[n]);const o=T.useCallback(async({username:c,password:p})=>{r({type:"initCall"});try{const y=new FormData;y.append("username",c),y.append("password",p);const{fetchPath:g,options:h}=Be({path:Pe(e,"auth/login"),method:"POST"}),x=await fetch(g,{...h,headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(y)});x.ok||(x.status===400?r({type:"setError",payload:"Username or password wrong."}):r({type:"setError",payload:"Couldn't sign in user"})),i()}catch(y){console.error("signin error",y),r({type:"setError",payload:"Failed to fetch"})}},[e,i]),s=T.useCallback(async()=>{r({type:"initCall"});try{const{fetchPath:c,options:p}=Be({path:Pe(e,"auth/logout"),method:"POST"});(await fetch(c,p)).ok||r({type:"setError",payload:"Couldn't sign out user"}),r({type:"setUser",payload:null})}catch(c){console.error("signout error",c),r({type:"setError",payload:"Failed to fetch"})}finally{r({type:"setLoading",payload:!1})}},[e]),l=T.useCallback(async c=>{r({type:"initCall"});try{const{fetchPath:p,options:y}=Be({path:Pe(e,"auth/user"),method:"PUT",body:c});(await fetch(p,y)).ok||r({type:"setError",payload:"Couldn't update user data"}),i()}catch(p){console.error("update error",p),r({type:"setError",payload:"Failed to post"})}},[e,i]),u=T.useCallback(async c=>{if(!n.email)return r({type:"setError",payload:"No email found"});try{const{fetchPath:p,options:y}=Be({path:Pe(e,"auth/forgot-password"),method:"POST",body:{email:n.email}}),g=await fetch(p,y);if(!g.ok){r({type:"setError",payload:"Couldn't request token to reset password"});return}const h=await g.json(),{token:x}=h,{fetchPath:w,options:k}=Be({path:Pe(e,"auth/reset-password"),method:"POST",body:{token:x,password:c}});if(!(await fetch(w,k)).ok){r({type:"setError",payload:"Couldn't reset password"});return}i()}catch(p){console.error("resetPassword error",p),r({type:"setError",payload:"Failed to post"})}},[e,i,n==null?void 0:n.email]),f=T.useCallback((c,p)=>{const y=Pe(e,"auth/login",c);if(p){const x=window.screenLeft+window.outerWidth/2-250,w=window.screenTop+window.outerHeight/2-500/2,k=window.open(y+"?popup=true","auth",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=500, height=500, top=${w}, left=${x}`),M=window.setInterval(function(){k.closed!==!1&&(window.clearInterval(M),i())},200);return}window.location.href=Pe(e,"auth/login",c)},[e,i]);return{user:t.user,loading:t.loading,error:t.error,signin:o,signout:s,update:l,resetPassword:u,oauth_signin:f}}function Pp(e,t){const{user:r}=t,[n,i]=T.useState(null),[a,o]=T.useState(!0),[s,l]=T.useState({error:"401 Not authorized",message:"User is not logged in."});T.useEffect(()=>{r&&u(e)},[r]);const u=async f=>{o(!0);try{const{fetchPath:c,options:p}=Be({path:Pe(f,"info/"),method:"GET"}),y=await fetch(c,p);if(y.ok){const g=await y.json();i(g)}else l({error:"404 Not Found",message:"Couldn't fetch info"})}catch{l({error:"Network error",message:"Failed to fetch"})}finally{o(!1)}};return{info:n,loading:a,error:s}}const fa=T.createContext({auth:{user:null,loading:!1,error:null,signin:async(e,t)=>null,signout:async()=>null,update:async e=>null,resetPassword:async e=>null,oauth_signin:(e,t)=>null},info:{info:null,loading:!1,error:null}});function ms(){return T.useContext(fa).auth}function gs(){return T.useContext(fa).info}function kp(e){const t={baseUrl:new URL(document.baseURI).pathname+"/api/v1",inheritMantineTheme:!1},{baseUrl:r,children:n}={...t,...e},i=Ap(r),a={baseUrl:r,...Pp(r,i)};return d.jsx(fa.Provider,{value:{auth:i,info:a},children:n})}const jp=async(e,t,r)=>{const{fetchPath:n,options:i}=Be({path:Pe(t,"/download"),method:"POST"}),a=await fetch(n,{...i,body:JSON.stringify(r)});if(!a.ok)throw new Error(a.statusText);const o=await a.blob(),s=document.createElement("a"),l=URL.createObjectURL(o);s.href=l,s.download=e.toLowerCase()+".csv",s.click()},ys={queryParams:null,loading:!1,error:null};function $p(e,t){switch(t.type){case"setQueryParams":return{...e,queryParams:{...t.payload}};case"setLoading":return{...e,loading:t.payload};case"setError":return{...e,error:t.payload};default:throw new Error}}function Ip({path:e,initialQueryParams:t,relation:r,fetchInfo:n=!0,clearInfoOnRefetch:i=!1,clearDataOnRefetch:a=!1}){const[o,s]=T.useReducer($p,{...ys,queryParams:t?Bo(null,t):null}),l=T.useMemo(()=>r?{...o.queryParams,filters:[...o.queryParams.filters,{col:r.foreign_key,opr:r.type,value:Fe(r.id)}]}:o.queryParams,[o.queryParams,r]),u=T.useMemo(()=>l!=null,[l]),{info:f,loading:c,refetch:p,error:y}=ps({path:e,autoInvoke:n,clearDataOnRefetch:i}),{data:g,loading:h,refetch:x,error:w}=Uo({path:e,queryParams:l,autoInvoke:u,clearDataOnRefetch:a});T.useEffect(()=>{if(y){s({type:"setError",payload:{message:"Couldn't fetch info",originalError:y}});return}if(w){s({type:"setError",payload:{message:"Couldn't fetch list",originalError:w}});return}s({type:"setError",payload:ys.error})},[y,w]),T.useEffect(()=>{s({type:"setLoading",payload:c||h})},[h,c]);const k=T.useCallback(J=>{const ee=Bo(o.queryParams,J);s({type:"setQueryParams",payload:ee})},[o.queryParams]),M=T.useCallback(async J=>{try{return await Md(e,Fe(J))}catch(ee){s({type:"setError",payload:{message:`Couldn't fetch item with id ${J}`,originalError:ee}})}},[e]),N=T.useCallback(async(J,ee)=>{try{const ae=await Id(e,J);return ee||(p(),x()),ae}catch(ae){s({type:"setError",payload:{message:"Couldnt add item.",originalError:ae}})}},[x,p,e]),_=T.useCallback(async(J,ee,ae)=>{try{const z=await Dd(e,Fe(J),ee);return ae||(p(),x()),z}catch(z){s({type:"setError",payload:{message:`Couldn't update item with id ${J}`,originalError:z}})}},[x,p,e]),R=T.useCallback(async(J,ee)=>{try{const ae=await Rd(e,Fe(J));return ee||(p(),x()),ae}catch(ae){s({type:"setError",payload:{message:`Couldn't delete item with id ${J}`,originalError:ae}})}},[x,p,e]),F=T.useCallback(async J=>{try{await jp(J,e,o.queryParams)}catch(ee){s({type:"setError",payload:{message:"Couldn't download",originalError:ee}})}},[e,o.queryParams]);return{path:e,data:g,info:f,queryParams:o.queryParams,loading:o.loading,error:o.error,setQueryParams:k,refetch:x,refetchInfo:p,getEntry:M,addEntry:N,updateEntry:_,deleteEntry:R,download:F}}const Rp=async(e,t,r)=>{try{const{fetchPath:n,options:i}=Be({path:Pe(e,"/bulk",t),method:"POST",body:r}),a=await fetch(n,i);if(a.ok)return await a.json();throw new Error(a.statusText)}catch(n){throw new Error(n)}},Mp=({Api:e})=>{const[t,r]=T.useState([]),[n,i]=T.useState(null),a=T.useCallback(async(s,l)=>{try{i(null);const u=await Rp(e.path,s,t);return l?void 0:(e.refetch(),u)}catch(u){console.error(u),i({message:"Couldn't perform bulk action",originalError:u})}},[e,t]);return{bulkActions:T.useMemo(()=>({selectedIds:t,setSelectedIds:r}),[t,r]),dispatchBulkActions:a,error:n}},da=T.createContext({Api:{path:"",data:null,info:null,queryParams:null,loading:!1,error:null,setQueryParams:e=>null,refetch:()=>null,refetchInfo:()=>null,getEntry:async e=>({}),addEntry:async(e,t)=>({}),updateEntry:async(e,t,r)=>({}),deleteEntry:async(e,t)=>({}),download:async e=>null},BulkActions:{bulkActions:{selectedIds:[],setSelectedIds:()=>{}},dispatchBulkActions:async(e,t)=>{},error:null}});function Re(){const e=T.useContext(da);if(e===void 0)throw new Error("useApi must be used within a ApiProvider");return e.Api}function Dp(){const e=T.useContext(da);if(e===void 0)throw new Error("useBulkActions must be used within a ApiProvider");return e.BulkActions}function vs({resource_name:e="",initialQueryParams:t,relation:r,fetchInfo:n,clearInfoOnRefetch:i,clearDataOnRefetch:a,children:o}){const{baseUrl:s}=gs(),l=Ip({path:Pe(s,e),initialQueryParams:t,relation:r,fetchInfo:n,clearInfoOnRefetch:i,clearDataOnRefetch:a}),u=Mp({path:Pe(s,e),Api:l});return d.jsx(da.Provider,{value:{Api:l,BulkActions:u},children:o})}function pa(e){return t=>{try{return e.validateSync(t,{abortEarly:!1}),{}}catch(r){const n={};return r instanceof Le&&r.inner.forEach(i=>{n[i.path.replaceAll("[",".").replaceAll("]","")]=i.message}),n}}}function Np({form:e,name:t,...r}){return d.jsx(d.Fragment,{children:d.jsx(ar.DateInput,{...e.getInputProps(t),onChange:n=>{if(n instanceof Date){const i=new Date(n.getTime()-n.getTimezoneOffset()*6e4);e.setFieldValue(t,i.toISOString().substring(0,10))}},value:e.getInputProps(t).value?new Date(e.getInputProps(t).value):null,...r})})}function Fp({form:e,name:t,...r}){return d.jsx(d.Fragment,{children:d.jsx(ar.DateTimePicker,{...e.getInputProps(t),onChange:n=>{if(n instanceof Date){const i=new Date(n);e.setFieldValue(t,i.toISOString())}},value:e.getInputProps(t).value?new Date(e.getInputProps(t).value):null,...r})})}function Lp({form:e,name:t,items:r,filter:n,...i}){var o;const a=r.map(s=>({value:String(Fe(s.id)),label:s.value}));return d.jsx(v.Select,{data:a,searchable:!0,...e.getInputProps(t),onChange:s=>{if(n){e.setFieldValue(t,s);return}const l=r.find(u=>String(Fe(u.id))===s)||null;e.setFieldValue(t,l)},value:n?e.getInputProps(t).value:String(Fe((o=e.getInputProps(t).value)==null?void 0:o.id))||"",...i})}function zp({form:e,name:t,items:r,...n}){const i=r.map(o=>({value:String(Fe(o.id)),label:o.value})),a=Array.isArray(e.getInputProps(t).value)?e.getInputProps(t).value.map(o=>String(typeof o=="object"?Fe(o.id):o)):[];return d.jsx(v.MultiSelect,{data:i,searchable:!0,...e.getInputProps(t),value:a||[],...n})}function Up({form:e,name:t,items:r,...n}){return d.jsx(v.Select,{data:r,searchable:!0,...e.getInputProps(t),value:String(e.getInputProps(t).value)||"",...n})}function bs({form:e,name:t,...r}){return t==="password"?d.jsx(v.PasswordInput,{...e.getInputProps(t),value:e.getInputProps(t).value||"",...r}):d.jsx(v.TextInput,{...e.getInputProps(t),value:e.getInputProps(t).value||"",...r})}const Bp=/choices=\[([^\]]*)\]/;function Vp({form:e,name:t,items:r,...n}){const i=r[0].match(Bp)[1].replaceAll("'","").split(",").map(a=>(a=a.trim(),{label:a,value:a}));return d.jsx(v.Select,{data:i,searchable:!0,...e.getInputProps(t),...n,value:String(e.getInputProps(t).value)||""})}function ha({form:e,name:t,schema:r,filter:n,...i}){if(!r.type)return null;switch(r.type){case"Boolean":return d.jsx(Up,{form:e,name:t,items:[{label:"true",value:n?"1":"true"},{label:"false",value:n?"0":"false"}],...i});case"RelatedList":return d.jsx(zp,{form:e,name:t,items:r.values,...i});case"Related":return d.jsx(Lp,{form:e,name:t,items:r.values,filter:n,...i});case"DateTime":return d.jsx(Fp,{form:e,name:t,valueFormat:"DD.MM.YYYY HH:mm:ss",schema:r,...i});case"Date":return d.jsx(Np,{form:e,name:t,valueFormat:"DD.MM.YYYY",schema:r,...i});case"Field":return d.jsx(Vp,{form:e,name:t,items:r.validate,...i});case"Integer":case"Float":return d.jsx(bs,{form:e,name:t,...i});default:return d.jsx(bs,{form:e,name:t,...i})}}function xs({opened:e,onClose:t,...r}){const{info:n,addEntry:i}=Re(),a={modal:{},stack:{},addButton:{}},{addButton:o,modal:s,stack:l}=v.useProps("AddDialog",a,r),u=zi.useForm({initialValues:n.add.defaultValues,validate:pa(n.add.schema)}),f=async c=>{await i(c),u.reset(),t()};return T.useEffect(()=>{u.setInitialValues(n.add.defaultValues),u.reset()},[n.add.defaultValues]),d.jsx(v.Modal,{opened:e,onClose:()=>{u.reset(),t()},title:n.add.title,size:"lg",centered:!0,...s,children:d.jsx(v.Box,{component:"form",onSubmit:u.onSubmit(f),children:d.jsx(v.Stack,{spacing:"md",...l,children:d.jsxs(v.ScrollArea.Autosize,{mah:450,type:"auto",children:[n.add.columns.map((c,p)=>d.jsx(ha,{form:u,name:c.name,label:c.label,description:c.description,schema:c,withAsterisk:c.required},p)),d.jsx(v.Group,{position:"right",mt:"xl",children:d.jsx(v.Button,{type:"submit",...o,children:"Add"})})]})})})})}var ma={exports:{}},On={exports:{}},ue={};/** @license React v16.13.1
|
|
36
36
|
* react-is.production.min.js
|
|
37
37
|
*
|
|
38
38
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -51,7 +51,7 @@ object-assign
|
|
|
51
51
|
(c) Sindre Sorhus
|
|
52
52
|
@license MIT
|
|
53
53
|
*/var ga,ws;function Gp(){if(ws)return ga;ws=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(o).map(function(f){return o[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ga=i()?Object.assign:function(a,o){for(var s,l=n(a),u,f=1;f<arguments.length;f++){s=Object(arguments[f]);for(var c in s)t.call(s,c)&&(l[c]=s[c]);if(e){u=e(s);for(var p=0;p<u.length;p++)r.call(s,u[p])&&(l[u[p]]=s[u[p]])}}return l},ga}var ya,Cs;function va(){if(Cs)return ya;Cs=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ya=e,ya}var ba,Os;function As(){return Os||(Os=1,ba=Function.call.bind(Object.prototype.hasOwnProperty)),ba}var xa,Ps;function qp(){if(Ps)return xa;Ps=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=va(),r={},n=As();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(a,o,s,l,u){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var c;try{if(typeof a[f]!="function"){var p=Error((l||"React class")+": "+s+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}c=a[f](o,f,l,s,null,t)}catch(g){c=g}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var y=u?u():"";e("Failed "+s+" type: "+c.message+(y??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},xa=i,xa}var _a,ks;function Yp(){if(ks)return _a;ks=1;var e=Ss(),t=Gp(),r=va(),n=As(),i=qp(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return _a=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(C){var P=C&&(u&&C[u]||C[f]);if(typeof P=="function")return P}var p="<<anonymous>>",y={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:k(),arrayOf:M,element:N(),elementType:_(),instanceOf:R,node:ae(),objectOf:J,oneOf:F,oneOfType:ee,shape:le,exact:me};function g(C,P){return C===P?C!==0||1/C===1/P:C!==C&&P!==P}function h(C,P){this.message=C,this.data=P&&typeof P=="object"?P:{},this.stack=""}h.prototype=Error.prototype;function x(C){if(process.env.NODE_ENV!=="production")var P={},Y=0;function L(U,V,q,K,Z,X,Ae){if(K=K||p,X=X||q,Ae!==r){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ie=K+":"+q;!P[Ie]&&Y<3&&(a("You are manually calling a React.PropTypes validation function for the `"+X+"` prop on `"+K+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),P[Ie]=!0,Y++)}}return V[q]==null?U?V[q]===null?new h("The "+Z+" `"+X+"` is marked as required "+("in `"+K+"`, but its value is `null`.")):new h("The "+Z+" `"+X+"` is marked as required in "+("`"+K+"`, but its value is `undefined`.")):null:C(V,q,K,Z,X)}var G=L.bind(null,!1);return G.isRequired=L.bind(null,!0),G}function w(C){function P(Y,L,G,U,V,q){var K=Y[L],Z=je(K);if(Z!==C){var X=Ze(K);return new h("Invalid "+U+" `"+V+"` of type "+("`"+X+"` supplied to `"+G+"`, expected ")+("`"+C+"`."),{expectedType:C})}return null}return x(P)}function k(){return x(o)}function M(C){function P(Y,L,G,U,V){if(typeof C!="function")return new h("Property `"+V+"` of component `"+G+"` has invalid PropType notation inside arrayOf.");var q=Y[L];if(!Array.isArray(q)){var K=je(q);return new h("Invalid "+U+" `"+V+"` of type "+("`"+K+"` supplied to `"+G+"`, expected an array."))}for(var Z=0;Z<q.length;Z++){var X=C(q,Z,G,U,V+"["+Z+"]",r);if(X instanceof Error)return X}return null}return x(P)}function N(){function C(P,Y,L,G,U){var V=P[Y];if(!s(V)){var q=je(V);return new h("Invalid "+G+" `"+U+"` of type "+("`"+q+"` supplied to `"+L+"`, expected a single ReactElement."))}return null}return x(C)}function _(){function C(P,Y,L,G,U){var V=P[Y];if(!e.isValidElementType(V)){var q=je(V);return new h("Invalid "+G+" `"+U+"` of type "+("`"+q+"` supplied to `"+L+"`, expected a single ReactElement type."))}return null}return x(C)}function R(C){function P(Y,L,G,U,V){if(!(Y[L]instanceof C)){var q=C.name||p,K=yt(Y[L]);return new h("Invalid "+U+" `"+V+"` of type "+("`"+K+"` supplied to `"+G+"`, expected ")+("instance of `"+q+"`."))}return null}return x(P)}function F(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function P(Y,L,G,U,V){for(var q=Y[L],K=0;K<C.length;K++)if(g(q,C[K]))return null;var Z=JSON.stringify(C,function(Ae,$){var Ie=Ze($);return Ie==="symbol"?String($):$});return new h("Invalid "+U+" `"+V+"` of value `"+String(q)+"` "+("supplied to `"+G+"`, expected one of "+Z+"."))}return x(P)}function J(C){function P(Y,L,G,U,V){if(typeof C!="function")return new h("Property `"+V+"` of component `"+G+"` has invalid PropType notation inside objectOf.");var q=Y[L],K=je(q);if(K!=="object")return new h("Invalid "+U+" `"+V+"` of type "+("`"+K+"` supplied to `"+G+"`, expected an object."));for(var Z in q)if(n(q,Z)){var X=C(q,Z,G,U,V+"."+Z,r);if(X instanceof Error)return X}return null}return x(P)}function ee(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var P=0;P<C.length;P++){var Y=C[P];if(typeof Y!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+at(Y)+" at index "+P+"."),o}function L(G,U,V,q,K){for(var Z=[],X=0;X<C.length;X++){var Ae=C[X],$=Ae(G,U,V,q,K,r);if($==null)return null;$.data&&n($.data,"expectedType")&&Z.push($.data.expectedType)}var Ie=Z.length>0?", expected one of type ["+Z.join(", ")+"]":"";return new h("Invalid "+q+" `"+K+"` supplied to "+("`"+V+"`"+Ie+"."))}return x(L)}function ae(){function C(P,Y,L,G,U){return ye(P[Y])?null:new h("Invalid "+G+" `"+U+"` supplied to "+("`"+L+"`, expected a ReactNode."))}return x(C)}function z(C,P,Y,L,G){return new h((C||"React class")+": "+P+" type `"+Y+"."+L+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+G+"`.")}function le(C){function P(Y,L,G,U,V){var q=Y[L],K=je(q);if(K!=="object")return new h("Invalid "+U+" `"+V+"` of type `"+K+"` "+("supplied to `"+G+"`, expected `object`."));for(var Z in C){var X=C[Z];if(typeof X!="function")return z(G,U,V,Z,Ze(X));var Ae=X(q,Z,G,U,V+"."+Z,r);if(Ae)return Ae}return null}return x(P)}function me(C){function P(Y,L,G,U,V){var q=Y[L],K=je(q);if(K!=="object")return new h("Invalid "+U+" `"+V+"` of type `"+K+"` "+("supplied to `"+G+"`, expected `object`."));var Z=t({},Y[L],C);for(var X in Z){var Ae=C[X];if(n(C,X)&&typeof Ae!="function")return z(G,U,V,X,Ze(Ae));if(!Ae)return new h("Invalid "+U+" `"+V+"` key `"+X+"` supplied to `"+G+"`.\nBad object: "+JSON.stringify(Y[L],null," ")+`
|
|
54
|
-
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var $=Ae(q,X,G,U,V+"."+X,r);if($)return $}return null}return x(P)}function ye(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every(ye);if(C===null||s(C))return!0;var P=c(C);if(P){var Y=P.call(C),L;if(P!==C.entries){for(;!(L=Y.next()).done;)if(!ye(L.value))return!1}else for(;!(L=Y.next()).done;){var G=L.value;if(G&&!ye(G[1]))return!1}}else return!1;return!0;default:return!1}}function qe(C,P){return C==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function je(C){var P=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":qe(P,C)?"symbol":P}function Ze(C){if(typeof C>"u"||C===null)return""+C;var P=je(C);if(P==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return P}function at(C){var P=Ze(C);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function yt(C){return!C.constructor||!C.constructor.name?p:C.constructor.name}return y.checkPropTypes=i,y.resetWarningCache=i.resetWarningCache,y.PropTypes=y,y},_a}var Ta,js;function Kp(){if(js)return Ta;js=1;var e=va();function t(){}function r(){}return r.resetWarningCache=t,Ta=function(){function n(o,s,l,u,f,c){if(c!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},Ta}if(process.env.NODE_ENV!=="production"){var Xp=Ss(),Jp=!0;ma.exports=Yp()(Xp.isElement,Jp)}else ma.exports=Kp()();var Zp=ma.exports;const H=Ot(Zp);var Qp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},eh=Object.defineProperty,th=Object.defineProperties,rh=Object.getOwnPropertyDescriptors,An=Object.getOwnPropertySymbols,$s=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,Rs=(e,t,r)=>t in e?eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ms=(e,t)=>{for(var r in t||(t={}))$s.call(t,r)&&Rs(e,r,t[r]);if(An)for(var r of An(t))Is.call(t,r)&&Rs(e,r,t[r]);return e},nh=(e,t)=>th(e,rh(t)),ih=(e,t)=>{var r={};for(var n in e)$s.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&An)for(var n of An(e))t.indexOf(n)<0&&Is.call(e,n)&&(r[n]=e[n]);return r},Ve=(e,t,r)=>{const n=T.forwardRef((i,a)=>{var o=i,{color:s="currentColor",size:l=24,stroke:u=2,children:f}=o,c=ih(o,["color","size","stroke","children"]);return T.createElement("svg",Ms(nh(Ms({ref:a},Qp),{width:l,height:l,stroke:s,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),c),[...r.map(([p,y])=>T.createElement(p,y)),...f||[]])});return n.propTypes={color:H.string,size:H.oneOfType([H.string,H.number]),stroke:H.oneOfType([H.string,H.number])},n.displayName=`${t}`,n},ah=Ve("alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]),oh=Ve("app-window","IconAppWindow",[["path",{d:"M3 5m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M6 8h.01",key:"svg-1"}],["path",{d:"M9 8h.01",key:"svg-2"}]]),Ea=Ve("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),Ds=Ve("chevron-up","IconChevronUp",[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]]),sh=Ve("download","IconDownload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]),lh=Ve("exclamation-circle","IconExclamationCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 9v4",key:"svg-1"}],["path",{d:"M12 16v.01",key:"svg-2"}]]),uh=Ve("eye","IconEye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]]),Ns=Ve("filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]),ch=Ve("id-badge-2","IconIdBadge2",[["path",{d:"M7 12h3v4h-3z",key:"svg-0"}],["path",{d:"M10 6h-6a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1h-6",key:"svg-1"}],["path",{d:"M10 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M14 16h2",key:"svg-3"}],["path",{d:"M14 12h4",key:"svg-4"}]]),Fs=Ve("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),fh=Ve("logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]),dh=Ve("pencil","IconPencil",[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]]),Sa=Ve("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),Ls=Ve("trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]),ph=Ve("users","IconUsers",[["path",{d:"M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"svg-2"}],["path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85",key:"svg-3"}]]);function zs(...e){const[t,r]=T.useState(!1),n={bg:"transparent",size:"sm",c:"gray"},i=v.useProps("ActionIcon",n,e);return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Add Item",children:d.jsx(v.ActionIcon,{bg:i.bg,size:i.size,c:i.c,onClick:()=>{r(!0)},children:d.jsx(Sa,{})})}),d.jsx(xs,{opened:t,onClose:()=>{r(!1)}})]})}function hh({form:e,name:t,items:r,onChange:n,...i}){return d.jsx(v.Select,{data:r,searchable:!0,...e.getInputProps(t),onChange:n,...i})}function mh({form:e,name:t,items:r,onChange:n,...i}){return d.jsx(v.Select,{data:r,searchable:!0,...e.getInputProps(t),onChange:n,...i})}function gh({form:e,name:t,...r}){const n=v.useCombobox({onDropdownClose:()=>n.resetSelectedOption(),onDropdownOpen:()=>n.updateSelectedOptionIndex("active")}),[i,a]=T.useState([]),[o,s]=T.useState(""),l=c=>{o!==""&&(i.includes(o)||a(p=>[...p,o]),s(""))},u=c=>a(p=>p.filter(y=>y!==c)),f=i.map(c=>d.jsx(v.Pill,{withRemoveButton:!0,onRemove:()=>u(c),children:c},c));return T.useEffect(()=>{if(e.getInputProps(t).value)try{const c=JSON.parse(String(e.getInputProps(t).value));a([...c])}catch(c){console.error("Error parsing JSON:",c)}else e.getInputProps(t).onChange([])},[]),T.useEffect(()=>{e.getInputProps(t).onChange(i)},[i]),d.jsxs(v.Combobox,{store:n,onOptionSubmit:l,children:[d.jsx(v.Combobox.DropdownTarget,{children:d.jsx(v.PillsInput,{onClick:()=>n.openDropdown(),children:d.jsxs(v.Pill.Group,{children:[f,d.jsx(v.Combobox.EventsTarget,{children:d.jsx(v.PillsInput.Field,{onFocus:()=>n.openDropdown(),onBlur:()=>n.closeDropdown(),value:o,placeholder:"Search values",onChange:c=>{n.updateSelectedOptionIndex(),s(c.currentTarget.value)},onKeyDown:c=>{c.key==="Backspace"&&o.length===0&&(c.preventDefault(),u(i[i.length-1]))}})})]})})}),d.jsx(v.Combobox.Dropdown,{children:d.jsx(v.Combobox.Options,{children:d.jsxs(v.Combobox.Option,{value:"$create",children:["+ Create ",o]})})})]})}function Us({onClose:e,...t}){const{info:r,queryParams:n,setQueryParams:i,path:a}=Re(),o=zi.useForm({initialValues:{filters:[]},validate:pa(zr({filters:sa().of(zr({col:wn().transform(c=>c||void 0).required("Field is required"),opr:wn().transform(c=>c||void 0).required("col is required"),value:Sn().when("col",{is:c=>c&&r.filters[c].schema.required,then:()=>Sn().required("Value is required")})}))}))}),s={bg:"transparent",size:"sm",c:"gray"},l=v.useProps("ActionIcon",s,t);T.useEffect(()=>{o.setValues({filters:[]}),o.reset()},[a]),T.useEffect(()=>{if(n.filters&&n.filters.length){const c=n.filters.map(p=>({...p,key:Nr.randomId()}));o.setFieldValue("filters",c)}},[n.filters]);const u=c=>{const p=c.filters.map(({key:g,...h})=>h),y=JSON.parse(JSON.stringify(p));i({filters:y,page:0}),e()},f=o.values.filters.map((c,p)=>d.jsxs(v.Box,{px:"sm",children:[d.jsxs(v.Flex,{my:"md",gap:"md",style:{whiteSpace:"nowrap"},children:[d.jsx(v.Box,{style:{width:"192px"},children:r&&r.filters&&d.jsx(hh,{form:o,name:`filters.${p}.col`,items:Object.entries(r.filters).map(([y,g])=>({label:g.label,value:String(y)})),onChange:y=>{o.setFieldValue(`filters.${p}`,{col:y,opr:"",value:"",key:Nr.randomId()})}})}),d.jsx(v.Box,{style:{width:"192px"},children:c.col?d.jsx(mh,{form:o,name:`filters.${p}.opr`,items:r.filters[c.col].filters.map(y=>({label:y.name,value:y.operator})),onChange:y=>{o.setFieldValue(`filters.${p}`,{col:o.values.filters[p].col,opr:y,value:"",key:Nr.randomId()})}}):null}),d.jsx(v.Box,{style:{width:"192px"},children:c.col?c.opr==="in"?d.jsx(gh,{form:o,name:`filters.${p}.value`}):d.jsx(ha,{form:o,name:`filters.${p}.value`,schema:r.filters[c.col].schema,filter:!0}):null}),d.jsx(v.ActionIcon,{bg:l.bg,size:l.size,c:l.c,onClick:()=>{o.removeListItem("filters",p)},children:d.jsx(Ls,{})})]}),o.values.filters.length>1&&p<o.values.filters.length-1?d.jsx(v.Divider,{my:"md",labelPosition:"center",label:"AND"}):null]},c.key));return d.jsxs(v.Box,{component:"form",onSubmit:o.onSubmit(u),children:[f.length===0&&d.jsx(v.Box,{style:{width:"642px"},children:d.jsx(v.Text,{style:{fontStyle:"italic",padding:"7px"},size:"sm",c:"dimmed",children:"No filters selected..."})}),d.jsx(v.ScrollArea.Autosize,{mah:"40vh",mt:20,children:f}),d.jsx(v.Divider,{my:"sm"}),d.jsxs(v.Box,{style:{display:"flex",justifyContent:"space-between"},children:[d.jsx(v.Button,{variant:"subtle",leftSection:d.jsx(Sa,{}),onClick:()=>{o.insertListItem("filters",{col:"",opr:"",value:"",key:Nr.randomId()})},children:"Add Filter"}),d.jsx(v.Group,{spacing:"md",children:d.jsx(v.Button,{type:"submit",children:"Apply"})})]})]})}function Bs(...e){const{queryParams:t}=Re(),r={bg:"transparent",size:"sm",c:"gray"},n=v.useProps("ActionIcon",r,e),[i,a]=T.useState(!1);return d.jsxs(v.Popover,{opened:i,position:"bottom-end",onClose:()=>a(!1),closeOnClickOutside:!1,zIndex:1,children:[d.jsx(v.Popover.Target,{children:d.jsx(v.Tooltip,{opened:i?!1:null,label:"Filter",children:t.filters.length!=0?d.jsx(v.Indicator,{zIndex:20,size:16,label:t.filters.length,children:d.jsx(v.ActionIcon,{bg:n.bg,size:n.size,c:n.c,onClick:()=>a(!0),children:d.jsx(Ns,{})})}):d.jsx(v.ActionIcon,{bg:n.bg,size:n.size,c:n.c,onClick:()=>a(!0),children:d.jsx(Ns,{})})})}),d.jsxs(v.Popover.Dropdown,{px:"xs",children:[d.jsx(v.Box,{style:{position:"absolute",top:4,right:4},children:d.jsx(v.CloseButton,{title:"Filters",onClick:()=>a(!1)})}),d.jsx(Us,{onClose:()=>{a(!1)}})]})]})}function yh(...e){const[t,r]=T.useState(!1),{download:n}=Re(),i={bg:"transparent",size:"sm",c:"gray"},a=v.useProps("ActionIcon",i,e);return t?d.jsx(v.Loader,{color:a.c,size:a.size}):d.jsx(v.Tooltip,{label:"Download",children:d.jsx(v.ActionIcon,{bg:a.bg,size:a.size,c:a.c,onClick:()=>{r(!0),n("download").then(()=>r(!1))},children:d.jsx(sh,{})})})}const Vs=T.memo(({hideAdd:e,hideFilter:t,hideDownload:r,toolbarCustomizer:n})=>{const{info:i}=Re(),a=T.useMemo(()=>{const s={};return Object.entries(n).forEach(([l,u])=>{s[l]=u,typeof s[l]=="function"&&(s[l]=s[l]())}),s},[n]),o=i.permissions.includes("can_post");return d.jsxs(v.Flex,{justify:"flex-end",p:"md",gap:"sm",children:[!r&&(a.download||d.jsx(yh,{})),o&&!e?a.add||d.jsx(zs,{}):null,t?null:a.filter||d.jsx(Bs,{})]})});Vs.displayName="Toolbar";const Ws={root:"_root_1kmay_1",wrapper:"_wrapper_1kmay_7",icon:"_icon_1kmay_18"};function wa({column:e,label:t,orderColumn:r,related:n,toggleAll:i,allChecked:a,classNames:o,styles:s,customElement:l,...u}){const{queryParams:f,setQueryParams:c,loading:p}=Re(),y={fw:700,size:"sm",color:"gray.8",hoverColor:"gray.6",selectedColor:"blue"},g=v.useStyles({name:"FieldTitle",classes:Ws,classNames:o,styles:s,props:u}),h=v.useProps("FieldTitle",y,u),{hovered:x,ref:w}=Nr.useHover(),k=r&&f.order_column===r;return d.jsx(v.Table.Th,{className:Ws.fieldTitleRoot,...g("root"),onClick:r&&!p?()=>c({order_column:r,order_direction:f.order_direction==="asc"?"desc":"asc"}):null,children:d.jsx(v.Box,{ref:w,...g("wrapper"),children:e==="Checkbox"?d.jsx(v.Checkbox,{pb:5,pl:2,onChange:i,checked:a}):d.jsxs(d.Fragment,{children:[d.jsx(v.Box,{w:"100%",fw:h.fw,size:"xl",c:x?h.hoverColor:k?h.selectedColor:h.color,children:l||t||e}),n?d.jsx(v.Tooltip,{label:"Related Field",children:d.jsx(v.Indicator,{label:"rel",style:{indicator:{top:"-1px !important",right:"-2px !important",padding:"4px"}},children:d.jsx(v.Box,{...g("icon"),children:k?f.order_direction==="asc"?d.jsx(Ea,{size:14,strokeWidth:1.5}):d.jsx(Ds,{size:14,strokeWidth:1.5}):null})})}):d.jsx(v.Box,{...g("icon"),children:k?f.order_direction==="asc"?d.jsx(Ea,{size:14,strokeWidth:1.5}):d.jsx(Ds,{size:14,strokeWidth:1.5}):null})]})})})}const Hs=T.memo(({data:e,info:t,settings:r,hideActions:n,hideCheckbox:i,allChecked:a,toggleAll:o,headerCustomizer:s})=>{const l=e.list_columns.includes("actions")?"_actions":"actions";let u=s==null?void 0:s[l];return typeof u=="function"&&(u=u()),d.jsx(v.Table.Thead,{children:d.jsxs(v.Table.Tr,{children:[i?null:d.jsx(wa,{data:e,column:"Checkbox",allChecked:a,toggleAll:o}),n?null:d.jsx(wa,{column:"Actions",customElement:u}),e.list_columns.map((f,c)=>{var y;let p=s==null?void 0:s[f];return typeof p=="function"&&(p=p(e.label_columns[f])),p===null?null:d.jsx(wa,{column:f,label:e.label_columns[f],orderColumn:e.order_columns.find(g=>g===f)||e.order_columns.find(g=>g.startsWith(`${f}.`)),related:((y=t.filters[f])==null?void 0:y.schema.type)==="Nested",customElement:p},f)})]})})});Hs.displayName="Header";const Gs=(e,t)=>{const r=t.split(".").reduce((n,i)=>n[i],e);return!r&&typeof r!="boolean"&&typeof r!="number"?null:typeof r=="boolean"?r.toString():Array.isArray(r)?r.map(n=>n.name_).join(", "):typeof r=="object"?r.name_:r};function qs(e,t){return e===!0||Array.isArray(e)?t:Object.fromEntries(Object.keys(e).map(r=>[r,qs(e[r],t[r])]))}function Ys(e,t){if(!e)return e;const r=t.values;if(!r||!r.length)return e;const n=r[0].id;if(!(n instanceof Object))return e;const a=Object.keys(n),o={};return a.forEach(s=>{o[s]=e[s]}),e.id=o,e}function vh(e,t){const r={};return t.forEach(n=>{if(n.type==="Related"){r[n.name]=Ys(e.result[n.name],n);return}if(n.type==="RelatedList"){r[n.name]=e.result[n.name].map(i=>Ys(i,n));return}r[n.name]=typeof e.result[n.name]=="boolean"?String(e.result[n.name]):e.result[n.name]}),r}function bh({relatedPath:e,...t}){const{path:r}=Re();return Pe(r?r.substring(0,r.lastIndexOf("/")):"",e.substring(0,e.lastIndexOf("/"))),d.jsx(vs,{resource_name:e.replace("/",""),relation:t,children:d.jsx(qa,{hideToolbar:!0,hideDownload:!1})})}const xh=T.memo(bh);function _h({item:e,info:t,loading:r,opened:n,onClose:i,...a}){const o={modal:{},tabs:{},tabsList:{},tabsPanel:{}},{modal:s,tabs:l,tabsList:u,tabsPanel:f}=v.useProps("ViewDialog",o,a);return d.jsxs(v.Modal,{opened:n,onClose:i,title:`${e==null?void 0:e.show_title} (#${Fe(e==null?void 0:e.id)})`,size:"lg",centered:!0,zIndex:1e3,...s,children:[d.jsx(v.LoadingOverlay,{visible:r}),!r&&e?d.jsxs(v.Tabs,{defaultValue:"details",...l,children:[d.jsxs(v.Tabs.List,{...u,children:[d.jsx(v.Tabs.Tab,{value:"details",children:"Details"}),t.relations.map((c,p)=>d.jsx(v.Tabs.Tab,{value:c.name,children:c.name},p))]}),d.jsx(v.Tabs.Panel,{pt:"xs",value:"details",...f,children:d.jsx(v.Paper,{p:"xs",withBorder:!0,children:d.jsx(v.Stack,{spacing:"md",children:d.jsx(v.ScrollArea,{h:450,type:"auto",children:e.show_columns.map((c,p)=>d.jsxs(v.Grid,{maw:500,children:[d.jsx(v.Grid.Col,{span:4,children:d.jsx(v.Text,{size:"md",children:e.label_columns[c]})}),d.jsx(v.Grid.Col,{span:1,children:d.jsx(v.Text,{size:"xs",children:":"})}),d.jsx(v.Grid.Col,{span:6,children:d.jsx(v.Text,{size:"md",children:Gs(e.result,c)})})]},p))})})})}),t.relations.map((c,p)=>d.jsx(v.Tabs.Panel,{pt:"xs",value:c.name,children:d.jsx(v.Paper,{withBorder:!0,children:d.jsx(xh,{relatedPath:c.path,id:Fe(e.id),foreign_key:c.foreign_key,type:c.type})})},p))]}):null]})}function Th({id:e,...t}){const{info:r,getEntry:n}=Re(),i={bg:"transparent",size:"sm",c:"gray"},a=v.useProps("ActionIcon",i,t),[o,s]=T.useState(null),[l,u]=T.useState(!1),[f,c]=T.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Details",children:d.jsx(v.ActionIcon,{bg:a.bg,size:a.size,c:a.c,onClick:async()=>{u(!0);const p=await n(e);p&&(s(p),u(!1),c(!0))},children:d.jsx(uh,{})})}),d.jsx(_h,{item:o,info:r,loading:l,opened:f,onClose:()=>c(!1)})]})}function Eh(e,t){return new Promise(r=>{r(vh(e,t.edit.columns))})}function Ks({item:e,info:t,opened:r,onClose:n,...i}){const{updateEntry:a}=Re(),o={modal:{},stack:{},saveButton:{}},{modal:s,stack:l,saveButton:u}=v.useProps("EditDialog",o,i),f=zi.useForm({initialValues:t.edit.defaultValues,validate:pa(t.edit.schema)}),c=()=>{const y={};return Object.keys(f.values).forEach(g=>{f.isDirty(g)&&(y[g]=!0)}),y};T.useEffect(()=>{e&&Eh(e,t).then(y=>{f.setValues(y),f.resetDirty(y)})},[e,t.edit.columns]);const p=async y=>{y=qs(c(),y),await a(e.id,y),n()};return T.useEffect(()=>{f.setInitialValues(t.edit.defaultValues),f.reset()},[t.edit.defaultValues]),e?d.jsx(v.Modal,{opened:r,onClose:()=>{n()},title:t.edit.title,size:"lg",centered:!0,...s,children:d.jsx(v.Box,{component:"form",onSubmit:f.onSubmit(p),children:d.jsx(v.Stack,{spacing:"md",...l,children:d.jsxs(v.ScrollArea.Autosize,{mah:450,type:"auto",children:[t.edit.columns.map((y,g)=>d.jsx(ha,{form:f,name:y.name,label:y.label,description:y.description,schema:y,withAsterisk:y.required},g)),d.jsx(v.Group,{position:"right",mt:"xl",children:d.jsx(v.Button,{type:"submit",...u,children:"Save"})})]})})})}):null}function Xs({id:e,...t}){const{info:r,getEntry:n}=Re(),i={bg:"transparent",size:"sm",c:"gray"},a=v.useProps("ActionIcon",i,t),[o,s]=T.useState(null),[l,u]=T.useState(!1),[f,c]=T.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Edit",children:d.jsx(v.ActionIcon,{bg:a.bg,size:a.size,c:a.c,onClick:async()=>{u(!0);const p=await n(e);p&&(s(p),u(!1),c(!0))},children:d.jsx(dh,{})})}),d.jsx(Ks,{item:o,info:r,opened:f,onClose:()=>c(!1)})]})}function Sh({opened:e,onClose:t,handleAccept:r,handleReject:n}){return d.jsxs(v.Modal,{opened:e,onClose:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",title:"Item löschen?",centered:!0,children:["Sind Sie Sicher, dass Sie das Item löschen wollen?",d.jsxs(v.Group,{align:"right",mt:"xl",justify:"flex-end",children:[d.jsx(v.Button,{onClick:n,variant:"default",children:"Abbrechen"}),d.jsx(v.Button,{onClick:r,color:"red",children:"Löschen"})]})]})}function Js({id:e,...t}){const{deleteEntry:r}=Re(),n={bg:"transparent",size:"sm",c:"gray"},i=v.useProps("ActionIcon",n,t),[a,o]=T.useState(!1),s=()=>{o(!1)},l=async()=>{r(e),o(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Delete",children:d.jsx(v.ActionIcon,{bg:i.bg,size:i.size,c:i.c,onClick:()=>{o(!0)},children:d.jsx(Ls,{})})}),d.jsx(Sh,{opened:a,onClose:s,handleAccept:l,handleReject:s})]})}function Zs({id:e,selected:t}){const{info:r}=Re();return d.jsxs(v.Flex,{style:{gap:4,whiteSpace:"nowrap"},children:[r.permissions.includes("can_get")?d.jsx(Th,{id:e}):null,r.permissions.includes("can_put")?d.jsx(Xs,{id:e}):null,r.permissions.includes("can_delete")?d.jsx(Js,{id:e}):null]})}var Ca={},Oa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(n){n.Root="root",n.Text="text",n.Directive="directive",n.Comment="comment",n.Script="script",n.Style="style",n.Tag="tag",n.CDATA="cdata",n.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function r(n){return n.type===t.Tag||n.type===t.Script||n.type===t.Style}e.isTag=r,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})(Oa);var te={},Ft=$e&&$e.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ur=$e&&$e.__assign||function(){return Ur=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ur.apply(this,arguments)};Object.defineProperty(te,"__esModule",{value:!0}),te.cloneNode=te.hasChildren=te.isDocument=te.isDirective=te.isComment=te.isText=te.isCDATA=te.isTag=te.Element=te.Document=te.CDATA=te.NodeWithChildren=te.ProcessingInstruction=te.Comment=te.Text=te.DataNode=te.Node=void 0;var Xe=Oa,Aa=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),Pa(this,t)},e}();te.Node=Aa;var Pn=function(e){Ft(t,e);function t(r){var n=e.call(this)||this;return n.data=r,n}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),t}(Aa);te.DataNode=Pn;var Qs=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.Text,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(Pn);te.Text=Qs;var el=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.Comment,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(Pn);te.Comment=el;var tl=function(e){Ft(t,e);function t(r,n){var i=e.call(this,n)||this;return i.name=r,i.type=Xe.ElementType.Directive,i}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(Pn);te.ProcessingInstruction=tl;var kn=function(e){Ft(t,e);function t(r){var n=e.call(this)||this;return n.children=r,n}return Object.defineProperty(t.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),t}(Aa);te.NodeWithChildren=kn;var rl=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.CDATA,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(kn);te.CDATA=rl;var nl=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.Root,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(kn);te.Document=nl;var il=function(e){Ft(t,e);function t(r,n,i,a){i===void 0&&(i=[]),a===void 0&&(a=r==="script"?Xe.ElementType.Script:r==="style"?Xe.ElementType.Style:Xe.ElementType.Tag);var o=e.call(this,i)||this;return o.name=r,o.attribs=n,o.type=a,o}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(n){var i,a;return{name:n,value:r.attribs[n],namespace:(i=r["x-attribsNamespace"])===null||i===void 0?void 0:i[n],prefix:(a=r["x-attribsPrefix"])===null||a===void 0?void 0:a[n]}})},enumerable:!1,configurable:!0}),t}(kn);te.Element=il;function al(e){return(0,Xe.isTag)(e)}te.isTag=al;function ol(e){return e.type===Xe.ElementType.CDATA}te.isCDATA=ol;function sl(e){return e.type===Xe.ElementType.Text}te.isText=sl;function ll(e){return e.type===Xe.ElementType.Comment}te.isComment=ll;function ul(e){return e.type===Xe.ElementType.Directive}te.isDirective=ul;function cl(e){return e.type===Xe.ElementType.Root}te.isDocument=cl;function wh(e){return Object.prototype.hasOwnProperty.call(e,"children")}te.hasChildren=wh;function Pa(e,t){t===void 0&&(t=!1);var r;if(sl(e))r=new Qs(e.data);else if(ll(e))r=new el(e.data);else if(al(e)){var n=t?ka(e.children):[],i=new il(e.name,Ur({},e.attribs),n);n.forEach(function(l){return l.parent=i}),e.namespace!=null&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=Ur({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=Ur({},e["x-attribsPrefix"])),r=i}else if(ol(e)){var n=t?ka(e.children):[],a=new rl(n);n.forEach(function(u){return u.parent=a}),r=a}else if(cl(e)){var n=t?ka(e.children):[],o=new nl(n);n.forEach(function(u){return u.parent=o}),e["x-mode"]&&(o["x-mode"]=e["x-mode"]),r=o}else if(ul(e)){var s=new tl(e.name,e.data);e["x-name"]!=null&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),r=s}else throw new Error("Not implemented yet: ".concat(e.type));return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}te.cloneNode=Pa;function ka(e){for(var t=e.map(function(n){return Pa(n,!0)}),r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}(function(e){var t=$e&&$e.__createBinding||(Object.create?function(s,l,u,f){f===void 0&&(f=u);var c=Object.getOwnPropertyDescriptor(l,u);(!c||("get"in c?!l.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(s,f,c)}:function(s,l,u,f){f===void 0&&(f=u),s[f]=l[u]}),r=$e&&$e.__exportStar||function(s,l){for(var u in s)u!=="default"&&!Object.prototype.hasOwnProperty.call(l,u)&&t(l,s,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var n=Oa,i=te;r(te,e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function s(l,u,f){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof u=="function"&&(f=u,u=a),typeof l=="object"&&(u=l,l=void 0),this.callback=l??null,this.options=u??a,this.elementCB=f??null}return s.prototype.onparserinit=function(l){this.parser=l},s.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},s.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},s.prototype.onerror=function(l){this.handleCallback(l)},s.prototype.onclosetag=function(){this.lastNode=null;var l=this.tagStack.pop();this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(l)},s.prototype.onopentag=function(l,u){var f=this.options.xmlMode?n.ElementType.Tag:void 0,c=new i.Element(l,u,void 0,f);this.addNode(c),this.tagStack.push(c)},s.prototype.ontext=function(l){var u=this.lastNode;if(u&&u.type===n.ElementType.Text)u.data+=l,this.options.withEndIndices&&(u.endIndex=this.parser.endIndex);else{var f=new i.Text(l);this.addNode(f),this.lastNode=f}},s.prototype.oncomment=function(l){if(this.lastNode&&this.lastNode.type===n.ElementType.Comment){this.lastNode.data+=l;return}var u=new i.Comment(l);this.addNode(u),this.lastNode=u},s.prototype.oncommentend=function(){this.lastNode=null},s.prototype.oncdatastart=function(){var l=new i.Text(""),u=new i.CDATA([l]);this.addNode(u),l.parent=u,this.lastNode=l},s.prototype.oncdataend=function(){this.lastNode=null},s.prototype.onprocessinginstruction=function(l,u){var f=new i.ProcessingInstruction(l,u);this.addNode(f)},s.prototype.handleCallback=function(l){if(typeof this.callback=="function")this.callback(l,this.dom);else if(l)throw l},s.prototype.addNode=function(l){var u=this.tagStack[this.tagStack.length-1],f=u.children[u.children.length-1];this.options.withStartIndices&&(l.startIndex=this.parser.startIndex),this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),u.children.push(l),f&&(l.prev=f,f.next=l),l.parent=u,this.lastNode=null},s}();e.DomHandler=o,e.default=o})(Ca);var ja={},$a={};Object.defineProperty($a,"__esModule",{value:!0});var fl="html",dl="head",jn="body",Ch=/<([a-zA-Z]+[0-9]?)/,pl=/<head[^]*>/i,hl=/<body[^]*>/i,$n=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},Ia=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},ml=typeof window=="object"&&window.DOMParser;if(typeof ml=="function"){var Oh=new ml,Ah="text/html";Ia=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),Oh.parseFromString(e,Ah)},$n=Ia}if(typeof document=="object"&&document.implementation){var In=document.implementation.createHTMLDocument();$n=function(e,t){if(t){var r=In.documentElement.querySelector(t);return r&&(r.innerHTML=e),In}return In.documentElement.innerHTML=e,In}}var Rn=typeof document=="object"&&document.createElement("template"),Ra;Rn&&Rn.content&&(Ra=function(e){return Rn.innerHTML=e,Rn.content.childNodes});function Ph(e){var t,r,n=e.match(Ch),i=n&&n[1]?n[1].toLowerCase():"";switch(i){case fl:{var a=Ia(e);if(!pl.test(e)){var o=a.querySelector(dl);(t=o==null?void 0:o.parentNode)===null||t===void 0||t.removeChild(o)}if(!hl.test(e)){var o=a.querySelector(jn);(r=o==null?void 0:o.parentNode)===null||r===void 0||r.removeChild(o)}return a.querySelectorAll(fl)}case dl:case jn:{var s=$n(e).querySelectorAll(i);return hl.test(e)&&pl.test(e)?s[0].parentNode.childNodes:s}default:{if(Ra)return Ra(e);var o=$n(e,jn).querySelector(jn);return o.childNodes}}}$a.default=Ph;var ur={},gl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(t,r){return t[r.toLowerCase()]=r,t},{})})(gl),Object.defineProperty(ur,"__esModule",{value:!0}),ur.formatDOM=ur.formatAttributes=void 0;var Mn=Ca,kh=gl;function jh(e){return kh.CASE_SENSITIVE_TAG_NAMES_MAP[e]}function yl(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r];t[i.name]=i.value}return t}ur.formatAttributes=yl;function $h(e){e=e.toLowerCase();var t=jh(e);return t||e}function vl(e,t,r){t===void 0&&(t=null);for(var n=[],i,a=0,o=e.length;a<o;a++){var s=e[a];switch(s.nodeType){case 1:{var l=$h(s.nodeName);i=new Mn.Element(l,yl(s.attributes)),i.children=vl(l==="template"?s.content.childNodes:s.childNodes,i);break}case 3:i=new Mn.Text(s.nodeValue);break;case 8:i=new Mn.Comment(s.nodeValue);break;default:continue}var u=n[a-1]||null;u&&(u.next=i),i.parent=t,i.prev=u,i.next=null,n.push(i)}return r&&(i=new Mn.ProcessingInstruction(r.substring(0,r.indexOf(" ")).toLowerCase(),r),i.next=n[0]||null,i.parent=t,n.unshift(i),n[1]&&(n[1].prev=n[0])),n}ur.formatDOM=vl;var Ih=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ja,"__esModule",{value:!0});var Rh=Ih($a),Mh=ur,Dh=/<(![a-zA-Z\s]+)>/;function Nh(e){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(Dh),r=t?t[1]:void 0;return(0,Mh.formatDOM)((0,Rh.default)(e),null,r)}ja.default=Nh;var ht={},Dn={},Fh=0;Dn.SAME=Fh;var Lh=1;Dn.CAMELCASE=Lh,Dn.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};const bl=0,Lt=1,Nn=2,Fn=3,Ma=4,xl=5,_l=6;function zh(e){return Me.hasOwnProperty(e)?Me[e]:null}function We(e,t,r,n,i,a,o){this.acceptsBooleans=t===Nn||t===Fn||t===Ma,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}const Me={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(e=>{Me[e]=new We(e,bl,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([e,t])=>{Me[e]=new We(e,Lt,!1,t,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(e=>{Me[e]=new We(e,Nn,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(e=>{Me[e]=new We(e,Nn,!1,e,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(e=>{Me[e]=new We(e,Fn,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(e=>{Me[e]=new We(e,Fn,!0,e,null,!1,!1)}),["capture","download"].forEach(e=>{Me[e]=new We(e,Ma,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(e=>{Me[e]=new We(e,_l,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(e=>{Me[e]=new We(e,xl,!1,e.toLowerCase(),null,!1,!1)});const Da=/[\-\:]([a-z])/g,Na=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(e=>{const t=e.replace(Da,Na);Me[t]=new We(t,Lt,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(e=>{const t=e.replace(Da,Na);Me[t]=new We(t,Lt,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(e=>{const t=e.replace(Da,Na);Me[t]=new We(t,Lt,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(e=>{Me[e]=new We(e,Lt,!1,e.toLowerCase(),null,!1,!1)});const Uh="xlinkHref";Me[Uh]=new We("xlinkHref",Lt,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(e=>{Me[e]=new We(e,Lt,!1,e.toLowerCase(),null,!0,!0)});const{CAMELCASE:Bh,SAME:Vh,possibleStandardNames:Tl}=Dn,Wh=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Hh=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+Wh+"]*$")),Gh=Object.keys(Tl).reduce((e,t)=>{const r=Tl[t];return r===Vh?e[t]=t:r===Bh?e[t.toLowerCase()]=t:e[t]=r,e},{});ht.BOOLEAN=Fn,ht.BOOLEANISH_STRING=Nn,ht.NUMERIC=xl,ht.OVERLOADED_BOOLEAN=Ma,ht.POSITIVE_NUMERIC=_l,ht.RESERVED=bl,ht.STRING=Lt,ht.getPropertyInfo=zh,ht.isCustomAttribute=Hh,ht.possibleStandardNames=Gh;var Fa={},La={},El=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,qh=/\n/g,Yh=/^\s*/,Kh=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xh=/^:\s*/,Jh=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Zh=/^[;\s]*/,Qh=/^\s+|\s+$/g,em=`
|
|
54
|
+
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var $=Ae(q,X,G,U,V+"."+X,r);if($)return $}return null}return x(P)}function ye(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every(ye);if(C===null||s(C))return!0;var P=c(C);if(P){var Y=P.call(C),L;if(P!==C.entries){for(;!(L=Y.next()).done;)if(!ye(L.value))return!1}else for(;!(L=Y.next()).done;){var G=L.value;if(G&&!ye(G[1]))return!1}}else return!1;return!0;default:return!1}}function qe(C,P){return C==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function je(C){var P=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":qe(P,C)?"symbol":P}function Ze(C){if(typeof C>"u"||C===null)return""+C;var P=je(C);if(P==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return P}function at(C){var P=Ze(C);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function yt(C){return!C.constructor||!C.constructor.name?p:C.constructor.name}return y.checkPropTypes=i,y.resetWarningCache=i.resetWarningCache,y.PropTypes=y,y},_a}var Ta,js;function Kp(){if(js)return Ta;js=1;var e=va();function t(){}function r(){}return r.resetWarningCache=t,Ta=function(){function n(o,s,l,u,f,c){if(c!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},Ta}if(process.env.NODE_ENV!=="production"){var Xp=Ss(),Jp=!0;ma.exports=Yp()(Xp.isElement,Jp)}else ma.exports=Kp()();var Zp=ma.exports;const H=Ot(Zp);var Qp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},eh=Object.defineProperty,th=Object.defineProperties,rh=Object.getOwnPropertyDescriptors,An=Object.getOwnPropertySymbols,$s=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,Rs=(e,t,r)=>t in e?eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ms=(e,t)=>{for(var r in t||(t={}))$s.call(t,r)&&Rs(e,r,t[r]);if(An)for(var r of An(t))Is.call(t,r)&&Rs(e,r,t[r]);return e},nh=(e,t)=>th(e,rh(t)),ih=(e,t)=>{var r={};for(var n in e)$s.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&An)for(var n of An(e))t.indexOf(n)<0&&Is.call(e,n)&&(r[n]=e[n]);return r},Ve=(e,t,r)=>{const n=T.forwardRef((i,a)=>{var o=i,{color:s="currentColor",size:l=24,stroke:u=2,children:f}=o,c=ih(o,["color","size","stroke","children"]);return T.createElement("svg",Ms(nh(Ms({ref:a},Qp),{width:l,height:l,stroke:s,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),c),[...r.map(([p,y])=>T.createElement(p,y)),...f||[]])});return n.propTypes={color:H.string,size:H.oneOfType([H.string,H.number]),stroke:H.oneOfType([H.string,H.number])},n.displayName=`${t}`,n},ah=Ve("alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]),oh=Ve("app-window","IconAppWindow",[["path",{d:"M3 5m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M6 8h.01",key:"svg-1"}],["path",{d:"M9 8h.01",key:"svg-2"}]]),Ea=Ve("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),Ds=Ve("chevron-up","IconChevronUp",[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]]),sh=Ve("download","IconDownload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]),lh=Ve("exclamation-circle","IconExclamationCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 9v4",key:"svg-1"}],["path",{d:"M12 16v.01",key:"svg-2"}]]),uh=Ve("eye","IconEye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]]),Ns=Ve("filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]),ch=Ve("id-badge-2","IconIdBadge2",[["path",{d:"M7 12h3v4h-3z",key:"svg-0"}],["path",{d:"M10 6h-6a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1h-6",key:"svg-1"}],["path",{d:"M10 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M14 16h2",key:"svg-3"}],["path",{d:"M14 12h4",key:"svg-4"}]]),Fs=Ve("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),fh=Ve("logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]),dh=Ve("pencil","IconPencil",[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]]),Sa=Ve("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),Ls=Ve("trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]),ph=Ve("users","IconUsers",[["path",{d:"M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"svg-2"}],["path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85",key:"svg-3"}]]);function zs(...e){const[t,r]=T.useState(!1),n={bg:"transparent",size:"sm",c:"gray"},i=v.useProps("ActionIcon",n,e);return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Add Item",children:d.jsx(v.ActionIcon,{bg:i.bg,size:i.size,c:i.c,onClick:()=>{r(!0)},children:d.jsx(Sa,{})})}),d.jsx(xs,{opened:t,onClose:()=>{r(!1)}})]})}function hh({form:e,name:t,items:r,onChange:n,...i}){return d.jsx(v.Select,{data:r,searchable:!0,...e.getInputProps(t),onChange:n,...i})}function mh({form:e,name:t,items:r,onChange:n,...i}){return d.jsx(v.Select,{data:r,searchable:!0,...e.getInputProps(t),onChange:n,...i})}function gh({form:e,name:t,...r}){const n=v.useCombobox({onDropdownClose:()=>n.resetSelectedOption(),onDropdownOpen:()=>n.updateSelectedOptionIndex("active")}),[i,a]=T.useState([]),[o,s]=T.useState(""),l=c=>{o!==""&&(i.includes(o)||a(p=>[...p,o]),s(""))},u=c=>a(p=>p.filter(y=>y!==c)),f=i.map(c=>d.jsx(v.Pill,{withRemoveButton:!0,onRemove:()=>u(c),children:c},c));return T.useEffect(()=>{if(e.getInputProps(t).value)try{const c=JSON.parse(String(e.getInputProps(t).value));a([...c])}catch(c){console.error("Error parsing JSON:",c)}else e.getInputProps(t).onChange([])},[]),T.useEffect(()=>{e.getInputProps(t).onChange(i)},[i]),d.jsxs(v.Combobox,{store:n,onOptionSubmit:l,children:[d.jsx(v.Combobox.DropdownTarget,{children:d.jsx(v.PillsInput,{onClick:()=>n.openDropdown(),children:d.jsxs(v.Pill.Group,{children:[f,d.jsx(v.Combobox.EventsTarget,{children:d.jsx(v.PillsInput.Field,{onFocus:()=>n.openDropdown(),onBlur:()=>n.closeDropdown(),value:o,placeholder:"Search values",onChange:c=>{n.updateSelectedOptionIndex(),s(c.currentTarget.value)},onKeyDown:c=>{c.key==="Backspace"&&o.length===0&&(c.preventDefault(),u(i[i.length-1]))}})})]})})}),d.jsx(v.Combobox.Dropdown,{children:d.jsx(v.Combobox.Options,{children:d.jsxs(v.Combobox.Option,{value:"$create",children:["+ Create ",o]})})})]})}function Us({onClose:e,...t}){const{info:r,queryParams:n,setQueryParams:i,path:a}=Re(),o=zi.useForm({initialValues:{filters:[]},validate:pa(zr({filters:sa().of(zr({col:wn().transform(c=>c||void 0).required("Field is required"),opr:wn().transform(c=>c||void 0).required("col is required"),value:Sn().when("col",{is:c=>c&&r.filters[c].schema.required,then:()=>Sn().required("Value is required")})}))}))}),s={bg:"transparent",size:"sm",c:"gray"},l=v.useProps("ActionIcon",s,t);T.useEffect(()=>{o.setValues({filters:[]}),o.reset()},[a]),T.useEffect(()=>{if(n.filters&&n.filters.length){const c=n.filters.map(p=>({...p,key:Nr.randomId()}));o.setFieldValue("filters",c)}},[n.filters]);const u=c=>{const p=c.filters.map(({key:g,...h})=>h),y=JSON.parse(JSON.stringify(p));i({filters:y,page:0}),e()},f=o.values.filters.map((c,p)=>d.jsxs(v.Box,{px:"sm",children:[d.jsxs(v.Flex,{my:"md",gap:"md",style:{whiteSpace:"nowrap"},children:[d.jsx(v.Box,{style:{width:"192px"},children:r&&r.filters&&d.jsx(hh,{form:o,name:`filters.${p}.col`,items:Object.entries(r.filters).map(([y,g])=>({label:g.label,value:String(y)})),onChange:y=>{o.setFieldValue(`filters.${p}`,{col:y,opr:"",value:"",key:Nr.randomId()})}})}),d.jsx(v.Box,{style:{width:"192px"},children:c.col?d.jsx(mh,{form:o,name:`filters.${p}.opr`,items:r.filters[c.col].filters.map(y=>({label:y.name,value:y.operator})),onChange:y=>{o.setFieldValue(`filters.${p}`,{col:o.values.filters[p].col,opr:y,value:"",key:Nr.randomId()})}}):null}),d.jsx(v.Box,{style:{width:"192px"},children:c.col?c.opr==="in"?d.jsx(gh,{form:o,name:`filters.${p}.value`}):d.jsx(ha,{form:o,name:`filters.${p}.value`,schema:r.filters[c.col].schema,filter:!0}):null}),d.jsx(v.ActionIcon,{bg:l.bg,size:l.size,c:l.c,onClick:()=>{o.removeListItem("filters",p)},children:d.jsx(Ls,{})})]}),o.values.filters.length>1&&p<o.values.filters.length-1?d.jsx(v.Divider,{my:"md",labelPosition:"center",label:"AND"}):null]},c.key));return d.jsxs(v.Box,{component:"form",onSubmit:o.onSubmit(u),children:[f.length===0&&d.jsx(v.Box,{style:{width:"642px"},children:d.jsx(v.Text,{style:{fontStyle:"italic",padding:"7px"},size:"sm",c:"dimmed",children:"No filters selected..."})}),d.jsx(v.ScrollArea.Autosize,{mah:"40vh",mt:20,children:f}),d.jsx(v.Divider,{my:"sm"}),d.jsxs(v.Box,{style:{display:"flex",justifyContent:"space-between"},children:[d.jsx(v.Button,{variant:"subtle",leftSection:d.jsx(Sa,{}),onClick:()=>{o.insertListItem("filters",{col:"",opr:"",value:"",key:Nr.randomId()})},children:"Add Filter"}),d.jsx(v.Group,{spacing:"md",children:d.jsx(v.Button,{type:"submit",children:"Apply"})})]})]})}function Bs(...e){const{queryParams:t}=Re(),r={bg:"transparent",size:"sm",c:"gray"},n=v.useProps("ActionIcon",r,e),[i,a]=T.useState(!1);return d.jsxs(v.Popover,{opened:i,position:"bottom-end",onClose:()=>a(!1),closeOnClickOutside:!1,zIndex:1,children:[d.jsx(v.Popover.Target,{children:d.jsx(v.Tooltip,{opened:i?!1:null,label:"Filter",children:t.filters.length!=0?d.jsx(v.Indicator,{zIndex:20,size:16,label:t.filters.length,children:d.jsx(v.ActionIcon,{bg:n.bg,size:n.size,c:n.c,onClick:()=>a(!0),children:d.jsx(Ns,{})})}):d.jsx(v.ActionIcon,{bg:n.bg,size:n.size,c:n.c,onClick:()=>a(!0),children:d.jsx(Ns,{})})})}),d.jsxs(v.Popover.Dropdown,{px:"xs",children:[d.jsx(v.Box,{style:{position:"absolute",top:4,right:4},children:d.jsx(v.CloseButton,{title:"Filters",onClick:()=>a(!1)})}),d.jsx(Us,{onClose:()=>{a(!1)}})]})]})}function yh(...e){const[t,r]=T.useState(!1),{download:n}=Re(),i={bg:"transparent",size:"sm",c:"gray"},a=v.useProps("ActionIcon",i,e);return t?d.jsx(v.Loader,{color:a.c,size:a.size}):d.jsx(v.Tooltip,{label:"Download",children:d.jsx(v.ActionIcon,{bg:a.bg,size:a.size,c:a.c,onClick:()=>{r(!0),n("download").then(()=>r(!1))},children:d.jsx(sh,{})})})}const Vs=T.memo(({hideAdd:e,hideFilter:t,hideDownload:r,toolbarCustomizer:n})=>{const{info:i}=Re(),a=T.useMemo(()=>{const s={};return Object.entries(n).forEach(([l,u])=>{s[l]=u,typeof s[l]=="function"&&(s[l]=s[l]())}),s},[n]),o=i.permissions.includes("can_post");return d.jsxs(v.Flex,{justify:"flex-end",p:"md",gap:"sm",children:[!r&&(a.download||d.jsx(yh,{})),o&&!e?a.add||d.jsx(zs,{}):null,t?null:a.filter||d.jsx(Bs,{})]})});Vs.displayName="Toolbar";const Ws={root:"_root_1kmay_1",wrapper:"_wrapper_1kmay_7",icon:"_icon_1kmay_18"};function wa({column:e,label:t,orderColumn:r,related:n,toggleAll:i,allChecked:a,classNames:o,styles:s,customElement:l,...u}){const{queryParams:f,setQueryParams:c,loading:p}=Re(),y={fw:700,size:"sm",color:"gray.8",hoverColor:"gray.6",selectedColor:"blue"},g=v.useStyles({name:"FieldTitle",classes:Ws,classNames:o,styles:s,props:u}),h=v.useProps("FieldTitle",y,u),{hovered:x,ref:w}=Nr.useHover(),k=r&&f.order_column===r,M=g("wrapper");return M.style.cursor=r?M.style.cursor:"auto",d.jsx(v.Table.Th,{className:Ws.fieldTitleRoot,...g("root"),onClick:r&&!p?()=>c({order_column:r,order_direction:f.order_direction==="asc"?"desc":"asc"}):null,children:d.jsx(v.Box,{ref:w,...M,children:e==="Checkbox"?d.jsx(v.Checkbox,{pb:5,pl:2,onChange:i,checked:a}):d.jsxs(d.Fragment,{children:[d.jsx(v.Box,{w:"100%",fw:h.fw,size:"xl",c:x&&r?h.hoverColor:k?h.selectedColor:h.color,children:l||t||e}),n?d.jsx(v.Tooltip,{label:"Related Field",children:d.jsx(v.Indicator,{label:"rel",style:{indicator:{top:"-1px !important",right:"-2px !important",padding:"4px"}},children:d.jsx(v.Box,{...g("icon"),children:k?f.order_direction==="asc"?d.jsx(Ea,{size:14,strokeWidth:1.5}):d.jsx(Ds,{size:14,strokeWidth:1.5}):null})})}):d.jsx(v.Box,{...g("icon"),children:k?f.order_direction==="asc"?d.jsx(Ea,{size:14,strokeWidth:1.5}):d.jsx(Ds,{size:14,strokeWidth:1.5}):null})]})})})}const Hs=T.memo(({data:e,info:t,settings:r,hideActions:n,hideCheckbox:i,allChecked:a,toggleAll:o,headerCustomizer:s})=>{const l=e.list_columns.includes("actions")?"_actions":"actions";let u=s==null?void 0:s[l];return typeof u=="function"&&(u=u()),d.jsx(v.Table.Thead,{children:d.jsxs(v.Table.Tr,{children:[i?null:d.jsx(wa,{data:e,column:"Checkbox",allChecked:a,toggleAll:o}),n?null:d.jsx(wa,{column:"Actions",customElement:u}),e.list_columns.map((f,c)=>{var y;let p=s==null?void 0:s[f];return typeof p=="function"&&(p=p(e.label_columns[f])),p===null?null:d.jsx(wa,{column:f,label:e.label_columns[f],orderColumn:e.order_columns.find(g=>g===f)||e.order_columns.find(g=>g.startsWith(`${f}.`)),related:((y=t.filters[f])==null?void 0:y.schema.type)==="Nested",customElement:p},f)})]})})});Hs.displayName="Header";const Gs=(e,t)=>{const r=t.split(".").reduce((n,i)=>n[i],e);return!r&&typeof r!="boolean"&&typeof r!="number"?null:typeof r=="boolean"?r.toString():Array.isArray(r)?r.map(n=>n.name_).join(", "):typeof r=="object"?r.name_:r};function qs(e,t){return e===!0||Array.isArray(e)?t:Object.fromEntries(Object.keys(e).map(r=>[r,qs(e[r],t[r])]))}function Ys(e,t){if(!e)return e;const r=t.values;if(!r||!r.length)return e;const n=r[0].id;if(!(n instanceof Object))return e;const a=Object.keys(n),o={};return a.forEach(s=>{o[s]=e[s]}),e.id=o,e}function vh(e,t){const r={};return t.forEach(n=>{if(n.type==="Related"){r[n.name]=Ys(e.result[n.name],n);return}if(n.type==="RelatedList"){r[n.name]=e.result[n.name].map(i=>Ys(i,n));return}r[n.name]=typeof e.result[n.name]=="boolean"?String(e.result[n.name]):e.result[n.name]}),r}function bh({relatedPath:e,...t}){const{path:r}=Re();return Pe(r?r.substring(0,r.lastIndexOf("/")):"",e.substring(0,e.lastIndexOf("/"))),d.jsx(vs,{resource_name:e.replace("/",""),relation:t,children:d.jsx(qa,{hideToolbar:!0,hideDownload:!1})})}const xh=T.memo(bh);function _h({item:e,info:t,loading:r,opened:n,onClose:i,...a}){const o={modal:{},tabs:{},tabsList:{},tabsPanel:{}},{modal:s,tabs:l,tabsList:u,tabsPanel:f}=v.useProps("ViewDialog",o,a);return d.jsxs(v.Modal,{opened:n,onClose:i,title:`${e==null?void 0:e.show_title} (#${Fe(e==null?void 0:e.id)})`,size:"lg",centered:!0,zIndex:1e3,...s,children:[d.jsx(v.LoadingOverlay,{visible:r}),!r&&e?d.jsxs(v.Tabs,{defaultValue:"details",...l,children:[d.jsxs(v.Tabs.List,{...u,children:[d.jsx(v.Tabs.Tab,{value:"details",children:"Details"}),t.relations.map((c,p)=>d.jsx(v.Tabs.Tab,{value:c.name,children:c.name},p))]}),d.jsx(v.Tabs.Panel,{pt:"xs",value:"details",...f,children:d.jsx(v.Paper,{p:"xs",withBorder:!0,children:d.jsx(v.Stack,{spacing:"md",children:d.jsx(v.ScrollArea,{h:450,type:"auto",children:e.show_columns.map((c,p)=>d.jsxs(v.Grid,{maw:500,children:[d.jsx(v.Grid.Col,{span:4,children:d.jsx(v.Text,{size:"md",children:e.label_columns[c]})}),d.jsx(v.Grid.Col,{span:1,children:d.jsx(v.Text,{size:"xs",children:":"})}),d.jsx(v.Grid.Col,{span:6,children:d.jsx(v.Text,{size:"md",children:Gs(e.result,c)})})]},p))})})})}),t.relations.map((c,p)=>d.jsx(v.Tabs.Panel,{pt:"xs",value:c.name,children:d.jsx(v.Paper,{withBorder:!0,children:d.jsx(xh,{relatedPath:c.path,id:Fe(e.id),foreign_key:c.foreign_key,type:c.type})})},p))]}):null]})}function Th({id:e,...t}){const{info:r,getEntry:n}=Re(),i={bg:"transparent",size:"sm",c:"gray"},a=v.useProps("ActionIcon",i,t),[o,s]=T.useState(null),[l,u]=T.useState(!1),[f,c]=T.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Details",children:d.jsx(v.ActionIcon,{bg:a.bg,size:a.size,c:a.c,onClick:async()=>{u(!0);const p=await n(e);p&&(s(p),u(!1),c(!0))},children:d.jsx(uh,{})})}),d.jsx(_h,{item:o,info:r,loading:l,opened:f,onClose:()=>c(!1)})]})}function Eh(e,t){return new Promise(r=>{r(vh(e,t.edit.columns))})}function Ks({item:e,info:t,opened:r,onClose:n,...i}){const{updateEntry:a}=Re(),o={modal:{},stack:{},saveButton:{}},{modal:s,stack:l,saveButton:u}=v.useProps("EditDialog",o,i),f=zi.useForm({initialValues:t.edit.defaultValues,validate:pa(t.edit.schema)}),c=()=>{const y={};return Object.keys(f.values).forEach(g=>{f.isDirty(g)&&(y[g]=!0)}),y};T.useEffect(()=>{e&&Eh(e,t).then(y=>{f.setValues(y),f.resetDirty(y)})},[e,t.edit.columns]);const p=async y=>{y=qs(c(),y),await a(e.id,y),n()};return T.useEffect(()=>{f.setInitialValues(t.edit.defaultValues),f.reset()},[t.edit.defaultValues]),e?d.jsx(v.Modal,{opened:r,onClose:()=>{n()},title:t.edit.title,size:"lg",centered:!0,...s,children:d.jsx(v.Box,{component:"form",onSubmit:f.onSubmit(p),children:d.jsx(v.Stack,{spacing:"md",...l,children:d.jsxs(v.ScrollArea.Autosize,{mah:450,type:"auto",children:[t.edit.columns.map((y,g)=>d.jsx(ha,{form:f,name:y.name,label:y.label,description:y.description,schema:y,withAsterisk:y.required},g)),d.jsx(v.Group,{position:"right",mt:"xl",children:d.jsx(v.Button,{type:"submit",...u,children:"Save"})})]})})})}):null}function Xs({id:e,...t}){const{info:r,getEntry:n}=Re(),i={bg:"transparent",size:"sm",c:"gray"},a=v.useProps("ActionIcon",i,t),[o,s]=T.useState(null),[l,u]=T.useState(!1),[f,c]=T.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Edit",children:d.jsx(v.ActionIcon,{bg:a.bg,size:a.size,c:a.c,onClick:async()=>{u(!0);const p=await n(e);p&&(s(p),u(!1),c(!0))},children:d.jsx(dh,{})})}),d.jsx(Ks,{item:o,info:r,opened:f,onClose:()=>c(!1)})]})}function Sh({opened:e,onClose:t,handleAccept:r,handleReject:n}){return d.jsxs(v.Modal,{opened:e,onClose:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",title:"Item löschen?",centered:!0,children:["Sind Sie Sicher, dass Sie das Item löschen wollen?",d.jsxs(v.Group,{align:"right",mt:"xl",justify:"flex-end",children:[d.jsx(v.Button,{onClick:n,variant:"default",children:"Abbrechen"}),d.jsx(v.Button,{onClick:r,color:"red",children:"Löschen"})]})]})}function Js({id:e,...t}){const{deleteEntry:r}=Re(),n={bg:"transparent",size:"sm",c:"gray"},i=v.useProps("ActionIcon",n,t),[a,o]=T.useState(!1),s=()=>{o(!1)},l=async()=>{r(e),o(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(v.Tooltip,{label:"Delete",children:d.jsx(v.ActionIcon,{bg:i.bg,size:i.size,c:i.c,onClick:()=>{o(!0)},children:d.jsx(Ls,{})})}),d.jsx(Sh,{opened:a,onClose:s,handleAccept:l,handleReject:s})]})}function Zs({id:e,selected:t}){const{info:r}=Re();return d.jsxs(v.Flex,{style:{gap:4,whiteSpace:"nowrap"},children:[r.permissions.includes("can_get")?d.jsx(Th,{id:e}):null,r.permissions.includes("can_put")?d.jsx(Xs,{id:e}):null,r.permissions.includes("can_delete")?d.jsx(Js,{id:e}):null]})}var Ca={},Oa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(n){n.Root="root",n.Text="text",n.Directive="directive",n.Comment="comment",n.Script="script",n.Style="style",n.Tag="tag",n.CDATA="cdata",n.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function r(n){return n.type===t.Tag||n.type===t.Script||n.type===t.Style}e.isTag=r,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})(Oa);var te={},Ft=$e&&$e.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ur=$e&&$e.__assign||function(){return Ur=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ur.apply(this,arguments)};Object.defineProperty(te,"__esModule",{value:!0}),te.cloneNode=te.hasChildren=te.isDocument=te.isDirective=te.isComment=te.isText=te.isCDATA=te.isTag=te.Element=te.Document=te.CDATA=te.NodeWithChildren=te.ProcessingInstruction=te.Comment=te.Text=te.DataNode=te.Node=void 0;var Xe=Oa,Aa=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),Pa(this,t)},e}();te.Node=Aa;var Pn=function(e){Ft(t,e);function t(r){var n=e.call(this)||this;return n.data=r,n}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),t}(Aa);te.DataNode=Pn;var Qs=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.Text,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(Pn);te.Text=Qs;var el=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.Comment,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(Pn);te.Comment=el;var tl=function(e){Ft(t,e);function t(r,n){var i=e.call(this,n)||this;return i.name=r,i.type=Xe.ElementType.Directive,i}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(Pn);te.ProcessingInstruction=tl;var kn=function(e){Ft(t,e);function t(r){var n=e.call(this)||this;return n.children=r,n}return Object.defineProperty(t.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),t}(Aa);te.NodeWithChildren=kn;var rl=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.CDATA,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(kn);te.CDATA=rl;var nl=function(e){Ft(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Xe.ElementType.Root,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(kn);te.Document=nl;var il=function(e){Ft(t,e);function t(r,n,i,a){i===void 0&&(i=[]),a===void 0&&(a=r==="script"?Xe.ElementType.Script:r==="style"?Xe.ElementType.Style:Xe.ElementType.Tag);var o=e.call(this,i)||this;return o.name=r,o.attribs=n,o.type=a,o}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(n){var i,a;return{name:n,value:r.attribs[n],namespace:(i=r["x-attribsNamespace"])===null||i===void 0?void 0:i[n],prefix:(a=r["x-attribsPrefix"])===null||a===void 0?void 0:a[n]}})},enumerable:!1,configurable:!0}),t}(kn);te.Element=il;function al(e){return(0,Xe.isTag)(e)}te.isTag=al;function ol(e){return e.type===Xe.ElementType.CDATA}te.isCDATA=ol;function sl(e){return e.type===Xe.ElementType.Text}te.isText=sl;function ll(e){return e.type===Xe.ElementType.Comment}te.isComment=ll;function ul(e){return e.type===Xe.ElementType.Directive}te.isDirective=ul;function cl(e){return e.type===Xe.ElementType.Root}te.isDocument=cl;function wh(e){return Object.prototype.hasOwnProperty.call(e,"children")}te.hasChildren=wh;function Pa(e,t){t===void 0&&(t=!1);var r;if(sl(e))r=new Qs(e.data);else if(ll(e))r=new el(e.data);else if(al(e)){var n=t?ka(e.children):[],i=new il(e.name,Ur({},e.attribs),n);n.forEach(function(l){return l.parent=i}),e.namespace!=null&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=Ur({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=Ur({},e["x-attribsPrefix"])),r=i}else if(ol(e)){var n=t?ka(e.children):[],a=new rl(n);n.forEach(function(u){return u.parent=a}),r=a}else if(cl(e)){var n=t?ka(e.children):[],o=new nl(n);n.forEach(function(u){return u.parent=o}),e["x-mode"]&&(o["x-mode"]=e["x-mode"]),r=o}else if(ul(e)){var s=new tl(e.name,e.data);e["x-name"]!=null&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),r=s}else throw new Error("Not implemented yet: ".concat(e.type));return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}te.cloneNode=Pa;function ka(e){for(var t=e.map(function(n){return Pa(n,!0)}),r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}(function(e){var t=$e&&$e.__createBinding||(Object.create?function(s,l,u,f){f===void 0&&(f=u);var c=Object.getOwnPropertyDescriptor(l,u);(!c||("get"in c?!l.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(s,f,c)}:function(s,l,u,f){f===void 0&&(f=u),s[f]=l[u]}),r=$e&&$e.__exportStar||function(s,l){for(var u in s)u!=="default"&&!Object.prototype.hasOwnProperty.call(l,u)&&t(l,s,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var n=Oa,i=te;r(te,e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function s(l,u,f){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof u=="function"&&(f=u,u=a),typeof l=="object"&&(u=l,l=void 0),this.callback=l??null,this.options=u??a,this.elementCB=f??null}return s.prototype.onparserinit=function(l){this.parser=l},s.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},s.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},s.prototype.onerror=function(l){this.handleCallback(l)},s.prototype.onclosetag=function(){this.lastNode=null;var l=this.tagStack.pop();this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(l)},s.prototype.onopentag=function(l,u){var f=this.options.xmlMode?n.ElementType.Tag:void 0,c=new i.Element(l,u,void 0,f);this.addNode(c),this.tagStack.push(c)},s.prototype.ontext=function(l){var u=this.lastNode;if(u&&u.type===n.ElementType.Text)u.data+=l,this.options.withEndIndices&&(u.endIndex=this.parser.endIndex);else{var f=new i.Text(l);this.addNode(f),this.lastNode=f}},s.prototype.oncomment=function(l){if(this.lastNode&&this.lastNode.type===n.ElementType.Comment){this.lastNode.data+=l;return}var u=new i.Comment(l);this.addNode(u),this.lastNode=u},s.prototype.oncommentend=function(){this.lastNode=null},s.prototype.oncdatastart=function(){var l=new i.Text(""),u=new i.CDATA([l]);this.addNode(u),l.parent=u,this.lastNode=l},s.prototype.oncdataend=function(){this.lastNode=null},s.prototype.onprocessinginstruction=function(l,u){var f=new i.ProcessingInstruction(l,u);this.addNode(f)},s.prototype.handleCallback=function(l){if(typeof this.callback=="function")this.callback(l,this.dom);else if(l)throw l},s.prototype.addNode=function(l){var u=this.tagStack[this.tagStack.length-1],f=u.children[u.children.length-1];this.options.withStartIndices&&(l.startIndex=this.parser.startIndex),this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),u.children.push(l),f&&(l.prev=f,f.next=l),l.parent=u,this.lastNode=null},s}();e.DomHandler=o,e.default=o})(Ca);var ja={},$a={};Object.defineProperty($a,"__esModule",{value:!0});var fl="html",dl="head",jn="body",Ch=/<([a-zA-Z]+[0-9]?)/,pl=/<head[^]*>/i,hl=/<body[^]*>/i,$n=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},Ia=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},ml=typeof window=="object"&&window.DOMParser;if(typeof ml=="function"){var Oh=new ml,Ah="text/html";Ia=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),Oh.parseFromString(e,Ah)},$n=Ia}if(typeof document=="object"&&document.implementation){var In=document.implementation.createHTMLDocument();$n=function(e,t){if(t){var r=In.documentElement.querySelector(t);return r&&(r.innerHTML=e),In}return In.documentElement.innerHTML=e,In}}var Rn=typeof document=="object"&&document.createElement("template"),Ra;Rn&&Rn.content&&(Ra=function(e){return Rn.innerHTML=e,Rn.content.childNodes});function Ph(e){var t,r,n=e.match(Ch),i=n&&n[1]?n[1].toLowerCase():"";switch(i){case fl:{var a=Ia(e);if(!pl.test(e)){var o=a.querySelector(dl);(t=o==null?void 0:o.parentNode)===null||t===void 0||t.removeChild(o)}if(!hl.test(e)){var o=a.querySelector(jn);(r=o==null?void 0:o.parentNode)===null||r===void 0||r.removeChild(o)}return a.querySelectorAll(fl)}case dl:case jn:{var s=$n(e).querySelectorAll(i);return hl.test(e)&&pl.test(e)?s[0].parentNode.childNodes:s}default:{if(Ra)return Ra(e);var o=$n(e,jn).querySelector(jn);return o.childNodes}}}$a.default=Ph;var ur={},gl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(t,r){return t[r.toLowerCase()]=r,t},{})})(gl),Object.defineProperty(ur,"__esModule",{value:!0}),ur.formatDOM=ur.formatAttributes=void 0;var Mn=Ca,kh=gl;function jh(e){return kh.CASE_SENSITIVE_TAG_NAMES_MAP[e]}function yl(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r];t[i.name]=i.value}return t}ur.formatAttributes=yl;function $h(e){e=e.toLowerCase();var t=jh(e);return t||e}function vl(e,t,r){t===void 0&&(t=null);for(var n=[],i,a=0,o=e.length;a<o;a++){var s=e[a];switch(s.nodeType){case 1:{var l=$h(s.nodeName);i=new Mn.Element(l,yl(s.attributes)),i.children=vl(l==="template"?s.content.childNodes:s.childNodes,i);break}case 3:i=new Mn.Text(s.nodeValue);break;case 8:i=new Mn.Comment(s.nodeValue);break;default:continue}var u=n[a-1]||null;u&&(u.next=i),i.parent=t,i.prev=u,i.next=null,n.push(i)}return r&&(i=new Mn.ProcessingInstruction(r.substring(0,r.indexOf(" ")).toLowerCase(),r),i.next=n[0]||null,i.parent=t,n.unshift(i),n[1]&&(n[1].prev=n[0])),n}ur.formatDOM=vl;var Ih=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ja,"__esModule",{value:!0});var Rh=Ih($a),Mh=ur,Dh=/<(![a-zA-Z\s]+)>/;function Nh(e){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(Dh),r=t?t[1]:void 0;return(0,Mh.formatDOM)((0,Rh.default)(e),null,r)}ja.default=Nh;var ht={},Dn={},Fh=0;Dn.SAME=Fh;var Lh=1;Dn.CAMELCASE=Lh,Dn.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};const bl=0,Lt=1,Nn=2,Fn=3,Ma=4,xl=5,_l=6;function zh(e){return Me.hasOwnProperty(e)?Me[e]:null}function We(e,t,r,n,i,a,o){this.acceptsBooleans=t===Nn||t===Fn||t===Ma,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}const Me={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(e=>{Me[e]=new We(e,bl,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([e,t])=>{Me[e]=new We(e,Lt,!1,t,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(e=>{Me[e]=new We(e,Nn,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(e=>{Me[e]=new We(e,Nn,!1,e,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(e=>{Me[e]=new We(e,Fn,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(e=>{Me[e]=new We(e,Fn,!0,e,null,!1,!1)}),["capture","download"].forEach(e=>{Me[e]=new We(e,Ma,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(e=>{Me[e]=new We(e,_l,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(e=>{Me[e]=new We(e,xl,!1,e.toLowerCase(),null,!1,!1)});const Da=/[\-\:]([a-z])/g,Na=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(e=>{const t=e.replace(Da,Na);Me[t]=new We(t,Lt,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(e=>{const t=e.replace(Da,Na);Me[t]=new We(t,Lt,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(e=>{const t=e.replace(Da,Na);Me[t]=new We(t,Lt,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(e=>{Me[e]=new We(e,Lt,!1,e.toLowerCase(),null,!1,!1)});const Uh="xlinkHref";Me[Uh]=new We("xlinkHref",Lt,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(e=>{Me[e]=new We(e,Lt,!1,e.toLowerCase(),null,!0,!0)});const{CAMELCASE:Bh,SAME:Vh,possibleStandardNames:Tl}=Dn,Wh=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Hh=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+Wh+"]*$")),Gh=Object.keys(Tl).reduce((e,t)=>{const r=Tl[t];return r===Vh?e[t]=t:r===Bh?e[t.toLowerCase()]=t:e[t]=r,e},{});ht.BOOLEAN=Fn,ht.BOOLEANISH_STRING=Nn,ht.NUMERIC=xl,ht.OVERLOADED_BOOLEAN=Ma,ht.POSITIVE_NUMERIC=_l,ht.RESERVED=bl,ht.STRING=Lt,ht.getPropertyInfo=zh,ht.isCustomAttribute=Hh,ht.possibleStandardNames=Gh;var Fa={},La={},El=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,qh=/\n/g,Yh=/^\s*/,Kh=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xh=/^:\s*/,Jh=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Zh=/^[;\s]*/,Qh=/^\s+|\s+$/g,em=`
|
|
55
55
|
`,Sl="/",wl="*",Xt="",tm="comment",rm="declaration",nm=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function i(g){var h=g.match(qh);h&&(r+=h.length);var x=g.lastIndexOf(em);n=~x?g.length-x:n+g.length}function a(){var g={line:r,column:n};return function(h){return h.position=new o(g),u(),h}}function o(g){this.start=g,this.end={line:r,column:n},this.source=t.source}o.prototype.content=e;function s(g){var h=new Error(t.source+":"+r+":"+n+": "+g);if(h.reason=g,h.filename=t.source,h.line=r,h.column=n,h.source=e,!t.silent)throw h}function l(g){var h=g.exec(e);if(h){var x=h[0];return i(x),e=e.slice(x.length),h}}function u(){l(Yh)}function f(g){var h;for(g=g||[];h=c();)h!==!1&&g.push(h);return g}function c(){var g=a();if(!(Sl!=e.charAt(0)||wl!=e.charAt(1))){for(var h=2;Xt!=e.charAt(h)&&(wl!=e.charAt(h)||Sl!=e.charAt(h+1));)++h;if(h+=2,Xt===e.charAt(h-1))return s("End of comment missing");var x=e.slice(2,h-2);return n+=2,i(x),e=e.slice(h),n+=2,g({type:tm,comment:x})}}function p(){var g=a(),h=l(Kh);if(h){if(c(),!l(Xh))return s("property missing ':'");var x=l(Jh),w=g({type:rm,property:Cl(h[0].replace(El,Xt)),value:x?Cl(x[0].replace(El,Xt)):Xt});return l(Zh),w}}function y(){var g=[];f(g);for(var h;h=p();)h!==!1&&(g.push(h),f(g));return g}return u(),y()};function Cl(e){return e?e.replace(Qh,Xt):Xt}var im=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(La,"__esModule",{value:!0});var am=im(nm);function om(e,t){var r=null;if(!e||typeof e!="string")return r;var n=(0,am.default)(e),i=typeof t=="function";return n.forEach(function(a){if(a.type==="declaration"){var o=a.property,s=a.value;i?t(o,s,a):s&&(r=r||{},r[o]=s)}}),r}La.default=om;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.camelCase=void 0;var sm=/^--[a-zA-Z0-9-]+$/,lm=/-([a-z])/g,um=/^[^-]+$/,cm=/^-(webkit|moz|ms|o|khtml)-/,fm=/^-(ms)-/,dm=function(e){return!e||um.test(e)||sm.test(e)},pm=function(e,t){return t.toUpperCase()},Ol=function(e,t){return"".concat(t,"-")},hm=function(e,t){return t===void 0&&(t={}),dm(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(fm,Ol):e=e.replace(cm,Ol),e.replace(lm,pm))};Ln.camelCase=hm;var mm=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fa,"__esModule",{value:!0});var gm=mm(La),ym=Ln;function vm(e,t){var r={};return!e||typeof e!="string"||(0,gm.default)(e,function(n,i){n&&i&&(r[(0,ym.camelCase)(n,t)]=i)}),r}Fa.default=vm;var bm=T,xm=Fa.default,_m=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Tm(e,t){return e.indexOf("-")===-1?t&&typeof t.is=="string":!_m.has(e)}var Em={reactCompat:!0};function Sm(e,t){if(e!=null)try{t.style=xm(e,Em)}catch{t.style={}}}var wm=bm.version.split(".")[0]>=16,Al=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function Cm(e){return!Al.has(e.name)}function Om(e){return e}var Pl={PRESERVE_CUSTOM_ATTRIBUTES:wm,ELEMENTS_WITH_NO_TEXT_CHILDREN:Al,isCustomComponent:Tm,setStyleProp:Sm,canTextBeChildOfNode:Cm,returnFirstArg:Om},Br=ht,kl=Pl,Am=["checked","value"],Pm=["input","select","textarea"],km={reset:!0,submit:!0},jl=function(t,r){t=t||{};var n,i,a,o,s,l={},u=t.type&&km[t.type];for(n in t){if(a=t[n],Br.isCustomAttribute(n)){l[n]=a;continue}if(i=n.toLowerCase(),o=$l(i),o){switch(s=Br.getPropertyInfo(o),Am.indexOf(o)!==-1&&Pm.indexOf(r)!==-1&&!u&&(o=$l("default"+i)),l[o]=a,s&&s.type){case Br.BOOLEAN:l[o]=!0;break;case Br.OVERLOADED_BOOLEAN:a===""&&(l[o]=!0);break}continue}kl.PRESERVE_CUSTOM_ATTRIBUTES&&(l[n]=a)}return kl.setStyleProp(t.style,l),l};function $l(e){return Br.possibleStandardNames[e]}var jm=T,$m=jl,Vr=Pl,Im=Vr.setStyleProp,Rm=Vr.canTextBeChildOfNode;function Il(e,t){t=t||{};for(var r=t.library||jm,n=r.cloneElement,i=r.createElement,a=r.isValidElement,o=[],s,l,u=typeof t.replace=="function",f=t.transform||Vr.returnFirstArg,c,p,y,g=t.trim,h=0,x=e.length;h<x;h++){if(s=e[h],u&&(c=t.replace(s),a(c))){x>1&&(c=n(c,{key:c.key||h})),o.push(f(c,s,h));continue}if(s.type==="text"){if(l=!s.data.trim().length,l&&s.parent&&!Rm(s.parent)||g&&l)continue;o.push(f(s.data,s,h));continue}switch(p=s.attribs,Mm(s)?Im(p.style,p):p&&(p=$m(p,s.name)),y=null,s.type){case"script":case"style":s.children[0]&&(p.dangerouslySetInnerHTML={__html:s.children[0].data});break;case"tag":s.name==="textarea"&&s.children[0]?p.defaultValue=s.children[0].data:s.children&&s.children.length&&(y=Il(s.children,t));break;default:continue}x>1&&(p.key=h),o.push(f(i(s.name,p,y),s,h))}return o.length===1?o[0]:o}function Mm(e){return Vr.PRESERVE_CUSTOM_ATTRIBUTES&&e.type==="tag"&&Vr.isCustomComponent(e.name,e.attribs)}var Dm=Il,zn=Ca,cr=ja.default,Nm=jl,Rl=Dm;cr=typeof cr.default=="function"?cr.default:cr;var Fm={lowerCaseAttributeNames:!1};function _t(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");return e===""?[]:(t=t||{},Rl(cr(e,t.htmlparser2||Fm),t))}_t.domToReact=Rl,_t.htmlToDOM=cr,_t.attributesToProps=Nm,_t.Comment=zn.Comment,_t.Element=zn.Element,_t.ProcessingInstruction=zn.ProcessingInstruction,_t.Text=zn.Text;var Lm=_t;_t.default=_t;const Jt=Ot(Lm);Jt.domToReact,Jt.htmlToDOM,Jt.attributesToProps,Jt.Comment,Jt.Element,Jt.ProcessingInstruction,Jt.Text;/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:Ml,setPrototypeOf:Dl,isFrozen:zm,getPrototypeOf:Um,getOwnPropertyDescriptor:Bm}=Object;let{freeze:He,seal:st,create:Nl}=Object,{apply:za,construct:Ua}=typeof Reflect<"u"&&Reflect;He||(He=function(t){return t}),st||(st=function(t){return t}),za||(za=function(t,r,n){return t.apply(r,n)}),Ua||(Ua=function(t,r){return new t(...r)});const Un=rt(Array.prototype.forEach),Fl=rt(Array.prototype.pop),Wr=rt(Array.prototype.push),Bn=rt(String.prototype.toLowerCase),Ba=rt(String.prototype.toString),Ll=rt(String.prototype.match),Hr=rt(String.prototype.replace),Vm=rt(String.prototype.indexOf),Wm=rt(String.prototype.trim),mt=rt(Object.prototype.hasOwnProperty),Ge=rt(RegExp.prototype.test),Gr=Hm(TypeError);function rt(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return za(e,t,n)}}function Hm(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ua(e,r)}}function re(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bn;Dl&&Dl(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const a=r(i);a!==i&&(zm(t)||(t[n]=a),i=a)}e[i]=!0}return e}function Gm(e){for(let t=0;t<e.length;t++)mt(e,t)||(e[t]=null);return e}function Zt(e){const t=Nl(null);for(const[r,n]of Ml(e))mt(e,r)&&(Array.isArray(n)?t[r]=Gm(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Zt(n):t[r]=n);return t}function qr(e,t){for(;e!==null;){const n=Bm(e,t);if(n){if(n.get)return rt(n.get);if(typeof n.value=="function")return rt(n.value)}e=Um(e)}function r(){return null}return r}const zl=He(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Va=He(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Wa=He(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),qm=He(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ha=He(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ym=He(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ul=He(["#text"]),Bl=He(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ga=He(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Vl=He(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vn=He(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Km=st(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Xm=st(/<%[\w\W]*|[\w\W]*%>/gm),Jm=st(/\${[\w\W]*}/gm),Zm=st(/^data-[\-\w.\u00B7-\uFFFF]/),Qm=st(/^aria-[\-\w]+$/),Wl=st(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eg=st(/^(?:\w+script|data):/i),tg=st(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hl=st(/^html$/i),rg=st(/^[a-z][.\w]*(-[.\w]+)+$/i);var Gl=Object.freeze({__proto__:null,MUSTACHE_EXPR:Km,ERB_EXPR:Xm,TMPLIT_EXPR:Jm,DATA_ATTR:Zm,ARIA_ATTR:Qm,IS_ALLOWED_URI:Wl,IS_SCRIPT_OR_DATA:eg,ATTR_WHITESPACE:tg,DOCTYPE_NAME:Hl,CUSTOM_ELEMENT:rg});const Yr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ng=function(){return typeof window>"u"?null:window},ig=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function ql(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ng();const t=O=>ql(O);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Yr.document)return t.isSupported=!1,t;let{document:r}=e;const n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:l,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:c,DOMParser:p,trustedTypes:y}=e,g=l.prototype,h=qr(g,"cloneNode"),x=qr(g,"remove"),w=qr(g,"nextSibling"),k=qr(g,"childNodes"),M=qr(g,"parentNode");if(typeof o=="function"){const O=r.createElement("template");O.content&&O.content.ownerDocument&&(r=O.content.ownerDocument)}let N,_="";const{implementation:R,createNodeIterator:F,createDocumentFragment:J,getElementsByTagName:ee}=r,{importNode:ae}=n;let z={};t.isSupported=typeof Ml=="function"&&typeof M=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:le,ERB_EXPR:me,TMPLIT_EXPR:ye,DATA_ATTR:qe,ARIA_ATTR:je,IS_SCRIPT_OR_DATA:Ze,ATTR_WHITESPACE:at,CUSTOM_ELEMENT:yt}=Gl;let{IS_ALLOWED_URI:C}=Gl,P=null;const Y=re({},[...zl,...Va,...Wa,...Ha,...Ul]);let L=null;const G=re({},[...Bl,...Ga,...Vl,...Vn]);let U=Object.seal(Nl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,q=null,K=!0,Z=!0,X=!1,Ae=!0,$=!1,Ie=!0,D=!1,Ye=!1,Qe=!1,dt=!1,rr=!1,jt=!1,Ci=!0,Oi=!1;const fn="user-content-";let dn=!0,nr=!1,$t={},It=null;const Vt=re({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ai=null;const pn=re({},["audio","video","img","source","image","track"]);let jr=null;const $r=re({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ir="http://www.w3.org/1998/Math/MathML",Rr="http://www.w3.org/2000/svg",vt="http://www.w3.org/1999/xhtml";let Wt=vt,hn=!1,mn=null;const No=re({},[Ir,Rr,vt],Ba);let Rt=null;const Pi=["application/xhtml+xml","text/html"],Ht="text/html";let we=null,Ct=null;const ki=r.createElement("form"),ji=function(b){return b instanceof RegExp||b instanceof Function},Mr=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ct&&Ct===b)){if((!b||typeof b!="object")&&(b={}),b=Zt(b),Rt=Pi.indexOf(b.PARSER_MEDIA_TYPE)===-1?Ht:b.PARSER_MEDIA_TYPE,we=Rt==="application/xhtml+xml"?Ba:Bn,P=mt(b,"ALLOWED_TAGS")?re({},b.ALLOWED_TAGS,we):Y,L=mt(b,"ALLOWED_ATTR")?re({},b.ALLOWED_ATTR,we):G,mn=mt(b,"ALLOWED_NAMESPACES")?re({},b.ALLOWED_NAMESPACES,Ba):No,jr=mt(b,"ADD_URI_SAFE_ATTR")?re(Zt($r),b.ADD_URI_SAFE_ATTR,we):$r,Ai=mt(b,"ADD_DATA_URI_TAGS")?re(Zt(pn),b.ADD_DATA_URI_TAGS,we):pn,It=mt(b,"FORBID_CONTENTS")?re({},b.FORBID_CONTENTS,we):Vt,V=mt(b,"FORBID_TAGS")?re({},b.FORBID_TAGS,we):{},q=mt(b,"FORBID_ATTR")?re({},b.FORBID_ATTR,we):{},$t=mt(b,"USE_PROFILES")?b.USE_PROFILES:!1,K=b.ALLOW_ARIA_ATTR!==!1,Z=b.ALLOW_DATA_ATTR!==!1,X=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$=b.SAFE_FOR_TEMPLATES||!1,Ie=b.SAFE_FOR_XML!==!1,D=b.WHOLE_DOCUMENT||!1,dt=b.RETURN_DOM||!1,rr=b.RETURN_DOM_FRAGMENT||!1,jt=b.RETURN_TRUSTED_TYPE||!1,Qe=b.FORCE_BODY||!1,Ci=b.SANITIZE_DOM!==!1,Oi=b.SANITIZE_NAMED_PROPS||!1,dn=b.KEEP_CONTENT!==!1,nr=b.IN_PLACE||!1,C=b.ALLOWED_URI_REGEXP||Wl,Wt=b.NAMESPACE||vt,U=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&ji(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&ji(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$&&(Z=!1),rr&&(dt=!0),$t&&(P=re({},Ul),L=[],$t.html===!0&&(re(P,zl),re(L,Bl)),$t.svg===!0&&(re(P,Va),re(L,Ga),re(L,Vn)),$t.svgFilters===!0&&(re(P,Wa),re(L,Ga),re(L,Vn)),$t.mathMl===!0&&(re(P,Ha),re(L,Vl),re(L,Vn))),b.ADD_TAGS&&(P===Y&&(P=Zt(P)),re(P,b.ADD_TAGS,we)),b.ADD_ATTR&&(L===G&&(L=Zt(L)),re(L,b.ADD_ATTR,we)),b.ADD_URI_SAFE_ATTR&&re(jr,b.ADD_URI_SAFE_ATTR,we),b.FORBID_CONTENTS&&(It===Vt&&(It=Zt(It)),re(It,b.FORBID_CONTENTS,we)),dn&&(P["#text"]=!0),D&&re(P,["html","head","body"]),P.table&&(re(P,["tbody"]),delete V.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=b.TRUSTED_TYPES_POLICY,_=N.createHTML("")}else N===void 0&&(N=ig(y,i)),N!==null&&typeof _=="string"&&(_=N.createHTML(""));He&&He(b),Ct=b}},$i=re({},["mi","mo","mn","ms","mtext"]),gn=re({},["foreignobject","annotation-xml"]),Ii=re({},["title","style","font","a","script"]),Ri=re({},[...Va,...Wa,...qm]),Mi=re({},[...Ha,...Ym]),Di=function(b){let S=M(b);(!S||!S.tagName)&&(S={namespaceURI:Wt,tagName:"template"});const j=Bn(b.tagName),Q=Bn(S.tagName);return mn[b.namespaceURI]?b.namespaceURI===Rr?S.namespaceURI===vt?j==="svg":S.namespaceURI===Ir?j==="svg"&&(Q==="annotation-xml"||$i[Q]):!!Ri[j]:b.namespaceURI===Ir?S.namespaceURI===vt?j==="math":S.namespaceURI===Rr?j==="math"&&gn[Q]:!!Mi[j]:b.namespaceURI===vt?S.namespaceURI===Rr&&!gn[Q]||S.namespaceURI===Ir&&!$i[Q]?!1:!Mi[j]&&(Ii[j]||!Ri[j]):!!(Rt==="application/xhtml+xml"&&mn[b.namespaceURI]):!1},ot=function(b){Wr(t.removed,{element:b});try{M(b).removeChild(b)}catch{x(b)}},Dr=function(b,S){try{Wr(t.removed,{attribute:S.getAttributeNode(b),from:S})}catch{Wr(t.removed,{attribute:null,from:S})}if(S.removeAttribute(b),b==="is"&&!L[b])if(dt||rr)try{ot(S)}catch{}else try{S.setAttribute(b,"")}catch{}},Ni=function(b){let S=null,j=null;if(Qe)b="<remove></remove>"+b;else{const xe=Ll(b,/^[\r\n\t ]+/);j=xe&&xe[0]}Rt==="application/xhtml+xml"&&Wt===vt&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const Q=N?N.createHTML(b):b;if(Wt===vt)try{S=new p().parseFromString(Q,Rt)}catch{}if(!S||!S.documentElement){S=R.createDocument(Wt,"template",null);try{S.documentElement.innerHTML=hn?_:Q}catch{}}const Te=S.body||S.documentElement;return b&&j&&Te.insertBefore(r.createTextNode(j),Te.childNodes[0]||null),Wt===vt?ee.call(S,D?"html":"body")[0]:D?S.documentElement:Te},Fi=function(b){return F.call(b.ownerDocument||b,b,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Li=function(b){return b instanceof c&&(typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||!(b.attributes instanceof f)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function")},m=function(b){return typeof s=="function"&&b instanceof s},E=function(b,S,j){z[b]&&Un(z[b],Q=>{Q.call(t,S,j,Ct)})},I=function(b){let S=null;if(E("beforeSanitizeElements",b,null),Li(b))return ot(b),!0;const j=we(b.nodeName);if(E("uponSanitizeElement",b,{tagName:j,allowedTags:P}),b.hasChildNodes()&&!m(b.firstElementChild)&&Ge(/<[/\w]/g,b.innerHTML)&&Ge(/<[/\w]/g,b.textContent)||b.nodeType===Yr.progressingInstruction||Ie&&b.nodeType===Yr.comment&&Ge(/<[/\w]/g,b.data))return ot(b),!0;if(!P[j]||V[j]){if(!V[j]&&ie(j)&&(U.tagNameCheck instanceof RegExp&&Ge(U.tagNameCheck,j)||U.tagNameCheck instanceof Function&&U.tagNameCheck(j)))return!1;if(dn&&!It[j]){const Q=M(b)||b.parentNode,Te=k(b)||b.childNodes;if(Te&&Q){const xe=Te.length;for(let ge=xe-1;ge>=0;--ge){const et=h(Te[ge],!0);et.__removalCount=(b.__removalCount||0)+1,Q.insertBefore(et,w(b))}}}return ot(b),!0}return b instanceof l&&!Di(b)||(j==="noscript"||j==="noembed"||j==="noframes")&&Ge(/<\/no(script|embed|frames)/i,b.innerHTML)?(ot(b),!0):($&&b.nodeType===Yr.text&&(S=b.textContent,Un([le,me,ye],Q=>{S=Hr(S,Q," ")}),b.textContent!==S&&(Wr(t.removed,{element:b.cloneNode()}),b.textContent=S)),E("afterSanitizeElements",b,null),!1)},W=function(b,S,j){if(Ci&&(S==="id"||S==="name")&&(j in r||j in ki))return!1;if(!(Z&&!q[S]&&Ge(qe,S))){if(!(K&&Ge(je,S))){if(!L[S]||q[S]){if(!(ie(b)&&(U.tagNameCheck instanceof RegExp&&Ge(U.tagNameCheck,b)||U.tagNameCheck instanceof Function&&U.tagNameCheck(b))&&(U.attributeNameCheck instanceof RegExp&&Ge(U.attributeNameCheck,S)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(S))||S==="is"&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&Ge(U.tagNameCheck,j)||U.tagNameCheck instanceof Function&&U.tagNameCheck(j))))return!1}else if(!jr[S]){if(!Ge(C,Hr(j,at,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&b!=="script"&&Vm(j,"data:")===0&&Ai[b])){if(!(X&&!Ge(Ze,Hr(j,at,"")))){if(j)return!1}}}}}}return!0},ie=function(b){return b!=="annotation-xml"&&Ll(b,yt)},pe=function(b){E("beforeSanitizeAttributes",b,null);const{attributes:S}=b;if(!S)return;const j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L};let Q=S.length;for(;Q--;){const Te=S[Q],{name:xe,namespaceURI:ge,value:et}=Te,ir=we(xe);let Ne=xe==="value"?et:Wm(et);if(j.attrName=ir,j.attrValue=Ne,j.keepAttr=!0,j.forceKeepAttr=void 0,E("uponSanitizeAttribute",b,j),Ne=j.attrValue,Ie&&Ge(/((--!?|])>)|<\/(style|title)/i,Ne)){Dr(xe,b);continue}if(j.forceKeepAttr||(Dr(xe,b),!j.keepAttr))continue;if(!Ae&&Ge(/\/>/i,Ne)){Dr(xe,b);continue}$&&Un([le,me,ye],Cd=>{Ne=Hr(Ne,Cd," ")});const wd=we(b.nodeName);if(W(wd,ir,Ne)){if(Oi&&(ir==="id"||ir==="name")&&(Dr(xe,b),Ne=fn+Ne),N&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!ge)switch(y.getAttributeType(wd,ir)){case"TrustedHTML":{Ne=N.createHTML(Ne);break}case"TrustedScriptURL":{Ne=N.createScriptURL(Ne);break}}try{ge?b.setAttributeNS(ge,xe,Ne):b.setAttribute(xe,Ne),Li(b)?ot(b):Fl(t.removed)}catch{}}}E("afterSanitizeAttributes",b,null)},ne=function O(b){let S=null;const j=Fi(b);for(E("beforeSanitizeShadowDOM",b,null);S=j.nextNode();)E("uponSanitizeShadowNode",S,null),!I(S)&&(S.content instanceof a&&O(S.content),pe(S));E("afterSanitizeShadowDOM",b,null)};return t.sanitize=function(O){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,j=null,Q=null,Te=null;if(hn=!O,hn&&(O="<!-->"),typeof O!="string"&&!m(O))if(typeof O.toString=="function"){if(O=O.toString(),typeof O!="string")throw Gr("dirty is not a string, aborting")}else throw Gr("toString is not a function");if(!t.isSupported)return O;if(Ye||Mr(b),t.removed=[],typeof O=="string"&&(nr=!1),nr){if(O.nodeName){const et=we(O.nodeName);if(!P[et]||V[et])throw Gr("root node is forbidden and cannot be sanitized in-place")}}else if(O instanceof s)S=Ni("<!---->"),j=S.ownerDocument.importNode(O,!0),j.nodeType===Yr.element&&j.nodeName==="BODY"||j.nodeName==="HTML"?S=j:S.appendChild(j);else{if(!dt&&!$&&!D&&O.indexOf("<")===-1)return N&&jt?N.createHTML(O):O;if(S=Ni(O),!S)return dt?null:jt?_:""}S&&Qe&&ot(S.firstChild);const xe=Fi(nr?O:S);for(;Q=xe.nextNode();)I(Q)||(Q.content instanceof a&&ne(Q.content),pe(Q));if(nr)return O;if(dt){if(rr)for(Te=J.call(S.ownerDocument);S.firstChild;)Te.appendChild(S.firstChild);else Te=S;return(L.shadowroot||L.shadowrootmode)&&(Te=ae.call(n,Te,!0)),Te}let ge=D?S.outerHTML:S.innerHTML;return D&&P["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Ge(Hl,S.ownerDocument.doctype.name)&&(ge="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
56
56
|
`+ge),$&&Un([le,me,ye],et=>{ge=Hr(ge,et," ")}),N&&jt?N.createHTML(ge):ge},t.setConfig=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mr(O),Ye=!0},t.clearConfig=function(){Ct=null,Ye=!1},t.isValidAttribute=function(O,b,S){Ct||Mr({});const j=we(O),Q=we(b);return W(j,Q,S)},t.addHook=function(O,b){typeof b=="function"&&(z[O]=z[O]||[],Wr(z[O],b))},t.removeHook=function(O){if(z[O])return Fl(z[O])},t.removeHooks=function(O){z[O]&&(z[O]=[])},t.removeAllHooks=function(){z={}},t}var ag=ql();const og={field:"_field_zdaf7_1",rtl:"_rtl_zdaf7_7",borderRight:"_borderRight_zdaf7_12"},Wn=T.memo(({id:e,entry:t,loading:r,rightBorder:n,children:i,onClickEntry:a,customElement:o,sanitize:s,...l})=>{const u={text:{style:{whiteSpace:"nowrap",overflow:"ellipsis"}}},{text:f}=v.useProps("Field",u,l),c={};Object.entries(f).forEach(([g,h])=>{typeof h=="function"&&(c[g]=h(t))});let p;s&&(p=ag.sanitize(i));const y=v.useStyles({name:"Field",props:l,classes:og});return d.jsx(v.Table.Td,{...y("field"),onClick:a?()=>a(e,t):null,...l,children:d.jsx(v.Box,{w:"100%",children:d.jsx(v.Skeleton,{visible:r,children:o||(typeof i!="object"?d.jsx(v.Text,{...f,...c,children:p||i}):p||i)})})})});Wn.displayName="Field";const Yl={row:"_row_138r2_1",selected:"_selected_138r2_5"};function sg({entry:e,selected:t,children:r}){const n=v.useStyles({name:"Row",classes:Yl}),i=v.useProps("Row",{},{});Object.entries(i).forEach(([s,l])=>{typeof l=="function"&&(i[s]=l(e))});var{className:a,style:o}=n("row");return a=`${a} ${t?Yl.selected:""}`,d.jsx(v.Table.Tr,{className:a,style:{...o},...i,children:r})}function lg({bodyCustomizer:e,actionColumn:t,id:r,entry:n}){let i=e==null?void 0:e[t];return typeof i=="function"&&(i=i({id:r,...n})),i===null?null:i||d.jsx(Zs,{id:r})}function ug({data:e,loading:t,hideActions:r,hideCheckbox:n,selection:i,toggleRow:a,onClickEntry:o,bodyCustomizer:s}){const l=e.list_columns.includes("actions")?"_actions":"actions";return d.jsx(v.Table.Tbody,{children:e.result.length?e.result.map((u,f)=>{const c=e.ids[f];return d.jsxs(sg,{entry:{...u,id:c},children:[n?null:d.jsx(Wn,{loading:t,children:d.jsx(v.Checkbox,{pl:2,checked:i.includes(Fe(c)),onChange:p=>{a(Fe(c))}})},f),r?null:d.jsx(Wn,{loading:t,children:d.jsx(lg,{bodyCustomizer:s,actionColumn:l,id:Fe(c),entry:u})}),e.list_columns.map((p,y)=>{let g=s==null?void 0:s[p];return typeof g=="function"&&(g=g({id:c,...u})),g===null?null:d.jsx(Wn,{id:Fe(c),entry:u,loading:t,onClickEntry:o,customElement:g,sanitize:!0,children:Gs(u,p)},y)})]},Fe(c))}):d.jsx("tr",{children:d.jsx("td",{style:{padding:"8px"},colSpan:r?e.list_columns.length:e.list_columns.length+1,children:d.jsx(v.Text,{style:{fontStyle:"italic"},size:"sm",c:"dimmed",children:"No data available..."})})})})}const cg={scrollbar:"_scrollbar_isyo2_1"};function fg({bulkActions:e,hideActions:t,loading:r,onSelectCheckbox:n,onClickEntry:i,hideCheckbox:a,hideDownload:o,headerCustomizer:s,bodyCustomizer:l,...u}){const f=v.useMantineTheme(),c=v.Table.extend({highlightOnHover:!0,striped:!0,horizontalSpacing:"md",verticalSpacing:"sm"}),p=v.useProps("DatagridTable",c,u),{data:y,info:g}=Re(),[h,x]=T.useState([]),[w,k]=T.useState(!1),M=_=>{x(R=>R.includes(_)?R.filter(F=>F!==_):[...R,_])},N=()=>{x(_=>_.length===y.ids.length?[]:y.ids.map((R,F)=>R))};return T.useEffect(()=>{k(h.length===y.result.length&&h.length>0),n&&n(h),e==null||e.setSelectedIds(h.map(_=>_))},[h]),T.useEffect(()=>{x([]),n&&n([])},[y]),d.jsx(v.ScrollArea,{options:{className:f.colorScheme==="dark"?"os-theme-light":void 0},style:{flex:1,flexDirection:"column"},classNames:cg,children:d.jsxs(v.Table,{stickyHeader:!0,...p,children:[d.jsx(Hs,{data:y,info:g,hideActions:t,hideCheckbox:a,allChecked:w,setSelection:x,toggleAll:N,headerCustomizer:s}),d.jsx(ug,{data:y,loading:r,hideActions:t,hideCheckbox:a,selection:h,setSelection:x,toggleRow:M,onClickEntry:i,bodyCustomizer:l})]})})}const Kl=T.memo(({...e})=>{const{data:t,queryParams:r,setQueryParams:n}=Re(),i=[{value:"10",label:"10"},{value:"25",label:"25"},{value:"50",label:"50"}],a=String(r.page_size),[o,s]=T.useState(r.page);T.useEffect(()=>{s(r.page)},[r.page]);const l=f=>{s(f-1),n({page:f-1})},u=f=>{n({page_size:parseInt(f,10),page:0})};return d.jsxs(d.Fragment,{children:[d.jsx(v.Divider,{}),d.jsxs(v.Box,{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:54,border:"none",borderTopWidth:"1px",padding:"var(--mantine-spacing-md)"},children:[d.jsxs(v.Box,{style:{display:"flex",alignItems:"center",gap:"var(--mantine-spacing-sm)"},children:[d.jsx(v.Text,{children:"Rows per page:"}),d.jsx(v.Select,{value:a,defaultValue:a,onChange:f=>u(f),data:i,allowDeselect:!1,w:80,size:"xs",styles:()=>({input:{fontSize:"14px",fontWeight:"250",lineHeight:"52px",border:"1px solid #E6E8ED"},item:{"&[data-selected]":{"&, &:hover":{outline:"none !important"}}}})})]}),d.jsx(v.Pagination,{size:"sm",total:Math.ceil(t.count/a),value:o+1,onChange:l,...e})]})]})});Kl.displayName="Pagination";function dg(){const{error:e}=Re(),[t,r]=T.useState(!1);return T.useEffect(()=>{e&&r(!0)},[e]),d.jsx(v.Modal,{opened:t,onClose:()=>r(!1),title:d.jsxs(v.Group,{children:[d.jsx(ah,{size:16,color:"red"}),d.jsx(v.Text,{children:e?e.originalError.detail||e.originalError.message:"Error"})]}),centered:!0,children:e?d.jsx(v.Text,{children:e.message}):null})}const qa=T.forwardRef((e,t)=>{const{path:r,data:n,loading:i,info:a,setQueryParams:o}=Re(),{hideToolbar:s=!1,hideFilter:l=!1,hideAdd:u=!1,hideSettings:f=!1,hideActions:c=!1,hidePagination:p=!1,hideError:y=!1,hideDownload:g=!0,onSelectCheckbox:h=null,onClickEntry:x=null,fetchOnMount:w=!0,bulkActions:k=null,styles:M,headerCustomizer:N={},bodyCustomizer:_={},toolbarCustomizer:R={}}=e;if(T.useEffect(()=>{!n&&w&&o({})},[n]),!a)return;const F=k===null;return d.jsxs(v.Paper,{ref:t,style:{position:"relative",height:"100%",display:"flex",flexDirection:"column",...M},children:[s?null:d.jsx(Vs,{hideFilter:l,hideAdd:u,hideSettings:f,hideDownload:g,toolbarCustomizer:R}),n?d.jsx(fg,{bulkActions:k,hideActions:c,loading:i,onSelectCheckbox:h,onClickEntry:x,hideCheckbox:F,hideDownload:g,headerCustomizer:N,bodyCustomizer:_}):null,!p&&n?d.jsx(Kl,{}):null,y?null:d.jsx(dg,{})]})});qa.displayName="DataGrid";const pg=e=>{const{description:t,errors:r,data:n,handleChange:i,path:a,label:o,required:s,enabled:l}=e;return d.jsx(ar.DateInput,{valueFormat:"DD.MM.YYYY",disabled:!l,label:o,description:t,error:r,required:s,value:n?new Date(n):null,onChange:u=>{if(u instanceof Date){const f=new Date(u.getTime()-u.getTimezoneOffset()*6e4);i(a,f.toISOString().substring(0,10))}}})},Xl=B.rankWith(5,B.isDateControl),Jl=ve.withJsonFormsControlProps(pg),hg=e=>{const{description:t,errors:r,data:n,handleChange:i,path:a,label:o,required:s,enabled:l}=e;return d.jsx(ar.DateTimePicker,{valueFormat:"DD.MM.YYYY HH:mm",disabled:!l,label:o,description:t,error:r,required:s,value:n?new Date(n):null,onChange:u=>{if(u instanceof Date){const f=new Date(u);i(a,f.toISOString())}}})},Zl=B.rankWith(5,B.isDateTimeControl),Ql=ve.withJsonFormsControlProps(hg);var mg=Object.prototype;function gg(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||mg;return e===r}var Hn=gg;function yg(e,t){return function(r){return e(t(r))}}var eu=yg,vg=eu,bg=vg(Object.keys,Object),xg=bg,_g=Hn,Tg=xg,Eg=Object.prototype,Sg=Eg.hasOwnProperty;function wg(e){if(!_g(e))return Tg(e);var t=[];for(var r in Object(e))Sg.call(e,r)&&r!="constructor"&&t.push(r);return t}var Cg=wg,Og=typeof $e=="object"&&$e&&$e.Object===Object&&$e,tu=Og,Ag=tu,Pg=typeof self=="object"&&self&&self.Object===Object&&self,kg=Ag||Pg||Function("return this")(),gt=kg,jg=gt,$g=jg.Symbol,Gn=$g,ru=Gn,nu=Object.prototype,Ig=nu.hasOwnProperty,Rg=nu.toString,Kr=ru?ru.toStringTag:void 0;function Mg(e){var t=Ig.call(e,Kr),r=e[Kr];try{e[Kr]=void 0;var n=!0}catch{}var i=Rg.call(e);return n&&(t?e[Kr]=r:delete e[Kr]),i}var Dg=Mg,Ng=Object.prototype,Fg=Ng.toString;function Lg(e){return Fg.call(e)}var zg=Lg,iu=Gn,Ug=Dg,Bg=zg,Vg="[object Null]",Wg="[object Undefined]",au=iu?iu.toStringTag:void 0;function Hg(e){return e==null?e===void 0?Wg:Vg:au&&au in Object(e)?Ug(e):Bg(e)}var fr=Hg;function Gg(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Pt=Gg,qg=fr,Yg=Pt,Kg="[object AsyncFunction]",Xg="[object Function]",Jg="[object GeneratorFunction]",Zg="[object Proxy]";function Qg(e){if(!Yg(e))return!1;var t=qg(e);return t==Xg||t==Jg||t==Kg||t==Zg}var Ya=Qg,ey=gt,ty=ey["__core-js_shared__"],ry=ty,Ka=ry,ou=function(){var e=/[^.]+$/.exec(Ka&&Ka.keys&&Ka.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ny(e){return!!ou&&ou in e}var iy=ny,ay=Function.prototype,oy=ay.toString;function sy(e){if(e!=null){try{return oy.call(e)}catch{}try{return e+""}catch{}}return""}var su=sy,ly=Ya,uy=iy,cy=Pt,fy=su,dy=/[\\^$.*+?()[\]{}|]/g,py=/^\[object .+?Constructor\]$/,hy=Function.prototype,my=Object.prototype,gy=hy.toString,yy=my.hasOwnProperty,vy=RegExp("^"+gy.call(yy).replace(dy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function by(e){if(!cy(e)||uy(e))return!1;var t=ly(e)?vy:py;return t.test(fy(e))}var xy=by;function _y(e,t){return e==null?void 0:e[t]}var Ty=_y,Ey=xy,Sy=Ty;function wy(e,t){var r=Sy(e,t);return Ey(r)?r:void 0}var Qt=wy,Cy=Qt,Oy=gt,Ay=Cy(Oy,"DataView"),Py=Ay,ky=Qt,jy=gt,$y=ky(jy,"Map"),Xa=$y,Iy=Qt,Ry=gt,My=Iy(Ry,"Promise"),Dy=My,Ny=Qt,Fy=gt,Ly=Ny(Fy,"Set"),lu=Ly,zy=Qt,Uy=gt,By=zy(Uy,"WeakMap"),Vy=By,Ja=Py,Za=Xa,Qa=Dy,eo=lu,to=Vy,uu=fr,dr=su,cu="[object Map]",Wy="[object Object]",fu="[object Promise]",du="[object Set]",pu="[object WeakMap]",hu="[object DataView]",Hy=dr(Ja),Gy=dr(Za),qy=dr(Qa),Yy=dr(eo),Ky=dr(to),er=uu;(Ja&&er(new Ja(new ArrayBuffer(1)))!=hu||Za&&er(new Za)!=cu||Qa&&er(Qa.resolve())!=fu||eo&&er(new eo)!=du||to&&er(new to)!=pu)&&(er=function(e){var t=uu(e),r=t==Wy?e.constructor:void 0,n=r?dr(r):"";if(n)switch(n){case Hy:return hu;case Gy:return cu;case qy:return fu;case Yy:return du;case Ky:return pu}return t});var Xy=er;function Jy(e){return e!=null&&typeof e=="object"}var pr=Jy,Zy=fr,Qy=pr,e0="[object Arguments]";function t0(e){return Qy(e)&&Zy(e)==e0}var r0=t0,mu=r0,n0=pr,gu=Object.prototype,i0=gu.hasOwnProperty,a0=gu.propertyIsEnumerable,o0=mu(function(){return arguments}())?mu:function(e){return n0(e)&&i0.call(e,"callee")&&!a0.call(e,"callee")},qn=o0,s0=Array.isArray,Xr=s0,l0=9007199254740991;function u0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=l0}var yu=u0,c0=Ya,f0=yu;function d0(e){return e!=null&&f0(e.length)&&!c0(e)}var Yn=d0,Kn={exports:{}};function p0(){return!1}var h0=p0;Kn.exports,function(e,t){var r=gt,n=h0,i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,s=o?r.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;e.exports=u}(Kn,Kn.exports);var ro=Kn.exports,m0=fr,g0=yu,y0=pr,v0="[object Arguments]",b0="[object Array]",x0="[object Boolean]",_0="[object Date]",T0="[object Error]",E0="[object Function]",S0="[object Map]",w0="[object Number]",C0="[object Object]",O0="[object RegExp]",A0="[object Set]",P0="[object String]",k0="[object WeakMap]",j0="[object ArrayBuffer]",$0="[object DataView]",I0="[object Float32Array]",R0="[object Float64Array]",M0="[object Int8Array]",D0="[object Int16Array]",N0="[object Int32Array]",F0="[object Uint8Array]",L0="[object Uint8ClampedArray]",z0="[object Uint16Array]",U0="[object Uint32Array]",be={};be[I0]=be[R0]=be[M0]=be[D0]=be[N0]=be[F0]=be[L0]=be[z0]=be[U0]=!0,be[v0]=be[b0]=be[j0]=be[x0]=be[$0]=be[_0]=be[T0]=be[E0]=be[S0]=be[w0]=be[C0]=be[O0]=be[A0]=be[P0]=be[k0]=!1;function B0(e){return y0(e)&&g0(e.length)&&!!be[m0(e)]}var V0=B0;function W0(e){return function(t){return e(t)}}var H0=W0,Xn={exports:{}};Xn.exports,function(e,t){var r=tu,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s}(Xn,Xn.exports);var G0=Xn.exports,q0=V0,Y0=H0,vu=G0,bu=vu&&vu.isTypedArray,K0=bu?Y0(bu):q0,no=K0,X0=Cg,J0=Xy,Z0=qn,Q0=Xr,ev=Yn,tv=ro,rv=Hn,nv=no,iv="[object Map]",av="[object Set]",ov=Object.prototype,sv=ov.hasOwnProperty;function lv(e){if(e==null)return!0;if(ev(e)&&(Q0(e)||typeof e=="string"||typeof e.splice=="function"||tv(e)||nv(e)||Z0(e)))return!e.length;var t=J0(e);if(t==iv||t==av)return!e.size;if(rv(e))return!X0(e).length;for(var r in e)if(sv.call(e,r))return!1;return!0}var uv=lv;const xu=Ot(uv),_u=(e,t,r,n,i,a,o)=>e.map((s,l)=>d.jsx(v.Grid.Col,{span:i==="row"?12/e.length:12,children:d.jsx(ve.JsonFormsDispatch,{uischema:s,schema:t,path:r,enabled:n,renderers:a,cells:o})},`${r}-${l}`)),cv=({elements:e,schema:t,path:r,enabled:n,direction:i,renderers:a,cells:o})=>xu(e)?null:d.jsx(v.Grid,{spacing:i==="row"?2:0,children:_u(e,t,r,n,i,a,o)}),io=T.memo(cv),fv=e=>function(r){const n=ve.useJsonForms(),i=B.getAjv({jsonforms:{...n}});return d.jsx(e,{...r,ajv:i})};var dv=gt,pv=function(){return dv.Date.now()},hv=pv,mv=/\s/;function gv(e){for(var t=e.length;t--&&mv.test(e.charAt(t)););return t}var yv=gv,vv=yv,bv=/^\s+/;function xv(e){return e&&e.slice(0,vv(e)+1).replace(bv,"")}var _v=xv,Tv=fr,Ev=pr,Sv="[object Symbol]";function wv(e){return typeof e=="symbol"||Ev(e)&&Tv(e)==Sv}var Tu=wv,Cv=_v,Eu=Pt,Ov=Tu,Su=0/0,Av=/^[-+]0x[0-9a-f]+$/i,Pv=/^0b[01]+$/i,kv=/^0o[0-7]+$/i,jv=parseInt;function $v(e){if(typeof e=="number")return e;if(Ov(e))return Su;if(Eu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Eu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Cv(e);var r=Pv.test(e);return r||kv.test(e)?jv(e.slice(2),r?2:8):Av.test(e)?Su:+e}var wu=$v,Iv=Pt,ao=hv,Cu=wu,Rv="Expected a function",Mv=Math.max,Dv=Math.min;function Nv(e,t,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,p=!0;if(typeof e!="function")throw new TypeError(Rv);t=Cu(t)||0,Iv(r)&&(f=!!r.leading,c="maxWait"in r,a=c?Mv(Cu(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function y(R){var F=n,J=i;return n=i=void 0,u=R,o=e.apply(J,F),o}function g(R){return u=R,s=setTimeout(w,t),f?y(R):o}function h(R){var F=R-l,J=R-u,ee=t-F;return c?Dv(ee,a-J):ee}function x(R){var F=R-l,J=R-u;return l===void 0||F>=t||F<0||c&&J>=a}function w(){var R=ao();if(x(R))return k(R);s=setTimeout(w,h(R))}function k(R){return s=void 0,p&&n?y(R):(n=i=void 0,o)}function M(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function N(){return s===void 0?o:k(ao())}function _(){var R=ao(),F=x(R);if(n=arguments,i=this,l=R,F){if(s===void 0)return g(l);if(c)return clearTimeout(s),s=setTimeout(w,t),y(l)}return s===void 0&&(s=setTimeout(w,t)),o}return _.cancel=M,_.flush=N,_}var Fv=Nv;const Lv=Ot(Fv),Ou=(e,t,r,n,i,a=300)=>{const[o,s]=T.useState(r??t);T.useEffect(()=>{s(r??t)},[r]);const l=T.useCallback(Lv(c=>e(n,c),a),[e,n,a]),u=T.useCallback(c=>{const p=i(c);s(p??t),l(p)},[l,i]),f=T.useCallback(()=>{s(t),e(n,void 0)},[t,e,n]);return[o,u,f]},zv=e=>e===""?void 0:parseFloat(e),Uv=e=>zv(e),Jn=T.memo(function(t){const{allowDecimal:r,className:n,data:i,description:a,errors:o,enabled:s,handleChange:l,label:u,path:f,required:c,hideControls:p}=t,[y,g]=Ou(l,"",i,f,Uv);return d.jsx(v.NumberInput,{label:u,description:a,error:o,required:c,value:y,onChange:g,className:n,disabled:!s,allowDecimal:r,hideControls:p,w:"100%"})}),Bv=e=>d.jsx(Jn,{...e}),Au=B.rankWith(3,B.isNumberControl),Pu=ve.withJsonFormsControlProps(Bv),Vv=e=>d.jsx(Jn,{...e}),ku=B.rankWith(3,B.isIntegerControl),ju=ve.withJsonFormsControlProps(Vv);function Wv(){this.__data__=[],this.size=0}var Hv=Wv;function Gv(e,t){return e===t||e!==e&&t!==t}var Zn=Gv,qv=Zn;function Yv(e,t){for(var r=e.length;r--;)if(qv(e[r][0],t))return r;return-1}var Qn=Yv,Kv=Qn,Xv=Array.prototype,Jv=Xv.splice;function Zv(e){var t=this.__data__,r=Kv(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Jv.call(t,r,1),--this.size,!0}var Qv=Zv,eb=Qn;function tb(e){var t=this.__data__,r=eb(t,e);return r<0?void 0:t[r][1]}var rb=tb,nb=Qn;function ib(e){return nb(this.__data__,e)>-1}var ab=ib,ob=Qn;function sb(e,t){var r=this.__data__,n=ob(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var lb=sb,ub=Hv,cb=Qv,fb=rb,db=ab,pb=lb;function hr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}hr.prototype.clear=ub,hr.prototype.delete=cb,hr.prototype.get=fb,hr.prototype.has=db,hr.prototype.set=pb;var ei=hr,hb=ei;function mb(){this.__data__=new hb,this.size=0}var gb=mb;function yb(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var vb=yb;function bb(e){return this.__data__.get(e)}var xb=bb;function _b(e){return this.__data__.has(e)}var Tb=_b,Eb=Qt,Sb=Eb(Object,"create"),ti=Sb,$u=ti;function wb(){this.__data__=$u?$u(null):{},this.size=0}var Cb=wb;function Ob(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ab=Ob,Pb=ti,kb="__lodash_hash_undefined__",jb=Object.prototype,$b=jb.hasOwnProperty;function Ib(e){var t=this.__data__;if(Pb){var r=t[e];return r===kb?void 0:r}return $b.call(t,e)?t[e]:void 0}var Rb=Ib,Mb=ti,Db=Object.prototype,Nb=Db.hasOwnProperty;function Fb(e){var t=this.__data__;return Mb?t[e]!==void 0:Nb.call(t,e)}var Lb=Fb,zb=ti,Ub="__lodash_hash_undefined__";function Bb(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=zb&&t===void 0?Ub:t,this}var Vb=Bb,Wb=Cb,Hb=Ab,Gb=Rb,qb=Lb,Yb=Vb;function mr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}mr.prototype.clear=Wb,mr.prototype.delete=Hb,mr.prototype.get=Gb,mr.prototype.has=qb,mr.prototype.set=Yb;var Kb=mr,Iu=Kb,Xb=ei,Jb=Xa;function Zb(){this.size=0,this.__data__={hash:new Iu,map:new(Jb||Xb),string:new Iu}}var Qb=Zb;function e1(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var t1=e1,r1=t1;function n1(e,t){var r=e.__data__;return r1(t)?r[typeof t=="string"?"string":"hash"]:r.map}var ri=n1,i1=ri;function a1(e){var t=i1(this,e).delete(e);return this.size-=t?1:0,t}var o1=a1,s1=ri;function l1(e){return s1(this,e).get(e)}var u1=l1,c1=ri;function f1(e){return c1(this,e).has(e)}var d1=f1,p1=ri;function h1(e,t){var r=p1(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var m1=h1,g1=Qb,y1=o1,v1=u1,b1=d1,x1=m1;function gr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gr.prototype.clear=g1,gr.prototype.delete=y1,gr.prototype.get=v1,gr.prototype.has=b1,gr.prototype.set=x1;var Ru=gr,_1=ei,T1=Xa,E1=Ru,S1=200;function w1(e,t){var r=this.__data__;if(r instanceof _1){var n=r.__data__;if(!T1||n.length<S1-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new E1(n)}return r.set(e,t),this.size=r.size,this}var C1=w1,O1=ei,A1=gb,P1=vb,k1=xb,j1=Tb,$1=C1;function yr(e){var t=this.__data__=new O1(e);this.size=t.size}yr.prototype.clear=A1,yr.prototype.delete=P1,yr.prototype.get=k1,yr.prototype.has=j1,yr.prototype.set=$1;var I1=yr,R1=Qt,M1=function(){try{var e=R1(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Mu=M1,Du=Mu;function D1(e,t,r){t=="__proto__"&&Du?Du(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var oo=D1,N1=oo,F1=Zn;function L1(e,t,r){(r!==void 0&&!F1(e[t],r)||r===void 0&&!(t in e))&&N1(e,t,r)}var Nu=L1;function z1(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var U1=z1,B1=U1,V1=B1(),W1=V1,ni={exports:{}};ni.exports,function(e,t){var r=gt,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(u,f){if(f)return u.slice();var c=u.length,p=s?s(c):new u.constructor(c);return u.copy(p),p}e.exports=l}(ni,ni.exports);var H1=ni.exports,G1=gt,q1=G1.Uint8Array,Y1=q1,Fu=Y1;function K1(e){var t=new e.constructor(e.byteLength);return new Fu(t).set(new Fu(e)),t}var X1=K1,J1=X1;function Z1(e,t){var r=t?J1(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Q1=Z1;function ex(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var tx=ex,rx=Pt,Lu=Object.create,nx=function(){function e(){}return function(t){if(!rx(t))return{};if(Lu)return Lu(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),ix=nx,ax=eu,ox=ax(Object.getPrototypeOf,Object),zu=ox,sx=ix,lx=zu,ux=Hn;function cx(e){return typeof e.constructor=="function"&&!ux(e)?sx(lx(e)):{}}var fx=cx,dx=Yn,px=pr;function hx(e){return px(e)&&dx(e)}var Uu=hx,mx=fr,gx=zu,yx=pr,vx="[object Object]",bx=Function.prototype,xx=Object.prototype,Bu=bx.toString,_x=xx.hasOwnProperty,Tx=Bu.call(Object);function Ex(e){if(!yx(e)||mx(e)!=vx)return!1;var t=gx(e);if(t===null)return!0;var r=_x.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Bu.call(r)==Tx}var Sx=Ex;function wx(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Vu=wx,Cx=oo,Ox=Zn,Ax=Object.prototype,Px=Ax.hasOwnProperty;function kx(e,t,r){var n=e[t];(!(Px.call(e,t)&&Ox(n,r))||r===void 0&&!(t in e))&&Cx(e,t,r)}var jx=kx,$x=jx,Ix=oo;function Rx(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],l=n?n(r[s],e[s],s,r,e):void 0;l===void 0&&(l=e[s]),i?Ix(r,s,l):$x(r,s,l)}return r}var Mx=Rx;function Dx(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Nx=Dx,Fx=9007199254740991,Lx=/^(?:0|[1-9]\d*)$/;function zx(e,t){var r=typeof e;return t=t??Fx,!!t&&(r=="number"||r!="symbol"&&Lx.test(e))&&e>-1&&e%1==0&&e<t}var Wu=zx,Ux=Nx,Bx=qn,Vx=Xr,Wx=ro,Hx=Wu,Gx=no,qx=Object.prototype,Yx=qx.hasOwnProperty;function Kx(e,t){var r=Vx(e),n=!r&&Bx(e),i=!r&&!n&&Wx(e),a=!r&&!n&&!i&&Gx(e),o=r||n||i||a,s=o?Ux(e.length,String):[],l=s.length;for(var u in e)(t||Yx.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Hx(u,l)))&&s.push(u);return s}var Xx=Kx;function Jx(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Zx=Jx,Qx=Pt,e_=Hn,t_=Zx,r_=Object.prototype,n_=r_.hasOwnProperty;function i_(e){if(!Qx(e))return t_(e);var t=e_(e),r=[];for(var n in e)n=="constructor"&&(t||!n_.call(e,n))||r.push(n);return r}var a_=i_,o_=Xx,s_=a_,l_=Yn;function u_(e){return l_(e)?o_(e,!0):s_(e)}var Hu=u_,c_=Mx,f_=Hu;function d_(e){return c_(e,f_(e))}var p_=d_,Gu=Nu,h_=H1,m_=Q1,g_=tx,y_=fx,qu=qn,Yu=Xr,v_=Uu,b_=ro,x_=Ya,__=Pt,T_=Sx,E_=no,Ku=Vu,S_=p_;function w_(e,t,r,n,i,a,o){var s=Ku(e,r),l=Ku(t,r),u=o.get(l);if(u){Gu(e,r,u);return}var f=a?a(s,l,r+"",e,t,o):void 0,c=f===void 0;if(c){var p=Yu(l),y=!p&&b_(l),g=!p&&!y&&E_(l);f=l,p||y||g?Yu(s)?f=s:v_(s)?f=g_(s):y?(c=!1,f=h_(l,!0)):g?(c=!1,f=m_(l,!0)):f=[]:T_(l)||qu(l)?(f=s,qu(s)?f=S_(s):(!__(s)||x_(s))&&(f=y_(l))):c=!1}c&&(o.set(l,f),i(f,l,n,a,o),o.delete(l)),Gu(e,r,f)}var C_=w_,O_=I1,A_=Nu,P_=W1,k_=C_,j_=Pt,$_=Hu,I_=Vu;function Xu(e,t,r,n,i){e!==t&&P_(t,function(a,o){if(i||(i=new O_),j_(a))k_(e,t,o,r,Xu,n,i);else{var s=n?n(I_(e,o),a,o+"",e,t,i):void 0;s===void 0&&(s=a),A_(e,o,s)}},$_)}var R_=Xu;function M_(e){return e}var Ju=M_;function D_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var N_=D_,F_=N_,Zu=Math.max;function L_(e,t,r){return t=Zu(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Zu(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),F_(e,this,s)}}var z_=L_;function U_(e){return function(){return e}}var B_=U_,V_=B_,Qu=Mu,W_=Ju,H_=Qu?function(e,t){return Qu(e,"toString",{configurable:!0,enumerable:!1,value:V_(t),writable:!0})}:W_,G_=H_,q_=800,Y_=16,K_=Date.now;function X_(e){var t=0,r=0;return function(){var n=K_(),i=Y_-(n-r);if(r=n,i>0){if(++t>=q_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var J_=X_,Z_=G_,Q_=J_,eT=Q_(Z_),tT=eT,rT=Ju,nT=z_,iT=tT;function aT(e,t){return iT(nT(e,t,rT),e+"")}var ec=aT,oT=Zn,sT=Yn,lT=Wu,uT=Pt;function cT(e,t,r){if(!uT(r))return!1;var n=typeof t;return(n=="number"?sT(r)&&lT(t,r.length):n=="string"&&t in r)?oT(r[t],e):!1}var tc=cT,fT=ec,dT=tc;function pT(e){return fT(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&dT(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t})}var hT=pT,mT=R_,gT=hT,yT=gT(function(e,t,r){mT(e,t,r)}),vT=yT;const rc=Ot(vT),nc=T.memo(function(t){const{className:r,config:n,uischema:i,data:a,description:o,errors:s,enabled:l,path:u,handleChange:f,label:c,required:p}=t;return rc({},n,i.options).format==="password"?d.jsx(v.PasswordInput,{label:c,description:o,error:s,required:p,value:a||"",onChange:g=>{f(u,g.currentTarget.value)},className:r,disabled:!l,w:"100%"}):d.jsx(v.TextInput,{label:c,description:o,error:s,required:p,value:a||"",onChange:g=>{f(u,g.currentTarget.value)},className:r,disabled:!l,w:"100%"})}),ic=T.memo(function(t){const{className:r,data:n,description:i,enabled:a,errors:o,handleChange:s,label:l,labelPosition:u,path:f,required:c}=t;return d.jsx(v.Checkbox,{label:l,description:i,error:o,disabled:!a,className:r,labelPosition:u,required:c,data:[{label:"true",value:"true"},{label:"false",value:"false"}],value:String(n)||"",onChange:p=>{s(f,p==="true")}})}),bT=e=>d.jsx(nc,{...e}),ac=B.rankWith(3,B.isStringControl),oc=ve.withJsonFormsControlProps(bT),xT=e=>d.jsx(ic,{...e}),sc=B.rankWith(3,B.isBooleanControl),lc=ve.withJsonFormsControlProps(xT),_T=({data:e,options:t,handleChange:r,path:n,...i})=>{const{description:a,errors:o,label:s,required:l,enabled:u}=i;return d.jsx(v.Select,{disabled:!u,data:t,value:e||null,label:s,description:a,required:l,error:o,searchable:!0,onChange:f=>{r(n,f)}})},uc=B.rankWith(5,B.isEnumControl),cc=ve.withJsonFormsEnumProps(ve.withTranslateProps(T.memo(_T)),!1);function TT(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var ET=TT,fc=Gn,ST=qn,wT=Xr,dc=fc?fc.isConcatSpreadable:void 0;function CT(e){return wT(e)||ST(e)||!!(dc&&e&&e[dc])}var OT=CT,AT=ET,PT=OT;function pc(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=PT),i||(i=[]);++a<o;){var s=e[a];t>0&&r(s)?t>1?pc(s,t-1,r,n,i):AT(i,s):n||(i[i.length]=s)}return i}var kT=pc,jT="__lodash_hash_undefined__";function $T(e){return this.__data__.set(e,jT),this}var IT=$T;function RT(e){return this.__data__.has(e)}var MT=RT,DT=Ru,NT=IT,FT=MT;function ii(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new DT;++t<r;)this.add(e[t])}ii.prototype.add=ii.prototype.push=NT,ii.prototype.has=FT;var LT=ii;function zT(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var UT=zT;function BT(e){return e!==e}var VT=BT;function WT(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var HT=WT,GT=UT,qT=VT,YT=HT;function KT(e,t,r){return t===t?YT(e,t,r):GT(e,qT,r)}var XT=KT,JT=XT;function ZT(e,t){var r=e==null?0:e.length;return!!r&&JT(e,t,0)>-1}var QT=ZT;function eE(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var tE=eE;function rE(e,t){return e.has(t)}var nE=rE;function iE(){}var aE=iE;function oE(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var hc=oE,so=lu,sE=aE,lE=hc,uE=1/0,cE=so&&1/lE(new so([,-0]))[1]==uE?function(e){return new so(e)}:sE,fE=cE,dE=LT,pE=QT,hE=tE,mE=nE,gE=fE,yE=hc,vE=200;function bE(e,t,r){var n=-1,i=pE,a=e.length,o=!0,s=[],l=s;if(r)o=!1,i=hE;else if(a>=vE){var u=t?null:gE(e);if(u)return yE(u);o=!1,i=mE,l=new dE}else l=t?[]:s;e:for(;++n<a;){var f=e[n],c=t?t(f):f;if(f=r||f!==0?f:0,o&&c===c){for(var p=l.length;p--;)if(l[p]===c)continue e;t&&l.push(c),s.push(f)}else i(l,c,r)||(l!==s&&l.push(c),s.push(f))}return s}var xE=bE,_E=kT,TE=ec,EE=xE,SE=Uu,wE=TE(function(e){return EE(_E(e,1,SE,!0))}),CE=wE;const OE=Ot(CE);function AE(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}var PE=AE;function kE(e){return function(t){return e==null?void 0:e[t]}}var jE=kE,$E=jE,IE={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},RE=$E(IE),ME=RE;function DE(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var NE=DE,mc=Gn,FE=NE,LE=Xr,zE=Tu,UE=1/0,gc=mc?mc.prototype:void 0,yc=gc?gc.toString:void 0;function vc(e){if(typeof e=="string")return e;if(LE(e))return FE(e,vc)+"";if(zE(e))return yc?yc.call(e):"";var t=e+"";return t=="0"&&1/e==-UE?"-0":t}var BE=vc,VE=BE;function WE(e){return e==null?"":VE(e)}var lo=WE,HE=ME,GE=lo,qE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,YE="\\u0300-\\u036f",KE="\\ufe20-\\ufe2f",XE="\\u20d0-\\u20ff",JE=YE+KE+XE,ZE="["+JE+"]",QE=RegExp(ZE,"g");function eS(e){return e=GE(e),e&&e.replace(qE,HE).replace(QE,"")}var tS=eS,rS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function nS(e){return e.match(rS)||[]}var iS=nS,aS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function oS(e){return aS.test(e)}var sS=oS,bc="\\ud800-\\udfff",lS="\\u0300-\\u036f",uS="\\ufe20-\\ufe2f",cS="\\u20d0-\\u20ff",fS=lS+uS+cS,xc="\\u2700-\\u27bf",_c="a-z\\xdf-\\xf6\\xf8-\\xff",dS="\\xac\\xb1\\xd7\\xf7",pS="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hS="\\u2000-\\u206f",mS=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tc="A-Z\\xc0-\\xd6\\xd8-\\xde",gS="\\ufe0e\\ufe0f",Ec=dS+pS+hS+mS,Sc="['’]",wc="["+Ec+"]",yS="["+fS+"]",Cc="\\d+",vS="["+xc+"]",Oc="["+_c+"]",Ac="[^"+bc+Ec+Cc+xc+_c+Tc+"]",bS="\\ud83c[\\udffb-\\udfff]",xS="(?:"+yS+"|"+bS+")",_S="[^"+bc+"]",Pc="(?:\\ud83c[\\udde6-\\uddff]){2}",kc="[\\ud800-\\udbff][\\udc00-\\udfff]",vr="["+Tc+"]",TS="\\u200d",jc="(?:"+Oc+"|"+Ac+")",ES="(?:"+vr+"|"+Ac+")",$c="(?:"+Sc+"(?:d|ll|m|re|s|t|ve))?",Ic="(?:"+Sc+"(?:D|LL|M|RE|S|T|VE))?",Rc=xS+"?",Mc="["+gS+"]?",SS="(?:"+TS+"(?:"+[_S,Pc,kc].join("|")+")"+Mc+Rc+")*",wS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",CS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",OS=Mc+Rc+SS,AS="(?:"+[vS,Pc,kc].join("|")+")"+OS,PS=RegExp([vr+"?"+Oc+"+"+$c+"(?="+[wc,vr,"$"].join("|")+")",ES+"+"+Ic+"(?="+[wc,vr+jc,"$"].join("|")+")",vr+"?"+jc+"+"+$c,vr+"+"+Ic,CS,wS,Cc,AS].join("|"),"g");function kS(e){return e.match(PS)||[]}var jS=kS,$S=iS,IS=sS,RS=lo,MS=jS;function DS(e,t,r){return e=RS(e),t=r?void 0:t,t===void 0?IS(e)?MS(e):$S(e):e.match(t)||[]}var NS=DS,FS=PE,LS=tS,zS=NS,US="['’]",BS=RegExp(US,"g");function VS(e){return function(t){return FS(zS(LS(t).replace(BS,"")),e,"")}}var WS=VS;function HS(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}var GS=HS,qS=GS;function YS(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:qS(e,t,r)}var KS=YS,XS="\\ud800-\\udfff",JS="\\u0300-\\u036f",ZS="\\ufe20-\\ufe2f",QS="\\u20d0-\\u20ff",ew=JS+ZS+QS,tw="\\ufe0e\\ufe0f",rw="\\u200d",nw=RegExp("["+rw+XS+ew+tw+"]");function iw(e){return nw.test(e)}var Dc=iw;function aw(e){return e.split("")}var ow=aw,Nc="\\ud800-\\udfff",sw="\\u0300-\\u036f",lw="\\ufe20-\\ufe2f",uw="\\u20d0-\\u20ff",cw=sw+lw+uw,fw="\\ufe0e\\ufe0f",dw="["+Nc+"]",uo="["+cw+"]",co="\\ud83c[\\udffb-\\udfff]",pw="(?:"+uo+"|"+co+")",Fc="[^"+Nc+"]",Lc="(?:\\ud83c[\\udde6-\\uddff]){2}",zc="[\\ud800-\\udbff][\\udc00-\\udfff]",hw="\\u200d",Uc=pw+"?",Bc="["+fw+"]?",mw="(?:"+hw+"(?:"+[Fc,Lc,zc].join("|")+")"+Bc+Uc+")*",gw=Bc+Uc+mw,yw="(?:"+[Fc+uo+"?",uo,Lc,zc,dw].join("|")+")",vw=RegExp(co+"(?="+co+")|"+yw+gw,"g");function bw(e){return e.match(vw)||[]}var xw=bw,_w=ow,Tw=Dc,Ew=xw;function Sw(e){return Tw(e)?Ew(e):_w(e)}var ww=Sw,Cw=KS,Ow=Dc,Aw=ww,Pw=lo;function kw(e){return function(t){t=Pw(t);var r=Ow(t)?Aw(t):void 0,n=r?r[0]:t.charAt(0),i=r?Cw(r,1).join(""):t.slice(1);return n[e]()+i}}var jw=kw,$w=jw,Iw=$w("toUpperCase"),Rw=Iw,Mw=WS,Dw=Rw,Nw=Mw(function(e,t,r){return e+(r?" ":"")+Dw(t)}),Fw=Nw;const Lw=Ot(Fw);var zw=Math.ceil,Uw=Math.max;function Bw(e,t,r,n){for(var i=-1,a=Uw(zw((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var Vw=Bw,Ww=wu,Vc=1/0,Hw=17976931348623157e292;function Gw(e){if(!e)return e===0?e:0;if(e=Ww(e),e===Vc||e===-Vc){var t=e<0?-1:1;return t*Hw}return e===e?e:0}var qw=Gw,Yw=Vw,Kw=tc,fo=qw;function Xw(e){return function(t,r,n){return n&&typeof n!="number"&&Kw(t,r,n)&&(r=n=void 0),t=fo(t),r===void 0?(r=t,t=0):r=fo(r),n=n===void 0?t<r?1:-1:fo(n),Yw(t,r,n,e)}}var Jw=Xw,Zw=Jw,Qw=Zw(),eC=Qw;const tC=Ot(eC);function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},he.apply(null,arguments)}function zt(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Wc(e){if(!zt(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Wc(e[r])}),t}function Tt(e,t,r={clone:!0}){const n=r.clone?he({},e):e;return zt(e)&&zt(t)&&Object.keys(t).forEach(i=>{zt(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&zt(e[i])?n[i]=Tt(e[i],t[i],r):r.clone?n[i]=zt(t[i])?Wc(t[i]):t[i]:n[i]=t[i]}),n}const rC=Object.freeze(Object.defineProperty({__proto__:null,default:Tt,isPlainObject:zt},Symbol.toStringTag,{value:"Module"}));function Jr(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;r<arguments.length;r+=1)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}const nC=Object.freeze(Object.defineProperty({__proto__:null,default:Jr},Symbol.toStringTag,{value:"Module"}));var po={exports:{}},fe={};/**
|
|
57
57
|
* @license React
|