@golemui/gui-lit 0.17.0 → 1.0.0-rc.0

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/{abstract-calendar-s67Qu3Nt.js → abstract-calendar-BoqKPRmS.js} +21 -4
  3. package/{accordion.element-ChLmV6QT.js → accordion.element-BIgxl5e9.js} +0 -1
  4. package/{alert.element-9QFlqjj9.js → alert.element-DPWq9-0F.js} +3 -4
  5. package/{button.element-DoQmGWze.js → button.element-3a7rRHbA.js} +0 -1
  6. package/{calendar-aXb9yz-6.js → calendar-DTYKVYc3.js} +2 -2
  7. package/{calendar.element-D7OF4QVV.js → calendar.element-MubSE1bx.js} +11 -12
  8. package/{checkbox.element-DMmer4Jw.js → checkbox.element-CVskoXEc.js} +0 -1
  9. package/{currency.element-ybKzwXEh.js → currency.element-YyL4TeL0.js} +0 -1
  10. package/{date-CG1562vW.js → date-DTYg8sog.js} +12 -13
  11. package/{date-input-5Heujc5X.js → date-input-BeQvyfln.js} +1 -2
  12. package/{date-picker.element-DStQrD4x.js → date-picker.element-DabW_-0-.js} +2 -3
  13. package/{date.element-DymfLrlq.js → date.element-BtVJSIRk.js} +1 -2
  14. package/{dropdown.element-sbd3T145.js → dropdown.element-DqzC6aXR.js} +1 -2
  15. package/{flex.element-B0sG0YT1.js → flex.element-DG4Uaj_X.js} +0 -1
  16. package/{grid.element-Bf5aEjkj.js → grid.element-DCZsh-3J.js} +0 -1
  17. package/index.js +1243 -1210
  18. package/index.umd.cjs +77 -51
  19. package/lib/components/accordion.element.d.ts +1 -1
  20. package/lib/components/alert.element.d.ts +1 -1
  21. package/lib/components/button.element.d.ts +1 -1
  22. package/lib/components/calendar.element.d.ts +1 -1
  23. package/lib/components/checkbox.element.d.ts +1 -1
  24. package/lib/components/currency.element.d.ts +1 -1
  25. package/lib/components/date-picker.element.d.ts +1 -1
  26. package/lib/components/date.element.d.ts +1 -1
  27. package/lib/components/dropdown.element.d.ts +1 -1
  28. package/lib/components/flex.element.d.ts +1 -1
  29. package/lib/components/grid.element.d.ts +1 -1
  30. package/lib/components/list.element.d.ts +1 -1
  31. package/lib/components/markdown-text.element.d.ts +1 -1
  32. package/lib/components/markdown.element.d.ts +1 -1
  33. package/lib/components/number.element.d.ts +1 -1
  34. package/lib/components/password.element.d.ts +1 -1
  35. package/lib/components/radiogroup.element.d.ts +1 -1
  36. package/lib/components/range-calendar.element.d.ts +1 -1
  37. package/lib/components/range-date-input.element.d.ts +1 -1
  38. package/lib/components/range-date-picker.element.d.ts +1 -1
  39. package/lib/components/renderer.element.d.ts +1 -1
  40. package/lib/components/repeater.element.d.ts +1 -1
  41. package/lib/components/select.element.d.ts +1 -1
  42. package/lib/components/tabs.element.d.ts +1 -1
  43. package/lib/components/tags.element.d.ts +1 -1
  44. package/lib/components/textarea.element.d.ts +1 -1
  45. package/lib/components/textinput.element.d.ts +1 -1
  46. package/lib/components/toggle.element.d.ts +1 -1
  47. package/lib/widget.loaders.d.ts +1 -1
  48. package/{list-CVDHuXKS.js → list-D1oKnH89.js} +2 -3
  49. package/{list.element-Bgnx2CN_.js → list.element-Co3V3Cn5.js} +9 -10
  50. package/{markdown-text.element-C_1OqrGa.js → markdown-text.element-B8TfVLIO.js} +0 -1
  51. package/{markdown.element-BiAglcXP.js → markdown.element-CNp4wbg9.js} +0 -1
  52. package/{number.element-DlpxcOBs.js → number.element-B6TsvHMK.js} +10 -3
  53. package/{one-of-DifUsEYY.js → one-of-C0ur6b_n.js} +13 -11
  54. package/package.json +6 -6
  55. package/{password.element-BT65mDsp.js → password.element-n-R9RbkB.js} +0 -1
  56. package/{radiogroup.element-tdHrN9V5.js → radiogroup.element-CeQn623u.js} +5 -6
  57. package/{range-calendar-DUoIqmOA.js → range-calendar-9skwbwlB.js} +2 -3
  58. package/{range-calendar.element-D6FO7HpL.js → range-calendar.element-QTE6vGNP.js} +1 -2
  59. package/{range-date-input-CoFG7Qem.js → range-date-input-Uy8134vi.js} +1 -2
  60. package/{range-date-input.element-Cjl1vZfr.js → range-date-input.element-Dj29D_OQ.js} +1 -2
  61. package/{range-date-picker.element-DqjOBKoT.js → range-date-picker.element-BUUKtKkz.js} +2 -3
  62. package/{renderer.element-DMsheQGi.js → renderer.element-CNyMn2Lu.js} +0 -1
  63. package/{repeater.element-Ry8HyMfW.js → repeater.element-CtNgB4F5.js} +0 -1
  64. package/{select.element-Y9i1tsl-.js → select.element-jcDF1h-g.js} +7 -8
  65. package/{tabs.element-VLrtF1j5.js → tabs.element-BvAyI71N.js} +0 -1
  66. package/{tags.element-B3JP4m0z.js → tags.element-CX3vQL8L.js} +0 -1
  67. package/{textarea.element-BTJLqnnI.js → textarea.element-Cu9ZW3K4.js} +0 -1
  68. package/{textinput.element-zI0iG-Cq.js → textinput.element-CkXNzMUg.js} +0 -1
  69. package/{toggle.element-NXRrhALB.js → toggle.element-C1kCw5H8.js} +9 -10
package/index.umd.cjs CHANGED
@@ -1,13 +1,13 @@
1
- (function(C,Oe){typeof exports=="object"&&typeof module<"u"?Oe(exports,require("@golemui/core"),require("@golemui/gui-shared"),require("@golemui/lit"),require("lit"),require("lit/decorators.js"),require("@lit/context"),require("rxjs"),require("lit/directives/class-map.js"),require("lit-html/directives/repeat.js"),require("lit/directives/live.js"),require("lit-html/directives/style-map.js"),require("lit/directives/if-defined.js"),require("lit/directives/repeat.js"),require("lit/directives/unsafe-html.js")):typeof define=="function"&&define.amd?define(["exports","@golemui/core","@golemui/gui-shared","@golemui/lit","lit","lit/decorators.js","@lit/context","rxjs","lit/directives/class-map.js","lit-html/directives/repeat.js","lit/directives/live.js","lit-html/directives/style-map.js","lit/directives/if-defined.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],Oe):(C=typeof globalThis<"u"?globalThis:C||self,Oe(C["gui-lit"]={},C.core,C.guiShared,C.lit$1,C.lit,C.decorators_js,C.context,C.rxjs,C.classMap_js,C.repeat_js,C.live_js,C.styleMap_js,C.ifDefined_js,C.repeat_js$1,C.unsafeHtml_js))})(this,(function(C,Oe,Ha,y,d,o,b,Ai,$,fe,Ti,He,Gt,Li,Ya){"use strict";const Mi={LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function Ka(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}const Et=new Map;function Ri(e,t){if(Et.has(e))throw new Error(`Item type "${e}" is already registered.`);Et.set(e,t)}function Pt(e){const t=Et.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function zi(e){return Et.has(e)}function S(e){const t=l=>{if(!e.sensibleDefaults)return{};let u={...e.sensibleDefaults.base};for(const p of l){const c=p.config;for(const h of e.sensibleDefaults.fields){const f=h;c[f]!=null&&(u={...u,[f]:c[f]})}}return u},i=(l,u)=>e.sensibleDefaults?e.sensibleDefaults.apply(l,u):l,n=l=>{switch(e.entryShape){case"bare":return{baseDef:l};case"keyed":{const u=l;return{baseDef:u.def,path:u.key}}case"compound":{const u=l;return{baseDef:u.def,children:u.children}}}},a={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};Ri(e.itemType,a);const r=Ka(e.itemType);return{gsl:r,gslByUid:(l,u)=>r(u,(p=>p.uid===l))}}function Ja(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function Y(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Ja(e.path)}}function Pe(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}const Xa=(e,t)=>({type:"ITEMS",itemType:Mi.DISPLAYS,items:[{render:e}],tags:[]}),Fi={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","MARKDOWN_TEXTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Qa(e,t){const i=Fi[e];return i?i.has(t):e===t}class ja{resolve(t,i){const n=[];for(const r of i)r.kind==="aggregated"?this.collectFromAggregated(r,t,n):this.collectFromLeaf(r,t,n);const a=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:a}}collectFromAggregated(t,i,n){if(t.matcher(i))for(const a of t.children)this.collectFromLeaf(a,i,n)}collectFromLeaf(t,i,n){Qa(t.selectorType,i.itemType??"")&&t.matcher(i)&&n.push(t)}rollUpSensibleDefaults(t){const i=new Map,n=(r,s)=>{const l=i.get(r)??[];l.push(s),i.set(r,l)};for(const r of t){const s=Fi[r.selectorType];if(s)for(const l of s)n(l,r);else n(r.selectorType,r)}const a={};for(const[r,s]of i)zi(r)&&(a[r]=Pt(r).rollUpSensibleDefaults(s));return a}}const en=new ja;class tn{deepMerge(t,i){if(i==null)return t;if(t==null||typeof t!="object"||typeof i!="object"||Array.isArray(t)||Array.isArray(i))return i;const n={...t};for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&(typeof i[a]=="object"&&!Array.isArray(i[a])&&i[a]!==null&&typeof t[a]=="object"&&!Array.isArray(t[a])&&t[a]!==null?n[a]=this.deepMerge(t[a],i[a]):n[a]=i[a]);return n}}const an=new tn;class nn{constructor(t){this.objectUtils=t}merge(t,i,n){let a={},r=null;typeof t=="function"&&(r=t);const s=this.collectDecorators(n);for(const p of s){if(r!=null){r=this.composeRuntimeFunctions(r,p);continue}if(typeof p=="function"){const c=p({...a,...typeof t=="function"?{}:t});if(typeof c=="function"){r=this.createPromotedFunction(a,t,c,i,n);continue}a=this.objectUtils.deepMerge(a,c)}else a=this.objectUtils.deepMerge(a,p)}if(r!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(r,a,i,n)};const l=this.objectUtils.deepMerge(t,a);return{kind:"static",def:this.applySensibleDefaults({...l},i,n)}}collectDecorators(t){const i=[];for(const n of t.leafSelectors){const a=n.config;a.override!=null&&i.push(a.override)}return i}applySensibleDefaults(t,i,n){if(!zi(i))return t;const a=n.sensibleDefaults[i]??{};return Pt(i).applySensibleDefaults(t,a)}createPromotedFunction(t,i,n,a,r){return s=>{const l=n(s);let u=this.objectUtils.deepMerge(t,l);return u=this.objectUtils.deepMerge(u,i),this.applySensibleDefaults(u,a,r)}}wrapWithSensibleDefaults(t,i,n,a){return r=>{let s=t(r);return Object.keys(i).length>0&&(s=this.objectUtils.deepMerge(i,s)),this.applySensibleDefaults(s,n,a)}}composeRuntimeFunctions(t,i){return typeof i=="function"?n=>{const a=t(n),r=i(a);return typeof r=="function"?r(n):this.objectUtils.deepMerge(r,a)}:n=>{const a=t(n);return this.objectUtils.deepMerge(a,i)}}}const rn=new nn(an);class sn{mapToWidget(t,i){if(t.kind==="dynamic"){const n=t.fn;return(a=>{const r=n(a);return this.mapStaticDef(r,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const n=Pt(i).mapToWidget(t);return this.applyBaseWidgetFields(n,t)}applyBaseWidgetFields(t,i){return i.size!=null&&(t.size=i.size),i.defaultValue!=null&&t.kind==="input"&&(t.defaultValue=i.defaultValue),i.on!=null&&(t.on=i.on),i.include!=null&&(t.include=i.include),i.exclude!=null&&(t.exclude=i.exclude),t}}const on=new sn;class ln{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],n=[],a=[];for(const r of i)r.kind==="leaf"?a.push(r):n.push(r);return a.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:a}),n}extractFormConfig(){return{suppressAutomaticStack:!1}}}const dn=new ln,Ni={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},un=Object.keys(Ni);class pn{extractOnClickFromMergeResult(t,i,n){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:u=>{const p=s(u);return this.wireOnClick(p,i,n)}}}const a=t.def;return{kind:"static",def:this.wireOnClick(a,i,n)}}wireOnClick(t,i,n){const a=n.next(),r=t.onClick;if(typeof r=="function"){const{onClick:s,...l}=t,u=r(void 0);return typeof u=="string"?{...l,uid:a,on:{click:u}}:(i.set(a,p=>r(p.data)),{...l,uid:a,on:{click:a}})}return{...t,uid:a}}wireInputLayoutEvents(t,i,n){if(t.kind==="dynamic"){const r=t.fn;return{kind:"dynamic",fn:l=>{const u=r(l);return this.wireEventProperties(u,i,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,n)}}wireEventProperties(t,i,n){const a={...t.on||{}};let r=!1;const s={...t};for(const l of un){const u=t[l];if(u==null)continue;const p=Ni[l];if(typeof u=="function"){const c=n.next();i.set(c,u),a[p]=c,r=!0}else typeof u=="string"&&(a[p]=u,r=!0);delete s[l]}return r&&(s.on=a),s}}const Ht=new pn,cn={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},qi={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class hn{extractFromMergeResult(t,i){const n={};for(const l of i){const u=l.targetState,p=l.config,c=p.override&&typeof p.override!="function"?p.override:p;n[u]={...n[u]||{},...c}}if(t.kind==="dynamic"){const l=t.fn;return{cleanedResult:{kind:"dynamic",fn:p=>{const c=l(p),{states:h,...f}=c;return f}},stateData:{stateOverrides:n}}}const{states:a,...r}=t.def,s={};for(const[l,u]of Object.entries(n))s[l]={...u};if(a)for(const[l,u]of Object.entries(a))s[l]={...s[l]||{},...u};return{cleanedResult:{kind:"static",def:r},stateData:{stateOverrides:s}}}applyToWidget(t,i,n,a){const{stateOverrides:r}=i;if(Object.keys(r).length===0)return t;const s={...t},l=t.kind,u=cn[l]||new Set;t.props&&(s.props={...t.props}),t.on&&(s.on={...t.on});for(const[p,c]of Object.entries(r))for(const[h,f]of Object.entries(c))h==="visible"?this.applyVisibility(s,p,f):qi[h]?this.applyStateEvent(s,p,h,f,n,a):u.has(h)?s[`${h}.${p}`]=f:(s.props||(s.props={}),s.props[`${h}.${p}`]=f);return s}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,n){if(n){const a=t.include?.in||[];t.include={...t.include||{},in:[...a,i]}}else{const a=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...a,i]}}}applyStateEvent(t,i,n,a,r,s){const l=qi[n];if(t.on||(t.on={}),typeof a=="function"){const u=s.next();r.set(u,a),t.on[`${l}.${i}`]=u}else typeof a=="string"&&(t.on[`${l}.${i}`]=a)}}const mn=new hn;function yn(){let e=0;return{next:()=>`event_${e++}`}}class fn{constructor(t,i,n,a,r){this.resolver=t,this.merger=i,this.mapper=n,this.eventWiring=a,this.stateExpansion=r}walkAndMap(t,i,n){const a=new Map,r=yn(),s={value:0},l=new Set;return{widgets:this.walkItems(t,i,a,n,r,s,l),eventRegistry:a}}walkItems(t,i,n,a,r,s,l){return t.flatMap(u=>{if(u.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return u.items.map(p=>this.processItem(p,u.itemType,u.tags,i,n,a,r,s,l))})}processItem(t,i,n,a,r,s,l,u,p){const c=i,h=Pt(i),f=h.parseEntry(t),g=this.buildBaseDef(f),k=this.buildDecoratorForMatching(g,c,n),I=this.resolver.resolve(k,a),Ua=I.leafSelectors.filter(ue=>ue.targetState!=null),Wa={leafSelectors:I.leafSelectors.filter(ue=>ue.targetState==null),sensibleDefaults:I.sensibleDefaults};let Ge=this.merger.merge(g,c,Wa);h.afterMerge&&(Ge=h.afterMerge(Ge,{eventRegistry:r,formConfig:s,eventIdGenerator:l})),Ge=this.eventWiring.wireInputLayoutEvents(Ge,r,l);const{cleanedResult:Ga,stateData:Ii}=this.stateExpansion.extractFromMergeResult(Ge,Ua);let Ee;if(h.buildCustomWidget){const ue=this.buildCustomWidgetContext(f.children,a,r,s,l,u,p);Ee=this.buildCustomWidget(h,Ga,ue)}else Ee=this.mapper.mapToWidget(Ga,c);if(typeof Ee!="function"){const ue=Ee;ue.uid||(ue.path&&!p.has(ue.path)?(ue.uid=ue.path,p.add(ue.path)):ue.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(Ii))if(typeof Ee=="function"){const ue=Ee;Ee=(rp=>{const sp=ue(rp);return this.stateExpansion.applyToWidget(sp,Ii,r,l)})}else Ee=this.stateExpansion.applyToWidget(Ee,Ii,r,l);return Ee}buildCustomWidgetContext(t,i,n,a,r,s,l){return{children:t,mapStaticDef:(u,p)=>this.mapper.mapStaticDef(u,p),walkChildren:u=>this.walkItems(u,i,n,a,r,s,l)}}buildCustomWidget(t,i,n){return t.buildCustomWidget(i,n)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?n=>{const r=i(n??{});return t.path!=null?{...r,path:t.path}:r}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,n){if(typeof t=="function")return{itemType:i,tags:[...n]};const a=[...n,..."tags"in t&&t.tags?t.tags:[]],r="uid"in t?t.uid:void 0,s="type"in t?t.type:void 0;return{itemType:i,tags:a,uid:r,type:s}}}function W(e){const{uid:t,path:i,label:n,disabled:a,readonly:r,defaultValue:s,tags:l,type:u,size:p,onLoad:c,onChange:h,onFilter:f,on:g,states:k,include:I,exclude:Ua,validator:Wa,...Ge}=e;return Ge}function ae(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function gn(e){switch(e.type){case"text":return Dn(e);case"number":return vn(e);case"boolean":return bn(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function bn(e){const t=W(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"boolean")}:{},props:t}}function Dn(e){const t=W(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:ae(e.validator,"string")}}function vn(e){const t=W(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:ae(e.validator,"number")}}S({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=Y(e,t);return i=Pe(i,t),i}},mapToWidget:gn});function wn(e){const{uid:t,label:i,actionType:n,disabled:a,on:r,onClick:s,data:l,type:u,tags:p,size:c,include:h,exclude:f,states:g,...k}=e;return{uid:t??"",kind:"action",type:"button",disabled:a,actionType:n,label:i,...r!=null?{on:r}:{},props:k}}S({itemType:"ACTIONS",entryShape:"bare",mapToWidget:wn,afterMerge:(e,t)=>Ht.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function $n(e){const{uid:t,widgetName:i,tags:n,size:a,onChange:r,include:s,exclude:l,...u}=e,{on:p,...c}=u;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:c.direction??"column",...c},children:[]}}function kn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"LAYOUTS"),children:i}})}function _n(e){return e.children}S({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:$n,buildCustomWidget:kn,getChildren:_n});function Cn(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function Sn(e,t){if(e.kind==="static"){const n=e.def;return(a=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(a??{})}}))}const i=e.fn;return(n=>{const a=i(n);return{uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(n??{})}}})}S({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:Cn,buildCustomWidget:Sn}),S({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"boolean")}:{},props:W(e)})}),S({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"number")}:{},props:W(e)})}),S({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"array")}:{},props:W(e)})}),S({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:W(e)})}),S({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:W(e)})});function On(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function xn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"TABS"),children:i}})}function En(e){return e.children}S({itemType:"TABS",entryShape:"compound",mapToWidget:On,buildCustomWidget:xn,getChildren:En}),S({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:W(e)})}),S({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),S({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:W(e)})});function Pn(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function In(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"ACCORDION"),children:i}})}function An(e){return e.children}S({itemType:"ACCORDION",entryShape:"compound",mapToWidget:Pn,buildCustomWidget:In,getChildren:An});function Tn(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function Ln(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"array")}:{},props:{...Tn(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Yt(e,t){for(const i of e){if(typeof i=="function")continue;const n=i;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&Yt(n.children,t);const a=n.props;a?.template?.children&&Array.isArray(a.template.children)&&Yt(a.template.children,t)}}function Mn(e,t){const i=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&Yt(i,n+".items.");const a={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const s=t.mapStaticDef(e.def,"REPEATER");return{...s,props:{...s.props,template:a}}}const r=e.fn;return(s=>{const l=r(s),u=t.mapStaticDef(l,"REPEATER");return{...u,props:{...u.props,template:a}}})}function Rn(e){return{baseDef:e.def,path:e.key,children:e.children}}function zn(e){return e.children}Ri("REPEATER",{parseEntry:Rn,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Ln,buildCustomWidget:Mn,getChildren:zn}),S({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"array")}:{},props:W(e)})}),S({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ae(e.validator,"array")}:{},props:W(e)})}),S({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})}),S({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),S({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:n,on:a,onClick:r,data:s,customType:l,tags:u,size:p,include:c,exclude:h,states:f,props:g,...k}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:n,...a!=null?{on:a}:{},props:{...g,...k}}},afterMerge:(e,t)=>Ht.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function Fn(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function Nn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"CUSTOM_LAYOUT"),children:i}})}function qn(e){return e.children}S({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:Fn,buildCustomWidget:Nn,getChildren:qn});class Bn{constructor(t,i){this.selectorNormalizer=t,this.walker=i}processDxFacade(t,i=[],n){const{defs:a,gslSelectors:r,formConfig:s}=this.prepareForm(t,i,n),{widgets:l,eventRegistry:u}=this.walker.walkAndMap(a,r,s),p=l[0];return this.buildResult({form:p},u,s)}prepareForm(t,i,n){const r=(Array.isArray(t)?[...t]:[t]).map(u=>typeof u=="function"?Xa(u):u),s=this.selectorNormalizer.normalizeSelectors(i),l={...this.selectorNormalizer.extractFormConfig(),...n};if(!l.suppressAutomaticStack){const u={def:{uid:"#root",direction:"column",widgetName:"flex"},children:r};return{defs:[{type:"ITEMS",itemType:Mi.LAYOUTS,items:[u],tags:[]}],gslSelectors:s,formConfig:l}}return{defs:r,gslSelectors:s,formConfig:l}}convertStateNames(t){const i={};for(const[n,a]of Object.entries(t))i[n.replace(/\$/g,":")]=a;return i}buildResult(t,i,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const a={form:t};return i.size>0&&(a.events=r=>{const s=i.get(r.name);if(s){const l=p=>{if(p&&typeof p=="object"&&"path"in p&&!("type"in p)){const{path:c,...h}=p;for(const[f,g]of Object.entries(h))r.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:c,prop:f,value:g}})}else r.callback(p)},u={...r,callback:l,update:l};s(u)}}),n.dependencies&&(a.dependencies=n.dependencies),n.widgetLoaders&&(a.widgetLoaders=n.widgetLoaders),n.validateOn&&(a.validateOn=n.validateOn),n.itemRenderers&&(a.itemRenderers=n.itemRenderers),a}}const Zn=new fn(en,rn,on,Ht,mn),Vn=new Bn(dn,Zn);function Un(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(Bi):Bi(e)}function Bi(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}const Zi=Object.freeze({}),Wn=Object.freeze({}),Vi=new WeakMap;function Kt(e,t){return e==null?t:typeof e=="object"?e:{}}function Gn(e,t,i){if(!Un(e))return{formDef:e};const n=Kt(e,Zi),a=Kt(t,Zi),r=Kt(i,Wn);let s=Vi.get(n);s||(s=new WeakMap,Vi.set(n,s));let l=s.get(a);l||(l=new WeakMap,s.set(a,l));const u=l.get(r);if(u)return u;const p=Vn.processDxFacade(e,t,i),c={formDef:p.form,formEvent:p.events,dependencies:p.dependencies,widgetLoaders:p.widgetLoaders,validateOn:p.validateOn,itemRenderers:p.itemRenderers};return l.set(r,c),c}function Hn(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const i=t();return Object.defineProperty(e,"__rid",{value:i,enumerable:!1,configurable:!1}),i}function m(e,t,i){function n(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,u);const p=s.prototype,c=Object.keys(p);for(let h=0;h<c.length;h++){const f=c[h];f in l||(l[f]=p[f].bind(l))}}const a=i?.Parent??Object;class r extends a{}Object.defineProperty(r,"name",{value:e});function s(l){var u;const p=i?.Parent?new r:this;n(p,l),(u=p._zod).deferred??(u.deferred=[]);for(const c of p._zod.deferred)c();return p}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:l=>i?.Parent&&l instanceof i.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Ye extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ui extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Yn={};function Fe(e){return Yn}function Jt(e,t){return typeof t=="bigint"?t.toString():t}function Xt(e){return e==null}function Qt(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const Wi=Symbol("evaluating");function _(e,t,i){let n;Object.defineProperty(e,t,{get(){if(n!==Wi)return n===void 0&&(n=Wi,n=i()),n},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function Kn(...e){const t={};for(const i of e){const n=Object.getOwnPropertyDescriptors(i);Object.assign(t,n)}return Object.defineProperties({},t)}function Jn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Gi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Hi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jt(e){if(Hi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(Hi(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Yi(e){return jt(e)?{...e}:Array.isArray(e)?[...e]:e}function ei(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ki(e,t,i){const n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}function v(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const Xn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ke(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Qn(e,t){return t.map(i=>{var n;return(n=i).path??(n.path=[]),i.path.unshift(e),i})}function It(e){return typeof e=="string"?e:e?.message}function Ne(e,t,i){const n={...e,path:e.path??[]};if(!e.message){const a=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(i.customError?.(e))??It(i.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ti(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function tt(...e){const[t,i,n]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:n}:{...t}}const Ji=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Jt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xi=m("$ZodError",Ji),At=m("$ZodError",Ji,{Parent:Error});function jn(e,t=i=>i.message){const i={},n=[];for(const a of e.issues)a.path.length>0?(i[a.path[0]]=i[a.path[0]]||[],i[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:i}}function er(e,t=i=>i.message){const i={_errors:[]},n=a=>{for(const r of a.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(s=>n({issues:s}));else if(r.code==="invalid_key")n({issues:r.issues});else if(r.code==="invalid_element")n({issues:r.issues});else if(r.path.length===0)i._errors.push(t(r));else{let s=i,l=0;for(;l<r.path.length;){const u=r.path[l];l===r.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(t(r))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(e),i}const Tt=e=>(t,i,n,a)=>{const r=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new Ye;if(s.issues.length){const l=new(a?.Err??e)(s.issues.map(u=>Ne(u,r,Fe())));throw Gi(l,a?.callee),l}return s.value},tr=Tt(At),Lt=e=>async(t,i,n,a)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const l=new(a?.Err??e)(s.issues.map(u=>Ne(u,r,Fe())));throw Gi(l,a?.callee),l}return s.value},ir=Lt(At),Mt=e=>(t,i,n)=>{const a=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:i,issues:[]},a);if(r instanceof Promise)throw new Ye;return r.issues.length?{success:!1,error:new(e??Xi)(r.issues.map(s=>Ne(s,a,Fe())))}:{success:!0,data:r.value}},Qi=Mt(At),Rt=e=>async(t,i,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let r=t._zod.run({value:i,issues:[]},a);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(s=>Ne(s,a,Fe())))}:{success:!0,data:r.value}},ji=Rt(At),ar=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Tt(e)(t,i,a)},nr=e=>(t,i,n)=>Tt(e)(t,i,n),rr=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Lt(e)(t,i,a)},sr=e=>async(t,i,n)=>Lt(e)(t,i,n),or=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Mt(e)(t,i,a)},lr=e=>(t,i,n)=>Mt(e)(t,i,n),dr=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Rt(e)(t,i,a)},ur=e=>async(t,i,n)=>Rt(e)(t,i,n),pr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ea=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,cr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,yr=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ta="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",fr=new RegExp(`^${ta}$`);function ia(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gr(e){return new RegExp(`^${ia(e)}$`)}function br(e){const t=ia({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${i.join("|")})`;return new RegExp(`^${ta}T(?:${n})$`)}const Dr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},vr=/^-?\d+$/,wr=/^-?\d+(?:\.\d+)?$/,$r=/^(?:true|false)$/i,kr=/^[^A-Z]*$/,_r=/^[^a-z]*$/,ge=m("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),aa={number:"number",bigint:"bigint",object:"date"},Cr=m("$ZodCheckLessThan",(e,t)=>{ge.init(e,t);const i=aa[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,r=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sr=m("$ZodCheckGreaterThan",(e,t)=>{ge.init(e,t);const i=aa[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,r=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Or=m("$ZodCheckNumberFormat",(e,t)=>{ge.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),n=i?"int":"number",[a,r]=Xn[t.format];e._zod.onattach.push(s=>{const l=s._zod.bag;l.format=t.format,l.minimum=a,l.maximum=r,i&&(l.pattern=vr)}),e._zod.check=s=>{const l=s.value;if(i){if(!Number.isInteger(l)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?s.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<a&&s.issues.push({origin:"number",input:l,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),l>r&&s.issues.push({origin:"number",input:l,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),xr=m("$ZodCheckMaxLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const s=ti(a);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Er=m("$ZodCheckMinLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const s=ti(a);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Pr=m("$ZodCheckLengthEquals",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=n=>{const a=n.value,r=a.length;if(r===t.length)return;const s=ti(a),l=r>t.length;n.issues.push({origin:s,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),zt=m("$ZodCheckStringFormat",(e,t)=>{var i,n;ge.init(e,t),e._zod.onattach.push(a=>{const r=a._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ir=m("$ZodCheckRegex",(e,t)=>{zt.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ar=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=kr),zt.init(e,t)}),Tr=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_r),zt.init(e,t)}),Lr=m("$ZodCheckIncludes",(e,t)=>{ge.init(e,t);const i=ei(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=n,e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),Mr=m("$ZodCheckStartsWith",(e,t)=>{ge.init(e,t);const i=new RegExp(`^${ei(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Rr=m("$ZodCheckEndsWith",(e,t)=>{ge.init(e,t);const i=new RegExp(`.*${ei(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),zr=m("$ZodCheckOverwrite",(e,t)=>{ge.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),Fr={major:4,minor:3,patch:6},z=m("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fr;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const a of n)for(const r of a._zod.onattach)r(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const a=(s,l,u)=>{let p=Ke(s),c;for(const h of l){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(p)continue;const f=s.issues.length,g=h._zod.check(s);if(g instanceof Promise&&u?.async===!1)throw new Ye;if(c||g instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await g,s.issues.length!==f&&(p||(p=Ke(s,f)))});else{if(s.issues.length===f)continue;p||(p=Ke(s,f))}}return c?c.then(()=>s):s},r=(s,l,u)=>{if(Ke(s))return s.aborted=!0,s;const p=a(l,n,u);if(p instanceof Promise){if(u.async===!1)throw new Ye;return p.then(c=>e._zod.parse(c,u))}return e._zod.parse(p,u)};e._zod.run=(s,l)=>{if(l.skipChecks)return e._zod.parse(s,l);if(l.direction==="backward"){const p=e._zod.parse({value:s.value,issues:[]},{...l,skipChecks:!0});return p instanceof Promise?p.then(c=>r(c,s,l)):r(p,s,l)}const u=e._zod.parse(s,l);if(u instanceof Promise){if(l.async===!1)throw new Ye;return u.then(p=>a(p,n,l))}return a(u,n,l)}}_(e,"~standard",()=>({validate:a=>{try{const r=Qi(e,a);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return ji(e,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),ii=m("$ZodString",(e,t)=>{z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Dr(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),De=m("$ZodStringFormat",(e,t)=>{zt.init(e,t),ii.init(e,t)}),Nr=m("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ea(n))}else t.pattern??(t.pattern=ea());De.init(e,t)}),qr=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cr),De.init(e,t)}),Br=m("$ZodURL",(e,t)=>{De.init(e,t),e._zod.check=i=>{try{const n=i.value.trim(),a=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=a.href:i.value=n;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),Zr=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=br(t)),De.init(e,t)}),Vr=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fr),De.init(e,t)}),Ur=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=gr(t)),De.init(e,t)}),Wr=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=pr),De.init(e,t)}),Gr=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hr),De.init(e,t),e._zod.bag.format="ipv4"}),Hr=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mr),De.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),Yr=m("$ZodCustomStringFormat",(e,t)=>{De.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),na=m("$ZodNumber",(e,t)=>{z.init(e,t),e._zod.pattern=e._zod.bag.pattern??wr,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const a=i.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return i;const r=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...r?{received:r}:{}}),i}}),Kr=m("$ZodNumberFormat",(e,t)=>{Or.init(e,t),na.init(e,t)}),Jr=m("$ZodBoolean",(e,t)=>{z.init(e,t),e._zod.pattern=$r,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=!!i.value}catch{}const a=i.value;return typeof a=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),i}}),Xr=m("$ZodAny",(e,t)=>{z.init(e,t),e._zod.parse=i=>i});function ra(e,t,i){e.issues.length&&t.issues.push(...Qn(i,e.issues)),t.value[i]=e.value}const sa=m("$ZodArray",(e,t)=>{z.init(e,t),e._zod.parse=(i,n)=>{const a=i.value;if(!Array.isArray(a))return i.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),i;i.value=Array(a.length);const r=[];for(let s=0;s<a.length;s++){const l=a[s],u=t.element._zod.run({value:l,issues:[]},n);u instanceof Promise?r.push(u.then(p=>ra(p,i,s))):ra(u,i,s)}return r.length?Promise.all(r).then(()=>i):i}});function oa(e,t,i,n){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const a=e.filter(r=>!Ke(r));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(r=>r.issues.map(s=>Ne(s,n,Fe())))}),t)}const Qr=m("$ZodUnion",(e,t)=>{z.init(e,t),_(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),_(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),_(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),_(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${a.map(r=>Qt(r.source)).join("|")})$`)}});const i=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(a,r)=>{if(i)return n(a,r);let s=!1;const l=[];for(const u of t.options){const p=u._zod.run({value:a.value,issues:[]},r);if(p instanceof Promise)l.push(p),s=!0;else{if(p.issues.length===0)return p;l.push(p)}}return s?Promise.all(l).then(u=>oa(u,a,e,r)):oa(l,a,e,r)}}),jr=m("$ZodIntersection",(e,t)=>{z.init(e,t),e._zod.parse=(i,n)=>{const a=i.value,r=t.left._zod.run({value:a,issues:[]},n),s=t.right._zod.run({value:a,issues:[]},n);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then(([u,p])=>la(i,u,p)):la(i,r,s)}});function ai(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(jt(e)&&jt(t)){const i=Object.keys(t),n=Object.keys(e).filter(r=>i.indexOf(r)!==-1),a={...e,...t};for(const r of n){const s=ai(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};a[r]=s.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let n=0;n<e.length;n++){const a=e[n],r=t[n],s=ai(a,r);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};i.push(s.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function la(e,t,i){const n=new Map;let a;for(const l of t.issues)if(l.code==="unrecognized_keys"){a??(a=l);for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(l);for(const l of i.issues)if(l.code==="unrecognized_keys")for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(l);const r=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(r.length&&a&&e.issues.push({...a,keys:r}),Ke(e))return e;const s=ai(t.value,i.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const es=m("$ZodTransform",(e,t)=>{z.init(e,t),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ui(e.constructor.name);const a=t.transform(i.value,i);if(n.async)return(a instanceof Promise?a:Promise.resolve(a)).then(s=>(i.value=s,i));if(a instanceof Promise)throw new Ye;return i.value=a,i}});function da(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ni=m("$ZodOptional",(e,t)=>{z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qt(i.source)})?$`):void 0}),e._zod.parse=(i,n)=>{if(t.innerType._zod.optin==="optional"){const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>da(r,i.value)):da(a,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,n)}}),ts=m("$ZodExactOptional",(e,t)=>{ni.init(e,t),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,n)=>t.innerType._zod.run(i,n)}),is=m("$ZodNullable",(e,t)=>{z.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qt(i.source)}|null)$`):void 0}),_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,n)=>i.value===null?i:t.innerType._zod.run(i,n)}),as=m("$ZodDefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);if(i.value===void 0)return i.value=t.defaultValue,i;const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>ua(r,t)):ua(a,t)}});function ua(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ns=m("$ZodPrefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>(n.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,n))}),rs=m("$ZodNonOptional",(e,t)=>{z.init(e,t),_(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(n=>n!==void 0)):void 0}),e._zod.parse=(i,n)=>{const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>pa(r,e)):pa(a,e)}});function pa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ss=m("$ZodCatch",(e,t)=>{z.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(s=>Ne(s,n,Fe()))},input:i.value}),i.issues=[]),i)):(i.value=a.value,a.issues.length&&(i.value=t.catchValue({...i,error:{issues:a.issues.map(r=>Ne(r,n,Fe()))},input:i.value}),i.issues=[]),i)}}),os=m("$ZodPipe",(e,t)=>{z.init(e,t),_(e._zod,"values",()=>t.in._zod.values),_(e._zod,"optin",()=>t.in._zod.optin),_(e._zod,"optout",()=>t.out._zod.optout),_(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,n)=>{if(n.direction==="backward"){const r=t.out._zod.run(i,n);return r instanceof Promise?r.then(s=>Ft(s,t.in,n)):Ft(r,t.in,n)}const a=t.in._zod.run(i,n);return a instanceof Promise?a.then(r=>Ft(r,t.out,n)):Ft(a,t.out,n)}});function Ft(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const ls=m("$ZodReadonly",(e,t)=>{z.init(e,t),_(e._zod,"propValues",()=>t.innerType._zod.propValues),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"optin",()=>t.innerType?._zod?.optin),_(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(ca):ca(a)}});function ca(e){return e.value=Object.freeze(e.value),e}const ha=m("$ZodCustom",(e,t)=>{ge.init(e,t),z.init(e,t),e._zod.parse=(i,n)=>i,e._zod.check=i=>{const n=i.value,a=t.fn(n);if(a instanceof Promise)return a.then(r=>ma(r,i,n,e));ma(a,i,n,e)}});function ma(e,t,i,n){if(!e){const a={code:"custom",input:i,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(a.params=n._zod.def.params),t.issues.push(tt(a))}}var ya;class ds{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const n=i[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const n={...this.get(i)??{}};delete n.id;const a={...n,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function us(){return new ds}(ya=globalThis).__zod_globalRegistry??(ya.__zod_globalRegistry=us());const it=globalThis.__zod_globalRegistry;function ps(e,t){return new e({type:"string",...v(t)})}function cs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function ms(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function ys(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function fs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function gs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function bs(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function Ds(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function vs(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function ws(e,t){return new e({type:"number",checks:[],...v(t)})}function $s(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function ks(e,t){return new e({type:"boolean",...v(t)})}function _s(e){return new e({type:"any"})}function Cs(e,t){return new Cr({check:"less_than",...v(t),value:e,inclusive:!0})}function Ss(e,t){return new Sr({check:"greater_than",...v(t),value:e,inclusive:!0})}function Nt(e,t){return new xr({check:"max_length",...v(t),maximum:e})}function Je(e,t){return new Er({check:"min_length",...v(t),minimum:e})}function fa(e,t){return new Pr({check:"length_equals",...v(t),length:e})}function ga(e,t){return new Ir({check:"string_format",format:"regex",...v(t),pattern:e})}function Os(e){return new Ar({check:"string_format",format:"lowercase",...v(e)})}function xs(e){return new Tr({check:"string_format",format:"uppercase",...v(e)})}function Es(e,t){return new Lr({check:"string_format",format:"includes",...v(t),includes:e})}function Ps(e,t){return new Mr({check:"string_format",format:"starts_with",...v(t),prefix:e})}function Is(e,t){return new Rr({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Xe(e){return new zr({check:"overwrite",tx:e})}function As(e){return Xe(t=>t.normalize(e))}function Ts(){return Xe(e=>e.trim())}function Ls(){return Xe(e=>e.toLowerCase())}function Ms(){return Xe(e=>e.toUpperCase())}function Rs(){return Xe(e=>Jn(e))}function zs(e,t,i){return new e({type:"array",element:t,...v(i)})}function ba(e,t,i){return new e({type:"custom",check:"custom",fn:t,...v(i)})}function Da(e){const t=Fs(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(tt(n,i.value,t._zod.def));else{const a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=i.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),i.issues.push(tt(a))}},e(i.value,i)));return t}function Fs(e,t){const i=new ge({check:"custom",...v(t)});return i._zod.check=e,i}function Ns(e,t,i,n={}){const a=v(n),r={...v(n),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:l=>i.test(l),...a};return i instanceof RegExp&&(r.pattern=i),new e(r)}function va(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??it,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ne(e,t,i={path:[],schemaPath:[]}){var n;const a=e._zod.def,r=t.seen.get(e);if(r)return r.count++,i.schemaPath.includes(e)&&(r.cycle=i.path),r.schema;const s={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,s);const l=e._zod.toJSONSchema?.();if(l)s.schema=l;else{const c={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,c);else{const f=s.schema,g=t.processors[a.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);g(e,t,f,c)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),ne(h,t,c),t.seen.get(h).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&re(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function wa(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const s of e.seen.entries()){const l=e.metadataRegistry.get(s[0])?.id;if(l){const u=n.get(l);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,s[0])}}const a=s=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(s[0])?.id,f=e.external.uri??(k=>k);if(h)return{ref:f(h)};const g=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=g,{defId:g,ref:`${f("__shared")}#/${l}/${g}`}}if(s[1]===i)return{ref:"#"};const p=`#/${l}/`,c=s[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:p+c}},r=s=>{if(s[1].schema.$ref)return;const l=s[1],{ref:u,defId:p}=a(s);l.def={...l.schema},p&&(l.defId=p);const c=l.schema;for(const h in c)delete c[h];c.$ref=u};if(e.cycles==="throw")for(const s of e.seen.entries()){const l=s[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
1
+ (function(S,Oe){typeof exports=="object"&&typeof module<"u"?Oe(exports,require("@golemui/core"),require("@golemui/gui-shared"),require("@golemui/lit"),require("lit"),require("lit/decorators.js"),require("@lit/context"),require("rxjs"),require("lit/directives/class-map.js"),require("lit-html/directives/repeat.js"),require("lit/directives/live.js"),require("lit-html/directives/style-map.js"),require("lit/directives/if-defined.js"),require("lit/directives/repeat.js"),require("lit/directives/unsafe-html.js")):typeof define=="function"&&define.amd?define(["exports","@golemui/core","@golemui/gui-shared","@golemui/lit","lit","lit/decorators.js","@lit/context","rxjs","lit/directives/class-map.js","lit-html/directives/repeat.js","lit/directives/live.js","lit-html/directives/style-map.js","lit/directives/if-defined.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],Oe):(S=typeof globalThis<"u"?globalThis:S||self,Oe(S["gui-lit"]={},S.core,null,S.lit$1,S.lit,S.decorators_js,S.context,S.rxjs,S.classMap_js,S.repeat_js,S.live_js,S.styleMap_js,S.ifDefined_js,S.repeat_js$1,S.unsafeHtml_js))})(this,(function(S,Oe,op,y,d,o,b,Ai,$,fe,Ti,He,Gt,Li,Ha){"use strict";const Mi={LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function Ya(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}function ee(e,t){return typeof e=="function"?e:{type:t,...e??{}}}const Ka=(e,t)=>({type:"ITEMS",itemType:Mi.DISPLAYS,items:[{render:e}],tags:t??[]}),Et=new Map;function Ri(e,t){if(Et.has(e))throw new Error(`Item type "${e}" is already registered.`);Et.set(e,t)}function Pt(e){const t=Et.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function zi(e){return Et.has(e)}function _(e){const t=l=>{if(!e.sensibleDefaults)return{};let u={...e.sensibleDefaults.base};for(const p of l){const c=p.config;for(const h of e.sensibleDefaults.fields){const f=h;c[f]!=null&&(u={...u,[f]:c[f]})}}return u},i=(l,u)=>e.sensibleDefaults?e.sensibleDefaults.apply(l,u):l,n=l=>{switch(e.entryShape){case"bare":return{baseDef:l};case"keyed":{const u=l;return{baseDef:u.def,path:u.key}}case"compound":{const u=l;return{baseDef:u.def,children:u.children}}}},a={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};Ri(e.itemType,a);const r=Ya(e.itemType);return{gsl:r,gslByUid:(l,u)=>r(u,(p=>p.uid===l))}}function z(e){const{uid:t,path:i,label:n,disabled:a,readonly:r,defaultValue:s,tags:l,type:u,size:p,onLoad:c,onChange:h,onFilter:f,on:g,states:k,include:I,exclude:Ua,validator:Wa,...Ge}=e;return Ge}function Ja(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function G(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Ja(e.path)}}function xe(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function Xa(e){switch(e.type){case"text":return ja(e);case"number":return en(e);case"boolean":return Qa(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Qa(e){const t=z(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"boolean")}:{},props:t}}function ja(e){const t=z(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:ee(e.validator,"string")}}function en(e){const t=z(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:ee(e.validator,"number")}}_({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=G(e,t);return i=xe(i,t),i}},mapToWidget:Xa}),_({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),_({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),_({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),_({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"boolean")}:{},props:z(e)})}),_({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"string")}:{},props:z(e)})}),_({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"string")}:{},props:z(e)})}),_({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"number")}:{},props:z(e)})}),_({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"string")}:{},props:z(e)})}),_({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),_({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"string")}:{},props:z(e)})}),_({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"string")}:{},props:z(e)})}),_({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"string")}:{},props:z(e)})}),_({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"array")}:{},props:z(e)})}),_({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"array")}:{},props:z(e)})}),_({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"array")}:{},props:z(e)})});function tn(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function an(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"array")}:{},props:{...tn(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Ht(e,t){for(const i of e){if(typeof i=="function")continue;const n=i;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&Ht(n.children,t);const a=n.props;a?.template?.children&&Array.isArray(a.template.children)&&Ht(a.template.children,t)}}function nn(e,t){const i=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&Ht(i,n+".items.");const a={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const s=t.mapStaticDef(e.def,"REPEATER");return{...s,props:{...s.props,template:a}}}const r=e.fn;return(s=>{const l=r(s),u=t.mapStaticDef(l,"REPEATER");return{...u,props:{...u.props,template:a}}})}function rn(e){return{baseDef:e.def,path:e.key,children:e.children}}function sn(e){return e.children}Ri("REPEATER",{parseEntry:rn,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:an,buildCustomWidget:nn,getChildren:sn});const Fi={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},on=Object.keys(Fi);class ln{extractOnClickFromMergeResult(t,i,n){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:u=>{const p=s(u);return this.wireOnClick(p,i,n)}}}const a=t.def;return{kind:"static",def:this.wireOnClick(a,i,n)}}wireOnClick(t,i,n){const a=n.next(),r=t.onClick;if(typeof r=="function"){const{onClick:s,...l}=t,u=r(void 0);return typeof u=="string"?{...l,uid:a,on:{click:u}}:(i.set(a,p=>r(p.data)),{...l,uid:a,on:{click:a}})}return{...t,uid:a}}wireInputLayoutEvents(t,i,n){if(t.kind==="dynamic"){const r=t.fn;return{kind:"dynamic",fn:l=>{const u=r(l);return this.wireEventProperties(u,i,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,n)}}wireEventProperties(t,i,n){const a={...t.on||{}};let r=!1;const s={...t};for(const l of on){const u=t[l];if(u==null)continue;const p=Fi[l];if(typeof u=="function"){const c=n.next();i.set(c,u),a[p]=c,r=!0}else typeof u=="string"&&(a[p]=u,r=!0);delete s[l]}return r&&(s.on=a),s}}const Yt=new ln;function dn(e){const{uid:t,label:i,actionType:n,disabled:a,on:r,onClick:s,data:l,type:u,tags:p,size:c,include:h,exclude:f,states:g,...k}=e;return{uid:t??"",kind:"action",type:"button",disabled:a,actionType:n,label:i,...r!=null?{on:r}:{},props:k}}_({itemType:"ACTIONS",entryShape:"bare",mapToWidget:dn,afterMerge:(e,t)=>Yt.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function un(e){const{uid:t,widgetName:i,tags:n,size:a,onChange:r,include:s,exclude:l,...u}=e,{on:p,...c}=u;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:c.direction??"column",...c},children:[]}}function pn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"LAYOUTS"),children:i}})}function cn(e){return e.children}_({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:un,buildCustomWidget:pn,getChildren:cn});function hn(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function mn(e,t){if(e.kind==="static"){const n=e.def;return(a=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(a??{})}}))}const i=e.fn;return(n=>{const a=i(n);return{uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(n??{})}}})}_({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:hn,buildCustomWidget:mn}),_({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),_({itemType:"MARKDOWN_TEXTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})});function yn(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function fn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"TABS"),children:i}})}function gn(e){return e.children}_({itemType:"TABS",entryShape:"compound",mapToWidget:yn,buildCustomWidget:fn,getChildren:gn});function bn(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function Dn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"ACCORDION"),children:i}})}function vn(e){return e.children}_({itemType:"ACCORDION",entryShape:"compound",mapToWidget:bn,buildCustomWidget:Dn,getChildren:vn}),_({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),_({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:n,on:a,onClick:r,data:s,customType:l,tags:u,size:p,include:c,exclude:h,states:f,props:g,...k}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:n,...a!=null?{on:a}:{},props:{...g,...k}}},afterMerge:(e,t)=>Yt.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),_({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function wn(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function $n(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const n=e.fn;return(a=>{const r=n(a);return{...t.mapStaticDef(r,"CUSTOM_LAYOUT"),children:i}})}function kn(e){return e.children}_({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:wn,buildCustomWidget:$n,getChildren:kn}),_({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>xe(G(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"tags",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ee(e.validator,"array")}:{},props:z(e)})});const Ni={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","MARKDOWN_TEXTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function _n(e,t){const i=Ni[e];return i?i.has(t):e===t}class Cn{resolve(t,i){const n=[];for(const r of i)r.kind==="aggregated"?this.collectFromAggregated(r,t,n):this.collectFromLeaf(r,t,n);const a=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:a}}collectFromAggregated(t,i,n){if(t.matcher(i))for(const a of t.children)this.collectFromLeaf(a,i,n)}collectFromLeaf(t,i,n){_n(t.selectorType,i.itemType??"")&&t.matcher(i)&&n.push(t)}rollUpSensibleDefaults(t){const i=new Map,n=(r,s)=>{const l=i.get(r)??[];l.push(s),i.set(r,l)};for(const r of t){const s=Ni[r.selectorType];if(s)for(const l of s)n(l,r);else n(r.selectorType,r)}const a={};for(const[r,s]of i)zi(r)&&(a[r]=Pt(r).rollUpSensibleDefaults(s));return a}}const Sn=new Cn;class On{deepMerge(t,i){if(i==null)return t;if(t==null||typeof t!="object"||typeof i!="object"||Array.isArray(t)||Array.isArray(i))return i;const n={...t};for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&(typeof i[a]=="object"&&!Array.isArray(i[a])&&i[a]!==null&&typeof t[a]=="object"&&!Array.isArray(t[a])&&t[a]!==null?n[a]=this.deepMerge(t[a],i[a]):n[a]=i[a]);return n}}const xn=new On;class En{constructor(t){this.objectUtils=t}merge(t,i,n){let a={},r=null;typeof t=="function"&&(r=t);const s=this.collectDecorators(n);for(const p of s){if(r!=null){r=this.composeRuntimeFunctions(r,p);continue}if(typeof p=="function"){const c=p({...a,...typeof t=="function"?{}:t});if(typeof c=="function"){r=this.createPromotedFunction(a,t,c,i,n);continue}a=this.objectUtils.deepMerge(a,c)}else a=this.objectUtils.deepMerge(a,p)}if(r!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(r,a,i,n)};const l=this.objectUtils.deepMerge(t,a);return{kind:"static",def:this.applySensibleDefaults({...l},i,n)}}collectDecorators(t){const i=[];for(const n of t.leafSelectors){const a=n.config;a.override!=null&&i.push(a.override)}return i}applySensibleDefaults(t,i,n){if(!zi(i))return t;const a=n.sensibleDefaults[i]??{};return Pt(i).applySensibleDefaults(t,a)}createPromotedFunction(t,i,n,a,r){return s=>{const l=n(s);let u=this.objectUtils.deepMerge(t,l);return u=this.objectUtils.deepMerge(u,i),this.applySensibleDefaults(u,a,r)}}wrapWithSensibleDefaults(t,i,n,a){return r=>{let s=t(r);return Object.keys(i).length>0&&(s=this.objectUtils.deepMerge(i,s)),this.applySensibleDefaults(s,n,a)}}composeRuntimeFunctions(t,i){return typeof i=="function"?n=>{const a=t(n),r=i(a);return typeof r=="function"?r(n):this.objectUtils.deepMerge(r,a)}:n=>{const a=t(n);return this.objectUtils.deepMerge(a,i)}}}const Pn=new En(xn);class In{mapToWidget(t,i){if(t.kind==="dynamic"){const n=t.fn;return(a=>{const r=n(a);return this.mapStaticDef(r,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const n=Pt(i).mapToWidget(t);return this.applyBaseWidgetFields(n,t)}applyBaseWidgetFields(t,i){return i.size!=null&&(t.size=i.size),i.defaultValue!=null&&t.kind==="input"&&(t.defaultValue=i.defaultValue),i.on!=null&&(t.on=i.on),i.include!=null&&(t.include=i.include),i.exclude!=null&&(t.exclude=i.exclude),t}}const An=new In;class Tn{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],n=[],a=[];for(const r of i)r.kind==="leaf"?a.push(r):n.push(r);return a.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:a}),n}extractFormConfig(){return{suppressAutomaticStack:!1}}}const Ln=new Tn,Mn={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},qi={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class Rn{extractFromMergeResult(t,i){const n={};for(const l of i){const u=l.targetState,p=l.config,c=p.override&&typeof p.override!="function"?p.override:p;n[u]={...n[u]||{},...c}}if(t.kind==="dynamic"){const l=t.fn;return{cleanedResult:{kind:"dynamic",fn:p=>{const c=l(p),{states:h,...f}=c;return f}},stateData:{stateOverrides:n}}}const{states:a,...r}=t.def,s={};for(const[l,u]of Object.entries(n))s[l]={...u};if(a)for(const[l,u]of Object.entries(a))s[l]={...s[l]||{},...u};return{cleanedResult:{kind:"static",def:r},stateData:{stateOverrides:s}}}applyToWidget(t,i,n,a){const{stateOverrides:r}=i;if(Object.keys(r).length===0)return t;const s={...t},l=t.kind,u=Mn[l]||new Set;t.props&&(s.props={...t.props}),t.on&&(s.on={...t.on});for(const[p,c]of Object.entries(r))for(const[h,f]of Object.entries(c))h==="visible"?this.applyVisibility(s,p,f):qi[h]?this.applyStateEvent(s,p,h,f,n,a):u.has(h)?s[`${h}.${p}`]=f:(s.props||(s.props={}),s.props[`${h}.${p}`]=f);return s}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,n){if(n){const a=t.include?.in||[];t.include={...t.include||{},in:[...a,i]}}else{const a=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...a,i]}}}applyStateEvent(t,i,n,a,r,s){const l=qi[n];if(t.on||(t.on={}),typeof a=="function"){const u=s.next();r.set(u,a),t.on[`${l}.${i}`]=u}else typeof a=="string"&&(t.on[`${l}.${i}`]=a)}}const zn=new Rn;function Fn(){let e=0;return{next:()=>`event_${e++}`}}class Nn{constructor(t,i,n,a,r){this.resolver=t,this.merger=i,this.mapper=n,this.eventWiring=a,this.stateExpansion=r}walkAndMap(t,i,n){const a=new Map,r=Fn(),s={value:0},l=new Set;return{widgets:this.walkItems(t,i,a,n,r,s,l),eventRegistry:a}}walkItems(t,i,n,a,r,s,l){return t.flatMap(u=>{if(u.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return u.items.map(p=>this.processItem(p,u.itemType,u.tags,i,n,a,r,s,l))})}processItem(t,i,n,a,r,s,l,u,p){const c=i,h=Pt(i),f=h.parseEntry(t),g=this.buildBaseDef(f),k=this.buildDecoratorForMatching(g,c,n),I=this.resolver.resolve(k,a),Ua=I.leafSelectors.filter(ue=>ue.targetState!=null),Wa={leafSelectors:I.leafSelectors.filter(ue=>ue.targetState==null),sensibleDefaults:I.sensibleDefaults};let Ge=this.merger.merge(g,c,Wa);h.afterMerge&&(Ge=h.afterMerge(Ge,{eventRegistry:r,formConfig:s,eventIdGenerator:l})),Ge=this.eventWiring.wireInputLayoutEvents(Ge,r,l);const{cleanedResult:Ga,stateData:Ii}=this.stateExpansion.extractFromMergeResult(Ge,Ua);let Pe;if(h.buildCustomWidget){const ue=this.buildCustomWidgetContext(f.children,a,r,s,l,u,p);Pe=this.buildCustomWidget(h,Ga,ue)}else Pe=this.mapper.mapToWidget(Ga,c);if(typeof Pe!="function"){const ue=Pe;ue.uid||(ue.path&&!p.has(ue.path)?(ue.uid=ue.path,p.add(ue.path)):ue.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(Ii))if(typeof Pe=="function"){const ue=Pe;Pe=(rp=>{const sp=ue(rp);return this.stateExpansion.applyToWidget(sp,Ii,r,l)})}else Pe=this.stateExpansion.applyToWidget(Pe,Ii,r,l);return Pe}buildCustomWidgetContext(t,i,n,a,r,s,l){return{children:t,mapStaticDef:(u,p)=>this.mapper.mapStaticDef(u,p),walkChildren:u=>this.walkItems(u,i,n,a,r,s,l)}}buildCustomWidget(t,i,n){return t.buildCustomWidget(i,n)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?n=>{const r=i(n??{});return t.path!=null?{...r,path:t.path}:r}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,n){if(typeof t=="function")return{itemType:i,tags:[...n]};const a=[...n,..."tags"in t&&t.tags?t.tags:[]],r="uid"in t?t.uid:void 0,s="type"in t?t.type:void 0;return{itemType:i,tags:a,uid:r,type:s}}}class qn{constructor(t,i){this.selectorNormalizer=t,this.walker=i}processDxFacade(t,i=[],n){const{defs:a,gslSelectors:r,formConfig:s}=this.prepareForm(t,i,n),{widgets:l,eventRegistry:u}=this.walker.walkAndMap(a,r,s),p=l[0];return this.buildResult({form:p},u,s)}prepareForm(t,i,n){const r=(Array.isArray(t)?[...t]:[t]).map(u=>typeof u=="function"?Ka(u):u),s=this.selectorNormalizer.normalizeSelectors(i),l={...this.selectorNormalizer.extractFormConfig(),...n};if(!l.suppressAutomaticStack){const u={def:{uid:"#root",direction:"column",widgetName:"flex"},children:r};return{defs:[{type:"ITEMS",itemType:Mi.LAYOUTS,items:[u],tags:[]}],gslSelectors:s,formConfig:l}}return{defs:r,gslSelectors:s,formConfig:l}}convertStateNames(t){const i={};for(const[n,a]of Object.entries(t))i[n.replace(/\$/g,":")]=a;return i}buildResult(t,i,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const a={form:t};return i.size>0&&(a.events=r=>{const s=i.get(r.name);if(s){const l=p=>{if(p&&typeof p=="object"&&"path"in p&&!("type"in p)){const{path:c,...h}=p;for(const[f,g]of Object.entries(h))r.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:c,prop:f,value:g}})}else r.callback(p)},u={...r,callback:l,update:l};s(u)}}),n.dependencies&&(a.dependencies=n.dependencies),n.widgetLoaders&&(a.widgetLoaders=n.widgetLoaders),n.validateOn&&(a.validateOn=n.validateOn),n.itemRenderers&&(a.itemRenderers=n.itemRenderers),a}}const Bn=new Nn(Sn,Pn,An,Yt,zn),Zn=new qn(Ln,Bn);function Vn(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(Bi):Bi(e)}function Bi(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}const Zi=Object.freeze({}),Un=Object.freeze({}),Vi=new WeakMap;function Kt(e,t){return e==null?t:typeof e=="object"?e:{}}function Wn(e,t,i){if(!Vn(e))return{formDef:e};const n=Kt(e,Zi),a=Kt(t,Zi),r=Kt(i,Un);let s=Vi.get(n);s||(s=new WeakMap,Vi.set(n,s));let l=s.get(a);l||(l=new WeakMap,s.set(a,l));const u=l.get(r);if(u)return u;const p=Zn.processDxFacade(e,t,i),c={formDef:p.form,formEvent:p.events,dependencies:p.dependencies,widgetLoaders:p.widgetLoaders,validateOn:p.validateOn,itemRenderers:p.itemRenderers};return l.set(r,c),c}function m(e,t,i){function n(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,u);const p=s.prototype,c=Object.keys(p);for(let h=0;h<c.length;h++){const f=c[h];f in l||(l[f]=p[f].bind(l))}}const a=i?.Parent??Object;class r extends a{}Object.defineProperty(r,"name",{value:e});function s(l){var u;const p=i?.Parent?new r:this;n(p,l),(u=p._zod).deferred??(u.deferred=[]);for(const c of p._zod.deferred)c();return p}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:l=>i?.Parent&&l instanceof i.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Ye extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ui extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Gn={};function Fe(e){return Gn}function Jt(e,t){return typeof t=="bigint"?t.toString():t}function Xt(e){return e==null}function Qt(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const Wi=Symbol("evaluating");function C(e,t,i){let n;Object.defineProperty(e,t,{get(){if(n!==Wi)return n===void 0&&(n=Wi,n=i()),n},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function Hn(...e){const t={};for(const i of e){const n=Object.getOwnPropertyDescriptors(i);Object.assign(t,n)}return Object.defineProperties({},t)}function Yn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Gi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Hi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jt(e){if(Hi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(Hi(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Yi(e){return jt(e)?{...e}:Array.isArray(e)?[...e]:e}function ei(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ki(e,t,i){const n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}function v(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const Kn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ke(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Jn(e,t){return t.map(i=>{var n;return(n=i).path??(n.path=[]),i.path.unshift(e),i})}function It(e){return typeof e=="string"?e:e?.message}function Ne(e,t,i){const n={...e,path:e.path??[]};if(!e.message){const a=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(i.customError?.(e))??It(i.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ti(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function tt(...e){const[t,i,n]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:n}:{...t}}const Ji=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Jt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xi=m("$ZodError",Ji),At=m("$ZodError",Ji,{Parent:Error});function Xn(e,t=i=>i.message){const i={},n=[];for(const a of e.issues)a.path.length>0?(i[a.path[0]]=i[a.path[0]]||[],i[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:i}}function Qn(e,t=i=>i.message){const i={_errors:[]},n=a=>{for(const r of a.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(s=>n({issues:s}));else if(r.code==="invalid_key")n({issues:r.issues});else if(r.code==="invalid_element")n({issues:r.issues});else if(r.path.length===0)i._errors.push(t(r));else{let s=i,l=0;for(;l<r.path.length;){const u=r.path[l];l===r.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(t(r))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(e),i}const Tt=e=>(t,i,n,a)=>{const r=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new Ye;if(s.issues.length){const l=new(a?.Err??e)(s.issues.map(u=>Ne(u,r,Fe())));throw Gi(l,a?.callee),l}return s.value},jn=Tt(At),Lt=e=>async(t,i,n,a)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const l=new(a?.Err??e)(s.issues.map(u=>Ne(u,r,Fe())));throw Gi(l,a?.callee),l}return s.value},er=Lt(At),Mt=e=>(t,i,n)=>{const a=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:i,issues:[]},a);if(r instanceof Promise)throw new Ye;return r.issues.length?{success:!1,error:new(e??Xi)(r.issues.map(s=>Ne(s,a,Fe())))}:{success:!0,data:r.value}},Qi=Mt(At),Rt=e=>async(t,i,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let r=t._zod.run({value:i,issues:[]},a);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(s=>Ne(s,a,Fe())))}:{success:!0,data:r.value}},ji=Rt(At),tr=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Tt(e)(t,i,a)},ir=e=>(t,i,n)=>Tt(e)(t,i,n),ar=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Lt(e)(t,i,a)},nr=e=>async(t,i,n)=>Lt(e)(t,i,n),rr=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Mt(e)(t,i,a)},sr=e=>(t,i,n)=>Mt(e)(t,i,n),or=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Rt(e)(t,i,a)},lr=e=>async(t,i,n)=>Rt(e)(t,i,n),dr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ea=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ur=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,hr=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ta="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",mr=new RegExp(`^${ta}$`);function ia(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yr(e){return new RegExp(`^${ia(e)}$`)}function fr(e){const t=ia({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${i.join("|")})`;return new RegExp(`^${ta}T(?:${n})$`)}const gr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},br=/^-?\d+$/,Dr=/^-?\d+(?:\.\d+)?$/,vr=/^(?:true|false)$/i,wr=/^[^A-Z]*$/,$r=/^[^a-z]*$/,ge=m("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),aa={number:"number",bigint:"bigint",object:"date"},kr=m("$ZodCheckLessThan",(e,t)=>{ge.init(e,t);const i=aa[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,r=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_r=m("$ZodCheckGreaterThan",(e,t)=>{ge.init(e,t);const i=aa[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,r=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Cr=m("$ZodCheckNumberFormat",(e,t)=>{ge.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),n=i?"int":"number",[a,r]=Kn[t.format];e._zod.onattach.push(s=>{const l=s._zod.bag;l.format=t.format,l.minimum=a,l.maximum=r,i&&(l.pattern=br)}),e._zod.check=s=>{const l=s.value;if(i){if(!Number.isInteger(l)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?s.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<a&&s.issues.push({origin:"number",input:l,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),l>r&&s.issues.push({origin:"number",input:l,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Sr=m("$ZodCheckMaxLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const s=ti(a);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Or=m("$ZodCheckMinLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const s=ti(a);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),xr=m("$ZodCheckLengthEquals",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=n=>{const a=n.value,r=a.length;if(r===t.length)return;const s=ti(a),l=r>t.length;n.issues.push({origin:s,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),zt=m("$ZodCheckStringFormat",(e,t)=>{var i,n;ge.init(e,t),e._zod.onattach.push(a=>{const r=a._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Er=m("$ZodCheckRegex",(e,t)=>{zt.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pr=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=wr),zt.init(e,t)}),Ir=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$r),zt.init(e,t)}),Ar=m("$ZodCheckIncludes",(e,t)=>{ge.init(e,t);const i=ei(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=n,e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),Tr=m("$ZodCheckStartsWith",(e,t)=>{ge.init(e,t);const i=new RegExp(`^${ei(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Lr=m("$ZodCheckEndsWith",(e,t)=>{ge.init(e,t);const i=new RegExp(`.*${ei(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Mr=m("$ZodCheckOverwrite",(e,t)=>{ge.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),Rr={major:4,minor:3,patch:6},F=m("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rr;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const a of n)for(const r of a._zod.onattach)r(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const a=(s,l,u)=>{let p=Ke(s),c;for(const h of l){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(p)continue;const f=s.issues.length,g=h._zod.check(s);if(g instanceof Promise&&u?.async===!1)throw new Ye;if(c||g instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await g,s.issues.length!==f&&(p||(p=Ke(s,f)))});else{if(s.issues.length===f)continue;p||(p=Ke(s,f))}}return c?c.then(()=>s):s},r=(s,l,u)=>{if(Ke(s))return s.aborted=!0,s;const p=a(l,n,u);if(p instanceof Promise){if(u.async===!1)throw new Ye;return p.then(c=>e._zod.parse(c,u))}return e._zod.parse(p,u)};e._zod.run=(s,l)=>{if(l.skipChecks)return e._zod.parse(s,l);if(l.direction==="backward"){const p=e._zod.parse({value:s.value,issues:[]},{...l,skipChecks:!0});return p instanceof Promise?p.then(c=>r(c,s,l)):r(p,s,l)}const u=e._zod.parse(s,l);if(u instanceof Promise){if(l.async===!1)throw new Ye;return u.then(p=>a(p,n,l))}return a(u,n,l)}}C(e,"~standard",()=>({validate:a=>{try{const r=Qi(e,a);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return ji(e,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),ii=m("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??gr(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),De=m("$ZodStringFormat",(e,t)=>{zt.init(e,t),ii.init(e,t)}),zr=m("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ea(n))}else t.pattern??(t.pattern=ea());De.init(e,t)}),Fr=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ur),De.init(e,t)}),Nr=m("$ZodURL",(e,t)=>{De.init(e,t),e._zod.check=i=>{try{const n=i.value.trim(),a=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=a.href:i.value=n;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),qr=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=fr(t)),De.init(e,t)}),Br=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mr),De.init(e,t)}),Zr=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=yr(t)),De.init(e,t)}),Vr=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=dr),De.init(e,t)}),Ur=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pr),De.init(e,t),e._zod.bag.format="ipv4"}),Wr=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=cr),De.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),Gr=m("$ZodCustomStringFormat",(e,t)=>{De.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),na=m("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??Dr,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const a=i.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return i;const r=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...r?{received:r}:{}}),i}}),Hr=m("$ZodNumberFormat",(e,t)=>{Cr.init(e,t),na.init(e,t)}),Yr=m("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=vr,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=!!i.value}catch{}const a=i.value;return typeof a=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),i}}),Kr=m("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=i=>i});function ra(e,t,i){e.issues.length&&t.issues.push(...Jn(i,e.issues)),t.value[i]=e.value}const sa=m("$ZodArray",(e,t)=>{F.init(e,t),e._zod.parse=(i,n)=>{const a=i.value;if(!Array.isArray(a))return i.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),i;i.value=Array(a.length);const r=[];for(let s=0;s<a.length;s++){const l=a[s],u=t.element._zod.run({value:l,issues:[]},n);u instanceof Promise?r.push(u.then(p=>ra(p,i,s))):ra(u,i,s)}return r.length?Promise.all(r).then(()=>i):i}});function oa(e,t,i,n){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const a=e.filter(r=>!Ke(r));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(r=>r.issues.map(s=>Ne(s,n,Fe())))}),t)}const Jr=m("$ZodUnion",(e,t)=>{F.init(e,t),C(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),C(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),C(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),C(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${a.map(r=>Qt(r.source)).join("|")})$`)}});const i=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(a,r)=>{if(i)return n(a,r);let s=!1;const l=[];for(const u of t.options){const p=u._zod.run({value:a.value,issues:[]},r);if(p instanceof Promise)l.push(p),s=!0;else{if(p.issues.length===0)return p;l.push(p)}}return s?Promise.all(l).then(u=>oa(u,a,e,r)):oa(l,a,e,r)}}),Xr=m("$ZodIntersection",(e,t)=>{F.init(e,t),e._zod.parse=(i,n)=>{const a=i.value,r=t.left._zod.run({value:a,issues:[]},n),s=t.right._zod.run({value:a,issues:[]},n);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then(([u,p])=>la(i,u,p)):la(i,r,s)}});function ai(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(jt(e)&&jt(t)){const i=Object.keys(t),n=Object.keys(e).filter(r=>i.indexOf(r)!==-1),a={...e,...t};for(const r of n){const s=ai(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};a[r]=s.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let n=0;n<e.length;n++){const a=e[n],r=t[n],s=ai(a,r);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};i.push(s.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function la(e,t,i){const n=new Map;let a;for(const l of t.issues)if(l.code==="unrecognized_keys"){a??(a=l);for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(l);for(const l of i.issues)if(l.code==="unrecognized_keys")for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(l);const r=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(r.length&&a&&e.issues.push({...a,keys:r}),Ke(e))return e;const s=ai(t.value,i.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Qr=m("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ui(e.constructor.name);const a=t.transform(i.value,i);if(n.async)return(a instanceof Promise?a:Promise.resolve(a)).then(s=>(i.value=s,i));if(a instanceof Promise)throw new Ye;return i.value=a,i}});function da(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ni=m("$ZodOptional",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.optout="optional",C(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),C(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qt(i.source)})?$`):void 0}),e._zod.parse=(i,n)=>{if(t.innerType._zod.optin==="optional"){const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>da(r,i.value)):da(a,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,n)}}),jr=m("$ZodExactOptional",(e,t)=>{ni.init(e,t),C(e._zod,"values",()=>t.innerType._zod.values),C(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,n)=>t.innerType._zod.run(i,n)}),es=m("$ZodNullable",(e,t)=>{F.init(e,t),C(e._zod,"optin",()=>t.innerType._zod.optin),C(e._zod,"optout",()=>t.innerType._zod.optout),C(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qt(i.source)}|null)$`):void 0}),C(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,n)=>i.value===null?i:t.innerType._zod.run(i,n)}),ts=m("$ZodDefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);if(i.value===void 0)return i.value=t.defaultValue,i;const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>ua(r,t)):ua(a,t)}});function ua(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const is=m("$ZodPrefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>(n.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,n))}),as=m("$ZodNonOptional",(e,t)=>{F.init(e,t),C(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(n=>n!==void 0)):void 0}),e._zod.parse=(i,n)=>{const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>pa(r,e)):pa(a,e)}});function pa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ns=m("$ZodCatch",(e,t)=>{F.init(e,t),C(e._zod,"optin",()=>t.innerType._zod.optin),C(e._zod,"optout",()=>t.innerType._zod.optout),C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(r=>(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(s=>Ne(s,n,Fe()))},input:i.value}),i.issues=[]),i)):(i.value=a.value,a.issues.length&&(i.value=t.catchValue({...i,error:{issues:a.issues.map(r=>Ne(r,n,Fe()))},input:i.value}),i.issues=[]),i)}}),rs=m("$ZodPipe",(e,t)=>{F.init(e,t),C(e._zod,"values",()=>t.in._zod.values),C(e._zod,"optin",()=>t.in._zod.optin),C(e._zod,"optout",()=>t.out._zod.optout),C(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,n)=>{if(n.direction==="backward"){const r=t.out._zod.run(i,n);return r instanceof Promise?r.then(s=>Ft(s,t.in,n)):Ft(r,t.in,n)}const a=t.in._zod.run(i,n);return a instanceof Promise?a.then(r=>Ft(r,t.out,n)):Ft(a,t.out,n)}});function Ft(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const ss=m("$ZodReadonly",(e,t)=>{F.init(e,t),C(e._zod,"propValues",()=>t.innerType._zod.propValues),C(e._zod,"values",()=>t.innerType._zod.values),C(e._zod,"optin",()=>t.innerType?._zod?.optin),C(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(ca):ca(a)}});function ca(e){return e.value=Object.freeze(e.value),e}const ha=m("$ZodCustom",(e,t)=>{ge.init(e,t),F.init(e,t),e._zod.parse=(i,n)=>i,e._zod.check=i=>{const n=i.value,a=t.fn(n);if(a instanceof Promise)return a.then(r=>ma(r,i,n,e));ma(a,i,n,e)}});function ma(e,t,i,n){if(!e){const a={code:"custom",input:i,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(a.params=n._zod.def.params),t.issues.push(tt(a))}}var ya;class os{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const n=i[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const n={...this.get(i)??{}};delete n.id;const a={...n,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ls(){return new os}(ya=globalThis).__zod_globalRegistry??(ya.__zod_globalRegistry=ls());const it=globalThis.__zod_globalRegistry;function ds(e,t){return new e({type:"string",...v(t)})}function us(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function cs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function hs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function ms(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function ys(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function fs(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function gs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function bs(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function Ds(e,t){return new e({type:"number",checks:[],...v(t)})}function vs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function ws(e,t){return new e({type:"boolean",...v(t)})}function $s(e){return new e({type:"any"})}function ks(e,t){return new kr({check:"less_than",...v(t),value:e,inclusive:!0})}function _s(e,t){return new _r({check:"greater_than",...v(t),value:e,inclusive:!0})}function Nt(e,t){return new Sr({check:"max_length",...v(t),maximum:e})}function Je(e,t){return new Or({check:"min_length",...v(t),minimum:e})}function fa(e,t){return new xr({check:"length_equals",...v(t),length:e})}function ga(e,t){return new Er({check:"string_format",format:"regex",...v(t),pattern:e})}function Cs(e){return new Pr({check:"string_format",format:"lowercase",...v(e)})}function Ss(e){return new Ir({check:"string_format",format:"uppercase",...v(e)})}function Os(e,t){return new Ar({check:"string_format",format:"includes",...v(t),includes:e})}function xs(e,t){return new Tr({check:"string_format",format:"starts_with",...v(t),prefix:e})}function Es(e,t){return new Lr({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Xe(e){return new Mr({check:"overwrite",tx:e})}function Ps(e){return Xe(t=>t.normalize(e))}function Is(){return Xe(e=>e.trim())}function As(){return Xe(e=>e.toLowerCase())}function Ts(){return Xe(e=>e.toUpperCase())}function Ls(){return Xe(e=>Yn(e))}function Ms(e,t,i){return new e({type:"array",element:t,...v(i)})}function ba(e,t,i){return new e({type:"custom",check:"custom",fn:t,...v(i)})}function Da(e){const t=Rs(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(tt(n,i.value,t._zod.def));else{const a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=i.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),i.issues.push(tt(a))}},e(i.value,i)));return t}function Rs(e,t){const i=new ge({check:"custom",...v(t)});return i._zod.check=e,i}function zs(e,t,i,n={}){const a=v(n),r={...v(n),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:l=>i.test(l),...a};return i instanceof RegExp&&(r.pattern=i),new e(r)}function va(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??it,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ne(e,t,i={path:[],schemaPath:[]}){var n;const a=e._zod.def,r=t.seen.get(e);if(r)return r.count++,i.schemaPath.includes(e)&&(r.cycle=i.path),r.schema;const s={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,s);const l=e._zod.toJSONSchema?.();if(l)s.schema=l;else{const c={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,c);else{const f=s.schema,g=t.processors[a.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);g(e,t,f,c)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),ne(h,t,c),t.seen.get(h).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&re(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function wa(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const s of e.seen.entries()){const l=e.metadataRegistry.get(s[0])?.id;if(l){const u=n.get(l);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,s[0])}}const a=s=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(s[0])?.id,f=e.external.uri??(k=>k);if(h)return{ref:f(h)};const g=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=g,{defId:g,ref:`${f("__shared")}#/${l}/${g}`}}if(s[1]===i)return{ref:"#"};const p=`#/${l}/`,c=s[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:p+c}},r=s=>{if(s[1].schema.$ref)return;const l=s[1],{ref:u,defId:p}=a(s);l.def={...l.schema},p&&(l.defId=p);const c=l.schema;for(const h in c)delete c[h];c.$ref=u};if(e.cycles==="throw")for(const s of e.seen.entries()){const l=s[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
2
2
 
3
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const l=s[1];if(t===s[0]){r(s);continue}if(e.external){const p=e.external.registry.get(s[0])?.id;if(t!==s[0]&&p){r(s);continue}}if(e.metadataRegistry.get(s[0])?.id){r(s);continue}if(l.cycle){r(s);continue}if(l.count>1&&e.reused==="ref"){r(s);continue}}}function $a(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const l=e.seen.get(s);if(l.ref===null)return;const u=l.def??l.schema,p={...u},c=l.ref;if(l.ref=null,c){n(c);const f=e.seen.get(c),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,p),s._zod.parent===c)for(const I in u)I==="$ref"||I==="allOf"||I in p||delete u[I];if(g.$ref&&f.def)for(const I in u)I==="$ref"||I==="allOf"||I in f.def&&JSON.stringify(u[I])===JSON.stringify(f.def[I])&&delete u[I]}const h=s._zod.parent;if(h&&h!==c){n(h);const f=e.seen.get(h);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(const g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:s,jsonSchema:u,path:l.path??[]})};for(const s of[...e.seen.entries()].reverse())n(s[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(s)}Object.assign(a,i.def??i.schema);const r=e.external?.defs??{};for(const s of e.seen.entries()){const l=s[1];l.def&&l.defId&&(r[l.defId]=l.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?a.$defs=r:a.definitions=r);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:qt(t,"input",e.processors),output:qt(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function re(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return re(n.element,i);if(n.type==="set")return re(n.valueType,i);if(n.type==="lazy")return re(n.getter(),i);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return re(n.innerType,i);if(n.type==="intersection")return re(n.left,i)||re(n.right,i);if(n.type==="record"||n.type==="map")return re(n.keyType,i)||re(n.valueType,i);if(n.type==="pipe")return re(n.in,i)||re(n.out,i);if(n.type==="object"){for(const a in n.shape)if(re(n.shape[a],i))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(re(a,i))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(re(a,i))return!0;return!!(n.rest&&re(n.rest,i))}return!1}const qs=(e,t={})=>i=>{const n=va({...i,processors:t});return ne(e,n),wa(n,e),$a(n,e)},qt=(e,t,i={})=>n=>{const{libraryOptions:a,target:r}=n??{},s=va({...a??{},target:r,io:t,processors:i});return ne(e,s),wa(s,e),$a(s,e)},Bs={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zs=(e,t,i,n)=>{const a=i;a.type="string";const{minimum:r,maximum:s,format:l,patterns:u,contentEncoding:p}=e._zod.bag;if(typeof r=="number"&&(a.minLength=r),typeof s=="number"&&(a.maxLength=s),l&&(a.format=Bs[l]??l,a.format===""&&delete a.format,l==="time"&&delete a.format),p&&(a.contentEncoding=p),u&&u.size>0){const c=[...u];c.length===1?a.pattern=c[0].source:c.length>1&&(a.allOf=[...c.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Vs=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Us=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ws=(e,t,i,n)=>{const a=i,r=e._zod.def,{minimum:s,maximum:l}=e._zod.bag;typeof s=="number"&&(a.minItems=s),typeof l=="number"&&(a.maxItems=l),a.type="array",a.items=ne(r.element,t,{...n,path:[...n.path,"items"]})},Gs=(e,t,i,n)=>{const a=e._zod.def,r=a.inclusive===!1,s=a.options.map((l,u)=>ne(l,t,{...n,path:[...n.path,r?"oneOf":"anyOf",u]}));r?i.oneOf=s:i.anyOf=s},Hs=(e,t,i,n)=>{const a=e._zod.def,r=ne(a.left,t,{...n,path:[...n.path,"allOf",0]}),s=ne(a.right,t,{...n,path:[...n.path,"allOf",1]}),l=p=>"allOf"in p&&Object.keys(p).length===1,u=[...l(r)?r.allOf:[r],...l(s)?s.allOf:[s]];i.allOf=u},Ys=(e,t,i,n)=>{const a=e._zod.def,r=ne(a.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=a.innerType,i.nullable=!0):i.anyOf=[r,{type:"null"}]},Ks=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType},Js=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType,i.default=JSON.parse(JSON.stringify(a.defaultValue))},Xs=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},Qs=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType;let s;try{s=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=s},js=(e,t,i,n)=>{const a=e._zod.def,r=t.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;ne(r,t,n);const s=t.seen.get(e);s.ref=r},eo=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType,i.readOnly=!0},ka=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType},to=m("ZodISODateTime",(e,t)=>{Zr.init(e,t),Bt.init(e,t)});function io(e){return gs(to,e)}const ao=m("ZodISODate",(e,t)=>{Vr.init(e,t),Bt.init(e,t)});function no(e){return bs(ao,e)}const ro=m("ZodISOTime",(e,t)=>{Ur.init(e,t),Bt.init(e,t)});function so(e){return Ds(ro,e)}const oo=m("ZodISODuration",(e,t)=>{Wr.init(e,t),Bt.init(e,t)});function lo(e){return vs(oo,e)}const ve=m("ZodError",(e,t)=>{Xi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>er(e,i)},flatten:{value:i=>jn(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Jt,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Jt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),uo=Tt(ve),po=Lt(ve),co=Mt(ve),ho=Rt(ve),mo=ar(ve),yo=nr(ve),fo=rr(ve),go=sr(ve),bo=or(ve),Do=lr(ve),vo=dr(ve),wo=ur(ve),se=m("ZodType",(e,t)=>(z.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:qt(e,"input"),output:qt(e,"output")}}),e.toJSONSchema=qs(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Kn(t,{checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(i,n)=>Ki(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.parse=(i,n)=>uo(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>co(e,i,n),e.parseAsync=async(i,n)=>po(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>ho(e,i,n),e.spa=e.safeParseAsync,e.encode=(i,n)=>mo(e,i,n),e.decode=(i,n)=>yo(e,i,n),e.encodeAsync=async(i,n)=>fo(e,i,n),e.decodeAsync=async(i,n)=>go(e,i,n),e.safeEncode=(i,n)=>bo(e,i,n),e.safeDecode=(i,n)=>Do(e,i,n),e.safeEncodeAsync=async(i,n)=>vo(e,i,n),e.safeDecodeAsync=async(i,n)=>wo(e,i,n),e.refine=(i,n)=>e.check(Ho(i,n)),e.superRefine=i=>e.check(Yo(i)),e.overwrite=i=>e.check(Xe(i)),e.optional=()=>_a(e),e.exactOptional=()=>To(e),e.nullable=()=>Ca(e),e.nullish=()=>_a(Ca(e)),e.nonoptional=i=>qo(e,i),e.array=()=>_o(e),e.or=i=>So([e,i]),e.and=i=>xo(e,i),e.transform=i=>Sa(e,Po(i)),e.default=i=>Ro(e,i),e.prefault=i=>Fo(e,i),e.catch=i=>Zo(e,i),e.pipe=i=>Sa(e,i),e.readonly=()=>Wo(e),e.describe=i=>{const n=e.clone();return it.add(n,{description:i}),n},Object.defineProperty(e,"description",{get(){return it.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return it.get(e);const n=e.clone();return it.add(n,i[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),$o=m("_ZodString",(e,t)=>{ii.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,a,r)=>Zs(e,n,a);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...n)=>e.check(ga(...n)),e.includes=(...n)=>e.check(Es(...n)),e.startsWith=(...n)=>e.check(Ps(...n)),e.endsWith=(...n)=>e.check(Is(...n)),e.min=(...n)=>e.check(Je(...n)),e.max=(...n)=>e.check(Nt(...n)),e.length=(...n)=>e.check(fa(...n)),e.nonempty=(...n)=>e.check(Je(1,...n)),e.lowercase=n=>e.check(Os(n)),e.uppercase=n=>e.check(xs(n)),e.trim=()=>e.check(Ts()),e.normalize=(...n)=>e.check(As(...n)),e.toLowerCase=()=>e.check(Ls()),e.toUpperCase=()=>e.check(Ms()),e.slugify=()=>e.check(Rs())}),Bt=m("ZodStringFormat",(e,t)=>{De.init(e,t),$o.init(e,t)}),ko=m("ZodArray",(e,t)=>{sa.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ws(e,i,n,a),e.element=t.element,e.min=(i,n)=>e.check(Je(i,n)),e.nonempty=i=>e.check(Je(1,i)),e.max=(i,n)=>e.check(Nt(i,n)),e.length=(i,n)=>e.check(fa(i,n)),e.unwrap=()=>e.element});function _o(e,t){return zs(ko,e,t)}const Co=m("ZodUnion",(e,t)=>{Qr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Gs(e,i,n,a),e.options=t.options});function So(e,t){return new Co({type:"union",options:e,...v(t)})}const Oo=m("ZodIntersection",(e,t)=>{jr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Hs(e,i,n,a)});function xo(e,t){return new Oo({type:"intersection",left:e,right:t})}const Eo=m("ZodTransform",(e,t)=>{es.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Us(e,i),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ui(e.constructor.name);i.addIssue=r=>{if(typeof r=="string")i.issues.push(tt(r,i.value,t));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=e),i.issues.push(tt(s))}};const a=t.transform(i.value,i);return a instanceof Promise?a.then(r=>(i.value=r,i)):(i.value=a,i)}});function Po(e){return new Eo({type:"transform",transform:e})}const Io=m("ZodOptional",(e,t)=>{ni.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>ka(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function _a(e){return new Io({type:"optional",innerType:e})}const Ao=m("ZodExactOptional",(e,t)=>{ts.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>ka(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function To(e){return new Ao({type:"optional",innerType:e})}const Lo=m("ZodNullable",(e,t)=>{is.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ys(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Ca(e){return new Lo({type:"nullable",innerType:e})}const Mo=m("ZodDefault",(e,t)=>{as.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Js(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ro(e,t){return new Mo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Yi(t)}})}const zo=m("ZodPrefault",(e,t)=>{ns.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Xs(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Fo(e,t){return new zo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Yi(t)}})}const No=m("ZodNonOptional",(e,t)=>{rs.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ks(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function qo(e,t){return new No({type:"nonoptional",innerType:e,...v(t)})}const Bo=m("ZodCatch",(e,t)=>{ss.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Qs(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Zo(e,t){return new Bo({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Vo=m("ZodPipe",(e,t)=>{os.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>js(e,i,n,a),e.in=t.in,e.out=t.out});function Sa(e,t){return new Vo({type:"pipe",in:e,out:t})}const Uo=m("ZodReadonly",(e,t)=>{ls.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>eo(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Wo(e){return new Uo({type:"readonly",innerType:e})}const Go=m("ZodCustom",(e,t)=>{ha.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Vs(e,i)});function Ho(e,t={}){return ba(Go,e,t)}function Yo(e){return Da(e)}const qe=m("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");z.init(e,t),e.def=t,e.type=t.type,e.parse=(i,n)=>tr(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>Qi(e,i,n),e.parseAsync=async(i,n)=>ir(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>ji(e,i,n),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(i,n)=>Ki(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.apply=i=>i(e)}),Oa=m("ZodMiniString",(e,t)=>{ii.init(e,t),qe.init(e,t)});function xa(e){return ps(Oa,e)}const Qe=m("ZodMiniStringFormat",(e,t)=>{De.init(e,t),Oa.init(e,t)}),Ko=m("ZodMiniEmail",(e,t)=>{qr.init(e,t),Qe.init(e,t)});function Jo(e){return cs(Ko,e)}const Xo=m("ZodMiniUUID",(e,t)=>{Nr.init(e,t),Qe.init(e,t)});function Qo(e){return hs(Xo,e)}const jo=m("ZodMiniURL",(e,t)=>{Br.init(e,t),Qe.init(e,t)});function el(e){return ms(jo,e)}const tl=m("ZodMiniIPv4",(e,t)=>{Gr.init(e,t),Qe.init(e,t)});function il(e){return ys(tl,e)}const al=m("ZodMiniIPv6",(e,t)=>{Hr.init(e,t),Qe.init(e,t)});function nl(e){return fs(al,e)}const rl=m("ZodMiniCustomStringFormat",(e,t)=>{Yr.init(e,t),Qe.init(e,t)});function sl(e){return Ns(rl,"hostname",yr,e)}const Ea=m("ZodMiniNumber",(e,t)=>{na.init(e,t),qe.init(e,t)});function Pa(e){return ws(Ea,e)}const ol=m("ZodMiniNumberFormat",(e,t)=>{Kr.init(e,t),Ea.init(e,t)});function ll(e){return $s(ol,e)}const dl=m("ZodMiniBoolean",(e,t)=>{Jr.init(e,t),qe.init(e,t)});function Ia(e){return ks(dl,e)}const ul=m("ZodMiniAny",(e,t)=>{Xr.init(e,t),qe.init(e,t)});function ri(){return _s(ul)}const pl=m("ZodMiniArray",(e,t)=>{sa.init(e,t),qe.init(e,t)});function Aa(e,t){return new pl({type:"array",element:e,...v(t)})}const cl=m("ZodMiniOptional",(e,t)=>{ni.init(e,t),qe.init(e,t)});function hl(e){return new cl({type:"optional",innerType:e})}const ml=m("ZodMiniCustom",(e,t)=>{ha.init(e,t),qe.init(e,t)});function K(e,t={}){return ba(ml,e,t)}function Ta(e){return Da(e)}const si={email:{schema:Jo()},hostname:{schema:sl()},ipv4:{schema:il()},ipv6:{schema:nl()},url:{schema:el()},uuid:{schema:Qo()},date:{schema:no()},time:{schema:so()},"date-time":{schema:io()},duration:{schema:lo()}},yl=Object.keys(si),fl=e=>(t,i)=>{switch(t.type){case"string":return gl(t,i);case"integer":case"number":return Dl(t,i);case"boolean":return vl(t,i);case"array":return wl(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return $l(t,e)}}};function x(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function gl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?xa(n):xa();if(i.required===!0){const r=x(i.messages?.required,t)??"This field is required";a=a.check(K(s=>s.length>0,{error:r}))}if(typeof i.minLength=="number"){const r=x(i.messages?.minLength,t),s=i.minLength;a=a.check(r?K(l=>l.length>=s,{error:r}):Je(s))}if(typeof i.maxLength=="number"){const r=x(i.messages?.maxLength,t),s=i.maxLength;a=a.check(r?K(l=>l.length<=s,{error:r}):Nt(s))}if(typeof i.pattern=="string"){const r=x(i.messages?.pattern,t),s=new RegExp(i.pattern);a=a.check(r?K(l=>s.test(l),{error:r}):ga(s))}if(i.enum){const r=i.enum,s=x(i.messages?.enum,t);a=a.check(K(l=>r.includes(l),s?{error:s}:void 0))}if(i.const!==void 0){const r=x(i.messages?.const,t);a=a.check(K(s=>s===i.const,r?{error:r}:void 0))}if(i.format!==void 0)if(yl.includes(i.format)){const r=x(i.messages?.format,t);a=a.check(r?Ta((s,l)=>{const u=Oe.standardValidate(si[i.format].schema,s);Oe.isStandardValidateSuccess(u)||l.addIssue({code:"custom",path:[],message:r})}):si[i.format].schema)}else console.error(`The string validation format "${i.format}" is not supported`);return a})}const bl=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function Dl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Pa(n):Pa();if(i.type==="integer"&&(a=a.check(ll())),i.minimum!==void 0){const r=x(i.messages?.minimum,t),s=i.minimum;a=a.check(r?K(l=>l>=s,{error:r}):Ss(s))}if(i.maximum!==void 0){const r=x(i.messages?.maximum,t),s=i.maximum;a=a.check(r?K(l=>l<=s,{error:r}):Cs(s))}if(i.exclusiveMinimum!==void 0){const r=x(i.messages?.exclusiveMinimum,t),s=i.exclusiveMinimum;a=a.check(K(l=>l>s,r?{error:r}:void 0))}if(i.exclusiveMaximum!==void 0){const r=x(i.messages?.exclusiveMaximum,t),s=i.exclusiveMaximum;a=a.check(K(l=>l<s,r?{error:r}:void 0))}if(i.multipleOf!==void 0){const r=x(i.messages?.multipleOf,t),s=i.multipleOf;a=a.check(K(l=>bl(l,s),r?{error:r}:void 0))}if(i.enum){const r=i.enum,s=x(i.messages?.enum,t);a=a.check(K(l=>r.includes(l),s?{error:s}:void 0))}if(i.const!==void 0){const r=x(i.messages?.const,t);a=a.check(K(s=>s===i.const,r?{error:r}:void 0))}return a})}function vl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Ia(n):Ia();if(i.const!==void 0){const r=x(i.messages?.const,t);a=a.check(K(s=>s===i.const,r?{error:r}:void 0))}return a})}function wl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Aa(ri(),n):Aa(ri());if(i.required===!0){const r=x(i.messages?.required,t)??"This field is required";a=a.check(K(s=>s.length>0,{error:r}))}if(typeof i.minItems=="number"){const r=x(i.messages?.minItems,t),s=i.minItems;a=a.check(r?K(l=>l.length>=s,{error:r}):Je(s))}if(typeof i.maxItems=="number"){const r=x(i.messages?.maxItems,t),s=i.maxItems;a=a.check(r?K(l=>l.length<=s,{error:r}):Nt(s))}return a})}function $l(e,t){return at(e,i=>{let n=ri();return Oe.filterTap(Object.keys(i),a=>a!=="type"&&a!=="required",a=>{const r=i[a],s=t[a],l=s(r);n=n.check(Ta((u,p)=>{const c=Oe.standardValidate(l,u);if(!Oe.isStandardValidateSuccess(c)){const h=c.issues[0];p.addIssue({code:"custom",path:[],message:h?.message||`Validation failed for ${a}`})}}))}),n})}function at(e,t){const i=t(e);return e.required?i:hl(i)}const La={button:async()=>(await Promise.resolve().then(()=>El)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>Nl)).CalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>Gl)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>Xl)).RangeDateInputElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>ed)).RangeDatePickerElement,currency:async()=>(await Promise.resolve().then(()=>rd)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>ud)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>hd)).DatePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>Od)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>Pd)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>zd)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>Zd)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Hd)).TextinputElement,textarea:async()=>(await Promise.resolve().then(()=>Qd)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>au)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>lu)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>hu)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>wu)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>Su)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>Au)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>zu)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>qu)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>Vu)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>Gu)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Ku)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Qu)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>tp)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>np)).RendererElement};var kl=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,Zt=(e,t,i,n)=>{for(var a=n>1?void 0:n?_l(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&kl(t,i,a),a};C.FormElement=class extends d.LitElement{constructor(){super(...arguments),this.autocomplete=void 0}setData(t){this.coreForm?.setData(t)}setMeta(t){this.coreForm?.setMeta(t)}createRenderRoot(){return this}render(){const t=this.config,i=Gn(t.formDef,t.formSelectors,t.formConfig),n={formDef:i.formDef,widgetLoaders:{...La,...i.widgetLoaders,...t.customWidgetLoaders??{}},dependencies:{...i.dependencies??{},...t.dependencies??{}},validateOn:t.validateOn??i.validateOn??"eager",itemRenderers:{...i.itemRenderers??{},...t.itemRenderers??{}},localization:t.localization,middlewares:t.middlewares??[],data:t.data,meta:t.meta,formName:t.formName},a=fl({...t.customValidators??{}}),r=i.formEvent,s=r?l=>r(l.detail):void 0;return d.html`
3
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const l=s[1];if(t===s[0]){r(s);continue}if(e.external){const p=e.external.registry.get(s[0])?.id;if(t!==s[0]&&p){r(s);continue}}if(e.metadataRegistry.get(s[0])?.id){r(s);continue}if(l.cycle){r(s);continue}if(l.count>1&&e.reused==="ref"){r(s);continue}}}function $a(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const l=e.seen.get(s);if(l.ref===null)return;const u=l.def??l.schema,p={...u},c=l.ref;if(l.ref=null,c){n(c);const f=e.seen.get(c),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,p),s._zod.parent===c)for(const I in u)I==="$ref"||I==="allOf"||I in p||delete u[I];if(g.$ref&&f.def)for(const I in u)I==="$ref"||I==="allOf"||I in f.def&&JSON.stringify(u[I])===JSON.stringify(f.def[I])&&delete u[I]}const h=s._zod.parent;if(h&&h!==c){n(h);const f=e.seen.get(h);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(const g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:s,jsonSchema:u,path:l.path??[]})};for(const s of[...e.seen.entries()].reverse())n(s[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(s)}Object.assign(a,i.def??i.schema);const r=e.external?.defs??{};for(const s of e.seen.entries()){const l=s[1];l.def&&l.defId&&(r[l.defId]=l.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?a.$defs=r:a.definitions=r);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:qt(t,"input",e.processors),output:qt(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function re(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return re(n.element,i);if(n.type==="set")return re(n.valueType,i);if(n.type==="lazy")return re(n.getter(),i);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return re(n.innerType,i);if(n.type==="intersection")return re(n.left,i)||re(n.right,i);if(n.type==="record"||n.type==="map")return re(n.keyType,i)||re(n.valueType,i);if(n.type==="pipe")return re(n.in,i)||re(n.out,i);if(n.type==="object"){for(const a in n.shape)if(re(n.shape[a],i))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(re(a,i))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(re(a,i))return!0;return!!(n.rest&&re(n.rest,i))}return!1}const Fs=(e,t={})=>i=>{const n=va({...i,processors:t});return ne(e,n),wa(n,e),$a(n,e)},qt=(e,t,i={})=>n=>{const{libraryOptions:a,target:r}=n??{},s=va({...a??{},target:r,io:t,processors:i});return ne(e,s),wa(s,e),$a(s,e)},Ns={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qs=(e,t,i,n)=>{const a=i;a.type="string";const{minimum:r,maximum:s,format:l,patterns:u,contentEncoding:p}=e._zod.bag;if(typeof r=="number"&&(a.minLength=r),typeof s=="number"&&(a.maxLength=s),l&&(a.format=Ns[l]??l,a.format===""&&delete a.format,l==="time"&&delete a.format),p&&(a.contentEncoding=p),u&&u.size>0){const c=[...u];c.length===1?a.pattern=c[0].source:c.length>1&&(a.allOf=[...c.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Bs=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Zs=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Vs=(e,t,i,n)=>{const a=i,r=e._zod.def,{minimum:s,maximum:l}=e._zod.bag;typeof s=="number"&&(a.minItems=s),typeof l=="number"&&(a.maxItems=l),a.type="array",a.items=ne(r.element,t,{...n,path:[...n.path,"items"]})},Us=(e,t,i,n)=>{const a=e._zod.def,r=a.inclusive===!1,s=a.options.map((l,u)=>ne(l,t,{...n,path:[...n.path,r?"oneOf":"anyOf",u]}));r?i.oneOf=s:i.anyOf=s},Ws=(e,t,i,n)=>{const a=e._zod.def,r=ne(a.left,t,{...n,path:[...n.path,"allOf",0]}),s=ne(a.right,t,{...n,path:[...n.path,"allOf",1]}),l=p=>"allOf"in p&&Object.keys(p).length===1,u=[...l(r)?r.allOf:[r],...l(s)?s.allOf:[s]];i.allOf=u},Gs=(e,t,i,n)=>{const a=e._zod.def,r=ne(a.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=a.innerType,i.nullable=!0):i.anyOf=[r,{type:"null"}]},Hs=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType},Ys=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType,i.default=JSON.parse(JSON.stringify(a.defaultValue))},Ks=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},Js=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType;let s;try{s=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=s},Xs=(e,t,i,n)=>{const a=e._zod.def,r=t.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;ne(r,t,n);const s=t.seen.get(e);s.ref=r},Qs=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType,i.readOnly=!0},ka=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const r=t.seen.get(e);r.ref=a.innerType},js=m("ZodISODateTime",(e,t)=>{qr.init(e,t),Bt.init(e,t)});function eo(e){return ys(js,e)}const to=m("ZodISODate",(e,t)=>{Br.init(e,t),Bt.init(e,t)});function io(e){return fs(to,e)}const ao=m("ZodISOTime",(e,t)=>{Zr.init(e,t),Bt.init(e,t)});function no(e){return gs(ao,e)}const ro=m("ZodISODuration",(e,t)=>{Vr.init(e,t),Bt.init(e,t)});function so(e){return bs(ro,e)}const ve=m("ZodError",(e,t)=>{Xi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Qn(e,i)},flatten:{value:i=>Xn(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Jt,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Jt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),oo=Tt(ve),lo=Lt(ve),uo=Mt(ve),po=Rt(ve),co=tr(ve),ho=ir(ve),mo=ar(ve),yo=nr(ve),fo=rr(ve),go=sr(ve),bo=or(ve),Do=lr(ve),se=m("ZodType",(e,t)=>(F.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:qt(e,"input"),output:qt(e,"output")}}),e.toJSONSchema=Fs(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Hn(t,{checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(i,n)=>Ki(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.parse=(i,n)=>oo(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>uo(e,i,n),e.parseAsync=async(i,n)=>lo(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>po(e,i,n),e.spa=e.safeParseAsync,e.encode=(i,n)=>co(e,i,n),e.decode=(i,n)=>ho(e,i,n),e.encodeAsync=async(i,n)=>mo(e,i,n),e.decodeAsync=async(i,n)=>yo(e,i,n),e.safeEncode=(i,n)=>fo(e,i,n),e.safeDecode=(i,n)=>go(e,i,n),e.safeEncodeAsync=async(i,n)=>bo(e,i,n),e.safeDecodeAsync=async(i,n)=>Do(e,i,n),e.refine=(i,n)=>e.check(Wo(i,n)),e.superRefine=i=>e.check(Go(i)),e.overwrite=i=>e.check(Xe(i)),e.optional=()=>_a(e),e.exactOptional=()=>Io(e),e.nullable=()=>Ca(e),e.nullish=()=>_a(Ca(e)),e.nonoptional=i=>Fo(e,i),e.array=()=>$o(e),e.or=i=>_o([e,i]),e.and=i=>So(e,i),e.transform=i=>Sa(e,xo(i)),e.default=i=>Lo(e,i),e.prefault=i=>Ro(e,i),e.catch=i=>qo(e,i),e.pipe=i=>Sa(e,i),e.readonly=()=>Vo(e),e.describe=i=>{const n=e.clone();return it.add(n,{description:i}),n},Object.defineProperty(e,"description",{get(){return it.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return it.get(e);const n=e.clone();return it.add(n,i[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),vo=m("_ZodString",(e,t)=>{ii.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,a,r)=>qs(e,n,a);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...n)=>e.check(ga(...n)),e.includes=(...n)=>e.check(Os(...n)),e.startsWith=(...n)=>e.check(xs(...n)),e.endsWith=(...n)=>e.check(Es(...n)),e.min=(...n)=>e.check(Je(...n)),e.max=(...n)=>e.check(Nt(...n)),e.length=(...n)=>e.check(fa(...n)),e.nonempty=(...n)=>e.check(Je(1,...n)),e.lowercase=n=>e.check(Cs(n)),e.uppercase=n=>e.check(Ss(n)),e.trim=()=>e.check(Is()),e.normalize=(...n)=>e.check(Ps(...n)),e.toLowerCase=()=>e.check(As()),e.toUpperCase=()=>e.check(Ts()),e.slugify=()=>e.check(Ls())}),Bt=m("ZodStringFormat",(e,t)=>{De.init(e,t),vo.init(e,t)}),wo=m("ZodArray",(e,t)=>{sa.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Vs(e,i,n,a),e.element=t.element,e.min=(i,n)=>e.check(Je(i,n)),e.nonempty=i=>e.check(Je(1,i)),e.max=(i,n)=>e.check(Nt(i,n)),e.length=(i,n)=>e.check(fa(i,n)),e.unwrap=()=>e.element});function $o(e,t){return Ms(wo,e,t)}const ko=m("ZodUnion",(e,t)=>{Jr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Us(e,i,n,a),e.options=t.options});function _o(e,t){return new ko({type:"union",options:e,...v(t)})}const Co=m("ZodIntersection",(e,t)=>{Xr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ws(e,i,n,a)});function So(e,t){return new Co({type:"intersection",left:e,right:t})}const Oo=m("ZodTransform",(e,t)=>{Qr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Zs(e,i),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ui(e.constructor.name);i.addIssue=r=>{if(typeof r=="string")i.issues.push(tt(r,i.value,t));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=e),i.issues.push(tt(s))}};const a=t.transform(i.value,i);return a instanceof Promise?a.then(r=>(i.value=r,i)):(i.value=a,i)}});function xo(e){return new Oo({type:"transform",transform:e})}const Eo=m("ZodOptional",(e,t)=>{ni.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>ka(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function _a(e){return new Eo({type:"optional",innerType:e})}const Po=m("ZodExactOptional",(e,t)=>{jr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>ka(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Io(e){return new Po({type:"optional",innerType:e})}const Ao=m("ZodNullable",(e,t)=>{es.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Gs(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Ca(e){return new Ao({type:"nullable",innerType:e})}const To=m("ZodDefault",(e,t)=>{ts.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ys(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Lo(e,t){return new To({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Yi(t)}})}const Mo=m("ZodPrefault",(e,t)=>{is.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ks(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Ro(e,t){return new Mo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Yi(t)}})}const zo=m("ZodNonOptional",(e,t)=>{as.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Hs(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Fo(e,t){return new zo({type:"nonoptional",innerType:e,...v(t)})}const No=m("ZodCatch",(e,t)=>{ns.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Js(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qo(e,t){return new No({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Bo=m("ZodPipe",(e,t)=>{rs.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Xs(e,i,n,a),e.in=t.in,e.out=t.out});function Sa(e,t){return new Bo({type:"pipe",in:e,out:t})}const Zo=m("ZodReadonly",(e,t)=>{ss.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Qs(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Vo(e){return new Zo({type:"readonly",innerType:e})}const Uo=m("ZodCustom",(e,t)=>{ha.init(e,t),se.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Bs(e,i)});function Wo(e,t={}){return ba(Uo,e,t)}function Go(e){return Da(e)}const qe=m("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");F.init(e,t),e.def=t,e.type=t.type,e.parse=(i,n)=>jn(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>Qi(e,i,n),e.parseAsync=async(i,n)=>er(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>ji(e,i,n),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(i,n)=>Ki(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.apply=i=>i(e)}),Oa=m("ZodMiniString",(e,t)=>{ii.init(e,t),qe.init(e,t)});function xa(e){return ds(Oa,e)}const Qe=m("ZodMiniStringFormat",(e,t)=>{De.init(e,t),Oa.init(e,t)}),Ho=m("ZodMiniEmail",(e,t)=>{Fr.init(e,t),Qe.init(e,t)});function Yo(e){return us(Ho,e)}const Ko=m("ZodMiniUUID",(e,t)=>{zr.init(e,t),Qe.init(e,t)});function Jo(e){return ps(Ko,e)}const Xo=m("ZodMiniURL",(e,t)=>{Nr.init(e,t),Qe.init(e,t)});function Qo(e){return cs(Xo,e)}const jo=m("ZodMiniIPv4",(e,t)=>{Ur.init(e,t),Qe.init(e,t)});function el(e){return hs(jo,e)}const tl=m("ZodMiniIPv6",(e,t)=>{Wr.init(e,t),Qe.init(e,t)});function il(e){return ms(tl,e)}const al=m("ZodMiniCustomStringFormat",(e,t)=>{Gr.init(e,t),Qe.init(e,t)});function nl(e){return zs(al,"hostname",hr,e)}const Ea=m("ZodMiniNumber",(e,t)=>{na.init(e,t),qe.init(e,t)});function Pa(e){return Ds(Ea,e)}const rl=m("ZodMiniNumberFormat",(e,t)=>{Hr.init(e,t),Ea.init(e,t)});function sl(e){return vs(rl,e)}const ol=m("ZodMiniBoolean",(e,t)=>{Yr.init(e,t),qe.init(e,t)});function Ia(e){return ws(ol,e)}const ll=m("ZodMiniAny",(e,t)=>{Kr.init(e,t),qe.init(e,t)});function ri(){return $s(ll)}const dl=m("ZodMiniArray",(e,t)=>{sa.init(e,t),qe.init(e,t)});function Aa(e,t){return new dl({type:"array",element:e,...v(t)})}const ul=m("ZodMiniOptional",(e,t)=>{ni.init(e,t),qe.init(e,t)});function pl(e){return new ul({type:"optional",innerType:e})}const cl=m("ZodMiniCustom",(e,t)=>{ha.init(e,t),qe.init(e,t)});function K(e,t={}){return ba(cl,e,t)}function Ta(e){return Da(e)}const si={email:{schema:Yo()},hostname:{schema:nl()},ipv4:{schema:el()},ipv6:{schema:il()},url:{schema:Qo()},uuid:{schema:Jo()},date:{schema:io()},time:{schema:no()},"date-time":{schema:eo()},duration:{schema:so()}},hl=Object.keys(si),ml=e=>(t,i)=>{switch(t.type){case"string":return yl(t,i);case"integer":case"number":return gl(t,i);case"boolean":return bl(t,i);case"array":return Dl(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return vl(t,e)}}};function x(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function yl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?xa(n):xa();if(i.required===!0){const r=x(i.messages?.required,t)??"This field is required";a=a.check(K(s=>s.length>0,{error:r}))}if(typeof i.minLength=="number"){const r=x(i.messages?.minLength,t),s=i.minLength;a=a.check(r?K(l=>l.length>=s,{error:r}):Je(s))}if(typeof i.maxLength=="number"){const r=x(i.messages?.maxLength,t),s=i.maxLength;a=a.check(r?K(l=>l.length<=s,{error:r}):Nt(s))}if(typeof i.pattern=="string"){const r=x(i.messages?.pattern,t),s=new RegExp(i.pattern);a=a.check(r?K(l=>s.test(l),{error:r}):ga(s))}if(i.enum){const r=i.enum,s=x(i.messages?.enum,t);a=a.check(K(l=>r.includes(l),s?{error:s}:void 0))}if(i.const!==void 0){const r=x(i.messages?.const,t);a=a.check(K(s=>s===i.const,r?{error:r}:void 0))}if(i.format!==void 0)if(hl.includes(i.format)){const r=x(i.messages?.format,t);a=a.check(r?Ta((s,l)=>{const u=Oe.standardValidate(si[i.format].schema,s);Oe.isStandardValidateSuccess(u)||l.addIssue({code:"custom",path:[],message:r})}):si[i.format].schema)}else console.error(`The string validation format "${i.format}" is not supported`);return a})}const fl=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function gl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Pa(n):Pa();if(i.type==="integer"&&(a=a.check(sl())),i.minimum!==void 0){const r=x(i.messages?.minimum,t),s=i.minimum;a=a.check(r?K(l=>l>=s,{error:r}):_s(s))}if(i.maximum!==void 0){const r=x(i.messages?.maximum,t),s=i.maximum;a=a.check(r?K(l=>l<=s,{error:r}):ks(s))}if(i.exclusiveMinimum!==void 0){const r=x(i.messages?.exclusiveMinimum,t),s=i.exclusiveMinimum;a=a.check(K(l=>l>s,r?{error:r}:void 0))}if(i.exclusiveMaximum!==void 0){const r=x(i.messages?.exclusiveMaximum,t),s=i.exclusiveMaximum;a=a.check(K(l=>l<s,r?{error:r}:void 0))}if(i.multipleOf!==void 0){const r=x(i.messages?.multipleOf,t),s=i.multipleOf;a=a.check(K(l=>fl(l,s),r?{error:r}:void 0))}if(i.enum){const r=i.enum,s=x(i.messages?.enum,t);a=a.check(K(l=>r.includes(l),s?{error:s}:void 0))}if(i.const!==void 0){const r=x(i.messages?.const,t);a=a.check(K(s=>s===i.const,r?{error:r}:void 0))}return a})}function bl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Ia(n):Ia();if(i.const!==void 0){const r=x(i.messages?.const,t);a=a.check(K(s=>s===i.const,r?{error:r}:void 0))}return a})}function Dl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Aa(ri(),n):Aa(ri());if(i.required===!0){const r=x(i.messages?.required,t)??"This field is required";a=a.check(K(s=>s.length>0,{error:r}))}if(typeof i.minItems=="number"){const r=x(i.messages?.minItems,t),s=i.minItems;a=a.check(r?K(l=>l.length>=s,{error:r}):Je(s))}if(typeof i.maxItems=="number"){const r=x(i.messages?.maxItems,t),s=i.maxItems;a=a.check(r?K(l=>l.length<=s,{error:r}):Nt(s))}return a})}function vl(e,t){return at(e,i=>{let n=ri();return Oe.filterTap(Object.keys(i),a=>a!=="type"&&a!=="required",a=>{const r=i[a],s=t[a],l=s(r);n=n.check(Ta((u,p)=>{const c=Oe.standardValidate(l,u);if(!Oe.isStandardValidateSuccess(c)){const h=c.issues[0];p.addIssue({code:"custom",path:[],message:h?.message||`Validation failed for ${a}`})}}))}),n})}function at(e,t){const i=t(e);return e.required?i:pl(i)}const wl=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"label")&&Object.prototype.hasOwnProperty.call(e,"value");function $l(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const i=t();return Object.defineProperty(e,"__rid",{value:i,enumerable:!1,configurable:!1}),i}const La={button:async()=>(await Promise.resolve().then(()=>El)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>Nl)).CalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>Gl)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>Xl)).RangeDateInputElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>ed)).RangeDatePickerElement,currency:async()=>(await Promise.resolve().then(()=>rd)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>ud)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>hd)).DatePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>Od)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>Pd)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>zd)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>Zd)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Hd)).TextinputElement,textarea:async()=>(await Promise.resolve().then(()=>Qd)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>au)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>lu)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>hu)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>wu)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>Su)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>Au)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>zu)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>qu)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>Vu)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>Gu)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Ku)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Qu)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>tp)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>np)).RendererElement};var kl=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,Zt=(e,t,i,n)=>{for(var a=n>1?void 0:n?_l(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&kl(t,i,a),a};S.FormElement=class extends d.LitElement{constructor(){super(...arguments),this.autocomplete=void 0}setData(t){this.coreForm?.setData(t)}setMeta(t){this.coreForm?.setMeta(t)}createRenderRoot(){return this}render(){const t=this.config,i=Wn(t.formDef,t.formSelectors,t.formConfig),n={formDef:i.formDef,widgetLoaders:{...La,...i.widgetLoaders,...t.customWidgetLoaders??{}},dependencies:{...i.dependencies??{},...t.dependencies??{}},validateOn:t.validateOn??i.validateOn??"eager",itemRenderers:{...i.itemRenderers??{},...t.itemRenderers??{}},localization:t.localization,middlewares:t.middlewares??[],data:t.data,meta:t.meta,formName:t.formName},a=ml({...t.customValidators??{}}),r=i.formEvent,s=r?l=>r(l.detail):void 0;return d.html`
4
4
  <gui-core-form
5
5
  .config=${n}
6
6
  .validators=${a}
7
7
  .autocomplete=${this.autocomplete}
8
8
  @formEvent=${s}
9
9
  ></gui-core-form>
10
- `}},Zt([o.property({attribute:!1})],C.FormElement.prototype,"config",2),Zt([o.property({type:String})],C.FormElement.prototype,"autocomplete",2),Zt([o.query("gui-core-form")],C.FormElement.prototype,"coreForm",2),C.FormElement=Zt([o.customElement("gui-form")],C.FormElement);var Cl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,Ie=(e,t,i,n)=>{for(var a=n>1?void 0:n?Sl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Cl(t,i,a),a};let _e=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.disabled=!1,this.icon=void 0,this.variant="filled",this.iconPosition="left",this.actionType="button",this.invalid=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){const e=this.icon,t=this.iconPosition||"left",i={"gui-button-with-icon":!!e,[`gui-button-icon-${t}`]:!0,"gui-button--outlined":this.variant==="outlined","gui-button--link":this.variant==="link","gui-button--invalid":this.invalid&&this.actionType==="submit"},n=e?d.html`<span class="gui-widget-icon gui-button-icon ${e}" data-icon=${e}></span>`:d.nothing;return d.html`
10
+ `}},Zt([o.property({attribute:!1})],S.FormElement.prototype,"config",2),Zt([o.property({type:String})],S.FormElement.prototype,"autocomplete",2),Zt([o.query("gui-core-form")],S.FormElement.prototype,"coreForm",2),S.FormElement=Zt([o.customElement("gui-form")],S.FormElement);var Cl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,Ie=(e,t,i,n)=>{for(var a=n>1?void 0:n?Sl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Cl(t,i,a),a};let _e=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.disabled=!1,this.icon=void 0,this.variant="filled",this.iconPosition="left",this.actionType="button",this.invalid=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){const e=this.icon,t=this.iconPosition||"left",i={"gui-button-with-icon":!!e,[`gui-button-icon-${t}`]:!0,"gui-button--outlined":this.variant==="outlined","gui-button--link":this.variant==="link","gui-button--invalid":this.invalid&&this.actionType==="submit"},n=e?d.html`<span class="gui-widget-icon gui-button-icon ${e}" data-icon=${e}></span>`:d.nothing;return d.html`
11
11
  <div class="gui-widget">
12
12
  <button
13
13
  type=${this.actionType??"button"}
@@ -41,15 +41,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
41
41
  id=${n?`${e}_${n}_label`:`${e}_label`}
42
42
  >
43
43
  ${t.label+(t.required?" *":"")} ${Na(e,t)}
44
- ${i?F(e,t):d.nothing}
44
+ ${i?N(e,t):d.nothing}
45
45
  </label>`:d.nothing:t.label?d.html`<span
46
46
  class="gui-label"
47
47
  data-cy=${`${e}_label`}
48
48
  id=${n?`${e}_${n}_label`:`${e}_label`}
49
49
  >
50
50
  ${t.label+(t.required?" *":"")} ${Na(e,t)}
51
- ${i?F(e,t):d.nothing}
52
- </span>`:d.nothing,Na=(e,t)=>t.hint?d.html`<div class="gui-widget-hint" id=${`${e}_hint`}>${t.hint}</div>`:d.html``,Ze=(e,t)=>{const i={[`gui-${e}--icon`]:!1,[`gui-${e}--icon-right`]:!1};if(t.icon){i[`gui-${e}--icon`]=!0;const n={"gui-widget-icon":!0,[t.icon]:!0};return{widgetClasses:i,html:d.html`<span class=${$.classMap(n)} data-icon=${t.icon}></span>`}}else return{widgetClasses:i,html:d.html``}},F=(e,t)=>{const i=t.touched&&t.errors&&t.errors.length>0;return d.html`${i?d.html`<ul class="gui-validator" id=${`${e}_errors`} data-cy=${`${e}_validator-errors`}>
51
+ ${i?N(e,t):d.nothing}
52
+ </span>`:d.nothing,Na=(e,t)=>t.hint?d.html`<div class="gui-widget-hint" id=${`${e}_hint`}>${t.hint}</div>`:d.html``,Ze=(e,t)=>{const i={[`gui-${e}--icon`]:!1,[`gui-${e}--icon-right`]:!1};if(t.icon){i[`gui-${e}--icon`]=!0;const n={"gui-widget-icon":!0,[t.icon]:!0};return{widgetClasses:i,html:d.html`<span class=${$.classMap(n)} data-icon=${t.icon}></span>`}}else return{widgetClasses:i,html:d.html``}},N=(e,t)=>{const i=t.touched&&t.errors&&t.errors.length>0;return d.html`${i?d.html`<ul class="gui-validator" id=${`${e}_errors`} data-cy=${`${e}_validator-errors`}>
53
53
  ${t.errors?.map(n=>d.html`<li class="gui-validator__error" role="alert" data-cy=${`${e}_validator-error`}>
54
54
  ${n}
55
55
  </li>`)}
@@ -77,7 +77,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
77
77
  ${this.prevMonthIcon?d.html`<span
78
78
  class=${`gui-widget-icon ${this.prevMonthIcon}`}
79
79
  data-icon=${this.prevMonthIcon}
80
- ></span>`:d.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256"><path d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"></path></svg>`}
80
+ ></span>`:d.html`<svg
81
+ xmlns="http://www.w3.org/2000/svg"
82
+ width="16"
83
+ height="16"
84
+ viewBox="0 0 256 256"
85
+ >
86
+ <path
87
+ d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"
88
+ ></path>
89
+ </svg>`}
81
90
  </button>
82
91
 
83
92
  <div class="gui-calendar__months-grid">
@@ -95,13 +104,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
95
104
  ${this.nextMonthIcon?d.html`<span
96
105
  class=${`gui-widget-icon ${this.nextMonthIcon}`}
97
106
  data-icon=${this.nextMonthIcon}
98
- ></span>`:d.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"></path></svg>`}
107
+ ></span>`:d.html`<svg
108
+ xmlns="http://www.w3.org/2000/svg"
109
+ width="16"
110
+ height="16"
111
+ viewBox="0 0 256 256"
112
+ >
113
+ <path
114
+ d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"
115
+ ></path>
116
+ </svg>`}
99
117
  </button>
100
118
  </div>
101
119
  </div>
102
120
  </div>
103
121
 
104
- ${this.errors?.length?F(this.uid,t):d.nothing}
122
+ ${this.errors?.length?N(this.uid,t):d.nothing}
105
123
  `}renderMonthPanel(t){const i=this.getDaysInMonth(t),n=this.chunkDays(i),a=Al(this.localeId),r=new Date(this._currentDate);return r.setDate(1),r.setMonth(r.getMonth()+t),d.html`
106
124
  <div class="gui-calendar__panel">
107
125
  ${this.renderHeader(r)}
@@ -211,7 +229,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
211
229
  @change=${this.valueChanged}
212
230
  @blur=${()=>this.adapter.onBlur()}
213
231
  ></gui-calendar>
214
- `}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};di([b.consume({context:y.formContext}),o.property({attribute:!1})],st.prototype,"formContext",2),di([b.provide({context:y.inputContext})],st.prototype,"adapter",2),st=di([o.customElement("gui-calendar-input")],st);const Nl=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return st}},Symbol.toStringTag,{value:"Module"}));function Ut(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const n=new IntersectionObserver(a=>{a.forEach(r=>{t(r.isIntersecting)})},i);return n.observe(e),n}var ql=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,pe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Bl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&ql(t,i,a),a};let ee=class extends d.LitElement{constructor(){super(...arguments),this.items=[],this.clickable=!1,this.removable=!0,this.bubble=!0,this.tabbable=!0,this.disabled=!1,this.readOnly=!1,this.removeAriaLabel="Remove",this._isStartVisible=!0,this._isEndVisible=!0,this._showDropdown=!1,this._pendingFocusIndex=null,this.handlePillFocus=e=>{e.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},this.toggleDropdown=()=>{this._showDropdown?this.closeDropdown():this.openDropdown()},this.handleOutsideInteraction=e=>{const t=this.querySelector(".gui-pills__compact"),i=this.querySelector(".gui-pills__dropdown"),n=e.composedPath()[0];!t?.contains(n)&&!i?.contains(n)&&this.closeDropdown()}}createRenderRoot(){return this}updated(e){if(super.updated(e),this.setupObservers(),this._pendingFocusIndex!==null&&e.has("items")){const t=this._pendingFocusIndex;this._pendingFocusIndex=null;const i=this.items.length;if(i===0){this._showDropdown&&this.closeDropdown();return}const n=Math.max(0,Math.min(t,i-1));this.focusPillAt(n)}}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e=this.items.length;return e===0?d.nothing:d.html`
232
+ `}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};di([b.consume({context:y.formContext}),o.property({attribute:!1})],st.prototype,"formContext",2),di([b.provide({context:y.inputContext})],st.prototype,"adapter",2),st=di([o.customElement("gui-calendar-input")],st);const Nl=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return st}},Symbol.toStringTag,{value:"Module"}));function Ut(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const n=new IntersectionObserver(a=>{a.forEach(r=>{t(r.isIntersecting)})},i);return n.observe(e),n}var ql=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,pe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Bl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&ql(t,i,a),a};let te=class extends d.LitElement{constructor(){super(...arguments),this.items=[],this.clickable=!1,this.removable=!0,this.bubble=!0,this.tabbable=!0,this.disabled=!1,this.readOnly=!1,this.removeAriaLabel="Remove",this._isStartVisible=!0,this._isEndVisible=!0,this._showDropdown=!1,this._pendingFocusIndex=null,this.handlePillFocus=e=>{e.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},this.toggleDropdown=()=>{this._showDropdown?this.closeDropdown():this.openDropdown()},this.handleOutsideInteraction=e=>{const t=this.querySelector(".gui-pills__compact"),i=this.querySelector(".gui-pills__dropdown"),n=e.composedPath()[0];!t?.contains(n)&&!i?.contains(n)&&this.closeDropdown()}}createRenderRoot(){return this}updated(e){if(super.updated(e),this.setupObservers(),this._pendingFocusIndex!==null&&e.has("items")){const t=this._pendingFocusIndex;this._pendingFocusIndex=null;const i=this.items.length;if(i===0){this._showDropdown&&this.closeDropdown();return}const n=Math.max(0,Math.min(t,i-1));this.focusPillAt(n)}}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e=this.items.length;return e===0?d.nothing:d.html`
215
233
  ${this.renderStrip()} ${this.bubble?this.renderCompact(e):d.nothing}
216
234
  ${this.bubble&&this._showDropdown?this.renderDropdown():d.nothing}
217
235
  `}renderStrip(){return d.html`
@@ -282,7 +300,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
282
300
  ></path>
283
301
  </svg>`}
284
302
  </button>
285
- `}onPillClick(e,t){!this.clickable||this.disabled||this.readOnly||(e.stopPropagation(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0})))}onPillKeydown(e,t,i){if(this.disabled||this.readOnly){this.emitKeydown(t.key,e);return}if(this.removable&&(e.key==="Delete"||e.key==="Backspace")){e.preventDefault(),e.stopPropagation(),this.emitRemove(t.key,i);return}if((e.key==="Enter"||e.key===" ")&&this.clickable){e.preventDefault(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0}));return}const n=this._showDropdown,a=n?"ArrowUp":"ArrowLeft",r=n?"ArrowDown":"ArrowRight";if(e.key===a){i>0?(e.preventDefault(),this.focusPillAt(i-1)):this.emitKeydown(t.key,e);return}if(e.key===r){i<this.items.length-1?(e.preventDefault(),this.focusPillAt(i+1)):this.emitKeydown(t.key,e);return}if(e.key==="Home"){e.preventDefault(),this.focusPillAt(0);return}if(e.key==="End"){e.preventDefault(),this.focusPillAt(this.items.length-1);return}if(e.key==="Escape"&&n){e.preventDefault(),this.closeDropdown();return}this.emitKeydown(t.key,e)}emitRemove(e,t){this._pendingFocusIndex=t,this.dispatchEvent(new CustomEvent("pillremove",{detail:{key:e},bubbles:!0,composed:!0}))}emitKeydown(e,t){this.dispatchEvent(new CustomEvent("pillkeydown",{detail:{key:e,event:t},bubbles:!0,composed:!0}))}focusPillAt(e){requestAnimationFrame(()=>{const t=this._showDropdown?".gui-pills__dropdown .gui-pills__pill":".gui-pills__strip .gui-pills__pill",i=this.querySelectorAll(t);if(i.length===0)return;const n=Math.max(0,Math.min(e,i.length-1));i[n].focus()})}openDropdown(){!this.bubble||this.disabled||this.readOnly||this._showDropdown||(this._showDropdown=!0,this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!0},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{this.addOutsideListeners(),this.querySelector(".gui-pills__dropdown .gui-pills__pill")?.focus()}))}closeDropdown(){this._showDropdown&&(this._showDropdown=!1,this.removeOutsideListeners(),this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!1},bubbles:!0,composed:!0})))}addOutsideListeners(){document.addEventListener("pointerdown",this.handleOutsideInteraction),document.addEventListener("focusin",this.handleOutsideInteraction)}removeOutsideListeners(){document.removeEventListener("pointerdown",this.handleOutsideInteraction),document.removeEventListener("focusin",this.handleOutsideInteraction)}setupObservers(){const e=this.querySelector(".gui-sentinel__start"),t=this.querySelector(".gui-sentinel__end");e&&!this.startObserver&&(this.startObserver=Ut(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=Ut(t,i=>this._isEndVisible=i)),!e&&this.startObserver&&(this.startObserver.disconnect(),this.startObserver=void 0,this._isStartVisible=!0),!t&&this.endObserver&&(this.endObserver.disconnect(),this.endObserver=void 0,this._isEndVisible=!0)}disconnectObservers(){this.startObserver?.disconnect(),this.endObserver?.disconnect(),this.startObserver=void 0,this.endObserver=void 0}};pe([o.property({type:Array})],ee.prototype,"items",2),pe([o.property({type:Boolean})],ee.prototype,"clickable",2),pe([o.property({type:Boolean})],ee.prototype,"removable",2),pe([o.property({type:Boolean})],ee.prototype,"bubble",2),pe([o.property({type:Boolean})],ee.prototype,"tabbable",2),pe([o.property({type:Boolean})],ee.prototype,"disabled",2),pe([o.property({type:Boolean,attribute:"readonly"})],ee.prototype,"readOnly",2),pe([o.property({type:String,attribute:"remove-aria-label"})],ee.prototype,"removeAriaLabel",2),pe([o.property({type:String,attribute:"remove-icon"})],ee.prototype,"removeIcon",2),pe([o.property({type:String,attribute:"compact-aria-label"})],ee.prototype,"compactAriaLabel",2),pe([o.state()],ee.prototype,"_isStartVisible",2),pe([o.state()],ee.prototype,"_isEndVisible",2),pe([o.state()],ee.prototype,"_showDropdown",2),ee=pe([o.customElement("gui-pills")],ee),typeof customElements<"u"&&!customElements.get("gui-pills")&&customElements.define("gui-pills",ee);var Zl=Object.defineProperty,Vl=Object.getOwnPropertyDescriptor,Re=(e,t,i,n)=>{for(var a=n>1?void 0:n?Vl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Zl(t,i,a),a};let xe=class extends O{constructor(){super(...arguments),this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this._anchorDate=null,this._nextDate=null,this._isSelecting=!1,this._skipValueNavigation=!1,this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const i=this.getSortedPills().find(a=>`${a.start}-${a.end??a.start}`===e.detail.key);if(!i)return;const n=(this.value??[]).filter(a=>!(a.start===i.start&&(a.end??null)===(i.end??null)));this.value=n,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))},this.onPillClickEvent=e=>{const i=this.getSortedPills().find(n=>`${n.start}-${n.end??n.start}`===e.detail.key);i&&this.navigateToDate(i.start)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")&&!e.has("focusDate")){if(this._skipValueNavigation)this._skipValueNavigation=!1;else if(this.value){const t=Array.isArray(this.value)?this.value:[{start:this.value}];if(t.length>0&&t[0].start){const i=new Date(t[0].start);!isNaN(i.getTime())&&!Be(i,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=i)}}}if(e.has("focusDate")&&this.focusDate){const t=new Date(this.focusDate);isNaN(t.getTime())||(Be(t,this._currentDate,this.numberOfMonths??1)||(this._currentDate=t),this.focusDate=void 0)}}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,"other-month":!e.isCurrentMonth,"range-start":e.isRangeStart&&!e.isOneDayRange,"range-end":e.isRangeEnd&&!e.isOneDayRange,selected:e.isOneDayRange,"in-range":e.isInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return d.html`
303
+ `}onPillClick(e,t){!this.clickable||this.disabled||this.readOnly||(e.stopPropagation(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0})))}onPillKeydown(e,t,i){if(this.disabled||this.readOnly){this.emitKeydown(t.key,e);return}if(this.removable&&(e.key==="Delete"||e.key==="Backspace")){e.preventDefault(),e.stopPropagation(),this.emitRemove(t.key,i);return}if((e.key==="Enter"||e.key===" ")&&this.clickable){e.preventDefault(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0}));return}const n=this._showDropdown,a=n?"ArrowUp":"ArrowLeft",r=n?"ArrowDown":"ArrowRight";if(e.key===a){i>0?(e.preventDefault(),this.focusPillAt(i-1)):this.emitKeydown(t.key,e);return}if(e.key===r){i<this.items.length-1?(e.preventDefault(),this.focusPillAt(i+1)):this.emitKeydown(t.key,e);return}if(e.key==="Home"){e.preventDefault(),this.focusPillAt(0);return}if(e.key==="End"){e.preventDefault(),this.focusPillAt(this.items.length-1);return}if(e.key==="Escape"&&n){e.preventDefault(),this.closeDropdown();return}this.emitKeydown(t.key,e)}emitRemove(e,t){this._pendingFocusIndex=t,this.dispatchEvent(new CustomEvent("pillremove",{detail:{key:e},bubbles:!0,composed:!0}))}emitKeydown(e,t){this.dispatchEvent(new CustomEvent("pillkeydown",{detail:{key:e,event:t},bubbles:!0,composed:!0}))}focusPillAt(e){requestAnimationFrame(()=>{const t=this._showDropdown?".gui-pills__dropdown .gui-pills__pill":".gui-pills__strip .gui-pills__pill",i=this.querySelectorAll(t);if(i.length===0)return;const n=Math.max(0,Math.min(e,i.length-1));i[n].focus()})}openDropdown(){!this.bubble||this.disabled||this.readOnly||this._showDropdown||(this._showDropdown=!0,this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!0},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{this.addOutsideListeners(),this.querySelector(".gui-pills__dropdown .gui-pills__pill")?.focus()}))}closeDropdown(){this._showDropdown&&(this._showDropdown=!1,this.removeOutsideListeners(),this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!1},bubbles:!0,composed:!0})))}addOutsideListeners(){document.addEventListener("pointerdown",this.handleOutsideInteraction),document.addEventListener("focusin",this.handleOutsideInteraction)}removeOutsideListeners(){document.removeEventListener("pointerdown",this.handleOutsideInteraction),document.removeEventListener("focusin",this.handleOutsideInteraction)}setupObservers(){const e=this.querySelector(".gui-sentinel__start"),t=this.querySelector(".gui-sentinel__end");e&&!this.startObserver&&(this.startObserver=Ut(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=Ut(t,i=>this._isEndVisible=i)),!e&&this.startObserver&&(this.startObserver.disconnect(),this.startObserver=void 0,this._isStartVisible=!0),!t&&this.endObserver&&(this.endObserver.disconnect(),this.endObserver=void 0,this._isEndVisible=!0)}disconnectObservers(){this.startObserver?.disconnect(),this.endObserver?.disconnect(),this.startObserver=void 0,this.endObserver=void 0}};pe([o.property({type:Array})],te.prototype,"items",2),pe([o.property({type:Boolean})],te.prototype,"clickable",2),pe([o.property({type:Boolean})],te.prototype,"removable",2),pe([o.property({type:Boolean})],te.prototype,"bubble",2),pe([o.property({type:Boolean})],te.prototype,"tabbable",2),pe([o.property({type:Boolean})],te.prototype,"disabled",2),pe([o.property({type:Boolean,attribute:"readonly"})],te.prototype,"readOnly",2),pe([o.property({type:String,attribute:"remove-aria-label"})],te.prototype,"removeAriaLabel",2),pe([o.property({type:String,attribute:"remove-icon"})],te.prototype,"removeIcon",2),pe([o.property({type:String,attribute:"compact-aria-label"})],te.prototype,"compactAriaLabel",2),pe([o.state()],te.prototype,"_isStartVisible",2),pe([o.state()],te.prototype,"_isEndVisible",2),pe([o.state()],te.prototype,"_showDropdown",2),te=pe([o.customElement("gui-pills")],te),typeof customElements<"u"&&!customElements.get("gui-pills")&&customElements.define("gui-pills",te);var Zl=Object.defineProperty,Vl=Object.getOwnPropertyDescriptor,Re=(e,t,i,n)=>{for(var a=n>1?void 0:n?Vl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Zl(t,i,a),a};let Ee=class extends O{constructor(){super(...arguments),this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this._anchorDate=null,this._nextDate=null,this._isSelecting=!1,this._skipValueNavigation=!1,this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const i=this.getSortedPills().find(a=>`${a.start}-${a.end??a.start}`===e.detail.key);if(!i)return;const n=(this.value??[]).filter(a=>!(a.start===i.start&&(a.end??null)===(i.end??null)));this.value=n,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))},this.onPillClickEvent=e=>{const i=this.getSortedPills().find(n=>`${n.start}-${n.end??n.start}`===e.detail.key);i&&this.navigateToDate(i.start)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")&&!e.has("focusDate")){if(this._skipValueNavigation)this._skipValueNavigation=!1;else if(this.value){const t=Array.isArray(this.value)?this.value:[{start:this.value}];if(t.length>0&&t[0].start){const i=new Date(t[0].start);!isNaN(i.getTime())&&!Be(i,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=i)}}}if(e.has("focusDate")&&this.focusDate){const t=new Date(this.focusDate);isNaN(t.getTime())||(Be(t,this._currentDate,this.numberOfMonths??1)||(this._currentDate=t),this.focusDate=void 0)}}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,"other-month":!e.isCurrentMonth,"range-start":e.isRangeStart&&!e.isOneDayRange,"range-end":e.isRangeEnd&&!e.isOneDayRange,selected:e.isOneDayRange,"in-range":e.isInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return d.html`
286
304
  <button
287
305
  type="button"
288
306
  role="gridcell"
@@ -311,7 +329,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
311
329
  @pillremove=${this.onPillRemoveEvent}
312
330
  @pillclick=${this.onPillClickEvent}
313
331
  ></gui-pills>
314
- `}formatDateForDisplay(e){const t=new Date(e);return isNaN(t.getTime())?e:new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}getSortedPills(){return!this.value||!Array.isArray(this.value)?[]:[...this.value].sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}navigateToDate(e){const t=new Date(e);!isNaN(t.getTime())&&!Be(t,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=t)}};Re([o.property({type:Array})],xe.prototype,"value",2),Re([o.property({type:String})],xe.prototype,"focusDate",2),Re([o.property({type:Boolean})],xe.prototype,"hidePills",2),Re([o.property({type:String})],xe.prototype,"removePillAriaLabel",2),Re([o.state()],xe.prototype,"_anchorDate",2),Re([o.state()],xe.prototype,"_nextDate",2),Re([o.state()],xe.prototype,"_isSelecting",2),xe=Re([o.customElement("gui-range-calendar")],xe),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",xe);var Ul=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,ui=(e,t,i,n)=>{for(var a=n>1?void 0:n?Wl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Ul(t,i,a),a};let ot=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
332
+ `}formatDateForDisplay(e){const t=new Date(e);return isNaN(t.getTime())?e:new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}getSortedPills(){return!this.value||!Array.isArray(this.value)?[]:[...this.value].sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}navigateToDate(e){const t=new Date(e);!isNaN(t.getTime())&&!Be(t,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=t)}};Re([o.property({type:Array})],Ee.prototype,"value",2),Re([o.property({type:String})],Ee.prototype,"focusDate",2),Re([o.property({type:Boolean})],Ee.prototype,"hidePills",2),Re([o.property({type:String})],Ee.prototype,"removePillAriaLabel",2),Re([o.state()],Ee.prototype,"_anchorDate",2),Re([o.state()],Ee.prototype,"_nextDate",2),Re([o.state()],Ee.prototype,"_isSelecting",2),Ee=Re([o.customElement("gui-range-calendar")],Ee),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",Ee);var Ul=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,ui=(e,t,i,n)=>{for(var a=n>1?void 0:n?Wl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Ul(t,i,a),a};let ot=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
315
333
  <gui-range-calendar
316
334
  .uid=${this.widget.uid}
317
335
  .label=${this.adapter.templateData.label}
@@ -339,7 +357,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
339
357
  @change=${this.valueChanged}
340
358
  @blur=${()=>this.adapter.onBlur()}
341
359
  ></gui-range-calendar>
342
- `}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ui([b.consume({context:y.formContext}),o.property({attribute:!1})],ot.prototype,"formContext",2),ui([b.provide({context:y.inputContext})],ot.prototype,"adapter",2),ot=ui([o.customElement("gui-range-calendar-input")],ot);const Gl=Object.freeze(Object.defineProperty({__proto__:null,get RangeCalendarElement(){return ot}},Symbol.toStringTag,{value:"Module"}));var Hl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,N=(e,t,i,n)=>{for(var a=n>1?void 0:n?Yl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Hl(t,i,a),a};let A=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=[],this.hint=void 0,this.icon="",this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.separator=void 0,this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-range-date-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=this.getSortedPills(),i=t.findIndex(r=>`${r.start}-${r.end??r.start}`===e.detail.key);if(i<0)return;const n=t[i],a=(this.value??[]).filter(r=>!(r.start===n.start&&(r.end??null)===(n.end??null)));this.value=a,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),a.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-input__field input")?.focus()})},this.onPillClickEvent=e=>{const i=this.getSortedPills().find(n=>`${n.start}-${n.end??n.start}`===e.detail.key);i&&this.onPillClick(i)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),n=this.getSortedPills().map(r=>{const s=this.formatDateForDisplay(r.start),l=r.end?this.formatDateForDisplay(r.end):s,u=`${s} - ${l}`;return{key:`${r.start}-${r.end??r.start}`,label:u,ariaLabel:`${this.removePillAriaLabel??"Remove date"} ${u}`}}),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return d.html`
360
+ `}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ui([b.consume({context:y.formContext}),o.property({attribute:!1})],ot.prototype,"formContext",2),ui([b.provide({context:y.inputContext})],ot.prototype,"adapter",2),ot=ui([o.customElement("gui-range-calendar-input")],ot);const Gl=Object.freeze(Object.defineProperty({__proto__:null,get RangeCalendarElement(){return ot}},Symbol.toStringTag,{value:"Module"}));var Hl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,q=(e,t,i,n)=>{for(var a=n>1?void 0:n?Yl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Hl(t,i,a),a};let A=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=[],this.hint=void 0,this.icon="",this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.separator=void 0,this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-range-date-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=this.getSortedPills(),i=t.findIndex(r=>`${r.start}-${r.end??r.start}`===e.detail.key);if(i<0)return;const n=t[i],a=(this.value??[]).filter(r=>!(r.start===n.start&&(r.end??null)===(n.end??null)));this.value=a,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),a.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-input__field input")?.focus()})},this.onPillClickEvent=e=>{const i=this.getSortedPills().find(n=>`${n.start}-${n.end??n.start}`===e.detail.key);i&&this.onPillClick(i)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),n=this.getSortedPills().map(r=>{const s=this.formatDateForDisplay(r.start),l=r.end?this.formatDateForDisplay(r.end):s,u=`${s} - ${l}`;return{key:`${r.start}-${r.end??r.start}`,label:u,ariaLabel:`${this.removePillAriaLabel??"Remove date"} ${u}`}}),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return d.html`
343
361
  ${this.label?le(this.uid,e,!1,void 0,!1):d.nothing}
344
362
 
345
363
  <div class="gui-widget">
@@ -386,7 +404,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
386
404
  </div>
387
405
  </div>
388
406
 
389
- ${this.showErrors&&this.errors?.length?F(this.uid,e):d.nothing}
407
+ ${this.showErrors&&this.errors?.length?N(this.uid,e):d.nothing}
390
408
  </div>
391
409
  `}renderDateInputs(e,t){const i=e==="start"?this._startDate:this._endDate;return fe.repeat(t,n=>`${e}-${n.type}`,(n,a)=>{const r=e==="start"&&a===0?0:-1;switch(n.type){case"day":return this.renderInput(e,"day","dd",2,r,i.day);case"month":return this.renderInput(e,"month","mm",2,r,i.month);case"year":return this.renderInput(e,"year","yyyy",4,r,i.year);case"literal":return d.html`<span class="gui-range-date-input__separator">${n.value}</span>`;default:return""}})}renderInput(e,t,i,n,a,r){return d.html`
392
410
  <div class="gui-range-date-input__touch-target">
@@ -412,7 +430,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
412
430
  />
413
431
  <div class="gui-range-date-input__visual-underline"></div>
414
432
  </div>
415
- `}formatDateForDisplay(e){const t=new Date(e);return isNaN(t.getTime())?e:new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}getSortedPills(){return!this.value||!Array.isArray(this.value)?[]:[...this.value].sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t,i){if(this.readOnly)return;const n=window.getComputedStyle(this).direction==="rtl",a=e.target,r=this.getGroupInputs(t),s=r.indexOf(a);if(a.value.length===a.maxLength&&/^[0-9]$/.test(e.key))if(s===r.length-1){if(t==="start"){const l=this.getGroupInputs("end");l.length>0&&l[0].focus()}}else r[s+1].focus();switch(e.key){case"Enter":{if(this.tryCreatePill(),this.value&&this.value.length>0){const l=this.value[this.value.length-1];this.onPillClick(l)}break}case"ArrowUp":{const l=isNaN(parseInt(a.value,10)+1)?1:parseInt(a.value,10)+1;this.setDatePartValue(t,i,l),a.select(),this.tryCreatePill();break}case"ArrowDown":{const l=isNaN(parseInt(a.value,10)-1)?1:parseInt(a.value,10)-1;this.setDatePartValue(t,i,l),a.select(),this.tryCreatePill();break}case"ArrowLeft":{const l=n?s+1:s-1;if(l>=0&&l<r.length)r[l].focus(),r[l].select();else{const u=n?"end":"start";if(t!==u){const p=this.getGroupInputs(u);if(p.length>0){const c=p[p.length-1];c.focus(),c.select()}}}break}case"ArrowRight":{const l=n?s-1:s+1;if(l>=0&&l<r.length)r[l].focus(),r[l].select();else{const u=n?"start":"end";if(t!==u){const p=this.getGroupInputs(u);p.length>0&&(p[0].focus(),p[0].select())}}break}}}handleChange(e,t,i){if(e.stopImmediatePropagation(),this.readOnly)return;const a=e.target.value.replace(/[^0-9]/g,"");this.updateDatePart(t,i,a),this.tryCreatePill()}handleBlur(e,t,i){const n=e.target,a=parseInt(n.value,10);if(!isNaN(a)&&a>0){const r=i==="year"?4:2;n.value=a.toString().padStart(r,"0")}this.dispatchEvent(new CustomEvent("blur"))}getGroupInputs(e){return Array.from(this.querySelectorAll(`input[data-group="${e}"]`))}setDatePartValue(e,t,i){const n=e==="start"?this._startDate:this._endDate,a=t==="year"?4:2;t==="day"&&(n.day=i.toString().padStart(a,"0")),t==="month"&&(n.month=i.toString().padStart(a,"0")),t==="year"&&(n.year=i.toString().padStart(a,"0")),e==="start"?this._startDate={...n}:this._endDate={...n}}updateDatePart(e,t,i){e==="start"?this._startDate={...this._startDate,[t]:i}:this._endDate={...this._endDate,[t]:i}}validateDateParts(e){let t=parseInt(e.year,10),i=parseInt(e.month,10),n=parseInt(e.day,10);if(isNaN(t)||isNaN(i)||isNaN(n)||String(t).length<4)return null;t=Math.max(this.MIN_YEAR,Math.min(this.MAX_YEAR,t)),i=Math.max(this.MIN_MONTH,Math.min(this.MAX_MONTH,i)),n=Math.max(this.MIN_DAY,Math.min(this.MAX_DAY,n));const a=this.MAX_VALID_DAY(i,t);return n>a?(this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0})),null):new Date(t,i-1,n)}tryCreatePill(){const e=this.validateDateParts(this._startDate),t=this.validateDateParts(this._endDate);if(!e||!t)return;let i=e,n=t;t.getTime()<e.getTime()&&(i=t,n=e);const a=Ae(i),r=Ae(n),s=a===r?{start:a}:{start:a,end:r},l=this.value?[...this.value]:[];l.push(s),this.value=Fa(l),this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{const u=this.getGroupInputs("start");u.length>0&&u[0].focus()}),this.requestUpdate()}};N([o.property({type:String})],A.prototype,"uid",2),N([o.property({type:String})],A.prototype,"label",2),N([o.property({type:String,attribute:"locale-id"})],A.prototype,"localeId",2),N([o.property({type:Array})],A.prototype,"errors",2),N([o.property({type:Boolean})],A.prototype,"showErrors",2),N([o.property({type:Boolean})],A.prototype,"touched",2),N([o.property({type:Boolean})],A.prototype,"required",2),N([o.property({type:Boolean})],A.prototype,"disabled",2),N([o.property({type:Boolean,attribute:"readonly"})],A.prototype,"readOnly",2),N([o.property({type:Array})],A.prototype,"value",2),N([o.property({type:String})],A.prototype,"hint",2),N([o.property({type:String})],A.prototype,"icon",2),N([o.property({type:String})],A.prototype,"removePillAriaLabel",2),N([o.property({type:String})],A.prototype,"startDateAriaLabel",2),N([o.property({type:String})],A.prototype,"endDateAriaLabel",2),N([o.property({type:String})],A.prototype,"separator",2),N([o.state()],A.prototype,"_startDate",2),N([o.state()],A.prototype,"_endDate",2),A=N([o.customElement("gui-range-date")],A),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",A);var Kl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,pi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Jl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Kl(t,i,a),a};let lt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
433
+ `}formatDateForDisplay(e){const t=new Date(e);return isNaN(t.getTime())?e:new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}getSortedPills(){return!this.value||!Array.isArray(this.value)?[]:[...this.value].sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t,i){if(this.readOnly)return;const n=window.getComputedStyle(this).direction==="rtl",a=e.target,r=this.getGroupInputs(t),s=r.indexOf(a);if(a.value.length===a.maxLength&&/^[0-9]$/.test(e.key))if(s===r.length-1){if(t==="start"){const l=this.getGroupInputs("end");l.length>0&&l[0].focus()}}else r[s+1].focus();switch(e.key){case"Enter":{if(this.tryCreatePill(),this.value&&this.value.length>0){const l=this.value[this.value.length-1];this.onPillClick(l)}break}case"ArrowUp":{const l=isNaN(parseInt(a.value,10)+1)?1:parseInt(a.value,10)+1;this.setDatePartValue(t,i,l),a.select(),this.tryCreatePill();break}case"ArrowDown":{const l=isNaN(parseInt(a.value,10)-1)?1:parseInt(a.value,10)-1;this.setDatePartValue(t,i,l),a.select(),this.tryCreatePill();break}case"ArrowLeft":{const l=n?s+1:s-1;if(l>=0&&l<r.length)r[l].focus(),r[l].select();else{const u=n?"end":"start";if(t!==u){const p=this.getGroupInputs(u);if(p.length>0){const c=p[p.length-1];c.focus(),c.select()}}}break}case"ArrowRight":{const l=n?s-1:s+1;if(l>=0&&l<r.length)r[l].focus(),r[l].select();else{const u=n?"start":"end";if(t!==u){const p=this.getGroupInputs(u);p.length>0&&(p[0].focus(),p[0].select())}}break}}}handleChange(e,t,i){if(e.stopImmediatePropagation(),this.readOnly)return;const a=e.target.value.replace(/[^0-9]/g,"");this.updateDatePart(t,i,a),this.tryCreatePill()}handleBlur(e,t,i){const n=e.target,a=parseInt(n.value,10);if(!isNaN(a)&&a>0){const r=i==="year"?4:2;n.value=a.toString().padStart(r,"0")}this.dispatchEvent(new CustomEvent("blur"))}getGroupInputs(e){return Array.from(this.querySelectorAll(`input[data-group="${e}"]`))}setDatePartValue(e,t,i){const n=e==="start"?this._startDate:this._endDate,a=t==="year"?4:2;t==="day"&&(n.day=i.toString().padStart(a,"0")),t==="month"&&(n.month=i.toString().padStart(a,"0")),t==="year"&&(n.year=i.toString().padStart(a,"0")),e==="start"?this._startDate={...n}:this._endDate={...n}}updateDatePart(e,t,i){e==="start"?this._startDate={...this._startDate,[t]:i}:this._endDate={...this._endDate,[t]:i}}validateDateParts(e){let t=parseInt(e.year,10),i=parseInt(e.month,10),n=parseInt(e.day,10);if(isNaN(t)||isNaN(i)||isNaN(n)||String(t).length<4)return null;t=Math.max(this.MIN_YEAR,Math.min(this.MAX_YEAR,t)),i=Math.max(this.MIN_MONTH,Math.min(this.MAX_MONTH,i)),n=Math.max(this.MIN_DAY,Math.min(this.MAX_DAY,n));const a=this.MAX_VALID_DAY(i,t);return n>a?(this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0})),null):new Date(t,i-1,n)}tryCreatePill(){const e=this.validateDateParts(this._startDate),t=this.validateDateParts(this._endDate);if(!e||!t)return;let i=e,n=t;t.getTime()<e.getTime()&&(i=t,n=e);const a=Ae(i),r=Ae(n),s=a===r?{start:a}:{start:a,end:r},l=this.value?[...this.value]:[];l.push(s),this.value=Fa(l),this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{const u=this.getGroupInputs("start");u.length>0&&u[0].focus()}),this.requestUpdate()}};q([o.property({type:String})],A.prototype,"uid",2),q([o.property({type:String})],A.prototype,"label",2),q([o.property({type:String,attribute:"locale-id"})],A.prototype,"localeId",2),q([o.property({type:Array})],A.prototype,"errors",2),q([o.property({type:Boolean})],A.prototype,"showErrors",2),q([o.property({type:Boolean})],A.prototype,"touched",2),q([o.property({type:Boolean})],A.prototype,"required",2),q([o.property({type:Boolean})],A.prototype,"disabled",2),q([o.property({type:Boolean,attribute:"readonly"})],A.prototype,"readOnly",2),q([o.property({type:Array})],A.prototype,"value",2),q([o.property({type:String})],A.prototype,"hint",2),q([o.property({type:String})],A.prototype,"icon",2),q([o.property({type:String})],A.prototype,"removePillAriaLabel",2),q([o.property({type:String})],A.prototype,"startDateAriaLabel",2),q([o.property({type:String})],A.prototype,"endDateAriaLabel",2),q([o.property({type:String})],A.prototype,"separator",2),q([o.state()],A.prototype,"_startDate",2),q([o.state()],A.prototype,"_endDate",2),A=q([o.customElement("gui-range-date")],A),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",A);var Kl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,pi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Jl(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Kl(t,i,a),a};let lt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
416
434
  <gui-range-date
417
435
  .uid=${this.widget.uid}
418
436
  .label=${this.adapter.templateData.label}
@@ -502,7 +520,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
502
520
  ${t}
503
521
  </div>
504
522
 
505
- ${F(this.widget.uid,this.adapter.templateData)}
523
+ ${N(this.widget.uid,this.adapter.templateData)}
506
524
  `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onBlurCalendar(){this.adapter.onBlur(),this.closeCalendar()}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}onPillClick(e){this.focusDate=e.detail.range.start,this.openCalendar()}onKeyUp(e){const t=e;t.target===t.currentTarget&&(t?.key==="Enter"||t?.key===" ")&&(this.isCalendarOpen?this.closeCalendar():this.openCalendar())}toggleCalendar(e){const t=e.target,i=t.closest(".gui-range-date-input__part"),n=t.closest("gui-range-calendar");i||n?this.openCalendar():this.isCalendarOpen?this.closeCalendar():this.openCalendar()}openCalendar(){!!this.querySelector(".gui-pills__dropdown")&&(this._ignoreNextFocusOut=!0),this.closePillsDropdown(),this.isCalendarOpen||(this.isCalendarOpen=!0,this.requestUpdate())}closeCalendar(){this.isCalendarOpen=!1,this.requestUpdate()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onDocumentClick),this.removeEventListener("focusout",this.onFocusOut),this.removeEventListener("dropdowntoggle",this.onDropdownToggle),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ve([b.consume({context:y.formContext}),o.property({attribute:!1})],Te.prototype,"formContext",2),Ve([b.provide({context:y.inputContext})],Te.prototype,"adapter",2),Ve([o.query("#date-input")],Te.prototype,"dateInput",2),Ve([o.query("#calendar-input")],Te.prototype,"calendarInput",2),Ve([o.state()],Te.prototype,"isCalendarOpen",2),Ve([o.state()],Te.prototype,"focusDate",2),Te=Ve([o.customElement("gui-range-date-picker-input")],Te);const ed=Object.freeze(Object.defineProperty({__proto__:null,get RangeDatePickerElement(){return Te}},Symbol.toStringTag,{value:"Module"}));var td=Object.defineProperty,id=Object.getOwnPropertyDescriptor,M=(e,t,i,n)=>{for(var a=n>1?void 0:n?id(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&td(t,i,a),a};let P=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.currency=void 0,this.step=void 0,this.maximumFractionDigits=void 0,this.minimumFractionDigits=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&document.activeElement!==this.inputElement&&(this.displayValue=this.formatCurrency(this.value))}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,currency:this.currency,maximumFractionDigits:this.maximumFractionDigits,minimumFractionDigits:this.minimumFractionDigits,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete};this.displayValue=this.formatCurrency(this.value);const t=Ze("currency",e),i={"gui-widget-input":!0,"gui-currency--icon":!!this.icon};return d.html`
507
525
  ${le(this.uid,e)}
508
526
 
@@ -532,7 +550,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
532
550
  ${t.html}
533
551
  </div>
534
552
 
535
- ${F(this.uid,e)}
553
+ ${N(this.uid,e)}
536
554
  `}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber),this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},bubbles:!0,composed:!0}))}}handleFocus(){this.displayValue=this.formatCurrency(this.value)}handleBlur(){this.displayValue=this.formatCurrency(this.value),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}formatCurrency(e){if(e===""||e===void 0||e===null||isNaN(e))return"";try{return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),minimumFractionDigits:this.minimumFractionDigits??2}).format(e)}catch(t){return console.warn("Invalid locale or currency",t),e.toString()}}get separators(){const e=new Intl.NumberFormat(this.localeId??"en").format(1111.1);return{group:e.replace(/1/g,"").replace(/\d/g,"")[0]||",",decimal:e.replace(/1/g,"").replace(/\d/g,"").slice(-1)||"."}}};M([o.property({type:String})],P.prototype,"uid",2),M([o.property({type:String})],P.prototype,"label",2),M([o.property({type:String,attribute:"locale-id"})],P.prototype,"localeId",2),M([o.property({type:Array})],P.prototype,"errors",2),M([o.property({type:Boolean})],P.prototype,"touched",2),M([o.property({type:Boolean})],P.prototype,"required",2),M([o.property({type:Boolean})],P.prototype,"disabled",2),M([o.property({type:Boolean,attribute:"readonly"})],P.prototype,"readOnly",2),M([o.property({type:String})],P.prototype,"value",2),M([o.property({type:String})],P.prototype,"currency",2),M([o.property({type:String})],P.prototype,"step",2),M([o.property({type:String})],P.prototype,"maximumFractionDigits",2),M([o.property({type:String})],P.prototype,"minimumFractionDigits",2),M([o.property({type:String})],P.prototype,"hint",2),M([o.property({type:String})],P.prototype,"icon",2),M([o.property({type:String})],P.prototype,"placeholder",2),M([o.property({type:String})],P.prototype,"autocomplete",2),M([o.state()],P.prototype,"displayValue",2),M([o.query("input")],P.prototype,"inputElement",2),P=M([o.customElement("gui-currency")],P),typeof customElements<"u"&&!customElements.get("gui-currency")&&customElements.define("gui-currency",P);var ad=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,ci=(e,t,i,n)=>{for(var a=n>1?void 0:n?nd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&ad(t,i,a),a};let dt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-currency","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
537
555
  <gui-currency
538
556
  .uid=${this.widget.uid}
@@ -555,7 +573,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
555
573
  @input=${this.valueChanged}
556
574
  @blur=${()=>this.adapter.onBlur()}
557
575
  ></gui-currency>
558
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ci([b.consume({context:y.formContext}),o.property({attribute:!1})],dt.prototype,"formContext",2),ci([b.provide({context:y.inputContext})],dt.prototype,"adapter",2),dt=ci([o.customElement("gui-currency-input")],dt);const rd=Object.freeze(Object.defineProperty({__proto__:null,get CurrencyElement(){return dt}},Symbol.toStringTag,{value:"Module"}));var sd=Object.defineProperty,od=Object.getOwnPropertyDescriptor,te=(e,t,i,n)=>{for(var a=n>1?void 0:n?od(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&sd(t,i,a),a};let G=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.icon="",this.hint=void 0,this._day="",this._month="",this._year="",this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-date-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&this.parseValue(this.value??"")}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),i={"gui-widget-icon":!0,[this.icon]:!0};return d.html`
576
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ci([b.consume({context:y.formContext}),o.property({attribute:!1})],dt.prototype,"formContext",2),ci([b.provide({context:y.inputContext})],dt.prototype,"adapter",2),dt=ci([o.customElement("gui-currency-input")],dt);const rd=Object.freeze(Object.defineProperty({__proto__:null,get CurrencyElement(){return dt}},Symbol.toStringTag,{value:"Module"}));var sd=Object.defineProperty,od=Object.getOwnPropertyDescriptor,ie=(e,t,i,n)=>{for(var a=n>1?void 0:n?od(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&sd(t,i,a),a};let H=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.icon="",this.hint=void 0,this._day="",this._month="",this._year="",this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-date-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&this.parseValue(this.value??"")}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),i={"gui-widget-icon":!0,[this.icon]:!0};return d.html`
559
577
  ${this.label?le(this.uid,e):d.nothing}
560
578
 
561
579
  <div class="gui-widget">
@@ -568,7 +586,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
568
586
  ${this.icon?d.html`<span class=${$.classMap(i)} data-icon=${this.icon}></span>`:d.nothing}
569
587
  </div>
570
588
 
571
- ${this.showErrors&&this.errors?.length?F(this.uid,e):d.nothing}
589
+ ${this.showErrors&&this.errors?.length?N(this.uid,e):d.nothing}
572
590
  `}renderInput(e,t,i,n,a){return d.html`
573
591
  <div class="gui-date-input__touch-target">
574
592
  <input
@@ -592,7 +610,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
592
610
  />
593
611
  <div class="gui-date-input__visual-underline"></div>
594
612
  </div>
595
- `}parseValue(e){if(!e){this._day="",this._month="",this._year="";return}const t=new Date(e);isNaN(t.getTime())||(this._day=t.getDate().toString().padStart(2,"0"),this._month=(t.getMonth()+1).toString().padStart(2,"0"),this._year=t.getFullYear().toString())}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t){if(this.readOnly)return;const i=window.getComputedStyle(this).direction==="rtl",n=e.target,a=Array.from(this.querySelectorAll("input")),r=a.indexOf(n);switch(n.value.length===n.maxLength&&/^[0-9]$/.test(e.key)&&(r===a.length-1?a[0].focus():a[r+1].focus()),e.key){case"ArrowUp":{const s=isNaN(parseInt(n.value,10)+1)?1:parseInt(n.value,10)+1;t==="year"&&(this._year=s.toString().padStart(4,"0")),t==="month"&&(this._month=s.toString().padStart(2,"0")),t==="day"&&(this._day=s.toString().padStart(2,"0")),n.select(),this.validateAndEmit();break}case"ArrowDown":{const s=isNaN(parseInt(n.value,10)-1)?1:parseInt(n.value,10)-1;t==="year"&&(this._year=s.toString().padStart(4,"0")),t==="month"&&(this._month=s.toString().padStart(2,"0")),t==="day"&&(this._day=s.toString().padStart(2,"0")),n.select(),this.validateAndEmit();break}case"ArrowLeft":{const s=i?r+1:r-1;s>=0&&s<a.length&&(a[s].focus(),a[s].select());break}case"ArrowRight":{const s=i?r-1:r+1;s>=0&&s<a.length&&(a[s].focus(),a[s].select());break}}}handleChange(e,t){if(e.stopImmediatePropagation(),this.readOnly)return;const n=e.target.value.replace(/[^0-9]/g,"");switch(t){case"day":this._day=n;break;case"month":this._month=n;break;case"year":this._year=n;break}this.validateAndEmit()}handleBlur(e,t){const i=e.target,n=parseInt(i.value,10);if(!isNaN(n)&&n>0){const a=t==="year"?4:2;i.value=n.toString().padStart(a,"0")}else this.dispatchEvent(new CustomEvent("change",{detail:{value:null}}));this.dispatchEvent(new CustomEvent("blur"))}validateAndEmit(){let e=parseInt(this._year,10),t=parseInt(this._month,10),i=parseInt(this._day,10);e>this.MAX_YEAR&&(e=this.MAX_YEAR,this._year=e.toString().padStart(4,"0")),e<this.MIN_YEAR&&(e=this.MIN_YEAR,this._year=e.toString().padStart(4,"0")),t>this.MAX_MONTH&&(t=this.MAX_MONTH,this._month=t.toString().padStart(2,"0")),t<this.MIN_MONTH&&(t=this.MIN_MONTH,this._month=t.toString().padStart(2,"0")),i>this.MAX_DAY&&(i=this.MAX_DAY,this._day=i.toString().padStart(2,"0")),i<this.MIN_DAY&&(i=this.MIN_DAY,this._day=i.toString().padStart(2,"0"));const n=!isNaN(e)&&String(e).length===4,a=!isNaN(t)&&t>0;if(!isNaN(i)&&i>0&&a&&n){const s=this.MAX_VALID_DAY(t,e);if(i>s)this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0}));else{const l=new Date(e,t-1,i);this.value=Ae(l),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}}this.requestUpdate()}};te([o.property({type:String})],G.prototype,"uid",2),te([o.property({type:String})],G.prototype,"label",2),te([o.property({type:String,attribute:"locale-id"})],G.prototype,"localeId",2),te([o.property({type:Array})],G.prototype,"errors",2),te([o.property({type:Boolean})],G.prototype,"showErrors",2),te([o.property({type:Boolean})],G.prototype,"touched",2),te([o.property({type:Boolean})],G.prototype,"required",2),te([o.property({type:Boolean})],G.prototype,"disabled",2),te([o.property({type:Boolean,attribute:"readonly"})],G.prototype,"readOnly",2),te([o.property({type:String})],G.prototype,"value",2),te([o.property({type:String})],G.prototype,"icon",2),te([o.property({type:String})],G.prototype,"hint",2),te([o.state()],G.prototype,"_day",2),te([o.state()],G.prototype,"_month",2),te([o.state()],G.prototype,"_year",2),G=te([o.customElement("gui-date")],G),typeof customElements<"u"&&!customElements.get("gui-date")&&customElements.define("gui-date",G);var ld=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,hi=(e,t,i,n)=>{for(var a=n>1?void 0:n?dd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&ld(t,i,a),a};let ut=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Ze("date",this.adapter.templateData);return d.html`
613
+ `}parseValue(e){if(!e){this._day="",this._month="",this._year="";return}const t=new Date(e);isNaN(t.getTime())||(this._day=t.getDate().toString().padStart(2,"0"),this._month=(t.getMonth()+1).toString().padStart(2,"0"),this._year=t.getFullYear().toString())}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t){if(this.readOnly)return;const i=window.getComputedStyle(this).direction==="rtl",n=e.target,a=Array.from(this.querySelectorAll("input")),r=a.indexOf(n);switch(n.value.length===n.maxLength&&/^[0-9]$/.test(e.key)&&(r===a.length-1?a[0].focus():a[r+1].focus()),e.key){case"ArrowUp":{const s=isNaN(parseInt(n.value,10)+1)?1:parseInt(n.value,10)+1;t==="year"&&(this._year=s.toString().padStart(4,"0")),t==="month"&&(this._month=s.toString().padStart(2,"0")),t==="day"&&(this._day=s.toString().padStart(2,"0")),n.select(),this.validateAndEmit();break}case"ArrowDown":{const s=isNaN(parseInt(n.value,10)-1)?1:parseInt(n.value,10)-1;t==="year"&&(this._year=s.toString().padStart(4,"0")),t==="month"&&(this._month=s.toString().padStart(2,"0")),t==="day"&&(this._day=s.toString().padStart(2,"0")),n.select(),this.validateAndEmit();break}case"ArrowLeft":{const s=i?r+1:r-1;s>=0&&s<a.length&&(a[s].focus(),a[s].select());break}case"ArrowRight":{const s=i?r-1:r+1;s>=0&&s<a.length&&(a[s].focus(),a[s].select());break}}}handleChange(e,t){if(e.stopImmediatePropagation(),this.readOnly)return;const n=e.target.value.replace(/[^0-9]/g,"");switch(t){case"day":this._day=n;break;case"month":this._month=n;break;case"year":this._year=n;break}this.validateAndEmit()}handleBlur(e,t){const i=e.target,n=parseInt(i.value,10);if(!isNaN(n)&&n>0){const a=t==="year"?4:2;i.value=n.toString().padStart(a,"0")}else this.dispatchEvent(new CustomEvent("change",{detail:{value:null}}));this.dispatchEvent(new CustomEvent("blur"))}validateAndEmit(){let e=parseInt(this._year,10),t=parseInt(this._month,10),i=parseInt(this._day,10);e>this.MAX_YEAR&&(e=this.MAX_YEAR,this._year=e.toString().padStart(4,"0")),e<this.MIN_YEAR&&(e=this.MIN_YEAR,this._year=e.toString().padStart(4,"0")),t>this.MAX_MONTH&&(t=this.MAX_MONTH,this._month=t.toString().padStart(2,"0")),t<this.MIN_MONTH&&(t=this.MIN_MONTH,this._month=t.toString().padStart(2,"0")),i>this.MAX_DAY&&(i=this.MAX_DAY,this._day=i.toString().padStart(2,"0")),i<this.MIN_DAY&&(i=this.MIN_DAY,this._day=i.toString().padStart(2,"0"));const n=!isNaN(e)&&String(e).length===4,a=!isNaN(t)&&t>0;if(!isNaN(i)&&i>0&&a&&n){const s=this.MAX_VALID_DAY(t,e);if(i>s)this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0}));else{const l=new Date(e,t-1,i);this.value=Ae(l),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}}this.requestUpdate()}};ie([o.property({type:String})],H.prototype,"uid",2),ie([o.property({type:String})],H.prototype,"label",2),ie([o.property({type:String,attribute:"locale-id"})],H.prototype,"localeId",2),ie([o.property({type:Array})],H.prototype,"errors",2),ie([o.property({type:Boolean})],H.prototype,"showErrors",2),ie([o.property({type:Boolean})],H.prototype,"touched",2),ie([o.property({type:Boolean})],H.prototype,"required",2),ie([o.property({type:Boolean})],H.prototype,"disabled",2),ie([o.property({type:Boolean,attribute:"readonly"})],H.prototype,"readOnly",2),ie([o.property({type:String})],H.prototype,"value",2),ie([o.property({type:String})],H.prototype,"icon",2),ie([o.property({type:String})],H.prototype,"hint",2),ie([o.state()],H.prototype,"_day",2),ie([o.state()],H.prototype,"_month",2),ie([o.state()],H.prototype,"_year",2),H=ie([o.customElement("gui-date")],H),typeof customElements<"u"&&!customElements.get("gui-date")&&customElements.define("gui-date",H);var ld=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,hi=(e,t,i,n)=>{for(var a=n>1?void 0:n?dd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&ld(t,i,a),a};let ut=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Ze("date",this.adapter.templateData);return d.html`
596
614
  <gui-date
597
615
  class=${$.classMap(e.widgetClasses)}
598
616
  .uid=${this.widget.uid}
@@ -673,7 +691,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
673
691
  ${t}
674
692
  </div>
675
693
 
676
- ${F(this.widget.uid,this.adapter.templateData)}
694
+ ${N(this.widget.uid,this.adapter.templateData)}
677
695
  `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onCalendarChange(e){this.valueChanged(e),this.closeCalendar()}onBlurCalendar(){this.adapter.onBlur(),this.closeCalendar()}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}onKeyUp(e){const t=e;t.target===t.currentTarget&&(t?.key==="Enter"||t?.key===" ")&&(this.isCalendarOpen=!this.isCalendarOpen,this.requestUpdate())}toggleCalendar(e){const t=e.target,i=t.closest(".gui-date-input__part"),n=t.closest("gui-calendar");i||n?this.openCalendar():(this.isCalendarOpen=!this.isCalendarOpen,this.requestUpdate())}openCalendar(){this.isCalendarOpen||(this.isCalendarOpen=!0,this.requestUpdate())}closeCalendar(){this.isCalendarOpen=!1,this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onDocumentClick),this.removeEventListener("focusout",this.onFocusOut),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};je([b.consume({context:y.formContext}),o.property({attribute:!1})],ze.prototype,"formContext",2),je([b.provide({context:y.inputContext})],ze.prototype,"adapter",2),je([o.query("#date-input")],ze.prototype,"dateInput",2),je([o.query("#calendar-input")],ze.prototype,"calendarInput",2),je([o.state()],ze.prototype,"isCalendarOpen",2),ze=je([o.customElement("gui-date-picker-input")],ze);const hd=Object.freeze(Object.defineProperty({__proto__:null,get DatePickerElement(){return ze}},Symbol.toStringTag,{value:"Module"})),Ba=e=>{const t={"gui-list__item":!0,"gui-list__item-selected":!!e.selected,"gui-list__item-focused":!!e.focused,"gui-list__item-disabled":!!e.disabled};return d.html`
678
696
  <div
679
697
  role="option"
@@ -683,7 +701,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
683
701
  >
684
702
  ${e.template}
685
703
  </div>
686
- `};var md=Object.defineProperty,yd=Object.getOwnPropertyDescriptor,Ce=(e,t,i,n)=>{for(var a=n>1?void 0:n?yd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&md(t,i,a),a};let be=class extends d.LitElement{constructor(){super(...arguments),this.targetElement=void 0,this.uid=void 0,this.label=void 0,this.hint=void 0,this.required=void 0,this.errors=[],this.disabled=!1,this.readOnly=!1,this.touched=!1,this.native=!0,this.ariaController=new oe(this,{getTargets:()=>Array.isArray(this.targetElement)?[...this.targetElement]:[this.targetElement],getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}render(){return super.render(),d.html`${le(this.uid,{label:this.label,hint:this.hint,required:this.required,errors:this.errors,touched:this.touched},!1,void 0,this.native)}`}};Ce([o.property({type:Object})],be.prototype,"targetElement",2),Ce([o.property({type:String})],be.prototype,"uid",2),Ce([o.property({type:String})],be.prototype,"label",2),Ce([o.property({type:String})],be.prototype,"hint",2),Ce([o.property({type:Boolean})],be.prototype,"required",2),Ce([o.property({type:Array})],be.prototype,"errors",2),Ce([o.property({type:Boolean})],be.prototype,"disabled",2),Ce([o.property({type:Boolean,attribute:"readonly"})],be.prototype,"readOnly",2),Ce([o.property({type:Boolean})],be.prototype,"touched",2),Ce([o.property({type:Boolean})],be.prototype,"native",2),be=Ce([o.customElement("gui-label")],be),typeof customElements<"u"&&!customElements.get("gui-label")&&customElements.define("gui-label",be);const fd=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"template")&&Object.prototype.hasOwnProperty.call(e,"value");function gd(e){const t=typeof e;return t==="string"||t==="number"}const bd=(e,{valueField:t})=>{if(e===null||typeof e!="object")return!1;const i=e,n=t??"value";return!!Object.prototype.hasOwnProperty.call(i,n)};function Dd(e,{valueField:t}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const i=e,n=t??"value",a=Object.prototype.hasOwnProperty.call(i,n)?n:void 0;if(!a)throw new Error("No valueField exists on the object");return r=>{if(r===null||typeof r!="object")throw new Error("Item is not an object");return{template:r,value:a?r[a]:""}}}const vd=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!fd(e[0])){if(gd(e[0]))return e.map(i=>({template:i,value:i}));if(bd(e[0],t)){const i=Dd(e[0],t);return e.map(i)}else throw new Error("Invalid list item shape")}return e};var wd=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,H=(e,t,i,n)=>{for(var a=n>1?void 0:n?$d(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&wd(t,i,a),a};let R=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.valueField=void 0,this.label=void 0,this.hint=void 0,this.items=[],this.itemHeight=void 0,this.height=void 0,this._items=[],this._scrollTop=0,this._viewportHeight=0,this._focusedIndex=-1,this.buffer=5}willUpdate(e){super.willUpdate(e),e.has("items")&&this.updateItems(),(e.has("items")||e.has("_scrollTop")||e.has("height"))&&this.emitRangeChange()}firstUpdated(){this.measureViewport(),new ResizeObserver(()=>this.measureViewport()).observe(this.viewportElement)}render(){const e=this.height??300,t=this.itemHeight??40,i=(this.items?.length??0)*t,{offsetY:n}=this.calculateRange(),a=this._focusedIndex>=0?`${this.uid}-item-${this._focusedIndex}`:void 0;return d.html`
704
+ `};var md=Object.defineProperty,yd=Object.getOwnPropertyDescriptor,Ce=(e,t,i,n)=>{for(var a=n>1?void 0:n?yd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&md(t,i,a),a};let be=class extends d.LitElement{constructor(){super(...arguments),this.targetElement=void 0,this.uid=void 0,this.label=void 0,this.hint=void 0,this.required=void 0,this.errors=[],this.disabled=!1,this.readOnly=!1,this.touched=!1,this.native=!0,this.ariaController=new oe(this,{getTargets:()=>Array.isArray(this.targetElement)?[...this.targetElement]:[this.targetElement],getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}render(){return super.render(),d.html`${le(this.uid,{label:this.label,hint:this.hint,required:this.required,errors:this.errors,touched:this.touched},!1,void 0,this.native)}`}};Ce([o.property({type:Object})],be.prototype,"targetElement",2),Ce([o.property({type:String})],be.prototype,"uid",2),Ce([o.property({type:String})],be.prototype,"label",2),Ce([o.property({type:String})],be.prototype,"hint",2),Ce([o.property({type:Boolean})],be.prototype,"required",2),Ce([o.property({type:Array})],be.prototype,"errors",2),Ce([o.property({type:Boolean})],be.prototype,"disabled",2),Ce([o.property({type:Boolean,attribute:"readonly"})],be.prototype,"readOnly",2),Ce([o.property({type:Boolean})],be.prototype,"touched",2),Ce([o.property({type:Boolean})],be.prototype,"native",2),be=Ce([o.customElement("gui-label")],be),typeof customElements<"u"&&!customElements.get("gui-label")&&customElements.define("gui-label",be);const fd=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"template")&&Object.prototype.hasOwnProperty.call(e,"value");function gd(e){const t=typeof e;return t==="string"||t==="number"}const bd=(e,{valueField:t})=>{if(e===null||typeof e!="object")return!1;const i=e,n=t??"value";return!!Object.prototype.hasOwnProperty.call(i,n)};function Dd(e,{valueField:t}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const i=e,n=t??"value",a=Object.prototype.hasOwnProperty.call(i,n)?n:void 0;if(!a)throw new Error("No valueField exists on the object");return r=>{if(r===null||typeof r!="object")throw new Error("Item is not an object");return{template:r,value:a?r[a]:""}}}const vd=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!fd(e[0])){if(gd(e[0]))return e.map(i=>({template:i,value:i}));if(bd(e[0],t)){const i=Dd(e[0],t);return e.map(i)}else throw new Error("Invalid list item shape")}return e};var wd=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,Y=(e,t,i,n)=>{for(var a=n>1?void 0:n?$d(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&wd(t,i,a),a};let R=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.valueField=void 0,this.label=void 0,this.hint=void 0,this.items=[],this.itemHeight=void 0,this.height=void 0,this._items=[],this._scrollTop=0,this._viewportHeight=0,this._focusedIndex=-1,this.buffer=5}willUpdate(e){super.willUpdate(e),e.has("items")&&this.updateItems(),(e.has("items")||e.has("_scrollTop")||e.has("height"))&&this.emitRangeChange()}firstUpdated(){this.measureViewport(),new ResizeObserver(()=>this.measureViewport()).observe(this.viewportElement)}render(){const e=this.height??300,t=this.itemHeight??40,i=(this.items?.length??0)*t,{offsetY:n}=this.calculateRange(),a=this._focusedIndex>=0?`${this.uid}-item-${this._focusedIndex}`:void 0;return d.html`
687
705
  <div
688
706
  role="listbox"
689
707
  id=${this.uid}
@@ -712,7 +730,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
712
730
  <slot></slot>
713
731
  </div>
714
732
  </div>
715
- `}focus(e){this.viewportElement?this.viewportElement.focus(e):super.focus(e)}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this._items.findIndex(t=>t.value===this.value);this.scrollToIndex(e)}onKeyDown(e){if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),n=this.items.length-1;let a=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(Math.min(this._focusedIndex+1,n)),a=!0;break;case"ArrowUp":this.setFocusedIndex(Math.max(this._focusedIndex-1,0)),a=!0;break;case"PageDown":this.setFocusedIndex(Math.min(this._focusedIndex+i,n)),a=!0;break;case"PageUp":this.setFocusedIndex(Math.max(this._focusedIndex-i,0)),a=!0;break;case"Home":this.setFocusedIndex(0),a=!0;break;case"End":this.setFocusedIndex(n),a=!0;break;case"Enter":case" ":{const r=this._items[this._focusedIndex];this._focusedIndex>=0&&r!=null&&this.selectItem(r),a=!0;break}}a&&e.preventDefault()}onFocus(){if(!this.value||!this.items.length)return;const e=this._items.findIndex(t=>t.value===this.value);this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0}))}onFocusOut(e){e.relatedTarget&&this.contains(e.relatedTarget)||(this._focusedIndex=-1,this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:-1},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0})))}scrollToIndex(e){const t=this.itemHeight??40,i=this.height??300,n=e*t,a=n+t,r=this.viewportElement.scrollTop,s=r+i;n<r?this.viewportElement.scrollTop=n:a>s&&(this.viewportElement.scrollTop=a-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0}))}setFocusedIndex(e){e<0||e>=this.items.length||(this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0})))}updateItems(){this._items=vd(this.items,{valueField:this.valueField}),this.dispatchEvent(new CustomEvent("gui-update-items",{detail:this._items,bubbles:!0,composed:!0}))}emitRangeChange(){const{startIndex:e,endIndex:t}=this.calculateRange();this.dispatchEvent(new CustomEvent("gui-range-change",{detail:{startIndex:e,endIndex:t},bubbles:!0,composed:!0}))}measureViewport(){this.viewportElement&&(this._viewportHeight=this.viewportElement.offsetHeight,this.emitRangeChange())}onScroll(e){const t=e.target;this._scrollTop=t.scrollTop}calculateRange(){const e=this.itemHeight??40,t=this.items?.length??0,i=Math.ceil(this._viewportHeight/e),n=Math.floor(this._scrollTop/e),a=Math.max(0,n-this.buffer),r=Math.min(t,n+i+this.buffer),s=a*e;return{startIndex:a,endIndex:r,offsetY:s}}};H([o.property({type:String})],R.prototype,"uid",2),H([o.property({type:Boolean})],R.prototype,"touched",2),H([o.property({type:Boolean})],R.prototype,"required",2),H([o.property({type:Boolean})],R.prototype,"disabled",2),H([o.property({type:Boolean,attribute:"readonly"})],R.prototype,"readOnly",2),H([o.property({type:String})],R.prototype,"value",2),H([o.property({type:String})],R.prototype,"valueField",2),H([o.property({type:String})],R.prototype,"label",2),H([o.property({type:String})],R.prototype,"hint",2),H([o.property({type:Array})],R.prototype,"items",2),H([o.property({type:Number})],R.prototype,"itemHeight",2),H([o.property({type:Number})],R.prototype,"height",2),H([o.state()],R.prototype,"_items",2),H([o.state()],R.prototype,"_scrollTop",2),H([o.state()],R.prototype,"_viewportHeight",2),H([o.state()],R.prototype,"_focusedIndex",2),H([o.query(".gui-list__scroll-viewport")],R.prototype,"viewportElement",2),R=H([o.customElement("gui-list")],R),typeof customElements<"u"&&!customElements.get("gui-list")&&customElements.define("gui-list",R);var kd=Object.defineProperty,_d=Object.getOwnPropertyDescriptor,Wt=(e,t,i,n)=>{for(var a=n>1?void 0:n?_d(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&kd(t,i,a),a};let et=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.errors=[],this.touched=!1}createRenderRoot(){return this}render(){return super.render(),d.html`${F(this.uid,{touched:this.touched,errors:this.errors})}`}};Wt([o.property({type:String})],et.prototype,"uid",2),Wt([o.property({type:Array})],et.prototype,"errors",2),Wt([o.property({type:Boolean})],et.prototype,"touched",2),et=Wt([o.customElement("gui-errors")],et),typeof customElements<"u"&&!customElements.get("gui-errors")&&customElements.define("gui-errors",et);var Cd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,we=(e,t,i,n)=>{for(var a=n>1?void 0:n?Sd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Cd(t,i,a),a};let ce=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.debouncer=new Ai.Subject,this.subscriptions=[],this._range={start:0,end:10},this._filteredItems=[],this._listItems=[],this._focusedIndex=-1,this._isFiltering=!1,this._isListVisible=!1,this._selectedItem=void 0,this.onDocumentClick=e=>{if(!this._isListVisible)return;const t=e.composedPath(),i=this._inputRef&&t.includes(this._inputRef),n=this._listRef&&t.includes(this._listRef);!i&&!n&&(this._isListVisible=!1)}}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-dropdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this._filteredItems=this.adapter.templateData.items,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems?.length===0&&this._filteredItems?.length===0&&(this._filteredItems=e.items,this._listItems=e.items),this.requestUpdate()}),this.debouncer.pipe(Ai.debounceTime(this.adapter.templateData.inputDebounce??500)).subscribe(e=>{this._filterItems(e)}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){const t=e.detail||[];if(this._listItems=t,!this._selectedItem&&this.adapter.templateData.value!=null){const i=t.find(n=>n.value===this.adapter.templateData.value);i&&(this._selectedItem=i)}}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){if(this.adapter.templateData.readonly)return;const i=this.adapter.templateData;this.adapter.valueChanged(e.value),this.adapter.filterChanged(""),this._focusedIndex=t,this._selectedItem=e,this._isFiltering=!1,this._isListVisible=!1,this._listRef&&(this._listRef.focusItemAtIndex(t),this._inputRef.value=i.valueField?e.template[i.valueField]:e.template)}_onValueChange(e){const t=e.detail.value;this.adapter.valueChanged(t),this.adapter.filterChanged(""),this._selectedItem=this._listItems.find(i=>i.value===t),this._isFiltering=!1,this._isListVisible=!1}async _onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isListVisible=!0,await this.updateComplete,this._listRef.focus(),this._listRef.scrollToSelectedIndex();break;case"Enter":this._inputRef.value||(this.adapter.valueChanged(null),this._isListVisible=!1,this._isFiltering=!1);break}}_onInput(e){const t=e.target.value;this.debouncer.next(t)}_filterItems(e){const t=this.adapter.templateData,i=!!this.widget.on?.filter;if(this.adapter.filterChanged(e),e&&!i){this._isFiltering=!0,this._isListVisible=!0;const n=t.searchFields??[t.labelField,t.valueField].filter(l=>!!l),a=n.length>0,s=(t.items||[]).filter(l=>{const u=Object.keys(l);if(!u.length)return l.toString().toLowerCase().includes(e.toLowerCase());const c=(h,f)=>h||l[f].toString().toLowerCase().includes(e.toLowerCase());return a?u.filter(h=>n.includes(h)).reduce(c,!1):u.reduce(c,!1)});this._filteredItems=[...s]}else this._isFiltering=!1,this._filteredItems=[...t.items]}async _onFocus(){this._isListVisible=!0,await this.updateComplete,this._listRef.scrollToSelectedIndex()}_onFocusOutInput(e){const t=e.relatedTarget;t&&this.contains(t)||(this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1)}_onBlur(){this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),n=this.adapter.getItemRenderer(e.itemRenderer,Ba),r=this._selectedItem?.template!==null&&typeof this._selectedItem?.template=="object"?e.labelField??"label":null,s=r?this._selectedItem?.template[r]:this._selectedItem?.template,l=!!this.widget.on?.filter;return d.html`
733
+ `}focus(e){this.viewportElement?this.viewportElement.focus(e):super.focus(e)}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this._items.findIndex(t=>t.value===this.value);this.scrollToIndex(e)}onKeyDown(e){if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),n=this.items.length-1;let a=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(Math.min(this._focusedIndex+1,n)),a=!0;break;case"ArrowUp":this.setFocusedIndex(Math.max(this._focusedIndex-1,0)),a=!0;break;case"PageDown":this.setFocusedIndex(Math.min(this._focusedIndex+i,n)),a=!0;break;case"PageUp":this.setFocusedIndex(Math.max(this._focusedIndex-i,0)),a=!0;break;case"Home":this.setFocusedIndex(0),a=!0;break;case"End":this.setFocusedIndex(n),a=!0;break;case"Enter":case" ":{const r=this._items[this._focusedIndex];this._focusedIndex>=0&&r!=null&&this.selectItem(r),a=!0;break}}a&&e.preventDefault()}onFocus(){if(!this.value||!this.items.length)return;const e=this._items.findIndex(t=>t.value===this.value);this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0}))}onFocusOut(e){e.relatedTarget&&this.contains(e.relatedTarget)||(this._focusedIndex=-1,this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:-1},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0})))}scrollToIndex(e){const t=this.itemHeight??40,i=this.height??300,n=e*t,a=n+t,r=this.viewportElement.scrollTop,s=r+i;n<r?this.viewportElement.scrollTop=n:a>s&&(this.viewportElement.scrollTop=a-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0}))}setFocusedIndex(e){e<0||e>=this.items.length||(this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0})))}updateItems(){this._items=vd(this.items,{valueField:this.valueField}),this.dispatchEvent(new CustomEvent("gui-update-items",{detail:this._items,bubbles:!0,composed:!0}))}emitRangeChange(){const{startIndex:e,endIndex:t}=this.calculateRange();this.dispatchEvent(new CustomEvent("gui-range-change",{detail:{startIndex:e,endIndex:t},bubbles:!0,composed:!0}))}measureViewport(){this.viewportElement&&(this._viewportHeight=this.viewportElement.offsetHeight,this.emitRangeChange())}onScroll(e){const t=e.target;this._scrollTop=t.scrollTop}calculateRange(){const e=this.itemHeight??40,t=this.items?.length??0,i=Math.ceil(this._viewportHeight/e),n=Math.floor(this._scrollTop/e),a=Math.max(0,n-this.buffer),r=Math.min(t,n+i+this.buffer),s=a*e;return{startIndex:a,endIndex:r,offsetY:s}}};Y([o.property({type:String})],R.prototype,"uid",2),Y([o.property({type:Boolean})],R.prototype,"touched",2),Y([o.property({type:Boolean})],R.prototype,"required",2),Y([o.property({type:Boolean})],R.prototype,"disabled",2),Y([o.property({type:Boolean,attribute:"readonly"})],R.prototype,"readOnly",2),Y([o.property({type:String})],R.prototype,"value",2),Y([o.property({type:String})],R.prototype,"valueField",2),Y([o.property({type:String})],R.prototype,"label",2),Y([o.property({type:String})],R.prototype,"hint",2),Y([o.property({type:Array})],R.prototype,"items",2),Y([o.property({type:Number})],R.prototype,"itemHeight",2),Y([o.property({type:Number})],R.prototype,"height",2),Y([o.state()],R.prototype,"_items",2),Y([o.state()],R.prototype,"_scrollTop",2),Y([o.state()],R.prototype,"_viewportHeight",2),Y([o.state()],R.prototype,"_focusedIndex",2),Y([o.query(".gui-list__scroll-viewport")],R.prototype,"viewportElement",2),R=Y([o.customElement("gui-list")],R),typeof customElements<"u"&&!customElements.get("gui-list")&&customElements.define("gui-list",R);var kd=Object.defineProperty,_d=Object.getOwnPropertyDescriptor,Wt=(e,t,i,n)=>{for(var a=n>1?void 0:n?_d(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&kd(t,i,a),a};let et=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.errors=[],this.touched=!1}createRenderRoot(){return this}render(){return super.render(),d.html`${N(this.uid,{touched:this.touched,errors:this.errors})}`}};Wt([o.property({type:String})],et.prototype,"uid",2),Wt([o.property({type:Array})],et.prototype,"errors",2),Wt([o.property({type:Boolean})],et.prototype,"touched",2),et=Wt([o.customElement("gui-errors")],et),typeof customElements<"u"&&!customElements.get("gui-errors")&&customElements.define("gui-errors",et);var Cd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,we=(e,t,i,n)=>{for(var a=n>1?void 0:n?Sd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Cd(t,i,a),a};let ce=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.debouncer=new Ai.Subject,this.subscriptions=[],this._range={start:0,end:10},this._filteredItems=[],this._listItems=[],this._focusedIndex=-1,this._isFiltering=!1,this._isListVisible=!1,this._selectedItem=void 0,this.onDocumentClick=e=>{if(!this._isListVisible)return;const t=e.composedPath(),i=this._inputRef&&t.includes(this._inputRef),n=this._listRef&&t.includes(this._listRef);!i&&!n&&(this._isListVisible=!1)}}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-dropdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this._filteredItems=this.adapter.templateData.items,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems?.length===0&&this._filteredItems?.length===0&&(this._filteredItems=e.items,this._listItems=e.items),this.requestUpdate()}),this.debouncer.pipe(Ai.debounceTime(this.adapter.templateData.inputDebounce??500)).subscribe(e=>{this._filterItems(e)}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){const t=e.detail||[];if(this._listItems=t,!this._selectedItem&&this.adapter.templateData.value!=null){const i=t.find(n=>n.value===this.adapter.templateData.value);i&&(this._selectedItem=i)}}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){if(this.adapter.templateData.readonly)return;const i=this.adapter.templateData;this.adapter.valueChanged(e.value),this.adapter.filterChanged(""),this._focusedIndex=t,this._selectedItem=e,this._isFiltering=!1,this._isListVisible=!1,this._listRef&&(this._listRef.focusItemAtIndex(t),this._inputRef.value=i.valueField?e.template[i.valueField]:e.template)}_onValueChange(e){const t=e.detail.value;this.adapter.valueChanged(t),this.adapter.filterChanged(""),this._selectedItem=this._listItems.find(i=>i.value===t),this._isFiltering=!1,this._isListVisible=!1}async _onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isListVisible=!0,await this.updateComplete,this._listRef.focus(),this._listRef.scrollToSelectedIndex();break;case"Enter":this._inputRef.value||(this.adapter.valueChanged(null),this._isListVisible=!1,this._isFiltering=!1);break}}_onInput(e){const t=e.target.value;this.debouncer.next(t)}_filterItems(e){const t=this.adapter.templateData,i=!!this.widget.on?.filter;if(this.adapter.filterChanged(e),e&&!i){this._isFiltering=!0,this._isListVisible=!0;const n=t.searchFields??[t.labelField,t.valueField].filter(l=>!!l),a=n.length>0,s=(t.items||[]).filter(l=>{const u=Object.keys(l);if(!u.length)return l.toString().toLowerCase().includes(e.toLowerCase());const c=(h,f)=>h||l[f].toString().toLowerCase().includes(e.toLowerCase());return a?u.filter(h=>n.includes(h)).reduce(c,!1):u.reduce(c,!1)});this._filteredItems=[...s]}else this._isFiltering=!1,this._filteredItems=[...t.items]}async _onFocus(){this._isListVisible=!0,await this.updateComplete,this._listRef.scrollToSelectedIndex()}_onFocusOutInput(e){const t=e.relatedTarget;t&&this.contains(t)||(this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1)}_onBlur(){this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),n=this.adapter.getItemRenderer(e.itemRenderer,Ba),r=this._selectedItem?.template!==null&&typeof this._selectedItem?.template=="object"?e.labelField??"label":null,s=r?this._selectedItem?.template[r]:this._selectedItem?.template,l=!!this.widget.on?.filter;return d.html`
716
734
  <gui-label
717
735
  .targetElement=${[this._listRef,this._inputRef]}
718
736
  .uid=${this.widget.uid}
@@ -845,7 +863,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
845
863
  .errors=${e.errors}
846
864
  .touched=${e.touched}
847
865
  ></gui-errors>`:d.nothing}
848
- `}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){this._listItems=e.detail||[]}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){this.adapter.templateData.disabled||(this.adapter.valueChanged(e.value),this._focusedIndex=t,this._guiListRef&&typeof this._guiListRef.focusItemAtIndex=="function"&&this._guiListRef.focusItemAtIndex(t))}_valueChanged(e){this.adapter.templateData.readonly||this.adapter.valueChanged(e.detail.value)}};Ue([b.consume({context:y.formContext}),o.property({attribute:!1})],Le.prototype,"formContext",2),Ue([b.provide({context:y.inputContext})],Le.prototype,"adapter",2),Ue([o.state()],Le.prototype,"_range",2),Ue([o.state()],Le.prototype,"_listItems",2),Ue([o.state()],Le.prototype,"_focusedIndex",2),Ue([o.query("gui-list")],Le.prototype,"_guiListRef",2),Le=Ue([o.customElement("gui-list-input")],Le);const Pd=Object.freeze(Object.defineProperty({__proto__:null,get ListElement(){return Le}},Symbol.toStringTag,{value:"Module"}));var Id=Object.defineProperty,Ad=Object.getOwnPropertyDescriptor,mi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ad(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Id(t,i,a),a};let pt=class extends d.LitElement{constructor(){super(...arguments),this.md=void 0,this.dependencies=void 0}createRenderRoot(){return this}render(){return d.html`${Ya.unsafeHTML(this.dependencies?.markdown?.parse(this.md??""))}`}};mi([o.property({type:String})],pt.prototype,"md",2),mi([o.property({type:Object})],pt.prototype,"dependencies",2),pt=mi([o.customElement("gui-markdown-text")],pt),typeof customElements<"u"&&!customElements.get("gui-markdown-text")&&customElements.define("gui-markdown-text",pt);var Td=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,w=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ld(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Td(t,i,a),a};let D=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.tools=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.defaultOpenPreview=void 0,this.maxLength=void 0,this.headingTitle=void 0,this.boldTitle=void 0,this.italicTitle=void 0,this.strikethroughTitle=void 0,this.quoteTitle=void 0,this.linkTitle=void 0,this.orderedListTitle=void 0,this.unorderedListTitle=void 0,this.splitViewTitle=void 0,this.dependencies=void 0,this.splitViewActive=!1,this.activeFormats={},this.splitViewInitialized=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}updated(){this.recalculateAutoGrow()}willUpdate(e){!this.splitViewInitialized&&e.has("defaultOpenPreview")&&(this.splitViewActive=!!this.defaultOpenPreview,this.splitViewInitialized=!0)}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,defaultOpenPreview:this.defaultOpenPreview??!1,maxLength:this.maxLength,dependencies:this.dependencies},t={"gui-widget-input":!0,"gui-markdown--icon":!1};let i=d.html``;if(e.counterMode&&e.maxLength){const a={"gui-markdown--counter":!0,"gui-markdown--counter__error":(e.value?.length??0)>e.maxLength},r=e.counterMode==="current"?d.html`<span>${e.value?.length??0}</span>`:d.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;i=d.html`<div class=${$.classMap(a)}>
866
+ `}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){this._listItems=e.detail||[]}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){this.adapter.templateData.disabled||(this.adapter.valueChanged(e.value),this._focusedIndex=t,this._guiListRef&&typeof this._guiListRef.focusItemAtIndex=="function"&&this._guiListRef.focusItemAtIndex(t))}_valueChanged(e){this.adapter.templateData.readonly||this.adapter.valueChanged(e.detail.value)}};Ue([b.consume({context:y.formContext}),o.property({attribute:!1})],Le.prototype,"formContext",2),Ue([b.provide({context:y.inputContext})],Le.prototype,"adapter",2),Ue([o.state()],Le.prototype,"_range",2),Ue([o.state()],Le.prototype,"_listItems",2),Ue([o.state()],Le.prototype,"_focusedIndex",2),Ue([o.query("gui-list")],Le.prototype,"_guiListRef",2),Le=Ue([o.customElement("gui-list-input")],Le);const Pd=Object.freeze(Object.defineProperty({__proto__:null,get ListElement(){return Le}},Symbol.toStringTag,{value:"Module"}));var Id=Object.defineProperty,Ad=Object.getOwnPropertyDescriptor,mi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ad(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Id(t,i,a),a};let pt=class extends d.LitElement{constructor(){super(...arguments),this.md=void 0,this.dependencies=void 0}createRenderRoot(){return this}render(){return d.html`${Ha.unsafeHTML(this.dependencies?.markdown?.parse(this.md??""))}`}};mi([o.property({type:String})],pt.prototype,"md",2),mi([o.property({type:Object})],pt.prototype,"dependencies",2),pt=mi([o.customElement("gui-markdown-text")],pt),typeof customElements<"u"&&!customElements.get("gui-markdown-text")&&customElements.define("gui-markdown-text",pt);var Td=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,w=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ld(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Td(t,i,a),a};let D=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.tools=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.defaultOpenPreview=void 0,this.maxLength=void 0,this.headingTitle=void 0,this.boldTitle=void 0,this.italicTitle=void 0,this.strikethroughTitle=void 0,this.quoteTitle=void 0,this.linkTitle=void 0,this.orderedListTitle=void 0,this.unorderedListTitle=void 0,this.splitViewTitle=void 0,this.dependencies=void 0,this.splitViewActive=!1,this.activeFormats={},this.splitViewInitialized=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}updated(){this.recalculateAutoGrow()}willUpdate(e){!this.splitViewInitialized&&e.has("defaultOpenPreview")&&(this.splitViewActive=!!this.defaultOpenPreview,this.splitViewInitialized=!0)}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,defaultOpenPreview:this.defaultOpenPreview??!1,maxLength:this.maxLength,dependencies:this.dependencies},t={"gui-widget-input":!0,"gui-markdown--icon":!1};let i=d.html``;if(e.counterMode&&e.maxLength){const a={"gui-markdown--counter":!0,"gui-markdown--counter__error":(e.value?.length??0)>e.maxLength},r=e.counterMode==="current"?d.html`<span>${e.value?.length??0}</span>`:d.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;i=d.html`<div class=${$.classMap(a)}>
849
867
  ${r}
850
868
  <span> / ${e.maxLength}</span>
851
869
  </div>`}const n={"min-height":`${e.minimumHeight}px`};return d.html`
@@ -913,7 +931,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
913
931
  </div>
914
932
 
915
933
  <div class="gui-markdown--validation">
916
- <div>${F(this.uid,e)}</div>
934
+ <div>${N(this.uid,e)}</div>
917
935
  ${i}
918
936
  </div>
919
937
  `}recalculateAutoGrow(){if(!this.autoGrow)return;const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const t=window.getComputedStyle(e),i=parseFloat(t.paddingTop),n=parseFloat(t.paddingBottom),a=i+n;e.style.height="auto",e.style.height=`${Math.max(this.minimumHeight??120,e.scrollHeight-a)}px`}splitView(){this.splitViewActive=!this.splitViewActive}renderToolbarItem(e){switch(e){case"H":return d.html`<li>
@@ -1065,7 +1083,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1065
1083
  @input=${this.valueChanged}
1066
1084
  @blur=${()=>this.adapter.onBlur()}
1067
1085
  ></gui-markdown>
1068
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};yi([b.consume({context:y.formContext}),o.property({attribute:!1})],ct.prototype,"formContext",2),yi([b.provide({context:y.inputContext})],ct.prototype,"adapter",2),ct=yi([o.customElement("gui-markdown-input")],ct);const zd=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownElement(){return ct}},Symbol.toStringTag,{value:"Module"}));var Fd=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,q=(e,t,i,n)=>{for(var a=n>1?void 0:n?Nd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Fd(t,i,a),a};let T=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.showPasswordIcon=void 0,this.hidePasswordIcon=void 0,this.showPasswordLabel=void 0,this.hidePasswordLabel=void 0,this.showPassword=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete,showPasswordIcon:this.showPasswordIcon,hidePasswordIcon:this.hidePasswordIcon,showPasswordLabel:this.showPasswordLabel,hidePasswordLabel:this.hidePasswordLabel},t=Ze("password",e),i={"gui-widget-input":!0,"gui-password--icon":!!this.icon};return d.html`
1086
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};yi([b.consume({context:y.formContext}),o.property({attribute:!1})],ct.prototype,"formContext",2),yi([b.provide({context:y.inputContext})],ct.prototype,"adapter",2),ct=yi([o.customElement("gui-markdown-input")],ct);const zd=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownElement(){return ct}},Symbol.toStringTag,{value:"Module"}));var Fd=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,B=(e,t,i,n)=>{for(var a=n>1?void 0:n?Nd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Fd(t,i,a),a};let T=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.showPasswordIcon=void 0,this.hidePasswordIcon=void 0,this.showPasswordLabel=void 0,this.hidePasswordLabel=void 0,this.showPassword=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete,showPasswordIcon:this.showPasswordIcon,hidePasswordIcon:this.hidePasswordIcon,showPasswordLabel:this.showPasswordLabel,hidePasswordLabel:this.hidePasswordLabel},t=Ze("password",e),i={"gui-widget-input":!0,"gui-password--icon":!!this.icon};return d.html`
1069
1087
  ${le(this.uid,e)}
1070
1088
 
1071
1089
  <div class="gui-widget">
@@ -1097,8 +1115,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1097
1115
  </button>
1098
1116
  </div>
1099
1117
 
1100
- ${F(this.uid,e)}
1101
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};q([o.property({type:String})],T.prototype,"uid",2),q([o.property({type:String})],T.prototype,"label",2),q([o.property({type:String,attribute:"locale-id"})],T.prototype,"localeId",2),q([o.property({type:Array})],T.prototype,"errors",2),q([o.property({type:Boolean})],T.prototype,"touched",2),q([o.property({type:Boolean})],T.prototype,"required",2),q([o.property({type:Boolean})],T.prototype,"disabled",2),q([o.property({type:Boolean,attribute:"readonly"})],T.prototype,"readOnly",2),q([o.property({type:String})],T.prototype,"value",2),q([o.property({type:String})],T.prototype,"hint",2),q([o.property({type:String})],T.prototype,"icon",2),q([o.property({type:String})],T.prototype,"placeholder",2),q([o.property({type:String})],T.prototype,"autocomplete",2),q([o.property({type:String})],T.prototype,"showPasswordIcon",2),q([o.property({type:String})],T.prototype,"hidePasswordIcon",2),q([o.property({type:String})],T.prototype,"showPasswordLabel",2),q([o.property({type:String})],T.prototype,"hidePasswordLabel",2),q([o.state()],T.prototype,"showPassword",2),T=q([o.customElement("gui-password")],T),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",T);var qd=Object.defineProperty,Bd=Object.getOwnPropertyDescriptor,fi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Bd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&qd(t,i,a),a};let ht=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-password","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1118
+ ${N(this.uid,e)}
1119
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};B([o.property({type:String})],T.prototype,"uid",2),B([o.property({type:String})],T.prototype,"label",2),B([o.property({type:String,attribute:"locale-id"})],T.prototype,"localeId",2),B([o.property({type:Array})],T.prototype,"errors",2),B([o.property({type:Boolean})],T.prototype,"touched",2),B([o.property({type:Boolean})],T.prototype,"required",2),B([o.property({type:Boolean})],T.prototype,"disabled",2),B([o.property({type:Boolean,attribute:"readonly"})],T.prototype,"readOnly",2),B([o.property({type:String})],T.prototype,"value",2),B([o.property({type:String})],T.prototype,"hint",2),B([o.property({type:String})],T.prototype,"icon",2),B([o.property({type:String})],T.prototype,"placeholder",2),B([o.property({type:String})],T.prototype,"autocomplete",2),B([o.property({type:String})],T.prototype,"showPasswordIcon",2),B([o.property({type:String})],T.prototype,"hidePasswordIcon",2),B([o.property({type:String})],T.prototype,"showPasswordLabel",2),B([o.property({type:String})],T.prototype,"hidePasswordLabel",2),B([o.state()],T.prototype,"showPassword",2),T=B([o.customElement("gui-password")],T),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",T);var qd=Object.defineProperty,Bd=Object.getOwnPropertyDescriptor,fi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Bd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&qd(t,i,a),a};let ht=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-password","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1102
1120
  <gui-password
1103
1121
  .uid=${this.widget.uid}
1104
1122
  .label=${this.adapter.templateData.label}
@@ -1119,7 +1137,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1119
1137
  @input=${this.valueChanged}
1120
1138
  @blur=${()=>this.adapter.onBlur()}
1121
1139
  ></gui-password>
1122
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};fi([b.consume({context:y.formContext}),o.property({attribute:!1})],ht.prototype,"formContext",2),fi([b.provide({context:y.inputContext})],ht.prototype,"adapter",2),ht=fi([o.customElement("gui-password-input")],ht);const Zd=Object.freeze(Object.defineProperty({__proto__:null,get PasswordElement(){return ht}},Symbol.toStringTag,{value:"Module"}));var Vd=Object.defineProperty,Ud=Object.getOwnPropertyDescriptor,he=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ud(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Vd(t,i,a),a};let ie=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete},t=Ze("textinput",e),i={"gui-widget-input":!0,"gui-textinput--icon":!!this.icon};return d.html`
1140
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};fi([b.consume({context:y.formContext}),o.property({attribute:!1})],ht.prototype,"formContext",2),fi([b.provide({context:y.inputContext})],ht.prototype,"adapter",2),ht=fi([o.customElement("gui-password-input")],ht);const Zd=Object.freeze(Object.defineProperty({__proto__:null,get PasswordElement(){return ht}},Symbol.toStringTag,{value:"Module"}));var Vd=Object.defineProperty,Ud=Object.getOwnPropertyDescriptor,he=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ud(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Vd(t,i,a),a};let ae=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete},t=Ze("textinput",e),i={"gui-widget-input":!0,"gui-textinput--icon":!!this.icon};return d.html`
1123
1141
  ${le(this.uid,e)}
1124
1142
 
1125
1143
  <div class="gui-widget">
@@ -1140,8 +1158,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1140
1158
  ${t.html}
1141
1159
  </div>
1142
1160
 
1143
- ${F(this.uid,e)}
1144
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};he([o.property({type:String})],ie.prototype,"uid",2),he([o.property({type:String})],ie.prototype,"label",2),he([o.property({type:String,attribute:"locale-id"})],ie.prototype,"localeId",2),he([o.property({type:Array})],ie.prototype,"errors",2),he([o.property({type:Boolean})],ie.prototype,"touched",2),he([o.property({type:Boolean})],ie.prototype,"required",2),he([o.property({type:Boolean})],ie.prototype,"disabled",2),he([o.property({type:Boolean,attribute:"readonly"})],ie.prototype,"readOnly",2),he([o.property({type:String})],ie.prototype,"value",2),he([o.property({type:String})],ie.prototype,"hint",2),he([o.property({type:String})],ie.prototype,"icon",2),he([o.property({type:String})],ie.prototype,"placeholder",2),he([o.property({type:String})],ie.prototype,"autocomplete",2),ie=he([o.customElement("gui-textinput")],ie),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",ie);var Wd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,gi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Gd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Wd(t,i,a),a};let mt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textinput","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1161
+ ${N(this.uid,e)}
1162
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};he([o.property({type:String})],ae.prototype,"uid",2),he([o.property({type:String})],ae.prototype,"label",2),he([o.property({type:String,attribute:"locale-id"})],ae.prototype,"localeId",2),he([o.property({type:Array})],ae.prototype,"errors",2),he([o.property({type:Boolean})],ae.prototype,"touched",2),he([o.property({type:Boolean})],ae.prototype,"required",2),he([o.property({type:Boolean})],ae.prototype,"disabled",2),he([o.property({type:Boolean,attribute:"readonly"})],ae.prototype,"readOnly",2),he([o.property({type:String})],ae.prototype,"value",2),he([o.property({type:String})],ae.prototype,"hint",2),he([o.property({type:String})],ae.prototype,"icon",2),he([o.property({type:String})],ae.prototype,"placeholder",2),he([o.property({type:String})],ae.prototype,"autocomplete",2),ae=he([o.customElement("gui-textinput")],ae),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",ae);var Wd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,gi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Gd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Wd(t,i,a),a};let mt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textinput","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1145
1163
  <gui-textinput
1146
1164
  .uid=${this.widget.uid}
1147
1165
  .label=${this.adapter.templateData.label}
@@ -1158,7 +1176,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1158
1176
  @input=${this.valueChanged}
1159
1177
  @blur=${()=>this.adapter.onBlur()}
1160
1178
  ></gui-textinput>
1161
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};gi([b.consume({context:y.formContext}),o.property({attribute:!1})],mt.prototype,"formContext",2),gi([b.provide({context:y.inputContext})],mt.prototype,"adapter",2),mt=gi([o.customElement("gui-textinput-input")],mt);const Hd=Object.freeze(Object.defineProperty({__proto__:null,get TextinputElement(){return mt}},Symbol.toStringTag,{value:"Module"}));var Yd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,J=(e,t,i,n)=>{for(var a=n>1?void 0:n?Kd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Yd(t,i,a),a};let B=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.maxLength=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,autocomplete:this.autocomplete,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,maxLength:this.maxLength};let t=d.html``;if(e.counterMode&&e.maxLength){const a={"gui-textarea--counter":!0,"gui-textarea--counter__error":(e.value?.length??0)>e.maxLength},r=e.counterMode==="current"?d.html`<span>${e.value?.length??0}</span>`:d.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;t=d.html`<div class=${$.classMap(a)}>
1179
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};gi([b.consume({context:y.formContext}),o.property({attribute:!1})],mt.prototype,"formContext",2),gi([b.provide({context:y.inputContext})],mt.prototype,"adapter",2),mt=gi([o.customElement("gui-textinput-input")],mt);const Hd=Object.freeze(Object.defineProperty({__proto__:null,get TextinputElement(){return mt}},Symbol.toStringTag,{value:"Module"}));var Yd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,J=(e,t,i,n)=>{for(var a=n>1?void 0:n?Kd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Yd(t,i,a),a};let Z=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.maxLength=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,autocomplete:this.autocomplete,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,maxLength:this.maxLength};let t=d.html``;if(e.counterMode&&e.maxLength){const a={"gui-textarea--counter":!0,"gui-textarea--counter__error":(e.value?.length??0)>e.maxLength},r=e.counterMode==="current"?d.html`<span>${e.value?.length??0}</span>`:d.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;t=d.html`<div class=${$.classMap(a)}>
1162
1180
  ${r}
1163
1181
  <span> / ${e.maxLength}</span>
1164
1182
  </div>`}const i={height:`${e.minimumHeight}px`,"min-height":`${e.minimumHeight}px`},n=this.querySelector(`textarea[id="${this.uid}"]`);if(this.autoGrow&&n){const a=window.getComputedStyle(n),r=parseFloat(a.paddingTop),s=parseFloat(a.paddingBottom),l=r+s;n.style.height="auto",i.height=`${Math.max(this.minimumHeight??120,n.scrollHeight-l)}px`}return d.html`
@@ -1181,10 +1199,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1181
1199
  </div>
1182
1200
 
1183
1201
  <div class="gui-textarea--validation">
1184
- <div>${F(this.uid,e)}</div>
1202
+ <div>${N(this.uid,e)}</div>
1185
1203
  ${t}
1186
1204
  </div>
1187
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};J([o.property({type:String})],B.prototype,"uid",2),J([o.property({type:String})],B.prototype,"label",2),J([o.property({type:String,attribute:"locale-id"})],B.prototype,"localeId",2),J([o.property({type:Array})],B.prototype,"errors",2),J([o.property({type:Boolean})],B.prototype,"touched",2),J([o.property({type:Boolean})],B.prototype,"required",2),J([o.property({type:Boolean})],B.prototype,"disabled",2),J([o.property({type:Boolean,attribute:"readonly"})],B.prototype,"readOnly",2),J([o.property({type:String})],B.prototype,"value",2),J([o.property({type:String})],B.prototype,"hint",2),J([o.property({type:String})],B.prototype,"placeholder",2),J([o.property({type:String})],B.prototype,"autocomplete",2),J([o.property({type:String,attribute:"countermode"})],B.prototype,"counterMode",2),J([o.property({type:Number,attribute:"minimumheight"})],B.prototype,"minimumHeight",2),J([o.property({type:Boolean,attribute:"autogrow"})],B.prototype,"autoGrow",2),J([o.property({type:Number,attribute:"maxlength"})],B.prototype,"maxLength",2),B=J([o.customElement("gui-textarea")],B),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",B);var Jd=Object.defineProperty,Xd=Object.getOwnPropertyDescriptor,bi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Xd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Jd(t,i,a),a};let yt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textarea","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1205
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};J([o.property({type:String})],Z.prototype,"uid",2),J([o.property({type:String})],Z.prototype,"label",2),J([o.property({type:String,attribute:"locale-id"})],Z.prototype,"localeId",2),J([o.property({type:Array})],Z.prototype,"errors",2),J([o.property({type:Boolean})],Z.prototype,"touched",2),J([o.property({type:Boolean})],Z.prototype,"required",2),J([o.property({type:Boolean})],Z.prototype,"disabled",2),J([o.property({type:Boolean,attribute:"readonly"})],Z.prototype,"readOnly",2),J([o.property({type:String})],Z.prototype,"value",2),J([o.property({type:String})],Z.prototype,"hint",2),J([o.property({type:String})],Z.prototype,"placeholder",2),J([o.property({type:String})],Z.prototype,"autocomplete",2),J([o.property({type:String,attribute:"countermode"})],Z.prototype,"counterMode",2),J([o.property({type:Number,attribute:"minimumheight"})],Z.prototype,"minimumHeight",2),J([o.property({type:Boolean,attribute:"autogrow"})],Z.prototype,"autoGrow",2),J([o.property({type:Number,attribute:"maxlength"})],Z.prototype,"maxLength",2),Z=J([o.customElement("gui-textarea")],Z),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",Z);var Jd=Object.defineProperty,Xd=Object.getOwnPropertyDescriptor,bi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Xd(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Jd(t,i,a),a};let yt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textarea","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1188
1206
  <gui-textarea
1189
1207
  .uid=${this.widget.uid}
1190
1208
  .label=${this.adapter.templateData.label}
@@ -1233,7 +1251,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1233
1251
  </label>
1234
1252
 
1235
1253
  <div class="gui-widget-hint" id=${`${e.uid}_hint`}>
1236
- ${e.hint??d.nothing} ${F(this.uid,e)}
1254
+ ${e.hint??d.nothing} ${N(this.uid,e)}
1237
1255
  </div>
1238
1256
  `}valueChanged(e){if(e?.stopPropagation(),!this.readOnly){const t=e?.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};$e([o.property({type:String})],me.prototype,"uid",2),$e([o.property({type:String})],me.prototype,"label",2),$e([o.property({type:String,attribute:"locale-id"})],me.prototype,"localeId",2),$e([o.property({type:Array})],me.prototype,"errors",2),$e([o.property({type:Boolean})],me.prototype,"touched",2),$e([o.property({type:Boolean})],me.prototype,"required",2),$e([o.property({type:Boolean})],me.prototype,"disabled",2),$e([o.property({type:Boolean,attribute:"readonly"})],me.prototype,"readOnly",2),$e([o.property({type:String})],me.prototype,"value",2),$e([o.property({type:String})],me.prototype,"hint",2),$e([o.property({type:String})],me.prototype,"togglePosition",2),me=$e([o.customElement("gui-toggle")],me),typeof customElements<"u"&&!customElements.get("gui-toggle")&&customElements.define("gui-toggle",me);var tu=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,Di=(e,t,i,n)=>{for(var a=n>1?void 0:n?iu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&tu(t,i,a),a};let ft=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-toggle","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1239
1257
  <gui-toggle
@@ -1277,7 +1295,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1277
1295
  </label>
1278
1296
 
1279
1297
  <div class="gui-widget-hint" id=${`${e.uid}_hint`}>
1280
- ${e.hint??d.nothing} ${F(this.uid,e)}
1298
+ ${e.hint??d.nothing} ${N(this.uid,e)}
1281
1299
  </div>
1282
1300
  `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};ke([o.property({type:String})],ye.prototype,"uid",2),ke([o.property({type:String})],ye.prototype,"label",2),ke([o.property({type:String,attribute:"locale-id"})],ye.prototype,"localeId",2),ke([o.property({type:Array})],ye.prototype,"errors",2),ke([o.property({type:Boolean})],ye.prototype,"touched",2),ke([o.property({type:Boolean})],ye.prototype,"required",2),ke([o.property({type:Boolean})],ye.prototype,"disabled",2),ke([o.property({type:Boolean,attribute:"readonly"})],ye.prototype,"readOnly",2),ke([o.property({type:String})],ye.prototype,"value",2),ke([o.property({type:String})],ye.prototype,"hint",2),ke([o.property({type:String})],ye.prototype,"checkboxPosition",2),ye=ke([o.customElement("gui-checkbox")],ye),typeof customElements<"u"&&!customElements.get("gui-checkbox")&&customElements.define("gui-checkbox",ye);var su=Object.defineProperty,ou=Object.getOwnPropertyDescriptor,vi=(e,t,i,n)=>{for(var a=n>1?void 0:n?ou(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&su(t,i,a),a};let gt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-checkbox","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1283
1301
  <gui-checkbox
@@ -1294,7 +1312,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1294
1312
  @change=${this.valueChanged}
1295
1313
  @blur=${()=>this.adapter.onBlur()}
1296
1314
  ></gui-checkbox>
1297
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};vi([b.consume({context:y.formContext}),o.property({attribute:!1})],gt.prototype,"formContext",2),vi([b.provide({context:y.inputContext})],gt.prototype,"adapter",2),gt=vi([o.customElement("gui-checkbox-input")],gt);const lu=Object.freeze(Object.defineProperty({__proto__:null,get CheckboxElement(){return gt}},Symbol.toStringTag,{value:"Module"}));var du=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,X=(e,t,i,n)=>{for(var a=n>1?void 0:n?uu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&du(t,i,a),a};let Z=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.step=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimum=void 0,this.maximum=void 0,this.autoGrow=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e=this.querySelector(`input[id="${this.uid}"]`),t={"min-width":"23px"};if(this.autoGrow)if(e){e.style.width="0px";const n=Math.max(23,e.scrollWidth);t.width=`${n}px`,t.maxWidth=`${n}px`,e.style.width=""}else t.width="47px";const i={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,step:this.step,placeholder:this.placeholder,autocomplete:this.autocomplete};return d.html`
1315
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};vi([b.consume({context:y.formContext}),o.property({attribute:!1})],gt.prototype,"formContext",2),vi([b.provide({context:y.inputContext})],gt.prototype,"adapter",2),gt=vi([o.customElement("gui-checkbox-input")],gt);const lu=Object.freeze(Object.defineProperty({__proto__:null,get CheckboxElement(){return gt}},Symbol.toStringTag,{value:"Module"}));var du=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,X=(e,t,i,n)=>{for(var a=n>1?void 0:n?uu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&du(t,i,a),a};let V=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.step=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimum=void 0,this.maximum=void 0,this.autoGrow=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e=this.querySelector(`input[id="${this.uid}"]`),t={"min-width":"23px"};if(this.autoGrow)if(e){e.style.width="0px";const n=Math.max(23,e.scrollWidth);t.width=`${n}px`,t.maxWidth=`${n}px`,e.style.width=""}else t.width="47px";const i={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,step:this.step,placeholder:this.placeholder,autocomplete:this.autocomplete};return d.html`
1298
1316
  ${le(this.uid,i)}
1299
1317
 
1300
1318
  <div class="gui-widget">
@@ -1317,13 +1335,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1317
1335
  @blur=${this.onBlur}
1318
1336
  />
1319
1337
  <span class="gui-number__decoration">
1320
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 256 256"><path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"></path></svg>
1321
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 256 256"><path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path></svg>
1338
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 256 256">
1339
+ <path
1340
+ d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"
1341
+ ></path>
1342
+ </svg>
1343
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 256 256">
1344
+ <path
1345
+ d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
1346
+ ></path>
1347
+ </svg>
1322
1348
  </span>
1323
1349
  </div>
1324
1350
 
1325
- ${F(this.uid,i)}
1326
- `}keyDown(e){switch(e.stopPropagation(),e.key){case"ArrowUp":e.preventDefault(),this.plus();break;case"ArrowDown":e.preventDefault(),this.minus();break}}minus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber-t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}plus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber+t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};X([o.property({type:String})],Z.prototype,"uid",2),X([o.property({type:String})],Z.prototype,"label",2),X([o.property({type:String})],Z.prototype,"hint",2),X([o.property({type:String,attribute:"locale-id"})],Z.prototype,"localeId",2),X([o.property({type:Array})],Z.prototype,"errors",2),X([o.property({type:Boolean})],Z.prototype,"touched",2),X([o.property({type:Boolean})],Z.prototype,"required",2),X([o.property({type:Boolean})],Z.prototype,"disabled",2),X([o.property({type:Boolean,attribute:"readonly"})],Z.prototype,"readOnly",2),X([o.property({type:Number})],Z.prototype,"value",2),X([o.property({type:Number})],Z.prototype,"step",2),X([o.property({type:String})],Z.prototype,"placeholder",2),X([o.property({type:String})],Z.prototype,"autocomplete",2),X([o.property({type:Number})],Z.prototype,"minimum",2),X([o.property({type:Number})],Z.prototype,"maximum",2),X([o.property({type:Number})],Z.prototype,"autoGrow",2),Z=X([o.customElement("gui-number")],Z),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",Z);var pu=Object.defineProperty,cu=Object.getOwnPropertyDescriptor,wi=(e,t,i,n)=>{for(var a=n>1?void 0:n?cu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&pu(t,i,a),a};let bt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-number","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1351
+ ${N(this.uid,i)}
1352
+ `}keyDown(e){switch(e.stopPropagation(),e.key){case"ArrowUp":e.preventDefault(),this.plus();break;case"ArrowDown":e.preventDefault(),this.minus();break}}minus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber-t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}plus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber+t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};X([o.property({type:String})],V.prototype,"uid",2),X([o.property({type:String})],V.prototype,"label",2),X([o.property({type:String})],V.prototype,"hint",2),X([o.property({type:String,attribute:"locale-id"})],V.prototype,"localeId",2),X([o.property({type:Array})],V.prototype,"errors",2),X([o.property({type:Boolean})],V.prototype,"touched",2),X([o.property({type:Boolean})],V.prototype,"required",2),X([o.property({type:Boolean})],V.prototype,"disabled",2),X([o.property({type:Boolean,attribute:"readonly"})],V.prototype,"readOnly",2),X([o.property({type:Number})],V.prototype,"value",2),X([o.property({type:Number})],V.prototype,"step",2),X([o.property({type:String})],V.prototype,"placeholder",2),X([o.property({type:String})],V.prototype,"autocomplete",2),X([o.property({type:Number})],V.prototype,"minimum",2),X([o.property({type:Number})],V.prototype,"maximum",2),X([o.property({type:Number})],V.prototype,"autoGrow",2),V=X([o.customElement("gui-number")],V),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",V);var pu=Object.defineProperty,cu=Object.getOwnPropertyDescriptor,wi=(e,t,i,n)=>{for(var a=n>1?void 0:n?cu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&pu(t,i,a),a};let bt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-number","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1327
1353
  <gui-number
1328
1354
  .uid=${this.widget.uid}
1329
1355
  .label=${this.adapter.templateData.label}
@@ -1343,7 +1369,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1343
1369
  @input=${this.valueChanged}
1344
1370
  @blur=${()=>this.adapter.onBlur()}
1345
1371
  ></gui-number>
1346
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};wi([b.consume({context:y.formContext}),o.property({attribute:!1})],bt.prototype,"formContext",2),wi([b.provide({context:y.inputContext})],bt.prototype,"adapter",2),bt=wi([o.customElement("gui-number-input")],bt);const hu=Object.freeze(Object.defineProperty({__proto__:null,get NumberElement(){return bt}},Symbol.toStringTag,{value:"Module"}));function mu(e){const t=typeof e;return t==="string"||t==="number"}function Za(e,t){return t.find(i=>i.value.toString()===e)?.value}const Va=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!Ha.isOption(e[0])){if(mu(e[0]))return e.map(i=>({label:i.toString(),value:i}));if(yu(e[0],t)){const i=fu(e[0],t);return e.map(i)}else throw new Error("Invalid option shape")}return e},yu=(e,{labelField:t,valueField:i})=>{if(e===null||typeof e!="object")return!1;const n=e,a=t?Object.prototype.hasOwnProperty.call(n,t):!1,r=i?Object.prototype.hasOwnProperty.call(n,i):!1;return t&&!a?!1:!(i&&!r)};function fu(e,{labelField:t,valueField:i}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const n=e,a=t&&Object.prototype.hasOwnProperty.call(n,t)?t:void 0,r=i&&Object.prototype.hasOwnProperty.call(n,i)?i:void 0;if(!a&&!r)throw new Error("Neither labelField nor valueField exists on the object");return s=>{if(s===null||typeof s!="object")throw new Error("Item is not an object");const l=s;return{label:a?l[a]:"",value:r?l[r]:""}}}var gu=Object.defineProperty,bu=Object.getOwnPropertyDescriptor,de=(e,t,i,n)=>{for(var a=n>1?void 0:n?bu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&gu(t,i,a),a};let Q=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.options=[],this.labelField=void 0,this.valueField=void 0,this.direction="column",this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[name="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,options:this.options,labelField:this.labelField,valueField:this.valueField,direction:this.direction};this.options=Va(this.options,{labelField:this.labelField,valueField:this.valueField});const t=this.value;this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===t)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
1372
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};wi([b.consume({context:y.formContext}),o.property({attribute:!1})],bt.prototype,"formContext",2),wi([b.provide({context:y.inputContext})],bt.prototype,"adapter",2),bt=wi([o.customElement("gui-number-input")],bt);const hu=Object.freeze(Object.defineProperty({__proto__:null,get NumberElement(){return bt}},Symbol.toStringTag,{value:"Module"}));function mu(e){const t=typeof e;return t==="string"||t==="number"}function Za(e,t){return t.find(i=>i.value.toString()===e)?.value}const Va=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!wl(e[0])){if(mu(e[0]))return e.map(i=>({label:i.toString(),value:i}));if(yu(e[0],t)){const i=fu(e[0],t);return e.map(i)}else throw new Error("Invalid option shape")}return e},yu=(e,{labelField:t,valueField:i})=>{if(e===null||typeof e!="object")return!1;const n=e,a=t?Object.prototype.hasOwnProperty.call(n,t):!1,r=i?Object.prototype.hasOwnProperty.call(n,i):!1;return t&&!a?!1:!(i&&!r)};function fu(e,{labelField:t,valueField:i}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const n=e,a=t&&Object.prototype.hasOwnProperty.call(n,t)?t:void 0,r=i&&Object.prototype.hasOwnProperty.call(n,i)?i:void 0;if(!a&&!r)throw new Error("Neither labelField nor valueField exists on the object");return s=>{if(s===null||typeof s!="object")throw new Error("Item is not an object");const l=s;return{label:a?l[a]:"",value:r?l[r]:""}}}var gu=Object.defineProperty,bu=Object.getOwnPropertyDescriptor,de=(e,t,i,n)=>{for(var a=n>1?void 0:n?bu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&gu(t,i,a),a};let Q=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.options=[],this.labelField=void 0,this.valueField=void 0,this.direction="column",this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[name="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,options:this.options,labelField:this.labelField,valueField:this.valueField,direction:this.direction};this.options=Va(this.options,{labelField:this.labelField,valueField:this.valueField});const t=this.value;this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===t)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
1347
1373
  ${fe.repeat(this.options||[],n=>n?.value,(n,a)=>{const r=this.hasMatchingValue&&n.value===e.value,s=!this.hasMatchingValue&&a===0,l=r||s;return d.html`<label for=${`${this.uid}_${a}`}>
1348
1374
  <input
1349
1375
  type="radio"
@@ -1373,7 +1399,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1373
1399
  ${i}
1374
1400
  </div>
1375
1401
 
1376
- ${F(this.uid,e)}
1402
+ ${N(this.uid,e)}
1377
1403
  `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Za(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};de([o.property({type:String})],Q.prototype,"uid",2),de([o.property({type:String})],Q.prototype,"label",2),de([o.property({type:String,attribute:"locale-id"})],Q.prototype,"localeId",2),de([o.property({type:Array})],Q.prototype,"errors",2),de([o.property({type:Boolean})],Q.prototype,"touched",2),de([o.property({type:Boolean})],Q.prototype,"required",2),de([o.property({type:Boolean})],Q.prototype,"disabled",2),de([o.property({type:Boolean,attribute:"readonly"})],Q.prototype,"readOnly",2),de([o.property({type:String})],Q.prototype,"value",2),de([o.property({type:String})],Q.prototype,"hint",2),de([o.property({type:Array})],Q.prototype,"options",2),de([o.property({type:String})],Q.prototype,"labelField",2),de([o.property({type:String})],Q.prototype,"valueField",2),de([o.property({type:String})],Q.prototype,"direction",2),Q=de([o.customElement("gui-radiogroup")],Q),typeof customElements<"u"&&!customElements.get("gui-radiogroup")&&customElements.define("gui-radiogroup",Q);var Du=Object.defineProperty,vu=Object.getOwnPropertyDescriptor,$i=(e,t,i,n)=>{for(var a=n>1?void 0:n?vu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Du(t,i,a),a};let Dt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-radiogroup","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1378
1404
  <gui-radiogroup
1379
1405
  .uid=${this.widget.uid}
@@ -1392,7 +1418,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1392
1418
  @change=${this.valueChanged}
1393
1419
  @blur=${()=>this.adapter.onBlur()}
1394
1420
  ></gui-radiogroup>
1395
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};$i([b.consume({context:y.formContext}),o.property({attribute:!1})],Dt.prototype,"formContext",2),$i([b.provide({context:y.inputContext})],Dt.prototype,"adapter",2),Dt=$i([o.customElement("gui-radiogroup-input")],Dt);const wu=Object.freeze(Object.defineProperty({__proto__:null,get RadiogroupElement(){return Dt}},Symbol.toStringTag,{value:"Module"}));var $u=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,j=(e,t,i,n)=>{for(var a=n>1?void 0:n?ku(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&$u(t,i,a),a};let V=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.autocomplete=void 0,this.options=[],this.placeholder=void 0,this.labelField=void 0,this.valueField=void 0,this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`select[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,icon:this.icon,autocomplete:this.autocomplete,options:this.options,placeholder:this.placeholder,labelField:this.labelField,valueField:this.valueField},t=Ze("select",e);this.options=Va(this.options,{labelField:this.labelField,valueField:this.valueField}),this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===this.value)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
1421
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};$i([b.consume({context:y.formContext}),o.property({attribute:!1})],Dt.prototype,"formContext",2),$i([b.provide({context:y.inputContext})],Dt.prototype,"adapter",2),Dt=$i([o.customElement("gui-radiogroup-input")],Dt);const wu=Object.freeze(Object.defineProperty({__proto__:null,get RadiogroupElement(){return Dt}},Symbol.toStringTag,{value:"Module"}));var $u=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,j=(e,t,i,n)=>{for(var a=n>1?void 0:n?ku(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&$u(t,i,a),a};let U=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.autocomplete=void 0,this.options=[],this.placeholder=void 0,this.labelField=void 0,this.valueField=void 0,this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`select[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,icon:this.icon,autocomplete:this.autocomplete,options:this.options,placeholder:this.placeholder,labelField:this.labelField,valueField:this.valueField},t=Ze("select",e);this.options=Va(this.options,{labelField:this.labelField,valueField:this.valueField}),this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===this.value)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
1396
1422
  <option value="" disabled selected=${this.hasMatchingValue?d.nothing:""}>
1397
1423
  ${this.placeholder??"Select an option"}
1398
1424
  </option>
@@ -1428,8 +1454,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1428
1454
  ${t.html}
1429
1455
  </div>
1430
1456
 
1431
- ${F(this.uid,e)}
1432
- `}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:`Invalid selection: '${this.value}' is not a valid option.`},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Za(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};j([o.property({type:String})],V.prototype,"uid",2),j([o.property({type:String})],V.prototype,"label",2),j([o.property({type:String,attribute:"locale-id"})],V.prototype,"localeId",2),j([o.property({type:Array})],V.prototype,"errors",2),j([o.property({type:Boolean})],V.prototype,"touched",2),j([o.property({type:Boolean})],V.prototype,"required",2),j([o.property({type:Boolean})],V.prototype,"disabled",2),j([o.property({type:Boolean,attribute:"readonly"})],V.prototype,"readOnly",2),j([o.property({type:String})],V.prototype,"value",2),j([o.property({type:String})],V.prototype,"hint",2),j([o.property({type:String})],V.prototype,"icon",2),j([o.property({type:String})],V.prototype,"autocomplete",2),j([o.property({type:Array})],V.prototype,"options",2),j([o.property({type:String})],V.prototype,"placeholder",2),j([o.property({type:String})],V.prototype,"labelField",2),j([o.property({type:String})],V.prototype,"valueField",2),V=j([o.customElement("gui-select")],V),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",V);var _u=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,ki=(e,t,i,n)=>{for(var a=n>1?void 0:n?Cu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&_u(t,i,a),a};let vt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-select","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1457
+ ${N(this.uid,e)}
1458
+ `}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:`Invalid selection: '${this.value}' is not a valid option.`},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Za(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};j([o.property({type:String})],U.prototype,"uid",2),j([o.property({type:String})],U.prototype,"label",2),j([o.property({type:String,attribute:"locale-id"})],U.prototype,"localeId",2),j([o.property({type:Array})],U.prototype,"errors",2),j([o.property({type:Boolean})],U.prototype,"touched",2),j([o.property({type:Boolean})],U.prototype,"required",2),j([o.property({type:Boolean})],U.prototype,"disabled",2),j([o.property({type:Boolean,attribute:"readonly"})],U.prototype,"readOnly",2),j([o.property({type:String})],U.prototype,"value",2),j([o.property({type:String})],U.prototype,"hint",2),j([o.property({type:String})],U.prototype,"icon",2),j([o.property({type:String})],U.prototype,"autocomplete",2),j([o.property({type:Array})],U.prototype,"options",2),j([o.property({type:String})],U.prototype,"placeholder",2),j([o.property({type:String})],U.prototype,"labelField",2),j([o.property({type:String})],U.prototype,"valueField",2),U=j([o.customElement("gui-select")],U),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",U);var _u=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,ki=(e,t,i,n)=>{for(var a=n>1?void 0:n?Cu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&_u(t,i,a),a};let vt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-select","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1433
1459
  <gui-select
1434
1460
  .uid=${this.widget.uid}
1435
1461
  .label=${this.adapter.templateData.label}
@@ -1450,7 +1476,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1450
1476
  @inputError=${this.onInputError}
1451
1477
  @blur=${()=>this.adapter.onBlur()}
1452
1478
  ></gui-select>
1453
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ki([b.consume({context:y.formContext}),o.property({attribute:!1})],vt.prototype,"formContext",2),ki([b.provide({context:y.inputContext})],vt.prototype,"adapter",2),vt=ki([o.customElement("gui-select-input")],vt);const Su=Object.freeze(Object.defineProperty({__proto__:null,get SelectElement(){return vt}},Symbol.toStringTag,{value:"Module"}));var Ou=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,U=(e,t,i,n)=>{for(var a=n>1?void 0:n?xu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Ou(t,i,a),a};const Eu=["Enter",",","Tab","blur"];let L=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=[],this.hint=void 0,this.placeholder=void 0,this.icon=void 0,this.separators=void 0,this.allowDuplicates=!0,this.trim=!0,this.limit=void 0,this.removeAriaLabel=void 0,this.removeIcon=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-tags-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemove=e=>{if(this.disabled||this.readOnly)return;const t=this.getValue(),i=t.findIndex((a,r)=>this.pillKey(a,r)===e.detail.key);if(i<0)return;const n=t.filter((a,r)=>r!==i);this.emitChange(n),n.length===0&&requestAnimationFrame(()=>this.focusInput())},this.onPillKeydown=e=>{e.detail.event.key==="ArrowRight"&&!this.isDropdownOpen()&&this.focusInput()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getSeparators(){return this.separators&&this.separators.length>0?this.separators:Eu}getValue(){return Array.isArray(this.value)?this.value:[]}getRemoveAriaLabel(){return this.removeAriaLabel??"Remove tag"}pillKey(e,t){return`${t}-${e}`}render(){const e=this.getValue(),t={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,placeholder:this.placeholder,icon:this.icon},i={"gui-widget-icon":!0,[this.icon]:!!this.icon},n=e.map((a,r)=>({key:this.pillKey(a,r),label:a}));return d.html`
1479
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ki([b.consume({context:y.formContext}),o.property({attribute:!1})],vt.prototype,"formContext",2),ki([b.provide({context:y.inputContext})],vt.prototype,"adapter",2),vt=ki([o.customElement("gui-select-input")],vt);const Su=Object.freeze(Object.defineProperty({__proto__:null,get SelectElement(){return vt}},Symbol.toStringTag,{value:"Module"}));var Ou=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,W=(e,t,i,n)=>{for(var a=n>1?void 0:n?xu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Ou(t,i,a),a};const Eu=["Enter",",","Tab","blur"];let L=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=[],this.hint=void 0,this.placeholder=void 0,this.icon=void 0,this.separators=void 0,this.allowDuplicates=!0,this.trim=!0,this.limit=void 0,this.removeAriaLabel=void 0,this.removeIcon=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-tags-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemove=e=>{if(this.disabled||this.readOnly)return;const t=this.getValue(),i=t.findIndex((a,r)=>this.pillKey(a,r)===e.detail.key);if(i<0)return;const n=t.filter((a,r)=>r!==i);this.emitChange(n),n.length===0&&requestAnimationFrame(()=>this.focusInput())},this.onPillKeydown=e=>{e.detail.event.key==="ArrowRight"&&!this.isDropdownOpen()&&this.focusInput()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getSeparators(){return this.separators&&this.separators.length>0?this.separators:Eu}getValue(){return Array.isArray(this.value)?this.value:[]}getRemoveAriaLabel(){return this.removeAriaLabel??"Remove tag"}pillKey(e,t){return`${t}-${e}`}render(){const e=this.getValue(),t={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,placeholder:this.placeholder,icon:this.icon},i={"gui-widget-icon":!0,[this.icon]:!!this.icon},n=e.map((a,r)=>({key:this.pillKey(a,r),label:a}));return d.html`
1454
1480
  ${this.label?le(this.uid,t,!1,void 0,!1):d.nothing}
1455
1481
 
1456
1482
  <div class="gui-widget">
@@ -1493,10 +1519,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1493
1519
  />
1494
1520
  </div>
1495
1521
 
1496
- ${F(this.uid,t)}
1522
+ ${N(this.uid,t)}
1497
1523
  </div>
1498
1524
  `}onInputKeydown(e){if(this.disabled||this.readOnly)return;const t=e.target,i=this.getSeparators(),n=t.value,a=t.selectionStart===0&&t.selectionEnd===0;if(e.key==="Enter"&&i.includes("Enter")){e.preventDefault(),this.commitDraft(n)&&(t.value="");return}if(e.key===","&&i.includes(",")){e.preventDefault(),this.commitDraft(n)&&(t.value="");return}if(e.key==="Tab"&&i.includes("Tab")&&n.length>0){this.commitDraft(n)&&(t.value="");return}if(e.key==="Escape"){e.preventDefault(),t.value="";return}const r=this.getValue(),s=this.isCompactMode();if(e.key==="ArrowDown"&&s&&r.length>0){e.preventDefault(),this.enterPillList(0);return}if(e.key==="ArrowLeft"&&!s&&a&&r.length>0){e.preventDefault(),this.enterPillList(r.length-1);return}if(e.key==="Backspace"&&n===""&&r.length>0){e.preventDefault(),this.enterPillList(r.length-1);return}}onInputBlur(e){const t=e.target,i=this.getSeparators(),n=t.value;n.length>0&&i.includes("blur")&&!this.disabled&&!this.readOnly&&this.commitDraft(n)&&(t.value=""),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}onPaste(e){if(this.disabled||this.readOnly)return;const t=e.clipboardData?.getData("text")??"";if(!t)return;const n=this.getSeparators().filter(c=>c!=="Enter"&&c!=="Tab"&&c!=="blur");if(n.length===0)return;const a=new RegExp(`[${n.map(c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("")}
1499
- ]`);if(!a.test(t))return;e.preventDefault();const r=e.target instanceof HTMLInputElement?e.target:null,l=((r?.value??"")+t).split(a),u=l.slice(0,-1),p=l[l.length-1]??"";this.commitDraftBatch(u)&&r&&(r.value=p)}commitDraft(e){const t=this.trim?e.trim():e;if(t.length===0)return!1;const i=this.getValue();return this.allowDuplicates===!1&&i.includes(t)?!0:this.limit!==void 0&&i.length>=this.limit?!1:(this.emitChange([...i,t]),!0)}commitDraftBatch(e){const t=this.getValue(),i=[...t];for(const n of e){const a=this.trim?n.trim():n;if(a.length!==0&&!(this.allowDuplicates===!1&&i.includes(a))){if(this.limit!==void 0&&i.length>=this.limit)break;i.push(a)}}return i.length===t.length?!1:(this.emitChange(i),!0)}emitChange(e){this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}focusInput(){this.querySelector(`input[id="${this.uid}"]`)?.focus()}getPills(){return this.querySelector("gui-pills")}isDropdownOpen(){return!!this.getPills()?.querySelector(".gui-pills__dropdown")}isCompactMode(){const e=this.getPills();if(!e)return!1;const t=e.querySelector(".gui-pills__strip-wrapper");return t?getComputedStyle(t).display==="none":!1}enterPillList(e){const t=this.getPills();t&&(this.isCompactMode()?(t.openDropdown(),requestAnimationFrame(()=>t.focusPillAt(e))):t.focusPillAt(e))}};U([o.property({type:String})],L.prototype,"uid",2),U([o.property({type:String})],L.prototype,"label",2),U([o.property({type:String,attribute:"locale-id"})],L.prototype,"localeId",2),U([o.property({type:Array})],L.prototype,"errors",2),U([o.property({type:Boolean})],L.prototype,"touched",2),U([o.property({type:Boolean})],L.prototype,"required",2),U([o.property({type:Boolean})],L.prototype,"disabled",2),U([o.property({type:Boolean,attribute:"readonly"})],L.prototype,"readOnly",2),U([o.property({type:Array})],L.prototype,"value",2),U([o.property({type:String})],L.prototype,"hint",2),U([o.property({type:String})],L.prototype,"placeholder",2),U([o.property({type:String})],L.prototype,"icon",2),U([o.property({type:Array})],L.prototype,"separators",2),U([o.property({type:Boolean})],L.prototype,"allowDuplicates",2),U([o.property({type:Boolean})],L.prototype,"trim",2),U([o.property({type:Number})],L.prototype,"limit",2),U([o.property({type:String,attribute:"remove-aria-label"})],L.prototype,"removeAriaLabel",2),U([o.property({type:String,attribute:"remove-icon"})],L.prototype,"removeIcon",2),L=U([o.customElement("gui-tags")],L),typeof customElements<"u"&&!customElements.get("gui-tags")&&customElements.define("gui-tags",L);var Pu=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,_i=(e,t,i,n)=>{for(var a=n>1?void 0:n?Iu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Pu(t,i,a),a};let wt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-tags","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1525
+ ]`);if(!a.test(t))return;e.preventDefault();const r=e.target instanceof HTMLInputElement?e.target:null,l=((r?.value??"")+t).split(a),u=l.slice(0,-1),p=l[l.length-1]??"";this.commitDraftBatch(u)&&r&&(r.value=p)}commitDraft(e){const t=this.trim?e.trim():e;if(t.length===0)return!1;const i=this.getValue();return this.allowDuplicates===!1&&i.includes(t)?!0:this.limit!==void 0&&i.length>=this.limit?!1:(this.emitChange([...i,t]),!0)}commitDraftBatch(e){const t=this.getValue(),i=[...t];for(const n of e){const a=this.trim?n.trim():n;if(a.length!==0&&!(this.allowDuplicates===!1&&i.includes(a))){if(this.limit!==void 0&&i.length>=this.limit)break;i.push(a)}}return i.length===t.length?!1:(this.emitChange(i),!0)}emitChange(e){this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}focusInput(){this.querySelector(`input[id="${this.uid}"]`)?.focus()}getPills(){return this.querySelector("gui-pills")}isDropdownOpen(){return!!this.getPills()?.querySelector(".gui-pills__dropdown")}isCompactMode(){const e=this.getPills();if(!e)return!1;const t=e.querySelector(".gui-pills__strip-wrapper");return t?getComputedStyle(t).display==="none":!1}enterPillList(e){const t=this.getPills();t&&(this.isCompactMode()?(t.openDropdown(),requestAnimationFrame(()=>t.focusPillAt(e))):t.focusPillAt(e))}};W([o.property({type:String})],L.prototype,"uid",2),W([o.property({type:String})],L.prototype,"label",2),W([o.property({type:String,attribute:"locale-id"})],L.prototype,"localeId",2),W([o.property({type:Array})],L.prototype,"errors",2),W([o.property({type:Boolean})],L.prototype,"touched",2),W([o.property({type:Boolean})],L.prototype,"required",2),W([o.property({type:Boolean})],L.prototype,"disabled",2),W([o.property({type:Boolean,attribute:"readonly"})],L.prototype,"readOnly",2),W([o.property({type:Array})],L.prototype,"value",2),W([o.property({type:String})],L.prototype,"hint",2),W([o.property({type:String})],L.prototype,"placeholder",2),W([o.property({type:String})],L.prototype,"icon",2),W([o.property({type:Array})],L.prototype,"separators",2),W([o.property({type:Boolean})],L.prototype,"allowDuplicates",2),W([o.property({type:Boolean})],L.prototype,"trim",2),W([o.property({type:Number})],L.prototype,"limit",2),W([o.property({type:String,attribute:"remove-aria-label"})],L.prototype,"removeAriaLabel",2),W([o.property({type:String,attribute:"remove-icon"})],L.prototype,"removeIcon",2),L=W([o.customElement("gui-tags")],L),typeof customElements<"u"&&!customElements.get("gui-tags")&&customElements.define("gui-tags",L);var Pu=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,_i=(e,t,i,n)=>{for(var a=n>1?void 0:n?Iu(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&Pu(t,i,a),a};let wt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-tags","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),d.html`
1500
1526
  <gui-tags
1501
1527
  .uid=${this.widget.uid}
1502
1528
  .label=${this.adapter.templateData.label}
@@ -1534,7 +1560,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1534
1560
  .required=${e.validator?.required}
1535
1561
  .native=${!1}
1536
1562
  ></gui-label>
1537
- ${e.value?fe.repeat(e.value,i=>Hn(i,Ru),(i,n)=>d.html`
1563
+ ${e.value?fe.repeat(e.value,i=>$l(i,Ru),(i,n)=>d.html`
1538
1564
  <div class="gui-repeater__card">
1539
1565
  <div class="gui-repeater__card-header">
1540
1566
  ${e.title?d.html`<span class="gui-repeater__card-title"
@@ -1680,4 +1706,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1680
1706
  </div>
1681
1707
  `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ei([b.consume({context:y.formContext}),o.property({attribute:!1})],Ot.prototype,"formContext",2),Ei([b.provide({context:y.displayWidgetContext})],Ot.prototype,"adapter",2),Ot=Ei([o.customElement("gui-markdown-text-display")],Ot);const tp=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownTextElement(){return Ot}},Symbol.toStringTag,{value:"Module"}));var ip=Object.defineProperty,ap=Object.getOwnPropertyDescriptor,Pi=(e,t,i,n)=>{for(var a=n>1?void 0:n?ap(t,i):t,r=e.length-1,s;r>=0;r--)(s=e[r])&&(a=(n?s(t,i,a):s(a))||a);return n&&a&&ip(t,i,a),a};let xt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-renderer","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return d.html`
1682
1708
  <div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
1683
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Pi([b.consume({context:y.formContext}),o.property({attribute:!1})],xt.prototype,"formContext",2),Pi([b.provide({context:y.displayWidgetContext})],xt.prototype,"adapter",2),xt=Pi([o.customElement("gui-renderer-component")],xt);const np=Object.freeze(Object.defineProperty({__proto__:null,get RendererElement(){return xt}},Symbol.toStringTag,{value:"Module"}));C.widgetLoaders=La,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
1709
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Pi([b.consume({context:y.formContext}),o.property({attribute:!1})],xt.prototype,"formContext",2),Pi([b.provide({context:y.displayWidgetContext})],xt.prototype,"adapter",2),xt=Pi([o.customElement("gui-renderer-component")],xt);const np=Object.freeze(Object.defineProperty({__proto__:null,get RendererElement(){return xt}},Symbol.toStringTag,{value:"Module"}));S.widgetLoaders=La,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));