@golemui/gui-lit 1.1.1-rc.2 → 1.2.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.
- package/CHANGELOG.md +8 -0
- package/{calendar-D31xNsxx.js → calendar-DleRbmvP.js} +2 -2
- package/{calendar.element-BhFrCsns.js → calendar.element-Cv3RBphf.js} +1 -1
- package/{checkbox.element-DAAVB651.js → checkbox.element-CpmrzdH0.js} +12 -10
- package/{currency.element-D8A2ObpM.js → currency.element-Cezgzbbs.js} +1 -1
- package/{date-input-DLiMreSS.js → date-input-B3yHsn-g.js} +1 -1
- package/{date-picker.element-DeUQtbLg.js → date-picker.element-ByZefznr.js} +3 -3
- package/{date-time-calendar-DzU-FtVl.js → date-time-calendar-CB5cNoOX.js} +3 -3
- package/{date-time-calendar.element-BLBcVsFu.js → date-time-calendar.element-DlbWZjoe.js} +1 -1
- package/{date-time-input-DZaz2heD.js → date-time-input-DrY68YDX.js} +1 -1
- package/{date-time-picker.element-BUbLdV6i.js → date-time-picker.element-CYwmumfq.js} +3 -3
- package/{date-time.element-B5onfSBG.js → date-time.element-CLLxM2nV.js} +2 -2
- package/{date.element-BsKhLrEc.js → date.element-B8ZHK9KJ.js} +2 -2
- package/{day-status-CsWStVQV.js → day-status-ljexnwEO.js} +1 -1
- package/{dropdown.element-CXpMwJsU.js → dropdown.element-DMZ7oL5n.js} +1 -1
- package/{errors-Byb2dIhK.js → errors-Bs_vYN-_.js} +1 -1
- package/index.js +902 -956
- package/index.umd.cjs +133 -133
- package/lib/components/form.element.d.ts +3 -12
- package/{list.element-eo3DIOrp.js → list.element-ADtUK2na.js} +1 -1
- package/{markdown.element-FbtwdnAv.js → markdown.element-D5zcxAUS.js} +1 -1
- package/{number.element-BEpOCzXy.js → number.element-DEY5tR_y.js} +1 -1
- package/package.json +6 -6
- package/{password.element-CBaB8h5b.js → password.element-C1aQh_iz.js} +1 -1
- package/{radiogroup.element-GKhoX1n2.js → radiogroup.element-B2G-XyGx.js} +1 -1
- package/{range-calendar-DO_woqcF.js → range-calendar-D7sG24Kx.js} +2 -2
- package/{range-calendar.element-DHLZhpnj.js → range-calendar.element-D5eb2f7p.js} +1 -1
- package/{range-date-input-Br7XqQPK.js → range-date-input-BChaoBC1.js} +1 -1
- package/{range-date-input.element-BdD4SlB4.js → range-date-input.element-C35grlYo.js} +1 -1
- package/{range-date-picker.element-DWRHiAoC.js → range-date-picker.element-Do5YsL5V.js} +3 -3
- package/{range-date-time-calendar-B3EMgN1E.js → range-date-time-calendar-DulGK2EQ.js} +3 -3
- package/{range-date-time-calendar.element-Coea6RF4.js → range-date-time-calendar.element-BV0J96Gu.js} +1 -1
- package/{range-date-time-input-Cu-T_nuC.js → range-date-time-input-8ggqckP7.js} +1 -1
- package/{range-date-time-input.element-Cti44iuW.js → range-date-time-input.element-CzgRbR9F.js} +1 -1
- package/{range-date-time-picker.element-CDN2RL1y.js → range-date-time-picker.element-hi5KdopZ.js} +3 -3
- package/{range-time-input-BP9ZL9O8.js → range-time-input-D7GFdDeA.js} +1 -1
- package/{range-time-input.element-B7wtHJoQ.js → range-time-input.element-BOHLUO8z.js} +1 -1
- package/{range-time-picker.element-CPIAiQPC.js → range-time-picker.element-DDNQMA_u.js} +2 -2
- package/{repeater.element-tEuTeMLO.js → repeater.element-Da8YN1Vy.js} +1 -1
- package/{select.element-DzUFQKcu.js → select.element-SDxBhGjz.js} +1 -1
- package/{tags.element-CPHgotb0.js → tags.element-Bnhfevp3.js} +1 -1
- package/{templates-Dmr34nwp.js → templates-Df7abEkB.js} +28 -24
- package/{textarea.element-CiNEy9uq.js → textarea.element-Dx7eYEnl.js} +1 -1
- package/{textinput.element-AL2Nr768.js → textinput.element-BnIoDRmY.js} +1 -1
- package/{time-input-5dkSm8UW.js → time-input-Kk4EX6at.js} +1 -1
- package/{time-picker-g337F8d0.js → time-picker-DLj1rhOf.js} +2 -2
- package/{time-picker.element-DLihegjg.js → time-picker.element-C3oR0EkQ.js} +1 -1
- package/{time.element-BneqgMlQ.js → time.element-X286nthD.js} +2 -2
- package/{toggle.element-Cz91CRdp.js → toggle.element-Dokdat_o.js} +4 -2
package/index.umd.cjs
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
(function(te,ut){typeof exports=="object"&&typeof module<"u"?ut(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/style-map.js"),require("lit-html/directives/repeat.js"),require("lit/directives/if-defined.js"),require("lit/directives/live.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/style-map.js","lit-html/directives/repeat.js","lit/directives/if-defined.js","lit/directives/live.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],ut):(te=typeof globalThis<"u"?globalThis:te||self,ut(te["gui-lit"]={},te.core,null,te.lit$1,te.lit,te.decorators_js,te.context,te.rxjs,te.classMap_js,te.styleMap_js,te.repeat_js,te.ifDefined_js,te.live_js,te.repeat_js$1,te.unsafeHtml_js))})(this,(function(te,ut,df,m,d,n,f,ds,S,wt,qe,ma,no,us,oo){"use strict";function Ct(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}const ct={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"},Je={...ct};class lo{constructor(){this.handlerByItemType=new Map,this.kindByItemType=new Map}registerItemType(t,i,a){if(this.handlerByItemType.has(t))throw new Error(`Item type "${t}" is already registered.`);this.handlerByItemType.set(t,i),a&&this.kindByItemType.set(t,a)}getItemTypeKind(t){return this.kindByItemType.get(t)}getRegisteredItemTypes(){return[...this.handlerByItemType.keys()]}getItemTypesOfKind(t){const i=[];for(const[a,r]of this.kindByItemType)r===t&&i.push(a);return i}getItemTypeHandler(t){const i=this.handlerByItemType.get(t);if(!i)throw new Error(`No handler registered for item type "${t}". Register its definition in the widget set's registry with registerShortcutType (for the gui widget set: add it to guiShortcutTypes in registry.ts).`);return i}hasItemTypeHandler(t){return this.handlerByItemType.has(t)}}function uo(){return new lo}function P(e){const t=l=>{if(!e.sensibleDefaults)return{};let u={...e.sensibleDefaults.base};for(const p of l){const h=p.config;for(const c of e.sensibleDefaults.fields){const y=c;h[y]!=null&&(u={...u,[y]:h[y]})}}return u},i=(l,u)=>e.sensibleDefaults?e.sensibleDefaults.apply(l,u):l,a=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}}}},r={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:a,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}},s=Ct(e.itemType),o=(l,u)=>s(u,(p=>p.uid===l));return{itemType:e.itemType,kind:e.kind,handler:r,gsl:s,gslByUid:o}}function po(e,t){e.registerItemType(t.itemType,t.handler,t.kind)}const ho=["tag","state","tagsAnd","tagsOr"];function co(e,t){if(t.length===0)return e;const i=t.find(s=>s.kind==="state"),a=t.filter(s=>s.kind!=="state"),r=e.matcher;return{...e,matcher:s=>{if(!r(s))return!1;for(const o of a){const l=s.tags??[];if(o.kind==="tagsAnd"){for(const u of o.tags)if(!l.includes(u))return!1}else{if(o.tags.length===0)continue;if(!o.tags.some(u=>l.includes(u)))return!1}}return!0},...i?{targetState:i.name}:{}}}function Ii(e){return(t,i)=>e(i,a=>a.uid===t)}function mo(){const e=Ct(ct.INPUTS),t=Ct(ct.ACTIONS),i=Ct(ct.DISPLAYS),a=Ct(ct.LAYOUTS);return{inputs:e,inputByUid:Ii(e),actions:t,actionByUid:Ii(t),displays:i,displayByUid:Ii(i),layouts:a,layoutByUid:Ii(a)}}function Nt(e,t){const i={tag:a=>Nt(e,[...t,{kind:"tagsAnd",tags:[a]}]),state:a=>Nt(e,[...t,{kind:"state",name:a}]),tagsAnd:a=>Nt(e,[...t,{kind:"tagsAnd",tags:a}]),tagsOr:a=>Nt(e,[...t,{kind:"tagsOr",tags:a}])};for(const[a,r]of Object.entries(e))i[a]=(...s)=>co(r(...s),t);return i}function yo(e){const t=ho.filter(a=>a in e);if(t.length>0)throw new Error(`Selector factory map must not use the reserved scope method name(s): ${t.join(", ")}.`);const i={...mo(),...e};return Nt(i,[])}const ps={[ct.INPUTS]:"input",[ct.ACTIONS]:"action",[ct.DISPLAYS]:"display",[ct.LAYOUTS]:"layout"};class go{constructor(t){this.registry=t}resolve(t,i){const a=[];for(const s of i)s.kind==="aggregated"?this.collectFromAggregated(s,t,a):this.collectFromLeaf(s,t,a);const r=this.rollUpSensibleDefaults(a);return{leafSelectors:a,sensibleDefaults:r}}selectorMatchesItemType(t,i){const a=ps[t];return a?this.registry.getItemTypeKind(i)===a:t===i}collectFromAggregated(t,i,a){if(t.matcher(i))for(const r of t.children)this.collectFromLeaf(r,i,a)}collectFromLeaf(t,i,a){this.selectorMatchesItemType(t.selectorType,i.itemType??"")&&t.matcher(i)&&a.push(t)}rollUpSensibleDefaults(t){const i=new Map,a=(s,o)=>{const l=i.get(s)??[];l.push(o),i.set(s,l)};for(const s of t){const o=ps[s.selectorType];if(o)for(const l of this.registry.getItemTypesOfKind(o))a(l,s);else a(s.selectorType,s)}const r={};for(const[s,o]of i)this.registry.hasItemTypeHandler(s)&&(r[s]=this.registry.getItemTypeHandler(s).rollUpSensibleDefaults(o));return r}}class bo{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 a={...t};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(typeof i[r]=="object"&&!Array.isArray(i[r])&&i[r]!==null&&typeof t[r]=="object"&&!Array.isArray(t[r])&&t[r]!==null?a[r]=this.deepMerge(t[r],i[r]):a[r]=i[r]);return a}}const fo=new bo;class vo{constructor(t,i){this.objectUtils=t,this.registry=i}merge(t,i,a){let r={},s=null;typeof t=="function"&&(s=t);const o=this.collectDecorators(a);for(const p of o){if(s!=null){s=this.composeRuntimeFunctions(s,p);continue}if(typeof p=="function"){const h=p({...r,...typeof t=="function"?{}:t});if(typeof h=="function"){s=this.createPromotedFunction(r,t,h,i,a);continue}r=this.objectUtils.deepMerge(r,h)}else r=this.objectUtils.deepMerge(r,p)}if(s!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(s,r,i,a)};const l=this.objectUtils.deepMerge(t,r);return{kind:"static",def:this.applySensibleDefaults({...l},i,a)}}collectDecorators(t){const i=[];for(const a of t.leafSelectors){const r=a.config;r.override!=null&&i.push(r.override)}return i}applySensibleDefaults(t,i,a){if(!this.registry.hasItemTypeHandler(i))return t;const r=a.sensibleDefaults[i]??{};return this.registry.getItemTypeHandler(i).applySensibleDefaults(t,r)}createPromotedFunction(t,i,a,r,s){return o=>{const l=a(o);let u=this.objectUtils.deepMerge(t,l);return u=this.objectUtils.deepMerge(u,i),this.applySensibleDefaults(u,r,s)}}wrapWithSensibleDefaults(t,i,a,r){return s=>{let o=t(s);return Object.keys(i).length>0&&(o=this.objectUtils.deepMerge(i,o)),this.applySensibleDefaults(o,a,r)}}composeRuntimeFunctions(t,i){return typeof i=="function"?a=>{const r=t(a),s=i(r);return typeof s=="function"?s(a):this.objectUtils.deepMerge(s,r)}:a=>{const r=t(a);return this.objectUtils.deepMerge(r,i)}}}class Do{constructor(t){this.registry=t}mapToWidget(t,i){if(t.kind==="dynamic"){const a=t.fn;return(r=>{const s=a(r);return this.mapStaticDef(s,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const a=this.registry.getItemTypeHandler(i).mapToWidget(t);return this.applyBaseWidgetFields(a,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}}class wo{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],a=[],r=[];for(const s of i)s.kind==="leaf"?r.push(s):a.push(s);return r.length>0&&a.unshift({kind:"aggregated",matcher:()=>!0,children:r}),a}extractFormConfig(){return{suppressAutomaticStack:!1}}}const hs={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},$o=Object.keys(hs);function cs(e){if(e.length>0)return null;try{const t=e();return typeof t=="string"?t:null}catch{return null}}class ko{extractOnClickFromMergeResult(t,i,a){if(t.kind==="dynamic"){const o=t.fn;return{kind:"dynamic",fn:u=>{const p=o(u);return this.wireOnClick(p,i,a)}}}const r=t.def;return{kind:"static",def:this.wireOnClick(r,i,a)}}wireOnClick(t,i,a){const r=a.next(),s=t.onClick;if(typeof s=="function"){const{onClick:o,...l}=t,u=s(void 0);return typeof u=="string"?{...l,uid:r,on:{click:u}}:(i.set(r,p=>s(p.data)),{...l,uid:r,on:{click:r}})}return{...t,uid:r}}wireInputLayoutEvents(t,i,a){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:l=>{const u=s(l);return this.wireEventProperties(u,i,a)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,a)}}wireEventProperties(t,i,a){const r={...t.on||{}};let s=!1;const o={...t};for(const l of $o){const u=t[l];if(u==null)continue;const p=hs[l];if(typeof u=="function"){const h=cs(u);if(h!=null)r[p]=h;else{const c=a.next();i.set(c,u),r[p]=c}s=!0}else typeof u=="string"&&(r[p]=u,s=!0);delete o[l]}return s&&(o.on=r),o}}const ya=new ko,To={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},ms={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class So{extractFromMergeResult(t,i){const a={};for(const l of i){const u=l.targetState,p=l.config,h=p.override&&typeof p.override!="function"?p.override:p;a[u]={...a[u]||{},...h}}if(t.kind==="dynamic"){const l=t.fn;return{cleanedResult:{kind:"dynamic",fn:p=>{const h=l(p),{states:c,...y}=h;return y}},stateData:{stateOverrides:a}}}const{states:r,...s}=t.def,o={};for(const[l,u]of Object.entries(a))o[l]={...u};if(r)for(const[l,u]of Object.entries(r))o[l]={...o[l]||{},...u};return{cleanedResult:{kind:"static",def:s},stateData:{stateOverrides:o}}}applyToWidget(t,i,a,r){const{stateOverrides:s}=i;if(Object.keys(s).length===0)return t;const o={...t},l=t.kind,u=To[l]||new Set;t.props&&(o.props={...t.props}),t.on&&(o.on={...t.on});for(const[p,h]of Object.entries(s))for(const[c,y]of Object.entries(h))c==="visible"?this.applyVisibility(o,p,y):ms[c]?this.applyStateEvent(o,p,c,y,a,r):u.has(c)?o[`${c}.${p}`]=y:(o.props||(o.props={}),o.props[`${c}.${p}`]=y);return o}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,a){if(a){const r=t.include?.in||[];t.include={...t.include||{},in:[...r,i]}}else{const r=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...r,i]}}}applyStateEvent(t,i,a,r,s,o){const l=ms[a];if(t.on||(t.on={}),typeof r=="function"){const u=cs(r);if(u!=null)t.on[`${l}.${i}`]=u;else{const p=o.next();s.set(p,r),t.on[`${l}.${i}`]=p}}else typeof r=="string"&&(t.on[`${l}.${i}`]=r)}}const _o=new So;function ga(e){return{errors:void 0,touched:void 0,translate:void 0,...e??{},$form:e?.$form??{}}}function Ao(){let e=0;return{next:()=>`event_${e++}`}}class Eo{constructor(t,i,a,r,s,o){this.registry=t,this.resolver=i,this.merger=a,this.mapper=r,this.eventWiring=s,this.stateExpansion=o}walkAndMap(t,i,a){const r=new Map,s=Ao(),o={value:0},l=new Set;return{widgets:this.walkItems(t,i,r,a,s,o,l),eventRegistry:r}}walkItems(t,i,a,r,s,o,l){return t.flatMap(u=>{if(u.type!=="ITEMS")throw new Error(`Unexpected shortcut type "${u.type}"`);return u.items.map(p=>this.processItem(p,u.itemType,u.tags,i,a,r,s,o,l))})}processItem(t,i,a,r,s,o,l,u,p){const h=i,c=this.registry.getItemTypeHandler(i),y=c.parseEntry(t),g=this.buildBaseDef(y),_=this.buildDecoratorForMatching(g,h,a),L=this.resolver.resolve(_,r),Ae=L.leafSelectors.filter(Ze=>Ze.targetState!=null),nt={leafSelectors:L.leafSelectors.filter(Ze=>Ze.targetState==null),sensibleDefaults:L.sensibleDefaults};let Dt=this.merger.merge(g,h,nt);c.afterMerge&&(Dt=c.afterMerge(Dt,{eventRegistry:s,formConfig:o,eventIdGenerator:l})),Dt=this.eventWiring.wireInputLayoutEvents(Dt,s,l);const{cleanedResult:so,stateData:ls}=this.stateExpansion.extractFromMergeResult(Dt,Ae);let ht;if(c.buildCustomWidget){const Ze=this.buildCustomWidgetContext(y.children,r,s,o,l,u,p);ht=this.buildCustomWidget(c,so,Ze)}else ht=this.mapper.mapToWidget(so,h);if(typeof ht!="function"){const Ze=ht;Ze.uid||(Ze.path&&!p.has(Ze.path)?(Ze.uid=Ze.path,p.add(Ze.path)):Ze.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(ls))if(typeof ht=="function"){const Ze=ht;ht=(of=>{const lf=Ze(of);return this.stateExpansion.applyToWidget(lf,ls,s,l)})}else ht=this.stateExpansion.applyToWidget(ht,ls,s,l);return ht}buildCustomWidgetContext(t,i,a,r,s,o,l){return{children:t,mapStaticDef:(u,p)=>this.mapper.mapStaticDef(u,p),walkChildren:u=>this.walkItems(u,i,a,r,s,o,l)}}buildCustomWidget(t,i,a){return t.buildCustomWidget(i,a)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?a=>{const r=ga(a),s=i(r);return t.path!=null?{...s,path:t.path}:s}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,a){if(typeof t=="function")return{itemType:i,tags:[...a]};const r=[...a,..."tags"in t&&t.tags?t.tags:[]],s="uid"in t?t.uid:void 0,o="type"in t?t.type:void 0;return{itemType:i,tags:r,uid:s,type:o}}}class Co{constructor(t,i,a){this.selectorNormalizer=t,this.walker=i,this.adapter=a}processDxFacade(t,i=[],a){const{defs:r,gslSelectors:s,formConfig:o}=this.prepareForm(t,i,a),{widgets:l,eventRegistry:u}=this.walker.walkAndMap(r,s,o),p=l[0];return this.buildResult({form:p},u,o)}prepareForm(t,i,a){const s=(Array.isArray(t)?[...t]:[t]).map(u=>typeof u=="function"?this.adapter.bareItemToWidget(u):u),o=this.selectorNormalizer.normalizeSelectors(i),l={...this.selectorNormalizer.extractFormConfig(),...a};return l.suppressAutomaticStack?{defs:s,gslSelectors:o,formConfig:l}:{defs:[this.adapter.rootEntry(s)],gslSelectors:o,formConfig:l}}convertStateNames(t){const i={};for(const[a,r]of Object.entries(t))i[a.replace(/\$/g,":")]=r;return i}buildResult(t,i,a){a.states&&Object.keys(a.states).length>0&&(t={...t,states:this.convertStateNames(a.states)});const r={form:t};return i.size>0&&(r.events=s=>{const o=i.get(s.name);if(o){const l=p=>{if(p&&typeof p=="object"&&"path"in p&&!("type"in p)){const{path:h,...c}=p;for(const[y,g]of Object.entries(c))s.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:h,prop:y,value:g}})}else s.callback(p)},u={...s,callback:l,update:l};o(u)}}),a.dependencies&&(r.dependencies=a.dependencies),a.functions&&(r.functions=a.functions),a.widgetLoaders&&(r.widgetLoaders=a.widgetLoaders),a.validateOn&&(r.validateOn=a.validateOn),a.itemRenderers&&(r.itemRenderers=a.itemRenderers),r}}function Lo(e){const{registry:t,adapter:i}=e,a=new Eo(t,new go(t),new vo(fo,t),new Do(t),ya,_o);return new Co(new wo,a,i)}function ys(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(gs):gs(e)}function gs(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"}function Io(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.form;if(ys(t))throw new Error("[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object.")}function xo(e){const t=Object.freeze({}),i=Object.freeze({}),a=new WeakMap;function r(s,o){return s==null?o:typeof s=="object"?s:{}}return function(o,l,u){if(!ys(o))return Io(o),{formDef:o};const p=r(o,t),h=r(l,t),c=r(u,i);let y=a.get(p);y||(y=new WeakMap,a.set(p,y));let g=y.get(h);g||(g=new WeakMap,y.set(h,g));const _=g.get(c);if(_)return _;const L=e.processDxFacade(o,l,u),Ae={formDef:L.form,formEvent:L.events,dependencies:L.dependencies,functions:L.functions,widgetLoaders:L.widgetLoaders,validateOn:L.validateOn,itemRenderers:L.itemRenderers};return g.set(c,Ae),Ae}}function Po(e){if("selectors"in e.facade)throw new Error(`The "${e.name}" implementation facade must not contain a "selectors" key: that slot of the namespace is filled by the selector chain.`);const t=Lo({registry:e.registry,adapter:e.adapter});return{name:e.name,registry:e.registry,namespace:{...e.facade,selectors:e.selectors},formDefs:t,resolveFormInput:xo(t)}}function J(e){const{uid:t,path:i,label:a,disabled:r,readonly:s,defaultValue:o,tags:l,type:u,size:p,onLoad:h,onChange:c,onFilter:y,on:g,states:_,include:L,exclude:Ae,validator:nt,...Dt}=e;return Dt}function ie(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function Mo(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 X(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Mo(e.path)}}function et(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function Oo(e){switch(e.type){case"text":return Fo(e);case"number":return Bo(e);case"boolean":return Ro(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Ro(e){const t=J(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:ie(e.validator,"boolean")}:{},props:t}}function Fo(e){const t=J(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:ie(e.validator,"string")}}function Bo(e){const t=J(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:ie(e.validator,"number")}}const ba=P({itemType:"INPUTS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=X(e,t);return i=et(i,t),i}},mapToWidget:Oo}),xi=ba.gsl,No=ba.gslByUid;function qo(e){const{uid:t,label:i,actionType:a,disabled:r,on:s,onClick:o,data:l,type:u,tags:p,size:h,include:c,exclude:y,states:g,..._}=e;return{uid:t??"",kind:"action",type:"button",disabled:r,actionType:a,label:i,...s!=null?{on:s}:{},props:_}}const fa=P({itemType:"ACTIONS",kind:"action",entryShape:"bare",mapToWidget:qo,afterMerge:(e,t)=>ya.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),zo=fa.gsl,Uo=fa.gslByUid;function Go(e){const{uid:t,widgetName:i,tags:a,size:r,onChange:s,include:o,exclude:l,...u}=e,{on:p,...h}=u;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:h.direction??"column",...h},children:[]}}function Vo(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"LAYOUTS"),children:i}})}function Zo(e){return e.children}const va=P({itemType:"LAYOUTS",kind:"layout",entryShape:"compound",mapToWidget:Go,buildCustomWidget:Vo,getChildren:Zo}),Yo=va.gsl,Ho=va.gslByUid;function Wo(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function Ko(e,t){if(e.kind==="static"){const a=e.def;return(r=>({uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(ga(r))}}))}const i=e.fn;return(a=>{const r=i(a);return{uid:"",kind:"display",type:"renderer",...r.include!=null?{include:r.include}:{},...r.exclude!=null?{exclude:r.exclude}:{},props:{render:r.render(ga(a))}}})}const Da=P({itemType:"DISPLAYS",kind:"display",entryShape:"bare",mapToWidget:Wo,buildCustomWidget:Ko}),Jo=Da.gsl,Xo=Da.gslByUid,wa=P({itemType:"CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:ie(e.validator,"string")}:{},props:J(e)})}),Qo=wa.gsl,jo=wa.gslByUid,$a=P({itemType:"DATE_TIME_CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeCalendar",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:ie(e.validator,"string")}:{},props:J(e)})}),el=$a.gsl,tl=$a.gslByUid,ka=P({itemType:"DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimePicker",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:ie(e.validator,"string")}:{},props:J(e)})}),il=ka.gsl,al=ka.gslByUid,Ta=P({itemType:"TEXTAREA",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:ie(e.validator,"string")}:{},props:J(e)})}),rl=Ta.gsl,sl=Ta.gslByUid,Sa=P({itemType:"PASSWORD",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:ie(e.validator,"string")}:{},props:J(e)})}),nl=Sa.gsl,ol=Sa.gslByUid,_a=P({itemType:"CHECKBOX",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:ie(e.validator,"boolean")}:{},props:J(e)})}),ll=_a.gsl,dl=_a.gslByUid,Aa=P({itemType:"DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:ie(e.validator,"string")}:{},props:J(e)})}),ul=Aa.gsl,pl=Aa.gslByUid,Ea=P({itemType:"TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timeInput",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:ie(e.validator,"string")}:{},props:J(e)})}),hl=Ea.gsl,cl=Ea.gslByUid,Ca=P({itemType:"TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timePicker",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:ie(e.validator,"string")}:{},props:J(e)})}),ml=Ca.gsl,yl=Ca.gslByUid,La=P({itemType:"DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeInput",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:ie(e.validator,"string")}:{},props:J(e)})}),gl=La.gsl,bl=La.gslByUid,Ia=P({itemType:"CURRENCY",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:ie(e.validator,"number")}:{},props:J(e)})}),fl=Ia.gsl,vl=Ia.gslByUid,xa=P({itemType:"RANGE_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:ie(e.validator,"array")}:{},props:J(e)})}),Dl=xa.gsl,wl=xa.gslByUid,Pa=P({itemType:"SELECT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:J(e)})}),$l=Pa.gsl,kl=Pa.gslByUid,Ma=P({itemType:"RADIOGROUP",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:J(e)})}),Tl=Ma.gsl,Sl=Ma.gslByUid;function _l(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 Al(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"TABS"),children:i}})}function El(e){return e.children}const Oa=P({itemType:"TABS",kind:"layout",entryShape:"compound",mapToWidget:_l,buildCustomWidget:Al,getChildren:El}),Cl=Oa.gsl,Ll=Oa.gslByUid,Ra=P({itemType:"LIST",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:J(e)})}),Il=Ra.gsl,xl=Ra.gslByUid,Fa=P({itemType:"TAGS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:ie(e.validator,"array")}:{},props:J(e)})});Fa.gsl,Fa.gslByUid;const Ba=P({itemType:"ALERTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),Pl=Ba.gsl,Ml=Ba.gslByUid,Na=P({itemType:"MARKDOWN_TEXTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})}),Ol=Na.gsl,Rl=Na.gslByUid,qa=P({itemType:"DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:ie(e.validator,"string")}:{},props:J(e)})}),Fl=qa.gsl,Bl=qa.gslByUid,za=P({itemType:"DROPDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:J(e)})}),Nl=za.gsl,ql=za.gslByUid;function zl(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 Ul(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"ACCORDION"),children:i}})}function Gl(e){return e.children}const Ua=P({itemType:"ACCORDION",kind:"layout",entryShape:"compound",mapToWidget:zl,buildCustomWidget:Ul,getChildren:Gl}),Vl=Ua.gsl,Zl=Ua.gslByUid;function Yl(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 Hl(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:ie(e.validator,"array")}:{},props:{...Yl(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Ga(e,t){for(const i of e){if(typeof i=="function")continue;const a=i;typeof a.path=="string"&&a.path&&!a.path.startsWith(t)&&(a.path=t+a.path),"children"in a&&Array.isArray(a.children)&&Ga(a.children,t);const r=a.props;r?.template?.children&&Array.isArray(r.template.children)&&Ga(r.template.children,t)}}function Wl(e,t){const i=t.walkChildren(t.children??[]),a=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";a&&Ga(i,a+".items.");const r={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const o=t.mapStaticDef(e.def,"REPEATER");return{...o,props:{...o.props,template:r}}}const s=e.fn;return(o=>{const l=s(o),u=t.mapStaticDef(l,"REPEATER");return{...u,props:{...u.props,template:r}}})}function Kl(e){return{baseDef:e.def,path:e.key,children:e.children}}function Jl(e){return e.children}const Xl={parseEntry:Kl,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Hl,buildCustomWidget:Wl,getChildren:Jl},Va=Ct("REPEATER"),bs=(e,t)=>Va(t,(i=>i.uid===e)),Ql={itemType:"REPEATER",kind:"input",handler:Xl,gsl:Va,gslByUid:bs},Za=P({itemType:"MARKDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:ie(e.validator,"string")}:{},props:J(e)})}),jl=Za.gsl,ed=Za.gslByUid,Ya=P({itemType:"RANGE_DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:ie(e.validator,"array")}:{},props:J(e)})}),td=Ya.gsl,id=Ya.gslByUid,Ha=P({itemType:"RANGE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimeInput",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:ie(e.validator,"array")}:{},props:J(e)})}),ad=Ha.gsl,rd=Ha.gslByUid,Wa=P({itemType:"RANGE_DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeInput",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:ie(e.validator,"array")}:{},props:J(e)})}),sd=Wa.gsl,nd=Wa.gslByUid,Ka=P({itemType:"RANGE_DATE_TIME_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeCalendar",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:ie(e.validator,"array")}:{},props:J(e)})}),od=Ka.gsl,ld=Ka.gslByUid,Ja=P({itemType:"RANGE_DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimePicker",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:ie(e.validator,"array")}:{},props:J(e)})}),dd=Ja.gsl,ud=Ja.gslByUid,Xa=P({itemType:"RANGE_DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:ie(e.validator,"array")}:{},props:J(e)})}),pd=Xa.gsl,hd=Xa.gslByUid,Qa=P({itemType:"RANGE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimePicker",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:ie(e.validator,"array")}:{},props:J(e)})}),cd=Qa.gsl,md=Qa.gslByUid,ja=P({itemType:"CUSTOM_DISPLAY",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})}),yd=ja.gsl,gd=ja.gslByUid,er=P({itemType:"CUSTOM_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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??{}})}),bd=er.gsl,fd=er.gslByUid,tr=P({itemType:"CUSTOM_ACTION",kind:"action",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:a,on:r,onClick:s,data:o,customType:l,tags:u,size:p,include:h,exclude:c,states:y,props:g,..._}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:a,...r!=null?{on:r}:{},props:{...g,..._}}},afterMerge:(e,t)=>ya.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),vd=tr.gsl,Dd=tr.gslByUid;function wd(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function $d(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"CUSTOM_LAYOUT"),children:i}})}function kd(e){return e.children}const ir=P({itemType:"CUSTOM_LAYOUT",kind:"layout",entryShape:"compound",mapToWidget:wd,buildCustomWidget:$d,getChildren:kd}),Td=ir.gsl,Sd=ir.gslByUid,_d=[ba,fa,va,Da,wa,$a,ka,Ta,Sa,_a,Aa,Ea,Ca,La,Ia,xa,Pa,Ma,Oa,Ra,Fa,Ba,Na,qa,za,Ua,Ql,Za,Ya,Ha,Wa,Ka,Ja,Xa,Qa,ja,er,tr,ir],fs=uo();for(const e of _d)po(fs,e);function Ad(e,t,i){if(typeof t=="function"){const r=t;return{items:[{key:e,def:o=>({type:"text",...r(o)})}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}const a={type:"text",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}function Ed(e,t,i){if(typeof t=="function"){const r=t;return{items:[{key:e,def:o=>({type:"number",...r(o)})}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}const a={type:"number",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}function Cd(e,t,i){if(typeof t=="function"){const r=t;return{items:[{key:e,def:o=>({type:"boolean",...r(o)})}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}const a={type:"boolean",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}function Ld(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:u=>({type:"select",...s(u)})}],tags:i??[]}}const a={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:a}],tags:i??[]}}function Id(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:u=>({type:"dropdown",...s(u)})}],tags:i??[]}}const a={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:a}],tags:i??[]}}function xd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:u=>({type:"radiogroup",...s(u)})}],tags:i??[]}}const a={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:a}],tags:i??[]}}function Pd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:u=>({type:"checkbox",...s(u)})}],tags:i??[]}}const a={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:a}],tags:i??[]}}function Md(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:u=>({type:"textarea",...s(u)})}],tags:i??[]}}const a={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:a}],tags:i??[]}}function Od(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:u=>({type:"password",...s(u)})}],tags:i??[]}}const a={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:a}],tags:i??[]}}function Rd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:u=>({type:"currency",...s(u)})}],tags:i??[]}}const a={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:a}],tags:i??[]}}function Fd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:u=>({type:"markdown",...s(u)})}],tags:i??[]}}const a={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:a}],tags:i??[]}}function Bd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:u=>({type:"list",...s(u)})}],tags:i??[]}}const a={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:a}],tags:i??[]}}function Nd(e,t,i){if(typeof t=="function"){const r=t;return{items:[o=>({type:"calendar",path:e,...r(o)})],type:"ITEMS",itemType:"CALENDAR",tags:i??[]}}return{items:[{type:"calendar",path:e,...t}],type:"ITEMS",itemType:"CALENDAR",tags:i??[]}}function qd(e,t,i){if(typeof t=="function"){const r=t;return{items:[o=>({type:"dateTimeCalendar",path:e,...r(o)})],type:"ITEMS",itemType:"DATE_TIME_CALENDAR",tags:i??[]}}return{items:[{type:"dateTimeCalendar",path:e,...t}],type:"ITEMS",itemType:"DATE_TIME_CALENDAR",tags:i??[]}}function zd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:u=>({type:"dateInput",...s(u)})}],tags:i??[]}}const a={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Ud(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:u=>({type:"datePicker",...s(u)})}],tags:i??[]}}const a={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Gd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_TIME_PICKER",items:[{key:e,def:u=>({type:"dateTimePicker",...s(u)})}],tags:i??[]}}const a={type:"dateTimePicker",...t};return{type:"ITEMS",itemType:"DATE_TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Vd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:u=>({type:"rangeCalendar",...s(u)})}],tags:i??[]}}const a={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:a}],tags:i??[]}}function Zd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:u=>({type:"rangeDateInput",...s(u)})}],tags:i??[]}}const a={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Yd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_INPUT",items:[{key:e,def:u=>({type:"rangeDateTimeInput",...s(u)})}],tags:i??[]}}const a={type:"rangeDateTimeInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Hd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_CALENDAR",items:[{key:e,def:u=>({type:"rangeDateTimeCalendar",...s(u)})}],tags:i??[]}}const a={type:"rangeDateTimeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_CALENDAR",items:[{key:e,def:a}],tags:i??[]}}function Wd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_PICKER",items:[{key:e,def:u=>({type:"rangeDateTimePicker",...s(u)})}],tags:i??[]}}const a={type:"rangeDateTimePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Kd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_TIME_INPUT",items:[{key:e,def:u=>({type:"rangeTimeInput",...s(u)})}],tags:i??[]}}const a={type:"rangeTimeInput",...t};return{type:"ITEMS",itemType:"RANGE_TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Jd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:u=>({type:"rangeDatePicker",...s(u)})}],tags:i??[]}}const a={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Xd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_TIME_PICKER",items:[{key:e,def:u=>({type:"rangeTimePicker",...s(u)})}],tags:i??[]}}const a={type:"rangeTimePicker",...t};return{type:"ITEMS",itemType:"RANGE_TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Qd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TIME_INPUT",items:[{key:e,def:u=>({type:"timeInput",...s(u)})}],tags:i??[]}}const a={type:"timeInput",...t};return{type:"ITEMS",itemType:"TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function jd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TIME_PICKER",items:[{key:e,def:u=>({type:"timePicker",...s(u)})}],tags:i??[]}}const a={type:"timePicker",...t};return{type:"ITEMS",itemType:"TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function eu(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_TIME_INPUT",items:[{key:e,def:u=>({type:"dateTimeInput",...s(u)})}],tags:i??[]}}const a={type:"dateTimeInput",...t};return{type:"ITEMS",itemType:"DATE_TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function tu(e,t,i,a){if(typeof i=="function"){const o=i;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:p=>({customType:e,...o(p)})}],tags:a??[]}}const r={customType:e,...i};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:r}],tags:a??[]}}function iu(e,t){return{items:[e],type:"ITEMS",itemType:Je.ACTIONS,tags:t??[]}}function au(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[l=>({customType:e,...s(l)})],tags:i??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:e,...t}],tags:i??[]}}const vs=(e,t)=>({type:"ITEMS",itemType:Je.DISPLAYS,items:[{render:e}],tags:t??[]});function ru(e,t){return{type:"ITEMS",itemType:"ALERTS",items:[e],tags:t??[]}}function su(e,t){return{type:"ITEMS",itemType:"MARKDOWN_TEXTS",items:[e],tags:t??[]}}function nu(e,t,i){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[p=>({customType:e,...l(p)})],tags:i??[]}}const{uid:a,...r}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:e,...a!=null?{uid:a}:{},props:Object.keys(r).length>0?r:void 0}],tags:i??[]}}const ar=(e,t,i)=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:e}],tags:i??[]}),ou=(e,t,i)=>ar(e,{direction:"row",...t??{}},i),lu=(e,t,i)=>ar(e,{direction:"column",...t??{}},i),rr=(e,t,i)=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:e}],tags:i??[]}),du=(e,t,i)=>rr(e,{direction:"row",...t??{}},i),uu=(e,t,i)=>rr(e,{direction:"column",...t??{}},i);function Ds(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function pu(e,t,i){const a=e.map(o=>({label:o.label,uid:o.uid??Ds(o.label)})),r=e.map(o=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{uid:o.uid??Ds(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:a,...t},children:r}],tags:i??[]}}function ws(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function hu(e,t,i){const a=e.map(o=>({label:o.label,uid:o.uid??ws(o.label)})),r=e.map(o=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{uid:o.uid??ws(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:a,...t},children:r}],tags:i??[]}}function cu(e,t,i,a){if(typeof i=="function"){const o=i;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:p=>({customType:e,...o(p)}),children:t}],tags:a??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:e,...i},children:t}],tags:a??[]}}function mu(e,t,i){const{template:a,...r}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:e,def:r,children:a}],tags:i??[]}}function yu(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:u=>({type:"tags",...s(u)})}],tags:i??[]}}const a={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:a}],tags:i??[]}}const gu=yo({inputs:xi,inputByUid:No,textInputs:e=>xi(e,t=>t.type==="text"),numberInputs:e=>xi(e,t=>t.type==="number"),booleanInputs:e=>xi(e,t=>t.type==="boolean"),selects:$l,selectByUid:kl,dropdowns:Nl,dropdownByUid:ql,radiogroups:Tl,radiogroupByUid:Sl,checkboxes:ll,checkboxByUid:dl,textareas:rl,textareaByUid:sl,passwords:nl,passwordByUid:ol,currencies:fl,currencyByUid:vl,markdowns:jl,markdownByUid:ed,lists:Il,listByUid:xl,calendars:Qo,calendarByUid:jo,dateTimeCalendars:el,dateTimeCalendarByUid:tl,dateInputs:ul,dateInputByUid:pl,timeInputs:hl,timeInputByUid:cl,timePickers:ml,timePickerByUid:yl,dateTimeInputs:gl,dateTimeInputByUid:bl,datePickers:Fl,datePickerByUid:Bl,dateTimePickers:il,dateTimePickerByUid:al,rangeCalendars:Dl,rangeCalendarByUid:wl,rangeDateInputs:td,rangeDateInputByUid:id,rangeTimeInputs:ad,rangeTimeInputByUid:rd,rangeDateTimeInputs:sd,rangeDateTimeInputByUid:nd,rangeDateTimeCalendars:od,rangeDateTimeCalendarByUid:ld,rangeDateTimePickers:dd,rangeDateTimePickerByUid:ud,rangeDatePickers:pd,rangeDatePickerByUid:hd,rangeTimePickers:cd,rangeTimePickerByUid:md,repeaters:Va,repeaterByUid:bs,actions:zo,actionByUid:Uo,layouts:Yo,layoutByUid:Ho,displays:Jo,displayByUid:Xo,alerts:Pl,alertByUid:Ml,markdownTexts:Ol,markdownTextByUid:Rl,tabs:Cl,tabsByUid:Ll,accordions:Vl,accordionByUid:Zl,customInputs:bd,customInputByUid:fd,customActions:vd,customActionByUid:Dd,customDisplays:yd,customDisplayByUid:gd,customLayouts:Td,customLayoutByUid:Sd}),bu=Po({name:"gui",registry:fs,facade:{inputs:{textInput:Ad,numberInput:Ed,booleanInput:Cd,select:Ld,dropdown:Id,radiogroup:xd,checkbox:Pd,textarea:Md,password:Od,currency:Rd,markdown:Fd,list:Bd,calendar:Nd,dateTimeCalendar:qd,dateInput:zd,datePicker:Ud,dateTimePicker:Gd,timeInput:Qd,timePicker:jd,dateTimeInput:eu,rangeCalendar:Vd,rangeDateInput:Zd,rangeDateTimeInput:Yd,rangeDateTimeCalendar:Hd,rangeDateTimePicker:Wd,rangeTimeInput:Kd,rangeDatePicker:Jd,rangeTimePicker:Xd,repeater:mu,tags:yu,custom:tu},actions:{button:iu,custom:au},displays:{display:vs,alert:ru,markdownText:su,custom:nu},layouts:{flex:ar,horizontalFlex:ou,verticalFlex:lu,grid:rr,horizontalGrid:du,verticalGrid:uu,tabs:pu,accordion:hu,custom:cu}},selectors:gu,adapter:{bareItemToWidget:e=>vs(e),rootEntry:e=>{const t={def:{uid:"#root",direction:"column",widgetName:"flex"},children:e};return{type:"ITEMS",itemType:Je.LAYOUTS,items:[t],tags:[]}}}}).resolveFormInput;function b(e,t,i){function a(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,u);const p=o.prototype,h=Object.keys(p);for(let c=0;c<h.length;c++){const y=h[c];y in l||(l[y]=p[y].bind(l))}}const r=i?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:e});function o(l){var u;const p=i?.Parent?new s:this;a(p,l),(u=p._zod).deferred??(u.deferred=[]);for(const h of p._zod.deferred)h();return p}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>i?.Parent&&l instanceof i.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Lt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $s extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const fu={};function $t(e){return fu}function sr(e,t){return typeof t=="bigint"?t.toString():t}function nr(e){return e==null}function or(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const ks=Symbol("evaluating");function Q(e,t,i){let a;Object.defineProperty(e,t,{get(){if(a!==ks)return a===void 0&&(a=ks,a=i()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function vu(...e){const t={};for(const i of e){const a=Object.getOwnPropertyDescriptors(i);Object.assign(t,a)}return Object.defineProperties({},t)}function Du(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ts="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ss(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lr(e){if(Ss(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(Ss(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function _s(e){return lr(e)?{...e}:Array.isArray(e)?[...e]:e}function dr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function As(e,t,i){const a=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(a._zod.parent=e),a}function z(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 wu={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 It(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 $u(e,t){return t.map(i=>{var a;return(a=i).path??(a.path=[]),i.path.unshift(e),i})}function Pi(e){return typeof e=="string"?e:e?.message}function kt(e,t,i){const a={...e,path:e.path??[]};if(!e.message){const r=Pi(e.inst?._zod.def?.error?.(e))??Pi(t?.error?.(e))??Pi(i.customError?.(e))??Pi(i.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ur(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function qt(...e){const[t,i,a]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:a}:{...t}}const Es=(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,sr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cs=b("$ZodError",Es),Mi=b("$ZodError",Es,{Parent:Error});function ku(e,t=i=>i.message){const i={},a=[];for(const r of e.issues)r.path.length>0?(i[r.path[0]]=i[r.path[0]]||[],i[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:i}}function Tu(e,t=i=>i.message){const i={_errors:[]},a=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>a({issues:o}));else if(s.code==="invalid_key")a({issues:s.issues});else if(s.code==="invalid_element")a({issues:s.issues});else if(s.path.length===0)i._errors.push(t(s));else{let o=i,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return a(e),i}const Oi=e=>(t,i,a,r)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise)throw new Lt;if(o.issues.length){const l=new(r?.Err??e)(o.issues.map(u=>kt(u,s,$t())));throw Ts(l,r?.callee),l}return o.value},Su=Oi(Mi),Ri=e=>async(t,i,a,r)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new(r?.Err??e)(o.issues.map(u=>kt(u,s,$t())));throw Ts(l,r?.callee),l}return o.value},_u=Ri(Mi),Fi=e=>(t,i,a)=>{const r=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new Lt;return s.issues.length?{success:!1,error:new(e??Cs)(s.issues.map(o=>kt(o,r,$t())))}:{success:!0,data:s.value}},Ls=Fi(Mi),Bi=e=>async(t,i,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>kt(o,r,$t())))}:{success:!0,data:s.value}},Is=Bi(Mi),Au=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Oi(e)(t,i,r)},Eu=e=>(t,i,a)=>Oi(e)(t,i,a),Cu=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ri(e)(t,i,r)},Lu=e=>async(t,i,a)=>Ri(e)(t,i,a),Iu=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Fi(e)(t,i,r)},xu=e=>(t,i,a)=>Fi(e)(t,i,a),Pu=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Bi(e)(t,i,r)},Mu=e=>async(t,i,a)=>Bi(e)(t,i,a),Ou=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xs=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)$/,Ru=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fu=/^(?:(?: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])$/,Bu=/^(([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}|:))$/,Nu=/^(?=.{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])?)*\.?$/,Ps="(?:(?:\\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])))",qu=new RegExp(`^${Ps}$`);function Ms(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 zu(e){return new RegExp(`^${Ms(e)}$`)}function Uu(e){const t=Ms({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${i.join("|")})`;return new RegExp(`^${Ps}T(?:${a})$`)}const Gu=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Vu=/^-?\d+$/,Zu=/^-?\d+(?:\.\d+)?$/,Yu=/^(?:true|false)$/i,Hu=/^[^A-Z]*$/,Wu=/^[^a-z]*$/,Xe=b("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Os={number:"number",bigint:"bigint",object:"date"},Ku=b("$ZodCheckLessThan",(e,t)=>{Xe.init(e,t);const i=Os[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ju=b("$ZodCheckGreaterThan",(e,t)=>{Xe.init(e,t);const i=Os[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xu=b("$ZodCheckNumberFormat",(e,t)=>{Xe.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),a=i?"int":"number",[r,s]=wu[t.format];e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,l.minimum=r,l.maximum=s,i&&(l.pattern=Vu)}),e._zod.check=o=>{const l=o.value;if(i){if(!Number.isInteger(l)){o.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}l<r&&o.issues.push({origin:"number",input:l,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),l>s&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Qu=b("$ZodCheckMaxLength",(e,t)=>{var i;Xe.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!nr(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const o=ur(r);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ju=b("$ZodCheckMinLength",(e,t)=>{var i;Xe.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!nr(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const o=ur(r);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ep=b("$ZodCheckLengthEquals",(e,t)=>{var i;Xe.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!nr(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,s=r.length;if(s===t.length)return;const o=ur(r),l=s>t.length;a.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Ni=b("$ZodCheckStringFormat",(e,t)=>{var i,a;Xe.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),tp=b("$ZodCheckRegex",(e,t)=>{Ni.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})}}),ip=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Hu),Ni.init(e,t)}),ap=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wu),Ni.init(e,t)}),rp=b("$ZodCheckIncludes",(e,t)=>{Xe.init(e,t);const i=dr(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=a,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),sp=b("$ZodCheckStartsWith",(e,t)=>{Xe.init(e,t);const i=new RegExp(`^${dr(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),np=b("$ZodCheckEndsWith",(e,t)=>{Xe.init(e,t);const i=new RegExp(`.*${dr(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),op=b("$ZodCheckOverwrite",(e,t)=>{Xe.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),lp={major:4,minor:3,patch:6},$e=b("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lp;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const s of r._zod.onattach)s(e);if(a.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(o,l,u)=>{let p=It(o),h;for(const c of l){if(c._zod.def.when){if(!c._zod.def.when(o))continue}else if(p)continue;const y=o.issues.length,g=c._zod.check(o);if(g instanceof Promise&&u?.async===!1)throw new Lt;if(h||g instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await g,o.issues.length!==y&&(p||(p=It(o,y)))});else{if(o.issues.length===y)continue;p||(p=It(o,y))}}return h?h.then(()=>o):o},s=(o,l,u)=>{if(It(o))return o.aborted=!0,o;const p=r(l,a,u);if(p instanceof Promise){if(u.async===!1)throw new Lt;return p.then(h=>e._zod.parse(h,u))}return e._zod.parse(p,u)};e._zod.run=(o,l)=>{if(l.skipChecks)return e._zod.parse(o,l);if(l.direction==="backward"){const p=e._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return p instanceof Promise?p.then(h=>s(h,o,l)):s(p,o,l)}const u=e._zod.parse(o,l);if(u instanceof Promise){if(l.async===!1)throw new Lt;return u.then(p=>r(p,a,l))}return r(u,a,l)}}Q(e,"~standard",()=>({validate:r=>{try{const s=Ls(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Is(e,r).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),pr=b("$ZodString",(e,t)=>{$e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gu(e._zod.bag),e._zod.parse=(i,a)=>{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}}),tt=b("$ZodStringFormat",(e,t)=>{Ni.init(e,t),pr.init(e,t)}),dp=b("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=xs(a))}else t.pattern??(t.pattern=xs());tt.init(e,t)}),up=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ru),tt.init(e,t)}),pp=b("$ZodURL",(e,t)=>{tt.init(e,t),e._zod.check=i=>{try{const a=i.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.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(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.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=r.href:i.value=a;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),hp=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Uu(t)),tt.init(e,t)}),cp=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qu),tt.init(e,t)}),mp=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=zu(t)),tt.init(e,t)}),yp=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ou),tt.init(e,t)}),gp=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Fu),tt.init(e,t),e._zod.bag.format="ipv4"}),bp=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bu),tt.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})}}}),fp=b("$ZodCustomStringFormat",(e,t)=>{tt.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})}}),Rs=b("$ZodNumber",(e,t)=>{$e.init(e,t),e._zod.pattern=e._zod.bag.pattern??Zu,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const r=i.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return i;const s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),i}}),vp=b("$ZodNumberFormat",(e,t)=>{Xu.init(e,t),Rs.init(e,t)}),Dp=b("$ZodBoolean",(e,t)=>{$e.init(e,t),e._zod.pattern=Yu,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=!!i.value}catch{}const r=i.value;return typeof r=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),i}}),wp=b("$ZodAny",(e,t)=>{$e.init(e,t),e._zod.parse=i=>i});function Fs(e,t,i){e.issues.length&&t.issues.push(...$u(i,e.issues)),t.value[i]=e.value}const Bs=b("$ZodArray",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{const r=i.value;if(!Array.isArray(r))return i.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),i;i.value=Array(r.length);const s=[];for(let o=0;o<r.length;o++){const l=r[o],u=t.element._zod.run({value:l,issues:[]},a);u instanceof Promise?s.push(u.then(p=>Fs(p,i,o))):Fs(u,i,o)}return s.length?Promise.all(s).then(()=>i):i}});function Ns(e,t,i,a){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!It(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(s=>s.issues.map(o=>kt(o,a,$t())))}),t)}const $p=b("$ZodUnion",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Q(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Q(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Q(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>or(s.source)).join("|")})$`)}});const i=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(i)return a(r,s);let o=!1;const l=[];for(const u of t.options){const p=u._zod.run({value:r.value,issues:[]},s);if(p instanceof Promise)l.push(p),o=!0;else{if(p.issues.length===0)return p;l.push(p)}}return o?Promise.all(l).then(u=>Ns(u,r,e,s)):Ns(l,r,e,s)}}),kp=b("$ZodIntersection",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{const r=i.value,s=t.left._zod.run({value:r,issues:[]},a),o=t.right._zod.run({value:r,issues:[]},a);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([u,p])=>qs(i,u,p)):qs(i,s,o)}});function hr(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(lr(e)&&lr(t)){const i=Object.keys(t),a=Object.keys(e).filter(s=>i.indexOf(s)!==-1),r={...e,...t};for(const s of a){const o=hr(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};r[s]=o.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let a=0;a<e.length;a++){const r=e[a],s=t[a],o=hr(r,s);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i.push(o.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function qs(e,t,i){const a=new Map;let r;for(const l of t.issues)if(l.code==="unrecognized_keys"){r??(r=l);for(const u of l.keys)a.has(u)||a.set(u,{}),a.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)a.has(u)||a.set(u,{}),a.get(u).r=!0;else e.issues.push(l);const s=[...a].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&r&&e.issues.push({...r,keys:s}),It(e))return e;const o=hr(t.value,i.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Tp=b("$ZodTransform",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new $s(e.constructor.name);const r=t.transform(i.value,i);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(o=>(i.value=o,i));if(r instanceof Promise)throw new Lt;return i.value=r,i}});function zs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const cr=b("$ZodOptional",(e,t)=>{$e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${or(i.source)})?$`):void 0}),e._zod.parse=(i,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>zs(s,i.value)):zs(r,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,a)}}),Sp=b("$ZodExactOptional",(e,t)=>{cr.init(e,t),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,a)=>t.innerType._zod.run(i,a)}),_p=b("$ZodNullable",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${or(i.source)}|null)$`):void 0}),Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,a)=>i.value===null?i:t.innerType._zod.run(i,a)}),Ap=b("$ZodDefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);if(i.value===void 0)return i.value=t.defaultValue,i;const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Us(s,t)):Us(r,t)}});function Us(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ep=b("$ZodPrefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>(a.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,a))}),Cp=b("$ZodNonOptional",(e,t)=>{$e.init(e,t),Q(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(a=>a!==void 0)):void 0}),e._zod.parse=(i,a)=>{const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Gs(s,e)):Gs(r,e)}});function Gs(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 Lp=b("$ZodCatch",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(o=>kt(o,a,$t()))},input:i.value}),i.issues=[]),i)):(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(s=>kt(s,a,$t()))},input:i.value}),i.issues=[]),i)}}),Ip=b("$ZodPipe",(e,t)=>{$e.init(e,t),Q(e._zod,"values",()=>t.in._zod.values),Q(e._zod,"optin",()=>t.in._zod.optin),Q(e._zod,"optout",()=>t.out._zod.optout),Q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,a)=>{if(a.direction==="backward"){const s=t.out._zod.run(i,a);return s instanceof Promise?s.then(o=>qi(o,t.in,a)):qi(s,t.in,a)}const r=t.in._zod.run(i,a);return r instanceof Promise?r.then(s=>qi(s,t.out,a)):qi(r,t.out,a)}});function qi(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const xp=b("$ZodReadonly",(e,t)=>{$e.init(e,t),Q(e._zod,"propValues",()=>t.innerType._zod.propValues),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"optin",()=>t.innerType?._zod?.optin),Q(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(Vs):Vs(r)}});function Vs(e){return e.value=Object.freeze(e.value),e}const Zs=b("$ZodCustom",(e,t)=>{Xe.init(e,t),$e.init(e,t),e._zod.parse=(i,a)=>i,e._zod.check=i=>{const a=i.value,r=t.fn(a);if(r instanceof Promise)return r.then(s=>Ys(s,i,a,e));Ys(r,i,a,e)}});function Ys(e,t,i,a){if(!e){const r={code:"custom",input:i,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(qt(r))}}var Hs;class Pp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const a=i[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.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 a={...this.get(i)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Mp(){return new Pp}(Hs=globalThis).__zod_globalRegistry??(Hs.__zod_globalRegistry=Mp());const zt=globalThis.__zod_globalRegistry;function Op(e,t){return new e({type:"string",...z(t)})}function Rp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function Fp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function Bp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function Np(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function qp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function zp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function Up(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Gp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function Vp(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Zp(e,t){return new e({type:"number",checks:[],...z(t)})}function Yp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Hp(e,t){return new e({type:"boolean",...z(t)})}function Wp(e){return new e({type:"any"})}function Kp(e,t){return new Ku({check:"less_than",...z(t),value:e,inclusive:!0})}function Jp(e,t){return new Ju({check:"greater_than",...z(t),value:e,inclusive:!0})}function zi(e,t){return new Qu({check:"max_length",...z(t),maximum:e})}function xt(e,t){return new ju({check:"min_length",...z(t),minimum:e})}function Ws(e,t){return new ep({check:"length_equals",...z(t),length:e})}function Ks(e,t){return new tp({check:"string_format",format:"regex",...z(t),pattern:e})}function Xp(e){return new ip({check:"string_format",format:"lowercase",...z(e)})}function Qp(e){return new ap({check:"string_format",format:"uppercase",...z(e)})}function jp(e,t){return new rp({check:"string_format",format:"includes",...z(t),includes:e})}function eh(e,t){return new sp({check:"string_format",format:"starts_with",...z(t),prefix:e})}function th(e,t){return new np({check:"string_format",format:"ends_with",...z(t),suffix:e})}function Pt(e){return new op({check:"overwrite",tx:e})}function ih(e){return Pt(t=>t.normalize(e))}function ah(){return Pt(e=>e.trim())}function rh(){return Pt(e=>e.toLowerCase())}function sh(){return Pt(e=>e.toUpperCase())}function nh(){return Pt(e=>Du(e))}function oh(e,t,i){return new e({type:"array",element:t,...z(i)})}function Js(e,t,i){return new e({type:"custom",check:"custom",fn:t,...z(i)})}function Xs(e){const t=lh(i=>(i.addIssue=a=>{if(typeof a=="string")i.issues.push(qt(a,i.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),i.issues.push(qt(r))}},e(i.value,i)));return t}function lh(e,t){const i=new Xe({check:"custom",...z(t)});return i._zod.check=e,i}function dh(e,t,i,a={}){const r=z(a),s={...z(a),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:l=>i.test(l),...r};return i instanceof RegExp&&(s.pattern=i),new e(s)}function Qs(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??zt,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 ze(e,t,i={path:[],schemaPath:[]}){var a;const r=e._zod.def,s=t.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,o);const l=e._zod.toJSONSchema?.();if(l)o.schema=l;else{const h={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const y=o.schema,g=t.processors[r.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);g(e,t,y,h)}const c=e._zod.parent;c&&(o.ref||(o.ref=c),ze(c,t,h),t.seen.get(c).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(o.schema,u),t.io==="input"&&Ue(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function js(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const o of e.seen.entries()){const l=e.metadataRegistry.get(o[0])?.id;if(l){const u=a.get(l);if(u&&u!==o[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(l,o[0])}}const r=o=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const c=e.external.registry.get(o[0])?.id,y=e.external.uri??(_=>_);if(c)return{ref:y(c)};const g=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=g,{defId:g,ref:`${y("__shared")}#/${l}/${g}`}}if(o[1]===i)return{ref:"#"};const p=`#/${l}/`,h=o[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:p+h}},s=o=>{if(o[1].schema.$ref)return;const l=o[1],{ref:u,defId:p}=r(o);l.def={...l.schema},p&&(l.defId=p);const h=l.schema;for(const c in h)delete h[c];h.$ref=u};if(e.cycles==="throw")for(const o of e.seen.entries()){const l=o[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
2
|
-
|
|
3
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const l=o[1];if(t===o[0]){s(o);continue}if(e.external){const p=e.external.registry.get(o[0])?.id;if(t!==o[0]&&p){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(l.cycle){s(o);continue}if(l.count>1&&e.reused==="ref"){s(o);continue}}}function en(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=o=>{const l=e.seen.get(o);if(l.ref===null)return;const u=l.def??l.schema,p={...u},h=l.ref;if(l.ref=null,h){a(h);const y=e.seen.get(h),g=y.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),o._zod.parent===h)for(const L in u)L==="$ref"||L==="allOf"||L in p||delete u[L];if(g.$ref&&y.def)for(const L in u)L==="$ref"||L==="allOf"||L in y.def&&JSON.stringify(u[L])===JSON.stringify(y.def[L])&&delete u[L]}const c=o._zod.parent;if(c&&c!==h){a(c);const y=e.seen.get(c);if(y?.schema.$ref&&(u.$ref=y.schema.$ref,y.def))for(const g in u)g==="$ref"||g==="allOf"||g in y.def&&JSON.stringify(u[g])===JSON.stringify(y.def[g])&&delete u[g]}e.override({zodSchema:o,jsonSchema:u,path:l.path??[]})};for(const o of[...e.seen.entries()].reverse())a(o[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(o)}Object.assign(r,i.def??i.schema);const s=e.external?.defs??{};for(const o of e.seen.entries()){const l=o[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{const o=JSON.parse(JSON.stringify(r));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ui(t,"input",e.processors),output:Ui(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Ue(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Ue(a.element,i);if(a.type==="set")return Ue(a.valueType,i);if(a.type==="lazy")return Ue(a.getter(),i);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Ue(a.innerType,i);if(a.type==="intersection")return Ue(a.left,i)||Ue(a.right,i);if(a.type==="record"||a.type==="map")return Ue(a.keyType,i)||Ue(a.valueType,i);if(a.type==="pipe")return Ue(a.in,i)||Ue(a.out,i);if(a.type==="object"){for(const r in a.shape)if(Ue(a.shape[r],i))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(Ue(r,i))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(Ue(r,i))return!0;return!!(a.rest&&Ue(a.rest,i))}return!1}const uh=(e,t={})=>i=>{const a=Qs({...i,processors:t});return ze(e,a),js(a,e),en(a,e)},Ui=(e,t,i={})=>a=>{const{libraryOptions:r,target:s}=a??{},o=Qs({...r??{},target:s,io:t,processors:i});return ze(e,o),js(o,e),en(o,e)},ph={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hh=(e,t,i,a)=>{const r=i;r.type="string";const{minimum:s,maximum:o,format:l,patterns:u,contentEncoding:p}=e._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof o=="number"&&(r.maxLength=o),l&&(r.format=ph[l]??l,r.format===""&&delete r.format,l==="time"&&delete r.format),p&&(r.contentEncoding=p),u&&u.size>0){const h=[...u];h.length===1?r.pattern=h[0].source:h.length>1&&(r.allOf=[...h.map(c=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))])}},ch=(e,t,i,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mh=(e,t,i,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},yh=(e,t,i,a)=>{const r=i,s=e._zod.def,{minimum:o,maximum:l}=e._zod.bag;typeof o=="number"&&(r.minItems=o),typeof l=="number"&&(r.maxItems=l),r.type="array",r.items=ze(s.element,t,{...a,path:[...a.path,"items"]})},gh=(e,t,i,a)=>{const r=e._zod.def,s=r.inclusive===!1,o=r.options.map((l,u)=>ze(l,t,{...a,path:[...a.path,s?"oneOf":"anyOf",u]}));s?i.oneOf=o:i.anyOf=o},bh=(e,t,i,a)=>{const r=e._zod.def,s=ze(r.left,t,{...a,path:[...a.path,"allOf",0]}),o=ze(r.right,t,{...a,path:[...a.path,"allOf",1]}),l=p=>"allOf"in p&&Object.keys(p).length===1,u=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];i.allOf=u},fh=(e,t,i,a)=>{const r=e._zod.def,s=ze(r.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=r.innerType,i.nullable=!0):i.anyOf=[s,{type:"null"}]},vh=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType},Dh=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,i.default=JSON.parse(JSON.stringify(r.defaultValue))},wh=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},$h=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType;let o;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=o},kh=(e,t,i,a)=>{const r=e._zod.def,s=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;ze(s,t,a);const o=t.seen.get(e);o.ref=s},Th=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,i.readOnly=!0},tn=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType},Sh=b("ZodISODateTime",(e,t)=>{hp.init(e,t),Gi.init(e,t)});function _h(e){return zp(Sh,e)}const Ah=b("ZodISODate",(e,t)=>{cp.init(e,t),Gi.init(e,t)});function Eh(e){return Up(Ah,e)}const Ch=b("ZodISOTime",(e,t)=>{mp.init(e,t),Gi.init(e,t)});function Lh(e){return Gp(Ch,e)}const Ih=b("ZodISODuration",(e,t)=>{yp.init(e,t),Gi.init(e,t)});function xh(e){return Vp(Ih,e)}const it=b("ZodError",(e,t)=>{Cs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Tu(e,i)},flatten:{value:i=>ku(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,sr,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,sr,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ph=Oi(it),Mh=Ri(it),Oh=Fi(it),Rh=Bi(it),Fh=Au(it),Bh=Eu(it),Nh=Cu(it),qh=Lu(it),zh=Iu(it),Uh=xu(it),Gh=Pu(it),Vh=Mu(it),Ge=b("ZodType",(e,t)=>($e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ui(e,"input"),output:Ui(e,"output")}}),e.toJSONSchema=uh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(vu(t,{checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(i,a)=>As(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.parse=(i,a)=>Ph(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>Oh(e,i,a),e.parseAsync=async(i,a)=>Mh(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>Rh(e,i,a),e.spa=e.safeParseAsync,e.encode=(i,a)=>Fh(e,i,a),e.decode=(i,a)=>Bh(e,i,a),e.encodeAsync=async(i,a)=>Nh(e,i,a),e.decodeAsync=async(i,a)=>qh(e,i,a),e.safeEncode=(i,a)=>zh(e,i,a),e.safeDecode=(i,a)=>Uh(e,i,a),e.safeEncodeAsync=async(i,a)=>Gh(e,i,a),e.safeDecodeAsync=async(i,a)=>Vh(e,i,a),e.refine=(i,a)=>e.check(gc(i,a)),e.superRefine=i=>e.check(bc(i)),e.overwrite=i=>e.check(Pt(i)),e.optional=()=>an(e),e.exactOptional=()=>ic(e),e.nullable=()=>rn(e),e.nullish=()=>an(rn(e)),e.nonoptional=i=>dc(e,i),e.array=()=>Hh(e),e.or=i=>Kh([e,i]),e.and=i=>Xh(e,i),e.transform=i=>sn(e,jh(i)),e.default=i=>sc(e,i),e.prefault=i=>oc(e,i),e.catch=i=>pc(e,i),e.pipe=i=>sn(e,i),e.readonly=()=>mc(e),e.describe=i=>{const a=e.clone();return zt.add(a,{description:i}),a},Object.defineProperty(e,"description",{get(){return zt.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return zt.get(e);const a=e.clone();return zt.add(a,i[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Zh=b("_ZodString",(e,t)=>{pr.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(a,r,s)=>hh(e,a,r);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...a)=>e.check(Ks(...a)),e.includes=(...a)=>e.check(jp(...a)),e.startsWith=(...a)=>e.check(eh(...a)),e.endsWith=(...a)=>e.check(th(...a)),e.min=(...a)=>e.check(xt(...a)),e.max=(...a)=>e.check(zi(...a)),e.length=(...a)=>e.check(Ws(...a)),e.nonempty=(...a)=>e.check(xt(1,...a)),e.lowercase=a=>e.check(Xp(a)),e.uppercase=a=>e.check(Qp(a)),e.trim=()=>e.check(ah()),e.normalize=(...a)=>e.check(ih(...a)),e.toLowerCase=()=>e.check(rh()),e.toUpperCase=()=>e.check(sh()),e.slugify=()=>e.check(nh())}),Gi=b("ZodStringFormat",(e,t)=>{tt.init(e,t),Zh.init(e,t)}),Yh=b("ZodArray",(e,t)=>{Bs.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>yh(e,i,a,r),e.element=t.element,e.min=(i,a)=>e.check(xt(i,a)),e.nonempty=i=>e.check(xt(1,i)),e.max=(i,a)=>e.check(zi(i,a)),e.length=(i,a)=>e.check(Ws(i,a)),e.unwrap=()=>e.element});function Hh(e,t){return oh(Yh,e,t)}const Wh=b("ZodUnion",(e,t)=>{$p.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>gh(e,i,a,r),e.options=t.options});function Kh(e,t){return new Wh({type:"union",options:e,...z(t)})}const Jh=b("ZodIntersection",(e,t)=>{kp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>bh(e,i,a,r)});function Xh(e,t){return new Jh({type:"intersection",left:e,right:t})}const Qh=b("ZodTransform",(e,t)=>{Tp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>mh(e,i),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new $s(e.constructor.name);i.addIssue=s=>{if(typeof s=="string")i.issues.push(qt(s,i.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=e),i.issues.push(qt(o))}};const r=t.transform(i.value,i);return r instanceof Promise?r.then(s=>(i.value=s,i)):(i.value=r,i)}});function jh(e){return new Qh({type:"transform",transform:e})}const ec=b("ZodOptional",(e,t)=>{cr.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>tn(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function an(e){return new ec({type:"optional",innerType:e})}const tc=b("ZodExactOptional",(e,t)=>{Sp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>tn(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function ic(e){return new tc({type:"optional",innerType:e})}const ac=b("ZodNullable",(e,t)=>{_p.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>fh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function rn(e){return new ac({type:"nullable",innerType:e})}const rc=b("ZodDefault",(e,t)=>{Ap.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Dh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sc(e,t){return new rc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_s(t)}})}const nc=b("ZodPrefault",(e,t)=>{Ep.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>wh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function oc(e,t){return new nc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_s(t)}})}const lc=b("ZodNonOptional",(e,t)=>{Cp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>vh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function dc(e,t){return new lc({type:"nonoptional",innerType:e,...z(t)})}const uc=b("ZodCatch",(e,t)=>{Lp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>$h(e,i,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function pc(e,t){return new uc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const hc=b("ZodPipe",(e,t)=>{Ip.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>kh(e,i,a,r),e.in=t.in,e.out=t.out});function sn(e,t){return new hc({type:"pipe",in:e,out:t})}const cc=b("ZodReadonly",(e,t)=>{xp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Th(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new cc({type:"readonly",innerType:e})}const yc=b("ZodCustom",(e,t)=>{Zs.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>ch(e,i)});function gc(e,t={}){return Js(yc,e,t)}function bc(e){return Xs(e)}const Tt=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");$e.init(e,t),e.def=t,e.type=t.type,e.parse=(i,a)=>Su(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>Ls(e,i,a),e.parseAsync=async(i,a)=>_u(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>Is(e,i,a),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]},{parent:!0}),e.with=e.check,e.clone=(i,a)=>As(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.apply=i=>i(e)}),nn=b("ZodMiniString",(e,t)=>{pr.init(e,t),Tt.init(e,t)});function on(e){return Op(nn,e)}const Mt=b("ZodMiniStringFormat",(e,t)=>{tt.init(e,t),nn.init(e,t)}),fc=b("ZodMiniEmail",(e,t)=>{up.init(e,t),Mt.init(e,t)});function vc(e){return Rp(fc,e)}const Dc=b("ZodMiniUUID",(e,t)=>{dp.init(e,t),Mt.init(e,t)});function wc(e){return Fp(Dc,e)}const $c=b("ZodMiniURL",(e,t)=>{pp.init(e,t),Mt.init(e,t)});function kc(e){return Bp($c,e)}const Tc=b("ZodMiniIPv4",(e,t)=>{gp.init(e,t),Mt.init(e,t)});function Sc(e){return Np(Tc,e)}const _c=b("ZodMiniIPv6",(e,t)=>{bp.init(e,t),Mt.init(e,t)});function Ac(e){return qp(_c,e)}const Ec=b("ZodMiniCustomStringFormat",(e,t)=>{fp.init(e,t),Mt.init(e,t)});function Cc(e){return dh(Ec,"hostname",Nu,e)}const ln=b("ZodMiniNumber",(e,t)=>{Rs.init(e,t),Tt.init(e,t)});function dn(e){return Zp(ln,e)}const Lc=b("ZodMiniNumberFormat",(e,t)=>{vp.init(e,t),ln.init(e,t)});function Ic(e){return Yp(Lc,e)}const xc=b("ZodMiniBoolean",(e,t)=>{Dp.init(e,t),Tt.init(e,t)});function un(e){return Hp(xc,e)}const Pc=b("ZodMiniAny",(e,t)=>{wp.init(e,t),Tt.init(e,t)});function mr(){return Wp(Pc)}const Mc=b("ZodMiniArray",(e,t)=>{Bs.init(e,t),Tt.init(e,t)});function pn(e,t){return new Mc({type:"array",element:e,...z(t)})}const Oc=b("ZodMiniOptional",(e,t)=>{cr.init(e,t),Tt.init(e,t)});function Rc(e){return new Oc({type:"optional",innerType:e})}const Fc=b("ZodMiniCustom",(e,t)=>{Zs.init(e,t),Tt.init(e,t)});function xe(e,t={}){return Js(Fc,e,t)}function hn(e){return Xs(e)}const yr={email:{schema:vc()},hostname:{schema:Cc()},ipv4:{schema:Sc()},ipv6:{schema:Ac()},url:{schema:kc()},uuid:{schema:wc()},date:{schema:Eh()},time:{schema:Lh()},"date-time":{schema:_h({local:!0,offset:!0})},duration:{schema:xh()}},cn=Object.keys(yr),Bc=e=>(t,i)=>{switch(t.type){case"string":return Nc(t,i);case"integer":case"number":return zc(t,i);case"boolean":return Uc(t,i);case"array":return Gc(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return Vc(t,e)}default:{const a=t;throw new Error(`Unknown validator config: ${JSON.stringify(a)}. The "type" property must be one of: "string", "number", "integer", "boolean", "array", "custom".`)}}};function pe(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function Nc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?on(a):on();if(i.required===!0){const s=pe(i.messages?.required,t)??"This field is required";r=r.check(xe(o=>o.length>0,{error:s}))}if(typeof i.minLength=="number"){const s=pe(i.messages?.minLength,t),o=i.minLength;r=r.check(s?xe(l=>l.length>=o,{error:s}):xt(o))}if(typeof i.maxLength=="number"){const s=pe(i.messages?.maxLength,t),o=i.maxLength;r=r.check(s?xe(l=>l.length<=o,{error:s}):zi(o))}if(typeof i.pattern=="string"){const s=pe(i.messages?.pattern,t),o=new RegExp(i.pattern);r=r.check(s?xe(l=>o.test(l),{error:s}):Ks(o))}if(i.enum){const s=i.enum,o=pe(i.messages?.enum,t);r=r.check(xe(l=>s.includes(l),o?{error:o}:void 0))}if(i.const!==void 0){const s=pe(i.messages?.const,t);r=r.check(xe(o=>o===i.const,s?{error:s}:void 0))}if(i.format!==void 0)if(cn.includes(i.format)){const s=pe(i.messages?.format,t);r=r.check(s?hn((o,l)=>{const u=ut.standardValidate(yr[i.format].schema,o);ut.isStandardValidateSuccess(u)||l.addIssue({code:"custom",path:[],message:s})}):yr[i.format].schema)}else throw new Error(`Unknown string validation format: ${JSON.stringify(i.format)}. The "format" property must be one of: ${cn.map(s=>`"${s}"`).join(", ")}.`);return r})}const qc=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function zc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?dn(a):dn();if(i.type==="integer"&&(r=r.check(Ic())),i.minimum!==void 0){const s=pe(i.messages?.minimum,t),o=i.minimum;r=r.check(s?xe(l=>l>=o,{error:s}):Jp(o))}if(i.maximum!==void 0){const s=pe(i.messages?.maximum,t),o=i.maximum;r=r.check(s?xe(l=>l<=o,{error:s}):Kp(o))}if(i.exclusiveMinimum!==void 0){const s=pe(i.messages?.exclusiveMinimum,t),o=i.exclusiveMinimum;r=r.check(xe(l=>l>o,s?{error:s}:void 0))}if(i.exclusiveMaximum!==void 0){const s=pe(i.messages?.exclusiveMaximum,t),o=i.exclusiveMaximum;r=r.check(xe(l=>l<o,s?{error:s}:void 0))}if(i.multipleOf!==void 0){const s=pe(i.messages?.multipleOf,t),o=i.multipleOf;r=r.check(xe(l=>qc(l,o),s?{error:s}:void 0))}if(i.enum){const s=i.enum,o=pe(i.messages?.enum,t);r=r.check(xe(l=>s.includes(l),o?{error:o}:void 0))}if(i.const!==void 0){const s=pe(i.messages?.const,t);r=r.check(xe(o=>o===i.const,s?{error:s}:void 0))}return r})}function Uc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?un(a):un();if(i.const!==void 0){const s=pe(i.messages?.const,t);r=r.check(xe(o=>o===i.const,s?{error:s}:void 0))}return r})}function Gc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?pn(mr(),a):pn(mr());if(i.required===!0){const s=pe(i.messages?.required,t)??"This field is required";r=r.check(xe(o=>o.length>0,{error:s}))}if(typeof i.minItems=="number"){const s=pe(i.messages?.minItems,t),o=i.minItems;r=r.check(s?xe(l=>l.length>=o,{error:s}):xt(o))}if(typeof i.maxItems=="number"){const s=pe(i.messages?.maxItems,t),o=i.maxItems;r=r.check(s?xe(l=>l.length<=o,{error:s}):zi(o))}return r})}function Vc(e,t){return Ut(e,i=>{let a=mr();return ut.filterTap(Object.keys(i),r=>r!=="type"&&r!=="required",r=>{const s=i[r],o=t[r];if(!o){const u=Object.keys(t).map(p=>`"${p}"`).join(", ");throw new Error(`Unknown custom validator rule "${r}". Registered rules: ${u||"(none)"}.`)}const l=o(s);a=a.check(hn((u,p)=>{const h=ut.standardValidate(l,u);if(!ut.isStandardValidateSuccess(h)){const c=h.issues[0];p.addIssue({code:"custom",path:[],message:c?.message||`Validation failed for ${r}`})}}))}),a})}function Ut(e,t){const i=t(e);return e.required?i:Rc(i)}const Zc=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"label")&&Object.prototype.hasOwnProperty.call(e,"value");function Yc(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 mn={button:async()=>(await Promise.resolve().then(()=>jc)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>$m)).CalendarElement,dateTimeCalendar:async()=>(await Promise.resolve().then(()=>Wm)).DateTimeCalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>ty)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>oy)).RangeDateInputElement,rangeTimeInput:async()=>(await Promise.resolve().then(()=>hy)).RangeTimeInputElement,rangeDateTimeInput:async()=>(await Promise.resolve().then(()=>by)).RangeDateTimeInputElement,rangeDateTimeCalendar:async()=>(await Promise.resolve().then(()=>$y)).RangeDateTimeCalendarElement,rangeDateTimePicker:async()=>(await Promise.resolve().then(()=>Ay)).RangeDateTimePickerElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>xy)).RangeDatePickerElement,rangeTimePicker:async()=>(await Promise.resolve().then(()=>Fy)).RangeTimePickerElement,currency:async()=>(await Promise.resolve().then(()=>Uy)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>Hy)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>Qy)).DatePickerElement,dateTimePicker:async()=>(await Promise.resolve().then(()=>sg)).DateTimePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>vg)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>$g)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>Cg)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>Mg)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Ng)).TextinputElement,timeInput:async()=>(await Promise.resolve().then(()=>Ug)).TimeElement,timePicker:async()=>(await Promise.resolve().then(()=>Zg)).TimePickerElement,dateTimeInput:async()=>(await Promise.resolve().then(()=>Wg)).DateTimeElement,textarea:async()=>(await Promise.resolve().then(()=>jg)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>rb)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>db)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>mb)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>$b)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>Ab)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>Pb)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>Bb)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>zb)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>Vb)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>Hb)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Jb)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>jb)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>af)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>nf)).RendererElement};var Hc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,Gt=(e,t,i,a)=>{for(var r=a>1?void 0:a?Wc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Hc(t,i,r),r};te.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=bu(t.formDef,t.formSelectors,t.formConfig),a={formDef:i.formDef,widgetLoaders:{...mn,...i.widgetLoaders,...t.customWidgetLoaders??{}},dependencies:{...i.dependencies??{},...t.dependencies??{}},functions:{...i.functions??{},...t.functions??{}},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},r=Bc({...t.customValidators??{}}),s=i.formEvent,o=s?l=>s(l.detail):void 0;return d.html`
|
|
4
|
-
<gui-core-form
|
|
5
|
-
.config=${a}
|
|
6
|
-
.validators=${r}
|
|
7
|
-
.autocomplete=${this.autocomplete}
|
|
8
|
-
.formHealthBoundary=${this.formHealthBoundary}
|
|
9
|
-
@formEvent=${o}
|
|
10
|
-
></gui-core-form>
|
|
11
|
-
`}},Gt([n.property({attribute:!1})],te.FormElement.prototype,"config",2),Gt([n.property({type:String})],te.FormElement.prototype,"autocomplete",2),Gt([n.property({attribute:!1})],te.FormElement.prototype,"formHealthBoundary",2),Gt([n.query("gui-core-form")],te.FormElement.prototype,"coreForm",2),te.FormElement=Gt([n.customElement("gui-form")],te.FormElement);var Kc=Object.defineProperty,Jc=Object.getOwnPropertyDescriptor,mt=(e,t,i,a)=>{for(var r=a>1?void 0:a?Jc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Kc(t,i,r),r};let ot=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"},a=e?d.html`<span
|
|
1
|
+
(function(ue,Li){typeof exports=="object"&&typeof module<"u"?Li(exports,require("@golemui/gui-shared"),require("@golemui/core"),require("@golemui/lit"),require("lit/decorators.js"),require("@lit/context"),require("lit"),require("rxjs"),require("lit/directives/class-map.js"),require("lit-html/directives/style-map.js"),require("lit-html/directives/repeat.js"),require("lit/directives/if-defined.js"),require("lit/directives/live.js"),require("lit/directives/repeat.js"),require("lit/directives/unsafe-html.js")):typeof define=="function"&&define.amd?define(["exports","@golemui/gui-shared","@golemui/core","@golemui/lit","lit/decorators.js","@lit/context","lit","rxjs","lit/directives/class-map.js","lit-html/directives/style-map.js","lit-html/directives/repeat.js","lit/directives/if-defined.js","lit/directives/live.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],Li):(ue=typeof globalThis<"u"?globalThis:ue||self,Li(ue["gui-lit"]={},null,ue.core,ue.lit,ue.decorators_js,ue.context,ue.lit$1,ue.rxjs,ue.classMap_js,ue.styleMap_js,ue.repeat_js,ue.ifDefined_js,ue.live_js,ue.repeat_js$1,ue.unsafeHtml_js))})(this,(function(ue,Li,Et,m,n,f,d,ds,S,Dt,qe,ma,no,us,oo){"use strict";function Ct(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}const ht={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"},Je={...ht};class lo{constructor(){this.handlerByItemType=new Map,this.kindByItemType=new Map}registerItemType(t,i,a){if(this.handlerByItemType.has(t))throw new Error(`Item type "${t}" is already registered.`);this.handlerByItemType.set(t,i),a&&this.kindByItemType.set(t,a)}getItemTypeKind(t){return this.kindByItemType.get(t)}getRegisteredItemTypes(){return[...this.handlerByItemType.keys()]}getItemTypesOfKind(t){const i=[];for(const[a,r]of this.kindByItemType)r===t&&i.push(a);return i}getItemTypeHandler(t){const i=this.handlerByItemType.get(t);if(!i)throw new Error(`No handler registered for item type "${t}". Register its definition in the widget set's registry with registerShortcutType (for the gui widget set: add it to guiShortcutTypes in registry.ts).`);return i}hasItemTypeHandler(t){return this.handlerByItemType.has(t)}}function uo(){return new lo}function P(e){const t=l=>{if(!e.sensibleDefaults)return{};let u={...e.sensibleDefaults.base};for(const p of l){const h=p.config;for(const c of e.sensibleDefaults.fields){const y=c;h[y]!=null&&(u={...u,[y]:h[y]})}}return u},i=(l,u)=>e.sensibleDefaults?e.sensibleDefaults.apply(l,u):l,a=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}}}},r={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:a,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}},s=Ct(e.itemType),o=(l,u)=>s(u,(p=>p.uid===l));return{itemType:e.itemType,kind:e.kind,handler:r,gsl:s,gslByUid:o}}function po(e,t){e.registerItemType(t.itemType,t.handler,t.kind)}const ho=["tag","state","tagsAnd","tagsOr"];function co(e,t){if(t.length===0)return e;const i=t.find(s=>s.kind==="state"),a=t.filter(s=>s.kind!=="state"),r=e.matcher;return{...e,matcher:s=>{if(!r(s))return!1;for(const o of a){const l=s.tags??[];if(o.kind==="tagsAnd"){for(const u of o.tags)if(!l.includes(u))return!1}else{if(o.tags.length===0)continue;if(!o.tags.some(u=>l.includes(u)))return!1}}return!0},...i?{targetState:i.name}:{}}}function Ii(e){return(t,i)=>e(i,a=>a.uid===t)}function mo(){const e=Ct(ht.INPUTS),t=Ct(ht.ACTIONS),i=Ct(ht.DISPLAYS),a=Ct(ht.LAYOUTS);return{inputs:e,inputByUid:Ii(e),actions:t,actionByUid:Ii(t),displays:i,displayByUid:Ii(i),layouts:a,layoutByUid:Ii(a)}}function Nt(e,t){const i={tag:a=>Nt(e,[...t,{kind:"tagsAnd",tags:[a]}]),state:a=>Nt(e,[...t,{kind:"state",name:a}]),tagsAnd:a=>Nt(e,[...t,{kind:"tagsAnd",tags:a}]),tagsOr:a=>Nt(e,[...t,{kind:"tagsOr",tags:a}])};for(const[a,r]of Object.entries(e))i[a]=(...s)=>co(r(...s),t);return i}function yo(e){const t=ho.filter(a=>a in e);if(t.length>0)throw new Error(`Selector factory map must not use the reserved scope method name(s): ${t.join(", ")}.`);const i={...mo(),...e};return Nt(i,[])}const ps={[ht.INPUTS]:"input",[ht.ACTIONS]:"action",[ht.DISPLAYS]:"display",[ht.LAYOUTS]:"layout"};class go{constructor(t){this.registry=t}resolve(t,i){const a=[];for(const s of i)s.kind==="aggregated"?this.collectFromAggregated(s,t,a):this.collectFromLeaf(s,t,a);const r=this.rollUpSensibleDefaults(a);return{leafSelectors:a,sensibleDefaults:r}}selectorMatchesItemType(t,i){const a=ps[t];return a?this.registry.getItemTypeKind(i)===a:t===i}collectFromAggregated(t,i,a){if(t.matcher(i))for(const r of t.children)this.collectFromLeaf(r,i,a)}collectFromLeaf(t,i,a){this.selectorMatchesItemType(t.selectorType,i.itemType??"")&&t.matcher(i)&&a.push(t)}rollUpSensibleDefaults(t){const i=new Map,a=(s,o)=>{const l=i.get(s)??[];l.push(o),i.set(s,l)};for(const s of t){const o=ps[s.selectorType];if(o)for(const l of this.registry.getItemTypesOfKind(o))a(l,s);else a(s.selectorType,s)}const r={};for(const[s,o]of i)this.registry.hasItemTypeHandler(s)&&(r[s]=this.registry.getItemTypeHandler(s).rollUpSensibleDefaults(o));return r}}class bo{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 a={...t};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(typeof i[r]=="object"&&!Array.isArray(i[r])&&i[r]!==null&&typeof t[r]=="object"&&!Array.isArray(t[r])&&t[r]!==null?a[r]=this.deepMerge(t[r],i[r]):a[r]=i[r]);return a}}const fo=new bo;class vo{constructor(t,i){this.objectUtils=t,this.registry=i}merge(t,i,a){let r={},s=null;typeof t=="function"&&(s=t);const o=this.collectDecorators(a);for(const p of o){if(s!=null){s=this.composeRuntimeFunctions(s,p);continue}if(typeof p=="function"){const h=p({...r,...typeof t=="function"?{}:t});if(typeof h=="function"){s=this.createPromotedFunction(r,t,h,i,a);continue}r=this.objectUtils.deepMerge(r,h)}else r=this.objectUtils.deepMerge(r,p)}if(s!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(s,r,i,a)};const l=this.objectUtils.deepMerge(t,r);return{kind:"static",def:this.applySensibleDefaults({...l},i,a)}}collectDecorators(t){const i=[];for(const a of t.leafSelectors){const r=a.config;r.override!=null&&i.push(r.override)}return i}applySensibleDefaults(t,i,a){if(!this.registry.hasItemTypeHandler(i))return t;const r=a.sensibleDefaults[i]??{};return this.registry.getItemTypeHandler(i).applySensibleDefaults(t,r)}createPromotedFunction(t,i,a,r,s){return o=>{const l=a(o);let u=this.objectUtils.deepMerge(t,l);return u=this.objectUtils.deepMerge(u,i),this.applySensibleDefaults(u,r,s)}}wrapWithSensibleDefaults(t,i,a,r){return s=>{let o=t(s);return Object.keys(i).length>0&&(o=this.objectUtils.deepMerge(i,o)),this.applySensibleDefaults(o,a,r)}}composeRuntimeFunctions(t,i){return typeof i=="function"?a=>{const r=t(a),s=i(r);return typeof s=="function"?s(a):this.objectUtils.deepMerge(s,r)}:a=>{const r=t(a);return this.objectUtils.deepMerge(r,i)}}}class Do{constructor(t){this.registry=t}mapToWidget(t,i){if(t.kind==="dynamic"){const a=t.fn;return(r=>{const s=a(r);return this.mapStaticDef(s,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const a=this.registry.getItemTypeHandler(i).mapToWidget(t);return this.applyBaseWidgetFields(a,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}}class wo{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],a=[],r=[];for(const s of i)s.kind==="leaf"?r.push(s):a.push(s);return r.length>0&&a.unshift({kind:"aggregated",matcher:()=>!0,children:r}),a}extractFormConfig(){return{suppressAutomaticStack:!1}}}const hs={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},$o=Object.keys(hs);function cs(e){if(e.length>0)return null;try{const t=e();return typeof t=="string"?t:null}catch{return null}}class ko{extractOnClickFromMergeResult(t,i,a){if(t.kind==="dynamic"){const o=t.fn;return{kind:"dynamic",fn:u=>{const p=o(u);return this.wireOnClick(p,i,a)}}}const r=t.def;return{kind:"static",def:this.wireOnClick(r,i,a)}}wireOnClick(t,i,a){const r=a.next(),s=t.onClick;if(typeof s=="function"){const{onClick:o,...l}=t,u=s(void 0);return typeof u=="string"?{...l,uid:r,on:{click:u}}:(i.set(r,p=>s(p.data)),{...l,uid:r,on:{click:r}})}return{...t,uid:r}}wireInputLayoutEvents(t,i,a){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:l=>{const u=s(l);return this.wireEventProperties(u,i,a)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,a)}}wireEventProperties(t,i,a){const r={...t.on||{}};let s=!1;const o={...t};for(const l of $o){const u=t[l];if(u==null)continue;const p=hs[l];if(typeof u=="function"){const h=cs(u);if(h!=null)r[p]=h;else{const c=a.next();i.set(c,u),r[p]=c}s=!0}else typeof u=="string"&&(r[p]=u,s=!0);delete o[l]}return s&&(o.on=r),o}}const ya=new ko,To={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},ms={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class So{extractFromMergeResult(t,i){const a={};for(const l of i){const u=l.targetState,p=l.config,h=p.override&&typeof p.override!="function"?p.override:p;a[u]={...a[u]||{},...h}}if(t.kind==="dynamic"){const l=t.fn;return{cleanedResult:{kind:"dynamic",fn:p=>{const h=l(p),{states:c,...y}=h;return y}},stateData:{stateOverrides:a}}}const{states:r,...s}=t.def,o={};for(const[l,u]of Object.entries(a))o[l]={...u};if(r)for(const[l,u]of Object.entries(r))o[l]={...o[l]||{},...u};return{cleanedResult:{kind:"static",def:s},stateData:{stateOverrides:o}}}applyToWidget(t,i,a,r){const{stateOverrides:s}=i;if(Object.keys(s).length===0)return t;const o={...t},l=t.kind,u=To[l]||new Set;t.props&&(o.props={...t.props}),t.on&&(o.on={...t.on});for(const[p,h]of Object.entries(s))for(const[c,y]of Object.entries(h))c==="visible"?this.applyVisibility(o,p,y):ms[c]?this.applyStateEvent(o,p,c,y,a,r):u.has(c)?o[`${c}.${p}`]=y:(o.props||(o.props={}),o.props[`${c}.${p}`]=y);return o}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,a){if(a){const r=t.include?.in||[];t.include={...t.include||{},in:[...r,i]}}else{const r=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...r,i]}}}applyStateEvent(t,i,a,r,s,o){const l=ms[a];if(t.on||(t.on={}),typeof r=="function"){const u=cs(r);if(u!=null)t.on[`${l}.${i}`]=u;else{const p=o.next();s.set(p,r),t.on[`${l}.${i}`]=p}}else typeof r=="string"&&(t.on[`${l}.${i}`]=r)}}const _o=new So;function ga(e){return{errors:void 0,touched:void 0,translate:void 0,...e??{},$form:e?.$form??{}}}function Ao(){let e=0;return{next:()=>`event_${e++}`}}class Eo{constructor(t,i,a,r,s,o){this.registry=t,this.resolver=i,this.merger=a,this.mapper=r,this.eventWiring=s,this.stateExpansion=o}walkAndMap(t,i,a){const r=new Map,s=Ao(),o={value:0},l=new Set;return{widgets:this.walkItems(t,i,r,a,s,o,l),eventRegistry:r}}walkItems(t,i,a,r,s,o,l){return t.flatMap(u=>{if(u.type!=="ITEMS")throw new Error(`Unexpected shortcut type "${u.type}"`);return u.items.map(p=>this.processItem(p,u.itemType,u.tags,i,a,r,s,o,l))})}processItem(t,i,a,r,s,o,l,u,p){const h=i,c=this.registry.getItemTypeHandler(i),y=c.parseEntry(t),g=this.buildBaseDef(y),_=this.buildDecoratorForMatching(g,h,a),L=this.resolver.resolve(_,r),Ae=L.leafSelectors.filter(Ze=>Ze.targetState!=null),nt={leafSelectors:L.leafSelectors.filter(Ze=>Ze.targetState==null),sensibleDefaults:L.sensibleDefaults};let vt=this.merger.merge(g,h,nt);c.afterMerge&&(vt=c.afterMerge(vt,{eventRegistry:s,formConfig:o,eventIdGenerator:l})),vt=this.eventWiring.wireInputLayoutEvents(vt,s,l);const{cleanedResult:so,stateData:ls}=this.stateExpansion.extractFromMergeResult(vt,Ae);let pt;if(c.buildCustomWidget){const Ze=this.buildCustomWidgetContext(y.children,r,s,o,l,u,p);pt=this.buildCustomWidget(c,so,Ze)}else pt=this.mapper.mapToWidget(so,h);if(typeof pt!="function"){const Ze=pt;Ze.uid||(Ze.path&&!p.has(Ze.path)?(Ze.uid=Ze.path,p.add(Ze.path)):Ze.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(ls))if(typeof pt=="function"){const Ze=pt;pt=(of=>{const lf=Ze(of);return this.stateExpansion.applyToWidget(lf,ls,s,l)})}else pt=this.stateExpansion.applyToWidget(pt,ls,s,l);return pt}buildCustomWidgetContext(t,i,a,r,s,o,l){return{children:t,mapStaticDef:(u,p)=>this.mapper.mapStaticDef(u,p),walkChildren:u=>this.walkItems(u,i,a,r,s,o,l)}}buildCustomWidget(t,i,a){return t.buildCustomWidget(i,a)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?a=>{const r=ga(a),s=i(r);return t.path!=null?{...s,path:t.path}:s}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,a){if(typeof t=="function")return{itemType:i,tags:[...a]};const r=[...a,..."tags"in t&&t.tags?t.tags:[]],s="uid"in t?t.uid:void 0,o="type"in t?t.type:void 0;return{itemType:i,tags:r,uid:s,type:o}}}class Co{constructor(t,i,a){this.selectorNormalizer=t,this.walker=i,this.adapter=a}processDxFacade(t,i=[],a){const{defs:r,gslSelectors:s,formConfig:o}=this.prepareForm(t,i,a),{widgets:l,eventRegistry:u}=this.walker.walkAndMap(r,s,o),p=l[0];return this.buildResult({form:p},u,o)}prepareForm(t,i,a){const s=(Array.isArray(t)?[...t]:[t]).map(u=>typeof u=="function"?this.adapter.bareItemToWidget(u):u),o=this.selectorNormalizer.normalizeSelectors(i),l={...this.selectorNormalizer.extractFormConfig(),...a};return l.suppressAutomaticStack?{defs:s,gslSelectors:o,formConfig:l}:{defs:[this.adapter.rootEntry(s)],gslSelectors:o,formConfig:l}}convertStateNames(t){const i={};for(const[a,r]of Object.entries(t))i[a.replace(/\$/g,":")]=r;return i}buildResult(t,i,a){a.states&&Object.keys(a.states).length>0&&(t={...t,states:this.convertStateNames(a.states)});const r={form:t};return i.size>0&&(r.events=s=>{const o=i.get(s.name);if(o){const l=p=>{if(p&&typeof p=="object"&&"path"in p&&!("type"in p)){const{path:h,...c}=p;for(const[y,g]of Object.entries(c))s.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:h,prop:y,value:g}})}else s.callback(p)},u={...s,callback:l,update:l};o(u)}}),a.dependencies&&(r.dependencies=a.dependencies),a.functions&&(r.functions=a.functions),a.widgetLoaders&&(r.widgetLoaders=a.widgetLoaders),a.validateOn&&(r.validateOn=a.validateOn),a.itemRenderers&&(r.itemRenderers=a.itemRenderers),r}}function Lo(e){const{registry:t,adapter:i}=e,a=new Eo(t,new go(t),new vo(fo,t),new Do(t),ya,_o);return new Co(new wo,a,i)}function ys(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(gs):gs(e)}function gs(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"}function Io(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.form;if(ys(t))throw new Error("[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object.")}function xo(e){const t=Object.freeze({}),i=Object.freeze({}),a=new WeakMap;function r(s,o){return s==null?o:typeof s=="object"?s:{}}return function(o,l,u){if(!ys(o))return Io(o),{formDef:o};const p=r(o,t),h=r(l,t),c=r(u,i);let y=a.get(p);y||(y=new WeakMap,a.set(p,y));let g=y.get(h);g||(g=new WeakMap,y.set(h,g));const _=g.get(c);if(_)return _;const L=e.processDxFacade(o,l,u),Ae={formDef:L.form,formEvent:L.events,dependencies:L.dependencies,functions:L.functions,widgetLoaders:L.widgetLoaders,validateOn:L.validateOn,itemRenderers:L.itemRenderers};return g.set(c,Ae),Ae}}function Po(e){if("selectors"in e.facade)throw new Error(`The "${e.name}" implementation facade must not contain a "selectors" key: that slot of the namespace is filled by the selector chain.`);const t=Lo({registry:e.registry,adapter:e.adapter});return{name:e.name,registry:e.registry,namespace:{...e.facade,selectors:e.selectors},formDefs:t,resolveFormInput:xo(t)}}function J(e){const{uid:t,path:i,label:a,disabled:r,readonly:s,defaultValue:o,tags:l,type:u,size:p,onLoad:h,onChange:c,onFilter:y,on:g,states:_,include:L,exclude:Ae,validator:nt,...vt}=e;return vt}function te(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function Mo(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 X(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Mo(e.path)}}function et(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function Oo(e){switch(e.type){case"text":return Fo(e);case"number":return Bo(e);case"boolean":return Ro(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Ro(e){const t=J(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:te(e.validator,"boolean")}:{},props:t}}function Fo(e){const t=J(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:te(e.validator,"string")}}function Bo(e){const t=J(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:te(e.validator,"number")}}const ba=P({itemType:"INPUTS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=X(e,t);return i=et(i,t),i}},mapToWidget:Oo}),xi=ba.gsl,No=ba.gslByUid;function qo(e){const{uid:t,label:i,actionType:a,disabled:r,on:s,onClick:o,data:l,type:u,tags:p,size:h,include:c,exclude:y,states:g,..._}=e;return{uid:t??"",kind:"action",type:"button",disabled:r,actionType:a,label:i,...s!=null?{on:s}:{},props:_}}const fa=P({itemType:"ACTIONS",kind:"action",entryShape:"bare",mapToWidget:qo,afterMerge:(e,t)=>ya.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),zo=fa.gsl,Uo=fa.gslByUid;function Go(e){const{uid:t,widgetName:i,tags:a,size:r,onChange:s,include:o,exclude:l,...u}=e,{on:p,...h}=u;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:h.direction??"column",...h},children:[]}}function Vo(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"LAYOUTS"),children:i}})}function Zo(e){return e.children}const va=P({itemType:"LAYOUTS",kind:"layout",entryShape:"compound",mapToWidget:Go,buildCustomWidget:Vo,getChildren:Zo}),Yo=va.gsl,Ho=va.gslByUid;function Wo(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function Ko(e,t){if(e.kind==="static"){const a=e.def;return(r=>({uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(ga(r))}}))}const i=e.fn;return(a=>{const r=i(a);return{uid:"",kind:"display",type:"renderer",...r.include!=null?{include:r.include}:{},...r.exclude!=null?{exclude:r.exclude}:{},props:{render:r.render(ga(a))}}})}const Da=P({itemType:"DISPLAYS",kind:"display",entryShape:"bare",mapToWidget:Wo,buildCustomWidget:Ko}),Jo=Da.gsl,Xo=Da.gslByUid,wa=P({itemType:"CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:te(e.validator,"string")}:{},props:J(e)})}),Qo=wa.gsl,jo=wa.gslByUid,$a=P({itemType:"DATE_TIME_CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeCalendar",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:te(e.validator,"string")}:{},props:J(e)})}),el=$a.gsl,tl=$a.gslByUid,ka=P({itemType:"DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimePicker",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:te(e.validator,"string")}:{},props:J(e)})}),il=ka.gsl,al=ka.gslByUid,Ta=P({itemType:"TEXTAREA",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:te(e.validator,"string")}:{},props:J(e)})}),rl=Ta.gsl,sl=Ta.gslByUid,Sa=P({itemType:"PASSWORD",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:te(e.validator,"string")}:{},props:J(e)})}),nl=Sa.gsl,ol=Sa.gslByUid,_a=P({itemType:"CHECKBOX",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:te(e.validator,"boolean")}:{},props:J(e)})}),ll=_a.gsl,dl=_a.gslByUid,Aa=P({itemType:"DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:te(e.validator,"string")}:{},props:J(e)})}),ul=Aa.gsl,pl=Aa.gslByUid,Ea=P({itemType:"TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timeInput",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:te(e.validator,"string")}:{},props:J(e)})}),hl=Ea.gsl,cl=Ea.gslByUid,Ca=P({itemType:"TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timePicker",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:te(e.validator,"string")}:{},props:J(e)})}),ml=Ca.gsl,yl=Ca.gslByUid,La=P({itemType:"DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeInput",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:te(e.validator,"string")}:{},props:J(e)})}),gl=La.gsl,bl=La.gslByUid,Ia=P({itemType:"CURRENCY",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:te(e.validator,"number")}:{},props:J(e)})}),fl=Ia.gsl,vl=Ia.gslByUid,xa=P({itemType:"RANGE_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:te(e.validator,"array")}:{},props:J(e)})}),Dl=xa.gsl,wl=xa.gslByUid,Pa=P({itemType:"SELECT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:J(e)})}),$l=Pa.gsl,kl=Pa.gslByUid,Ma=P({itemType:"RADIOGROUP",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:J(e)})}),Tl=Ma.gsl,Sl=Ma.gslByUid;function _l(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 Al(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"TABS"),children:i}})}function El(e){return e.children}const Oa=P({itemType:"TABS",kind:"layout",entryShape:"compound",mapToWidget:_l,buildCustomWidget:Al,getChildren:El}),Cl=Oa.gsl,Ll=Oa.gslByUid,Ra=P({itemType:"LIST",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:J(e)})}),Il=Ra.gsl,xl=Ra.gslByUid,Fa=P({itemType:"TAGS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:te(e.validator,"array")}:{},props:J(e)})});Fa.gsl,Fa.gslByUid;const Ba=P({itemType:"ALERTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),Pl=Ba.gsl,Ml=Ba.gslByUid,Na=P({itemType:"MARKDOWN_TEXTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})}),Ol=Na.gsl,Rl=Na.gslByUid,qa=P({itemType:"DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:te(e.validator,"string")}:{},props:J(e)})}),Fl=qa.gsl,Bl=qa.gslByUid,za=P({itemType:"DROPDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:J(e)})}),Nl=za.gsl,ql=za.gslByUid;function zl(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 Ul(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"ACCORDION"),children:i}})}function Gl(e){return e.children}const Ua=P({itemType:"ACCORDION",kind:"layout",entryShape:"compound",mapToWidget:zl,buildCustomWidget:Ul,getChildren:Gl}),Vl=Ua.gsl,Zl=Ua.gslByUid;function Yl(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 Hl(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:te(e.validator,"array")}:{},props:{...Yl(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Ga(e,t){for(const i of e){if(typeof i=="function")continue;const a=i;typeof a.path=="string"&&a.path&&!a.path.startsWith(t)&&(a.path=t+a.path),"children"in a&&Array.isArray(a.children)&&Ga(a.children,t);const r=a.props;r?.template?.children&&Array.isArray(r.template.children)&&Ga(r.template.children,t)}}function Wl(e,t){const i=t.walkChildren(t.children??[]),a=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";a&&Ga(i,a+".items.");const r={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const o=t.mapStaticDef(e.def,"REPEATER");return{...o,props:{...o.props,template:r}}}const s=e.fn;return(o=>{const l=s(o),u=t.mapStaticDef(l,"REPEATER");return{...u,props:{...u.props,template:r}}})}function Kl(e){return{baseDef:e.def,path:e.key,children:e.children}}function Jl(e){return e.children}const Xl={parseEntry:Kl,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Hl,buildCustomWidget:Wl,getChildren:Jl},Va=Ct("REPEATER"),bs=(e,t)=>Va(t,(i=>i.uid===e)),Ql={itemType:"REPEATER",kind:"input",handler:Xl,gsl:Va,gslByUid:bs},Za=P({itemType:"MARKDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:te(e.validator,"string")}:{},props:J(e)})}),jl=Za.gsl,ed=Za.gslByUid,Ya=P({itemType:"RANGE_DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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:te(e.validator,"array")}:{},props:J(e)})}),td=Ya.gsl,id=Ya.gslByUid,Ha=P({itemType:"RANGE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimeInput",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:te(e.validator,"array")}:{},props:J(e)})}),ad=Ha.gsl,rd=Ha.gslByUid,Wa=P({itemType:"RANGE_DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeInput",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:te(e.validator,"array")}:{},props:J(e)})}),sd=Wa.gsl,nd=Wa.gslByUid,Ka=P({itemType:"RANGE_DATE_TIME_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeCalendar",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:te(e.validator,"array")}:{},props:J(e)})}),od=Ka.gsl,ld=Ka.gslByUid,Ja=P({itemType:"RANGE_DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimePicker",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:te(e.validator,"array")}:{},props:J(e)})}),dd=Ja.gsl,ud=Ja.gslByUid,Xa=P({itemType:"RANGE_DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>et(X(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:te(e.validator,"array")}:{},props:J(e)})}),pd=Xa.gsl,hd=Xa.gslByUid,Qa=P({itemType:"RANGE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimePicker",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:te(e.validator,"array")}:{},props:J(e)})}),cd=Qa.gsl,md=Qa.gslByUid,ja=P({itemType:"CUSTOM_DISPLAY",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})}),yd=ja.gsl,gd=ja.gslByUid,er=P({itemType:"CUSTOM_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(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??{}})}),bd=er.gsl,fd=er.gslByUid,tr=P({itemType:"CUSTOM_ACTION",kind:"action",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:a,on:r,onClick:s,data:o,customType:l,tags:u,size:p,include:h,exclude:c,states:y,props:g,..._}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:a,...r!=null?{on:r}:{},props:{...g,..._}}},afterMerge:(e,t)=>ya.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),vd=tr.gsl,Dd=tr.gslByUid;function wd(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function $d(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"CUSTOM_LAYOUT"),children:i}})}function kd(e){return e.children}const ir=P({itemType:"CUSTOM_LAYOUT",kind:"layout",entryShape:"compound",mapToWidget:wd,buildCustomWidget:$d,getChildren:kd}),Td=ir.gsl,Sd=ir.gslByUid,_d=[ba,fa,va,Da,wa,$a,ka,Ta,Sa,_a,Aa,Ea,Ca,La,Ia,xa,Pa,Ma,Oa,Ra,Fa,Ba,Na,qa,za,Ua,Ql,Za,Ya,Ha,Wa,Ka,Ja,Xa,Qa,ja,er,tr,ir],fs=uo();for(const e of _d)po(fs,e);function Ad(e,t,i){if(typeof t=="function"){const r=t;return{items:[{key:e,def:o=>({type:"text",...r(o)})}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}const a={type:"text",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}function Ed(e,t,i){if(typeof t=="function"){const r=t;return{items:[{key:e,def:o=>({type:"number",...r(o)})}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}const a={type:"number",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}function Cd(e,t,i){if(typeof t=="function"){const r=t;return{items:[{key:e,def:o=>({type:"boolean",...r(o)})}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}const a={type:"boolean",...t};return{items:[{key:e,def:a}],type:"ITEMS",itemType:Je.INPUTS,tags:i??[]}}function Ld(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:u=>({type:"select",...s(u)})}],tags:i??[]}}const a={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:a}],tags:i??[]}}function Id(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:u=>({type:"dropdown",...s(u)})}],tags:i??[]}}const a={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:a}],tags:i??[]}}function xd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:u=>({type:"radiogroup",...s(u)})}],tags:i??[]}}const a={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:a}],tags:i??[]}}function Pd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:u=>({type:"checkbox",...s(u)})}],tags:i??[]}}const a={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:a}],tags:i??[]}}function Md(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:u=>({type:"textarea",...s(u)})}],tags:i??[]}}const a={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:a}],tags:i??[]}}function Od(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:u=>({type:"password",...s(u)})}],tags:i??[]}}const a={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:a}],tags:i??[]}}function Rd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:u=>({type:"currency",...s(u)})}],tags:i??[]}}const a={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:a}],tags:i??[]}}function Fd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:u=>({type:"markdown",...s(u)})}],tags:i??[]}}const a={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:a}],tags:i??[]}}function Bd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:u=>({type:"list",...s(u)})}],tags:i??[]}}const a={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:a}],tags:i??[]}}function Nd(e,t,i){if(typeof t=="function"){const r=t;return{items:[o=>({type:"calendar",path:e,...r(o)})],type:"ITEMS",itemType:"CALENDAR",tags:i??[]}}return{items:[{type:"calendar",path:e,...t}],type:"ITEMS",itemType:"CALENDAR",tags:i??[]}}function qd(e,t,i){if(typeof t=="function"){const r=t;return{items:[o=>({type:"dateTimeCalendar",path:e,...r(o)})],type:"ITEMS",itemType:"DATE_TIME_CALENDAR",tags:i??[]}}return{items:[{type:"dateTimeCalendar",path:e,...t}],type:"ITEMS",itemType:"DATE_TIME_CALENDAR",tags:i??[]}}function zd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:u=>({type:"dateInput",...s(u)})}],tags:i??[]}}const a={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Ud(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:u=>({type:"datePicker",...s(u)})}],tags:i??[]}}const a={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Gd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_TIME_PICKER",items:[{key:e,def:u=>({type:"dateTimePicker",...s(u)})}],tags:i??[]}}const a={type:"dateTimePicker",...t};return{type:"ITEMS",itemType:"DATE_TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Vd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:u=>({type:"rangeCalendar",...s(u)})}],tags:i??[]}}const a={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:a}],tags:i??[]}}function Zd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:u=>({type:"rangeDateInput",...s(u)})}],tags:i??[]}}const a={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Yd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_INPUT",items:[{key:e,def:u=>({type:"rangeDateTimeInput",...s(u)})}],tags:i??[]}}const a={type:"rangeDateTimeInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Hd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_CALENDAR",items:[{key:e,def:u=>({type:"rangeDateTimeCalendar",...s(u)})}],tags:i??[]}}const a={type:"rangeDateTimeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_CALENDAR",items:[{key:e,def:a}],tags:i??[]}}function Wd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_TIME_PICKER",items:[{key:e,def:u=>({type:"rangeDateTimePicker",...s(u)})}],tags:i??[]}}const a={type:"rangeDateTimePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Kd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_TIME_INPUT",items:[{key:e,def:u=>({type:"rangeTimeInput",...s(u)})}],tags:i??[]}}const a={type:"rangeTimeInput",...t};return{type:"ITEMS",itemType:"RANGE_TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function Jd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:u=>({type:"rangeDatePicker",...s(u)})}],tags:i??[]}}const a={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Xd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"RANGE_TIME_PICKER",items:[{key:e,def:u=>({type:"rangeTimePicker",...s(u)})}],tags:i??[]}}const a={type:"rangeTimePicker",...t};return{type:"ITEMS",itemType:"RANGE_TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function Qd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TIME_INPUT",items:[{key:e,def:u=>({type:"timeInput",...s(u)})}],tags:i??[]}}const a={type:"timeInput",...t};return{type:"ITEMS",itemType:"TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function jd(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TIME_PICKER",items:[{key:e,def:u=>({type:"timePicker",...s(u)})}],tags:i??[]}}const a={type:"timePicker",...t};return{type:"ITEMS",itemType:"TIME_PICKER",items:[{key:e,def:a}],tags:i??[]}}function eu(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"DATE_TIME_INPUT",items:[{key:e,def:u=>({type:"dateTimeInput",...s(u)})}],tags:i??[]}}const a={type:"dateTimeInput",...t};return{type:"ITEMS",itemType:"DATE_TIME_INPUT",items:[{key:e,def:a}],tags:i??[]}}function tu(e,t,i,a){if(typeof i=="function"){const o=i;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:p=>({customType:e,...o(p)})}],tags:a??[]}}const r={customType:e,...i};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:r}],tags:a??[]}}function iu(e,t){return{items:[e],type:"ITEMS",itemType:Je.ACTIONS,tags:t??[]}}function au(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[l=>({customType:e,...s(l)})],tags:i??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:e,...t}],tags:i??[]}}const vs=(e,t)=>({type:"ITEMS",itemType:Je.DISPLAYS,items:[{render:e}],tags:t??[]});function ru(e,t){return{type:"ITEMS",itemType:"ALERTS",items:[e],tags:t??[]}}function su(e,t){return{type:"ITEMS",itemType:"MARKDOWN_TEXTS",items:[e],tags:t??[]}}function nu(e,t,i){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[p=>({customType:e,...l(p)})],tags:i??[]}}const{uid:a,...r}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:e,...a!=null?{uid:a}:{},props:Object.keys(r).length>0?r:void 0}],tags:i??[]}}const ar=(e,t,i)=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:e}],tags:i??[]}),ou=(e,t,i)=>ar(e,{direction:"row",...t??{}},i),lu=(e,t,i)=>ar(e,{direction:"column",...t??{}},i),rr=(e,t,i)=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:e}],tags:i??[]}),du=(e,t,i)=>rr(e,{direction:"row",...t??{}},i),uu=(e,t,i)=>rr(e,{direction:"column",...t??{}},i);function Ds(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function pu(e,t,i){const a=e.map(o=>({label:o.label,uid:o.uid??Ds(o.label)})),r=e.map(o=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{uid:o.uid??Ds(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:a,...t},children:r}],tags:i??[]}}function ws(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function hu(e,t,i){const a=e.map(o=>({label:o.label,uid:o.uid??ws(o.label)})),r=e.map(o=>({type:"ITEMS",itemType:Je.LAYOUTS,items:[{def:{uid:o.uid??ws(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:a,...t},children:r}],tags:i??[]}}function cu(e,t,i,a){if(typeof i=="function"){const o=i;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:p=>({customType:e,...o(p)}),children:t}],tags:a??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:e,...i},children:t}],tags:a??[]}}function mu(e,t,i){const{template:a,...r}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:e,def:r,children:a}],tags:i??[]}}function yu(e,t,i){if(typeof t=="function"){const s=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:u=>({type:"tags",...s(u)})}],tags:i??[]}}const a={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:a}],tags:i??[]}}const gu=yo({inputs:xi,inputByUid:No,textInputs:e=>xi(e,t=>t.type==="text"),numberInputs:e=>xi(e,t=>t.type==="number"),booleanInputs:e=>xi(e,t=>t.type==="boolean"),selects:$l,selectByUid:kl,dropdowns:Nl,dropdownByUid:ql,radiogroups:Tl,radiogroupByUid:Sl,checkboxes:ll,checkboxByUid:dl,textareas:rl,textareaByUid:sl,passwords:nl,passwordByUid:ol,currencies:fl,currencyByUid:vl,markdowns:jl,markdownByUid:ed,lists:Il,listByUid:xl,calendars:Qo,calendarByUid:jo,dateTimeCalendars:el,dateTimeCalendarByUid:tl,dateInputs:ul,dateInputByUid:pl,timeInputs:hl,timeInputByUid:cl,timePickers:ml,timePickerByUid:yl,dateTimeInputs:gl,dateTimeInputByUid:bl,datePickers:Fl,datePickerByUid:Bl,dateTimePickers:il,dateTimePickerByUid:al,rangeCalendars:Dl,rangeCalendarByUid:wl,rangeDateInputs:td,rangeDateInputByUid:id,rangeTimeInputs:ad,rangeTimeInputByUid:rd,rangeDateTimeInputs:sd,rangeDateTimeInputByUid:nd,rangeDateTimeCalendars:od,rangeDateTimeCalendarByUid:ld,rangeDateTimePickers:dd,rangeDateTimePickerByUid:ud,rangeDatePickers:pd,rangeDatePickerByUid:hd,rangeTimePickers:cd,rangeTimePickerByUid:md,repeaters:Va,repeaterByUid:bs,actions:zo,actionByUid:Uo,layouts:Yo,layoutByUid:Ho,displays:Jo,displayByUid:Xo,alerts:Pl,alertByUid:Ml,markdownTexts:Ol,markdownTextByUid:Rl,tabs:Cl,tabsByUid:Ll,accordions:Vl,accordionByUid:Zl,customInputs:bd,customInputByUid:fd,customActions:vd,customActionByUid:Dd,customDisplays:yd,customDisplayByUid:gd,customLayouts:Td,customLayoutByUid:Sd}),bu=Po({name:"gui",registry:fs,facade:{inputs:{textInput:Ad,numberInput:Ed,booleanInput:Cd,select:Ld,dropdown:Id,radiogroup:xd,checkbox:Pd,textarea:Md,password:Od,currency:Rd,markdown:Fd,list:Bd,calendar:Nd,dateTimeCalendar:qd,dateInput:zd,datePicker:Ud,dateTimePicker:Gd,timeInput:Qd,timePicker:jd,dateTimeInput:eu,rangeCalendar:Vd,rangeDateInput:Zd,rangeDateTimeInput:Yd,rangeDateTimeCalendar:Hd,rangeDateTimePicker:Wd,rangeTimeInput:Kd,rangeDatePicker:Jd,rangeTimePicker:Xd,repeater:mu,tags:yu,custom:tu},actions:{button:iu,custom:au},displays:{display:vs,alert:ru,markdownText:su,custom:nu},layouts:{flex:ar,horizontalFlex:ou,verticalFlex:lu,grid:rr,horizontalGrid:du,verticalGrid:uu,tabs:pu,accordion:hu,custom:cu}},selectors:gu,adapter:{bareItemToWidget:e=>vs(e),rootEntry:e=>{const t={def:{uid:"#root",direction:"column",widgetName:"flex"},children:e};return{type:"ITEMS",itemType:Je.LAYOUTS,items:[t],tags:[]}}}}).resolveFormInput;function b(e,t,i){function a(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,u);const p=o.prototype,h=Object.keys(p);for(let c=0;c<h.length;c++){const y=h[c];y in l||(l[y]=p[y].bind(l))}}const r=i?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:e});function o(l){var u;const p=i?.Parent?new s:this;a(p,l),(u=p._zod).deferred??(u.deferred=[]);for(const h of p._zod.deferred)h();return p}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>i?.Parent&&l instanceof i.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Lt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $s extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const fu={};function wt(e){return fu}function sr(e,t){return typeof t=="bigint"?t.toString():t}function nr(e){return e==null}function or(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const ks=Symbol("evaluating");function Q(e,t,i){let a;Object.defineProperty(e,t,{get(){if(a!==ks)return a===void 0&&(a=ks,a=i()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function vu(...e){const t={};for(const i of e){const a=Object.getOwnPropertyDescriptors(i);Object.assign(t,a)}return Object.defineProperties({},t)}function Du(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ts="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ss(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lr(e){if(Ss(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(Ss(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function _s(e){return lr(e)?{...e}:Array.isArray(e)?[...e]:e}function dr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function As(e,t,i){const a=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(a._zod.parent=e),a}function z(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 wu={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 It(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 $u(e,t){return t.map(i=>{var a;return(a=i).path??(a.path=[]),i.path.unshift(e),i})}function Pi(e){return typeof e=="string"?e:e?.message}function $t(e,t,i){const a={...e,path:e.path??[]};if(!e.message){const r=Pi(e.inst?._zod.def?.error?.(e))??Pi(t?.error?.(e))??Pi(i.customError?.(e))??Pi(i.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ur(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function qt(...e){const[t,i,a]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:a}:{...t}}const Es=(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,sr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cs=b("$ZodError",Es),Mi=b("$ZodError",Es,{Parent:Error});function ku(e,t=i=>i.message){const i={},a=[];for(const r of e.issues)r.path.length>0?(i[r.path[0]]=i[r.path[0]]||[],i[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:i}}function Tu(e,t=i=>i.message){const i={_errors:[]},a=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>a({issues:o}));else if(s.code==="invalid_key")a({issues:s.issues});else if(s.code==="invalid_element")a({issues:s.issues});else if(s.path.length===0)i._errors.push(t(s));else{let o=i,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return a(e),i}const Oi=e=>(t,i,a,r)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise)throw new Lt;if(o.issues.length){const l=new(r?.Err??e)(o.issues.map(u=>$t(u,s,wt())));throw Ts(l,r?.callee),l}return o.value},Su=Oi(Mi),Ri=e=>async(t,i,a,r)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new(r?.Err??e)(o.issues.map(u=>$t(u,s,wt())));throw Ts(l,r?.callee),l}return o.value},_u=Ri(Mi),Fi=e=>(t,i,a)=>{const r=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new Lt;return s.issues.length?{success:!1,error:new(e??Cs)(s.issues.map(o=>$t(o,r,wt())))}:{success:!0,data:s.value}},Ls=Fi(Mi),Bi=e=>async(t,i,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>$t(o,r,wt())))}:{success:!0,data:s.value}},Is=Bi(Mi),Au=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Oi(e)(t,i,r)},Eu=e=>(t,i,a)=>Oi(e)(t,i,a),Cu=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ri(e)(t,i,r)},Lu=e=>async(t,i,a)=>Ri(e)(t,i,a),Iu=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Fi(e)(t,i,r)},xu=e=>(t,i,a)=>Fi(e)(t,i,a),Pu=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Bi(e)(t,i,r)},Mu=e=>async(t,i,a)=>Bi(e)(t,i,a),Ou=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xs=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)$/,Ru=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fu=/^(?:(?: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])$/,Bu=/^(([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}|:))$/,Nu=/^(?=.{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])?)*\.?$/,Ps="(?:(?:\\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])))",qu=new RegExp(`^${Ps}$`);function Ms(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 zu(e){return new RegExp(`^${Ms(e)}$`)}function Uu(e){const t=Ms({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${i.join("|")})`;return new RegExp(`^${Ps}T(?:${a})$`)}const Gu=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Vu=/^-?\d+$/,Zu=/^-?\d+(?:\.\d+)?$/,Yu=/^(?:true|false)$/i,Hu=/^[^A-Z]*$/,Wu=/^[^a-z]*$/,Xe=b("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Os={number:"number",bigint:"bigint",object:"date"},Ku=b("$ZodCheckLessThan",(e,t)=>{Xe.init(e,t);const i=Os[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ju=b("$ZodCheckGreaterThan",(e,t)=>{Xe.init(e,t);const i=Os[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xu=b("$ZodCheckNumberFormat",(e,t)=>{Xe.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),a=i?"int":"number",[r,s]=wu[t.format];e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,l.minimum=r,l.maximum=s,i&&(l.pattern=Vu)}),e._zod.check=o=>{const l=o.value;if(i){if(!Number.isInteger(l)){o.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}l<r&&o.issues.push({origin:"number",input:l,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),l>s&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Qu=b("$ZodCheckMaxLength",(e,t)=>{var i;Xe.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!nr(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const o=ur(r);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ju=b("$ZodCheckMinLength",(e,t)=>{var i;Xe.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!nr(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const o=ur(r);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ep=b("$ZodCheckLengthEquals",(e,t)=>{var i;Xe.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!nr(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,s=r.length;if(s===t.length)return;const o=ur(r),l=s>t.length;a.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Ni=b("$ZodCheckStringFormat",(e,t)=>{var i,a;Xe.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),tp=b("$ZodCheckRegex",(e,t)=>{Ni.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})}}),ip=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Hu),Ni.init(e,t)}),ap=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wu),Ni.init(e,t)}),rp=b("$ZodCheckIncludes",(e,t)=>{Xe.init(e,t);const i=dr(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=a,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),sp=b("$ZodCheckStartsWith",(e,t)=>{Xe.init(e,t);const i=new RegExp(`^${dr(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),np=b("$ZodCheckEndsWith",(e,t)=>{Xe.init(e,t);const i=new RegExp(`.*${dr(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),op=b("$ZodCheckOverwrite",(e,t)=>{Xe.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),lp={major:4,minor:3,patch:6},$e=b("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lp;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const s of r._zod.onattach)s(e);if(a.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(o,l,u)=>{let p=It(o),h;for(const c of l){if(c._zod.def.when){if(!c._zod.def.when(o))continue}else if(p)continue;const y=o.issues.length,g=c._zod.check(o);if(g instanceof Promise&&u?.async===!1)throw new Lt;if(h||g instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await g,o.issues.length!==y&&(p||(p=It(o,y)))});else{if(o.issues.length===y)continue;p||(p=It(o,y))}}return h?h.then(()=>o):o},s=(o,l,u)=>{if(It(o))return o.aborted=!0,o;const p=r(l,a,u);if(p instanceof Promise){if(u.async===!1)throw new Lt;return p.then(h=>e._zod.parse(h,u))}return e._zod.parse(p,u)};e._zod.run=(o,l)=>{if(l.skipChecks)return e._zod.parse(o,l);if(l.direction==="backward"){const p=e._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return p instanceof Promise?p.then(h=>s(h,o,l)):s(p,o,l)}const u=e._zod.parse(o,l);if(u instanceof Promise){if(l.async===!1)throw new Lt;return u.then(p=>r(p,a,l))}return r(u,a,l)}}Q(e,"~standard",()=>({validate:r=>{try{const s=Ls(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Is(e,r).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),pr=b("$ZodString",(e,t)=>{$e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gu(e._zod.bag),e._zod.parse=(i,a)=>{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}}),tt=b("$ZodStringFormat",(e,t)=>{Ni.init(e,t),pr.init(e,t)}),dp=b("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=xs(a))}else t.pattern??(t.pattern=xs());tt.init(e,t)}),up=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ru),tt.init(e,t)}),pp=b("$ZodURL",(e,t)=>{tt.init(e,t),e._zod.check=i=>{try{const a=i.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.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(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.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=r.href:i.value=a;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),hp=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Uu(t)),tt.init(e,t)}),cp=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qu),tt.init(e,t)}),mp=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=zu(t)),tt.init(e,t)}),yp=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ou),tt.init(e,t)}),gp=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Fu),tt.init(e,t),e._zod.bag.format="ipv4"}),bp=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bu),tt.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})}}}),fp=b("$ZodCustomStringFormat",(e,t)=>{tt.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})}}),Rs=b("$ZodNumber",(e,t)=>{$e.init(e,t),e._zod.pattern=e._zod.bag.pattern??Zu,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const r=i.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return i;const s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),i}}),vp=b("$ZodNumberFormat",(e,t)=>{Xu.init(e,t),Rs.init(e,t)}),Dp=b("$ZodBoolean",(e,t)=>{$e.init(e,t),e._zod.pattern=Yu,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=!!i.value}catch{}const r=i.value;return typeof r=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),i}}),wp=b("$ZodAny",(e,t)=>{$e.init(e,t),e._zod.parse=i=>i});function Fs(e,t,i){e.issues.length&&t.issues.push(...$u(i,e.issues)),t.value[i]=e.value}const Bs=b("$ZodArray",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{const r=i.value;if(!Array.isArray(r))return i.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),i;i.value=Array(r.length);const s=[];for(let o=0;o<r.length;o++){const l=r[o],u=t.element._zod.run({value:l,issues:[]},a);u instanceof Promise?s.push(u.then(p=>Fs(p,i,o))):Fs(u,i,o)}return s.length?Promise.all(s).then(()=>i):i}});function Ns(e,t,i,a){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!It(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(s=>s.issues.map(o=>$t(o,a,wt())))}),t)}const $p=b("$ZodUnion",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Q(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Q(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Q(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>or(s.source)).join("|")})$`)}});const i=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(i)return a(r,s);let o=!1;const l=[];for(const u of t.options){const p=u._zod.run({value:r.value,issues:[]},s);if(p instanceof Promise)l.push(p),o=!0;else{if(p.issues.length===0)return p;l.push(p)}}return o?Promise.all(l).then(u=>Ns(u,r,e,s)):Ns(l,r,e,s)}}),kp=b("$ZodIntersection",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{const r=i.value,s=t.left._zod.run({value:r,issues:[]},a),o=t.right._zod.run({value:r,issues:[]},a);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([u,p])=>qs(i,u,p)):qs(i,s,o)}});function hr(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(lr(e)&&lr(t)){const i=Object.keys(t),a=Object.keys(e).filter(s=>i.indexOf(s)!==-1),r={...e,...t};for(const s of a){const o=hr(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};r[s]=o.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let a=0;a<e.length;a++){const r=e[a],s=t[a],o=hr(r,s);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i.push(o.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function qs(e,t,i){const a=new Map;let r;for(const l of t.issues)if(l.code==="unrecognized_keys"){r??(r=l);for(const u of l.keys)a.has(u)||a.set(u,{}),a.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)a.has(u)||a.set(u,{}),a.get(u).r=!0;else e.issues.push(l);const s=[...a].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&r&&e.issues.push({...r,keys:s}),It(e))return e;const o=hr(t.value,i.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Tp=b("$ZodTransform",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new $s(e.constructor.name);const r=t.transform(i.value,i);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(o=>(i.value=o,i));if(r instanceof Promise)throw new Lt;return i.value=r,i}});function zs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const cr=b("$ZodOptional",(e,t)=>{$e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${or(i.source)})?$`):void 0}),e._zod.parse=(i,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>zs(s,i.value)):zs(r,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,a)}}),Sp=b("$ZodExactOptional",(e,t)=>{cr.init(e,t),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,a)=>t.innerType._zod.run(i,a)}),_p=b("$ZodNullable",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${or(i.source)}|null)$`):void 0}),Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,a)=>i.value===null?i:t.innerType._zod.run(i,a)}),Ap=b("$ZodDefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);if(i.value===void 0)return i.value=t.defaultValue,i;const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Us(s,t)):Us(r,t)}});function Us(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ep=b("$ZodPrefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>(a.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,a))}),Cp=b("$ZodNonOptional",(e,t)=>{$e.init(e,t),Q(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(a=>a!==void 0)):void 0}),e._zod.parse=(i,a)=>{const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Gs(s,e)):Gs(r,e)}});function Gs(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 Lp=b("$ZodCatch",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(o=>$t(o,a,wt()))},input:i.value}),i.issues=[]),i)):(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(s=>$t(s,a,wt()))},input:i.value}),i.issues=[]),i)}}),Ip=b("$ZodPipe",(e,t)=>{$e.init(e,t),Q(e._zod,"values",()=>t.in._zod.values),Q(e._zod,"optin",()=>t.in._zod.optin),Q(e._zod,"optout",()=>t.out._zod.optout),Q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,a)=>{if(a.direction==="backward"){const s=t.out._zod.run(i,a);return s instanceof Promise?s.then(o=>qi(o,t.in,a)):qi(s,t.in,a)}const r=t.in._zod.run(i,a);return r instanceof Promise?r.then(s=>qi(s,t.out,a)):qi(r,t.out,a)}});function qi(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const xp=b("$ZodReadonly",(e,t)=>{$e.init(e,t),Q(e._zod,"propValues",()=>t.innerType._zod.propValues),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"optin",()=>t.innerType?._zod?.optin),Q(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(Vs):Vs(r)}});function Vs(e){return e.value=Object.freeze(e.value),e}const Zs=b("$ZodCustom",(e,t)=>{Xe.init(e,t),$e.init(e,t),e._zod.parse=(i,a)=>i,e._zod.check=i=>{const a=i.value,r=t.fn(a);if(r instanceof Promise)return r.then(s=>Ys(s,i,a,e));Ys(r,i,a,e)}});function Ys(e,t,i,a){if(!e){const r={code:"custom",input:i,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(qt(r))}}var Hs;class Pp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const a=i[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.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 a={...this.get(i)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Mp(){return new Pp}(Hs=globalThis).__zod_globalRegistry??(Hs.__zod_globalRegistry=Mp());const zt=globalThis.__zod_globalRegistry;function Op(e,t){return new e({type:"string",...z(t)})}function Rp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function Fp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function Bp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function Np(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function qp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function zp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function Up(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Gp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function Vp(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Zp(e,t){return new e({type:"number",checks:[],...z(t)})}function Yp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Hp(e,t){return new e({type:"boolean",...z(t)})}function Wp(e){return new e({type:"any"})}function Kp(e,t){return new Ku({check:"less_than",...z(t),value:e,inclusive:!0})}function Jp(e,t){return new Ju({check:"greater_than",...z(t),value:e,inclusive:!0})}function zi(e,t){return new Qu({check:"max_length",...z(t),maximum:e})}function xt(e,t){return new ju({check:"min_length",...z(t),minimum:e})}function Ws(e,t){return new ep({check:"length_equals",...z(t),length:e})}function Ks(e,t){return new tp({check:"string_format",format:"regex",...z(t),pattern:e})}function Xp(e){return new ip({check:"string_format",format:"lowercase",...z(e)})}function Qp(e){return new ap({check:"string_format",format:"uppercase",...z(e)})}function jp(e,t){return new rp({check:"string_format",format:"includes",...z(t),includes:e})}function eh(e,t){return new sp({check:"string_format",format:"starts_with",...z(t),prefix:e})}function th(e,t){return new np({check:"string_format",format:"ends_with",...z(t),suffix:e})}function Pt(e){return new op({check:"overwrite",tx:e})}function ih(e){return Pt(t=>t.normalize(e))}function ah(){return Pt(e=>e.trim())}function rh(){return Pt(e=>e.toLowerCase())}function sh(){return Pt(e=>e.toUpperCase())}function nh(){return Pt(e=>Du(e))}function oh(e,t,i){return new e({type:"array",element:t,...z(i)})}function Js(e,t,i){return new e({type:"custom",check:"custom",fn:t,...z(i)})}function Xs(e){const t=lh(i=>(i.addIssue=a=>{if(typeof a=="string")i.issues.push(qt(a,i.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),i.issues.push(qt(r))}},e(i.value,i)));return t}function lh(e,t){const i=new Xe({check:"custom",...z(t)});return i._zod.check=e,i}function dh(e,t,i,a={}){const r=z(a),s={...z(a),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:l=>i.test(l),...r};return i instanceof RegExp&&(s.pattern=i),new e(s)}function Qs(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??zt,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 ze(e,t,i={path:[],schemaPath:[]}){var a;const r=e._zod.def,s=t.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,o);const l=e._zod.toJSONSchema?.();if(l)o.schema=l;else{const h={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const y=o.schema,g=t.processors[r.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);g(e,t,y,h)}const c=e._zod.parent;c&&(o.ref||(o.ref=c),ze(c,t,h),t.seen.get(c).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(o.schema,u),t.io==="input"&&Ue(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function js(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const o of e.seen.entries()){const l=e.metadataRegistry.get(o[0])?.id;if(l){const u=a.get(l);if(u&&u!==o[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(l,o[0])}}const r=o=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const c=e.external.registry.get(o[0])?.id,y=e.external.uri??(_=>_);if(c)return{ref:y(c)};const g=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=g,{defId:g,ref:`${y("__shared")}#/${l}/${g}`}}if(o[1]===i)return{ref:"#"};const p=`#/${l}/`,h=o[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:p+h}},s=o=>{if(o[1].schema.$ref)return;const l=o[1],{ref:u,defId:p}=r(o);l.def={...l.schema},p&&(l.defId=p);const h=l.schema;for(const c in h)delete h[c];h.$ref=u};if(e.cycles==="throw")for(const o of e.seen.entries()){const l=o[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
2
|
+
|
|
3
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const l=o[1];if(t===o[0]){s(o);continue}if(e.external){const p=e.external.registry.get(o[0])?.id;if(t!==o[0]&&p){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(l.cycle){s(o);continue}if(l.count>1&&e.reused==="ref"){s(o);continue}}}function en(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=o=>{const l=e.seen.get(o);if(l.ref===null)return;const u=l.def??l.schema,p={...u},h=l.ref;if(l.ref=null,h){a(h);const y=e.seen.get(h),g=y.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),o._zod.parent===h)for(const L in u)L==="$ref"||L==="allOf"||L in p||delete u[L];if(g.$ref&&y.def)for(const L in u)L==="$ref"||L==="allOf"||L in y.def&&JSON.stringify(u[L])===JSON.stringify(y.def[L])&&delete u[L]}const c=o._zod.parent;if(c&&c!==h){a(c);const y=e.seen.get(c);if(y?.schema.$ref&&(u.$ref=y.schema.$ref,y.def))for(const g in u)g==="$ref"||g==="allOf"||g in y.def&&JSON.stringify(u[g])===JSON.stringify(y.def[g])&&delete u[g]}e.override({zodSchema:o,jsonSchema:u,path:l.path??[]})};for(const o of[...e.seen.entries()].reverse())a(o[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(o)}Object.assign(r,i.def??i.schema);const s=e.external?.defs??{};for(const o of e.seen.entries()){const l=o[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{const o=JSON.parse(JSON.stringify(r));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ui(t,"input",e.processors),output:Ui(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Ue(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Ue(a.element,i);if(a.type==="set")return Ue(a.valueType,i);if(a.type==="lazy")return Ue(a.getter(),i);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Ue(a.innerType,i);if(a.type==="intersection")return Ue(a.left,i)||Ue(a.right,i);if(a.type==="record"||a.type==="map")return Ue(a.keyType,i)||Ue(a.valueType,i);if(a.type==="pipe")return Ue(a.in,i)||Ue(a.out,i);if(a.type==="object"){for(const r in a.shape)if(Ue(a.shape[r],i))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(Ue(r,i))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(Ue(r,i))return!0;return!!(a.rest&&Ue(a.rest,i))}return!1}const uh=(e,t={})=>i=>{const a=Qs({...i,processors:t});return ze(e,a),js(a,e),en(a,e)},Ui=(e,t,i={})=>a=>{const{libraryOptions:r,target:s}=a??{},o=Qs({...r??{},target:s,io:t,processors:i});return ze(e,o),js(o,e),en(o,e)},ph={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hh=(e,t,i,a)=>{const r=i;r.type="string";const{minimum:s,maximum:o,format:l,patterns:u,contentEncoding:p}=e._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof o=="number"&&(r.maxLength=o),l&&(r.format=ph[l]??l,r.format===""&&delete r.format,l==="time"&&delete r.format),p&&(r.contentEncoding=p),u&&u.size>0){const h=[...u];h.length===1?r.pattern=h[0].source:h.length>1&&(r.allOf=[...h.map(c=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))])}},ch=(e,t,i,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mh=(e,t,i,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},yh=(e,t,i,a)=>{const r=i,s=e._zod.def,{minimum:o,maximum:l}=e._zod.bag;typeof o=="number"&&(r.minItems=o),typeof l=="number"&&(r.maxItems=l),r.type="array",r.items=ze(s.element,t,{...a,path:[...a.path,"items"]})},gh=(e,t,i,a)=>{const r=e._zod.def,s=r.inclusive===!1,o=r.options.map((l,u)=>ze(l,t,{...a,path:[...a.path,s?"oneOf":"anyOf",u]}));s?i.oneOf=o:i.anyOf=o},bh=(e,t,i,a)=>{const r=e._zod.def,s=ze(r.left,t,{...a,path:[...a.path,"allOf",0]}),o=ze(r.right,t,{...a,path:[...a.path,"allOf",1]}),l=p=>"allOf"in p&&Object.keys(p).length===1,u=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];i.allOf=u},fh=(e,t,i,a)=>{const r=e._zod.def,s=ze(r.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=r.innerType,i.nullable=!0):i.anyOf=[s,{type:"null"}]},vh=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType},Dh=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,i.default=JSON.parse(JSON.stringify(r.defaultValue))},wh=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},$h=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType;let o;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=o},kh=(e,t,i,a)=>{const r=e._zod.def,s=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;ze(s,t,a);const o=t.seen.get(e);o.ref=s},Th=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,i.readOnly=!0},tn=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType},Sh=b("ZodISODateTime",(e,t)=>{hp.init(e,t),Gi.init(e,t)});function _h(e){return zp(Sh,e)}const Ah=b("ZodISODate",(e,t)=>{cp.init(e,t),Gi.init(e,t)});function Eh(e){return Up(Ah,e)}const Ch=b("ZodISOTime",(e,t)=>{mp.init(e,t),Gi.init(e,t)});function Lh(e){return Gp(Ch,e)}const Ih=b("ZodISODuration",(e,t)=>{yp.init(e,t),Gi.init(e,t)});function xh(e){return Vp(Ih,e)}const it=b("ZodError",(e,t)=>{Cs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Tu(e,i)},flatten:{value:i=>ku(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,sr,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,sr,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ph=Oi(it),Mh=Ri(it),Oh=Fi(it),Rh=Bi(it),Fh=Au(it),Bh=Eu(it),Nh=Cu(it),qh=Lu(it),zh=Iu(it),Uh=xu(it),Gh=Pu(it),Vh=Mu(it),Ge=b("ZodType",(e,t)=>($e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ui(e,"input"),output:Ui(e,"output")}}),e.toJSONSchema=uh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(vu(t,{checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(i,a)=>As(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.parse=(i,a)=>Ph(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>Oh(e,i,a),e.parseAsync=async(i,a)=>Mh(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>Rh(e,i,a),e.spa=e.safeParseAsync,e.encode=(i,a)=>Fh(e,i,a),e.decode=(i,a)=>Bh(e,i,a),e.encodeAsync=async(i,a)=>Nh(e,i,a),e.decodeAsync=async(i,a)=>qh(e,i,a),e.safeEncode=(i,a)=>zh(e,i,a),e.safeDecode=(i,a)=>Uh(e,i,a),e.safeEncodeAsync=async(i,a)=>Gh(e,i,a),e.safeDecodeAsync=async(i,a)=>Vh(e,i,a),e.refine=(i,a)=>e.check(gc(i,a)),e.superRefine=i=>e.check(bc(i)),e.overwrite=i=>e.check(Pt(i)),e.optional=()=>an(e),e.exactOptional=()=>ic(e),e.nullable=()=>rn(e),e.nullish=()=>an(rn(e)),e.nonoptional=i=>dc(e,i),e.array=()=>Hh(e),e.or=i=>Kh([e,i]),e.and=i=>Xh(e,i),e.transform=i=>sn(e,jh(i)),e.default=i=>sc(e,i),e.prefault=i=>oc(e,i),e.catch=i=>pc(e,i),e.pipe=i=>sn(e,i),e.readonly=()=>mc(e),e.describe=i=>{const a=e.clone();return zt.add(a,{description:i}),a},Object.defineProperty(e,"description",{get(){return zt.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return zt.get(e);const a=e.clone();return zt.add(a,i[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Zh=b("_ZodString",(e,t)=>{pr.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(a,r,s)=>hh(e,a,r);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...a)=>e.check(Ks(...a)),e.includes=(...a)=>e.check(jp(...a)),e.startsWith=(...a)=>e.check(eh(...a)),e.endsWith=(...a)=>e.check(th(...a)),e.min=(...a)=>e.check(xt(...a)),e.max=(...a)=>e.check(zi(...a)),e.length=(...a)=>e.check(Ws(...a)),e.nonempty=(...a)=>e.check(xt(1,...a)),e.lowercase=a=>e.check(Xp(a)),e.uppercase=a=>e.check(Qp(a)),e.trim=()=>e.check(ah()),e.normalize=(...a)=>e.check(ih(...a)),e.toLowerCase=()=>e.check(rh()),e.toUpperCase=()=>e.check(sh()),e.slugify=()=>e.check(nh())}),Gi=b("ZodStringFormat",(e,t)=>{tt.init(e,t),Zh.init(e,t)}),Yh=b("ZodArray",(e,t)=>{Bs.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>yh(e,i,a,r),e.element=t.element,e.min=(i,a)=>e.check(xt(i,a)),e.nonempty=i=>e.check(xt(1,i)),e.max=(i,a)=>e.check(zi(i,a)),e.length=(i,a)=>e.check(Ws(i,a)),e.unwrap=()=>e.element});function Hh(e,t){return oh(Yh,e,t)}const Wh=b("ZodUnion",(e,t)=>{$p.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>gh(e,i,a,r),e.options=t.options});function Kh(e,t){return new Wh({type:"union",options:e,...z(t)})}const Jh=b("ZodIntersection",(e,t)=>{kp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>bh(e,i,a,r)});function Xh(e,t){return new Jh({type:"intersection",left:e,right:t})}const Qh=b("ZodTransform",(e,t)=>{Tp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>mh(e,i),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new $s(e.constructor.name);i.addIssue=s=>{if(typeof s=="string")i.issues.push(qt(s,i.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=e),i.issues.push(qt(o))}};const r=t.transform(i.value,i);return r instanceof Promise?r.then(s=>(i.value=s,i)):(i.value=r,i)}});function jh(e){return new Qh({type:"transform",transform:e})}const ec=b("ZodOptional",(e,t)=>{cr.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>tn(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function an(e){return new ec({type:"optional",innerType:e})}const tc=b("ZodExactOptional",(e,t)=>{Sp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>tn(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function ic(e){return new tc({type:"optional",innerType:e})}const ac=b("ZodNullable",(e,t)=>{_p.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>fh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function rn(e){return new ac({type:"nullable",innerType:e})}const rc=b("ZodDefault",(e,t)=>{Ap.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Dh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sc(e,t){return new rc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_s(t)}})}const nc=b("ZodPrefault",(e,t)=>{Ep.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>wh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function oc(e,t){return new nc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_s(t)}})}const lc=b("ZodNonOptional",(e,t)=>{Cp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>vh(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function dc(e,t){return new lc({type:"nonoptional",innerType:e,...z(t)})}const uc=b("ZodCatch",(e,t)=>{Lp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>$h(e,i,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function pc(e,t){return new uc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const hc=b("ZodPipe",(e,t)=>{Ip.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>kh(e,i,a,r),e.in=t.in,e.out=t.out});function sn(e,t){return new hc({type:"pipe",in:e,out:t})}const cc=b("ZodReadonly",(e,t)=>{xp.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Th(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new cc({type:"readonly",innerType:e})}const yc=b("ZodCustom",(e,t)=>{Zs.init(e,t),Ge.init(e,t),e._zod.processJSONSchema=(i,a,r)=>ch(e,i)});function gc(e,t={}){return Js(yc,e,t)}function bc(e){return Xs(e)}const kt=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");$e.init(e,t),e.def=t,e.type=t.type,e.parse=(i,a)=>Su(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>Ls(e,i,a),e.parseAsync=async(i,a)=>_u(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>Is(e,i,a),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]},{parent:!0}),e.with=e.check,e.clone=(i,a)=>As(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.apply=i=>i(e)}),nn=b("ZodMiniString",(e,t)=>{pr.init(e,t),kt.init(e,t)});function on(e){return Op(nn,e)}const Mt=b("ZodMiniStringFormat",(e,t)=>{tt.init(e,t),nn.init(e,t)}),fc=b("ZodMiniEmail",(e,t)=>{up.init(e,t),Mt.init(e,t)});function vc(e){return Rp(fc,e)}const Dc=b("ZodMiniUUID",(e,t)=>{dp.init(e,t),Mt.init(e,t)});function wc(e){return Fp(Dc,e)}const $c=b("ZodMiniURL",(e,t)=>{pp.init(e,t),Mt.init(e,t)});function kc(e){return Bp($c,e)}const Tc=b("ZodMiniIPv4",(e,t)=>{gp.init(e,t),Mt.init(e,t)});function Sc(e){return Np(Tc,e)}const _c=b("ZodMiniIPv6",(e,t)=>{bp.init(e,t),Mt.init(e,t)});function Ac(e){return qp(_c,e)}const Ec=b("ZodMiniCustomStringFormat",(e,t)=>{fp.init(e,t),Mt.init(e,t)});function Cc(e){return dh(Ec,"hostname",Nu,e)}const ln=b("ZodMiniNumber",(e,t)=>{Rs.init(e,t),kt.init(e,t)});function dn(e){return Zp(ln,e)}const Lc=b("ZodMiniNumberFormat",(e,t)=>{vp.init(e,t),ln.init(e,t)});function Ic(e){return Yp(Lc,e)}const xc=b("ZodMiniBoolean",(e,t)=>{Dp.init(e,t),kt.init(e,t)});function un(e){return Hp(xc,e)}const Pc=b("ZodMiniAny",(e,t)=>{wp.init(e,t),kt.init(e,t)});function mr(){return Wp(Pc)}const Mc=b("ZodMiniArray",(e,t)=>{Bs.init(e,t),kt.init(e,t)});function pn(e,t){return new Mc({type:"array",element:e,...z(t)})}const Oc=b("ZodMiniOptional",(e,t)=>{cr.init(e,t),kt.init(e,t)});function Rc(e){return new Oc({type:"optional",innerType:e})}const Fc=b("ZodMiniCustom",(e,t)=>{Zs.init(e,t),kt.init(e,t)});function xe(e,t={}){return Js(Fc,e,t)}function hn(e){return Xs(e)}const yr={email:{schema:vc()},hostname:{schema:Cc()},ipv4:{schema:Sc()},ipv6:{schema:Ac()},url:{schema:kc()},uuid:{schema:wc()},date:{schema:Eh()},time:{schema:Lh()},"date-time":{schema:_h({local:!0,offset:!0})},duration:{schema:xh()}},cn=Object.keys(yr),Bc=e=>(t,i)=>{switch(t.type){case"string":return Nc(t,i);case"integer":case"number":return zc(t,i);case"boolean":return Uc(t,i);case"array":return Gc(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return Vc(t,e)}default:{const a=t;throw new Error(`Unknown validator config: ${JSON.stringify(a)}. The "type" property must be one of: "string", "number", "integer", "boolean", "array", "custom".`)}}};function pe(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function Nc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?on(a):on();if(i.required===!0){const s=pe(i.messages?.required,t)??"This field is required";r=r.check(xe(o=>o.length>0,{error:s}))}if(typeof i.minLength=="number"){const s=pe(i.messages?.minLength,t),o=i.minLength;r=r.check(s?xe(l=>l.length>=o,{error:s}):xt(o))}if(typeof i.maxLength=="number"){const s=pe(i.messages?.maxLength,t),o=i.maxLength;r=r.check(s?xe(l=>l.length<=o,{error:s}):zi(o))}if(typeof i.pattern=="string"){const s=pe(i.messages?.pattern,t),o=new RegExp(i.pattern);r=r.check(s?xe(l=>o.test(l),{error:s}):Ks(o))}if(i.enum){const s=i.enum,o=pe(i.messages?.enum,t);r=r.check(xe(l=>s.includes(l),o?{error:o}:void 0))}if(i.const!==void 0){const s=pe(i.messages?.const,t);r=r.check(xe(o=>o===i.const,s?{error:s}:void 0))}if(i.format!==void 0)if(cn.includes(i.format)){const s=pe(i.messages?.format,t);r=r.check(s?hn((o,l)=>{const u=Et.standardValidate(yr[i.format].schema,o);Et.isStandardValidateSuccess(u)||l.addIssue({code:"custom",path:[],message:s})}):yr[i.format].schema)}else throw new Error(`Unknown string validation format: ${JSON.stringify(i.format)}. The "format" property must be one of: ${cn.map(s=>`"${s}"`).join(", ")}.`);return r})}const qc=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function zc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?dn(a):dn();if(i.type==="integer"&&(r=r.check(Ic())),i.minimum!==void 0){const s=pe(i.messages?.minimum,t),o=i.minimum;r=r.check(s?xe(l=>l>=o,{error:s}):Jp(o))}if(i.maximum!==void 0){const s=pe(i.messages?.maximum,t),o=i.maximum;r=r.check(s?xe(l=>l<=o,{error:s}):Kp(o))}if(i.exclusiveMinimum!==void 0){const s=pe(i.messages?.exclusiveMinimum,t),o=i.exclusiveMinimum;r=r.check(xe(l=>l>o,s?{error:s}:void 0))}if(i.exclusiveMaximum!==void 0){const s=pe(i.messages?.exclusiveMaximum,t),o=i.exclusiveMaximum;r=r.check(xe(l=>l<o,s?{error:s}:void 0))}if(i.multipleOf!==void 0){const s=pe(i.messages?.multipleOf,t),o=i.multipleOf;r=r.check(xe(l=>qc(l,o),s?{error:s}:void 0))}if(i.enum){const s=i.enum,o=pe(i.messages?.enum,t);r=r.check(xe(l=>s.includes(l),o?{error:o}:void 0))}if(i.const!==void 0){const s=pe(i.messages?.const,t);r=r.check(xe(o=>o===i.const,s?{error:s}:void 0))}return r})}function Uc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?un(a):un();if(i.const!==void 0){const s=pe(i.messages?.const,t);r=r.check(xe(o=>o===i.const,s?{error:s}:void 0))}return r})}function Gc(e,t){return Ut(e,i=>{const a=pe(i.messages?.invalid,t);let r=a?pn(mr(),a):pn(mr());if(i.required===!0){const s=pe(i.messages?.required,t)??"This field is required";r=r.check(xe(o=>o.length>0,{error:s}))}if(typeof i.minItems=="number"){const s=pe(i.messages?.minItems,t),o=i.minItems;r=r.check(s?xe(l=>l.length>=o,{error:s}):xt(o))}if(typeof i.maxItems=="number"){const s=pe(i.messages?.maxItems,t),o=i.maxItems;r=r.check(s?xe(l=>l.length<=o,{error:s}):zi(o))}return r})}function Vc(e,t){return Ut(e,i=>{let a=mr();return Et.filterTap(Object.keys(i),r=>r!=="type"&&r!=="required",r=>{const s=i[r],o=t[r];if(!o){const u=Object.keys(t).map(p=>`"${p}"`).join(", ");throw new Error(`Unknown custom validator rule "${r}". Registered rules: ${u||"(none)"}.`)}const l=o(s);a=a.check(hn((u,p)=>{const h=Et.standardValidate(l,u);if(!Et.isStandardValidateSuccess(h)){const c=h.issues[0];p.addIssue({code:"custom",path:[],message:c?.message||`Validation failed for ${r}`})}}))}),a})}function Ut(e,t){const i=t(e);return e.required?i:Rc(i)}const Zc=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"label")&&Object.prototype.hasOwnProperty.call(e,"value");function Yc(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 mn={button:async()=>(await Promise.resolve().then(()=>jc)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>$m)).CalendarElement,dateTimeCalendar:async()=>(await Promise.resolve().then(()=>Wm)).DateTimeCalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>ty)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>oy)).RangeDateInputElement,rangeTimeInput:async()=>(await Promise.resolve().then(()=>hy)).RangeTimeInputElement,rangeDateTimeInput:async()=>(await Promise.resolve().then(()=>by)).RangeDateTimeInputElement,rangeDateTimeCalendar:async()=>(await Promise.resolve().then(()=>$y)).RangeDateTimeCalendarElement,rangeDateTimePicker:async()=>(await Promise.resolve().then(()=>Ay)).RangeDateTimePickerElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>xy)).RangeDatePickerElement,rangeTimePicker:async()=>(await Promise.resolve().then(()=>Fy)).RangeTimePickerElement,currency:async()=>(await Promise.resolve().then(()=>Uy)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>Hy)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>Qy)).DatePickerElement,dateTimePicker:async()=>(await Promise.resolve().then(()=>sg)).DateTimePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>vg)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>$g)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>Cg)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>Mg)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Ng)).TextinputElement,timeInput:async()=>(await Promise.resolve().then(()=>Ug)).TimeElement,timePicker:async()=>(await Promise.resolve().then(()=>Zg)).TimePickerElement,dateTimeInput:async()=>(await Promise.resolve().then(()=>Wg)).DateTimeElement,textarea:async()=>(await Promise.resolve().then(()=>jg)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>rb)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>db)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>mb)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>$b)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>Ab)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>Pb)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>Bb)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>zb)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>Vb)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>Hb)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Jb)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>jb)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>af)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>nf)).RendererElement};var Hc=Object.getOwnPropertyDescriptor,Wc=(e,t,i,a)=>{for(var r=a>1?void 0:a?Hc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=o(r)||r);return r};ue.FormElement=class extends m.createFormComponent({widgetLoaders:mn,validators:Bc,resolveFormInput:bu}){},ue.FormElement=Wc([n.customElement("gui-form")],ue.FormElement);var Kc=Object.defineProperty,Jc=Object.getOwnPropertyDescriptor,ct=(e,t,i,a)=>{for(var r=a>1?void 0:a?Jc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Kc(t,i,r),r};let ot=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"},a=e?d.html`<span
|
|
12
4
|
class="gui-widget-icon gui-button-icon ${e}"
|
|
13
5
|
data-icon=${e}
|
|
14
6
|
aria-hidden="true"
|
|
@@ -26,7 +18,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
26
18
|
${t==="right"?a:d.nothing}
|
|
27
19
|
</button>
|
|
28
20
|
</div>
|
|
29
|
-
`}};
|
|
21
|
+
`}};ct([n.property({type:String})],ot.prototype,"uid",2),ct([n.property({type:String})],ot.prototype,"label",2),ct([n.property({type:Boolean})],ot.prototype,"disabled",2),ct([n.property({type:String})],ot.prototype,"icon",2),ct([n.property({type:String})],ot.prototype,"variant",2),ct([n.property({type:String})],ot.prototype,"iconPosition",2),ct([n.property({type:String})],ot.prototype,"actionType",2),ct([n.property({type:Boolean})],ot.prototype,"invalid",2),ot=ct([n.customElement("gui-button")],ot),typeof customElements<"u"&&!customElements.get("gui-button")&&customElements.define("gui-button",ot);var Xc=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,gr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Qc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xc(t,i,r),r};let Gt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.ActionWidgetAdapter,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-button","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`
|
|
30
22
|
<gui-button
|
|
31
23
|
.uid=${this.widget.uid}
|
|
32
24
|
.actionType=${this.adapter.templateData.actionType??"button"}
|
|
@@ -38,20 +30,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
38
30
|
.iconPosition=${this.adapter.templateData.iconPosition}
|
|
39
31
|
@click=${()=>this.adapter.click()}
|
|
40
32
|
></gui-button>
|
|
41
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};gr([f.consume({context:m.formContext}),n.property({attribute:!1})],Vt.prototype,"formContext",2),gr([f.provide({context:m.actionContext})],Vt.prototype,"adapter",2),Vt=gr([n.customElement("gui-button-interactive")],Vt);const jc=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return Vt}},Symbol.toStringTag,{value:"Module"}));class he{constructor(t,i){t.addController(this),this.getTargets=i.getTargets,this.getState=i.getState}hostConnected(){}hostUpdated(){const t=this.getTargets();if(!t)return;let i=[];t instanceof NodeList?i=Array.from(t):Array.isArray(t)?i=t:i=[t];const{uid:a,templateData:r}=this.getState(),{touched:s,errors:o,readonly:l,disabled:u,hint:p,required:h}=r,c=s&&o&&o.length>0;ut.filterTap(i,y=>!!y,y=>{const g=(_,L)=>{L?y.setAttribute(_,L):y.removeAttribute(_)};g("aria-describedby",p?`${a}_hint`:null),g("aria-invalid",c?"true":null),g("aria-errormessage",c?`${a}_errors`:null),g("aria-readonly",l?"true":null),g("aria-disabled",u?"true":null),g("aria-required",h?"true":null)})}}function Vi(e,t,i,a,r={}){const{includeStart:s=!1,outOfBounds:o="index"}=r;let l=s?e:e+t;for(;l>=0&&l<i;){if(!a(l))return l;l+=t}return o==="index"?l:-1}function br(e,t){const{columns:i,isRTL:a,pageSize:r}=t;switch(e){case"ArrowUp":return{kind:"delta",delta:-i};case"ArrowDown":return{kind:"delta",delta:i};case"ArrowLeft":return i===1?{kind:"none"}:{kind:"delta",delta:a?1:-1};case"ArrowRight":return i===1?{kind:"none"}:{kind:"delta",delta:a?-1:1};case"PageUp":return r===void 0?{kind:"none"}:{kind:"delta",delta:-r};case"PageDown":return r===void 0?{kind:"none"}:{kind:"delta",delta:r};case"Home":return{kind:"edge",edge:"first"};case"End":return{kind:"edge",edge:"last"};default:return{kind:"none"}}}function em(e,t,i){return Math.max(1,Math.floor((e??300)/(t||40)))*(i||1)}function fr(e,t){const i=[];for(let a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return i}const Zi=".gui-calendar__day-button:not(.other-month)",tm=".gui-calendar__panel",im="gui-calendar__year-button",am=".gui-calendar__year-button",yn=".gui-calendar__year-button.current",rm=".gui-calendar__year-grid",gn=".gui-calendar__year-selector",sm='.gui-calendar__day-button[tabindex="0"]';class Yi{constructor(t,i){this.handleDayKeydown=async a=>{if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(a.key)&&a.key!==" "&&a.key!=="Enter")return;const s=a.target,o=Array.from(this.host.querySelectorAll(Zi)),l=o.indexOf(s),u=window.getComputedStyle(this.host).direction==="rtl";if(a.key===" "||a.key==="Enter"){a.preventDefault(),this.options.onActivateDay(s.dataset.date??"",a);return}const p=br(a.key,{columns:7,isRTL:u});if(p.kind!=="delta")return;const h=p.delta;a.preventDefault();const c=Vi(l,h,o.length,g=>this.isButtonDisabled(o[g]));let y=!1;if(c<0)if(this.options.canGoPrev())this.options.goPrev(),y=!0;else{o.find(_=>!this.isButtonDisabled(_))?.focus();return}else if(c>=o.length)if(this.options.canGoNext())this.options.goNext(),y=!0;else{[...o].reverse().find(L=>!this.isButtonDisabled(L))?.focus();return}if(y){await this.host.updateComplete;const g=Array.from(this.host.querySelectorAll(Zi)),_=Array.from(this.host.querySelectorAll(tm));let L;if(c<0)L=_[0].querySelectorAll(Zi).length+c;else{const nt=_[_.length-1].querySelectorAll(Zi).length;L=g.length-nt+(c-o.length)}if(this.isButtonDisabled(g[L])){const Ae=Vi(L,h,g.length,nt=>this.isButtonDisabled(g[nt]));if(Ae<0||Ae>=g.length){const nt=g.findIndex(Dt=>!this.isButtonDisabled(Dt));nt>-1&&g[nt].focus()}else g[Ae]?.focus()}else{const Ae=Math.max(0,Math.min(L,g.length-1));g[Ae]?.focus()}}else o[c]?.focus()},this.handleYearKeydown=a=>{const r=a.target;if(!r.classList.contains(im))return;const s=Array.from(this.host.querySelectorAll(am)),o=s.indexOf(r),l=window.getComputedStyle(this.host).direction==="rtl";if(a.key==="Enter"||a.key===" "){a.preventDefault();const h=parseInt(r.dataset.year??"",10);isNaN(h)||this.selectYear(h);return}if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),this.host.querySelector(gn)?.focus(),this.options.onCloseYearGrid();return}const u=br(a.key,{columns:4,isRTL:l});if(u.kind!=="delta")return;a.preventDefault();const p=o+u.delta;p>=0&&p<s.length&&s[p].focus()},this.onPrevMonthClick=()=>{this.options.goPrev(),this.keepNavFocusInside("prev","next")},this.onNextMonthClick=()=>{this.options.goNext(),this.keepNavFocusInside("next","prev")},this.host=t,this.options=i,t.addController(this)}hostConnected(){}selectYear(t){this.host.querySelector(gn)?.focus(),this.options.onSelectYear(t),this.host.updateComplete.then(()=>{this.host.querySelector(sm)?.focus()})}onYearGridToggled(){this.options.isYearGridOpen()&&this.host.updateComplete.then(()=>{this.scrollToCurrentYear(),this.focusCurrentYearButton()})}scrollToCurrentYear(){const t=this.host.querySelector(rm),i=this.host.querySelector(yn);if(t&&i){const a=t.getBoundingClientRect(),r=i.getBoundingClientRect(),s=t.scrollTop+(r.top-a.top)-a.height/2+r.height/2;t.scrollTop=Math.max(0,s)}}focusCurrentYearButton(){this.host.querySelector(yn)?.focus()}async keepNavFocusInside(t,i){await this.host.updateComplete;const a=this.host.querySelector(`.gui-calendar__month-button--${t}`);if(!a||!a.disabled)return;(this.host.querySelector(`.gui-calendar__month-button--${i}:not([disabled])`)??this.host.querySelector('.gui-calendar__day-button:not([disabled]):not([aria-disabled="true"])'))?.focus()}isButtonDisabled(t){return t?t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true":!0}}class Zt{constructor(t,i){this.onFocusOut=a=>{this.handleFocusOut(a)},t.addController(this),this.host=t,this.options=i}handleFocusOut(t){this.isInside(t.relatedTarget)||(this._rafId!==void 0&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this._rafId=void 0,this.isInside(document.activeElement)||this.options.onLeave()}))}cancelPendingLeave(){this._rafId!==void 0&&(cancelAnimationFrame(this._rafId),this._rafId=void 0)}isInside(t){return!!t&&this.host.contains(t)}hostDisconnected(){this.cancelPendingLeave()}}const bn={aa:{firstDay:7,weekend:[6,7],minimalDays:1},"aa-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"aa-ER":{firstDay:1,weekend:[6,7],minimalDays:1},ab:{firstDay:1,weekend:[6,7],minimalDays:1},af:{firstDay:7,weekend:[6,7],minimalDays:1},"af-NA":{firstDay:1,weekend:[6,7],minimalDays:1},agq:{firstDay:1,weekend:[6,7],minimalDays:1},ak:{firstDay:1,weekend:[6,7],minimalDays:1},am:{firstDay:7,weekend:[6,7],minimalDays:1},an:{firstDay:1,weekend:[6,7],minimalDays:4},ann:{firstDay:1,weekend:[6,7],minimalDays:1},apc:{firstDay:6,weekend:[5,6],minimalDays:1},ar:{firstDay:6,weekend:[5,6],minimalDays:1},"ar-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-BH":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EG":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EH":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-JO":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-KW":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-LB":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-LY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-OM":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-PS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-QA":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SA":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SO":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-YE":{firstDay:7,weekend:[5,6],minimalDays:1},arn:{firstDay:1,weekend:[6,7],minimalDays:1},as:{firstDay:7,weekend:[7],minimalDays:1},asa:{firstDay:1,weekend:[6,7],minimalDays:1},ast:{firstDay:1,weekend:[6,7],minimalDays:4},az:{firstDay:1,weekend:[6,7],minimalDays:1},"az-Arab":{firstDay:6,weekend:[5],minimalDays:1},"az-Arab-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"az-Arab-TR":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},ba:{firstDay:1,weekend:[6,7],minimalDays:4},bal:{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},bas:{firstDay:1,weekend:[6,7],minimalDays:1},be:{firstDay:1,weekend:[6,7],minimalDays:1},"be-tarask":{firstDay:1,weekend:[6,7],minimalDays:1},bem:{firstDay:1,weekend:[6,7],minimalDays:1},bew:{firstDay:7,weekend:[6,7],minimalDays:1},bez:{firstDay:1,weekend:[6,7],minimalDays:1},bg:{firstDay:1,weekend:[6,7],minimalDays:4},bgc:{firstDay:7,weekend:[7],minimalDays:1},bgn:{firstDay:7,weekend:[6,7],minimalDays:1},"bgn-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"bgn-AF":{firstDay:6,weekend:[4,5],minimalDays:1},"bgn-IR":{firstDay:6,weekend:[5],minimalDays:1},"bgn-OM":{firstDay:6,weekend:[5,6],minimalDays:1},bho:{firstDay:7,weekend:[7],minimalDays:1},blo:{firstDay:1,weekend:[6,7],minimalDays:1},blt:{firstDay:1,weekend:[6,7],minimalDays:1},bm:{firstDay:1,weekend:[6,7],minimalDays:1},"bm-Nkoo":{firstDay:1,weekend:[6,7],minimalDays:1},bn:{firstDay:7,weekend:[6,7],minimalDays:1},"bn-IN":{firstDay:7,weekend:[7],minimalDays:1},bo:{firstDay:1,weekend:[6,7],minimalDays:1},"bo-IN":{firstDay:7,weekend:[7],minimalDays:1},br:{firstDay:1,weekend:[6,7],minimalDays:4},brx:{firstDay:7,weekend:[7],minimalDays:1},bs:{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},bss:{firstDay:1,weekend:[6,7],minimalDays:1},byn:{firstDay:1,weekend:[6,7],minimalDays:1},ca:{firstDay:1,weekend:[6,7],minimalDays:4},"ca-AD":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-ES-valencia":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-IT":{firstDay:1,weekend:[6,7],minimalDays:4},cad:{firstDay:7,weekend:[6,7],minimalDays:1},cch:{firstDay:1,weekend:[6,7],minimalDays:1},ccp:{firstDay:7,weekend:[6,7],minimalDays:1},"ccp-IN":{firstDay:7,weekend:[7],minimalDays:1},ce:{firstDay:1,weekend:[6,7],minimalDays:4},ceb:{firstDay:7,weekend:[6,7],minimalDays:1},cgg:{firstDay:1,weekend:[7],minimalDays:1},cho:{firstDay:7,weekend:[6,7],minimalDays:1},chr:{firstDay:7,weekend:[6,7],minimalDays:1},cic:{firstDay:7,weekend:[6,7],minimalDays:1},ckb:{firstDay:6,weekend:[5,6],minimalDays:1},"ckb-IR":{firstDay:6,weekend:[5],minimalDays:1},co:{firstDay:1,weekend:[6,7],minimalDays:4},cs:{firstDay:1,weekend:[6,7],minimalDays:4},csw:{firstDay:7,weekend:[6,7],minimalDays:1},cu:{firstDay:1,weekend:[6,7],minimalDays:4},cv:{firstDay:1,weekend:[6,7],minimalDays:4},cy:{firstDay:1,weekend:[6,7],minimalDays:4},da:{firstDay:1,weekend:[6,7],minimalDays:4},"da-GL":{firstDay:1,weekend:[6,7],minimalDays:1},dav:{firstDay:7,weekend:[6,7],minimalDays:1},de:{firstDay:1,weekend:[6,7],minimalDays:4},"de-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"de-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"de-IT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LI":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LU":{firstDay:1,weekend:[6,7],minimalDays:4},dje:{firstDay:1,weekend:[6,7],minimalDays:1},doi:{firstDay:7,weekend:[7],minimalDays:1},dsb:{firstDay:1,weekend:[6,7],minimalDays:4},dua:{firstDay:1,weekend:[6,7],minimalDays:1},dv:{firstDay:5,weekend:[6,7],minimalDays:1},dyo:{firstDay:1,weekend:[6,7],minimalDays:1},dz:{firstDay:7,weekend:[6,7],minimalDays:1},ebu:{firstDay:7,weekend:[6,7],minimalDays:1},ee:{firstDay:1,weekend:[6,7],minimalDays:1},"ee-TG":{firstDay:1,weekend:[6,7],minimalDays:1},el:{firstDay:1,weekend:[6,7],minimalDays:4},"el-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"el-polyton":{firstDay:1,weekend:[6,7],minimalDays:4},en:{firstDay:7,weekend:[6,7],minimalDays:1},"en-001":{firstDay:1,weekend:[6,7],minimalDays:1},"en-150":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"en-AG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"en-AU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BW":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"en-CK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DK":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-Dsrt":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FJ":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GB":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GD":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GG":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GU":{firstDay:7,weekend:[6,7],minimalDays:1},"en-GY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"en-IE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"en-IM":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IN":{firstDay:7,weekend:[7],minimalDays:1},"en-IO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-JE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-JM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MP":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MV":{firstDay:5,weekend:[6,7],minimalDays:1},"en-MW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NA":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NF":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NL":{firstDay:1,weekend:[6,7],minimalDays:4},"en-NR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"en-SE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-SH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-Shaw":{firstDay:1,weekend:[6,7],minimalDays:4},"en-TC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-TV":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-UG":{firstDay:1,weekend:[7],minimalDays:1},"en-UM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VI":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-WS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-ZW":{firstDay:7,weekend:[6,7],minimalDays:1},eo:{firstDay:1,weekend:[6,7],minimalDays:1},es:{firstDay:1,weekend:[6,7],minimalDays:4},"es-419":{firstDay:1,weekend:[6,7],minimalDays:1},"es-AR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CL":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CU":{firstDay:1,weekend:[6,7],minimalDays:1},"es-DO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-EA":{firstDay:1,weekend:[6,7],minimalDays:1},"es-EC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GT":{firstDay:7,weekend:[6,7],minimalDays:1},"es-HN":{firstDay:7,weekend:[6,7],minimalDays:1},"es-IC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-MX":{firstDay:7,weekend:[6,7],minimalDays:1},"es-NI":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PA":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PE":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PY":{firstDay:7,weekend:[6,7],minimalDays:1},"es-SV":{firstDay:7,weekend:[6,7],minimalDays:1},"es-US":{firstDay:7,weekend:[6,7],minimalDays:1},"es-UY":{firstDay:1,weekend:[6,7],minimalDays:1},"es-VE":{firstDay:7,weekend:[6,7],minimalDays:1},et:{firstDay:1,weekend:[6,7],minimalDays:4},eu:{firstDay:1,weekend:[6,7],minimalDays:4},ewo:{firstDay:1,weekend:[6,7],minimalDays:1},fa:{firstDay:6,weekend:[5],minimalDays:1},"fa-AF":{firstDay:6,weekend:[4,5],minimalDays:1},ff:{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-SL":{firstDay:1,weekend:[6,7],minimalDays:1},fi:{firstDay:1,weekend:[6,7],minimalDays:4},fil:{firstDay:7,weekend:[6,7],minimalDays:1},fo:{firstDay:1,weekend:[6,7],minimalDays:4},"fo-DK":{firstDay:1,weekend:[6,7],minimalDays:4},fr:{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BL":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"fr-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-CI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"fr-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-GA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GF":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GP":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-HT":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MC":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-ML":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MQ":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-RE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-WF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-YT":{firstDay:1,weekend:[6,7],minimalDays:1},frr:{firstDay:1,weekend:[6,7],minimalDays:4},fur:{firstDay:1,weekend:[6,7],minimalDays:4},fy:{firstDay:1,weekend:[6,7],minimalDays:4},ga:{firstDay:1,weekend:[6,7],minimalDays:4},"ga-GB":{firstDay:1,weekend:[6,7],minimalDays:4},gaa:{firstDay:1,weekend:[6,7],minimalDays:1},gd:{firstDay:1,weekend:[6,7],minimalDays:4},gez:{firstDay:7,weekend:[6,7],minimalDays:1},"gez-ER":{firstDay:1,weekend:[6,7],minimalDays:1},gl:{firstDay:1,weekend:[6,7],minimalDays:4},gn:{firstDay:7,weekend:[6,7],minimalDays:1},gsw:{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-LI":{firstDay:1,weekend:[6,7],minimalDays:4},gu:{firstDay:7,weekend:[7],minimalDays:1},guz:{firstDay:7,weekend:[6,7],minimalDays:1},gv:{firstDay:1,weekend:[6,7],minimalDays:4},ha:{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ha-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-NE":{firstDay:1,weekend:[6,7],minimalDays:1},haw:{firstDay:7,weekend:[6,7],minimalDays:1},he:{firstDay:7,weekend:[5,6],minimalDays:1},hi:{firstDay:7,weekend:[7],minimalDays:1},"hi-Latn":{firstDay:7,weekend:[7],minimalDays:1},hnj:{firstDay:7,weekend:[6,7],minimalDays:1},"hnj-Hmnp":{firstDay:7,weekend:[6,7],minimalDays:1},hr:{firstDay:1,weekend:[6,7],minimalDays:1},"hr-BA":{firstDay:1,weekend:[6,7],minimalDays:1},hsb:{firstDay:1,weekend:[6,7],minimalDays:4},hu:{firstDay:1,weekend:[6,7],minimalDays:4},hy:{firstDay:1,weekend:[6,7],minimalDays:1},ia:{firstDay:1,weekend:[6,7],minimalDays:1},id:{firstDay:7,weekend:[6,7],minimalDays:1},ie:{firstDay:1,weekend:[6,7],minimalDays:4},ig:{firstDay:1,weekend:[6,7],minimalDays:1},ii:{firstDay:1,weekend:[6,7],minimalDays:1},io:{firstDay:1,weekend:[6,7],minimalDays:1},is:{firstDay:1,weekend:[6,7],minimalDays:4},it:{firstDay:1,weekend:[6,7],minimalDays:4},"it-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"it-SM":{firstDay:1,weekend:[6,7],minimalDays:4},"it-VA":{firstDay:1,weekend:[6,7],minimalDays:4},iu:{firstDay:7,weekend:[6,7],minimalDays:1},"iu-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},ja:{firstDay:7,weekend:[6,7],minimalDays:1},jbo:{firstDay:1,weekend:[6,7],minimalDays:1},jgo:{firstDay:1,weekend:[6,7],minimalDays:1},jmc:{firstDay:1,weekend:[6,7],minimalDays:1},jv:{firstDay:7,weekend:[6,7],minimalDays:1},ka:{firstDay:1,weekend:[6,7],minimalDays:1},kab:{firstDay:6,weekend:[5,6],minimalDays:1},kaj:{firstDay:1,weekend:[6,7],minimalDays:1},kam:{firstDay:7,weekend:[6,7],minimalDays:1},kcg:{firstDay:1,weekend:[6,7],minimalDays:1},kde:{firstDay:1,weekend:[6,7],minimalDays:1},kea:{firstDay:1,weekend:[6,7],minimalDays:1},ken:{firstDay:1,weekend:[6,7],minimalDays:1},kgp:{firstDay:7,weekend:[6,7],minimalDays:1},khq:{firstDay:1,weekend:[6,7],minimalDays:1},ki:{firstDay:7,weekend:[6,7],minimalDays:1},kk:{firstDay:1,weekend:[6,7],minimalDays:1},kkj:{firstDay:1,weekend:[6,7],minimalDays:1},kl:{firstDay:1,weekend:[6,7],minimalDays:1},kln:{firstDay:7,weekend:[6,7],minimalDays:1},km:{firstDay:7,weekend:[6,7],minimalDays:1},kn:{firstDay:7,weekend:[7],minimalDays:1},ko:{firstDay:7,weekend:[6,7],minimalDays:1},"ko-CN":{firstDay:1,weekend:[6,7],minimalDays:1},"ko-KP":{firstDay:1,weekend:[6,7],minimalDays:1},kok:{firstDay:7,weekend:[7],minimalDays:1},kpe:{firstDay:1,weekend:[6,7],minimalDays:1},"kpe-GN":{firstDay:1,weekend:[6,7],minimalDays:1},ks:{firstDay:7,weekend:[7],minimalDays:1},"ks-Arab":{firstDay:7,weekend:[7],minimalDays:1},"ks-Deva":{firstDay:7,weekend:[7],minimalDays:1},ksb:{firstDay:1,weekend:[6,7],minimalDays:1},ksf:{firstDay:1,weekend:[6,7],minimalDays:1},ksh:{firstDay:1,weekend:[6,7],minimalDays:4},ku:{firstDay:1,weekend:[6,7],minimalDays:1},kw:{firstDay:1,weekend:[6,7],minimalDays:4},kxv:{firstDay:7,weekend:[7],minimalDays:1},"kxv-Deva":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Latn":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Orya":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Telu":{firstDay:7,weekend:[7],minimalDays:1},ky:{firstDay:1,weekend:[6,7],minimalDays:1},la:{firstDay:1,weekend:[6,7],minimalDays:4},lag:{firstDay:1,weekend:[6,7],minimalDays:1},lb:{firstDay:1,weekend:[6,7],minimalDays:4},lg:{firstDay:1,weekend:[7],minimalDays:1},lij:{firstDay:1,weekend:[6,7],minimalDays:4},lkt:{firstDay:7,weekend:[6,7],minimalDays:1},lmo:{firstDay:1,weekend:[6,7],minimalDays:4},ln:{firstDay:1,weekend:[6,7],minimalDays:1},"ln-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CG":{firstDay:1,weekend:[6,7],minimalDays:1},lo:{firstDay:7,weekend:[6,7],minimalDays:1},lrc:{firstDay:6,weekend:[5],minimalDays:1},"lrc-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},lt:{firstDay:1,weekend:[6,7],minimalDays:4},lu:{firstDay:1,weekend:[6,7],minimalDays:1},luo:{firstDay:7,weekend:[6,7],minimalDays:1},luy:{firstDay:7,weekend:[6,7],minimalDays:1},lv:{firstDay:1,weekend:[6,7],minimalDays:1},mai:{firstDay:7,weekend:[7],minimalDays:1},mas:{firstDay:7,weekend:[6,7],minimalDays:1},"mas-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},mdf:{firstDay:1,weekend:[6,7],minimalDays:4},mer:{firstDay:7,weekend:[6,7],minimalDays:1},mfe:{firstDay:1,weekend:[6,7],minimalDays:1},mg:{firstDay:1,weekend:[6,7],minimalDays:1},mgh:{firstDay:7,weekend:[6,7],minimalDays:1},mgo:{firstDay:1,weekend:[6,7],minimalDays:1},mi:{firstDay:1,weekend:[6,7],minimalDays:1},mic:{firstDay:7,weekend:[6,7],minimalDays:1},mk:{firstDay:1,weekend:[6,7],minimalDays:1},ml:{firstDay:7,weekend:[7],minimalDays:1},mn:{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong":{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong-MN":{firstDay:1,weekend:[6,7],minimalDays:1},mni:{firstDay:7,weekend:[7],minimalDays:1},"mni-Beng":{firstDay:7,weekend:[7],minimalDays:1},"mni-Mtei":{firstDay:7,weekend:[7],minimalDays:1},moh:{firstDay:7,weekend:[6,7],minimalDays:1},mr:{firstDay:7,weekend:[7],minimalDays:1},ms:{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"ms-SG":{firstDay:7,weekend:[6,7],minimalDays:1},mt:{firstDay:7,weekend:[6,7],minimalDays:1},mua:{firstDay:1,weekend:[6,7],minimalDays:1},mus:{firstDay:7,weekend:[6,7],minimalDays:1},my:{firstDay:7,weekend:[6,7],minimalDays:1},myv:{firstDay:1,weekend:[6,7],minimalDays:4},mzn:{firstDay:6,weekend:[5],minimalDays:1},naq:{firstDay:1,weekend:[6,7],minimalDays:1},nb:{firstDay:1,weekend:[6,7],minimalDays:4},"nb-SJ":{firstDay:1,weekend:[6,7],minimalDays:4},nd:{firstDay:7,weekend:[6,7],minimalDays:1},nds:{firstDay:1,weekend:[6,7],minimalDays:4},"nds-NL":{firstDay:1,weekend:[6,7],minimalDays:4},ne:{firstDay:7,weekend:[6,7],minimalDays:1},"ne-IN":{firstDay:7,weekend:[7],minimalDays:1},nl:{firstDay:1,weekend:[6,7],minimalDays:4},"nl-AW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"nl-BQ":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-CW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SR":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SX":{firstDay:1,weekend:[6,7],minimalDays:1},nmg:{firstDay:1,weekend:[6,7],minimalDays:1},nn:{firstDay:1,weekend:[6,7],minimalDays:4},nnh:{firstDay:1,weekend:[6,7],minimalDays:1},no:{firstDay:1,weekend:[6,7],minimalDays:4},nqo:{firstDay:1,weekend:[6,7],minimalDays:1},nr:{firstDay:7,weekend:[6,7],minimalDays:1},nso:{firstDay:7,weekend:[6,7],minimalDays:1},nus:{firstDay:1,weekend:[6,7],minimalDays:1},nv:{firstDay:7,weekend:[6,7],minimalDays:1},ny:{firstDay:1,weekend:[6,7],minimalDays:1},nyn:{firstDay:1,weekend:[7],minimalDays:1},oc:{firstDay:1,weekend:[6,7],minimalDays:4},"oc-ES":{firstDay:1,weekend:[6,7],minimalDays:4},om:{firstDay:7,weekend:[6,7],minimalDays:1},"om-KE":{firstDay:7,weekend:[6,7],minimalDays:1},or:{firstDay:7,weekend:[7],minimalDays:1},os:{firstDay:1,weekend:[6,7],minimalDays:1},"os-RU":{firstDay:1,weekend:[6,7],minimalDays:4},osa:{firstDay:7,weekend:[6,7],minimalDays:1},pa:{firstDay:7,weekend:[7],minimalDays:1},"pa-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"pa-Guru":{firstDay:7,weekend:[7],minimalDays:1},pap:{firstDay:1,weekend:[6,7],minimalDays:1},"pap-AW":{firstDay:1,weekend:[6,7],minimalDays:1},pcm:{firstDay:1,weekend:[6,7],minimalDays:1},pis:{firstDay:1,weekend:[6,7],minimalDays:1},pl:{firstDay:1,weekend:[6,7],minimalDays:4},prg:{firstDay:1,weekend:[6,7],minimalDays:4},ps:{firstDay:6,weekend:[4,5],minimalDays:1},"ps-PK":{firstDay:7,weekend:[6,7],minimalDays:1},pt:{firstDay:7,weekend:[6,7],minimalDays:1},"pt-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-CV":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-MZ":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-PT":{firstDay:7,weekend:[6,7],minimalDays:4},"pt-ST":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-TL":{firstDay:1,weekend:[6,7],minimalDays:1},qu:{firstDay:7,weekend:[6,7],minimalDays:1},"qu-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"qu-EC":{firstDay:1,weekend:[6,7],minimalDays:1},quc:{firstDay:7,weekend:[6,7],minimalDays:1},raj:{firstDay:7,weekend:[7],minimalDays:1},rhg:{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg":{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg-BD":{firstDay:7,weekend:[6,7],minimalDays:1},rif:{firstDay:1,weekend:[6,7],minimalDays:1},rm:{firstDay:1,weekend:[6,7],minimalDays:4},rn:{firstDay:1,weekend:[6,7],minimalDays:1},ro:{firstDay:1,weekend:[6,7],minimalDays:1},"ro-MD":{firstDay:1,weekend:[6,7],minimalDays:1},rof:{firstDay:1,weekend:[6,7],minimalDays:1},ru:{firstDay:1,weekend:[6,7],minimalDays:4},"ru-BY":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KG":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KZ":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-MD":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-UA":{firstDay:1,weekend:[6,7],minimalDays:1},rw:{firstDay:1,weekend:[6,7],minimalDays:1},rwk:{firstDay:1,weekend:[6,7],minimalDays:1},sa:{firstDay:7,weekend:[7],minimalDays:1},sah:{firstDay:1,weekend:[6,7],minimalDays:4},saq:{firstDay:7,weekend:[6,7],minimalDays:1},sat:{firstDay:7,weekend:[7],minimalDays:1},"sat-Deva":{firstDay:7,weekend:[7],minimalDays:1},"sat-Olck":{firstDay:7,weekend:[7],minimalDays:1},sbp:{firstDay:1,weekend:[6,7],minimalDays:1},sc:{firstDay:1,weekend:[6,7],minimalDays:4},scn:{firstDay:1,weekend:[6,7],minimalDays:4},sd:{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Deva":{firstDay:7,weekend:[7],minimalDays:1},sdh:{firstDay:6,weekend:[5],minimalDays:1},"sdh-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},se:{firstDay:1,weekend:[6,7],minimalDays:4},"se-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"se-SE":{firstDay:1,weekend:[6,7],minimalDays:4},seh:{firstDay:7,weekend:[6,7],minimalDays:1},ses:{firstDay:1,weekend:[6,7],minimalDays:1},sg:{firstDay:1,weekend:[6,7],minimalDays:1},shi:{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Tfng":{firstDay:1,weekend:[6,7],minimalDays:1},shn:{firstDay:7,weekend:[6,7],minimalDays:1},"shn-TH":{firstDay:7,weekend:[6,7],minimalDays:1},si:{firstDay:1,weekend:[6,7],minimalDays:1},sid:{firstDay:7,weekend:[6,7],minimalDays:1},sk:{firstDay:1,weekend:[6,7],minimalDays:4},skr:{firstDay:7,weekend:[6,7],minimalDays:1},sl:{firstDay:1,weekend:[6,7],minimalDays:1},sma:{firstDay:1,weekend:[6,7],minimalDays:4},"sma-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smj:{firstDay:1,weekend:[6,7],minimalDays:4},"smj-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smn:{firstDay:1,weekend:[6,7],minimalDays:4},sms:{firstDay:1,weekend:[6,7],minimalDays:4},sn:{firstDay:7,weekend:[6,7],minimalDays:1},so:{firstDay:1,weekend:[6,7],minimalDays:1},"so-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"so-ET":{firstDay:7,weekend:[6,7],minimalDays:1},"so-KE":{firstDay:7,weekend:[6,7],minimalDays:1},sq:{firstDay:1,weekend:[6,7],minimalDays:1},"sq-MK":{firstDay:1,weekend:[6,7],minimalDays:1},"sq-XK":{firstDay:1,weekend:[6,7],minimalDays:1},sr:{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-XK":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-XK":{firstDay:1,weekend:[6,7],minimalDays:1},ss:{firstDay:7,weekend:[6,7],minimalDays:1},"ss-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},ssy:{firstDay:1,weekend:[6,7],minimalDays:1},st:{firstDay:7,weekend:[6,7],minimalDays:1},"st-LS":{firstDay:1,weekend:[6,7],minimalDays:1},su:{firstDay:7,weekend:[6,7],minimalDays:1},"su-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},sv:{firstDay:1,weekend:[6,7],minimalDays:4},"sv-AX":{firstDay:1,weekend:[6,7],minimalDays:4},"sv-FI":{firstDay:1,weekend:[6,7],minimalDays:4},sw:{firstDay:1,weekend:[6,7],minimalDays:1},"sw-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"sw-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"sw-UG":{firstDay:1,weekend:[7],minimalDays:1},syr:{firstDay:6,weekend:[5,6],minimalDays:1},"syr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},szl:{firstDay:1,weekend:[6,7],minimalDays:4},ta:{firstDay:7,weekend:[7],minimalDays:1},"ta-LK":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-SG":{firstDay:7,weekend:[6,7],minimalDays:1},te:{firstDay:7,weekend:[7],minimalDays:1},teo:{firstDay:1,weekend:[7],minimalDays:1},"teo-KE":{firstDay:7,weekend:[6,7],minimalDays:1},tg:{firstDay:1,weekend:[6,7],minimalDays:1},th:{firstDay:7,weekend:[6,7],minimalDays:1},ti:{firstDay:7,weekend:[6,7],minimalDays:1},"ti-ER":{firstDay:1,weekend:[6,7],minimalDays:1},tig:{firstDay:1,weekend:[6,7],minimalDays:1},tk:{firstDay:1,weekend:[6,7],minimalDays:1},tn:{firstDay:7,weekend:[6,7],minimalDays:1},"tn-BW":{firstDay:7,weekend:[6,7],minimalDays:1},to:{firstDay:1,weekend:[6,7],minimalDays:1},tok:{firstDay:1,weekend:[6,7],minimalDays:1},tpi:{firstDay:1,weekend:[6,7],minimalDays:1},tr:{firstDay:1,weekend:[6,7],minimalDays:1},"tr-CY":{firstDay:1,weekend:[6,7],minimalDays:1},trv:{firstDay:7,weekend:[6,7],minimalDays:1},trw:{firstDay:7,weekend:[6,7],minimalDays:1},ts:{firstDay:7,weekend:[6,7],minimalDays:1},tt:{firstDay:1,weekend:[6,7],minimalDays:4},twq:{firstDay:1,weekend:[6,7],minimalDays:1},tyv:{firstDay:1,weekend:[6,7],minimalDays:4},tzm:{firstDay:1,weekend:[6,7],minimalDays:1},ug:{firstDay:1,weekend:[6,7],minimalDays:1},uk:{firstDay:1,weekend:[6,7],minimalDays:1},und:{firstDay:7,weekend:[6,7],minimalDays:1},ur:{firstDay:7,weekend:[6,7],minimalDays:1},"ur-IN":{firstDay:7,weekend:[7],minimalDays:1},uz:{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Arab":{firstDay:6,weekend:[4,5],minimalDays:1},"uz-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},vai:{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Vaii":{firstDay:1,weekend:[6,7],minimalDays:1},ve:{firstDay:7,weekend:[6,7],minimalDays:1},vec:{firstDay:1,weekend:[6,7],minimalDays:4},vi:{firstDay:1,weekend:[6,7],minimalDays:1},vmw:{firstDay:7,weekend:[6,7],minimalDays:1},vo:{firstDay:1,weekend:[6,7],minimalDays:1},vun:{firstDay:1,weekend:[6,7],minimalDays:1},wa:{firstDay:1,weekend:[6,7],minimalDays:4},wae:{firstDay:1,weekend:[6,7],minimalDays:4},wal:{firstDay:7,weekend:[6,7],minimalDays:1},wbp:{firstDay:1,weekend:[6,7],minimalDays:1},wo:{firstDay:1,weekend:[6,7],minimalDays:1},xh:{firstDay:7,weekend:[6,7],minimalDays:1},xnr:{firstDay:7,weekend:[7],minimalDays:1},xog:{firstDay:1,weekend:[7],minimalDays:1},yav:{firstDay:1,weekend:[6,7],minimalDays:1},yi:{firstDay:1,weekend:[6,7],minimalDays:1},yo:{firstDay:1,weekend:[6,7],minimalDays:1},"yo-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},yrl:{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-VE":{firstDay:7,weekend:[6,7],minimalDays:1},yue:{firstDay:7,weekend:[6,7],minimalDays:1},"yue-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"yue-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},za:{firstDay:1,weekend:[6,7],minimalDays:1},zgh:{firstDay:1,weekend:[6,7],minimalDays:1},zh:{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-MO":{firstDay:7,weekend:[6,7],minimalDays:1},zu:{firstDay:7,weekend:[6,7],minimalDays:1}},fn="Invalid date: day is greater than the maximum valid day for the month and year.",nm="Invalid date: date is before the minimum allowed date.",om="Invalid date: date is after the maximum allowed date.",St="Invalid date: date is within a disabled range.",vn="Invalid time: time is before the minimum allowed time.",Dn="Invalid time: time is after the maximum allowed time.",lm="Invalid range: end time must be after start time.",Hi="Invalid time: time is within a disabled range.",dm="Invalid date-time: date-time is before the minimum allowed date-time.",um="Invalid date-time: date-time is after the maximum allowed date-time.";function ae(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${a}`}function re(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3])):new Date(e)}function Wi(e,t,i,a){const r=e.split("T")[0];if(t&&r<t.split("T")[0]||i&&r>i.split("T")[0])return!0;if(a&&a.length>0)for(const s of a){const o=s.start.split("T")[0],l=s.end?s.end.split("T")[0]:o;if(r>=o&&r<=l)return!0}return!1}function Yt(e,t,i,a,r){const s=e.split("T")[0];return t&&s<t.split("T")[0]?r?.minDateMessage??nm:i&&s>i.split("T")[0]?r?.maxDateMessage??om:Wi(s,void 0,void 0,a)?r?.disabledDateRangeMessage??St:null}function wn(e,t,i,a,r){const s=re(e),o=re(t);if(isNaN(s.getTime())||isNaN(o.getTime()))return!1;const l=new Date(s);l.setHours(0,0,0,0);const u=new Date(o);for(u.setHours(0,0,0,0);l<=u;){if(Wi(ae(l),a,r,i))return!0;l.setDate(l.getDate()+1)}return!1}function $n(e){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date)}function kn(e,t){return e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31}function vr(e){return yt(e,new Date)}function yt(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function pm(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function Tn(e){const t=e??"en",i=bn[t]||bn[t.split("-")[0]]||{firstDay:0};return pm(i.firstDay)}function hm(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return Tn(e).map(a=>{const r=new Date(i);return r.setDate(i.getDate()+a),t.format(r)})}function Sn(e,t){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Ki(e,t){return new Intl.DateTimeFormat(e,{dateStyle:"full"}).format(t)}function Dr(e,t,i){for(let a=0;a<i;a++){const r=new Date(t.getFullYear(),t.getMonth()+a,1);if(e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear())return!0}return!1}function cm(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(r=>r.type==="month"||r.type==="year")}function wr(e,t){const i=e||"en-US",s=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(o=>o.type==="day");return s?s.value:t.getDate().toString()}function _n(e,t){const i=ae(e),a=ae(t);return i===a?{start:i}:{start:i,end:a}}function An(e){return e.length?e.map(a=>({start:re(a.start).getTime(),end:re(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start).reduce((a,r)=>{const s=a[a.length-1];if(s){const o=new Date(s.end);if(o.setDate(o.getDate()+1),r.start<=o.getTime())return s.end=Math.max(s.end,r.end),a}return[...a,r]},[]).map(a=>_n(new Date(a.start),new Date(a.end))):[]}class Ji{constructor(t,i){this._currentDate=new Date,this._yearSelectorOpen=!1,this.host=t,this.options=i,t.addController(this)}hostConnected(){}get currentDate(){return this._currentDate}set currentDate(t){Object.is(t,this._currentDate)||(this._currentDate=t,this.host.requestUpdate())}get yearSelectorOpen(){return this._yearSelectorOpen}set yearSelectorOpen(t){Object.is(t,this._yearSelectorOpen)||(this._yearSelectorOpen=t,this.host.requestUpdate())}prevMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()-1,1)}nextMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()+1,1)}canGoPrev(){const t=this.options.getMinDate();if(!t)return!0;const i=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth(),0);return ae(i)>=t}canGoNext(){const t=this.options.getMaxDate();if(!t)return!0;const i=(this.options.getNumberOfMonths()??1)-1,a=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth()+i+1,1);return ae(a)<=t}get effectiveMinYear(){const t=this.options.getMinDate();return t?re(t).getFullYear():1900}get effectiveMaxYear(){const t=this.options.getMaxDate();return t?re(t).getFullYear():2099}get yearList(){const t=[];for(let i=this.effectiveMinYear;i<=this.effectiveMaxYear;i++)t.push(i);return t}toggleYearSelector(){this.yearSelectorOpen=!this._yearSelectorOpen,this.options.onYearSelectorToggled?.()}selectYear(t){this.currentDate=new Date(t,this._currentDate.getMonth(),1),this.yearSelectorOpen=!1}closeYearSelector(){this.yearSelectorOpen=!1}navigateToDate(t){!isNaN(t.getTime())&&!Dr(t,this._currentDate,this.options.getNumberOfMonths()??1)&&(this.currentDate=t)}isDisabled(t){return Wi(ae(t),this.options.getMinDate(),this.options.getMaxDate(),this.options.getDisabledRanges())}}const Xi=e=>e?d.html`<span aria-hidden="true"> *</span>`:d.nothing,le=(e,t,i=!1,a=void 0,r=!0)=>r?t.label?d.html`<label
|
|
33
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};gr([f.consume({context:m.formContext}),n.property({attribute:!1})],Gt.prototype,"formContext",2),gr([f.provide({context:m.actionContext})],Gt.prototype,"adapter",2),Gt=gr([n.customElement("gui-button-interactive")],Gt);const jc=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return Gt}},Symbol.toStringTag,{value:"Module"}));class he{constructor(t,i){t.addController(this),this.getTargets=i.getTargets,this.getState=i.getState}hostConnected(){}hostUpdated(){const t=this.getTargets();if(!t)return;let i=[];t instanceof NodeList?i=Array.from(t):Array.isArray(t)?i=t:i=[t];const{uid:a,templateData:r}=this.getState(),{touched:s,errors:o,readonly:l,disabled:u,hint:p,required:h}=r,c=s&&o&&o.length>0;Et.filterTap(i,y=>!!y,y=>{const g=(_,L)=>{L?y.setAttribute(_,L):y.removeAttribute(_)};g("aria-describedby",p?`${a}_hint`:null),g("aria-invalid",c?"true":null),g("aria-errormessage",c?`${a}_errors`:null),g("aria-readonly",l?"true":null),g("aria-disabled",u?"true":null),g("aria-required",h?"true":null)})}}function Vi(e,t,i,a,r={}){const{includeStart:s=!1,outOfBounds:o="index"}=r;let l=s?e:e+t;for(;l>=0&&l<i;){if(!a(l))return l;l+=t}return o==="index"?l:-1}function br(e,t){const{columns:i,isRTL:a,pageSize:r}=t;switch(e){case"ArrowUp":return{kind:"delta",delta:-i};case"ArrowDown":return{kind:"delta",delta:i};case"ArrowLeft":return i===1?{kind:"none"}:{kind:"delta",delta:a?1:-1};case"ArrowRight":return i===1?{kind:"none"}:{kind:"delta",delta:a?-1:1};case"PageUp":return r===void 0?{kind:"none"}:{kind:"delta",delta:-r};case"PageDown":return r===void 0?{kind:"none"}:{kind:"delta",delta:r};case"Home":return{kind:"edge",edge:"first"};case"End":return{kind:"edge",edge:"last"};default:return{kind:"none"}}}function em(e,t,i){return Math.max(1,Math.floor((e??300)/(t||40)))*(i||1)}function fr(e,t){const i=[];for(let a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return i}const Zi=".gui-calendar__day-button:not(.other-month)",tm=".gui-calendar__panel",im="gui-calendar__year-button",am=".gui-calendar__year-button",yn=".gui-calendar__year-button.current",rm=".gui-calendar__year-grid",gn=".gui-calendar__year-selector",sm='.gui-calendar__day-button[tabindex="0"]';class Yi{constructor(t,i){this.handleDayKeydown=async a=>{if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(a.key)&&a.key!==" "&&a.key!=="Enter")return;const s=a.target,o=Array.from(this.host.querySelectorAll(Zi)),l=o.indexOf(s),u=window.getComputedStyle(this.host).direction==="rtl";if(a.key===" "||a.key==="Enter"){a.preventDefault(),this.options.onActivateDay(s.dataset.date??"",a);return}const p=br(a.key,{columns:7,isRTL:u});if(p.kind!=="delta")return;const h=p.delta;a.preventDefault();const c=Vi(l,h,o.length,g=>this.isButtonDisabled(o[g]));let y=!1;if(c<0)if(this.options.canGoPrev())this.options.goPrev(),y=!0;else{o.find(_=>!this.isButtonDisabled(_))?.focus();return}else if(c>=o.length)if(this.options.canGoNext())this.options.goNext(),y=!0;else{[...o].reverse().find(L=>!this.isButtonDisabled(L))?.focus();return}if(y){await this.host.updateComplete;const g=Array.from(this.host.querySelectorAll(Zi)),_=Array.from(this.host.querySelectorAll(tm));let L;if(c<0)L=_[0].querySelectorAll(Zi).length+c;else{const nt=_[_.length-1].querySelectorAll(Zi).length;L=g.length-nt+(c-o.length)}if(this.isButtonDisabled(g[L])){const Ae=Vi(L,h,g.length,nt=>this.isButtonDisabled(g[nt]));if(Ae<0||Ae>=g.length){const nt=g.findIndex(vt=>!this.isButtonDisabled(vt));nt>-1&&g[nt].focus()}else g[Ae]?.focus()}else{const Ae=Math.max(0,Math.min(L,g.length-1));g[Ae]?.focus()}}else o[c]?.focus()},this.handleYearKeydown=a=>{const r=a.target;if(!r.classList.contains(im))return;const s=Array.from(this.host.querySelectorAll(am)),o=s.indexOf(r),l=window.getComputedStyle(this.host).direction==="rtl";if(a.key==="Enter"||a.key===" "){a.preventDefault();const h=parseInt(r.dataset.year??"",10);isNaN(h)||this.selectYear(h);return}if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),this.host.querySelector(gn)?.focus(),this.options.onCloseYearGrid();return}const u=br(a.key,{columns:4,isRTL:l});if(u.kind!=="delta")return;a.preventDefault();const p=o+u.delta;p>=0&&p<s.length&&s[p].focus()},this.onPrevMonthClick=()=>{this.options.goPrev(),this.keepNavFocusInside("prev","next")},this.onNextMonthClick=()=>{this.options.goNext(),this.keepNavFocusInside("next","prev")},this.host=t,this.options=i,t.addController(this)}hostConnected(){}selectYear(t){this.host.querySelector(gn)?.focus(),this.options.onSelectYear(t),this.host.updateComplete.then(()=>{this.host.querySelector(sm)?.focus()})}onYearGridToggled(){this.options.isYearGridOpen()&&this.host.updateComplete.then(()=>{this.scrollToCurrentYear(),this.focusCurrentYearButton()})}scrollToCurrentYear(){const t=this.host.querySelector(rm),i=this.host.querySelector(yn);if(t&&i){const a=t.getBoundingClientRect(),r=i.getBoundingClientRect(),s=t.scrollTop+(r.top-a.top)-a.height/2+r.height/2;t.scrollTop=Math.max(0,s)}}focusCurrentYearButton(){this.host.querySelector(yn)?.focus()}async keepNavFocusInside(t,i){await this.host.updateComplete;const a=this.host.querySelector(`.gui-calendar__month-button--${t}`);if(!a||!a.disabled)return;(this.host.querySelector(`.gui-calendar__month-button--${i}:not([disabled])`)??this.host.querySelector('.gui-calendar__day-button:not([disabled]):not([aria-disabled="true"])'))?.focus()}isButtonDisabled(t){return t?t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true":!0}}class Vt{constructor(t,i){this.onFocusOut=a=>{this.handleFocusOut(a)},t.addController(this),this.host=t,this.options=i}handleFocusOut(t){this.isInside(t.relatedTarget)||(this._rafId!==void 0&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this._rafId=void 0,this.isInside(document.activeElement)||this.options.onLeave()}))}cancelPendingLeave(){this._rafId!==void 0&&(cancelAnimationFrame(this._rafId),this._rafId=void 0)}isInside(t){return!!t&&this.host.contains(t)}hostDisconnected(){this.cancelPendingLeave()}}const bn={aa:{firstDay:7,weekend:[6,7],minimalDays:1},"aa-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"aa-ER":{firstDay:1,weekend:[6,7],minimalDays:1},ab:{firstDay:1,weekend:[6,7],minimalDays:1},af:{firstDay:7,weekend:[6,7],minimalDays:1},"af-NA":{firstDay:1,weekend:[6,7],minimalDays:1},agq:{firstDay:1,weekend:[6,7],minimalDays:1},ak:{firstDay:1,weekend:[6,7],minimalDays:1},am:{firstDay:7,weekend:[6,7],minimalDays:1},an:{firstDay:1,weekend:[6,7],minimalDays:4},ann:{firstDay:1,weekend:[6,7],minimalDays:1},apc:{firstDay:6,weekend:[5,6],minimalDays:1},ar:{firstDay:6,weekend:[5,6],minimalDays:1},"ar-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-BH":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EG":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EH":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-JO":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-KW":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-LB":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-LY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-OM":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-PS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-QA":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SA":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SO":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-YE":{firstDay:7,weekend:[5,6],minimalDays:1},arn:{firstDay:1,weekend:[6,7],minimalDays:1},as:{firstDay:7,weekend:[7],minimalDays:1},asa:{firstDay:1,weekend:[6,7],minimalDays:1},ast:{firstDay:1,weekend:[6,7],minimalDays:4},az:{firstDay:1,weekend:[6,7],minimalDays:1},"az-Arab":{firstDay:6,weekend:[5],minimalDays:1},"az-Arab-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"az-Arab-TR":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},ba:{firstDay:1,weekend:[6,7],minimalDays:4},bal:{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},bas:{firstDay:1,weekend:[6,7],minimalDays:1},be:{firstDay:1,weekend:[6,7],minimalDays:1},"be-tarask":{firstDay:1,weekend:[6,7],minimalDays:1},bem:{firstDay:1,weekend:[6,7],minimalDays:1},bew:{firstDay:7,weekend:[6,7],minimalDays:1},bez:{firstDay:1,weekend:[6,7],minimalDays:1},bg:{firstDay:1,weekend:[6,7],minimalDays:4},bgc:{firstDay:7,weekend:[7],minimalDays:1},bgn:{firstDay:7,weekend:[6,7],minimalDays:1},"bgn-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"bgn-AF":{firstDay:6,weekend:[4,5],minimalDays:1},"bgn-IR":{firstDay:6,weekend:[5],minimalDays:1},"bgn-OM":{firstDay:6,weekend:[5,6],minimalDays:1},bho:{firstDay:7,weekend:[7],minimalDays:1},blo:{firstDay:1,weekend:[6,7],minimalDays:1},blt:{firstDay:1,weekend:[6,7],minimalDays:1},bm:{firstDay:1,weekend:[6,7],minimalDays:1},"bm-Nkoo":{firstDay:1,weekend:[6,7],minimalDays:1},bn:{firstDay:7,weekend:[6,7],minimalDays:1},"bn-IN":{firstDay:7,weekend:[7],minimalDays:1},bo:{firstDay:1,weekend:[6,7],minimalDays:1},"bo-IN":{firstDay:7,weekend:[7],minimalDays:1},br:{firstDay:1,weekend:[6,7],minimalDays:4},brx:{firstDay:7,weekend:[7],minimalDays:1},bs:{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},bss:{firstDay:1,weekend:[6,7],minimalDays:1},byn:{firstDay:1,weekend:[6,7],minimalDays:1},ca:{firstDay:1,weekend:[6,7],minimalDays:4},"ca-AD":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-ES-valencia":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-IT":{firstDay:1,weekend:[6,7],minimalDays:4},cad:{firstDay:7,weekend:[6,7],minimalDays:1},cch:{firstDay:1,weekend:[6,7],minimalDays:1},ccp:{firstDay:7,weekend:[6,7],minimalDays:1},"ccp-IN":{firstDay:7,weekend:[7],minimalDays:1},ce:{firstDay:1,weekend:[6,7],minimalDays:4},ceb:{firstDay:7,weekend:[6,7],minimalDays:1},cgg:{firstDay:1,weekend:[7],minimalDays:1},cho:{firstDay:7,weekend:[6,7],minimalDays:1},chr:{firstDay:7,weekend:[6,7],minimalDays:1},cic:{firstDay:7,weekend:[6,7],minimalDays:1},ckb:{firstDay:6,weekend:[5,6],minimalDays:1},"ckb-IR":{firstDay:6,weekend:[5],minimalDays:1},co:{firstDay:1,weekend:[6,7],minimalDays:4},cs:{firstDay:1,weekend:[6,7],minimalDays:4},csw:{firstDay:7,weekend:[6,7],minimalDays:1},cu:{firstDay:1,weekend:[6,7],minimalDays:4},cv:{firstDay:1,weekend:[6,7],minimalDays:4},cy:{firstDay:1,weekend:[6,7],minimalDays:4},da:{firstDay:1,weekend:[6,7],minimalDays:4},"da-GL":{firstDay:1,weekend:[6,7],minimalDays:1},dav:{firstDay:7,weekend:[6,7],minimalDays:1},de:{firstDay:1,weekend:[6,7],minimalDays:4},"de-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"de-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"de-IT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LI":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LU":{firstDay:1,weekend:[6,7],minimalDays:4},dje:{firstDay:1,weekend:[6,7],minimalDays:1},doi:{firstDay:7,weekend:[7],minimalDays:1},dsb:{firstDay:1,weekend:[6,7],minimalDays:4},dua:{firstDay:1,weekend:[6,7],minimalDays:1},dv:{firstDay:5,weekend:[6,7],minimalDays:1},dyo:{firstDay:1,weekend:[6,7],minimalDays:1},dz:{firstDay:7,weekend:[6,7],minimalDays:1},ebu:{firstDay:7,weekend:[6,7],minimalDays:1},ee:{firstDay:1,weekend:[6,7],minimalDays:1},"ee-TG":{firstDay:1,weekend:[6,7],minimalDays:1},el:{firstDay:1,weekend:[6,7],minimalDays:4},"el-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"el-polyton":{firstDay:1,weekend:[6,7],minimalDays:4},en:{firstDay:7,weekend:[6,7],minimalDays:1},"en-001":{firstDay:1,weekend:[6,7],minimalDays:1},"en-150":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"en-AG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"en-AU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BW":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"en-CK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DK":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-Dsrt":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FJ":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GB":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GD":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GG":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GU":{firstDay:7,weekend:[6,7],minimalDays:1},"en-GY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"en-IE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"en-IM":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IN":{firstDay:7,weekend:[7],minimalDays:1},"en-IO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-JE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-JM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MP":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MV":{firstDay:5,weekend:[6,7],minimalDays:1},"en-MW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NA":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NF":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NL":{firstDay:1,weekend:[6,7],minimalDays:4},"en-NR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"en-SE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-SH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-Shaw":{firstDay:1,weekend:[6,7],minimalDays:4},"en-TC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-TV":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-UG":{firstDay:1,weekend:[7],minimalDays:1},"en-UM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VI":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-WS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-ZW":{firstDay:7,weekend:[6,7],minimalDays:1},eo:{firstDay:1,weekend:[6,7],minimalDays:1},es:{firstDay:1,weekend:[6,7],minimalDays:4},"es-419":{firstDay:1,weekend:[6,7],minimalDays:1},"es-AR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CL":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CU":{firstDay:1,weekend:[6,7],minimalDays:1},"es-DO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-EA":{firstDay:1,weekend:[6,7],minimalDays:1},"es-EC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GT":{firstDay:7,weekend:[6,7],minimalDays:1},"es-HN":{firstDay:7,weekend:[6,7],minimalDays:1},"es-IC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-MX":{firstDay:7,weekend:[6,7],minimalDays:1},"es-NI":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PA":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PE":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PY":{firstDay:7,weekend:[6,7],minimalDays:1},"es-SV":{firstDay:7,weekend:[6,7],minimalDays:1},"es-US":{firstDay:7,weekend:[6,7],minimalDays:1},"es-UY":{firstDay:1,weekend:[6,7],minimalDays:1},"es-VE":{firstDay:7,weekend:[6,7],minimalDays:1},et:{firstDay:1,weekend:[6,7],minimalDays:4},eu:{firstDay:1,weekend:[6,7],minimalDays:4},ewo:{firstDay:1,weekend:[6,7],minimalDays:1},fa:{firstDay:6,weekend:[5],minimalDays:1},"fa-AF":{firstDay:6,weekend:[4,5],minimalDays:1},ff:{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-SL":{firstDay:1,weekend:[6,7],minimalDays:1},fi:{firstDay:1,weekend:[6,7],minimalDays:4},fil:{firstDay:7,weekend:[6,7],minimalDays:1},fo:{firstDay:1,weekend:[6,7],minimalDays:4},"fo-DK":{firstDay:1,weekend:[6,7],minimalDays:4},fr:{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BL":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"fr-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-CI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"fr-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-GA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GF":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GP":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-HT":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MC":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-ML":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MQ":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-RE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-WF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-YT":{firstDay:1,weekend:[6,7],minimalDays:1},frr:{firstDay:1,weekend:[6,7],minimalDays:4},fur:{firstDay:1,weekend:[6,7],minimalDays:4},fy:{firstDay:1,weekend:[6,7],minimalDays:4},ga:{firstDay:1,weekend:[6,7],minimalDays:4},"ga-GB":{firstDay:1,weekend:[6,7],minimalDays:4},gaa:{firstDay:1,weekend:[6,7],minimalDays:1},gd:{firstDay:1,weekend:[6,7],minimalDays:4},gez:{firstDay:7,weekend:[6,7],minimalDays:1},"gez-ER":{firstDay:1,weekend:[6,7],minimalDays:1},gl:{firstDay:1,weekend:[6,7],minimalDays:4},gn:{firstDay:7,weekend:[6,7],minimalDays:1},gsw:{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-LI":{firstDay:1,weekend:[6,7],minimalDays:4},gu:{firstDay:7,weekend:[7],minimalDays:1},guz:{firstDay:7,weekend:[6,7],minimalDays:1},gv:{firstDay:1,weekend:[6,7],minimalDays:4},ha:{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ha-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-NE":{firstDay:1,weekend:[6,7],minimalDays:1},haw:{firstDay:7,weekend:[6,7],minimalDays:1},he:{firstDay:7,weekend:[5,6],minimalDays:1},hi:{firstDay:7,weekend:[7],minimalDays:1},"hi-Latn":{firstDay:7,weekend:[7],minimalDays:1},hnj:{firstDay:7,weekend:[6,7],minimalDays:1},"hnj-Hmnp":{firstDay:7,weekend:[6,7],minimalDays:1},hr:{firstDay:1,weekend:[6,7],minimalDays:1},"hr-BA":{firstDay:1,weekend:[6,7],minimalDays:1},hsb:{firstDay:1,weekend:[6,7],minimalDays:4},hu:{firstDay:1,weekend:[6,7],minimalDays:4},hy:{firstDay:1,weekend:[6,7],minimalDays:1},ia:{firstDay:1,weekend:[6,7],minimalDays:1},id:{firstDay:7,weekend:[6,7],minimalDays:1},ie:{firstDay:1,weekend:[6,7],minimalDays:4},ig:{firstDay:1,weekend:[6,7],minimalDays:1},ii:{firstDay:1,weekend:[6,7],minimalDays:1},io:{firstDay:1,weekend:[6,7],minimalDays:1},is:{firstDay:1,weekend:[6,7],minimalDays:4},it:{firstDay:1,weekend:[6,7],minimalDays:4},"it-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"it-SM":{firstDay:1,weekend:[6,7],minimalDays:4},"it-VA":{firstDay:1,weekend:[6,7],minimalDays:4},iu:{firstDay:7,weekend:[6,7],minimalDays:1},"iu-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},ja:{firstDay:7,weekend:[6,7],minimalDays:1},jbo:{firstDay:1,weekend:[6,7],minimalDays:1},jgo:{firstDay:1,weekend:[6,7],minimalDays:1},jmc:{firstDay:1,weekend:[6,7],minimalDays:1},jv:{firstDay:7,weekend:[6,7],minimalDays:1},ka:{firstDay:1,weekend:[6,7],minimalDays:1},kab:{firstDay:6,weekend:[5,6],minimalDays:1},kaj:{firstDay:1,weekend:[6,7],minimalDays:1},kam:{firstDay:7,weekend:[6,7],minimalDays:1},kcg:{firstDay:1,weekend:[6,7],minimalDays:1},kde:{firstDay:1,weekend:[6,7],minimalDays:1},kea:{firstDay:1,weekend:[6,7],minimalDays:1},ken:{firstDay:1,weekend:[6,7],minimalDays:1},kgp:{firstDay:7,weekend:[6,7],minimalDays:1},khq:{firstDay:1,weekend:[6,7],minimalDays:1},ki:{firstDay:7,weekend:[6,7],minimalDays:1},kk:{firstDay:1,weekend:[6,7],minimalDays:1},kkj:{firstDay:1,weekend:[6,7],minimalDays:1},kl:{firstDay:1,weekend:[6,7],minimalDays:1},kln:{firstDay:7,weekend:[6,7],minimalDays:1},km:{firstDay:7,weekend:[6,7],minimalDays:1},kn:{firstDay:7,weekend:[7],minimalDays:1},ko:{firstDay:7,weekend:[6,7],minimalDays:1},"ko-CN":{firstDay:1,weekend:[6,7],minimalDays:1},"ko-KP":{firstDay:1,weekend:[6,7],minimalDays:1},kok:{firstDay:7,weekend:[7],minimalDays:1},kpe:{firstDay:1,weekend:[6,7],minimalDays:1},"kpe-GN":{firstDay:1,weekend:[6,7],minimalDays:1},ks:{firstDay:7,weekend:[7],minimalDays:1},"ks-Arab":{firstDay:7,weekend:[7],minimalDays:1},"ks-Deva":{firstDay:7,weekend:[7],minimalDays:1},ksb:{firstDay:1,weekend:[6,7],minimalDays:1},ksf:{firstDay:1,weekend:[6,7],minimalDays:1},ksh:{firstDay:1,weekend:[6,7],minimalDays:4},ku:{firstDay:1,weekend:[6,7],minimalDays:1},kw:{firstDay:1,weekend:[6,7],minimalDays:4},kxv:{firstDay:7,weekend:[7],minimalDays:1},"kxv-Deva":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Latn":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Orya":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Telu":{firstDay:7,weekend:[7],minimalDays:1},ky:{firstDay:1,weekend:[6,7],minimalDays:1},la:{firstDay:1,weekend:[6,7],minimalDays:4},lag:{firstDay:1,weekend:[6,7],minimalDays:1},lb:{firstDay:1,weekend:[6,7],minimalDays:4},lg:{firstDay:1,weekend:[7],minimalDays:1},lij:{firstDay:1,weekend:[6,7],minimalDays:4},lkt:{firstDay:7,weekend:[6,7],minimalDays:1},lmo:{firstDay:1,weekend:[6,7],minimalDays:4},ln:{firstDay:1,weekend:[6,7],minimalDays:1},"ln-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CG":{firstDay:1,weekend:[6,7],minimalDays:1},lo:{firstDay:7,weekend:[6,7],minimalDays:1},lrc:{firstDay:6,weekend:[5],minimalDays:1},"lrc-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},lt:{firstDay:1,weekend:[6,7],minimalDays:4},lu:{firstDay:1,weekend:[6,7],minimalDays:1},luo:{firstDay:7,weekend:[6,7],minimalDays:1},luy:{firstDay:7,weekend:[6,7],minimalDays:1},lv:{firstDay:1,weekend:[6,7],minimalDays:1},mai:{firstDay:7,weekend:[7],minimalDays:1},mas:{firstDay:7,weekend:[6,7],minimalDays:1},"mas-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},mdf:{firstDay:1,weekend:[6,7],minimalDays:4},mer:{firstDay:7,weekend:[6,7],minimalDays:1},mfe:{firstDay:1,weekend:[6,7],minimalDays:1},mg:{firstDay:1,weekend:[6,7],minimalDays:1},mgh:{firstDay:7,weekend:[6,7],minimalDays:1},mgo:{firstDay:1,weekend:[6,7],minimalDays:1},mi:{firstDay:1,weekend:[6,7],minimalDays:1},mic:{firstDay:7,weekend:[6,7],minimalDays:1},mk:{firstDay:1,weekend:[6,7],minimalDays:1},ml:{firstDay:7,weekend:[7],minimalDays:1},mn:{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong":{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong-MN":{firstDay:1,weekend:[6,7],minimalDays:1},mni:{firstDay:7,weekend:[7],minimalDays:1},"mni-Beng":{firstDay:7,weekend:[7],minimalDays:1},"mni-Mtei":{firstDay:7,weekend:[7],minimalDays:1},moh:{firstDay:7,weekend:[6,7],minimalDays:1},mr:{firstDay:7,weekend:[7],minimalDays:1},ms:{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"ms-SG":{firstDay:7,weekend:[6,7],minimalDays:1},mt:{firstDay:7,weekend:[6,7],minimalDays:1},mua:{firstDay:1,weekend:[6,7],minimalDays:1},mus:{firstDay:7,weekend:[6,7],minimalDays:1},my:{firstDay:7,weekend:[6,7],minimalDays:1},myv:{firstDay:1,weekend:[6,7],minimalDays:4},mzn:{firstDay:6,weekend:[5],minimalDays:1},naq:{firstDay:1,weekend:[6,7],minimalDays:1},nb:{firstDay:1,weekend:[6,7],minimalDays:4},"nb-SJ":{firstDay:1,weekend:[6,7],minimalDays:4},nd:{firstDay:7,weekend:[6,7],minimalDays:1},nds:{firstDay:1,weekend:[6,7],minimalDays:4},"nds-NL":{firstDay:1,weekend:[6,7],minimalDays:4},ne:{firstDay:7,weekend:[6,7],minimalDays:1},"ne-IN":{firstDay:7,weekend:[7],minimalDays:1},nl:{firstDay:1,weekend:[6,7],minimalDays:4},"nl-AW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"nl-BQ":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-CW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SR":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SX":{firstDay:1,weekend:[6,7],minimalDays:1},nmg:{firstDay:1,weekend:[6,7],minimalDays:1},nn:{firstDay:1,weekend:[6,7],minimalDays:4},nnh:{firstDay:1,weekend:[6,7],minimalDays:1},no:{firstDay:1,weekend:[6,7],minimalDays:4},nqo:{firstDay:1,weekend:[6,7],minimalDays:1},nr:{firstDay:7,weekend:[6,7],minimalDays:1},nso:{firstDay:7,weekend:[6,7],minimalDays:1},nus:{firstDay:1,weekend:[6,7],minimalDays:1},nv:{firstDay:7,weekend:[6,7],minimalDays:1},ny:{firstDay:1,weekend:[6,7],minimalDays:1},nyn:{firstDay:1,weekend:[7],minimalDays:1},oc:{firstDay:1,weekend:[6,7],minimalDays:4},"oc-ES":{firstDay:1,weekend:[6,7],minimalDays:4},om:{firstDay:7,weekend:[6,7],minimalDays:1},"om-KE":{firstDay:7,weekend:[6,7],minimalDays:1},or:{firstDay:7,weekend:[7],minimalDays:1},os:{firstDay:1,weekend:[6,7],minimalDays:1},"os-RU":{firstDay:1,weekend:[6,7],minimalDays:4},osa:{firstDay:7,weekend:[6,7],minimalDays:1},pa:{firstDay:7,weekend:[7],minimalDays:1},"pa-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"pa-Guru":{firstDay:7,weekend:[7],minimalDays:1},pap:{firstDay:1,weekend:[6,7],minimalDays:1},"pap-AW":{firstDay:1,weekend:[6,7],minimalDays:1},pcm:{firstDay:1,weekend:[6,7],minimalDays:1},pis:{firstDay:1,weekend:[6,7],minimalDays:1},pl:{firstDay:1,weekend:[6,7],minimalDays:4},prg:{firstDay:1,weekend:[6,7],minimalDays:4},ps:{firstDay:6,weekend:[4,5],minimalDays:1},"ps-PK":{firstDay:7,weekend:[6,7],minimalDays:1},pt:{firstDay:7,weekend:[6,7],minimalDays:1},"pt-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-CV":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-MZ":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-PT":{firstDay:7,weekend:[6,7],minimalDays:4},"pt-ST":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-TL":{firstDay:1,weekend:[6,7],minimalDays:1},qu:{firstDay:7,weekend:[6,7],minimalDays:1},"qu-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"qu-EC":{firstDay:1,weekend:[6,7],minimalDays:1},quc:{firstDay:7,weekend:[6,7],minimalDays:1},raj:{firstDay:7,weekend:[7],minimalDays:1},rhg:{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg":{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg-BD":{firstDay:7,weekend:[6,7],minimalDays:1},rif:{firstDay:1,weekend:[6,7],minimalDays:1},rm:{firstDay:1,weekend:[6,7],minimalDays:4},rn:{firstDay:1,weekend:[6,7],minimalDays:1},ro:{firstDay:1,weekend:[6,7],minimalDays:1},"ro-MD":{firstDay:1,weekend:[6,7],minimalDays:1},rof:{firstDay:1,weekend:[6,7],minimalDays:1},ru:{firstDay:1,weekend:[6,7],minimalDays:4},"ru-BY":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KG":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KZ":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-MD":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-UA":{firstDay:1,weekend:[6,7],minimalDays:1},rw:{firstDay:1,weekend:[6,7],minimalDays:1},rwk:{firstDay:1,weekend:[6,7],minimalDays:1},sa:{firstDay:7,weekend:[7],minimalDays:1},sah:{firstDay:1,weekend:[6,7],minimalDays:4},saq:{firstDay:7,weekend:[6,7],minimalDays:1},sat:{firstDay:7,weekend:[7],minimalDays:1},"sat-Deva":{firstDay:7,weekend:[7],minimalDays:1},"sat-Olck":{firstDay:7,weekend:[7],minimalDays:1},sbp:{firstDay:1,weekend:[6,7],minimalDays:1},sc:{firstDay:1,weekend:[6,7],minimalDays:4},scn:{firstDay:1,weekend:[6,7],minimalDays:4},sd:{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Deva":{firstDay:7,weekend:[7],minimalDays:1},sdh:{firstDay:6,weekend:[5],minimalDays:1},"sdh-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},se:{firstDay:1,weekend:[6,7],minimalDays:4},"se-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"se-SE":{firstDay:1,weekend:[6,7],minimalDays:4},seh:{firstDay:7,weekend:[6,7],minimalDays:1},ses:{firstDay:1,weekend:[6,7],minimalDays:1},sg:{firstDay:1,weekend:[6,7],minimalDays:1},shi:{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Tfng":{firstDay:1,weekend:[6,7],minimalDays:1},shn:{firstDay:7,weekend:[6,7],minimalDays:1},"shn-TH":{firstDay:7,weekend:[6,7],minimalDays:1},si:{firstDay:1,weekend:[6,7],minimalDays:1},sid:{firstDay:7,weekend:[6,7],minimalDays:1},sk:{firstDay:1,weekend:[6,7],minimalDays:4},skr:{firstDay:7,weekend:[6,7],minimalDays:1},sl:{firstDay:1,weekend:[6,7],minimalDays:1},sma:{firstDay:1,weekend:[6,7],minimalDays:4},"sma-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smj:{firstDay:1,weekend:[6,7],minimalDays:4},"smj-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smn:{firstDay:1,weekend:[6,7],minimalDays:4},sms:{firstDay:1,weekend:[6,7],minimalDays:4},sn:{firstDay:7,weekend:[6,7],minimalDays:1},so:{firstDay:1,weekend:[6,7],minimalDays:1},"so-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"so-ET":{firstDay:7,weekend:[6,7],minimalDays:1},"so-KE":{firstDay:7,weekend:[6,7],minimalDays:1},sq:{firstDay:1,weekend:[6,7],minimalDays:1},"sq-MK":{firstDay:1,weekend:[6,7],minimalDays:1},"sq-XK":{firstDay:1,weekend:[6,7],minimalDays:1},sr:{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-XK":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-XK":{firstDay:1,weekend:[6,7],minimalDays:1},ss:{firstDay:7,weekend:[6,7],minimalDays:1},"ss-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},ssy:{firstDay:1,weekend:[6,7],minimalDays:1},st:{firstDay:7,weekend:[6,7],minimalDays:1},"st-LS":{firstDay:1,weekend:[6,7],minimalDays:1},su:{firstDay:7,weekend:[6,7],minimalDays:1},"su-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},sv:{firstDay:1,weekend:[6,7],minimalDays:4},"sv-AX":{firstDay:1,weekend:[6,7],minimalDays:4},"sv-FI":{firstDay:1,weekend:[6,7],minimalDays:4},sw:{firstDay:1,weekend:[6,7],minimalDays:1},"sw-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"sw-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"sw-UG":{firstDay:1,weekend:[7],minimalDays:1},syr:{firstDay:6,weekend:[5,6],minimalDays:1},"syr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},szl:{firstDay:1,weekend:[6,7],minimalDays:4},ta:{firstDay:7,weekend:[7],minimalDays:1},"ta-LK":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-SG":{firstDay:7,weekend:[6,7],minimalDays:1},te:{firstDay:7,weekend:[7],minimalDays:1},teo:{firstDay:1,weekend:[7],minimalDays:1},"teo-KE":{firstDay:7,weekend:[6,7],minimalDays:1},tg:{firstDay:1,weekend:[6,7],minimalDays:1},th:{firstDay:7,weekend:[6,7],minimalDays:1},ti:{firstDay:7,weekend:[6,7],minimalDays:1},"ti-ER":{firstDay:1,weekend:[6,7],minimalDays:1},tig:{firstDay:1,weekend:[6,7],minimalDays:1},tk:{firstDay:1,weekend:[6,7],minimalDays:1},tn:{firstDay:7,weekend:[6,7],minimalDays:1},"tn-BW":{firstDay:7,weekend:[6,7],minimalDays:1},to:{firstDay:1,weekend:[6,7],minimalDays:1},tok:{firstDay:1,weekend:[6,7],minimalDays:1},tpi:{firstDay:1,weekend:[6,7],minimalDays:1},tr:{firstDay:1,weekend:[6,7],minimalDays:1},"tr-CY":{firstDay:1,weekend:[6,7],minimalDays:1},trv:{firstDay:7,weekend:[6,7],minimalDays:1},trw:{firstDay:7,weekend:[6,7],minimalDays:1},ts:{firstDay:7,weekend:[6,7],minimalDays:1},tt:{firstDay:1,weekend:[6,7],minimalDays:4},twq:{firstDay:1,weekend:[6,7],minimalDays:1},tyv:{firstDay:1,weekend:[6,7],minimalDays:4},tzm:{firstDay:1,weekend:[6,7],minimalDays:1},ug:{firstDay:1,weekend:[6,7],minimalDays:1},uk:{firstDay:1,weekend:[6,7],minimalDays:1},und:{firstDay:7,weekend:[6,7],minimalDays:1},ur:{firstDay:7,weekend:[6,7],minimalDays:1},"ur-IN":{firstDay:7,weekend:[7],minimalDays:1},uz:{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Arab":{firstDay:6,weekend:[4,5],minimalDays:1},"uz-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},vai:{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Vaii":{firstDay:1,weekend:[6,7],minimalDays:1},ve:{firstDay:7,weekend:[6,7],minimalDays:1},vec:{firstDay:1,weekend:[6,7],minimalDays:4},vi:{firstDay:1,weekend:[6,7],minimalDays:1},vmw:{firstDay:7,weekend:[6,7],minimalDays:1},vo:{firstDay:1,weekend:[6,7],minimalDays:1},vun:{firstDay:1,weekend:[6,7],minimalDays:1},wa:{firstDay:1,weekend:[6,7],minimalDays:4},wae:{firstDay:1,weekend:[6,7],minimalDays:4},wal:{firstDay:7,weekend:[6,7],minimalDays:1},wbp:{firstDay:1,weekend:[6,7],minimalDays:1},wo:{firstDay:1,weekend:[6,7],minimalDays:1},xh:{firstDay:7,weekend:[6,7],minimalDays:1},xnr:{firstDay:7,weekend:[7],minimalDays:1},xog:{firstDay:1,weekend:[7],minimalDays:1},yav:{firstDay:1,weekend:[6,7],minimalDays:1},yi:{firstDay:1,weekend:[6,7],minimalDays:1},yo:{firstDay:1,weekend:[6,7],minimalDays:1},"yo-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},yrl:{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-VE":{firstDay:7,weekend:[6,7],minimalDays:1},yue:{firstDay:7,weekend:[6,7],minimalDays:1},"yue-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"yue-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},za:{firstDay:1,weekend:[6,7],minimalDays:1},zgh:{firstDay:1,weekend:[6,7],minimalDays:1},zh:{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-MO":{firstDay:7,weekend:[6,7],minimalDays:1},zu:{firstDay:7,weekend:[6,7],minimalDays:1}},fn="Invalid date: day is greater than the maximum valid day for the month and year.",nm="Invalid date: date is before the minimum allowed date.",om="Invalid date: date is after the maximum allowed date.",Tt="Invalid date: date is within a disabled range.",vn="Invalid time: time is before the minimum allowed time.",Dn="Invalid time: time is after the maximum allowed time.",lm="Invalid range: end time must be after start time.",Hi="Invalid time: time is within a disabled range.",dm="Invalid date-time: date-time is before the minimum allowed date-time.",um="Invalid date-time: date-time is after the maximum allowed date-time.";function ie(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${a}`}function ae(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3])):new Date(e)}function Wi(e,t,i,a){const r=e.split("T")[0];if(t&&r<t.split("T")[0]||i&&r>i.split("T")[0])return!0;if(a&&a.length>0)for(const s of a){const o=s.start.split("T")[0],l=s.end?s.end.split("T")[0]:o;if(r>=o&&r<=l)return!0}return!1}function Zt(e,t,i,a,r){const s=e.split("T")[0];return t&&s<t.split("T")[0]?r?.minDateMessage??nm:i&&s>i.split("T")[0]?r?.maxDateMessage??om:Wi(s,void 0,void 0,a)?r?.disabledDateRangeMessage??Tt:null}function wn(e,t,i,a,r){const s=ae(e),o=ae(t);if(isNaN(s.getTime())||isNaN(o.getTime()))return!1;const l=new Date(s);l.setHours(0,0,0,0);const u=new Date(o);for(u.setHours(0,0,0,0);l<=u;){if(Wi(ie(l),a,r,i))return!0;l.setDate(l.getDate()+1)}return!1}function $n(e){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date)}function kn(e,t){return e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31}function vr(e){return mt(e,new Date)}function mt(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function pm(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function Tn(e){const t=e??"en",i=bn[t]||bn[t.split("-")[0]]||{firstDay:0};return pm(i.firstDay)}function hm(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return Tn(e).map(a=>{const r=new Date(i);return r.setDate(i.getDate()+a),t.format(r)})}function Sn(e,t){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Ki(e,t){return new Intl.DateTimeFormat(e,{dateStyle:"full"}).format(t)}function Dr(e,t,i){for(let a=0;a<i;a++){const r=new Date(t.getFullYear(),t.getMonth()+a,1);if(e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear())return!0}return!1}function cm(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(r=>r.type==="month"||r.type==="year")}function wr(e,t){const i=e||"en-US",s=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(o=>o.type==="day");return s?s.value:t.getDate().toString()}function _n(e,t){const i=ie(e),a=ie(t);return i===a?{start:i}:{start:i,end:a}}function An(e){return e.length?e.map(a=>({start:ae(a.start).getTime(),end:ae(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start).reduce((a,r)=>{const s=a[a.length-1];if(s){const o=new Date(s.end);if(o.setDate(o.getDate()+1),r.start<=o.getTime())return s.end=Math.max(s.end,r.end),a}return[...a,r]},[]).map(a=>_n(new Date(a.start),new Date(a.end))):[]}class Ji{constructor(t,i){this._currentDate=new Date,this._yearSelectorOpen=!1,this.host=t,this.options=i,t.addController(this)}hostConnected(){}get currentDate(){return this._currentDate}set currentDate(t){Object.is(t,this._currentDate)||(this._currentDate=t,this.host.requestUpdate())}get yearSelectorOpen(){return this._yearSelectorOpen}set yearSelectorOpen(t){Object.is(t,this._yearSelectorOpen)||(this._yearSelectorOpen=t,this.host.requestUpdate())}prevMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()-1,1)}nextMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()+1,1)}canGoPrev(){const t=this.options.getMinDate();if(!t)return!0;const i=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth(),0);return ie(i)>=t}canGoNext(){const t=this.options.getMaxDate();if(!t)return!0;const i=(this.options.getNumberOfMonths()??1)-1,a=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth()+i+1,1);return ie(a)<=t}get effectiveMinYear(){const t=this.options.getMinDate();return t?ae(t).getFullYear():1900}get effectiveMaxYear(){const t=this.options.getMaxDate();return t?ae(t).getFullYear():2099}get yearList(){const t=[];for(let i=this.effectiveMinYear;i<=this.effectiveMaxYear;i++)t.push(i);return t}toggleYearSelector(){this.yearSelectorOpen=!this._yearSelectorOpen,this.options.onYearSelectorToggled?.()}selectYear(t){this.currentDate=new Date(t,this._currentDate.getMonth(),1),this.yearSelectorOpen=!1}closeYearSelector(){this.yearSelectorOpen=!1}navigateToDate(t){!isNaN(t.getTime())&&!Dr(t,this._currentDate,this.options.getNumberOfMonths()??1)&&(this.currentDate=t)}isDisabled(t){return Wi(ie(t),this.options.getMinDate(),this.options.getMaxDate(),this.options.getDisabledRanges())}}const Xi=e=>e?d.html`<span aria-hidden="true"> *</span>`:d.nothing,oe=(e,t,i=!1,a=void 0,r=!0)=>r?t.label?d.html`<label
|
|
42
34
|
class="gui-label"
|
|
43
35
|
for=${e}
|
|
44
36
|
data-cy=${`${e}_label`}
|
|
45
37
|
id=${a?`${e}_${a}_label`:`${e}_label`}
|
|
46
38
|
>
|
|
47
|
-
|
|
39
|
+
<span class="gui-label__text"
|
|
40
|
+
>${t.label}${Xi(t.required)}</span
|
|
41
|
+
>
|
|
48
42
|
${En(e,t)} ${i?j(e,t):d.nothing}
|
|
49
43
|
</label>`:d.nothing:t.label?d.html`<span
|
|
50
44
|
class="gui-label"
|
|
51
45
|
data-cy=${`${e}_label`}
|
|
52
46
|
id=${a?`${e}_${a}_label`:`${e}_label`}
|
|
53
47
|
>
|
|
54
|
-
|
|
48
|
+
<span class="gui-label__text"
|
|
49
|
+
>${t.label}${Xi(t.required)}</span
|
|
50
|
+
>
|
|
55
51
|
${En(e,t)} ${i?j(e,t):d.nothing}
|
|
56
52
|
</span>`:d.nothing,En=(e,t)=>t.hint?d.html`<div class="gui-widget-hint" id=${`${e}_hint`}>${t.hint}</div>`:d.html``,Qe=(e,t)=>{const i={[`gui-${e}--icon`]:!1,[`gui-${e}--icon-right`]:!1};if(t.icon){i[`gui-${e}--icon`]=!0;const a={"gui-widget-icon":!0,[t.icon]:!0};return{widgetClasses:i,html:d.html`<span
|
|
57
53
|
class=${S.classMap(a)}
|
|
@@ -67,7 +63,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
67
63
|
${r}
|
|
68
64
|
</li>`):d.nothing}
|
|
69
65
|
</ul>`};function $r(e,t){const i=new Date(e);return i.setDate(1),i.setMonth(i.getMonth()+t),i}function Qi(e){const t={uid:e.uid,label:e.label,hint:e.hint,errors:e.errors,touched:e.touched,required:e.required},i=Array.from({length:e.numberOfMonths??1},(r,s)=>s),a=i.map(r=>Sn(e.localeId,$r(e.currentDate,r))).join(", ");return d.html`
|
|
70
|
-
${e.label?
|
|
66
|
+
${e.label?oe(e.uid,t,!1,"calendar"):d.nothing}
|
|
71
67
|
|
|
72
68
|
<div class="gui-widget" @focusout=${e.onFocusOut}>
|
|
73
69
|
<div
|
|
@@ -208,7 +204,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
208
204
|
</div>
|
|
209
205
|
`)}
|
|
210
206
|
</div>
|
|
211
|
-
`}function ta(e,t){const i=e.getTime();let a=!1,r=!1,s=!1,o=!1,l=!1,u=!1,p=!1,h=!1;if(t.selectedISO&&(a=
|
|
207
|
+
`}function ta(e,t){const i=e.getTime();let a=!1,r=!1,s=!1,o=!1,l=!1,u=!1,p=!1,h=!1;if(t.selectedISO&&(a=mt(e,ae(t.selectedISO))),t.invalidRange){const c=t.invalidRange.start,y=t.invalidRange.end;u=mt(e,c),p=mt(e,y),i>c.getTime()&&i<y.getTime()&&(h=!0)}if(t.selectingSpan&&(l=i>=t.selectingSpan.start.getTime()&&i<=t.selectingSpan.end.getTime()),t.ranges)for(const c of t.ranges)mt(e,c.start)&&(r=!0,s=!c.end),c.end&&(mt(e,c.end)&&(s=!0),i>c.start.getTime()&&i<c.end.getTime()&&(o=!0));if(t.workingRange){const{start:c,end:y}=t.workingRange;mt(e,c)&&(r=!0),mt(e,y)&&(s=!0),i>c.getTime()&&i<y.getTime()&&(o=!0)}return{isSelected:a,isRangeStart:r,isRangeEnd:s,isInRange:o,isOneDayRange:r&&s,isAnchor:t.anchor?mt(e,t.anchor):!1,isSelecting:l,isInvalidStart:u,isInvalidEnd:p,isInvalidInRange:h}}function ia(e){const{currentDate:t,offset:i=0,localeId:a,numberOfMonths:r=1}=e,s=new Date(t.getFullYear(),t.getMonth()+i,1),o=s.getMonth(),l=s.getDay(),u=Tn(a)[0],p=(l-u+7)%7,h=new Date(s);h.setDate(s.getDate()-p);let c=[];for(let y=0;y<42;y++){const g=new Date(h);g.setDate(h.getDate()+y),c.push(e.toDay({date:g,dayLabel:wr(a,g),isCurrentMonth:g.getMonth()===o,isToday:vr(g),isDisabled:e.isDisabled(g)}))}for(let y=0;y<2;y++)c.slice(-7).every(_=>!_.isCurrentMonth)&&(c=c.slice(0,-7));if(i===0&&!c.some(y=>y.isFocusable)&&!(e.focusFallbackDates??[]).some(g=>Dr(g,t,r))){const g=c.find(_=>_.isCurrentMonth&&!_.isDisabled);g&&(g.isFocusable=!0)}return c}var fm=Object.defineProperty,vm=Object.getOwnPropertyDescriptor,se=(e,t,i,a)=>{for(var r=a>1?void 0:a?vm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&fm(t,i,r),r};let re=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=void 0,this._nav=new Ji(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Yi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:e=>{const t=ae(e);this.selectDate({date:t,dayLabel:wr(this.localeId,t),isCurrentMonth:!0,isToday:vr(t),isSelected:!1,isFocusable:!0,isDisabled:this.isDisabled(t)})},onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Vt(this,{onLeave:()=>{this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}})}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&this.value&&this._nav.navigateToDate(ae(this.value))}render(){return Qi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>d.nothing,renderMonthPanel:e=>ji({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this._nav.toggleYearSelector(),renderPanelBody:t=>this.renderPanelBody(t)})})}renderPanelBody(e){return ea({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,selected:e.isSelected,disabled:e.isDisabled,"other-month":!e.isCurrentMonth};return d.html`
|
|
212
208
|
<button
|
|
213
209
|
type="button"
|
|
214
210
|
role="gridcell"
|
|
@@ -218,14 +214,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
218
214
|
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
219
215
|
aria-label=${Ki(this.localeId,e.date)}
|
|
220
216
|
aria-current=${e.isToday?"date":d.nothing}
|
|
221
|
-
data-date=${
|
|
217
|
+
data-date=${ie(e.date)}
|
|
222
218
|
@click=${()=>this.selectDate(e)}
|
|
223
219
|
@keydown=${i=>this._keyboard.handleDayKeydown(i)}
|
|
224
220
|
aria-selected=${e.isSelected}
|
|
225
221
|
>
|
|
226
222
|
${e.dayLabel}
|
|
227
223
|
</button>
|
|
228
|
-
`}getDaysInMonth(e){const t=this.value;return ia({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=ta(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?
|
|
224
|
+
`}getDaysInMonth(e){const t=this.value;return ia({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=ta(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?ae(t):new Date]})}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=ie(e.date);this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t},bubbles:!0,composed:!0}))}isDisabled(e){return this._nav.isDisabled(e)}};se([n.property({type:String})],re.prototype,"uid",2),se([n.property({type:String})],re.prototype,"label",2),se([n.property({type:String})],re.prototype,"hint",2),se([n.property({type:String,attribute:"locale-id"})],re.prototype,"localeId",2),se([n.property({type:Array})],re.prototype,"errors",2),se([n.property({type:Boolean})],re.prototype,"touched",2),se([n.property({type:Boolean})],re.prototype,"required",2),se([n.property({type:Boolean})],re.prototype,"disabled",2),se([n.property({type:Boolean,attribute:"readonly"})],re.prototype,"readOnly",2),se([n.property({type:String,attribute:"prev-month-icon"})],re.prototype,"prevMonthIcon",2),se([n.property({type:String,attribute:"next-month-icon"})],re.prototype,"nextMonthIcon",2),se([n.property({type:String,attribute:"prev-month-aria-label"})],re.prototype,"prevMonthAriaLabel",2),se([n.property({type:String,attribute:"next-month-aria-label"})],re.prototype,"nextMonthAriaLabel",2),se([n.property({type:String,attribute:"select-year-aria-label"})],re.prototype,"selectYearAriaLabel",2),se([n.property({type:String,attribute:"year-grid-aria-label"})],re.prototype,"yearGridAriaLabel",2),se([n.property({type:String})],re.prototype,"dayFormat",2),se([n.property({type:String})],re.prototype,"weekdayFormat",2),se([n.property({type:String})],re.prototype,"monthFormat",2),se([n.property({type:String})],re.prototype,"minDate",2),se([n.property({type:String})],re.prototype,"maxDate",2),se([n.property({type:Array})],re.prototype,"disabledRanges",2),se([n.property({type:Number})],re.prototype,"numberOfMonths",2),se([n.property({type:String})],re.prototype,"value",2),re=se([n.customElement("gui-calendar")],re),typeof customElements<"u"&&!customElements.get("gui-calendar")&&customElements.define("gui-calendar",re);var Dm=Object.defineProperty,wm=Object.getOwnPropertyDescriptor,kr=(e,t,i,a)=>{for(var r=a>1?void 0:a?wm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Dm(t,i,r),r};let Yt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
229
225
|
<gui-calendar
|
|
230
226
|
.uid=${this.widget.uid}
|
|
231
227
|
.label=${this.adapter.templateData.label}
|
|
@@ -253,7 +249,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
253
249
|
@change=${this.valueChanged}
|
|
254
250
|
@blur=${()=>this.adapter.onBlur()}
|
|
255
251
|
></gui-calendar>
|
|
256
|
-
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};kr([f.consume({context:m.formContext}),n.property({attribute:!1})],Ht.prototype,"formContext",2),kr([f.provide({context:m.inputContext})],Ht.prototype,"adapter",2),Ht=kr([n.customElement("gui-calendar-input")],Ht);const $m=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return Ht}},Symbol.toStringTag,{value:"Module"})),Ln=new Date(2025,0,15,9,5,0);function aa(e,t){if(t==="12"||t==="24")return t;const{hourCycle:i}=new Intl.DateTimeFormat(e??"en",{hour:"numeric"}).resolvedOptions();return i==="h11"||i==="h12"?"12":"24"}function In(e,t){return new Intl.DateTimeFormat(e??"en",{hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Ln)}function xn(e,t){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Ln)}function km(e){const t=new Intl.DateTimeFormat(e??"en",{hour:"numeric",hourCycle:"h12"}),i=a=>t.formatToParts(new Date(2025,0,15,a,0,0)).find(r=>r.type==="dayPeriod")?.value??"";return{am:i(9)||"AM",pm:i(21)||"PM"}}function Tr(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),r=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");return`${t}-${i}-${a}T${r}:${s}:${o}`}function gt(e){const t=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return`${t}:${i}:${a}`}function ra(e){const t=/^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?$/.exec(e);return t?{hours:Number(t[1]),minutes:Number(t[2]),seconds:Number(t[3]??0)}:null}function ee(e){const t=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(e)}const Tm="No available times";function Re(e,t){const i=s=>s.length===5?`${s}:00`:s,a=i(e),r=i(t);return a<r?-1:a>r?1:0}function Pn(e,t){const i=ra(e);if(!i)return;const a=i.hours*60+i.minutes+(t||30);if(!(a>=1440))return gt(new Date(1970,0,1,Math.floor(a/60),a%60,0))}function Mn(e,t){if(!e?.length)return[];const i=re(t).getDay();return e.filter(a=>(a.date==null||a.date===t)&&(a.weekdays==null||a.weekdays.includes(i))).map(({start:a,end:r})=>({start:a,end:r}))}function sa(e,t){return t?.length?t.some(i=>Re(e,i.start)>=0&&Re(e,i.end??i.start)<=0):!1}function On(e,t,i){if(!i?.length)return!1;const a=t??e;return i.some(r=>{const s=r.end??r.start;return Re(e,s)<=0&&Re(r.start,a)<=0})}function Rn(e){return e.length===5?`${e}:00`:e}function Sm(e){if(!e.length)return[];const t=e.map(a=>({start:Rn(a.start),end:Rn(a.end??a.start)})).sort((a,r)=>Re(a.start,r.start)),i=[];for(const a of t){const r=i[i.length-1];r&&Re(a.start,r.end)<=0?Re(a.end,r.end)>0&&(r.end=a.end):i.push({...a})}return i}function Fn(e,t){return ee(e).getTime()<=ee(t).getTime()?{start:e,end:t}:{start:t,end:e}}function Bn(e){if(!e.length)return[];const t=e.map(a=>({start:ee(a.start).getTime(),end:ee(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start),i=[];for(const a of t){const r=i[i.length-1];r&&a.start<=r.end?a.end>r.end&&(r.end=a.end):i.push({start:a.start,end:a.end})}return i.map(a=>({start:Tr(new Date(a.start)),end:Tr(new Date(a.end))}))}function Nn(e,t){if(!t?.length)return!1;const i=ee(e.start).getTime(),a=ee(e.end??e.start).getTime();return t.some(r=>{const s=ee(r.start).getTime(),o=ee(r.end??r.start).getTime();return i<o&&s<a})}function _m(e,t){if(!t?.length)return!1;const i=ee(`${e}T00:00:00`).getTime(),a=ee(`${e}T23:59:59`).getTime();return t.some(r=>{const s=ee(r.start).getTime(),o=ee(r.end??r.start).getTime();return s<=i&&o>=a})}function Sr(e,t){if(!e?.length)return[];const i=ee(`${t}T00:00:00`).getTime(),a=ee(`${t}T23:59:59`).getTime(),r=[];for(const s of e){const o=ee(s.start).getTime(),l=ee(s.end??s.start).getTime();if(l<i||o>a)continue;const u=o<=i?"00:00:00":gt(new Date(o)),p=l>=a?"23:59:59":gt(new Date(l));r.push({start:u,end:p})}return r}function qn(e){const t=e.minuteStep||30,i=ra(e.minTime??"")??{hours:0,minutes:0,seconds:0},a=gt(new Date(1970,0,1,i.hours,i.minutes,i.seconds)),r=e.maxTime??"23:59:59",s=[];for(let o=i.hours*60+i.minutes;o<1440;o+=t){const l=gt(new Date(1970,0,1,Math.floor(o/60),o%60,0));if(Re(l,r)>0)break;Re(l,a)<0||s.push({value:l,disabled:sa(l,e.disabledRanges)})}return s}function na(e,t,i){const a=ra(e);return a?new Intl.DateTimeFormat(t??"en",{hour:"numeric",minute:"numeric",hourCycle:i==="12"?"h12":"h23"}).format(new Date(2025,0,15,a.hours,a.minutes,a.seconds)):e}function _r(e,t,i){const a=ee(e);return isNaN(a.getTime())?e:new Intl.DateTimeFormat(t??"en",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:i==="12"}).format(a)}function zn(e,t,i,a){const r=ee(e).getTime();if(isNaN(r))return null;if(t){const s=ee(t);if(!isNaN(s.getTime())&&r<s.getTime())return a?.minDateTimeMessage??dm}if(i){const s=ee(i);if(!isNaN(s.getTime())&&r>s.getTime())return a?.maxDateTimeMessage??um}return null}function Un(e,t){const i=e%12;return t==="pm"?i+12:i}function Am(e){const t=e>=12?"pm":"am";return{hour12:e%12===0?12:e%12,period:t}}const _t={day:"Day",month:"Month",year:"Year",hour:"Hour",minute:"Minute",second:"Second",dayPeriod:"AM/PM"};function Ar(){return{day:{type:"day",kind:"numeric",maxLength:2,min:1,max:31,placeholder:"dd"},month:{type:"month",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"mm"},year:{type:"year",kind:"numeric",maxLength:4,min:1e3,max:9999,placeholder:"yyyy"}}}function Em(e,t,i){return{hour:e==="12"?{type:"hour",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"hh"}:{type:"hour",kind:"numeric",maxLength:2,min:0,max:23,placeholder:"hh",incrementFallback:0},minute:{type:"minute",kind:"numeric",maxLength:2,min:0,max:59,placeholder:"mm",step:t,incrementFallback:0,wrap:!0},dayPeriod:{type:"dayPeriod",kind:"dayPeriod",maxLength:8,min:0,max:0,placeholder:i}}}function Gn(e,t,i){return e[t]?.[i]??""}function Vn(e,t,i,a){return{...e,[t]:{...e[t],[i]:a}}}function Cm(e,t){return{...e,[t]:{}}}function Lm(e,t,i){if(i!=="12")return e;let a=e;for(const r of t)Gn(a,r,"dayPeriod")||(a=Vn(a,r,"dayPeriod","am"));return a}function Im(e,t){if(isNaN(t))return{value:t};if(!e)return{value:t};const i=Math.max(e.min,Math.min(e.max,t));return i===t?{value:t}:{value:i,writeBack:i.toString().padStart(e.maxLength??2,"0")}}function pt(e,t,i,a){const r=parseInt(e[i]??"",10),{value:s,writeBack:o}=Im(t[i],r);return o!==void 0&&(a[i]=o),s}function Zn(e,t){const i={},a=pt(e,t.descriptors,"year",i),r=pt(e,t.descriptors,"month",i),s=pt(e,t.descriptors,"day",i),o=!isNaN(a)&&String(a).length===4,l=!isNaN(r)&&r>0,u=!isNaN(s)&&s>0;if(!(o&&l&&u))return{result:{kind:"incomplete"},writeBacks:i};if(s>kn(r,a))return{result:{kind:"invalid",message:t.invalidDateMessage??fn},writeBacks:i};const p=new Date(a,r-1,s);return{result:{kind:"valid",iso:ae(p),instant:p},writeBacks:i}}function Yn(e,t){const i=t.hourFormat==="12",a={},r=pt(e,t.descriptors,"hour",a),s=pt(e,t.descriptors,"minute",a),o=e.dayPeriod??"";if(isNaN(r)||isNaN(s))return{result:{kind:"incomplete"},writeBacks:a};if(i&&o!=="am"&&o!=="pm")return{result:{kind:"incomplete"},writeBacks:a};const l=i?Un(r,o):r,u=new Date(1970,0,1,l,s,0);return{result:{kind:"valid",iso:gt(u),instant:u},writeBacks:a}}function Hn(e,t){const i=t.hourFormat==="12",a={},r=pt(e,t.descriptors,"year",a),s=pt(e,t.descriptors,"month",a),o=pt(e,t.descriptors,"day",a),l=pt(e,t.descriptors,"hour",a),u=pt(e,t.descriptors,"minute",a),p=e.dayPeriod??"",h=!isNaN(r)&&String(r).length===4,c=!isNaN(s)&&s>0,y=!isNaN(o)&&o>0,g=!isNaN(l),_=!isNaN(u);if(!(h&&c&&y&&g&&_&&(!i||p==="am"||p==="pm")))return{result:{kind:"incomplete"},writeBacks:a};if(o>kn(s,r))return{result:{kind:"invalid",message:t.invalidDateMessage??fn},writeBacks:a};const Ae=i?Un(l,p):l,nt=new Date(r,s-1,o,Ae,u,0);return{result:{kind:"valid",iso:Tr(nt),instant:nt},writeBacks:a}}function oa(e,t){return t.minTime&&Re(e,t.minTime)<0?t.minTimeMessage??vn:t.maxTime&&Re(e,t.maxTime)>0?t.maxTimeMessage??Dn:null}const xm=["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"];function Wn(e){return/^[0-9]$/.test(e)}function Pm(e,t){return xm.includes(e.key)||e.ctrlKey||e.metaKey||t?!1:!Wn(e.key)}function Mm(e,t,i){const a=e?.step??1,r=e?.incrementFallback??1,s=i==="up"?a:-a,o=parseInt(t,10);let l;if(isNaN(o))l=r;else if(l=o+s,e?.wrap){const u=e.max-e.min+1;l=((l-e.min)%u+u)%u+e.min}else e&&(l=Math.max(e.min,Math.min(e.max,l)));return l.toString().padStart(e?.maxLength??2,"0")}const Kn=new Map;function la(e,t,i,a=!1){const r=i||1,s=`${e??""}|${t??""}|${r}|${a?"dt":"t"}`,o=Kn.get(s);if(o)return o;const l=aa(e,t),u=km(e),p=Em(l,r,u.am),h=a?{...Ar(),...p}:p,c={effectiveHourFormat:l,dayPeriodLabels:u,descriptors:h};return Kn.set(s,c),c}class Ot{constructor(t,i){this._values={},this._hasSurfacedInputError=!1,this.getPartDisplay=(a,r)=>{const s=this.getPart(a,r);if(r==="dayPeriod"&&(s==="am"||s==="pm")){const o=this.options.getDayPeriodLabels?.();if(o)return o[s]}return s},this.handleKeyDown=(a,r,s)=>{a.key==="Enter"&&this.options.onEnter&&(a.preventDefault(),a.target instanceof HTMLInputElement&&this.setPart(r,s,a.target.value.replace(/[^0-9]/g,""))),Pm(a,this.options.isReadonly())&&a.preventDefault()},this.handleDayPeriodKeyDown=a=>{(a.key==="ArrowUp"||a.key==="ArrowDown")&&a.preventDefault(),a.key==="Enter"&&a.preventDefault()},this.handleFocus=a=>{this.host.dispatchEvent(new CustomEvent("focus",{detail:a}))},this.handleKeyUp=(a,r,s)=>{if(this.options.isReadonly())return;const o=window.getComputedStyle(this.host).direction==="rtl",l=a.target,u=l,p=this.getGroupInputs(r),h=p.indexOf(l),c=this.options.getDescriptor(s);switch(l instanceof HTMLInputElement&&u.value.length===u.maxLength&&Wn(a.key)&&(h===p.length-1?this.autoAdvanceFromGroupEnd(r):p[h+1].focus()),a.key){case"Enter":{this.options.onEnter?.(a,r);break}case"ArrowUp":case"ArrowDown":{if(c?.kind==="dayPeriod"){this.toggleDayPeriod(r,s);break}const y=Mm(c,u.value,a.key==="ArrowUp"?"up":"down");this.setPart(r,s,y),this.selectPart(l),this.options.commitGroup(r);break}case"ArrowLeft":case"ArrowRight":{const y=[...p].sort((L,Ae)=>L.getBoundingClientRect().left-Ae.getBoundingClientRect().left),g=y.indexOf(l),_=a.key==="ArrowRight"?g+1:g-1;_>=0&&_<y.length?(y[_].focus(),this.selectPart(y[_])):this.navigatePastGroupEdge(a.key,r,o);break}}},this.handleChange=(a,r,s)=>{if(a.stopImmediatePropagation(),this.options.isReadonly()||this.options.getDescriptor(s)?.kind==="dayPeriod")return;const u=a.target.value.replace(/[^0-9]/g,"");this.setPart(r,s,u),this.options.commitGroup(r)},this.handleBlur=(a,r,s)=>{const o=this.options.getDescriptor(s);if(o?.kind!=="dayPeriod"){const l=a.target,u=parseInt(l.value,10);!isNaN(u)&&(u>0||o?.min===0)?l.value=u.toString().padStart(o?.maxLength??2,"0"):this.options.onEmptyPartBlur()}this.host.dispatchEvent(new CustomEvent("blur"))},this.toggleDayPeriod=(a,r)=>{if(this.options.isReadonly()||this.options.isDisabled())return;const s=this.getPart(a,r);this.setPart(a,r,s==="am"?"pm":"am"),this.options.commitGroup(a)},this.host=t,this.options=i,t.addController(this)}hostConnected(){}get values(){return this._values}getPart(t,i){return Gn(this._values,t,i)}setPart(t,i,a){this._values=Vn(this._values,t,i,a),this.host.requestUpdate()}clearGroup(t){this._values=Cm(this._values,t),this.host.requestUpdate()}applyWriteBacks(t,i){for(const[a,r]of Object.entries(i))r!==void 0&&this.setPart(t,a,r)}seedDayPeriods(t=this.options.groups){this.seedWith(t,this.options.getHourFormat?.()??"24")}seedWith(t,i){const a=Lm(this._values,t,i);a!==this._values&&(this._values=a,this.host.requestUpdate())}setGroupFromISO(t,i,a,r){const s=r??this.options.getHourFormat?.()??"24";if(!i){this.clearGroup(t),a!=="date"&&this.seedWith([t],s);return}if(a==="date"){const l=re(i);if(isNaN(l.getTime()))return;this.setPart(t,"year",String(l.getFullYear()).padStart(4,"0")),this.setPart(t,"month",String(l.getMonth()+1).padStart(2,"0")),this.setPart(t,"day",String(l.getDate()).padStart(2,"0"));return}if(a==="time"){let l=ra(i);if(!l){const u=ee(i);if(isNaN(u.getTime()))return;l={hours:u.getHours(),minutes:u.getMinutes(),seconds:u.getSeconds()}}this.writeTimeParts(t,l.hours,l.minutes,s);return}const o=ee(i);isNaN(o.getTime())||(this.setPart(t,"day",String(o.getDate()).padStart(2,"0")),this.setPart(t,"month",String(o.getMonth()+1).padStart(2,"0")),this.setPart(t,"year",String(o.getFullYear()).padStart(4,"0")),this.writeTimeParts(t,o.getHours(),o.getMinutes(),s))}writeTimeParts(t,i,a,r){if(r==="12"){const{hour12:s,period:o}=Am(i);this.setPart(t,"hour",s.toString().padStart(2,"0")),this.setPart(t,"dayPeriod",o)}else this.setPart(t,"hour",i.toString().padStart(2,"0"));this.setPart(t,"minute",a.toString().padStart(2,"0"))}getGroupInputs(t){return this.options.groups.length>1?Array.from(this.host.querySelectorAll(`[data-group="${t}"]`)):Array.from(this.host.querySelectorAll(`.${this.options.blockClass}__part`))}selectPart(t){t instanceof HTMLInputElement&&t.select()}focusFirst(t){requestAnimationFrame(()=>{this.getGroupInputs(t)[0]?.focus()})}autoAdvanceFromGroupEnd(t){const i=this.options.groups;if(i.length>1){const a=i[i.indexOf(t)+1];a!==void 0&&this.getGroupInputs(a)[0]?.focus();return}this.getGroupInputs(t)[0]?.focus()}navigatePastGroupEdge(t,i,a){const r=this.options.groups;if(r.length<=1)return;const s=r[0],o=r[r.length-1];if(t==="ArrowLeft"){const l=a?o:s;if(i!==l){const u=this.getGroupInputs(l),p=u[u.length-1];p&&(p.focus(),this.selectPart(p))}}else{const l=a?s:o;if(i!==l){const u=this.getGroupInputs(l);u[0]&&(u[0].focus(),this.selectPart(u[0]))}}}get hasSurfacedInputError(){return this._hasSurfacedInputError}surfaceInputError(t){this._hasSurfacedInputError=!0,this.options.onInputErrorSurfaced?.(t)}clearSurfacedInputError(t){this._hasSurfacedInputError&&(this._hasSurfacedInputError=!1,this.options.onSurfacedErrorCleared?.(t))}resetSurfacedInputError(){this._hasSurfacedInputError=!1}}const Om=(e,t)=>d.html`<span class="${t}__separator">${e.value}</span>`;function bt(e,t,i){const a=t.formatParts,r=t.groups.length>1,s=h=>r?`${e}-${h.type}`:h.type,o=(h,c)=>{if(h.type==="literal")return Om(h,t.blockClass);const y=t.getDescriptor(h.type);if(!y)return"";const g=e===t.groups[0]&&c===0?0:-1;return Rm(e,y,g,t,i)},l=h=>h.type==="hour"||h.type==="minute"||h.type==="second",u=a.findIndex(l);if(u===-1)return qe.repeat(a,s,o);let p=a.length-1;for(;!l(a[p]);)p--;return d.html`
|
|
252
|
+
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};kr([f.consume({context:m.formContext}),n.property({attribute:!1})],Yt.prototype,"formContext",2),kr([f.provide({context:m.inputContext})],Yt.prototype,"adapter",2),Yt=kr([n.customElement("gui-calendar-input")],Yt);const $m=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return Yt}},Symbol.toStringTag,{value:"Module"})),Ln=new Date(2025,0,15,9,5,0);function aa(e,t){if(t==="12"||t==="24")return t;const{hourCycle:i}=new Intl.DateTimeFormat(e??"en",{hour:"numeric"}).resolvedOptions();return i==="h11"||i==="h12"?"12":"24"}function In(e,t){return new Intl.DateTimeFormat(e??"en",{hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Ln)}function xn(e,t){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Ln)}function km(e){const t=new Intl.DateTimeFormat(e??"en",{hour:"numeric",hourCycle:"h12"}),i=a=>t.formatToParts(new Date(2025,0,15,a,0,0)).find(r=>r.type==="dayPeriod")?.value??"";return{am:i(9)||"AM",pm:i(21)||"PM"}}function Tr(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),r=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");return`${t}-${i}-${a}T${r}:${s}:${o}`}function yt(e){const t=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return`${t}:${i}:${a}`}function ra(e){const t=/^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?$/.exec(e);return t?{hours:Number(t[1]),minutes:Number(t[2]),seconds:Number(t[3]??0)}:null}function ee(e){const t=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(e)}const Tm="No available times";function Re(e,t){const i=s=>s.length===5?`${s}:00`:s,a=i(e),r=i(t);return a<r?-1:a>r?1:0}function Pn(e,t){const i=ra(e);if(!i)return;const a=i.hours*60+i.minutes+(t||30);if(!(a>=1440))return yt(new Date(1970,0,1,Math.floor(a/60),a%60,0))}function Mn(e,t){if(!e?.length)return[];const i=ae(t).getDay();return e.filter(a=>(a.date==null||a.date===t)&&(a.weekdays==null||a.weekdays.includes(i))).map(({start:a,end:r})=>({start:a,end:r}))}function sa(e,t){return t?.length?t.some(i=>Re(e,i.start)>=0&&Re(e,i.end??i.start)<=0):!1}function On(e,t,i){if(!i?.length)return!1;const a=t??e;return i.some(r=>{const s=r.end??r.start;return Re(e,s)<=0&&Re(r.start,a)<=0})}function Rn(e){return e.length===5?`${e}:00`:e}function Sm(e){if(!e.length)return[];const t=e.map(a=>({start:Rn(a.start),end:Rn(a.end??a.start)})).sort((a,r)=>Re(a.start,r.start)),i=[];for(const a of t){const r=i[i.length-1];r&&Re(a.start,r.end)<=0?Re(a.end,r.end)>0&&(r.end=a.end):i.push({...a})}return i}function Fn(e,t){return ee(e).getTime()<=ee(t).getTime()?{start:e,end:t}:{start:t,end:e}}function Bn(e){if(!e.length)return[];const t=e.map(a=>({start:ee(a.start).getTime(),end:ee(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start),i=[];for(const a of t){const r=i[i.length-1];r&&a.start<=r.end?a.end>r.end&&(r.end=a.end):i.push({start:a.start,end:a.end})}return i.map(a=>({start:Tr(new Date(a.start)),end:Tr(new Date(a.end))}))}function Nn(e,t){if(!t?.length)return!1;const i=ee(e.start).getTime(),a=ee(e.end??e.start).getTime();return t.some(r=>{const s=ee(r.start).getTime(),o=ee(r.end??r.start).getTime();return i<o&&s<a})}function _m(e,t){if(!t?.length)return!1;const i=ee(`${e}T00:00:00`).getTime(),a=ee(`${e}T23:59:59`).getTime();return t.some(r=>{const s=ee(r.start).getTime(),o=ee(r.end??r.start).getTime();return s<=i&&o>=a})}function Sr(e,t){if(!e?.length)return[];const i=ee(`${t}T00:00:00`).getTime(),a=ee(`${t}T23:59:59`).getTime(),r=[];for(const s of e){const o=ee(s.start).getTime(),l=ee(s.end??s.start).getTime();if(l<i||o>a)continue;const u=o<=i?"00:00:00":yt(new Date(o)),p=l>=a?"23:59:59":yt(new Date(l));r.push({start:u,end:p})}return r}function qn(e){const t=e.minuteStep||30,i=ra(e.minTime??"")??{hours:0,minutes:0,seconds:0},a=yt(new Date(1970,0,1,i.hours,i.minutes,i.seconds)),r=e.maxTime??"23:59:59",s=[];for(let o=i.hours*60+i.minutes;o<1440;o+=t){const l=yt(new Date(1970,0,1,Math.floor(o/60),o%60,0));if(Re(l,r)>0)break;Re(l,a)<0||s.push({value:l,disabled:sa(l,e.disabledRanges)})}return s}function na(e,t,i){const a=ra(e);return a?new Intl.DateTimeFormat(t??"en",{hour:"numeric",minute:"numeric",hourCycle:i==="12"?"h12":"h23"}).format(new Date(2025,0,15,a.hours,a.minutes,a.seconds)):e}function _r(e,t,i){const a=ee(e);return isNaN(a.getTime())?e:new Intl.DateTimeFormat(t??"en",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:i==="12"}).format(a)}function zn(e,t,i,a){const r=ee(e).getTime();if(isNaN(r))return null;if(t){const s=ee(t);if(!isNaN(s.getTime())&&r<s.getTime())return a?.minDateTimeMessage??dm}if(i){const s=ee(i);if(!isNaN(s.getTime())&&r>s.getTime())return a?.maxDateTimeMessage??um}return null}function Un(e,t){const i=e%12;return t==="pm"?i+12:i}function Am(e){const t=e>=12?"pm":"am";return{hour12:e%12===0?12:e%12,period:t}}const St={day:"Day",month:"Month",year:"Year",hour:"Hour",minute:"Minute",second:"Second",dayPeriod:"AM/PM"};function Ar(){return{day:{type:"day",kind:"numeric",maxLength:2,min:1,max:31,placeholder:"dd"},month:{type:"month",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"mm"},year:{type:"year",kind:"numeric",maxLength:4,min:1e3,max:9999,placeholder:"yyyy"}}}function Em(e,t,i){return{hour:e==="12"?{type:"hour",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"hh"}:{type:"hour",kind:"numeric",maxLength:2,min:0,max:23,placeholder:"hh",incrementFallback:0},minute:{type:"minute",kind:"numeric",maxLength:2,min:0,max:59,placeholder:"mm",step:t,incrementFallback:0,wrap:!0},dayPeriod:{type:"dayPeriod",kind:"dayPeriod",maxLength:8,min:0,max:0,placeholder:i}}}function Gn(e,t,i){return e[t]?.[i]??""}function Vn(e,t,i,a){return{...e,[t]:{...e[t],[i]:a}}}function Cm(e,t){return{...e,[t]:{}}}function Lm(e,t,i){if(i!=="12")return e;let a=e;for(const r of t)Gn(a,r,"dayPeriod")||(a=Vn(a,r,"dayPeriod","am"));return a}function Im(e,t){if(isNaN(t))return{value:t};if(!e)return{value:t};const i=Math.max(e.min,Math.min(e.max,t));return i===t?{value:t}:{value:i,writeBack:i.toString().padStart(e.maxLength??2,"0")}}function ut(e,t,i,a){const r=parseInt(e[i]??"",10),{value:s,writeBack:o}=Im(t[i],r);return o!==void 0&&(a[i]=o),s}function Zn(e,t){const i={},a=ut(e,t.descriptors,"year",i),r=ut(e,t.descriptors,"month",i),s=ut(e,t.descriptors,"day",i),o=!isNaN(a)&&String(a).length===4,l=!isNaN(r)&&r>0,u=!isNaN(s)&&s>0;if(!(o&&l&&u))return{result:{kind:"incomplete"},writeBacks:i};if(s>kn(r,a))return{result:{kind:"invalid",message:t.invalidDateMessage??fn},writeBacks:i};const p=new Date(a,r-1,s);return{result:{kind:"valid",iso:ie(p),instant:p},writeBacks:i}}function Yn(e,t){const i=t.hourFormat==="12",a={},r=ut(e,t.descriptors,"hour",a),s=ut(e,t.descriptors,"minute",a),o=e.dayPeriod??"";if(isNaN(r)||isNaN(s))return{result:{kind:"incomplete"},writeBacks:a};if(i&&o!=="am"&&o!=="pm")return{result:{kind:"incomplete"},writeBacks:a};const l=i?Un(r,o):r,u=new Date(1970,0,1,l,s,0);return{result:{kind:"valid",iso:yt(u),instant:u},writeBacks:a}}function Hn(e,t){const i=t.hourFormat==="12",a={},r=ut(e,t.descriptors,"year",a),s=ut(e,t.descriptors,"month",a),o=ut(e,t.descriptors,"day",a),l=ut(e,t.descriptors,"hour",a),u=ut(e,t.descriptors,"minute",a),p=e.dayPeriod??"",h=!isNaN(r)&&String(r).length===4,c=!isNaN(s)&&s>0,y=!isNaN(o)&&o>0,g=!isNaN(l),_=!isNaN(u);if(!(h&&c&&y&&g&&_&&(!i||p==="am"||p==="pm")))return{result:{kind:"incomplete"},writeBacks:a};if(o>kn(s,r))return{result:{kind:"invalid",message:t.invalidDateMessage??fn},writeBacks:a};const Ae=i?Un(l,p):l,nt=new Date(r,s-1,o,Ae,u,0);return{result:{kind:"valid",iso:Tr(nt),instant:nt},writeBacks:a}}function oa(e,t){return t.minTime&&Re(e,t.minTime)<0?t.minTimeMessage??vn:t.maxTime&&Re(e,t.maxTime)>0?t.maxTimeMessage??Dn:null}const xm=["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"];function Wn(e){return/^[0-9]$/.test(e)}function Pm(e,t){return xm.includes(e.key)||e.ctrlKey||e.metaKey||t?!1:!Wn(e.key)}function Mm(e,t,i){const a=e?.step??1,r=e?.incrementFallback??1,s=i==="up"?a:-a,o=parseInt(t,10);let l;if(isNaN(o))l=r;else if(l=o+s,e?.wrap){const u=e.max-e.min+1;l=((l-e.min)%u+u)%u+e.min}else e&&(l=Math.max(e.min,Math.min(e.max,l)));return l.toString().padStart(e?.maxLength??2,"0")}const Kn=new Map;function la(e,t,i,a=!1){const r=i||1,s=`${e??""}|${t??""}|${r}|${a?"dt":"t"}`,o=Kn.get(s);if(o)return o;const l=aa(e,t),u=km(e),p=Em(l,r,u.am),h=a?{...Ar(),...p}:p,c={effectiveHourFormat:l,dayPeriodLabels:u,descriptors:h};return Kn.set(s,c),c}class Ot{constructor(t,i){this._values={},this._hasSurfacedInputError=!1,this.getPartDisplay=(a,r)=>{const s=this.getPart(a,r);if(r==="dayPeriod"&&(s==="am"||s==="pm")){const o=this.options.getDayPeriodLabels?.();if(o)return o[s]}return s},this.handleKeyDown=(a,r,s)=>{a.key==="Enter"&&this.options.onEnter&&(a.preventDefault(),a.target instanceof HTMLInputElement&&this.setPart(r,s,a.target.value.replace(/[^0-9]/g,""))),Pm(a,this.options.isReadonly())&&a.preventDefault()},this.handleDayPeriodKeyDown=a=>{(a.key==="ArrowUp"||a.key==="ArrowDown")&&a.preventDefault(),a.key==="Enter"&&a.preventDefault()},this.handleFocus=a=>{this.host.dispatchEvent(new CustomEvent("focus",{detail:a}))},this.handleKeyUp=(a,r,s)=>{if(this.options.isReadonly())return;const o=window.getComputedStyle(this.host).direction==="rtl",l=a.target,u=l,p=this.getGroupInputs(r),h=p.indexOf(l),c=this.options.getDescriptor(s);switch(l instanceof HTMLInputElement&&u.value.length===u.maxLength&&Wn(a.key)&&(h===p.length-1?this.autoAdvanceFromGroupEnd(r):p[h+1].focus()),a.key){case"Enter":{this.options.onEnter?.(a,r);break}case"ArrowUp":case"ArrowDown":{if(c?.kind==="dayPeriod"){this.toggleDayPeriod(r,s);break}const y=Mm(c,u.value,a.key==="ArrowUp"?"up":"down");this.setPart(r,s,y),this.selectPart(l),this.options.commitGroup(r);break}case"ArrowLeft":case"ArrowRight":{const y=[...p].sort((L,Ae)=>L.getBoundingClientRect().left-Ae.getBoundingClientRect().left),g=y.indexOf(l),_=a.key==="ArrowRight"?g+1:g-1;_>=0&&_<y.length?(y[_].focus(),this.selectPart(y[_])):this.navigatePastGroupEdge(a.key,r,o);break}}},this.handleChange=(a,r,s)=>{if(a.stopImmediatePropagation(),this.options.isReadonly()||this.options.getDescriptor(s)?.kind==="dayPeriod")return;const u=a.target.value.replace(/[^0-9]/g,"");this.setPart(r,s,u),this.options.commitGroup(r)},this.handleBlur=(a,r,s)=>{const o=this.options.getDescriptor(s);if(o?.kind!=="dayPeriod"){const l=a.target,u=parseInt(l.value,10);!isNaN(u)&&(u>0||o?.min===0)?l.value=u.toString().padStart(o?.maxLength??2,"0"):this.options.onEmptyPartBlur()}this.host.dispatchEvent(new CustomEvent("blur"))},this.toggleDayPeriod=(a,r)=>{if(this.options.isReadonly()||this.options.isDisabled())return;const s=this.getPart(a,r);this.setPart(a,r,s==="am"?"pm":"am"),this.options.commitGroup(a)},this.host=t,this.options=i,t.addController(this)}hostConnected(){}get values(){return this._values}getPart(t,i){return Gn(this._values,t,i)}setPart(t,i,a){this._values=Vn(this._values,t,i,a),this.host.requestUpdate()}clearGroup(t){this._values=Cm(this._values,t),this.host.requestUpdate()}applyWriteBacks(t,i){for(const[a,r]of Object.entries(i))r!==void 0&&this.setPart(t,a,r)}seedDayPeriods(t=this.options.groups){this.seedWith(t,this.options.getHourFormat?.()??"24")}seedWith(t,i){const a=Lm(this._values,t,i);a!==this._values&&(this._values=a,this.host.requestUpdate())}setGroupFromISO(t,i,a,r){const s=r??this.options.getHourFormat?.()??"24";if(!i){this.clearGroup(t),a!=="date"&&this.seedWith([t],s);return}if(a==="date"){const l=ae(i);if(isNaN(l.getTime()))return;this.setPart(t,"year",String(l.getFullYear()).padStart(4,"0")),this.setPart(t,"month",String(l.getMonth()+1).padStart(2,"0")),this.setPart(t,"day",String(l.getDate()).padStart(2,"0"));return}if(a==="time"){let l=ra(i);if(!l){const u=ee(i);if(isNaN(u.getTime()))return;l={hours:u.getHours(),minutes:u.getMinutes(),seconds:u.getSeconds()}}this.writeTimeParts(t,l.hours,l.minutes,s);return}const o=ee(i);isNaN(o.getTime())||(this.setPart(t,"day",String(o.getDate()).padStart(2,"0")),this.setPart(t,"month",String(o.getMonth()+1).padStart(2,"0")),this.setPart(t,"year",String(o.getFullYear()).padStart(4,"0")),this.writeTimeParts(t,o.getHours(),o.getMinutes(),s))}writeTimeParts(t,i,a,r){if(r==="12"){const{hour12:s,period:o}=Am(i);this.setPart(t,"hour",s.toString().padStart(2,"0")),this.setPart(t,"dayPeriod",o)}else this.setPart(t,"hour",i.toString().padStart(2,"0"));this.setPart(t,"minute",a.toString().padStart(2,"0"))}getGroupInputs(t){return this.options.groups.length>1?Array.from(this.host.querySelectorAll(`[data-group="${t}"]`)):Array.from(this.host.querySelectorAll(`.${this.options.blockClass}__part`))}selectPart(t){t instanceof HTMLInputElement&&t.select()}focusFirst(t){requestAnimationFrame(()=>{this.getGroupInputs(t)[0]?.focus()})}autoAdvanceFromGroupEnd(t){const i=this.options.groups;if(i.length>1){const a=i[i.indexOf(t)+1];a!==void 0&&this.getGroupInputs(a)[0]?.focus();return}this.getGroupInputs(t)[0]?.focus()}navigatePastGroupEdge(t,i,a){const r=this.options.groups;if(r.length<=1)return;const s=r[0],o=r[r.length-1];if(t==="ArrowLeft"){const l=a?o:s;if(i!==l){const u=this.getGroupInputs(l),p=u[u.length-1];p&&(p.focus(),this.selectPart(p))}}else{const l=a?s:o;if(i!==l){const u=this.getGroupInputs(l);u[0]&&(u[0].focus(),this.selectPart(u[0]))}}}get hasSurfacedInputError(){return this._hasSurfacedInputError}surfaceInputError(t){this._hasSurfacedInputError=!0,this.options.onInputErrorSurfaced?.(t)}clearSurfacedInputError(t){this._hasSurfacedInputError&&(this._hasSurfacedInputError=!1,this.options.onSurfacedErrorCleared?.(t))}resetSurfacedInputError(){this._hasSurfacedInputError=!1}}const Om=(e,t)=>d.html`<span class="${t}__separator">${e.value}</span>`;function gt(e,t,i){const a=t.formatParts,r=t.groups.length>1,s=h=>r?`${e}-${h.type}`:h.type,o=(h,c)=>{if(h.type==="literal")return Om(h,t.blockClass);const y=t.getDescriptor(h.type);if(!y)return"";const g=e===t.groups[0]&&c===0?0:-1;return Rm(e,y,g,t,i)},l=h=>h.type==="hour"||h.type==="minute"||h.type==="second",u=a.findIndex(l);if(u===-1)return qe.repeat(a,s,o);let p=a.length-1;for(;!l(a[p]);)p--;return d.html`
|
|
257
253
|
${qe.repeat(a.slice(0,u),s,o)}
|
|
258
254
|
<div class="gui-parts__time-cluster ${t.blockClass}__time-cluster" dir="ltr">
|
|
259
255
|
${qe.repeat(a.slice(u,p+1),s,(h,c)=>o(h,u+c))}
|
|
@@ -271,7 +267,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
271
267
|
maxlength=${t.maxLength}
|
|
272
268
|
placeholder=${t.placeholder}
|
|
273
269
|
tabindex=${i}
|
|
274
|
-
aria-label=${a.getPartAriaLabel?.(e,o)??
|
|
270
|
+
aria-label=${a.getPartAriaLabel?.(e,o)??St[o]}
|
|
275
271
|
aria-valuemin=${t.min}
|
|
276
272
|
aria-valuemax=${t.max}
|
|
277
273
|
aria-valuenow=${isNaN(p)?d.nothing:p}
|
|
@@ -307,8 +303,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
307
303
|
</button>
|
|
308
304
|
<div class="gui-parts__visual-underline ${s}__visual-underline"></div>
|
|
309
305
|
</div>
|
|
310
|
-
`}var Bm=Object.defineProperty,Nm=Object.getOwnPropertyDescriptor,ce=(e,t,i,a)=>{for(var r=a>1?void 0:a?Nm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Bm(t,i,r),r};let
|
|
311
|
-
${this.label?
|
|
306
|
+
`}var Bm=Object.defineProperty,Nm=Object.getOwnPropertyDescriptor,ce=(e,t,i,a)=>{for(var r=a>1?void 0:a?Nm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Bm(t,i,r),r};let ne=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.icon="",this.hint=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.value=void 0,this.hourFormat=void 0,this.minuteStep=1,this.minTime=void 0,this.maxTime=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.inputBlockClass="gui-time-input",this.groups=["default"],this._parts=new Ot(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0})),getHourFormat:()=>this.timeLocaleData.effectiveHourFormat,getDayPeriodLabels:()=>this.timeLocaleData.dayPeriodLabels}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get timeLocaleData(){return la(this.localeId,this.hourFormat,this.minuteStep)}getPartDescriptor(e){return this.timeLocaleData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("value")||e.has("hourFormat")||e.has("localeId"))&&this._parts.setGroupFromISO("default",this.value??"","time",this.timeLocaleData.effectiveHourFormat)}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={blockClass:this.inputBlockClass,groups:this.groups,formatParts:In(this.localeId,this.timeLocaleData.effectiveHourFormat),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(a,r)=>({hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[r]??St[r],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return d.html`
|
|
307
|
+
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
312
308
|
|
|
313
309
|
<div class="gui-widget">
|
|
314
310
|
<div
|
|
@@ -317,7 +313,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
317
313
|
role="group"
|
|
318
314
|
aria-labelledby=${`${this.uid}_label`}
|
|
319
315
|
>
|
|
320
|
-
${
|
|
316
|
+
${gt("default",t,this._parts)}
|
|
321
317
|
</div>
|
|
322
318
|
${this.icon?d.html`<span
|
|
323
319
|
class=${S.classMap(i)}
|
|
@@ -327,7 +323,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
327
323
|
</div>
|
|
328
324
|
|
|
329
325
|
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
330
|
-
`}validateAndEmit(e){const{effectiveHourFormat:t,descriptors:i}=this.timeLocaleData,{result:a,writeBacks:r}=Yn(this._parts.values[e]??{},{hourFormat:t,descriptors:i});if(this._parts.applyWriteBacks(e,r),a.kind!=="valid"){this.requestUpdate();return}const s=oa(a.iso,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});if(s){this.dispatchEvent(new CustomEvent("change",{detail:{value:a.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:s},bubbles:!0})),this.requestUpdate();return}this.value=a.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0})),this.requestUpdate()}};ce([n.property({type:String})],
|
|
326
|
+
`}validateAndEmit(e){const{effectiveHourFormat:t,descriptors:i}=this.timeLocaleData,{result:a,writeBacks:r}=Yn(this._parts.values[e]??{},{hourFormat:t,descriptors:i});if(this._parts.applyWriteBacks(e,r),a.kind!=="valid"){this.requestUpdate();return}const s=oa(a.iso,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});if(s){this.dispatchEvent(new CustomEvent("change",{detail:{value:a.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:s},bubbles:!0})),this.requestUpdate();return}this.value=a.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0})),this.requestUpdate()}};ce([n.property({type:String})],ne.prototype,"uid",2),ce([n.property({type:String})],ne.prototype,"label",2),ce([n.property({type:String,attribute:"locale-id"})],ne.prototype,"localeId",2),ce([n.property({type:Array})],ne.prototype,"errors",2),ce([n.property({type:Boolean})],ne.prototype,"showErrors",2),ce([n.property({type:Boolean})],ne.prototype,"touched",2),ce([n.property({type:Boolean})],ne.prototype,"required",2),ce([n.property({type:Boolean})],ne.prototype,"disabled",2),ce([n.property({type:Boolean,attribute:"readonly"})],ne.prototype,"readOnly",2),ce([n.property({type:String})],ne.prototype,"icon",2),ce([n.property({type:String})],ne.prototype,"hint",2),ce([n.property({type:String})],ne.prototype,"hourAriaLabel",2),ce([n.property({type:String})],ne.prototype,"minuteAriaLabel",2),ce([n.property({type:String})],ne.prototype,"dayPeriodAriaLabel",2),ce([n.property({type:String})],ne.prototype,"value",2),ce([n.property({type:String,attribute:"hour-format"})],ne.prototype,"hourFormat",2),ce([n.property({type:Number,attribute:"minute-step"})],ne.prototype,"minuteStep",2),ce([n.property({type:String,attribute:"min-time"})],ne.prototype,"minTime",2),ce([n.property({type:String,attribute:"max-time"})],ne.prototype,"maxTime",2),ce([n.property({type:String,attribute:"min-time-message"})],ne.prototype,"minTimeMessage",2),ce([n.property({type:String,attribute:"max-time-message"})],ne.prototype,"maxTimeMessage",2),ne=ce([n.customElement("gui-time")],ne),typeof customElements<"u"&&!customElements.get("gui-time")&&customElements.define("gui-time",ne);var qm=Object.defineProperty,zm=Object.getOwnPropertyDescriptor,Fe=(e,t,i,a)=>{for(var r=a>1?void 0:a?zm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&qm(t,i,r),r};let Ee=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.value=void 0,this.label=void 0,this.minTime=void 0,this.maxTime=void 0,this.minuteStep=void 0,this.disabledRanges=void 0,this.localeId=void 0,this.hourFormat=void 0,this.disabled=!1,this.readOnly=!1,this.height=void 0,this.itemHeight=void 0,this.columns=void 0,this.noAvailableTimesMessage=void 0}createRenderRoot(){return this}get effectiveColumns(){return this.columns||1}get timeOptions(){const e=aa(this.localeId,this.hourFormat),t=[this.localeId,e,this.minTime,this.maxTime,this.minuteStep,JSON.stringify(this.disabledRanges??null)].join("|");return this._optionsCache?.key!==t&&(this._optionsCache={key:t,options:qn({minTime:this.minTime,maxTime:this.maxTime,minuteStep:this.minuteStep,disabledRanges:this.disabledRanges}).map(i=>({...i,template:na(i.value,this.localeId,e)}))}),this._optionsCache.options}isSelected(e){return this.value!=null&&Re(e.value,this.value)===0}get rovingIndex(){const e=this.timeOptions,t=e.findIndex(i=>this.isSelected(i)&&!i.disabled);return t!==-1?t:e.findIndex(i=>!i.disabled)}scrollToSelectedValue(){const e=this.querySelector(".gui-time-list__viewport"),t=this.querySelector(".gui-time-list__option--selected")??this.querySelector(".gui-time-list__option");if(e&&t){const i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),r=e.scrollTop+(a.top-i.top)-i.height/2+a.height/2;e.scrollTop=Math.max(0,r)}}focusSelectedOption(){this.querySelector('.gui-time-list__option[tabindex="0"]')?.focus()}selectOption(e,t){t.stopPropagation(),!(this.disabled||this.readOnly||e.disabled)&&(this.value=e.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0})))}onKeyDown(e){const t=e.target;if(!t.classList.contains("gui-time-list__option"))return;const i=Array.from(this.querySelectorAll(".gui-time-list__option")),a=i.indexOf(t),r=this.effectiveColumns,s=window.getComputedStyle(this).direction==="rtl",o=c=>this.timeOptions[c].disabled;if(e.key==="Enter"||e.key===" "){e.preventDefault();const c=this.timeOptions[a];c&&this.selectOption(c,e);return}const l=br(e.key,{columns:r,isRTL:s,pageSize:em(this.height,this.itemHeight,r)});if(l.kind==="none")return;if(e.preventDefault(),l.kind==="edge"){const c=l.edge==="first"?0:i.length-1,y=Vi(c,l.edge==="first"?1:-1,this.timeOptions.length,o,{includeStart:!0,outOfBounds:"none"});y!==-1&&i[y].focus();return}const u=l.delta,p=Math.min(Math.max(a+u,0),i.length-1);if(p===a)return;const h=Vi(p,u>0?1:-1,this.timeOptions.length,o,{includeStart:!0,outOfBounds:"none"});h!==-1&&h!==a&&i[h].focus()}renderOption(e,t,i){const a=this.isSelected(e),r={"gui-time-list__option":!0,"gui-time-list__option--selected":a};return d.html`
|
|
331
327
|
<button
|
|
332
328
|
type="button"
|
|
333
329
|
role=${i}
|
|
@@ -367,8 +363,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
367
363
|
</div>
|
|
368
364
|
`)}
|
|
369
365
|
</div>
|
|
370
|
-
`}};Fe([n.property({type:String})],Ee.prototype,"uid",2),Fe([n.property({type:String})],Ee.prototype,"value",2),Fe([n.property({type:String})],Ee.prototype,"label",2),Fe([n.property({type:String,attribute:"min-time"})],Ee.prototype,"minTime",2),Fe([n.property({type:String,attribute:"max-time"})],Ee.prototype,"maxTime",2),Fe([n.property({type:Number,attribute:"minute-step"})],Ee.prototype,"minuteStep",2),Fe([n.property({type:Array,attribute:"disabled-ranges"})],Ee.prototype,"disabledRanges",2),Fe([n.property({type:String,attribute:"locale-id"})],Ee.prototype,"localeId",2),Fe([n.property({type:String,attribute:"hour-format"})],Ee.prototype,"hourFormat",2),Fe([n.property({type:Boolean})],Ee.prototype,"disabled",2),Fe([n.property({type:Boolean,attribute:"readonly"})],Ee.prototype,"readOnly",2),Fe([n.property({type:Number})],Ee.prototype,"height",2),Fe([n.property({type:Number,attribute:"item-height"})],Ee.prototype,"itemHeight",2),Fe([n.property({type:Number})],Ee.prototype,"columns",2),Fe([n.property({type:String,attribute:"no-available-times-message"})],Ee.prototype,"noAvailableTimesMessage",2),Ee=Fe([n.customElement("gui-time-list")],Ee),typeof customElements<"u"&&!customElements.get("gui-time-list")&&customElements.define("gui-time-list",Ee);class Rt{constructor(t,i){this._open=!1,this._restoringFocus=!1,this._suppressNextFocusOut=!1,this._pointerDownInside=!1,this._pointerDownTarget=null,this.show=()=>{this.options.isDisabled()||this._restoringFocus||(this.options.beforeOpen?.(this),this.setOpen(!0))},this.close=()=>{this.setOpen(!1)},this.openAndFocus=()=>{this.show(),!(!this._open||!this.options.focusPopupSelector)&&Promise.resolve(this.host.updateComplete).then(()=>{this.host.querySelector(this.options.focusPopupSelector)?.focus()})},this.toggle=()=>{this.options.isDisabled()||(this.options.keyToggleMode==="toggle"?this.setOpen(!this._open):this._open?this.close():this.show())},this.onAnchorClick=a=>{if(this.options.isDisabled())return;const r=this._pointerDownTarget??a.target,s=this.options.clickIntent(r);if(s!=="ignore"){if(s==="open"){this.show();return}this.toggle()}},this.onAnchorKeyDown=a=>this.options.isDisabled()?!1:a.key==="Escape"&&this._open?(a.preventDefault(),a.stopPropagation(),this.restoreFocusToInput(),this.close(),!0):!1,this.onDocumentClick=a=>{if(!this._open)return;!a.composedPath().includes(this.host)&&!this._pointerDownInside&&this.close()},this.onDocumentPointerDown=a=>{const r=a.composedPath();this._pointerDownInside=r.includes(this.host),this._pointerDownTarget=r[0]??null},this.onDocumentKeyDown=a=>{a.key!=="Tab"&&a.key!=="Escape"||(this._pointerDownInside=!1,this._pointerDownTarget=null)},this.closeOnFocusLeave=()=>{this._pointerDownInside||this.close()},this.onHostFocusOut=a=>{if(this._suppressNextFocusOut){this._suppressNextFocusOut=!1;return}if(!this._open)return;const r=a.relatedTarget;this._pointerDownInside&&(!r||r.contains(this.host))||this.focusLeave.handleFocusOut(a)},this.host=t,this.options=i,this.focusLeave=new
|
|
371
|
-
${
|
|
366
|
+
`}};Fe([n.property({type:String})],Ee.prototype,"uid",2),Fe([n.property({type:String})],Ee.prototype,"value",2),Fe([n.property({type:String})],Ee.prototype,"label",2),Fe([n.property({type:String,attribute:"min-time"})],Ee.prototype,"minTime",2),Fe([n.property({type:String,attribute:"max-time"})],Ee.prototype,"maxTime",2),Fe([n.property({type:Number,attribute:"minute-step"})],Ee.prototype,"minuteStep",2),Fe([n.property({type:Array,attribute:"disabled-ranges"})],Ee.prototype,"disabledRanges",2),Fe([n.property({type:String,attribute:"locale-id"})],Ee.prototype,"localeId",2),Fe([n.property({type:String,attribute:"hour-format"})],Ee.prototype,"hourFormat",2),Fe([n.property({type:Boolean})],Ee.prototype,"disabled",2),Fe([n.property({type:Boolean,attribute:"readonly"})],Ee.prototype,"readOnly",2),Fe([n.property({type:Number})],Ee.prototype,"height",2),Fe([n.property({type:Number,attribute:"item-height"})],Ee.prototype,"itemHeight",2),Fe([n.property({type:Number})],Ee.prototype,"columns",2),Fe([n.property({type:String,attribute:"no-available-times-message"})],Ee.prototype,"noAvailableTimesMessage",2),Ee=Fe([n.customElement("gui-time-list")],Ee),typeof customElements<"u"&&!customElements.get("gui-time-list")&&customElements.define("gui-time-list",Ee);class Rt{constructor(t,i){this._open=!1,this._restoringFocus=!1,this._suppressNextFocusOut=!1,this._pointerDownInside=!1,this._pointerDownTarget=null,this.show=()=>{this.options.isDisabled()||this._restoringFocus||(this.options.beforeOpen?.(this),this.setOpen(!0))},this.close=()=>{this.setOpen(!1)},this.openAndFocus=()=>{this.show(),!(!this._open||!this.options.focusPopupSelector)&&Promise.resolve(this.host.updateComplete).then(()=>{this.host.querySelector(this.options.focusPopupSelector)?.focus()})},this.toggle=()=>{this.options.isDisabled()||(this.options.keyToggleMode==="toggle"?this.setOpen(!this._open):this._open?this.close():this.show())},this.onAnchorClick=a=>{if(this.options.isDisabled())return;const r=this._pointerDownTarget??a.target,s=this.options.clickIntent(r);if(s!=="ignore"){if(s==="open"){this.show();return}this.toggle()}},this.onAnchorKeyDown=a=>this.options.isDisabled()?!1:a.key==="Escape"&&this._open?(a.preventDefault(),a.stopPropagation(),this.restoreFocusToInput(),this.close(),!0):!1,this.onDocumentClick=a=>{if(!this._open)return;!a.composedPath().includes(this.host)&&!this._pointerDownInside&&this.close()},this.onDocumentPointerDown=a=>{const r=a.composedPath();this._pointerDownInside=r.includes(this.host),this._pointerDownTarget=r[0]??null},this.onDocumentKeyDown=a=>{a.key!=="Tab"&&a.key!=="Escape"||(this._pointerDownInside=!1,this._pointerDownTarget=null)},this.closeOnFocusLeave=()=>{this._pointerDownInside||this.close()},this.onHostFocusOut=a=>{if(this._suppressNextFocusOut){this._suppressNextFocusOut=!1;return}if(!this._open)return;const r=a.relatedTarget;this._pointerDownInside&&(!r||r.contains(this.host))||this.focusLeave.handleFocusOut(a)},this.host=t,this.options=i,this.focusLeave=new Vt(t,{onLeave:()=>{this.close()}}),t.addController(this)}get open(){return this._open}suppressNextFocusOut(){this._suppressNextFocusOut=!0}setOpen(t){this._open!==t&&(this._open=t,this.host.requestUpdate(),this.options.onOpenChanged?.(t))}restoreFocusToInput(){const t=this.host.querySelector(this.options.focusRestoreSelector);t&&(this._restoringFocus=!0,t.focus(),setTimeout(()=>{this._restoringFocus=!1}))}hostUpdated(){this._open&&this.options.isDisabled()&&this.close()}hostConnected(){document.addEventListener("click",this.onDocumentClick),document.addEventListener("pointerdown",this.onDocumentPointerDown,!0),document.addEventListener("keydown",this.onDocumentKeyDown,!0),this.host.addEventListener("focusout",this.onHostFocusOut)}hostDisconnected(){document.removeEventListener("click",this.onDocumentClick),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!0),document.removeEventListener("keydown",this.onDocumentKeyDown,!0),this.host.removeEventListener("focusout",this.onHostFocusOut)}}var Um=Object.defineProperty,Gm=Object.getOwnPropertyDescriptor,Y=(e,t,i,a)=>{for(var r=a>1?void 0:a?Gm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Um(t,i,r),r};let N=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledRanges=void 0,this.allowCustomTime=!1,this.height=void 0,this.itemHeight=void 0,this.columns=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._popup=new Rt(this,{focusRestoreSelector:"gui-time input, gui-time button",focusPopupSelector:'.gui-time-list__option[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-time-list__option")?"ignore":e.closest("gui-time")||e.closest("gui-time-list")?"open":"toggle",keyToggleMode:"openClose",onOpenChanged:e=>{this.dispatchListToggle(e),e&&this.updateComplete.then(()=>this._listRef?.scrollToSelectedValue())}}),this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()},this.onKeyDown=e=>{if(this._popup.onAnchorKeyDown(e))return;if(e.key==="Enter"&&e.target.closest("gui-time")){this._popup.open&&this._popup.close(),this.commitValue(this.value,!0);return}this.allowCustomTime||this.readOnly||this.disabled||e.key!=="ArrowDown"&&e.key!=="ArrowUp"||!e.target.closest("gui-time")||(e.preventDefault(),this.selectAdjacentOption(e.key==="ArrowDown"?1:-1))}}createRenderRoot(){return this}updated(e){e.has("value")&&this._listRef&&this._listRef.value!==this.value&&(this._listRef.value=this.value)}render(){const e=Qe("timePicker",{icon:this.icon});return d.html`
|
|
367
|
+
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
372
368
|
|
|
373
369
|
<div class="gui-widget" @keydown=${this.onKeyDown} @click=${this._popup.onAnchorClick}>
|
|
374
370
|
<gui-time
|
|
@@ -445,7 +441,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
445
441
|
</div>
|
|
446
442
|
|
|
447
443
|
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
448
|
-
`}onTimeChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onTimeBlur(){this.dispatchEvent(new CustomEvent("blur"))}onListChange(e){e.stopPropagation(),this.commitValue(e.detail.value,!0),this._popup.restoreFocusToInput(),this._popup.close()}commitValue(e,t=!1){this.value=e??void 0;const i=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null,commit:t},bubbles:!0,composed:!0})),i&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:i},bubbles:!0,composed:!0}))}validateBounds(e){if(!e)return null;const t=oa(e,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});return t||(sa(e,this.disabledRanges)?this.disabledRangeMessage??Hi:null)}selectAdjacentOption(e){const t=qn({minTime:this.minTime,maxTime:this.maxTime,minuteStep:this.minuteStep,disabledRanges:this.disabledRanges});if(!t.length)return;const i=t.findIndex(r=>r.value===this.value);let a=i===-1?e===1?0:t.length-1:i+e;for(;a>=0&&a<t.length&&t[a].disabled;)a+=e;a<0||a>=t.length||(this.commitValue(t[a].value),this._popup.show(),this.updateComplete.then(()=>this._listRef?.scrollToSelectedValue()))}closeList(){this._popup.close()}dispatchListToggle(e){this.dispatchEvent(new CustomEvent("listtoggle",{detail:{open:e},bubbles:!0,composed:!0}))}};Y([n.property({type:String})],N.prototype,"uid",2),Y([n.property({type:String})],N.prototype,"label",2),Y([n.property({type:String})],N.prototype,"hint",2),Y([n.property({type:String})],N.prototype,"icon",2),Y([n.property({type:String,attribute:"toggle-aria-label"})],N.prototype,"toggleAriaLabel",2),Y([n.property({type:String})],N.prototype,"hourAriaLabel",2),Y([n.property({type:String})],N.prototype,"minuteAriaLabel",2),Y([n.property({type:String})],N.prototype,"dayPeriodAriaLabel",2),Y([n.property({type:Array})],N.prototype,"errors",2),Y([n.property({type:Boolean})],N.prototype,"showErrors",2),Y([n.property({type:Boolean})],N.prototype,"touched",2),Y([n.property({type:Boolean})],N.prototype,"required",2),Y([n.property({type:Boolean})],N.prototype,"disabled",2),Y([n.property({type:Boolean,attribute:"readonly"})],N.prototype,"readOnly",2),Y([n.property({type:String,attribute:"locale-id"})],N.prototype,"localeId",2),Y([n.property({type:String})],N.prototype,"value",2),Y([n.property({type:String,attribute:"hour-format"})],N.prototype,"hourFormat",2),Y([n.property({type:Number,attribute:"minute-step"})],N.prototype,"minuteStep",2),Y([n.property({type:String,attribute:"min-time"})],N.prototype,"minTime",2),Y([n.property({type:String,attribute:"max-time"})],N.prototype,"maxTime",2),Y([n.property({type:Array,attribute:"disabled-ranges"})],N.prototype,"disabledRanges",2),Y([n.property({type:Boolean,attribute:"allow-custom-time"})],N.prototype,"allowCustomTime",2),Y([n.property({type:Number})],N.prototype,"height",2),Y([n.property({type:Number,attribute:"item-height"})],N.prototype,"itemHeight",2),Y([n.property({type:Number})],N.prototype,"columns",2),Y([n.property({type:String,attribute:"min-time-message"})],N.prototype,"minTimeMessage",2),Y([n.property({type:String,attribute:"max-time-message"})],N.prototype,"maxTimeMessage",2),Y([n.property({type:String,attribute:"disabled-range-message"})],N.prototype,"disabledRangeMessage",2),Y([n.property({type:String,attribute:"no-available-times-message"})],N.prototype,"noAvailableTimesMessage",2),Y([n.query("gui-time-list")],N.prototype,"_listRef",2),N=Y([n.customElement("gui-time-picker")],N),typeof customElements<"u"&&!customElements.get("gui-time-picker")&&customElements.define("gui-time-picker",N);var Vm=Object.defineProperty,Zm=Object.getOwnPropertyDescriptor,M=(e,t,i,a)=>{for(var r=a>1?void 0:a?Zm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Vm(t,i,r),r};let I=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledTimeRanges=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledTimeRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.allowCustomTime=!1,this._selectedDate=void 0,this._selectedTime=void 0,this._timeGridOpen=!1,this._internalValueChange=!1,this._nav=new Ji(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Yi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:e=>{const t=
|
|
444
|
+
`}onTimeChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onTimeBlur(){this.dispatchEvent(new CustomEvent("blur"))}onListChange(e){e.stopPropagation(),this.commitValue(e.detail.value,!0),this._popup.restoreFocusToInput(),this._popup.close()}commitValue(e,t=!1){this.value=e??void 0;const i=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null,commit:t},bubbles:!0,composed:!0})),i&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:i},bubbles:!0,composed:!0}))}validateBounds(e){if(!e)return null;const t=oa(e,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});return t||(sa(e,this.disabledRanges)?this.disabledRangeMessage??Hi:null)}selectAdjacentOption(e){const t=qn({minTime:this.minTime,maxTime:this.maxTime,minuteStep:this.minuteStep,disabledRanges:this.disabledRanges});if(!t.length)return;const i=t.findIndex(r=>r.value===this.value);let a=i===-1?e===1?0:t.length-1:i+e;for(;a>=0&&a<t.length&&t[a].disabled;)a+=e;a<0||a>=t.length||(this.commitValue(t[a].value),this._popup.show(),this.updateComplete.then(()=>this._listRef?.scrollToSelectedValue()))}closeList(){this._popup.close()}dispatchListToggle(e){this.dispatchEvent(new CustomEvent("listtoggle",{detail:{open:e},bubbles:!0,composed:!0}))}};Y([n.property({type:String})],N.prototype,"uid",2),Y([n.property({type:String})],N.prototype,"label",2),Y([n.property({type:String})],N.prototype,"hint",2),Y([n.property({type:String})],N.prototype,"icon",2),Y([n.property({type:String,attribute:"toggle-aria-label"})],N.prototype,"toggleAriaLabel",2),Y([n.property({type:String})],N.prototype,"hourAriaLabel",2),Y([n.property({type:String})],N.prototype,"minuteAriaLabel",2),Y([n.property({type:String})],N.prototype,"dayPeriodAriaLabel",2),Y([n.property({type:Array})],N.prototype,"errors",2),Y([n.property({type:Boolean})],N.prototype,"showErrors",2),Y([n.property({type:Boolean})],N.prototype,"touched",2),Y([n.property({type:Boolean})],N.prototype,"required",2),Y([n.property({type:Boolean})],N.prototype,"disabled",2),Y([n.property({type:Boolean,attribute:"readonly"})],N.prototype,"readOnly",2),Y([n.property({type:String,attribute:"locale-id"})],N.prototype,"localeId",2),Y([n.property({type:String})],N.prototype,"value",2),Y([n.property({type:String,attribute:"hour-format"})],N.prototype,"hourFormat",2),Y([n.property({type:Number,attribute:"minute-step"})],N.prototype,"minuteStep",2),Y([n.property({type:String,attribute:"min-time"})],N.prototype,"minTime",2),Y([n.property({type:String,attribute:"max-time"})],N.prototype,"maxTime",2),Y([n.property({type:Array,attribute:"disabled-ranges"})],N.prototype,"disabledRanges",2),Y([n.property({type:Boolean,attribute:"allow-custom-time"})],N.prototype,"allowCustomTime",2),Y([n.property({type:Number})],N.prototype,"height",2),Y([n.property({type:Number,attribute:"item-height"})],N.prototype,"itemHeight",2),Y([n.property({type:Number})],N.prototype,"columns",2),Y([n.property({type:String,attribute:"min-time-message"})],N.prototype,"minTimeMessage",2),Y([n.property({type:String,attribute:"max-time-message"})],N.prototype,"maxTimeMessage",2),Y([n.property({type:String,attribute:"disabled-range-message"})],N.prototype,"disabledRangeMessage",2),Y([n.property({type:String,attribute:"no-available-times-message"})],N.prototype,"noAvailableTimesMessage",2),Y([n.query("gui-time-list")],N.prototype,"_listRef",2),N=Y([n.customElement("gui-time-picker")],N),typeof customElements<"u"&&!customElements.get("gui-time-picker")&&customElements.define("gui-time-picker",N);var Vm=Object.defineProperty,Zm=Object.getOwnPropertyDescriptor,M=(e,t,i,a)=>{for(var r=a>1?void 0:a?Zm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Vm(t,i,r),r};let I=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledTimeRanges=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledTimeRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.allowCustomTime=!1,this._selectedDate=void 0,this._selectedTime=void 0,this._timeGridOpen=!1,this._internalValueChange=!1,this._nav=new Ji(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Yi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:e=>{const t=ae(e);this.selectDate({date:t,dayLabel:wr(this.localeId,t),isCurrentMonth:!0,isToday:vr(t),isSelected:!1,isFocusable:!0,isDisabled:this.isDisabled(t)})},onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Vt(this,{onLeave:()=>{this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}})}get resolvedTimeRanges(){return this._selectedDate?Mn(this.disabledTimeRanges,this._selectedDate):[]}get timePicker(){return this.querySelector("gui-time-picker")}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")){if(this._internalValueChange){this._internalValueChange=!1;return}if(this.value){const t=ee(this.value);isNaN(t.getTime())||(this._selectedDate=ie(t),this._selectedTime=yt(t),Dr(t,this._nav.currentDate,this.numberOfMonths??1)||(this._nav.currentDate=t))}else this._selectedTime&&(this._selectedDate=void 0,this._selectedTime=void 0)}}setValueInternal(e){this._internalValueChange=!0,this.value=e}emitChange(e,t=!1){this.dispatchEvent(new CustomEvent("change",{detail:{value:e,commit:t},bubbles:!0,composed:!0}))}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=ie(e.date);t!==this._selectedDate&&(this._selectedDate=t,this._selectedTime=void 0,this.value&&(this.setValueInternal(void 0),this.emitChange(null)))}commitTime(e,t=!1){this._selectedDate&&(this._selectedTime=e,this.setValueInternal(`${this._selectedDate}T${e}`),this.emitChange(this.value,t))}onTimePickerChange(e){e.stopPropagation();const t=e.detail.value,i=e.detail.commit===!0;if(!t){this._selectedTime=void 0,this.value&&(this.setValueInternal(void 0),this.emitChange(null));return}this.commitTime(t,i)}onListToggle(e){e.stopPropagation();const{open:t}=e.detail;if(t&&this.readOnly){this.timePicker?.closeList();return}this._timeGridOpen=t,t&&(this._nav.yearSelectorOpen=!1)}toggleYearSelector(){this.timePicker?.closeList(),this._nav.toggleYearSelector()}render(){return Qi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>d.nothing,renderMonthPanel:e=>ji({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){return e!==0?d.nothing:d.html`
|
|
449
445
|
<div class="gui-calendar__time-input-row">
|
|
450
446
|
<gui-time-picker
|
|
451
447
|
class="gui-time-picker gui-field"
|
|
@@ -481,14 +477,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
481
477
|
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
482
478
|
aria-label=${Ki(this.localeId,e.date)}
|
|
483
479
|
aria-current=${e.isToday?"date":d.nothing}
|
|
484
|
-
data-date=${
|
|
480
|
+
data-date=${ie(e.date)}
|
|
485
481
|
@click=${()=>this.selectDate(e)}
|
|
486
482
|
@keydown=${i=>this._keyboard.handleDayKeydown(i)}
|
|
487
483
|
aria-selected=${e.isSelected}
|
|
488
484
|
>
|
|
489
485
|
${e.dayLabel}
|
|
490
486
|
</button>
|
|
491
|
-
`}getDaysInMonth(e){const t=this._selectedDate;return ia({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=ta(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?
|
|
487
|
+
`}getDaysInMonth(e){const t=this._selectedDate;return ia({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=ta(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?ae(t):new Date]})}isDisabled(e){return this._nav.isDisabled(e)}};M([n.property({type:String})],I.prototype,"uid",2),M([n.property({type:String})],I.prototype,"label",2),M([n.property({type:String})],I.prototype,"hint",2),M([n.property({type:String,attribute:"locale-id"})],I.prototype,"localeId",2),M([n.property({type:Array})],I.prototype,"errors",2),M([n.property({type:Boolean})],I.prototype,"touched",2),M([n.property({type:Boolean})],I.prototype,"required",2),M([n.property({type:Boolean})],I.prototype,"disabled",2),M([n.property({type:Boolean,attribute:"readonly"})],I.prototype,"readOnly",2),M([n.property({type:String,attribute:"prev-month-icon"})],I.prototype,"prevMonthIcon",2),M([n.property({type:String,attribute:"next-month-icon"})],I.prototype,"nextMonthIcon",2),M([n.property({type:String,attribute:"prev-month-aria-label"})],I.prototype,"prevMonthAriaLabel",2),M([n.property({type:String,attribute:"next-month-aria-label"})],I.prototype,"nextMonthAriaLabel",2),M([n.property({type:String,attribute:"select-year-aria-label"})],I.prototype,"selectYearAriaLabel",2),M([n.property({type:String,attribute:"year-grid-aria-label"})],I.prototype,"yearGridAriaLabel",2),M([n.property({type:String})],I.prototype,"dayFormat",2),M([n.property({type:String})],I.prototype,"weekdayFormat",2),M([n.property({type:String})],I.prototype,"monthFormat",2),M([n.property({type:String})],I.prototype,"minDate",2),M([n.property({type:String})],I.prototype,"maxDate",2),M([n.property({type:Array})],I.prototype,"disabledRanges",2),M([n.property({type:Number})],I.prototype,"numberOfMonths",2),M([n.property({type:String})],I.prototype,"value",2),M([n.property({type:String,attribute:"hour-format"})],I.prototype,"hourFormat",2),M([n.property({type:Number,attribute:"minute-step"})],I.prototype,"minuteStep",2),M([n.property({type:String,attribute:"min-time"})],I.prototype,"minTime",2),M([n.property({type:String,attribute:"max-time"})],I.prototype,"maxTime",2),M([n.property({type:Array,attribute:"disabled-time-ranges"})],I.prototype,"disabledTimeRanges",2),M([n.property({type:String,attribute:"min-time-message"})],I.prototype,"minTimeMessage",2),M([n.property({type:String,attribute:"max-time-message"})],I.prototype,"maxTimeMessage",2),M([n.property({type:String,attribute:"disabled-time-range-message"})],I.prototype,"disabledTimeRangeMessage",2),M([n.property({type:String,attribute:"no-available-times-message"})],I.prototype,"noAvailableTimesMessage",2),M([n.property({type:Boolean,attribute:"allow-custom-time"})],I.prototype,"allowCustomTime",2),M([n.state()],I.prototype,"_selectedDate",2),M([n.state()],I.prototype,"_selectedTime",2),M([n.state()],I.prototype,"_timeGridOpen",2),I=M([n.customElement("gui-date-time-calendar")],I),typeof customElements<"u"&&!customElements.get("gui-date-time-calendar")&&customElements.define("gui-date-time-calendar",I);var Ym=Object.defineProperty,Hm=Object.getOwnPropertyDescriptor,Er=(e,t,i,a)=>{for(var r=a>1?void 0:a?Hm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ym(t,i,r),r};let Ht=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time-calendar","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=this.adapter.templateData;return d.html`
|
|
492
488
|
<gui-date-time-calendar
|
|
493
489
|
.uid=${this.widget.uid}
|
|
494
490
|
.label=${e.label}
|
|
@@ -527,7 +523,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
527
523
|
@inputError=${this.onInputError}
|
|
528
524
|
@blur=${()=>this.adapter.onBlur()}
|
|
529
525
|
></gui-date-time-calendar>
|
|
530
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Er([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
526
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Er([f.consume({context:m.formContext}),n.property({attribute:!1})],Ht.prototype,"formContext",2),Er([f.provide({context:m.inputContext})],Ht.prototype,"adapter",2),Ht=Er([n.customElement("gui-date-time-calendar-input")],Ht);const Wm=Object.freeze(Object.defineProperty({__proto__:null,get DateTimeCalendarElement(){return Ht}},Symbol.toStringTag,{value:"Module"}));function Jn(e){return`${e.start}-${e.end??e.start}`}function Wt(e,t){return!e||!Array.isArray(e)?[]:[...e].sort((i,a)=>t(i.start,a.start))}function Ft(e,t){return e.find(i=>Jn(i)===t)}function Kt(e,t){const i=e??[],a=Ft(i,t);if(!a)return null;const r=i.filter(s=>!(s.start===a.start&&(s.end??null)===(a.end??null)));return{removed:a,next:r}}function Xn(e,t){const i=ae(e);return isNaN(i.getTime())?e:new Intl.DateTimeFormat(t??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(i)}function da(e,t){const i=t(e.start),a=e.end?t(e.end):i;return`${i} - ${a}`}function Jt(e,t){return e.map(i=>{const a=t(i);return{key:Jn(i),label:a,ariaLabel:a}})}function ua(){return{anchor:null,hover:null,selecting:!1}}function pa(e,t){switch(t.type){case"pick":{if(!e.anchor)return{state:{anchor:t.date,hover:e.hover,selecting:!0}};let i=e.anchor,a=t.date;return t.date<i&&(i=t.date,a=e.anchor),{state:ua(),commit:{start:i,end:a}}}case"hover":return e.selecting?{state:{...e,hover:t.date}}:{state:e};case"reset":return{state:ua()}}}function Qn(e){return!e.selecting||!e.hover||!e.anchor?null:e.hover.getTime()>e.anchor.getTime()?{start:e.anchor,end:e.hover}:{start:e.hover,end:e.anchor}}function ha(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const a=new IntersectionObserver(r=>{r.forEach(s=>{t(s.isIntersecting)})},i);return a.observe(e),a}var Km=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,Be=(e,t,i,a)=>{for(var r=a>1?void 0:a?Jm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Km(t,i,r),r};let Ce=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.items=[],this.clickable=!1,this.removable=!0,this.bubble=!0,this.tabbable=!0,this.disabled=!1,this.readOnly=!1,this.removeAriaLabel="Remove",this.toolbarAriaLabel="Selected items",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"),a=e.composedPath()[0];!t?.contains(a)&&!i?.contains(a)&&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 a=Math.max(0,Math.min(t,i-1));this.focusPillAt(a)}}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e=this.items.length;return e===0?d.nothing:d.html`
|
|
531
527
|
${this.renderStrip()} ${this.bubble?this.renderCompact(e):d.nothing}
|
|
532
528
|
${this.bubble&&this._showDropdown?this.renderDropdown():d.nothing}
|
|
533
529
|
`}renderStrip(){return d.html`
|
|
@@ -612,7 +608,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
612
608
|
></path>
|
|
613
609
|
</svg>`}
|
|
614
610
|
</span>
|
|
615
|
-
`}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 a=this._showDropdown,r=a?"ArrowUp":"ArrowLeft",s=a?"ArrowDown":"ArrowRight";if(e.key===r){i>0?(e.preventDefault(),this.focusPillAt(i-1)):this.emitKeydown(t.key,e);return}if(e.key===s){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"&&a){e.preventDefault(),e.stopPropagation(),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 a=Math.max(0,Math.min(e,i.length-1));i[a].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=ha(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=ha(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}};Be([n.property({type:String})],Ce.prototype,"uid",2),Be([n.property({type:Array})],Ce.prototype,"items",2),Be([n.property({type:Boolean})],Ce.prototype,"clickable",2),Be([n.property({type:Boolean})],Ce.prototype,"removable",2),Be([n.property({type:Boolean})],Ce.prototype,"bubble",2),Be([n.property({type:Boolean})],Ce.prototype,"tabbable",2),Be([n.property({type:Boolean})],Ce.prototype,"disabled",2),Be([n.property({type:Boolean,attribute:"readonly"})],Ce.prototype,"readOnly",2),Be([n.property({type:String,attribute:"remove-aria-label"})],Ce.prototype,"removeAriaLabel",2),Be([n.property({type:String,attribute:"remove-icon"})],Ce.prototype,"removeIcon",2),Be([n.property({type:String,attribute:"compact-aria-label"})],Ce.prototype,"compactAriaLabel",2),Be([n.property({type:String,attribute:"toolbar-aria-label"})],Ce.prototype,"toolbarAriaLabel",2),Be([n.state()],Ce.prototype,"_isStartVisible",2),Be([n.state()],Ce.prototype,"_isEndVisible",2),Be([n.state()],Ce.prototype,"_showDropdown",2),Ce=Be([n.customElement("gui-pills")],Ce),typeof customElements<"u"&&!customElements.get("gui-pills")&&customElements.define("gui-pills",Ce);var Xm=Object.defineProperty,Qm=Object.getOwnPropertyDescriptor,H=(e,t,i,a)=>{for(var r=a>1?void 0:a?Qm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xm(t,i,r),r};let q=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this.disabledDateRangeMessage=void 0,this.invalidRange=null,this._selection=ua(),this._invalidRange=null,this._skipValueNavigation=!1,this._nav=new Ji(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Yi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:(e,t)=>this.selectDate(this.activationDay(e),t),onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new
|
|
611
|
+
`}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 a=this._showDropdown,r=a?"ArrowUp":"ArrowLeft",s=a?"ArrowDown":"ArrowRight";if(e.key===r){i>0?(e.preventDefault(),this.focusPillAt(i-1)):this.emitKeydown(t.key,e);return}if(e.key===s){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"&&a){e.preventDefault(),e.stopPropagation(),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 a=Math.max(0,Math.min(e,i.length-1));i[a].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=ha(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=ha(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}};Be([n.property({type:String})],Ce.prototype,"uid",2),Be([n.property({type:Array})],Ce.prototype,"items",2),Be([n.property({type:Boolean})],Ce.prototype,"clickable",2),Be([n.property({type:Boolean})],Ce.prototype,"removable",2),Be([n.property({type:Boolean})],Ce.prototype,"bubble",2),Be([n.property({type:Boolean})],Ce.prototype,"tabbable",2),Be([n.property({type:Boolean})],Ce.prototype,"disabled",2),Be([n.property({type:Boolean,attribute:"readonly"})],Ce.prototype,"readOnly",2),Be([n.property({type:String,attribute:"remove-aria-label"})],Ce.prototype,"removeAriaLabel",2),Be([n.property({type:String,attribute:"remove-icon"})],Ce.prototype,"removeIcon",2),Be([n.property({type:String,attribute:"compact-aria-label"})],Ce.prototype,"compactAriaLabel",2),Be([n.property({type:String,attribute:"toolbar-aria-label"})],Ce.prototype,"toolbarAriaLabel",2),Be([n.state()],Ce.prototype,"_isStartVisible",2),Be([n.state()],Ce.prototype,"_isEndVisible",2),Be([n.state()],Ce.prototype,"_showDropdown",2),Ce=Be([n.customElement("gui-pills")],Ce),typeof customElements<"u"&&!customElements.get("gui-pills")&&customElements.define("gui-pills",Ce);var Xm=Object.defineProperty,Qm=Object.getOwnPropertyDescriptor,H=(e,t,i,a)=>{for(var r=a>1?void 0:a?Qm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xm(t,i,r),r};let q=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this.disabledDateRangeMessage=void 0,this.invalidRange=null,this._selection=ua(),this._invalidRange=null,this._skipValueNavigation=!1,this._nav=new Ji(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Yi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:(e,t)=>this.selectDate(this.activationDay(e),t),onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Vt(this,{onLeave:()=>this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Kt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})))},this.onPillClickEvent=e=>{const t=Ft(this.getSortedPills(),e.detail.key);t&&this.navigateToDate(t.start)}}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}parseEndpoint(e){return ae(e)}endpointDay(e){return ae(e)}formatPillLabel(e){return da(e,t=>Xn(t,this.localeId))}renderDayContent(e){return d.html`${e.dayLabel}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("invalidRange"))if(this.invalidRange){const t=this.endpointDay(this.invalidRange.start),i=this.endpointDay(this.invalidRange.end);this._invalidRange=isNaN(t.getTime())||isNaN(i.getTime())?null:{start:t,end:i}}else this._invalidRange=null;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}];t.length>0&&t[0].start&&this._nav.navigateToDate(this.endpointDay(t[0].start))}}if(e.has("focusDate")&&this.focusDate){const t=ae(this.focusDate);isNaN(t.getTime())||(this._nav.navigateToDate(t),this.focusDate=void 0)}}render(){return Qi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>this.renderAboveCalendar(),renderMonthPanel:e=>ji({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){return d.nothing}renderPanelBody(e){return ea({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}toggleYearSelector(){this._nav.toggleYearSelector()}isDisabled(e){return this._nav.isDisabled(e)}activationDay(e){const t=ae(e);return{date:t,isCurrentMonth:!0,isDisabled:this.isDisabled(t),isFocusable:!0,dayLabel:"",isToday:!1,isRangeStart:!1,isRangeEnd:!1,isInRange:!1,isOneDayRange:!1,isAnchor:!1,isSelecting:!1,isInvalidStart:!1,isInvalidEnd:!1,isInvalidInRange:!1}}renderDay(e){const t=e.isInvalidStart&&e.isInvalidEnd,i={"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,"invalid-range-start":e.isInvalidStart&&!t,"invalid-range-end":e.isInvalidEnd&&!t,"invalid-range-single":t,"invalid-in-range":e.isInvalidInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return d.html`
|
|
616
612
|
<button
|
|
617
613
|
type="button"
|
|
618
614
|
role="gridcell"
|
|
@@ -622,7 +618,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
622
618
|
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
623
619
|
aria-label=${Ki(this.localeId,e.date)}
|
|
624
620
|
aria-current=${e.isToday?"date":d.nothing}
|
|
625
|
-
data-date=${
|
|
621
|
+
data-date=${ie(e.date)}
|
|
626
622
|
@click=${a=>this.selectDate(e,a)}
|
|
627
623
|
@mouseover=${()=>this.onMouseOver(e)}
|
|
628
624
|
@focus=${()=>this.onMouseOver(e)}
|
|
@@ -631,7 +627,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
631
627
|
>
|
|
632
628
|
${this.renderDayContent(e)}
|
|
633
629
|
</button>
|
|
634
|
-
`}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Qn(this._selection);return ia({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=ta(a.date,{ranges:t,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const{state:i,commit:a}=pa(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this._invalidRange=null;return}if(wn(
|
|
630
|
+
`}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Qn(this._selection);return ia({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=ta(a.date,{ranges:t,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const{state:i,commit:a}=pa(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this._invalidRange=null;return}if(wn(ie(a.start),ie(a.end),this.disabledRanges,this.minDate,this.maxDate)){this._invalidRange={start:a.start,end:a.end},this.dispatchEvent(new CustomEvent("inputError",{detail:{message:this.disabledDateRangeMessage??Tt,range:{start:ie(a.start),end:ie(a.end)}},bubbles:!0,composed:!0})),this.requestUpdate();return}this._invalidRange=null,this._skipValueNavigation=!0,this.value=An([...this.value||[],_n(a.start,a.end)]),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}onMouseOver(e){e.isDisabled||(this._selection=pa(this._selection,{type:"hover",date:e.date}).state)}renderAboveCalendar(){if(this.hidePills)return d.nothing;const e=this.getSortedPills();if(e.length===0)return d.nothing;const t=Jt(e,i=>this.formatPillLabel(i));return d.html`
|
|
635
631
|
<gui-pills
|
|
636
632
|
class="gui-range-calendar__pills"
|
|
637
633
|
.uid=${this.uid}
|
|
@@ -646,7 +642,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
646
642
|
@pillremove=${this.onPillRemoveEvent}
|
|
647
643
|
@pillclick=${this.onPillClickEvent}
|
|
648
644
|
></gui-pills>
|
|
649
|
-
`}getSortedPills(){return
|
|
645
|
+
`}getSortedPills(){return Wt(this.value,(e,t)=>this.parseEndpoint(e).getTime()-this.parseEndpoint(t).getTime())}navigateToDate(e){this._nav.navigateToDate(this.endpointDay(e))}};H([n.property({type:String})],q.prototype,"uid",2),H([n.property({type:String})],q.prototype,"label",2),H([n.property({type:String})],q.prototype,"hint",2),H([n.property({type:String,attribute:"locale-id"})],q.prototype,"localeId",2),H([n.property({type:Array})],q.prototype,"errors",2),H([n.property({type:Boolean})],q.prototype,"touched",2),H([n.property({type:Boolean})],q.prototype,"required",2),H([n.property({type:Boolean})],q.prototype,"disabled",2),H([n.property({type:Boolean,attribute:"readonly"})],q.prototype,"readOnly",2),H([n.property({type:String,attribute:"prev-month-icon"})],q.prototype,"prevMonthIcon",2),H([n.property({type:String,attribute:"next-month-icon"})],q.prototype,"nextMonthIcon",2),H([n.property({type:String,attribute:"prev-month-aria-label"})],q.prototype,"prevMonthAriaLabel",2),H([n.property({type:String,attribute:"next-month-aria-label"})],q.prototype,"nextMonthAriaLabel",2),H([n.property({type:String,attribute:"select-year-aria-label"})],q.prototype,"selectYearAriaLabel",2),H([n.property({type:String,attribute:"year-grid-aria-label"})],q.prototype,"yearGridAriaLabel",2),H([n.property({type:String})],q.prototype,"dayFormat",2),H([n.property({type:String})],q.prototype,"weekdayFormat",2),H([n.property({type:String})],q.prototype,"monthFormat",2),H([n.property({type:String})],q.prototype,"minDate",2),H([n.property({type:String})],q.prototype,"maxDate",2),H([n.property({type:Array})],q.prototype,"disabledRanges",2),H([n.property({type:Number})],q.prototype,"numberOfMonths",2),H([n.property({type:Array})],q.prototype,"value",2),H([n.property({type:String})],q.prototype,"focusDate",2),H([n.property({type:Boolean})],q.prototype,"hidePills",2),H([n.property({type:String})],q.prototype,"removePillAriaLabel",2),H([n.property({type:String,attribute:"disabled-date-range-message"})],q.prototype,"disabledDateRangeMessage",2),H([n.property({attribute:!1})],q.prototype,"invalidRange",2),H([n.state()],q.prototype,"_selection",2),H([n.state()],q.prototype,"_invalidRange",2),q=H([n.customElement("gui-range-calendar")],q),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",q);var jm=Object.defineProperty,ey=Object.getOwnPropertyDescriptor,Cr=(e,t,i,a)=>{for(var r=a>1?void 0:a?ey(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&jm(t,i,r),r};let Xt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
650
646
|
<gui-range-calendar
|
|
651
647
|
.uid=${this.widget.uid}
|
|
652
648
|
.label=${this.adapter.templateData.label}
|
|
@@ -678,8 +674,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
678
674
|
@inputError=${this.onInputError}
|
|
679
675
|
@blur=${()=>this.adapter.onBlur()}
|
|
680
676
|
></gui-range-calendar>
|
|
681
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Cr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
682
|
-
${this.label?
|
|
677
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Cr([f.consume({context:m.formContext}),n.property({attribute:!1})],Xt.prototype,"formContext",2),Cr([f.provide({context:m.inputContext})],Xt.prototype,"adapter",2),Xt=Cr([n.customElement("gui-range-calendar-input")],Xt);const ty=Object.freeze(Object.defineProperty({__proto__:null,get RangeCalendarElement(){return Xt}},Symbol.toStringTag,{value:"Module"}));function iy(e,t,i){return i(t,e)<0?{start:t,end:e}:{start:e,end:t}}function Lr(e,t,i,a){if(e.kind==="invalid")return{kind:"invalid",message:e.message};if(t.kind==="invalid")return{kind:"invalid",message:t.message};if(e.kind!=="valid"||t.kind!=="valid")return{kind:"incomplete"};const r=a.order?a.order(e.value,t.value):{start:e.value,end:t.value},s=a.validate?.(r)??null;return s!==null?{kind:"invalid",message:s}:{kind:"commit",value:a.merge([...i??[],a.toRange(r)])}}var ay=Object.defineProperty,ry=Object.getOwnPropertyDescriptor,ye=(e,t,i,a)=>{for(var r=a>1?void 0:a?ry(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ay(t,i,r),r};let le=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.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.value=[],this.invalidDateMessage=void 0,this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.separator=void 0,this.inputBlockClass="gui-range-date-input",this.groups=["start","end"],this.partDescriptors=Ar(),this._validationTriggered=!1,this._parts=new Ot(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{if(this.tryCreatePill(),this.value&&this.value.length>0){const e=this.value[this.value.length-1];this.onPillClick(e)}},onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Kt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=Ft(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getPartDescriptor(e){return this.partDescriptors[e]}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={blockClass:this.inputBlockClass,groups:this.groups,formatParts:$n(this.localeId),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(r,s)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel})[s]??St[s],disabled:this.disabled,partsReadonly:!!this.readOnly},i=Jt(this.getSortedPills(),r=>da(r,s=>Xn(s,this.localeId))),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return d.html`
|
|
678
|
+
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
683
679
|
|
|
684
680
|
<div class="gui-widget">
|
|
685
681
|
<div
|
|
@@ -695,7 +691,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
695
691
|
|
|
696
692
|
<gui-pills
|
|
697
693
|
class="gui-range-date-input__pills"
|
|
698
|
-
style=${
|
|
694
|
+
style=${Dt.styleMap(i.length?{}:{"min-width":0})}
|
|
699
695
|
.uid=${this.uid}
|
|
700
696
|
.toolbarAriaLabel=${"Selected date ranges"}
|
|
701
697
|
.items=${i}
|
|
@@ -716,7 +712,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
716
712
|
role="group"
|
|
717
713
|
aria-label=${this.startDateAriaLabel??"Start date"}
|
|
718
714
|
>
|
|
719
|
-
${
|
|
715
|
+
${gt("start",t,this._parts)}
|
|
720
716
|
</div>
|
|
721
717
|
|
|
722
718
|
<span class="gui-range-date-input__separator">${this.separator??"-"}</span>
|
|
@@ -726,14 +722,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
726
722
|
role="group"
|
|
727
723
|
aria-label=${this.endDateAriaLabel??"End date"}
|
|
728
724
|
>
|
|
729
|
-
${
|
|
725
|
+
${gt("end",t,this._parts)}
|
|
730
726
|
</div>
|
|
731
727
|
</div>
|
|
732
728
|
</div>
|
|
733
729
|
|
|
734
730
|
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
735
731
|
</div>
|
|
736
|
-
`}getSortedPills(){return
|
|
732
|
+
`}getSortedPills(){return Wt(this.value,(e,t)=>ae(e).getTime()-ae(t).getTime())}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}validateDateParts(e){const{result:t,writeBacks:i}=Zn(this._parts.values[e]??{},{descriptors:this.partDescriptors,invalidDateMessage:this.invalidDateMessage});return this._parts.applyWriteBacks(e,i),t.kind==="invalid"?{kind:"invalid",message:t.message}:t.kind==="valid"&&t.instant?{kind:"valid",value:t.instant}:{kind:"incomplete"}}syncParts(){return{start:this.validateDateParts("start"),end:this.validateDateParts("end")}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=Lr(e,t,this.value,{order:(a,r)=>iy(a,r,(s,o)=>s.getTime()-o.getTime()),toRange:({start:a,end:r})=>{const s=ie(a),o=ie(r);return s===o?{start:s}:{start:s,end:o}},merge:An});return i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();e.kind==="commit"&&(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.resetSurfacedInputError(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate())}showRange(e,t){this._parts.setGroupFromISO("start",e,"date"),this._parts.setGroupFromISO("end",t,"date")}clearRangeInputs(){this._parts.clearGroup("start"),this._parts.clearGroup("end")}};ye([n.property({type:String})],le.prototype,"uid",2),ye([n.property({type:String})],le.prototype,"label",2),ye([n.property({type:String,attribute:"locale-id"})],le.prototype,"localeId",2),ye([n.property({type:Array})],le.prototype,"errors",2),ye([n.property({type:Boolean})],le.prototype,"showErrors",2),ye([n.property({type:Boolean})],le.prototype,"touched",2),ye([n.property({type:Boolean})],le.prototype,"required",2),ye([n.property({type:Boolean})],le.prototype,"disabled",2),ye([n.property({type:Boolean,attribute:"readonly"})],le.prototype,"readOnly",2),ye([n.property({type:String})],le.prototype,"icon",2),ye([n.property({type:String})],le.prototype,"hint",2),ye([n.property({type:String})],le.prototype,"dayAriaLabel",2),ye([n.property({type:String})],le.prototype,"monthAriaLabel",2),ye([n.property({type:String})],le.prototype,"yearAriaLabel",2),ye([n.property({type:Array})],le.prototype,"value",2),ye([n.property({type:String,attribute:"invalid-date-message"})],le.prototype,"invalidDateMessage",2),ye([n.property({type:String})],le.prototype,"removePillAriaLabel",2),ye([n.property({type:String})],le.prototype,"startDateAriaLabel",2),ye([n.property({type:String})],le.prototype,"endDateAriaLabel",2),ye([n.property({type:String})],le.prototype,"separator",2),le=ye([n.customElement("gui-range-date")],le),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",le);var sy=Object.defineProperty,ny=Object.getOwnPropertyDescriptor,Ir=(e,t,i,a)=>{for(var r=a>1?void 0:a?ny(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&sy(t,i,r),r};let Qt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
737
733
|
<gui-range-date
|
|
738
734
|
.uid=${this.widget.uid}
|
|
739
735
|
.label=${this.adapter.templateData.label}
|
|
@@ -757,8 +753,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
757
753
|
@change=${this.valueChanged}
|
|
758
754
|
@inputError=${this.onInputError}
|
|
759
755
|
></gui-range-date>
|
|
760
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ir([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
761
|
-
${this.label?
|
|
756
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ir([f.consume({context:m.formContext}),n.property({attribute:!1})],Qt.prototype,"formContext",2),Ir([f.provide({context:m.inputContext})],Qt.prototype,"adapter",2),Qt=Ir([n.customElement("gui-range-date-input")],Qt);const oy=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateInputElement(){return Qt}},Symbol.toStringTag,{value:"Module"}));var ly=Object.defineProperty,dy=Object.getOwnPropertyDescriptor,W=(e,t,i,a)=>{for(var r=a>1?void 0:a?dy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ly(t,i,r),r};let U=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.icon="",this.hint=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.hourFormat=void 0,this.minuteStep=1,this.minTime=void 0,this.maxTime=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.value=[],this.rangeOrderMessage=void 0,this.removePillAriaLabel=void 0,this.startTimeAriaLabel=void 0,this.endTimeAriaLabel=void 0,this.separator=void 0,this.allowCustomTime=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.inputBlockClass="gui-range-time-input",this.groups=["start","end"],this._validationTriggered=!1,this._parts=new Ot(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})),isReadonly:()=>!!this.readOnly||this.allowCustomTime===!1,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{this.tryCreatePill(),this.value&&this.value.length>0&&this.onPillClick(this.value[this.value.length-1])},getHourFormat:()=>this.timeLocaleData.effectiveHourFormat,getDayPeriodLabels:()=>this.timeLocaleData.dayPeriodLabels}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Kt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-time-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=Ft(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get timeLocaleData(){return la(this.localeId,this.hourFormat,this.minuteStep)}getPartDescriptor(e){return this.timeLocaleData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("hourFormat")||e.has("localeId"))&&this._parts.seedDayPeriods()}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={blockClass:this.inputBlockClass,groups:this.groups,formatParts:In(this.localeId,this.timeLocaleData.effectiveHourFormat),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(r,s)=>({hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[s]??St[s],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly||this.allowCustomTime===!1},i=Jt(this.getSortedPills(),r=>da(r,s=>this.formatTimeForDisplay(s))),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return d.html`
|
|
757
|
+
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
762
758
|
|
|
763
759
|
<div class="gui-widget">
|
|
764
760
|
<div
|
|
@@ -774,7 +770,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
774
770
|
|
|
775
771
|
<gui-pills
|
|
776
772
|
class="gui-range-time-input__pills"
|
|
777
|
-
style=${
|
|
773
|
+
style=${Dt.styleMap(i.length?{}:{"min-width":0})}
|
|
778
774
|
.uid=${this.uid}
|
|
779
775
|
.toolbarAriaLabel=${"Selected time ranges"}
|
|
780
776
|
.items=${i}
|
|
@@ -795,7 +791,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
795
791
|
role="group"
|
|
796
792
|
aria-label=${this.startTimeAriaLabel??"Start time"}
|
|
797
793
|
>
|
|
798
|
-
${
|
|
794
|
+
${gt("start",t,this._parts)}
|
|
799
795
|
</div>
|
|
800
796
|
|
|
801
797
|
<span class="gui-range-time-input__separator">${this.separator??"-"}</span>
|
|
@@ -805,14 +801,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
805
801
|
role="group"
|
|
806
802
|
aria-label=${this.endTimeAriaLabel??"End time"}
|
|
807
803
|
>
|
|
808
|
-
${
|
|
804
|
+
${gt("end",t,this._parts)}
|
|
809
805
|
</div>
|
|
810
806
|
</div>
|
|
811
807
|
</div>
|
|
812
808
|
|
|
813
809
|
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
814
810
|
</div>
|
|
815
|
-
`}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatTimeForDisplay(e){return na(e,this.localeId,this.timeLocaleData.effectiveHourFormat)}getSortedPills(){return
|
|
811
|
+
`}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatTimeForDisplay(e){return na(e,this.localeId,this.timeLocaleData.effectiveHourFormat)}getSortedPills(){return Wt(this.value,Re)}validateTimeParts(e){const{effectiveHourFormat:t,descriptors:i}=this.timeLocaleData,{result:a,writeBacks:r}=Yn(this._parts.values[e]??{},{hourFormat:t,descriptors:i});if(this._parts.applyWriteBacks(e,r),a.kind!=="valid")return{kind:"incomplete"};const s=oa(a.iso,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});return s?{kind:"invalid",message:s}:{kind:"valid",value:a.iso}}fillGroup(e,t){this._parts.setGroupFromISO(e,t,"time",this.timeLocaleData.effectiveHourFormat),this.requestUpdate()}commitFromParts(){return this.tryCreatePill()}syncParts(){const e=this.validateTimeParts("start"),t=this.validateTimeParts("end"),i=a=>a.kind==="valid"?a.value:null;return this.dispatchEvent(new CustomEvent("partsChange",{detail:{start:i(e),end:i(t)},bubbles:!0,composed:!0})),{start:e,end:t}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=Lr(e,t,this.value,{validate:a=>Re(a.end,a.start)<=0?this.rangeOrderMessage??lm:On(a.start,a.end,this.disabledRanges)?this.disabledRangeMessage??Hi:null,toRange:a=>({start:a.start,end:a.end}),merge:Sm});return i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();return e.kind!=="commit"?!1:(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.seedDayPeriods(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate(),!0)}};W([n.property({type:String})],U.prototype,"uid",2),W([n.property({type:String})],U.prototype,"label",2),W([n.property({type:String,attribute:"locale-id"})],U.prototype,"localeId",2),W([n.property({type:Array})],U.prototype,"errors",2),W([n.property({type:Boolean})],U.prototype,"showErrors",2),W([n.property({type:Boolean})],U.prototype,"touched",2),W([n.property({type:Boolean})],U.prototype,"required",2),W([n.property({type:Boolean})],U.prototype,"disabled",2),W([n.property({type:Boolean,attribute:"readonly"})],U.prototype,"readOnly",2),W([n.property({type:String})],U.prototype,"icon",2),W([n.property({type:String})],U.prototype,"hint",2),W([n.property({type:String})],U.prototype,"hourAriaLabel",2),W([n.property({type:String})],U.prototype,"minuteAriaLabel",2),W([n.property({type:String})],U.prototype,"dayPeriodAriaLabel",2),W([n.property({type:String,attribute:"hour-format"})],U.prototype,"hourFormat",2),W([n.property({type:Number,attribute:"minute-step"})],U.prototype,"minuteStep",2),W([n.property({type:String,attribute:"min-time"})],U.prototype,"minTime",2),W([n.property({type:String,attribute:"max-time"})],U.prototype,"maxTime",2),W([n.property({type:String,attribute:"min-time-message"})],U.prototype,"minTimeMessage",2),W([n.property({type:String,attribute:"max-time-message"})],U.prototype,"maxTimeMessage",2),W([n.property({type:Array})],U.prototype,"value",2),W([n.property({type:String,attribute:"range-order-message"})],U.prototype,"rangeOrderMessage",2),W([n.property({type:String})],U.prototype,"removePillAriaLabel",2),W([n.property({type:String})],U.prototype,"startTimeAriaLabel",2),W([n.property({type:String})],U.prototype,"endTimeAriaLabel",2),W([n.property({type:String})],U.prototype,"separator",2),W([n.property({type:Boolean,attribute:"allow-custom-time"})],U.prototype,"allowCustomTime",2),W([n.property({type:Array,attribute:"disabled-ranges"})],U.prototype,"disabledRanges",2),W([n.property({type:String,attribute:"disabled-range-message"})],U.prototype,"disabledRangeMessage",2),U=W([n.customElement("gui-range-time")],U),typeof customElements<"u"&&!customElements.get("gui-range-time")&&customElements.define("gui-range-time",U);var uy=Object.defineProperty,py=Object.getOwnPropertyDescriptor,xr=(e,t,i,a)=>{for(var r=a>1?void 0:a?py(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&uy(t,i,r),r};let jt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time","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`
|
|
816
812
|
<gui-range-time
|
|
817
813
|
.uid=${this.widget.uid}
|
|
818
814
|
.label=${this.adapter.templateData.label}
|
|
@@ -842,8 +838,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
842
838
|
@change=${this.valueChanged}
|
|
843
839
|
@inputError=${this.onInputError}
|
|
844
840
|
></gui-range-time>
|
|
845
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};xr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
846
|
-
${this.label?
|
|
841
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};xr([f.consume({context:m.formContext}),n.property({attribute:!1})],jt.prototype,"formContext",2),xr([f.provide({context:m.inputContext})],jt.prototype,"adapter",2),jt=xr([n.customElement("gui-range-time-input")],jt);const hy=Object.freeze(Object.defineProperty({__proto__:null,get RangeTimeInputElement(){return jt}},Symbol.toStringTag,{value:"Module"}));var cy=Object.defineProperty,my=Object.getOwnPropertyDescriptor,G=(e,t,i,a)=>{for(var r=a>1?void 0:a?my(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&cy(t,i,r),r};let R=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.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.hourFormat=void 0,this.minuteStep=1,this.invalidDateMessage=void 0,this.value=[],this.removePillAriaLabel=void 0,this.startDateTimeAriaLabel=void 0,this.endDateTimeAriaLabel=void 0,this.separator=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.inputBlockClass="gui-range-date-time-input",this.groups=["start","end"],this._validationTriggered=!1,this._parts=new Ot(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{this.tryCreatePill(),this.value&&this.value.length>0&&this.onPillClick(this.value[this.value.length-1])},getHourFormat:()=>this.localeData.effectiveHourFormat,getDayPeriodLabels:()=>this.localeData.dayPeriodLabels,onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Kt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-time-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=Ft(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get localeData(){return la(this.localeId,this.hourFormat,this.minuteStep,!0)}getPartDescriptor(e){return this.localeData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("hourFormat")||e.has("localeId"))&&this._parts.seedDayPeriods()}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={blockClass:this.inputBlockClass,groups:this.groups,formatParts:xn(this.localeId,this.localeData.effectiveHourFormat),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(r,s)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel,hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[s]??St[s],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly},i=Jt(this.getSortedPills(),r=>da(r,s=>this.formatDateTimeForDisplay(s))),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return d.html`
|
|
842
|
+
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
847
843
|
|
|
848
844
|
<div class="gui-widget">
|
|
849
845
|
<div
|
|
@@ -859,7 +855,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
859
855
|
|
|
860
856
|
<gui-pills
|
|
861
857
|
class="gui-range-date-time-input__pills"
|
|
862
|
-
style=${
|
|
858
|
+
style=${Dt.styleMap(i.length?{}:{"min-width":0})}
|
|
863
859
|
.uid=${this.uid}
|
|
864
860
|
.toolbarAriaLabel=${"Selected date-time ranges"}
|
|
865
861
|
.items=${i}
|
|
@@ -880,7 +876,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
880
876
|
role="group"
|
|
881
877
|
aria-label=${this.startDateTimeAriaLabel??"Start date-time"}
|
|
882
878
|
>
|
|
883
|
-
${
|
|
879
|
+
${gt("start",t,this._parts)}
|
|
884
880
|
</div>
|
|
885
881
|
|
|
886
882
|
<span class="gui-range-date-time-input__separator">${this.separator??"-"}</span>
|
|
@@ -890,14 +886,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
890
886
|
role="group"
|
|
891
887
|
aria-label=${this.endDateTimeAriaLabel??"End date-time"}
|
|
892
888
|
>
|
|
893
|
-
${
|
|
889
|
+
${gt("end",t,this._parts)}
|
|
894
890
|
</div>
|
|
895
891
|
</div>
|
|
896
892
|
</div>
|
|
897
893
|
|
|
898
894
|
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
899
895
|
</div>
|
|
900
|
-
`}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatDateTimeForDisplay(e){return _r(e,this.localeId,this.localeData.effectiveHourFormat)}getSortedPills(){return
|
|
896
|
+
`}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatDateTimeForDisplay(e){return _r(e,this.localeId,this.localeData.effectiveHourFormat)}getSortedPills(){return Wt(this.value,(e,t)=>ee(e).getTime()-ee(t).getTime())}validateDateTimeParts(e){const{effectiveHourFormat:t,descriptors:i}=this.localeData,{result:a,writeBacks:r}=Hn(this._parts.values[e]??{},{hourFormat:t,descriptors:i,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,r),a.kind==="incomplete")return{kind:"incomplete"};if(a.kind==="invalid")return{kind:"invalid",message:a.message};const s=zn(a.iso,this.minDateTime,this.maxDateTime,{minDateTimeMessage:this.minDateTimeMessage,maxDateTimeMessage:this.maxDateTimeMessage});return s?{kind:"invalid",message:s}:{kind:"valid",value:a.iso}}syncParts(){return{start:this.validateDateTimeParts("start"),end:this.validateDateTimeParts("end")}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=Lr(e,t,this.value,{order:(a,r)=>{const s=Fn(a,r);return{start:s.start,end:s.end}},validate:a=>Nn({start:a.start,end:a.end},this.disabledRanges)?this.disabledRangeMessage??Tt:null,toRange:a=>({start:a.start,end:a.end}),merge:Bn});return i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();e.kind==="commit"&&(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.seedDayPeriods(),this._parts.resetSurfacedInputError(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate())}};G([n.property({type:String})],R.prototype,"uid",2),G([n.property({type:String})],R.prototype,"label",2),G([n.property({type:String,attribute:"locale-id"})],R.prototype,"localeId",2),G([n.property({type:Array})],R.prototype,"errors",2),G([n.property({type:Boolean})],R.prototype,"showErrors",2),G([n.property({type:Boolean})],R.prototype,"touched",2),G([n.property({type:Boolean})],R.prototype,"required",2),G([n.property({type:Boolean})],R.prototype,"disabled",2),G([n.property({type:Boolean,attribute:"readonly"})],R.prototype,"readOnly",2),G([n.property({type:String})],R.prototype,"icon",2),G([n.property({type:String})],R.prototype,"hint",2),G([n.property({type:String})],R.prototype,"dayAriaLabel",2),G([n.property({type:String})],R.prototype,"monthAriaLabel",2),G([n.property({type:String})],R.prototype,"yearAriaLabel",2),G([n.property({type:String})],R.prototype,"hourAriaLabel",2),G([n.property({type:String})],R.prototype,"minuteAriaLabel",2),G([n.property({type:String})],R.prototype,"dayPeriodAriaLabel",2),G([n.property({type:String,attribute:"hour-format"})],R.prototype,"hourFormat",2),G([n.property({type:Number,attribute:"minute-step"})],R.prototype,"minuteStep",2),G([n.property({type:String,attribute:"invalid-date-message"})],R.prototype,"invalidDateMessage",2),G([n.property({type:Array})],R.prototype,"value",2),G([n.property({type:String})],R.prototype,"removePillAriaLabel",2),G([n.property({type:String})],R.prototype,"startDateTimeAriaLabel",2),G([n.property({type:String})],R.prototype,"endDateTimeAriaLabel",2),G([n.property({type:String})],R.prototype,"separator",2),G([n.property({type:String,attribute:"min-date-time"})],R.prototype,"minDateTime",2),G([n.property({type:String,attribute:"max-date-time"})],R.prototype,"maxDateTime",2),G([n.property({type:String,attribute:"min-date-time-message"})],R.prototype,"minDateTimeMessage",2),G([n.property({type:String,attribute:"max-date-time-message"})],R.prototype,"maxDateTimeMessage",2),G([n.property({type:Array,attribute:"disabled-ranges"})],R.prototype,"disabledRanges",2),G([n.property({type:String,attribute:"disabled-range-message"})],R.prototype,"disabledRangeMessage",2),R=G([n.customElement("gui-range-date-time")],R),typeof customElements<"u"&&!customElements.get("gui-range-date-time")&&customElements.define("gui-range-date-time",R);var yy=Object.defineProperty,gy=Object.getOwnPropertyDescriptor,Pr=(e,t,i,a)=>{for(var r=a>1?void 0:a?gy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&yy(t,i,r),r};let ei=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time","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`
|
|
901
897
|
<gui-range-date-time
|
|
902
898
|
.uid=${this.widget.uid}
|
|
903
899
|
.label=${this.adapter.templateData.label}
|
|
@@ -930,7 +926,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
930
926
|
@change=${this.valueChanged}
|
|
931
927
|
@inputError=${this.onInputError}
|
|
932
928
|
></gui-range-date-time>
|
|
933
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Pr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
929
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Pr([f.consume({context:m.formContext}),n.property({attribute:!1})],ei.prototype,"formContext",2),Pr([f.provide({context:m.inputContext})],ei.prototype,"adapter",2),ei=Pr([n.customElement("gui-range-date-time-input")],ei);const by=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimeInputElement(){return ei}},Symbol.toStringTag,{value:"Module"}));var fy=Object.defineProperty,vy=Object.getOwnPropertyDescriptor,$=(e,t,i,a)=>{for(var r=a>1?void 0:a?vy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&fy(t,i,r),r};let D=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this.disabledDateRangeMessage=void 0,this.invalidRange=null,this.hourFormat=void 0,this.minuteStep=void 0,this.allowCustomTime=!1,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.dayCountAriaLabel=void 0,this.disabledDayCountAriaLabel=void 0,this._selection=ua(),this._invalidRange=null,this._workingDateStart=void 0,this._workingDateEnd=void 0,this._workingTimeIn=void 0,this._workingTimeOut=void 0,this._openList=null,this._skipValueNavigation=!1,this._nav=new Ji(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Yi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:(e,t)=>this.selectDate(this.activationDay(e),t),onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Vt(this,{onLeave:()=>this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Kt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})))},this.onPillClickEvent=e=>{const t=Ft(this.getSortedPills(),e.detail.key);t&&this.navigateToDate(t.start)}}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}get _yearSelectorOpen(){return this._nav.yearSelectorOpen}set _yearSelectorOpen(e){this._nav.yearSelectorOpen=e}parseEndpoint(e){return ee(e)}endpointDay(e){return ae(e.split("T")[0])}formatPillLabel(e){const t=aa(this.localeId,this.hourFormat),i=_r(e.start,this.localeId,t),a=e.end?_r(e.end,this.localeId,t):i;return`${i} - ${a}`}get workingRange(){if(!(!this._workingDateStart||!this._workingDateEnd))return{start:ae(this._workingDateStart),end:ae(this._workingDateEnd)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if((!this.hasUpdated||e.has("minDateTime")||e.has("maxDateTime"))&&(this.minDate=this.minDateTime?this.minDateTime.split("T")[0]:void 0,this.maxDate=this.maxDateTime?this.maxDateTime.split("T")[0]:void 0),e.has("invalidRange"))if(this.invalidRange){const t=this.endpointDay(this.invalidRange.start),i=this.endpointDay(this.invalidRange.end);this._invalidRange=isNaN(t.getTime())||isNaN(i.getTime())?null:{start:t,end:i}}else this._invalidRange=null;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}];t.length>0&&t[0].start&&this._nav.navigateToDate(this.endpointDay(t[0].start))}}if(e.has("focusDate")&&this.focusDate){const t=ae(this.focusDate);isNaN(t.getTime())||(this._nav.navigateToDate(t),this.focusDate=void 0)}}render(){return Qi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>this.renderAboveCalendar(),renderMonthPanel:e=>ji({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){if(e!==0)return d.nothing;const t=!this.disabled&&!!this._workingDateStart,i=!this.disabled&&!!this._workingTimeIn,a=this.startListBounds,r=this.endListBounds,s={"gui-range-date-time-calendar__time-row":!0,"is-list-open":this._openList!==null};return d.html`
|
|
934
930
|
<div class=${S.classMap(s)}>
|
|
935
931
|
<div
|
|
936
932
|
class=${S.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="start"})}
|
|
@@ -986,7 +982,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
986
982
|
></gui-time-picker>
|
|
987
983
|
</div>
|
|
988
984
|
</div>
|
|
989
|
-
`}renderPanelBody(e){return this._openList&&!this._yearSelectorOpen&&e===0?d.html``:ea({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}toggleYearSelector(){this.startPicker?.closeList(),this.endPicker?.closeList(),this._nav.toggleYearSelector()}isDisabled(e){const t=
|
|
985
|
+
`}renderPanelBody(e){return this._openList&&!this._yearSelectorOpen&&e===0?d.html``:ea({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}toggleYearSelector(){this.startPicker?.closeList(),this.endPicker?.closeList(),this._nav.toggleYearSelector()}isDisabled(e){const t=ie(e);return Wi(t,this.minDate,this.maxDate)?!0:_m(t,this.disabledRanges)}activationDay(e){const t=ae(e);return{date:t,isCurrentMonth:!0,isDisabled:this.isDisabled(t),isFocusable:!0,dayLabel:"",isToday:!1,isRangeStart:!1,isRangeEnd:!1,isInRange:!1,isOneDayRange:!1,isAnchor:!1,isSelecting:!1,isInvalidStart:!1,isInvalidEnd:!1,isInvalidInRange:!1}}renderDay(e){const t=e.isInvalidStart&&e.isInvalidEnd,i={"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,"invalid-range-start":e.isInvalidStart&&!t,"invalid-range-end":e.isInvalidEnd&&!t,"invalid-range-single":t,"invalid-in-range":e.isInvalidInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return d.html`
|
|
990
986
|
<button
|
|
991
987
|
type="button"
|
|
992
988
|
role="gridcell"
|
|
@@ -996,7 +992,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
996
992
|
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
997
993
|
aria-label=${Ki(this.localeId,e.date)}
|
|
998
994
|
aria-current=${e.isToday?"date":d.nothing}
|
|
999
|
-
data-date=${
|
|
995
|
+
data-date=${ie(e.date)}
|
|
1000
996
|
@click=${a=>this.selectDate(e,a)}
|
|
1001
997
|
@mouseover=${()=>this.onMouseOver(e)}
|
|
1002
998
|
@focus=${()=>this.onMouseOver(e)}
|
|
@@ -1005,13 +1001,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1005
1001
|
>
|
|
1006
1002
|
${this.renderDayContent(e)}
|
|
1007
1003
|
</button>
|
|
1008
|
-
`}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Qn(this._selection);return ia({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=ta(a.date,{ranges:t,workingRange:this.workingRange,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const{state:i,commit:a}=pa(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this.resetWorking(),this._invalidRange=null;return}if(this.spanCoversBlockedDay(a.start,a.end)){this._invalidRange={start:a.start,end:a.end},this.emitInputError(this.disabledRangeMessage??
|
|
1004
|
+
`}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Qn(this._selection);return ia({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=ta(a.date,{ranges:t,workingRange:this.workingRange,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const{state:i,commit:a}=pa(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this.resetWorking(),this._invalidRange=null;return}if(this.spanCoversBlockedDay(a.start,a.end)){this._invalidRange={start:a.start,end:a.end},this.emitInputError(this.disabledRangeMessage??Tt),this.requestUpdate();return}this._invalidRange=null,this._workingDateStart=ie(a.start),this._workingDateEnd=ie(a.end),this._workingTimeIn=void 0,this._workingTimeOut=void 0}spanCoversBlockedDay(e,t){const i=new Date(e);i.setHours(0,0,0,0);const a=new Date(t);for(a.setHours(0,0,0,0);i<=a;){if(this.isDisabled(i))return!0;i.setDate(i.getDate()+1)}return!1}onMouseOver(e){e.isDisabled||(this._selection=pa(this._selection,{type:"hover",date:e.date}).state)}onStartTimeChange(e){if(e.stopPropagation(),e.detail.commit!==!0)return;const t=e.detail.value;if(!t||!this._workingDateStart){this._workingTimeIn=void 0,this._workingTimeOut=void 0;return}const i=this.timeError(t,this._workingDateStart,this.resolvedStartTimeRanges);if(i){this._workingTimeIn=void 0,this._workingTimeOut=void 0,this.emitInputError(i);return}this._workingTimeIn=t,this._workingTimeOut=void 0}onEndTimeChange(e){if(e.stopPropagation(),e.detail.commit!==!0)return;const t=e.detail.value;if(!t){this._workingTimeOut=void 0;return}if(!this._workingTimeIn||!this._workingDateStart||!this._workingDateEnd)return;const i=this.timeError(t,this._workingDateEnd,this.resolvedEndTimeRanges);if(i){this._workingTimeOut=t,this.emitInputError(i);return}const a=Fn(`${this._workingDateStart}T${this._workingTimeIn}`,`${this._workingDateEnd}T${t}`);if(Nn(a,this.disabledRanges)){this._workingTimeOut=t,this.emitInputError(this.disabledRangeMessage??Tt);return}this._skipValueNavigation=!0,this.value=Bn([...this.value??[],a]),this.resetWorking(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}timeError(e,t,i){const a=zn(`${t}T${e}`,this.minDateTime,this.maxDateTime,{minDateTimeMessage:this.minDateTimeMessage,maxDateTimeMessage:this.maxDateTimeMessage});return a||(sa(e,i)?this.disabledRangeMessage??Tt:null)}resetWorking(){this._workingDateStart=void 0,this._workingDateEnd=void 0,this._workingTimeIn=void 0,this._workingTimeOut=void 0,this._openList=null,this.resetPicker(this.startPicker),this.resetPicker(this.endPicker)}resetPicker(e){e&&(e.value=void 0,e.closeList())}emitInputError(e){this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0,composed:!0}))}get startPicker(){return this.querySelector("gui-time-picker.gui-range-date-time-calendar__start")}get endPicker(){return this.querySelector("gui-time-picker.gui-range-date-time-calendar__end")}pickerFor(e){return e==="start"?this.startPicker:this.endPicker}onListToggle(e,t){e.stopPropagation();const{open:i}=e.detail;if(i&&this.readOnly){this.pickerFor(t)?.closeList();return}i?(this.pickerFor(t==="start"?"end":"start")?.closeList(),this._openList=t,this._yearSelectorOpen=!1):this._openList===t&&(this._openList=null)}get resolvedStartTimeRanges(){return this._workingDateStart?Sr(this.disabledRanges,this._workingDateStart):[]}get resolvedEndTimeRanges(){return this._workingDateEnd?Sr(this.disabledRanges,this._workingDateEnd):[]}dayClampedBounds(e){const t={};return this.minDateTime&&e===this.minDateTime.split("T")[0]&&(t.minTime=this.minDateTime.split("T")[1]),this.maxDateTime&&e===this.maxDateTime.split("T")[0]&&(t.maxTime=this.maxDateTime.split("T")[1]),t}get startListBounds(){return this._workingDateStart?this.dayClampedBounds(this._workingDateStart):{}}get endListBounds(){if(!this._workingDateEnd)return{};const e=this.dayClampedBounds(this._workingDateEnd);if(this._workingDateEnd!==this._workingDateStart||!this._workingTimeIn)return e;const t=Pn(this._workingTimeIn,this.minuteStep);return t?{minTime:t,maxTime:e.maxTime}:{minTime:"23:59:59",maxTime:"00:00:00"}}renderDayContent(e){const t=this.renderRangeCountBadge(e),i=this.renderDisabledSlotsBadge(e);return t===d.nothing&&i===d.nothing?d.html`${e.dayLabel}`:d.html`${e.dayLabel}<span class="gui-range-date-time-calendar__badges"
|
|
1009
1005
|
>${t}${i}</span
|
|
1010
1006
|
>`}renderBadge(e,t,i,a){return d.html`<span class="gui-range-date-time-calendar__${e}" aria-label=${i}
|
|
1011
1007
|
>${t}</span
|
|
1012
1008
|
><span class="gui-range-date-time-calendar__badge-tooltip" aria-hidden="true"
|
|
1013
1009
|
>${a.map(r=>d.html`<span>${r}</span>`)}</span
|
|
1014
|
-
>`}renderRangeCountBadge(e){if(!e.isCurrentMonth)return d.nothing;const t=this.rangesOnDay(e.date);if(t.length<=1)return d.nothing;const i=t.map(r=>this.formatPillLabel(r)),a=`${(this.dayCountAriaLabel??"{count} ranges").replace("{count}",String(t.length))}: ${i.join(", ")}`;return this.renderBadge("day-count",t.length,a,i)}renderDisabledSlotsBadge(e){if(!e.isCurrentMonth||e.isDisabled)return d.nothing;const t=Sr(this.disabledRanges,
|
|
1010
|
+
>`}renderRangeCountBadge(e){if(!e.isCurrentMonth)return d.nothing;const t=this.rangesOnDay(e.date);if(t.length<=1)return d.nothing;const i=t.map(r=>this.formatPillLabel(r)),a=`${(this.dayCountAriaLabel??"{count} ranges").replace("{count}",String(t.length))}: ${i.join(", ")}`;return this.renderBadge("day-count",t.length,a,i)}renderDisabledSlotsBadge(e){if(!e.isCurrentMonth||e.isDisabled)return d.nothing;const t=Sr(this.disabledRanges,ie(e.date));if(!t.length)return d.nothing;const i=aa(this.localeId,this.hourFormat),a=t.map(s=>`${na(s.start,this.localeId,i)} – ${na(s.end,this.localeId,i)}`),r=`${(this.disabledDayCountAriaLabel??"{count} disabled ranges").replace("{count}",String(t.length))}: ${a.join(", ")}`;return this.renderBadge("disabled-count",t.length,r,a)}rangesOnDay(e){if(!this.value?.length)return[];const t=ie(e);return this.value.filter(i=>{const a=i.start.split("T")[0],r=(i.end??i.start).split("T")[0];return t>=a&&t<=r})}renderAboveCalendar(){if(this.hidePills)return d.nothing;const e=this.getSortedPills();if(e.length===0)return d.nothing;const t=Jt(e,i=>this.formatPillLabel(i));return d.html`
|
|
1015
1011
|
<gui-pills
|
|
1016
1012
|
class="gui-range-calendar__pills"
|
|
1017
1013
|
.uid=${this.uid}
|
|
@@ -1026,7 +1022,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1026
1022
|
@pillremove=${this.onPillRemoveEvent}
|
|
1027
1023
|
@pillclick=${this.onPillClickEvent}
|
|
1028
1024
|
></gui-pills>
|
|
1029
|
-
`}getSortedPills(){return
|
|
1025
|
+
`}getSortedPills(){return Wt(this.value,(e,t)=>this.parseEndpoint(e).getTime()-this.parseEndpoint(t).getTime())}navigateToDate(e){this._nav.navigateToDate(this.endpointDay(e))}};$([n.property({type:String})],D.prototype,"uid",2),$([n.property({type:String})],D.prototype,"label",2),$([n.property({type:String})],D.prototype,"hint",2),$([n.property({type:String,attribute:"locale-id"})],D.prototype,"localeId",2),$([n.property({type:Array})],D.prototype,"errors",2),$([n.property({type:Boolean})],D.prototype,"touched",2),$([n.property({type:Boolean})],D.prototype,"required",2),$([n.property({type:Boolean})],D.prototype,"disabled",2),$([n.property({type:Boolean,attribute:"readonly"})],D.prototype,"readOnly",2),$([n.property({type:String,attribute:"prev-month-icon"})],D.prototype,"prevMonthIcon",2),$([n.property({type:String,attribute:"next-month-icon"})],D.prototype,"nextMonthIcon",2),$([n.property({type:String,attribute:"prev-month-aria-label"})],D.prototype,"prevMonthAriaLabel",2),$([n.property({type:String,attribute:"next-month-aria-label"})],D.prototype,"nextMonthAriaLabel",2),$([n.property({type:String,attribute:"select-year-aria-label"})],D.prototype,"selectYearAriaLabel",2),$([n.property({type:String,attribute:"year-grid-aria-label"})],D.prototype,"yearGridAriaLabel",2),$([n.property({type:String})],D.prototype,"dayFormat",2),$([n.property({type:String})],D.prototype,"weekdayFormat",2),$([n.property({type:String})],D.prototype,"monthFormat",2),$([n.property({type:String})],D.prototype,"minDate",2),$([n.property({type:String})],D.prototype,"maxDate",2),$([n.property({type:Array,attribute:"disabled-ranges"})],D.prototype,"disabledRanges",2),$([n.property({type:Number})],D.prototype,"numberOfMonths",2),$([n.property({type:Array})],D.prototype,"value",2),$([n.property({type:String})],D.prototype,"focusDate",2),$([n.property({type:Boolean})],D.prototype,"hidePills",2),$([n.property({type:String})],D.prototype,"removePillAriaLabel",2),$([n.property({type:String,attribute:"disabled-date-range-message"})],D.prototype,"disabledDateRangeMessage",2),$([n.property({attribute:!1})],D.prototype,"invalidRange",2),$([n.property({type:String,attribute:"hour-format"})],D.prototype,"hourFormat",2),$([n.property({type:Number,attribute:"minute-step"})],D.prototype,"minuteStep",2),$([n.property({type:Boolean,attribute:"allow-custom-time"})],D.prototype,"allowCustomTime",2),$([n.property({type:String,attribute:"start-time-label"})],D.prototype,"startTimeLabel",2),$([n.property({type:String,attribute:"end-time-label"})],D.prototype,"endTimeLabel",2),$([n.property({type:String,attribute:"min-date-time"})],D.prototype,"minDateTime",2),$([n.property({type:String,attribute:"max-date-time"})],D.prototype,"maxDateTime",2),$([n.property({type:String,attribute:"min-date-time-message"})],D.prototype,"minDateTimeMessage",2),$([n.property({type:String,attribute:"max-date-time-message"})],D.prototype,"maxDateTimeMessage",2),$([n.property({type:String,attribute:"disabled-range-message"})],D.prototype,"disabledRangeMessage",2),$([n.property({type:String,attribute:"no-available-times-message"})],D.prototype,"noAvailableTimesMessage",2),$([n.property({type:String,attribute:"day-count-aria-label"})],D.prototype,"dayCountAriaLabel",2),$([n.property({type:String,attribute:"disabled-day-count-aria-label"})],D.prototype,"disabledDayCountAriaLabel",2),$([n.state()],D.prototype,"_selection",2),$([n.state()],D.prototype,"_invalidRange",2),$([n.state()],D.prototype,"_workingDateStart",2),$([n.state()],D.prototype,"_workingDateEnd",2),$([n.state()],D.prototype,"_workingTimeIn",2),$([n.state()],D.prototype,"_workingTimeOut",2),$([n.state()],D.prototype,"_openList",2),D=$([n.customElement("gui-range-date-time-calendar")],D),typeof customElements<"u"&&!customElements.get("gui-range-date-time-calendar")&&customElements.define("gui-range-date-time-calendar",D);var Dy=Object.defineProperty,wy=Object.getOwnPropertyDescriptor,Mr=(e,t,i,a)=>{for(var r=a>1?void 0:a?wy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Dy(t,i,r),r};let ti=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time-calendar","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=this.adapter.templateData;return d.html`
|
|
1030
1026
|
<gui-range-date-time-calendar
|
|
1031
1027
|
.uid=${this.widget.uid}
|
|
1032
1028
|
.label=${e.label}
|
|
@@ -1067,7 +1063,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1067
1063
|
@inputError=${this.onInputError}
|
|
1068
1064
|
@blur=${()=>this.adapter.onBlur()}
|
|
1069
1065
|
></gui-range-date-time-calendar>
|
|
1070
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Mr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1066
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Mr([f.consume({context:m.formContext}),n.property({attribute:!1})],ti.prototype,"formContext",2),Mr([f.provide({context:m.inputContext})],ti.prototype,"adapter",2),ti=Mr([n.customElement("gui-range-date-time-calendar-input")],ti);const $y=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimeCalendarElement(){return ti}},Symbol.toStringTag,{value:"Module"}));var ky=Object.defineProperty,Ty=Object.getOwnPropertyDescriptor,w=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ty(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ky(t,i,r),r};let v=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.toggleAriaLabel=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.separator=void 0,this.removePillAriaLabel=void 0,this.startDateTimeAriaLabel=void 0,this.endDateTimeAriaLabel=void 0,this.invalidDateMessage=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.numberOfMonths=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.allowCustomTime=!1,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.dayCountAriaLabel=void 0,this.disabledDayCountAriaLabel=void 0,this._focusDate=void 0,this._popup=new Rt(this,{focusRestoreSelector:"gui-range-date-time input",focusPopupSelector:'.gui-calendar__day-button[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")||e.closest(".gui-time-list__option")||e.closest("gui-time-picker")?"ignore":e.closest(".gui-range-date-time-input__field")||e.closest("gui-range-date-time-calendar")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()},onOpenChanged:e=>{e||(this._focusDate=void 0)}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()},this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}render(){const e=Qe("datePicker",{icon:this.icon}),t=this._popup.open?d.html`<gui-range-date-time-calendar
|
|
1071
1067
|
id=${`${this.uid}_popup`}
|
|
1072
1068
|
role="dialog"
|
|
1073
1069
|
aria-label=${this.label??"Calendar"}
|
|
@@ -1109,7 +1105,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1109
1105
|
@change=${this.onCalendarChange}
|
|
1110
1106
|
@inputError=${this.onCalendarInputError}
|
|
1111
1107
|
></gui-range-date-time-calendar>`:d.nothing;return d.html`
|
|
1112
|
-
${
|
|
1108
|
+
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1113
1109
|
|
|
1114
1110
|
<div
|
|
1115
1111
|
class="gui-widget"
|
|
@@ -1181,7 +1177,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1181
1177
|
</div>
|
|
1182
1178
|
|
|
1183
1179
|
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
1184
|
-
`}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),this._popup.suppressNextFocusOut(),requestAnimationFrame(()=>{if(!this._popup.open)return;this.querySelector('gui-range-date-time-calendar .gui-calendar__day-button[tabindex="0"]')?.focus()})}onCalendarInputError(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("inputError",{detail:e.detail,bubbles:!0,composed:!0}))}commitValue(e){this.value=e??void 0,this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0}))}onCalendarBlur(){this._popup.closeOnFocusLeave()}onPillClick(e){this._focusDate=e.detail.range.start,this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};w([n.property({type:String})],v.prototype,"uid",2),w([n.property({type:String})],v.prototype,"label",2),w([n.property({type:String})],v.prototype,"hint",2),w([n.property({type:String})],v.prototype,"icon",2),w([n.property({type:Array})],v.prototype,"errors",2),w([n.property({type:Boolean})],v.prototype,"showErrors",2),w([n.property({type:Boolean})],v.prototype,"touched",2),w([n.property({type:Boolean})],v.prototype,"required",2),w([n.property({type:Boolean})],v.prototype,"disabled",2),w([n.property({type:Boolean,attribute:"readonly"})],v.prototype,"readOnly",2),w([n.property({type:String,attribute:"locale-id"})],v.prototype,"localeId",2),w([n.property({type:Array})],v.prototype,"value",2),w([n.property({type:String,attribute:"toggle-aria-label"})],v.prototype,"toggleAriaLabel",2),w([n.property({type:String})],v.prototype,"dayAriaLabel",2),w([n.property({type:String})],v.prototype,"monthAriaLabel",2),w([n.property({type:String})],v.prototype,"yearAriaLabel",2),w([n.property({type:String})],v.prototype,"hourAriaLabel",2),w([n.property({type:String})],v.prototype,"minuteAriaLabel",2),w([n.property({type:String})],v.prototype,"dayPeriodAriaLabel",2),w([n.property({type:String})],v.prototype,"separator",2),w([n.property({type:String,attribute:"remove-pill-aria-label"})],v.prototype,"removePillAriaLabel",2),w([n.property({type:String,attribute:"start-date-time-aria-label"})],v.prototype,"startDateTimeAriaLabel",2),w([n.property({type:String,attribute:"end-date-time-aria-label"})],v.prototype,"endDateTimeAriaLabel",2),w([n.property({type:String,attribute:"invalid-date-message"})],v.prototype,"invalidDateMessage",2),w([n.property({type:String,attribute:"prev-month-icon"})],v.prototype,"prevMonthIcon",2),w([n.property({type:String,attribute:"next-month-icon"})],v.prototype,"nextMonthIcon",2),w([n.property({type:String,attribute:"prev-month-aria-label"})],v.prototype,"prevMonthAriaLabel",2),w([n.property({type:String,attribute:"next-month-aria-label"})],v.prototype,"nextMonthAriaLabel",2),w([n.property({type:String,attribute:"select-year-aria-label"})],v.prototype,"selectYearAriaLabel",2),w([n.property({type:String,attribute:"year-grid-aria-label"})],v.prototype,"yearGridAriaLabel",2),w([n.property({type:String,attribute:"day-format"})],v.prototype,"dayFormat",2),w([n.property({type:String,attribute:"weekday-format"})],v.prototype,"weekdayFormat",2),w([n.property({type:String,attribute:"month-format"})],v.prototype,"monthFormat",2),w([n.property({type:Number,attribute:"number-of-months"})],v.prototype,"numberOfMonths",2),w([n.property({type:String,attribute:"hour-format"})],v.prototype,"hourFormat",2),w([n.property({type:Number,attribute:"minute-step"})],v.prototype,"minuteStep",2),w([n.property({type:Boolean,attribute:"allow-custom-time"})],v.prototype,"allowCustomTime",2),w([n.property({type:String,attribute:"start-time-label"})],v.prototype,"startTimeLabel",2),w([n.property({type:String,attribute:"end-time-label"})],v.prototype,"endTimeLabel",2),w([n.property({type:String,attribute:"min-date-time"})],v.prototype,"minDateTime",2),w([n.property({type:String,attribute:"max-date-time"})],v.prototype,"maxDateTime",2),w([n.property({type:String,attribute:"min-date-time-message"})],v.prototype,"minDateTimeMessage",2),w([n.property({type:String,attribute:"max-date-time-message"})],v.prototype,"maxDateTimeMessage",2),w([n.property({type:Array,attribute:"disabled-ranges"})],v.prototype,"disabledRanges",2),w([n.property({type:String,attribute:"disabled-range-message"})],v.prototype,"disabledRangeMessage",2),w([n.property({type:String,attribute:"no-available-times-message"})],v.prototype,"noAvailableTimesMessage",2),w([n.property({type:String,attribute:"day-count-aria-label"})],v.prototype,"dayCountAriaLabel",2),w([n.property({type:String,attribute:"disabled-day-count-aria-label"})],v.prototype,"disabledDayCountAriaLabel",2),w([n.state()],v.prototype,"_focusDate",2),v=w([n.customElement("gui-range-date-time-picker")],v),typeof customElements<"u"&&!customElements.get("gui-range-date-time-picker")&&customElements.define("gui-range-date-time-picker",v);var Sy=Object.defineProperty,_y=Object.getOwnPropertyDescriptor,Or=(e,t,i,a)=>{for(var r=a>1?void 0:a?_y(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Sy(t,i,r),r};let
|
|
1180
|
+
`}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),this._popup.suppressNextFocusOut(),requestAnimationFrame(()=>{if(!this._popup.open)return;this.querySelector('gui-range-date-time-calendar .gui-calendar__day-button[tabindex="0"]')?.focus()})}onCalendarInputError(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("inputError",{detail:e.detail,bubbles:!0,composed:!0}))}commitValue(e){this.value=e??void 0,this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0}))}onCalendarBlur(){this._popup.closeOnFocusLeave()}onPillClick(e){this._focusDate=e.detail.range.start,this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};w([n.property({type:String})],v.prototype,"uid",2),w([n.property({type:String})],v.prototype,"label",2),w([n.property({type:String})],v.prototype,"hint",2),w([n.property({type:String})],v.prototype,"icon",2),w([n.property({type:Array})],v.prototype,"errors",2),w([n.property({type:Boolean})],v.prototype,"showErrors",2),w([n.property({type:Boolean})],v.prototype,"touched",2),w([n.property({type:Boolean})],v.prototype,"required",2),w([n.property({type:Boolean})],v.prototype,"disabled",2),w([n.property({type:Boolean,attribute:"readonly"})],v.prototype,"readOnly",2),w([n.property({type:String,attribute:"locale-id"})],v.prototype,"localeId",2),w([n.property({type:Array})],v.prototype,"value",2),w([n.property({type:String,attribute:"toggle-aria-label"})],v.prototype,"toggleAriaLabel",2),w([n.property({type:String})],v.prototype,"dayAriaLabel",2),w([n.property({type:String})],v.prototype,"monthAriaLabel",2),w([n.property({type:String})],v.prototype,"yearAriaLabel",2),w([n.property({type:String})],v.prototype,"hourAriaLabel",2),w([n.property({type:String})],v.prototype,"minuteAriaLabel",2),w([n.property({type:String})],v.prototype,"dayPeriodAriaLabel",2),w([n.property({type:String})],v.prototype,"separator",2),w([n.property({type:String,attribute:"remove-pill-aria-label"})],v.prototype,"removePillAriaLabel",2),w([n.property({type:String,attribute:"start-date-time-aria-label"})],v.prototype,"startDateTimeAriaLabel",2),w([n.property({type:String,attribute:"end-date-time-aria-label"})],v.prototype,"endDateTimeAriaLabel",2),w([n.property({type:String,attribute:"invalid-date-message"})],v.prototype,"invalidDateMessage",2),w([n.property({type:String,attribute:"prev-month-icon"})],v.prototype,"prevMonthIcon",2),w([n.property({type:String,attribute:"next-month-icon"})],v.prototype,"nextMonthIcon",2),w([n.property({type:String,attribute:"prev-month-aria-label"})],v.prototype,"prevMonthAriaLabel",2),w([n.property({type:String,attribute:"next-month-aria-label"})],v.prototype,"nextMonthAriaLabel",2),w([n.property({type:String,attribute:"select-year-aria-label"})],v.prototype,"selectYearAriaLabel",2),w([n.property({type:String,attribute:"year-grid-aria-label"})],v.prototype,"yearGridAriaLabel",2),w([n.property({type:String,attribute:"day-format"})],v.prototype,"dayFormat",2),w([n.property({type:String,attribute:"weekday-format"})],v.prototype,"weekdayFormat",2),w([n.property({type:String,attribute:"month-format"})],v.prototype,"monthFormat",2),w([n.property({type:Number,attribute:"number-of-months"})],v.prototype,"numberOfMonths",2),w([n.property({type:String,attribute:"hour-format"})],v.prototype,"hourFormat",2),w([n.property({type:Number,attribute:"minute-step"})],v.prototype,"minuteStep",2),w([n.property({type:Boolean,attribute:"allow-custom-time"})],v.prototype,"allowCustomTime",2),w([n.property({type:String,attribute:"start-time-label"})],v.prototype,"startTimeLabel",2),w([n.property({type:String,attribute:"end-time-label"})],v.prototype,"endTimeLabel",2),w([n.property({type:String,attribute:"min-date-time"})],v.prototype,"minDateTime",2),w([n.property({type:String,attribute:"max-date-time"})],v.prototype,"maxDateTime",2),w([n.property({type:String,attribute:"min-date-time-message"})],v.prototype,"minDateTimeMessage",2),w([n.property({type:String,attribute:"max-date-time-message"})],v.prototype,"maxDateTimeMessage",2),w([n.property({type:Array,attribute:"disabled-ranges"})],v.prototype,"disabledRanges",2),w([n.property({type:String,attribute:"disabled-range-message"})],v.prototype,"disabledRangeMessage",2),w([n.property({type:String,attribute:"no-available-times-message"})],v.prototype,"noAvailableTimesMessage",2),w([n.property({type:String,attribute:"day-count-aria-label"})],v.prototype,"dayCountAriaLabel",2),w([n.property({type:String,attribute:"disabled-day-count-aria-label"})],v.prototype,"disabledDayCountAriaLabel",2),w([n.state()],v.prototype,"_focusDate",2),v=w([n.customElement("gui-range-date-time-picker")],v),typeof customElements<"u"&&!customElements.get("gui-range-date-time-picker")&&customElements.define("gui-range-date-time-picker",v);var Sy=Object.defineProperty,_y=Object.getOwnPropertyDescriptor,Or=(e,t,i,a)=>{for(var r=a>1?void 0:a?_y(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Sy(t,i,r),r};let ii=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time-picker","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=this.adapter.templateData;return d.html`
|
|
1185
1181
|
<gui-range-date-time-picker
|
|
1186
1182
|
.uid=${this.widget.uid}
|
|
1187
1183
|
.label=${e.label}
|
|
@@ -1234,7 +1230,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1234
1230
|
@inputError=${this.onInputError}
|
|
1235
1231
|
@blur=${()=>this.adapter.onBlur()}
|
|
1236
1232
|
></gui-range-date-time-picker>
|
|
1237
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Or([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1233
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Or([f.consume({context:m.formContext}),n.property({attribute:!1})],ii.prototype,"formContext",2),Or([f.provide({context:m.inputContext})],ii.prototype,"adapter",2),ii=Or([n.customElement("gui-range-date-time-picker-input")],ii);const Ay=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimePickerElement(){return ii}},Symbol.toStringTag,{value:"Module"}));var Ey=Object.defineProperty,Cy=Object.getOwnPropertyDescriptor,E=(e,t,i,a)=>{for(var r=a>1?void 0:a?Cy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ey(t,i,r),r};let A=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.separator=void 0,this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this._focusDate=void 0,this._invalidRange=null,this._popup=new Rt(this,{focusRestoreSelector:"gui-range-date input",focusPopupSelector:'.gui-calendar__day-button[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-range-date-input__part")||e.closest("gui-range-calendar")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()},this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}render(){const e=Qe("datePicker",{icon:this.icon}),t=this._popup.open?d.html`<gui-range-calendar
|
|
1238
1234
|
id=${`${this.uid}_popup`}
|
|
1239
1235
|
role="dialog"
|
|
1240
1236
|
aria-label=${this.label??"Calendar"}
|
|
@@ -1267,7 +1263,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1267
1263
|
@change=${this.onCalendarChange}
|
|
1268
1264
|
@inputError=${this.onCalendarInputError}
|
|
1269
1265
|
></gui-range-calendar>`:d.nothing;return d.html`
|
|
1270
|
-
${
|
|
1266
|
+
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1271
1267
|
|
|
1272
1268
|
<div
|
|
1273
1269
|
class="gui-widget"
|
|
@@ -1328,7 +1324,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1328
1324
|
</div>
|
|
1329
1325
|
|
|
1330
1326
|
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
1331
|
-
`}onDateChange(e){e.stopPropagation();const t=e.detail.value;for(const i of t??[]){const a=this.rangeError(i);if(a){this.rejectTypedRange(i,a);return}}this.commitValue(t)}rangeError(e){const t=e.start,i=e.end??e.start;if(wn(t,i,this.disabledRanges))return this.disabledDateRangeMessage??
|
|
1327
|
+
`}onDateChange(e){e.stopPropagation();const t=e.detail.value;for(const i of t??[]){const a=this.rangeError(i);if(a){this.rejectTypedRange(i,a);return}}this.commitValue(t)}rangeError(e){const t=e.start,i=e.end??e.start;if(wn(t,i,this.disabledRanges))return this.disabledDateRangeMessage??Tt;const a={minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage};for(const r of[t,i]){const s=Zt(r,this.minDate,this.maxDate,void 0,a);if(s)return s}return null}rejectTypedRange(e,t){const i=e.start,a=e.end??e.start;this._invalidRange={start:i,end:a};const r=this._dateRef;r&&(r.value=this.value??[],r.showRange(i,a)),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){e.stopPropagation(),this._dateRef?.clearRangeInputs(),this.commitValue(e.detail.value)}onCalendarInputError(e){const t=e.detail?.range;t&&(this._invalidRange=t,this._dateRef?.showRange(t.start,t.end))}commitValue(e){this.value=e??void 0,this._invalidRange=null,this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0}))}onCalendarBlur(){this._popup.closeOnFocusLeave()}onPillClick(e){this._focusDate=e.detail.range.start,this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};E([n.property({type:String})],A.prototype,"uid",2),E([n.property({type:String})],A.prototype,"label",2),E([n.property({type:String})],A.prototype,"hint",2),E([n.property({type:String})],A.prototype,"icon",2),E([n.property({type:String,attribute:"toggle-aria-label"})],A.prototype,"toggleAriaLabel",2),E([n.property({type:String})],A.prototype,"dayAriaLabel",2),E([n.property({type:String})],A.prototype,"monthAriaLabel",2),E([n.property({type:String})],A.prototype,"yearAriaLabel",2),E([n.property({type:Array})],A.prototype,"errors",2),E([n.property({type:Boolean})],A.prototype,"showErrors",2),E([n.property({type:Boolean})],A.prototype,"touched",2),E([n.property({type:Boolean})],A.prototype,"required",2),E([n.property({type:Boolean})],A.prototype,"disabled",2),E([n.property({type:Boolean,attribute:"readonly"})],A.prototype,"readOnly",2),E([n.property({type:String,attribute:"locale-id"})],A.prototype,"localeId",2),E([n.property({type:Array})],A.prototype,"value",2),E([n.property({type:String})],A.prototype,"separator",2),E([n.property({type:String,attribute:"remove-pill-aria-label"})],A.prototype,"removePillAriaLabel",2),E([n.property({type:String,attribute:"start-date-aria-label"})],A.prototype,"startDateAriaLabel",2),E([n.property({type:String,attribute:"end-date-aria-label"})],A.prototype,"endDateAriaLabel",2),E([n.property({type:String,attribute:"prev-month-icon"})],A.prototype,"prevMonthIcon",2),E([n.property({type:String,attribute:"next-month-icon"})],A.prototype,"nextMonthIcon",2),E([n.property({type:String,attribute:"prev-month-aria-label"})],A.prototype,"prevMonthAriaLabel",2),E([n.property({type:String,attribute:"next-month-aria-label"})],A.prototype,"nextMonthAriaLabel",2),E([n.property({type:String,attribute:"select-year-aria-label"})],A.prototype,"selectYearAriaLabel",2),E([n.property({type:String,attribute:"year-grid-aria-label"})],A.prototype,"yearGridAriaLabel",2),E([n.property({type:String,attribute:"day-format"})],A.prototype,"dayFormat",2),E([n.property({type:String,attribute:"weekday-format"})],A.prototype,"weekdayFormat",2),E([n.property({type:String,attribute:"month-format"})],A.prototype,"monthFormat",2),E([n.property({type:String,attribute:"min-date"})],A.prototype,"minDate",2),E([n.property({type:String,attribute:"max-date"})],A.prototype,"maxDate",2),E([n.property({type:Array,attribute:"disabled-ranges"})],A.prototype,"disabledRanges",2),E([n.property({type:Number,attribute:"number-of-months"})],A.prototype,"numberOfMonths",2),E([n.property({type:String,attribute:"invalid-date-message"})],A.prototype,"invalidDateMessage",2),E([n.property({type:String,attribute:"min-date-message"})],A.prototype,"minDateMessage",2),E([n.property({type:String,attribute:"max-date-message"})],A.prototype,"maxDateMessage",2),E([n.property({type:String,attribute:"disabled-date-range-message"})],A.prototype,"disabledDateRangeMessage",2),E([n.query("#date-input")],A.prototype,"_dateRef",2),E([n.state()],A.prototype,"_focusDate",2),E([n.state()],A.prototype,"_invalidRange",2),A=E([n.customElement("gui-range-date-picker")],A),typeof customElements<"u"&&!customElements.get("gui-range-date-picker")&&customElements.define("gui-range-date-picker",A);var Ly=Object.defineProperty,Iy=Object.getOwnPropertyDescriptor,Rr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Iy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ly(t,i,r),r};let ai=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-picker","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=this.adapter.templateData;return d.html`
|
|
1332
1328
|
<gui-range-date-picker
|
|
1333
1329
|
.uid=${this.widget.uid}
|
|
1334
1330
|
.label=${e.label}
|
|
@@ -1370,7 +1366,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1370
1366
|
@blur=${()=>this.adapter.onBlur()}
|
|
1371
1367
|
@change=${this.valueChanged}
|
|
1372
1368
|
></gui-range-date-picker>
|
|
1373
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Rr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1369
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Rr([f.consume({context:m.formContext}),n.property({attribute:!1})],ai.prototype,"formContext",2),Rr([f.provide({context:m.inputContext})],ai.prototype,"adapter",2),ai=Rr([n.customElement("gui-range-date-picker-input")],ai);const xy=Object.freeze(Object.defineProperty({__proto__:null,get RangeDatePickerElement(){return ai}},Symbol.toStringTag,{value:"Module"}));var Py=Object.defineProperty,My=Object.getOwnPropertyDescriptor,x=(e,t,i,a)=>{for(var r=a>1?void 0:a?My(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Py(t,i,r),r};let C=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.separator=void 0,this.removePillAriaLabel=void 0,this.startTimeAriaLabel=void 0,this.endTimeAriaLabel=void 0,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledRanges=void 0,this.allowCustomTime=!1,this.height=void 0,this.itemHeight=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.rangeOrderMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._workingIn=void 0,this._workingOut=void 0,this._popup=new Rt(this,{focusRestoreSelector:"gui-range-time input, gui-range-time button",focusPopupSelector:'.gui-time-list__option[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-time-list__option")?"ignore":e.closest(".gui-range-time-input__part")||e.closest(".gui-range-time-picker__panel")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()},onOpenChanged:e=>{e||(this._workingIn=void 0,this._workingOut=void 0)}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()},this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}get outListBounds(){if(!this._workingIn)return{minTime:this.minTime,maxTime:this.maxTime};const e=Pn(this._workingIn,this.minuteStep);return e?{minTime:e,maxTime:this.maxTime}:{minTime:"23:59:59",maxTime:"00:00:00"}}render(){const e=Qe("rangeTimePicker",{icon:this.icon}),t=this.outListBounds,i=this.startTimeLabel??"Start time",a=this.endTimeLabel??"End time",r=this._popup.open?d.html`<div
|
|
1374
1370
|
class="gui-range-time-picker__panel"
|
|
1375
1371
|
id=${`${this.uid}_popup`}
|
|
1376
1372
|
role="dialog"
|
|
@@ -1419,7 +1415,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1419
1415
|
></gui-time-list>
|
|
1420
1416
|
</div>
|
|
1421
1417
|
</div>`:d.nothing;return d.html`
|
|
1422
|
-
${
|
|
1418
|
+
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1423
1419
|
|
|
1424
1420
|
<div
|
|
1425
1421
|
class="gui-widget"
|
|
@@ -1490,7 +1486,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1490
1486
|
</div>
|
|
1491
1487
|
|
|
1492
1488
|
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
1493
|
-
`}onInputChange(e){e.stopPropagation(),this._workingIn=void 0,this._workingOut=void 0,this.commitValue(e.detail.value)}onPartsChange(e){e.stopPropagation(),this._workingIn=e.detail.start??void 0,this._workingOut=e.detail.end??void 0}onInputBlur(){this.dispatchEvent(new CustomEvent("blur"))}onInListChange(e){e.stopPropagation();const t=e.detail.value;this._workingIn=t??void 0,this._workingOut=void 0,t&&this._inputRef?.fillGroup("start",t)}onOutListChange(e){e.stopPropagation();const t=e.detail.value;if(!this._workingIn||!t||!this._inputRef)return;this._inputRef.fillGroup("end",t),this._inputRef.commitFromParts()?(this._workingIn=void 0,this._workingOut=void 0,this.updateComplete.then(()=>{this._inListRef()?.scrollToSelectedValue?.()})):(this._popup.close(),this.dispatchEvent(new CustomEvent("blur")))}_inListRef(){return this.querySelector(".gui-range-time-picker__column:first-child gui-time-list")}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e||e.length===0)return null;for(const t of e){for(const i of[t.start,t.end])if(i){if(this.minTime&&Re(i,this.minTime)<0)return this.minTimeMessage??vn;if(this.maxTime&&Re(i,this.maxTime)>0)return this.maxTimeMessage??Dn}if(On(t.start,t.end,this.disabledRanges))return this.disabledRangeMessage??Hi}return null}onPillClick(){this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};x([n.property({type:String})],C.prototype,"uid",2),x([n.property({type:String})],C.prototype,"label",2),x([n.property({type:String})],C.prototype,"hint",2),x([n.property({type:String})],C.prototype,"icon",2),x([n.property({type:String,attribute:"toggle-aria-label"})],C.prototype,"toggleAriaLabel",2),x([n.property({type:String})],C.prototype,"hourAriaLabel",2),x([n.property({type:String})],C.prototype,"minuteAriaLabel",2),x([n.property({type:String})],C.prototype,"dayPeriodAriaLabel",2),x([n.property({type:Array})],C.prototype,"errors",2),x([n.property({type:Boolean})],C.prototype,"showErrors",2),x([n.property({type:Boolean})],C.prototype,"touched",2),x([n.property({type:Boolean})],C.prototype,"required",2),x([n.property({type:Boolean})],C.prototype,"disabled",2),x([n.property({type:Boolean,attribute:"readonly"})],C.prototype,"readOnly",2),x([n.property({type:String,attribute:"locale-id"})],C.prototype,"localeId",2),x([n.property({type:Array})],C.prototype,"value",2),x([n.property({type:String})],C.prototype,"separator",2),x([n.property({type:String,attribute:"remove-pill-aria-label"})],C.prototype,"removePillAriaLabel",2),x([n.property({type:String,attribute:"start-time-aria-label"})],C.prototype,"startTimeAriaLabel",2),x([n.property({type:String,attribute:"end-time-aria-label"})],C.prototype,"endTimeAriaLabel",2),x([n.property({type:String,attribute:"start-time-label"})],C.prototype,"startTimeLabel",2),x([n.property({type:String,attribute:"end-time-label"})],C.prototype,"endTimeLabel",2),x([n.property({type:String,attribute:"hour-format"})],C.prototype,"hourFormat",2),x([n.property({type:Number,attribute:"minute-step"})],C.prototype,"minuteStep",2),x([n.property({type:String,attribute:"min-time"})],C.prototype,"minTime",2),x([n.property({type:String,attribute:"max-time"})],C.prototype,"maxTime",2),x([n.property({type:Array,attribute:"disabled-ranges"})],C.prototype,"disabledRanges",2),x([n.property({type:Boolean,attribute:"allow-custom-time"})],C.prototype,"allowCustomTime",2),x([n.property({type:Number})],C.prototype,"height",2),x([n.property({type:Number,attribute:"item-height"})],C.prototype,"itemHeight",2),x([n.property({type:String,attribute:"min-time-message"})],C.prototype,"minTimeMessage",2),x([n.property({type:String,attribute:"max-time-message"})],C.prototype,"maxTimeMessage",2),x([n.property({type:String,attribute:"range-order-message"})],C.prototype,"rangeOrderMessage",2),x([n.property({type:String,attribute:"disabled-range-message"})],C.prototype,"disabledRangeMessage",2),x([n.property({type:String,attribute:"no-available-times-message"})],C.prototype,"noAvailableTimesMessage",2),x([n.query("#time-input")],C.prototype,"_inputRef",2),x([n.state()],C.prototype,"_workingIn",2),x([n.state()],C.prototype,"_workingOut",2),C=x([n.customElement("gui-range-time-picker")],C),typeof customElements<"u"&&!customElements.get("gui-range-time-picker")&&customElements.define("gui-range-time-picker",C);var Oy=Object.defineProperty,Ry=Object.getOwnPropertyDescriptor,Fr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ry(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Oy(t,i,r),r};let
|
|
1489
|
+
`}onInputChange(e){e.stopPropagation(),this._workingIn=void 0,this._workingOut=void 0,this.commitValue(e.detail.value)}onPartsChange(e){e.stopPropagation(),this._workingIn=e.detail.start??void 0,this._workingOut=e.detail.end??void 0}onInputBlur(){this.dispatchEvent(new CustomEvent("blur"))}onInListChange(e){e.stopPropagation();const t=e.detail.value;this._workingIn=t??void 0,this._workingOut=void 0,t&&this._inputRef?.fillGroup("start",t)}onOutListChange(e){e.stopPropagation();const t=e.detail.value;if(!this._workingIn||!t||!this._inputRef)return;this._inputRef.fillGroup("end",t),this._inputRef.commitFromParts()?(this._workingIn=void 0,this._workingOut=void 0,this.updateComplete.then(()=>{this._inListRef()?.scrollToSelectedValue?.()})):(this._popup.close(),this.dispatchEvent(new CustomEvent("blur")))}_inListRef(){return this.querySelector(".gui-range-time-picker__column:first-child gui-time-list")}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e||e.length===0)return null;for(const t of e){for(const i of[t.start,t.end])if(i){if(this.minTime&&Re(i,this.minTime)<0)return this.minTimeMessage??vn;if(this.maxTime&&Re(i,this.maxTime)>0)return this.maxTimeMessage??Dn}if(On(t.start,t.end,this.disabledRanges))return this.disabledRangeMessage??Hi}return null}onPillClick(){this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};x([n.property({type:String})],C.prototype,"uid",2),x([n.property({type:String})],C.prototype,"label",2),x([n.property({type:String})],C.prototype,"hint",2),x([n.property({type:String})],C.prototype,"icon",2),x([n.property({type:String,attribute:"toggle-aria-label"})],C.prototype,"toggleAriaLabel",2),x([n.property({type:String})],C.prototype,"hourAriaLabel",2),x([n.property({type:String})],C.prototype,"minuteAriaLabel",2),x([n.property({type:String})],C.prototype,"dayPeriodAriaLabel",2),x([n.property({type:Array})],C.prototype,"errors",2),x([n.property({type:Boolean})],C.prototype,"showErrors",2),x([n.property({type:Boolean})],C.prototype,"touched",2),x([n.property({type:Boolean})],C.prototype,"required",2),x([n.property({type:Boolean})],C.prototype,"disabled",2),x([n.property({type:Boolean,attribute:"readonly"})],C.prototype,"readOnly",2),x([n.property({type:String,attribute:"locale-id"})],C.prototype,"localeId",2),x([n.property({type:Array})],C.prototype,"value",2),x([n.property({type:String})],C.prototype,"separator",2),x([n.property({type:String,attribute:"remove-pill-aria-label"})],C.prototype,"removePillAriaLabel",2),x([n.property({type:String,attribute:"start-time-aria-label"})],C.prototype,"startTimeAriaLabel",2),x([n.property({type:String,attribute:"end-time-aria-label"})],C.prototype,"endTimeAriaLabel",2),x([n.property({type:String,attribute:"start-time-label"})],C.prototype,"startTimeLabel",2),x([n.property({type:String,attribute:"end-time-label"})],C.prototype,"endTimeLabel",2),x([n.property({type:String,attribute:"hour-format"})],C.prototype,"hourFormat",2),x([n.property({type:Number,attribute:"minute-step"})],C.prototype,"minuteStep",2),x([n.property({type:String,attribute:"min-time"})],C.prototype,"minTime",2),x([n.property({type:String,attribute:"max-time"})],C.prototype,"maxTime",2),x([n.property({type:Array,attribute:"disabled-ranges"})],C.prototype,"disabledRanges",2),x([n.property({type:Boolean,attribute:"allow-custom-time"})],C.prototype,"allowCustomTime",2),x([n.property({type:Number})],C.prototype,"height",2),x([n.property({type:Number,attribute:"item-height"})],C.prototype,"itemHeight",2),x([n.property({type:String,attribute:"min-time-message"})],C.prototype,"minTimeMessage",2),x([n.property({type:String,attribute:"max-time-message"})],C.prototype,"maxTimeMessage",2),x([n.property({type:String,attribute:"range-order-message"})],C.prototype,"rangeOrderMessage",2),x([n.property({type:String,attribute:"disabled-range-message"})],C.prototype,"disabledRangeMessage",2),x([n.property({type:String,attribute:"no-available-times-message"})],C.prototype,"noAvailableTimesMessage",2),x([n.query("#time-input")],C.prototype,"_inputRef",2),x([n.state()],C.prototype,"_workingIn",2),x([n.state()],C.prototype,"_workingOut",2),C=x([n.customElement("gui-range-time-picker")],C),typeof customElements<"u"&&!customElements.get("gui-range-time-picker")&&customElements.define("gui-range-time-picker",C);var Oy=Object.defineProperty,Ry=Object.getOwnPropertyDescriptor,Fr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ry(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Oy(t,i,r),r};let ri=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time-picker","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=this.adapter.templateData;return d.html`
|
|
1494
1490
|
<gui-range-time-picker
|
|
1495
1491
|
.uid=${this.widget.uid}
|
|
1496
1492
|
.label=${e.label}
|
|
@@ -1530,8 +1526,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1530
1526
|
@blur=${()=>this.adapter.onBlur()}
|
|
1531
1527
|
@change=${this.valueChanged}
|
|
1532
1528
|
></gui-range-time-picker>
|
|
1533
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Fr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1534
|
-
${
|
|
1529
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Fr([f.consume({context:m.formContext}),n.property({attribute:!1})],ri.prototype,"formContext",2),Fr([f.provide({context:m.inputContext})],ri.prototype,"adapter",2),ri=Fr([n.customElement("gui-range-time-picker-input")],ri);const Fy=Object.freeze(Object.defineProperty({__proto__:null,get RangeTimePickerElement(){return ri}},Symbol.toStringTag,{value:"Module"})),jn=/^[0-9.,eE+-]+$/;function eo(e){const t=e.data??e.dataTransfer?.getData("text");t&&(jn.test(t)||e.preventDefault())}function to(e){e.ctrlKey||e.metaKey||e.altKey||e.isComposing||e.key.length===1&&(jn.test(e.key)||e.preventDefault())}var By=Object.defineProperty,Ny=Object.getOwnPropertyDescriptor,ve=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ny(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&By(t,i,r),r};let me=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 he(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,required:this.required}})})}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=Qe("currency",e),i={"gui-widget-input":!0,"gui-currency--icon":!!this.icon};return d.html`
|
|
1530
|
+
${oe(this.uid,e)}
|
|
1535
1531
|
|
|
1536
1532
|
<div class="gui-widget">
|
|
1537
1533
|
<input
|
|
@@ -1562,7 +1558,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1562
1558
|
</div>
|
|
1563
1559
|
|
|
1564
1560
|
${j(this.uid,e)}
|
|
1565
|
-
`}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber);const i=t.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},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{const t=this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),i=Math.min(this.minimumFractionDigits??2,t);return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:t,minimumFractionDigits:i}).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)||"."}}};ve([n.property({type:String})],me.prototype,"uid",2),ve([n.property({type:String})],me.prototype,"label",2),ve([n.property({type:String,attribute:"locale-id"})],me.prototype,"localeId",2),ve([n.property({type:Array})],me.prototype,"errors",2),ve([n.property({type:Boolean})],me.prototype,"touched",2),ve([n.property({type:Boolean})],me.prototype,"required",2),ve([n.property({type:Boolean})],me.prototype,"disabled",2),ve([n.property({type:Boolean,attribute:"readonly"})],me.prototype,"readOnly",2),ve([n.property({type:String})],me.prototype,"value",2),ve([n.property({type:String})],me.prototype,"currency",2),ve([n.property({type:String})],me.prototype,"step",2),ve([n.property({type:String})],me.prototype,"maximumFractionDigits",2),ve([n.property({type:String})],me.prototype,"minimumFractionDigits",2),ve([n.property({type:String})],me.prototype,"hint",2),ve([n.property({type:String})],me.prototype,"icon",2),ve([n.property({type:String})],me.prototype,"placeholder",2),ve([n.property({type:String})],me.prototype,"autocomplete",2),ve([n.state()],me.prototype,"displayValue",2),ve([n.query("input")],me.prototype,"inputElement",2),me=ve([n.customElement("gui-currency")],me),typeof customElements<"u"&&!customElements.get("gui-currency")&&customElements.define("gui-currency",me);var qy=Object.defineProperty,zy=Object.getOwnPropertyDescriptor,Br=(e,t,i,a)=>{for(var r=a>1?void 0:a?zy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&qy(t,i,r),r};let
|
|
1561
|
+
`}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber);const i=t.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},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{const t=this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),i=Math.min(this.minimumFractionDigits??2,t);return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:t,minimumFractionDigits:i}).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)||"."}}};ve([n.property({type:String})],me.prototype,"uid",2),ve([n.property({type:String})],me.prototype,"label",2),ve([n.property({type:String,attribute:"locale-id"})],me.prototype,"localeId",2),ve([n.property({type:Array})],me.prototype,"errors",2),ve([n.property({type:Boolean})],me.prototype,"touched",2),ve([n.property({type:Boolean})],me.prototype,"required",2),ve([n.property({type:Boolean})],me.prototype,"disabled",2),ve([n.property({type:Boolean,attribute:"readonly"})],me.prototype,"readOnly",2),ve([n.property({type:String})],me.prototype,"value",2),ve([n.property({type:String})],me.prototype,"currency",2),ve([n.property({type:String})],me.prototype,"step",2),ve([n.property({type:String})],me.prototype,"maximumFractionDigits",2),ve([n.property({type:String})],me.prototype,"minimumFractionDigits",2),ve([n.property({type:String})],me.prototype,"hint",2),ve([n.property({type:String})],me.prototype,"icon",2),ve([n.property({type:String})],me.prototype,"placeholder",2),ve([n.property({type:String})],me.prototype,"autocomplete",2),ve([n.state()],me.prototype,"displayValue",2),ve([n.query("input")],me.prototype,"inputElement",2),me=ve([n.customElement("gui-currency")],me),typeof customElements<"u"&&!customElements.get("gui-currency")&&customElements.define("gui-currency",me);var qy=Object.defineProperty,zy=Object.getOwnPropertyDescriptor,Br=(e,t,i,a)=>{for(var r=a>1?void 0:a?zy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&qy(t,i,r),r};let si=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
1566
1562
|
<gui-currency
|
|
1567
1563
|
.uid=${this.widget.uid}
|
|
1568
1564
|
.label=${this.adapter.templateData.label}
|
|
@@ -1584,8 +1580,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1584
1580
|
@input=${this.valueChanged}
|
|
1585
1581
|
@blur=${()=>this.adapter.onBlur()}
|
|
1586
1582
|
></gui-currency>
|
|
1587
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Br([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1588
|
-
${this.label?
|
|
1583
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Br([f.consume({context:m.formContext}),n.property({attribute:!1})],si.prototype,"formContext",2),Br([f.provide({context:m.inputContext})],si.prototype,"adapter",2),si=Br([n.customElement("gui-currency-input")],si);const Uy=Object.freeze(Object.defineProperty({__proto__:null,get CurrencyElement(){return si}},Symbol.toStringTag,{value:"Module"}));var Gy=Object.defineProperty,Vy=Object.getOwnPropertyDescriptor,ge=(e,t,i,a)=>{for(var r=a>1?void 0:a?Vy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Gy(t,i,r),r};let de=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.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.value=void 0,this.invalidDateMessage=void 0,this.minDate=void 0,this.maxDate=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.inputBlockClass="gui-date-input",this.groups=["default"],this.partDescriptors=Ar(),this._parts=new Ot(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0}))}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getPartDescriptor(e){return this.partDescriptors[e]}willUpdate(e){e.has("value")&&this._parts.setGroupFromISO("default",this.value??"","date")}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={blockClass:this.inputBlockClass,groups:this.groups,formatParts:$n(this.localeId),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(a,r)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel})[r]??St[r],disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return d.html`
|
|
1584
|
+
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
1589
1585
|
|
|
1590
1586
|
<div class="gui-widget">
|
|
1591
1587
|
<div
|
|
@@ -1594,7 +1590,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1594
1590
|
role="group"
|
|
1595
1591
|
aria-labelledby=${`${this.uid}_label`}
|
|
1596
1592
|
>
|
|
1597
|
-
${
|
|
1593
|
+
${gt("default",t,this._parts)}
|
|
1598
1594
|
</div>
|
|
1599
1595
|
${this.icon?d.html`<span
|
|
1600
1596
|
class=${S.classMap(i)}
|
|
@@ -1604,7 +1600,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1604
1600
|
</div>
|
|
1605
1601
|
|
|
1606
1602
|
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
1607
|
-
`}validateAndEmit(e){const{result:t,writeBacks:i}=Zn(this._parts.values[e]??{},{descriptors:this.partDescriptors,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,i),t.kind==="invalid")this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t.message},bubbles:!0}));else if(t.kind==="valid"){const a=
|
|
1603
|
+
`}validateAndEmit(e){const{result:t,writeBacks:i}=Zn(this._parts.values[e]??{},{descriptors:this.partDescriptors,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,i),t.kind==="invalid")this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t.message},bubbles:!0}));else if(t.kind==="valid"){const a=Zt(t.iso,this.minDate,this.maxDate,void 0,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage});if(a){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:a},bubbles:!0})),this.requestUpdate();return}this.value=t.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}this.requestUpdate()}};ge([n.property({type:String})],de.prototype,"uid",2),ge([n.property({type:String})],de.prototype,"label",2),ge([n.property({type:String,attribute:"locale-id"})],de.prototype,"localeId",2),ge([n.property({type:Array})],de.prototype,"errors",2),ge([n.property({type:Boolean})],de.prototype,"showErrors",2),ge([n.property({type:Boolean})],de.prototype,"touched",2),ge([n.property({type:Boolean})],de.prototype,"required",2),ge([n.property({type:Boolean})],de.prototype,"disabled",2),ge([n.property({type:Boolean,attribute:"readonly"})],de.prototype,"readOnly",2),ge([n.property({type:String})],de.prototype,"icon",2),ge([n.property({type:String})],de.prototype,"hint",2),ge([n.property({type:String})],de.prototype,"dayAriaLabel",2),ge([n.property({type:String})],de.prototype,"monthAriaLabel",2),ge([n.property({type:String})],de.prototype,"yearAriaLabel",2),ge([n.property({type:String})],de.prototype,"value",2),ge([n.property({type:String,attribute:"invalid-date-message"})],de.prototype,"invalidDateMessage",2),ge([n.property({type:String,attribute:"min-date"})],de.prototype,"minDate",2),ge([n.property({type:String,attribute:"max-date"})],de.prototype,"maxDate",2),ge([n.property({type:String,attribute:"min-date-message"})],de.prototype,"minDateMessage",2),ge([n.property({type:String,attribute:"max-date-message"})],de.prototype,"maxDateMessage",2),de=ge([n.customElement("gui-date")],de),typeof customElements<"u"&&!customElements.get("gui-date")&&customElements.define("gui-date",de);var Zy=Object.defineProperty,Yy=Object.getOwnPropertyDescriptor,Nr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Yy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Zy(t,i,r),r};let ni=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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=Qe("date",this.adapter.templateData);return d.html`
|
|
1608
1604
|
<gui-date
|
|
1609
1605
|
class=${S.classMap(e.widgetClasses)}
|
|
1610
1606
|
.uid=${this.widget.uid}
|
|
@@ -1630,7 +1626,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1630
1626
|
@blur=${()=>this.adapter.onBlur()}
|
|
1631
1627
|
@change=${this.valueChanged}
|
|
1632
1628
|
></gui-date>
|
|
1633
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Nr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1629
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Nr([f.consume({context:m.formContext}),n.property({attribute:!1})],ni.prototype,"formContext",2),Nr([f.provide({context:m.inputContext})],ni.prototype,"adapter",2),ni=Nr([n.customElement("gui-date-input")],ni);const Hy=Object.freeze(Object.defineProperty({__proto__:null,get DateElement(){return ni}},Symbol.toStringTag,{value:"Module"}));var Wy=Object.defineProperty,Ky=Object.getOwnPropertyDescriptor,F=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ky(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Wy(t,i,r),r};let O=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this._popup=new Rt(this,{focusRestoreSelector:"gui-date input",focusPopupSelector:'.gui-calendar__day-button[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")?"ignore":e.closest(".gui-date-input__part")||e.closest("gui-calendar")?"open":"toggle",keyToggleMode:"toggle"}),this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}render(){const e=Qe("datePicker",{icon:this.icon}),t=this._popup.open?d.html`<gui-calendar
|
|
1634
1630
|
id=${`${this.uid}_popup`}
|
|
1635
1631
|
role="dialog"
|
|
1636
1632
|
aria-label=${this.label??"Calendar"}
|
|
@@ -1658,7 +1654,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1658
1654
|
@blur=${this.onCalendarBlur}
|
|
1659
1655
|
@change=${this.onCalendarChange}
|
|
1660
1656
|
></gui-calendar>`:d.nothing;return d.html`
|
|
1661
|
-
${
|
|
1657
|
+
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1662
1658
|
|
|
1663
1659
|
<div
|
|
1664
1660
|
class="gui-widget"
|
|
@@ -1714,7 +1710,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1714
1710
|
</div>
|
|
1715
1711
|
|
|
1716
1712
|
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
1717
|
-
`}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){e.stopPropagation(),this.commitValue(e.detail.value),this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){return e?
|
|
1713
|
+
`}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){e.stopPropagation(),this.commitValue(e.detail.value),this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){return e?Zt(e,this.minDate,this.maxDate,this.disabledRanges,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage,disabledDateRangeMessage:this.disabledDateRangeMessage}):null}onCalendarBlur(){this._popup.closeOnFocusLeave()}};F([n.property({type:String})],O.prototype,"uid",2),F([n.property({type:String})],O.prototype,"label",2),F([n.property({type:String})],O.prototype,"hint",2),F([n.property({type:String})],O.prototype,"icon",2),F([n.property({type:String,attribute:"toggle-aria-label"})],O.prototype,"toggleAriaLabel",2),F([n.property({type:String})],O.prototype,"dayAriaLabel",2),F([n.property({type:String})],O.prototype,"monthAriaLabel",2),F([n.property({type:String})],O.prototype,"yearAriaLabel",2),F([n.property({type:Array})],O.prototype,"errors",2),F([n.property({type:Boolean})],O.prototype,"showErrors",2),F([n.property({type:Boolean})],O.prototype,"touched",2),F([n.property({type:Boolean})],O.prototype,"required",2),F([n.property({type:Boolean})],O.prototype,"disabled",2),F([n.property({type:Boolean,attribute:"readonly"})],O.prototype,"readOnly",2),F([n.property({type:String,attribute:"locale-id"})],O.prototype,"localeId",2),F([n.property({type:String})],O.prototype,"value",2),F([n.property({type:String,attribute:"prev-month-icon"})],O.prototype,"prevMonthIcon",2),F([n.property({type:String,attribute:"next-month-icon"})],O.prototype,"nextMonthIcon",2),F([n.property({type:String,attribute:"prev-month-aria-label"})],O.prototype,"prevMonthAriaLabel",2),F([n.property({type:String,attribute:"next-month-aria-label"})],O.prototype,"nextMonthAriaLabel",2),F([n.property({type:String,attribute:"select-year-aria-label"})],O.prototype,"selectYearAriaLabel",2),F([n.property({type:String,attribute:"year-grid-aria-label"})],O.prototype,"yearGridAriaLabel",2),F([n.property({type:String,attribute:"day-format"})],O.prototype,"dayFormat",2),F([n.property({type:String,attribute:"weekday-format"})],O.prototype,"weekdayFormat",2),F([n.property({type:String,attribute:"month-format"})],O.prototype,"monthFormat",2),F([n.property({type:String,attribute:"min-date"})],O.prototype,"minDate",2),F([n.property({type:String,attribute:"max-date"})],O.prototype,"maxDate",2),F([n.property({type:Array,attribute:"disabled-ranges"})],O.prototype,"disabledRanges",2),F([n.property({type:Number,attribute:"number-of-months"})],O.prototype,"numberOfMonths",2),F([n.property({type:String,attribute:"invalid-date-message"})],O.prototype,"invalidDateMessage",2),F([n.property({type:String,attribute:"min-date-message"})],O.prototype,"minDateMessage",2),F([n.property({type:String,attribute:"max-date-message"})],O.prototype,"maxDateMessage",2),F([n.property({type:String,attribute:"disabled-date-range-message"})],O.prototype,"disabledDateRangeMessage",2),O=F([n.customElement("gui-date-picker")],O),typeof customElements<"u"&&!customElements.get("gui-date-picker")&&customElements.define("gui-date-picker",O);var Jy=Object.defineProperty,Xy=Object.getOwnPropertyDescriptor,qr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Xy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Jy(t,i,r),r};let oi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-picker","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=this.adapter.templateData;return d.html`
|
|
1718
1714
|
<gui-date-picker
|
|
1719
1715
|
.uid=${this.widget.uid}
|
|
1720
1716
|
.label=${e.label}
|
|
@@ -1752,8 +1748,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1752
1748
|
@blur=${()=>this.adapter.onBlur()}
|
|
1753
1749
|
@change=${this.valueChanged}
|
|
1754
1750
|
></gui-date-picker>
|
|
1755
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};qr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1756
|
-
${this.label?
|
|
1751
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};qr([f.consume({context:m.formContext}),n.property({attribute:!1})],oi.prototype,"formContext",2),qr([f.provide({context:m.inputContext})],oi.prototype,"adapter",2),oi=qr([n.customElement("gui-date-picker-input")],oi);const Qy=Object.freeze(Object.defineProperty({__proto__:null,get DatePickerElement(){return oi}},Symbol.toStringTag,{value:"Module"}));var jy=Object.defineProperty,eg=Object.getOwnPropertyDescriptor,K=(e,t,i,a)=>{for(var r=a>1?void 0:a?eg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&jy(t,i,r),r};let V=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.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.hourFormat=void 0,this.minuteStep=1,this.invalidDateMessage=void 0,this.value=void 0,this.minDate=void 0,this.maxDate=void 0,this.minTime=void 0,this.maxTime=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.inputBlockClass="gui-date-time-input",this.groups=["default"],this._parts=new Ot(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0})),getHourFormat:()=>this.localeData.effectiveHourFormat,getDayPeriodLabels:()=>this.localeData.dayPeriodLabels}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get localeData(){return la(this.localeId,this.hourFormat,this.minuteStep,!0)}getPartDescriptor(e){return this.localeData.descriptors[e]}boundsError(e,t){return Zt(e,this.minDate,this.maxDate,void 0,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage})??oa(yt(t),{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage})}willUpdate(e){(!this.hasUpdated||e.has("value")||e.has("hourFormat")||e.has("localeId"))&&this._parts.setGroupFromISO("default",this.value??"","dateTime",this.localeData.effectiveHourFormat)}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={blockClass:this.inputBlockClass,groups:this.groups,formatParts:xn(this.localeId,this.localeData.effectiveHourFormat),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(a,r)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel,hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[r]??St[r],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return d.html`
|
|
1752
|
+
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
1757
1753
|
|
|
1758
1754
|
<div class="gui-widget">
|
|
1759
1755
|
<div
|
|
@@ -1762,7 +1758,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1762
1758
|
role="group"
|
|
1763
1759
|
aria-labelledby=${`${this.uid}_label`}
|
|
1764
1760
|
>
|
|
1765
|
-
${
|
|
1761
|
+
${gt("default",t,this._parts)}
|
|
1766
1762
|
</div>
|
|
1767
1763
|
${this.icon?d.html`<span
|
|
1768
1764
|
class=${S.classMap(i)}
|
|
@@ -1810,7 +1806,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1810
1806
|
@blur=${this.onCalendarBlur}
|
|
1811
1807
|
@change=${this.onCalendarChange}
|
|
1812
1808
|
></gui-date-time-calendar>`:d.nothing;return d.html`
|
|
1813
|
-
${
|
|
1809
|
+
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1814
1810
|
|
|
1815
1811
|
<div
|
|
1816
1812
|
class="gui-widget"
|
|
@@ -1875,7 +1871,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1875
1871
|
</div>
|
|
1876
1872
|
|
|
1877
1873
|
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
1878
|
-
`}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),e.detail.value&&e.detail.commit&&this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e)return null;const t=ee(e);if(isNaN(t.getTime()))return null;const i=
|
|
1874
|
+
`}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),e.detail.value&&e.detail.commit&&this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e)return null;const t=ee(e);if(isNaN(t.getTime()))return null;const i=ie(t),a=Zt(i,this.minDate,this.maxDate,this.disabledRanges,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage,disabledDateRangeMessage:this.disabledDateRangeMessage});if(a)return a;const r=Mn(this.disabledTimeRanges,i);return sa(yt(t),r)?this.disabledTimeRangeMessage??Hi:null}onCalendarBlur(){this._popup.closeOnFocusLeave()}};T([n.property({type:String})],k.prototype,"uid",2),T([n.property({type:String})],k.prototype,"label",2),T([n.property({type:String})],k.prototype,"hint",2),T([n.property({type:String})],k.prototype,"icon",2),T([n.property({type:String,attribute:"toggle-aria-label"})],k.prototype,"toggleAriaLabel",2),T([n.property({type:String})],k.prototype,"dayAriaLabel",2),T([n.property({type:String})],k.prototype,"monthAriaLabel",2),T([n.property({type:String})],k.prototype,"yearAriaLabel",2),T([n.property({type:String})],k.prototype,"hourAriaLabel",2),T([n.property({type:String})],k.prototype,"minuteAriaLabel",2),T([n.property({type:String})],k.prototype,"dayPeriodAriaLabel",2),T([n.property({type:Array})],k.prototype,"errors",2),T([n.property({type:Boolean})],k.prototype,"showErrors",2),T([n.property({type:Boolean})],k.prototype,"touched",2),T([n.property({type:Boolean})],k.prototype,"required",2),T([n.property({type:Boolean})],k.prototype,"disabled",2),T([n.property({type:Boolean,attribute:"readonly"})],k.prototype,"readOnly",2),T([n.property({type:String,attribute:"locale-id"})],k.prototype,"localeId",2),T([n.property({type:String})],k.prototype,"value",2),T([n.property({type:String,attribute:"prev-month-icon"})],k.prototype,"prevMonthIcon",2),T([n.property({type:String,attribute:"next-month-icon"})],k.prototype,"nextMonthIcon",2),T([n.property({type:String,attribute:"prev-month-aria-label"})],k.prototype,"prevMonthAriaLabel",2),T([n.property({type:String,attribute:"next-month-aria-label"})],k.prototype,"nextMonthAriaLabel",2),T([n.property({type:String,attribute:"select-year-aria-label"})],k.prototype,"selectYearAriaLabel",2),T([n.property({type:String,attribute:"year-grid-aria-label"})],k.prototype,"yearGridAriaLabel",2),T([n.property({type:String,attribute:"day-format"})],k.prototype,"dayFormat",2),T([n.property({type:String,attribute:"weekday-format"})],k.prototype,"weekdayFormat",2),T([n.property({type:String,attribute:"month-format"})],k.prototype,"monthFormat",2),T([n.property({type:String,attribute:"min-date"})],k.prototype,"minDate",2),T([n.property({type:String,attribute:"max-date"})],k.prototype,"maxDate",2),T([n.property({type:Array,attribute:"disabled-ranges"})],k.prototype,"disabledRanges",2),T([n.property({type:Number,attribute:"number-of-months"})],k.prototype,"numberOfMonths",2),T([n.property({type:String,attribute:"hour-format"})],k.prototype,"hourFormat",2),T([n.property({type:Number,attribute:"minute-step"})],k.prototype,"minuteStep",2),T([n.property({type:String,attribute:"min-time"})],k.prototype,"minTime",2),T([n.property({type:String,attribute:"max-time"})],k.prototype,"maxTime",2),T([n.property({type:Array,attribute:"disabled-time-ranges"})],k.prototype,"disabledTimeRanges",2),T([n.property({type:Boolean,attribute:"allow-custom-time"})],k.prototype,"allowCustomTime",2),T([n.property({type:String,attribute:"invalid-date-message"})],k.prototype,"invalidDateMessage",2),T([n.property({type:String,attribute:"min-date-message"})],k.prototype,"minDateMessage",2),T([n.property({type:String,attribute:"max-date-message"})],k.prototype,"maxDateMessage",2),T([n.property({type:String,attribute:"disabled-date-range-message"})],k.prototype,"disabledDateRangeMessage",2),T([n.property({type:String,attribute:"min-time-message"})],k.prototype,"minTimeMessage",2),T([n.property({type:String,attribute:"max-time-message"})],k.prototype,"maxTimeMessage",2),T([n.property({type:String,attribute:"disabled-time-range-message"})],k.prototype,"disabledTimeRangeMessage",2),T([n.property({type:String,attribute:"no-available-times-message"})],k.prototype,"noAvailableTimesMessage",2),k=T([n.customElement("gui-date-time-picker")],k),typeof customElements<"u"&&!customElements.get("gui-date-time-picker")&&customElements.define("gui-date-time-picker",k);var ag=Object.defineProperty,rg=Object.getOwnPropertyDescriptor,zr=(e,t,i,a)=>{for(var r=a>1?void 0:a?rg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ag(t,i,r),r};let li=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time-picker","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=this.adapter.templateData;return d.html`
|
|
1879
1875
|
<gui-date-time-picker
|
|
1880
1876
|
.uid=${this.widget.uid}
|
|
1881
1877
|
.label=${e.label}
|
|
@@ -1926,7 +1922,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1926
1922
|
@blur=${()=>this.adapter.onBlur()}
|
|
1927
1923
|
@change=${this.valueChanged}
|
|
1928
1924
|
></gui-date-time-picker>
|
|
1929
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};zr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
1925
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};zr([f.consume({context:m.formContext}),n.property({attribute:!1})],li.prototype,"formContext",2),zr([f.provide({context:m.inputContext})],li.prototype,"adapter",2),li=zr([n.customElement("gui-date-time-picker-input")],li);const sg=Object.freeze(Object.defineProperty({__proto__:null,get DateTimePickerElement(){return li}},Symbol.toStringTag,{value:"Module"})),io=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`
|
|
1930
1926
|
<div
|
|
1931
1927
|
role="option"
|
|
1932
1928
|
class=${S.classMap(t)}
|
|
@@ -1935,7 +1931,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1935
1931
|
>
|
|
1936
1932
|
${e.template}
|
|
1937
1933
|
</div>
|
|
1938
|
-
`};var ng=Object.defineProperty,og=Object.getOwnPropertyDescriptor,lt=(e,t,i,a)=>{for(var r=a>1?void 0:a?og(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ng(t,i,r),r};let je=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 he(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,required:this.required}})})}createRenderRoot(){return this}render(){return super.render(),d.html`${
|
|
1934
|
+
`};var ng=Object.defineProperty,og=Object.getOwnPropertyDescriptor,lt=(e,t,i,a)=>{for(var r=a>1?void 0:a?og(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ng(t,i,r),r};let je=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 he(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,required:this.required}})})}createRenderRoot(){return this}render(){return super.render(),d.html`${oe(this.uid,{label:this.label,hint:this.hint,required:this.required,errors:this.errors,touched:this.touched},!1,void 0,this.native)}`}};lt([n.property({type:Object})],je.prototype,"targetElement",2),lt([n.property({type:String})],je.prototype,"uid",2),lt([n.property({type:String})],je.prototype,"label",2),lt([n.property({type:String})],je.prototype,"hint",2),lt([n.property({type:Boolean})],je.prototype,"required",2),lt([n.property({type:Array})],je.prototype,"errors",2),lt([n.property({type:Boolean})],je.prototype,"disabled",2),lt([n.property({type:Boolean,attribute:"readonly"})],je.prototype,"readOnly",2),lt([n.property({type:Boolean})],je.prototype,"touched",2),lt([n.property({type:Boolean})],je.prototype,"native",2),je=lt([n.customElement("gui-label")],je),typeof customElements<"u"&&!customElements.get("gui-label")&&customElements.define("gui-label",je);const lg=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"template")&&Object.prototype.hasOwnProperty.call(e,"value");function dg(e){const t=typeof e;return t==="string"||t==="number"}const ug=(e,{valueField:t})=>{if(e===null||typeof e!="object")return!1;const i=e,a=t??"value";return!!Object.prototype.hasOwnProperty.call(i,a)};function pg(e,{valueField:t}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const i=e,a=t??"value",r=Object.prototype.hasOwnProperty.call(i,a)?a:void 0;if(!r)throw new Error("No valueField exists on the object");return s=>{if(s===null||typeof s!="object")throw new Error("Item is not an object");const o=s;return{template:s,value:r?o[r]:"",...typeof o.disabled=="boolean"?{disabled:o.disabled}:{}}}}const hg=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!lg(e[0])){if(dg(e[0]))return e.map(i=>({template:i,value:i}));if(ug(e[0],t)){const i=pg(e[0],t);return e.map(i)}else throw new Error("Invalid list item shape")}return e};var cg=Object.defineProperty,mg=Object.getOwnPropertyDescriptor,Le=(e,t,i,a)=>{for(var r=a>1?void 0:a?mg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&cg(t,i,r),r};let De=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,this.onKeyDown=e=>{if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),a=this.items.length-1;let r=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(this.findEnabledIndex(Math.min(this._focusedIndex+1,a),1)),r=!0;break;case"ArrowUp":this.setFocusedIndex(this.findEnabledIndex(Math.max(this._focusedIndex-1,0),-1)),r=!0;break;case"PageDown":this.setFocusedIndex(this.findEnabledIndex(Math.min(this._focusedIndex+i,a),1)),r=!0;break;case"PageUp":this.setFocusedIndex(this.findEnabledIndex(Math.max(this._focusedIndex-i,0),-1)),r=!0;break;case"Home":this.setFocusedIndex(this.findEnabledIndex(0,1)),r=!0;break;case"End":this.setFocusedIndex(this.findEnabledIndex(a,-1)),r=!0;break;case"Enter":case" ":{const s=this._items[this._focusedIndex];this._focusedIndex>=0&&s!=null&&!s.disabled&&this.selectItem(s),r=!0;break}}r&&e.preventDefault()},this.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}))},this.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})))}}willUpdate(e){super.willUpdate(e),e.has("items")&&this.updateItems(),(e.has("items")||e.has("_scrollTop")||e.has("height"))&&this.emitRangeChange(),this.syncHostAria()}syncHostAria(){this.setAttribute("role","listbox"),this.tabIndex=this.disabled?-1:0;const e=(t,i)=>{i===null?this.removeAttribute(t):this.setAttribute(t,i)};e("aria-required",this.required?"true":null),e("aria-disabled",this.disabled||this.readOnly?"true":null),e("aria-activedescendant",this._focusedIndex>=0?`${this.uid}-item-${this._focusedIndex}`:null),e("aria-label",this.label??null),e("aria-description",this.hint??null)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("focus",this.onFocus),this.addEventListener("focusout",this.onFocusOut)}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:a}=this.calculateRange();return d.html`
|
|
1939
1935
|
<div
|
|
1940
1936
|
class="gui-list__scroll-viewport"
|
|
1941
1937
|
style="max-height: ${e}px; min-height: 40px; overflow-y: auto; position: relative; display: block;"
|
|
@@ -2043,7 +2039,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2043
2039
|
.errors=${e.errors}
|
|
2044
2040
|
.touched=${e.touched}
|
|
2045
2041
|
></gui-errors>`:d.nothing}
|
|
2046
|
-
`}};at([f.consume({context:m.formContext}),n.property({attribute:!1})],Ye.prototype,"formContext",2),at([f.provide({context:m.inputContext})],Ye.prototype,"adapter",2),at([n.state()],Ye.prototype,"_range",2),at([n.state()],Ye.prototype,"_filteredItems",2),at([n.state()],Ye.prototype,"_listItems",2),at([n.state()],Ye.prototype,"_focusedIndex",2),at([n.state()],Ye.prototype,"_isFiltering",2),at([n.state()],Ye.prototype,"_isListVisible",2),at([n.state()],Ye.prototype,"_selectedItem",2),at([n.query("input")],Ye.prototype,"_inputRef",2),at([n.query("gui-list")],Ye.prototype,"_listRef",2),Ye=at([n.customElement("gui-dropdown-input")],Ye);const vg=Object.freeze(Object.defineProperty({__proto__:null,get DropdownElement(){return Ye}},Symbol.toStringTag,{value:"Module"}));var Dg=Object.defineProperty,wg=Object.getOwnPropertyDescriptor,
|
|
2042
|
+
`}};at([f.consume({context:m.formContext}),n.property({attribute:!1})],Ye.prototype,"formContext",2),at([f.provide({context:m.inputContext})],Ye.prototype,"adapter",2),at([n.state()],Ye.prototype,"_range",2),at([n.state()],Ye.prototype,"_filteredItems",2),at([n.state()],Ye.prototype,"_listItems",2),at([n.state()],Ye.prototype,"_focusedIndex",2),at([n.state()],Ye.prototype,"_isFiltering",2),at([n.state()],Ye.prototype,"_isListVisible",2),at([n.state()],Ye.prototype,"_selectedItem",2),at([n.query("input")],Ye.prototype,"_inputRef",2),at([n.query("gui-list")],Ye.prototype,"_listRef",2),Ye=at([n.customElement("gui-dropdown-input")],Ye);const vg=Object.freeze(Object.defineProperty({__proto__:null,get DropdownElement(){return Ye}},Symbol.toStringTag,{value:"Module"}));var Dg=Object.defineProperty,wg=Object.getOwnPropertyDescriptor,_t=(e,t,i,a)=>{for(var r=a>1?void 0:a?wg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Dg(t,i,r),r};let bt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[],this._range={start:0,end:10},this._listItems=[],this._focusedIndex=-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(),this.classList.add("gui-list","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems.length===0&&(this._listItems=e.items),this.requestUpdate()}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}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),a=this.adapter.getItemRenderer(e.itemRenderer,io);return d.html`
|
|
2047
2043
|
<gui-label
|
|
2048
2044
|
.targetElement=${this._guiListRef}
|
|
2049
2045
|
.uid=${this.widget.uid}
|
|
@@ -2097,11 +2093,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2097
2093
|
.errors=${e.errors}
|
|
2098
2094
|
.touched=${e.touched}
|
|
2099
2095
|
></gui-errors>`:d.nothing}
|
|
2100
|
-
`}_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||e.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)}};
|
|
2096
|
+
`}_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||e.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)}};_t([f.consume({context:m.formContext}),n.property({attribute:!1})],bt.prototype,"formContext",2),_t([f.provide({context:m.inputContext})],bt.prototype,"adapter",2),_t([n.state()],bt.prototype,"_range",2),_t([n.state()],bt.prototype,"_listItems",2),_t([n.state()],bt.prototype,"_focusedIndex",2),_t([n.query("gui-list")],bt.prototype,"_guiListRef",2),bt=_t([n.customElement("gui-list-input")],bt);const $g=Object.freeze(Object.defineProperty({__proto__:null,get ListElement(){return bt}},Symbol.toStringTag,{value:"Module"}));var kg=Object.defineProperty,Tg=Object.getOwnPropertyDescriptor,Ur=(e,t,i,a)=>{for(var r=a>1?void 0:a?Tg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&kg(t,i,r),r};let di=class extends d.LitElement{constructor(){super(...arguments),this.md=void 0,this.dependencies=void 0}createRenderRoot(){return this}render(){return d.html`${oo.unsafeHTML(this.dependencies?.markdown?.parse(this.md??""))}`}};Ur([n.property({type:String})],di.prototype,"md",2),Ur([n.property({type:Object})],di.prototype,"dependencies",2),di=Ur([n.customElement("gui-markdown-text")],di),typeof customElements<"u"&&!customElements.get("gui-markdown-text")&&customElements.define("gui-markdown-text",di);var Sg=Object.defineProperty,_g=Object.getOwnPropertyDescriptor,Z=(e,t,i,a)=>{for(var r=a>1?void 0:a?_g(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Sg(t,i,r),r};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.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.toolbarAriaLabel=void 0,this.dependencies=void 0,this.splitViewActive=!1,this.activeFormats={},this.splitViewInitialized=!1,this.ariaController=new he(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,required:this.required}})})}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 r={"gui-markdown--counter":!0,"gui-markdown--counter__error":(e.value?.length??0)>e.maxLength},s=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=${S.classMap(r)}>
|
|
2101
2097
|
${s}
|
|
2102
2098
|
<span> / ${e.maxLength}</span>
|
|
2103
2099
|
</div>`}const a={"min-height":`${e.minimumHeight}px`};return d.html`
|
|
2104
|
-
${
|
|
2100
|
+
${oe(this.uid,e)}
|
|
2105
2101
|
|
|
2106
2102
|
<div
|
|
2107
2103
|
class=${S.classMap({"gui-widget":!0,"gui-markdown--with-preview":this.splitViewActive})}
|
|
@@ -2143,7 +2139,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2143
2139
|
<textarea
|
|
2144
2140
|
id=${ma.ifDefined(this.uid)}
|
|
2145
2141
|
class=${S.classMap(t)}
|
|
2146
|
-
style=${
|
|
2142
|
+
style=${Dt.styleMap(a)}
|
|
2147
2143
|
?required=${e.required}
|
|
2148
2144
|
?disabled=${e.disabled}
|
|
2149
2145
|
?readonly=${e.readonly}
|
|
@@ -2160,7 +2156,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2160
2156
|
<section
|
|
2161
2157
|
data-cy=${ma.ifDefined(this.uid?`${this.uid}_markdown`:d.nothing)}
|
|
2162
2158
|
class="gui-markdown__preview"
|
|
2163
|
-
style=${
|
|
2159
|
+
style=${Dt.styleMap(a)}
|
|
2164
2160
|
>
|
|
2165
2161
|
<gui-markdown-text
|
|
2166
2162
|
.md=${this.value||""}
|
|
@@ -2371,7 +2367,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2371
2367
|
`,t-1)+1,a=e.indexOf(`
|
|
2372
2368
|
`,t),r=e.substring(i,a===-1?e.length:a),s=t-i,o=/\[[^\]]*\]\([^)]*\)/g;let l;for(;(l=o.exec(r))!==null;)if(s>=l.index&&s<=l.index+l[0].length)return!0;return!1}applyFormat(e,t="",i=""){return()=>{if(this.disabled||this.readOnly)return;const a=this.querySelector(`textarea[id="${this.uid}"]`);if(a){if(i&&this.activeFormats[i])this.removeFormat(a,e,t,i);else{const{selectionStart:r,selectionEnd:s,value:o}=a,l=o.substring(r,s),u=o.substring(0,r),p=o.substring(s);a.value=`${u}${e}${l}${t}${p}`,a.selectionStart=r+e.length,a.selectionEnd=r+e.length+l.length}a.focus(),a.dispatchEvent(new Event("input",{bubbles:!0})),this.detectFormats()}}}removeFormat(e,t,i,a){const{selectionStart:r,value:s}=e,o=s.lastIndexOf(`
|
|
2373
2369
|
`,r-1)+1,l=s.indexOf(`
|
|
2374
|
-
`,r),u=s.substring(o,l===-1?s.length:l);if(i)if(a==="link"){const p=r-o,h=/\[([^\]]*)\]\([^)]*\)/g;let c;for(;(c=h.exec(u))!==null;)if(p>=c.index&&p<=c.index+c[0].length){const y=c[1],g=o+c.index,_=g+c[0].length;e.value=`${s.substring(0,g)}${y}${s.substring(_)}`,e.selectionStart=g,e.selectionEnd=g+y.length;break}}else{const p=r-o;let h=0;for(;h<u.length;){const c=u.indexOf(t,h);if(c===-1)break;const y=u.indexOf(i,c+t.length);if(y===-1)break;if(p>=c&&p<=y+i.length){const g=u.substring(c+t.length,y),_=o+c,L=o+y+i.length;e.value=`${s.substring(0,_)}${g}${s.substring(L)}`,e.selectionStart=_,e.selectionEnd=_+g.length;break}h=y+i.length}}else{let p=t;if(a==="heading"){const g=u.match(/^#{1,6}\s/);g&&(p=g[0])}else if(a==="orderedList"){const g=u.match(/^\d+\.\s/);g&&(p=g[0])}const h=s.substring(0,o),c=u.substring(p.length),y=s.substring(l===-1?s.length:l);e.value=`${h}${c}${y}`,e.selectionStart=Math.max(o,r-p.length),e.selectionEnd=e.selectionStart}}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}))}};Z([n.property({type:String})],B.prototype,"uid",2),Z([n.property({type:String})],B.prototype,"label",2),Z([n.property({type:String,attribute:"locale-id"})],B.prototype,"localeId",2),Z([n.property({type:Array})],B.prototype,"errors",2),Z([n.property({type:Boolean})],B.prototype,"touched",2),Z([n.property({type:Boolean})],B.prototype,"required",2),Z([n.property({type:Boolean})],B.prototype,"disabled",2),Z([n.property({type:Boolean,attribute:"readonly"})],B.prototype,"readOnly",2),Z([n.property({type:String})],B.prototype,"value",2),Z([n.property({type:String})],B.prototype,"hint",2),Z([n.property({type:Array})],B.prototype,"tools",2),Z([n.property({type:String})],B.prototype,"placeholder",2),Z([n.property({type:String})],B.prototype,"autocomplete",2),Z([n.property({type:String,attribute:"countermode"})],B.prototype,"counterMode",2),Z([n.property({type:Number,attribute:"minimumheight"})],B.prototype,"minimumHeight",2),Z([n.property({type:Boolean,attribute:"autogrow"})],B.prototype,"autoGrow",2),Z([n.property({type:Boolean,attribute:"defaultopenpreview"})],B.prototype,"defaultOpenPreview",2),Z([n.property({type:Number,attribute:"maxlength"})],B.prototype,"maxLength",2),Z([n.property({type:String})],B.prototype,"headingTitle",2),Z([n.property({type:String})],B.prototype,"boldTitle",2),Z([n.property({type:String})],B.prototype,"italicTitle",2),Z([n.property({type:String})],B.prototype,"strikethroughTitle",2),Z([n.property({type:String})],B.prototype,"quoteTitle",2),Z([n.property({type:String})],B.prototype,"linkTitle",2),Z([n.property({type:String})],B.prototype,"orderedListTitle",2),Z([n.property({type:String})],B.prototype,"unorderedListTitle",2),Z([n.property({type:String})],B.prototype,"splitViewTitle",2),Z([n.property({type:String,attribute:"toolbar-aria-label"})],B.prototype,"toolbarAriaLabel",2),Z([n.property({type:Object})],B.prototype,"dependencies",2),Z([n.state()],B.prototype,"splitViewActive",2),Z([n.state()],B.prototype,"activeFormats",2),B=Z([n.customElement("gui-markdown")],B),typeof customElements<"u"&&!customElements.get("gui-markdown")&&customElements.define("gui-markdown",B);var Ag=Object.defineProperty,Eg=Object.getOwnPropertyDescriptor,Gr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Eg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ag(t,i,r),r};let
|
|
2370
|
+
`,r),u=s.substring(o,l===-1?s.length:l);if(i)if(a==="link"){const p=r-o,h=/\[([^\]]*)\]\([^)]*\)/g;let c;for(;(c=h.exec(u))!==null;)if(p>=c.index&&p<=c.index+c[0].length){const y=c[1],g=o+c.index,_=g+c[0].length;e.value=`${s.substring(0,g)}${y}${s.substring(_)}`,e.selectionStart=g,e.selectionEnd=g+y.length;break}}else{const p=r-o;let h=0;for(;h<u.length;){const c=u.indexOf(t,h);if(c===-1)break;const y=u.indexOf(i,c+t.length);if(y===-1)break;if(p>=c&&p<=y+i.length){const g=u.substring(c+t.length,y),_=o+c,L=o+y+i.length;e.value=`${s.substring(0,_)}${g}${s.substring(L)}`,e.selectionStart=_,e.selectionEnd=_+g.length;break}h=y+i.length}}else{let p=t;if(a==="heading"){const g=u.match(/^#{1,6}\s/);g&&(p=g[0])}else if(a==="orderedList"){const g=u.match(/^\d+\.\s/);g&&(p=g[0])}const h=s.substring(0,o),c=u.substring(p.length),y=s.substring(l===-1?s.length:l);e.value=`${h}${c}${y}`,e.selectionStart=Math.max(o,r-p.length),e.selectionEnd=e.selectionStart}}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}))}};Z([n.property({type:String})],B.prototype,"uid",2),Z([n.property({type:String})],B.prototype,"label",2),Z([n.property({type:String,attribute:"locale-id"})],B.prototype,"localeId",2),Z([n.property({type:Array})],B.prototype,"errors",2),Z([n.property({type:Boolean})],B.prototype,"touched",2),Z([n.property({type:Boolean})],B.prototype,"required",2),Z([n.property({type:Boolean})],B.prototype,"disabled",2),Z([n.property({type:Boolean,attribute:"readonly"})],B.prototype,"readOnly",2),Z([n.property({type:String})],B.prototype,"value",2),Z([n.property({type:String})],B.prototype,"hint",2),Z([n.property({type:Array})],B.prototype,"tools",2),Z([n.property({type:String})],B.prototype,"placeholder",2),Z([n.property({type:String})],B.prototype,"autocomplete",2),Z([n.property({type:String,attribute:"countermode"})],B.prototype,"counterMode",2),Z([n.property({type:Number,attribute:"minimumheight"})],B.prototype,"minimumHeight",2),Z([n.property({type:Boolean,attribute:"autogrow"})],B.prototype,"autoGrow",2),Z([n.property({type:Boolean,attribute:"defaultopenpreview"})],B.prototype,"defaultOpenPreview",2),Z([n.property({type:Number,attribute:"maxlength"})],B.prototype,"maxLength",2),Z([n.property({type:String})],B.prototype,"headingTitle",2),Z([n.property({type:String})],B.prototype,"boldTitle",2),Z([n.property({type:String})],B.prototype,"italicTitle",2),Z([n.property({type:String})],B.prototype,"strikethroughTitle",2),Z([n.property({type:String})],B.prototype,"quoteTitle",2),Z([n.property({type:String})],B.prototype,"linkTitle",2),Z([n.property({type:String})],B.prototype,"orderedListTitle",2),Z([n.property({type:String})],B.prototype,"unorderedListTitle",2),Z([n.property({type:String})],B.prototype,"splitViewTitle",2),Z([n.property({type:String,attribute:"toolbar-aria-label"})],B.prototype,"toolbarAriaLabel",2),Z([n.property({type:Object})],B.prototype,"dependencies",2),Z([n.state()],B.prototype,"splitViewActive",2),Z([n.state()],B.prototype,"activeFormats",2),B=Z([n.customElement("gui-markdown")],B),typeof customElements<"u"&&!customElements.get("gui-markdown")&&customElements.define("gui-markdown",B);var Ag=Object.defineProperty,Eg=Object.getOwnPropertyDescriptor,Gr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Eg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ag(t,i,r),r};let ui=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-markdown","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`
|
|
2375
2371
|
<gui-markdown
|
|
2376
2372
|
.uid=${this.widget.uid}
|
|
2377
2373
|
.label=${this.adapter.templateData.label}
|
|
@@ -2404,8 +2400,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2404
2400
|
@input=${this.valueChanged}
|
|
2405
2401
|
@blur=${()=>this.adapter.onBlur()}
|
|
2406
2402
|
></gui-markdown>
|
|
2407
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Gr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2408
|
-
${
|
|
2403
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Gr([f.consume({context:m.formContext}),n.property({attribute:!1})],ui.prototype,"formContext",2),Gr([f.provide({context:m.inputContext})],ui.prototype,"adapter",2),ui=Gr([n.customElement("gui-markdown-input")],ui);const Cg=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownElement(){return ui}},Symbol.toStringTag,{value:"Module"}));var Lg=Object.defineProperty,Ig=Object.getOwnPropertyDescriptor,ke=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ig(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Lg(t,i,r),r};let be=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 he(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,required:this.required}})})}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=Qe("password",e),i={"gui-widget-input":!0,"gui-password--icon":!!this.icon};return d.html`
|
|
2404
|
+
${oe(this.uid,e)}
|
|
2409
2405
|
|
|
2410
2406
|
<div class="gui-widget">
|
|
2411
2407
|
<input
|
|
@@ -2438,7 +2434,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2438
2434
|
</div>
|
|
2439
2435
|
|
|
2440
2436
|
${j(this.uid,e)}
|
|
2441
|
-
`}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}))}};ke([n.property({type:String})],be.prototype,"uid",2),ke([n.property({type:String})],be.prototype,"label",2),ke([n.property({type:String,attribute:"locale-id"})],be.prototype,"localeId",2),ke([n.property({type:Array})],be.prototype,"errors",2),ke([n.property({type:Boolean})],be.prototype,"touched",2),ke([n.property({type:Boolean})],be.prototype,"required",2),ke([n.property({type:Boolean})],be.prototype,"disabled",2),ke([n.property({type:Boolean,attribute:"readonly"})],be.prototype,"readOnly",2),ke([n.property({type:String})],be.prototype,"value",2),ke([n.property({type:String})],be.prototype,"hint",2),ke([n.property({type:String})],be.prototype,"icon",2),ke([n.property({type:String})],be.prototype,"placeholder",2),ke([n.property({type:String})],be.prototype,"autocomplete",2),ke([n.property({type:String})],be.prototype,"showPasswordIcon",2),ke([n.property({type:String})],be.prototype,"hidePasswordIcon",2),ke([n.property({type:String})],be.prototype,"showPasswordLabel",2),ke([n.property({type:String})],be.prototype,"hidePasswordLabel",2),ke([n.state()],be.prototype,"showPassword",2),be=ke([n.customElement("gui-password")],be),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",be);var xg=Object.defineProperty,Pg=Object.getOwnPropertyDescriptor,Vr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Pg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&xg(t,i,r),r};let
|
|
2437
|
+
`}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}))}};ke([n.property({type:String})],be.prototype,"uid",2),ke([n.property({type:String})],be.prototype,"label",2),ke([n.property({type:String,attribute:"locale-id"})],be.prototype,"localeId",2),ke([n.property({type:Array})],be.prototype,"errors",2),ke([n.property({type:Boolean})],be.prototype,"touched",2),ke([n.property({type:Boolean})],be.prototype,"required",2),ke([n.property({type:Boolean})],be.prototype,"disabled",2),ke([n.property({type:Boolean,attribute:"readonly"})],be.prototype,"readOnly",2),ke([n.property({type:String})],be.prototype,"value",2),ke([n.property({type:String})],be.prototype,"hint",2),ke([n.property({type:String})],be.prototype,"icon",2),ke([n.property({type:String})],be.prototype,"placeholder",2),ke([n.property({type:String})],be.prototype,"autocomplete",2),ke([n.property({type:String})],be.prototype,"showPasswordIcon",2),ke([n.property({type:String})],be.prototype,"hidePasswordIcon",2),ke([n.property({type:String})],be.prototype,"showPasswordLabel",2),ke([n.property({type:String})],be.prototype,"hidePasswordLabel",2),ke([n.state()],be.prototype,"showPassword",2),be=ke([n.customElement("gui-password")],be),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",be);var xg=Object.defineProperty,Pg=Object.getOwnPropertyDescriptor,Vr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Pg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&xg(t,i,r),r};let pi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2442
2438
|
<gui-password
|
|
2443
2439
|
.uid=${this.widget.uid}
|
|
2444
2440
|
.label=${this.adapter.templateData.label}
|
|
@@ -2459,8 +2455,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2459
2455
|
@input=${this.valueChanged}
|
|
2460
2456
|
@blur=${()=>this.adapter.onBlur()}
|
|
2461
2457
|
></gui-password>
|
|
2462
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Vr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2463
|
-
${
|
|
2458
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Vr([f.consume({context:m.formContext}),n.property({attribute:!1})],pi.prototype,"formContext",2),Vr([f.provide({context:m.inputContext})],pi.prototype,"adapter",2),pi=Vr([n.customElement("gui-password-input")],pi);const Mg=Object.freeze(Object.defineProperty({__proto__:null,get PasswordElement(){return pi}},Symbol.toStringTag,{value:"Module"}));var Og=Object.defineProperty,Rg=Object.getOwnPropertyDescriptor,He=(e,t,i,a)=>{for(var r=a>1?void 0:a?Rg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Og(t,i,r),r};let Ne=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 he(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,required:this.required}})})}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=Qe("textinput",e),i={"gui-widget-input":!0,"gui-textinput--icon":!!this.icon};return d.html`
|
|
2459
|
+
${oe(this.uid,e)}
|
|
2464
2460
|
|
|
2465
2461
|
<div class="gui-widget">
|
|
2466
2462
|
<input
|
|
@@ -2481,7 +2477,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2481
2477
|
</div>
|
|
2482
2478
|
|
|
2483
2479
|
${j(this.uid,e)}
|
|
2484
|
-
`}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([n.property({type:String})],Ne.prototype,"uid",2),He([n.property({type:String})],Ne.prototype,"label",2),He([n.property({type:String,attribute:"locale-id"})],Ne.prototype,"localeId",2),He([n.property({type:Array})],Ne.prototype,"errors",2),He([n.property({type:Boolean})],Ne.prototype,"touched",2),He([n.property({type:Boolean})],Ne.prototype,"required",2),He([n.property({type:Boolean})],Ne.prototype,"disabled",2),He([n.property({type:Boolean,attribute:"readonly"})],Ne.prototype,"readOnly",2),He([n.property({type:String})],Ne.prototype,"value",2),He([n.property({type:String})],Ne.prototype,"hint",2),He([n.property({type:String})],Ne.prototype,"icon",2),He([n.property({type:String})],Ne.prototype,"placeholder",2),He([n.property({type:String})],Ne.prototype,"autocomplete",2),Ne=He([n.customElement("gui-textinput")],Ne),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",Ne);var Fg=Object.defineProperty,Bg=Object.getOwnPropertyDescriptor,Zr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Bg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Fg(t,i,r),r};let
|
|
2480
|
+
`}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([n.property({type:String})],Ne.prototype,"uid",2),He([n.property({type:String})],Ne.prototype,"label",2),He([n.property({type:String,attribute:"locale-id"})],Ne.prototype,"localeId",2),He([n.property({type:Array})],Ne.prototype,"errors",2),He([n.property({type:Boolean})],Ne.prototype,"touched",2),He([n.property({type:Boolean})],Ne.prototype,"required",2),He([n.property({type:Boolean})],Ne.prototype,"disabled",2),He([n.property({type:Boolean,attribute:"readonly"})],Ne.prototype,"readOnly",2),He([n.property({type:String})],Ne.prototype,"value",2),He([n.property({type:String})],Ne.prototype,"hint",2),He([n.property({type:String})],Ne.prototype,"icon",2),He([n.property({type:String})],Ne.prototype,"placeholder",2),He([n.property({type:String})],Ne.prototype,"autocomplete",2),Ne=He([n.customElement("gui-textinput")],Ne),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",Ne);var Fg=Object.defineProperty,Bg=Object.getOwnPropertyDescriptor,Zr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Bg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Fg(t,i,r),r};let hi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2485
2481
|
<gui-textinput
|
|
2486
2482
|
.uid=${this.widget.uid}
|
|
2487
2483
|
.label=${this.adapter.templateData.label}
|
|
@@ -2498,7 +2494,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2498
2494
|
@input=${this.valueChanged}
|
|
2499
2495
|
@blur=${()=>this.adapter.onBlur()}
|
|
2500
2496
|
></gui-textinput>
|
|
2501
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Zr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2497
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Zr([f.consume({context:m.formContext}),n.property({attribute:!1})],hi.prototype,"formContext",2),Zr([f.provide({context:m.inputContext})],hi.prototype,"adapter",2),hi=Zr([n.customElement("gui-textinput-input")],hi);const Ng=Object.freeze(Object.defineProperty({__proto__:null,get TextinputElement(){return hi}},Symbol.toStringTag,{value:"Module"}));var qg=Object.defineProperty,zg=Object.getOwnPropertyDescriptor,Yr=(e,t,i,a)=>{for(var r=a>1?void 0:a?zg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&qg(t,i,r),r};let ci=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time","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=Qe("time",this.adapter.templateData);return d.html`
|
|
2502
2498
|
<gui-time
|
|
2503
2499
|
class=${S.classMap(e.widgetClasses)}
|
|
2504
2500
|
.uid=${this.widget.uid}
|
|
@@ -2525,7 +2521,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2525
2521
|
@blur=${()=>this.adapter.onBlur()}
|
|
2526
2522
|
@change=${this.valueChanged}
|
|
2527
2523
|
></gui-time>
|
|
2528
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Yr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2524
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Yr([f.consume({context:m.formContext}),n.property({attribute:!1})],ci.prototype,"formContext",2),Yr([f.provide({context:m.inputContext})],ci.prototype,"adapter",2),ci=Yr([n.customElement("gui-time-input")],ci);const Ug=Object.freeze(Object.defineProperty({__proto__:null,get TimeElement(){return ci}},Symbol.toStringTag,{value:"Module"}));var Gg=Object.defineProperty,Vg=Object.getOwnPropertyDescriptor,Hr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Vg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Gg(t,i,r),r};let mi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time-picker","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=this.adapter.templateData;return d.html`
|
|
2529
2525
|
<gui-time-picker
|
|
2530
2526
|
.uid=${this.widget.uid}
|
|
2531
2527
|
.label=${e.label}
|
|
@@ -2558,7 +2554,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2558
2554
|
@blur=${()=>this.adapter.onBlur()}
|
|
2559
2555
|
@change=${this.valueChanged}
|
|
2560
2556
|
></gui-time-picker>
|
|
2561
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Hr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2557
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Hr([f.consume({context:m.formContext}),n.property({attribute:!1})],mi.prototype,"formContext",2),Hr([f.provide({context:m.inputContext})],mi.prototype,"adapter",2),mi=Hr([n.customElement("gui-time-picker-input")],mi);const Zg=Object.freeze(Object.defineProperty({__proto__:null,get TimePickerElement(){return mi}},Symbol.toStringTag,{value:"Module"}));var Yg=Object.defineProperty,Hg=Object.getOwnPropertyDescriptor,Wr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Hg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Yg(t,i,r),r};let yi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-time","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=Qe("date-time",this.adapter.templateData);return d.html`
|
|
2562
2558
|
<gui-date-time
|
|
2563
2559
|
class=${S.classMap(e.widgetClasses)}
|
|
2564
2560
|
.uid=${this.widget.uid}
|
|
@@ -2593,18 +2589,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2593
2589
|
@blur=${()=>this.adapter.onBlur()}
|
|
2594
2590
|
@change=${this.valueChanged}
|
|
2595
2591
|
></gui-date-time>
|
|
2596
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Wr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2592
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Wr([f.consume({context:m.formContext}),n.property({attribute:!1})],yi.prototype,"formContext",2),Wr([f.provide({context:m.inputContext})],yi.prototype,"adapter",2),yi=Wr([n.customElement("gui-date-time-input")],yi);const Wg=Object.freeze(Object.defineProperty({__proto__:null,get DateTimeElement(){return yi}},Symbol.toStringTag,{value:"Module"}));var Kg=Object.defineProperty,Jg=Object.getOwnPropertyDescriptor,Pe=(e,t,i,a)=>{for(var r=a>1?void 0:a?Jg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Kg(t,i,r),r};let Te=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 he(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,required:this.required}})})}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 r={"gui-textarea--counter":!0,"gui-textarea--counter__error":(e.value?.length??0)>e.maxLength},s=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=${S.classMap(r)}>
|
|
2597
2593
|
${s}
|
|
2598
2594
|
<span> / ${e.maxLength}</span>
|
|
2599
2595
|
</div>`}const i={height:`${e.minimumHeight}px`,"min-height":`${e.minimumHeight}px`},a=this.querySelector(`textarea[id="${this.uid}"]`);if(this.autoGrow&&a){const r=window.getComputedStyle(a),s=parseFloat(r.paddingTop),o=parseFloat(r.paddingBottom),l=s+o;a.style.height="auto",i.height=`${Math.max(this.minimumHeight??120,a.scrollHeight-l)}px`}return d.html`
|
|
2600
|
-
${
|
|
2596
|
+
${oe(this.uid,e)}
|
|
2601
2597
|
|
|
2602
2598
|
<div class="gui-widget">
|
|
2603
2599
|
<textarea
|
|
2604
2600
|
id=${this.uid}
|
|
2605
2601
|
data-cy=${`${this.uid}_textarea`}
|
|
2606
2602
|
class="gui-widget-input"
|
|
2607
|
-
style=${
|
|
2603
|
+
style=${Dt.styleMap(i)}
|
|
2608
2604
|
?required=${e.required}
|
|
2609
2605
|
?disabled=${e.disabled}
|
|
2610
2606
|
?readonly=${e.readonly}
|
|
@@ -2620,7 +2616,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2620
2616
|
<div>${j(this.uid,e)}</div>
|
|
2621
2617
|
${t}
|
|
2622
2618
|
</div>
|
|
2623
|
-
`}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}))}};Pe([n.property({type:String})],Te.prototype,"uid",2),Pe([n.property({type:String})],Te.prototype,"label",2),Pe([n.property({type:String,attribute:"locale-id"})],Te.prototype,"localeId",2),Pe([n.property({type:Array})],Te.prototype,"errors",2),Pe([n.property({type:Boolean})],Te.prototype,"touched",2),Pe([n.property({type:Boolean})],Te.prototype,"required",2),Pe([n.property({type:Boolean})],Te.prototype,"disabled",2),Pe([n.property({type:Boolean,attribute:"readonly"})],Te.prototype,"readOnly",2),Pe([n.property({type:String})],Te.prototype,"value",2),Pe([n.property({type:String})],Te.prototype,"hint",2),Pe([n.property({type:String})],Te.prototype,"placeholder",2),Pe([n.property({type:String})],Te.prototype,"autocomplete",2),Pe([n.property({type:String,attribute:"countermode"})],Te.prototype,"counterMode",2),Pe([n.property({type:Number,attribute:"minimumheight"})],Te.prototype,"minimumHeight",2),Pe([n.property({type:Boolean,attribute:"autogrow"})],Te.prototype,"autoGrow",2),Pe([n.property({type:Number,attribute:"maxlength"})],Te.prototype,"maxLength",2),Te=Pe([n.customElement("gui-textarea")],Te),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",Te);var Xg=Object.defineProperty,Qg=Object.getOwnPropertyDescriptor,Kr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Qg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xg(t,i,r),r};let
|
|
2619
|
+
`}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}))}};Pe([n.property({type:String})],Te.prototype,"uid",2),Pe([n.property({type:String})],Te.prototype,"label",2),Pe([n.property({type:String,attribute:"locale-id"})],Te.prototype,"localeId",2),Pe([n.property({type:Array})],Te.prototype,"errors",2),Pe([n.property({type:Boolean})],Te.prototype,"touched",2),Pe([n.property({type:Boolean})],Te.prototype,"required",2),Pe([n.property({type:Boolean})],Te.prototype,"disabled",2),Pe([n.property({type:Boolean,attribute:"readonly"})],Te.prototype,"readOnly",2),Pe([n.property({type:String})],Te.prototype,"value",2),Pe([n.property({type:String})],Te.prototype,"hint",2),Pe([n.property({type:String})],Te.prototype,"placeholder",2),Pe([n.property({type:String})],Te.prototype,"autocomplete",2),Pe([n.property({type:String,attribute:"countermode"})],Te.prototype,"counterMode",2),Pe([n.property({type:Number,attribute:"minimumheight"})],Te.prototype,"minimumHeight",2),Pe([n.property({type:Boolean,attribute:"autogrow"})],Te.prototype,"autoGrow",2),Pe([n.property({type:Number,attribute:"maxlength"})],Te.prototype,"maxLength",2),Te=Pe([n.customElement("gui-textarea")],Te),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",Te);var Xg=Object.defineProperty,Qg=Object.getOwnPropertyDescriptor,Kr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Qg(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xg(t,i,r),r};let gi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2624
2620
|
<gui-textarea
|
|
2625
2621
|
.uid=${this.widget.uid}
|
|
2626
2622
|
.label=${this.adapter.templateData.label}
|
|
@@ -2640,7 +2636,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2640
2636
|
@input=${this.valueChanged}
|
|
2641
2637
|
@blur=${()=>this.adapter.onBlur()}
|
|
2642
2638
|
></gui-textarea>
|
|
2643
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Kr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2639
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Kr([f.consume({context:m.formContext}),n.property({attribute:!1})],gi.prototype,"formContext",2),Kr([f.provide({context:m.inputContext})],gi.prototype,"adapter",2),gi=Kr([n.customElement("gui-textarea-input")],gi);const jg=Object.freeze(Object.defineProperty({__proto__:null,get TextareaElement(){return gi}},Symbol.toStringTag,{value:"Module"}));var eb=Object.defineProperty,tb=Object.getOwnPropertyDescriptor,rt=(e,t,i,a)=>{for(var r=a>1?void 0:a?tb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&eb(t,i,r),r};let We=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.togglePosition="left",this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1,required:this.required}})})}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,togglePosition:this.togglePosition};return e.togglePosition==="right"?this.classList.add("gui-toggle--right"):this.classList.contains("gui-toggle--right")&&this.classList.remove("gui-toggle--right"),d.html`
|
|
2644
2640
|
<label
|
|
2645
2641
|
class="gui-label"
|
|
2646
2642
|
for=${this.uid}
|
|
@@ -2664,14 +2660,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2664
2660
|
</div>
|
|
2665
2661
|
|
|
2666
2662
|
<span class="gui-label__container">
|
|
2667
|
-
|
|
2663
|
+
<span class="gui-label__text"
|
|
2664
|
+
>${e.label}${Xi(e.required)}</span
|
|
2665
|
+
>
|
|
2668
2666
|
</span>
|
|
2669
2667
|
</label>
|
|
2670
2668
|
|
|
2671
2669
|
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
2672
2670
|
${e.hint??d.nothing} ${j(this.uid,e)}
|
|
2673
2671
|
</div>
|
|
2674
|
-
`}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}))}};rt([n.property({type:String})],We.prototype,"uid",2),rt([n.property({type:String})],We.prototype,"label",2),rt([n.property({type:String,attribute:"locale-id"})],We.prototype,"localeId",2),rt([n.property({type:Array})],We.prototype,"errors",2),rt([n.property({type:Boolean})],We.prototype,"touched",2),rt([n.property({type:Boolean})],We.prototype,"required",2),rt([n.property({type:Boolean})],We.prototype,"disabled",2),rt([n.property({type:Boolean,attribute:"readonly"})],We.prototype,"readOnly",2),rt([n.property({type:String})],We.prototype,"value",2),rt([n.property({type:String})],We.prototype,"hint",2),rt([n.property({type:String})],We.prototype,"togglePosition",2),We=rt([n.customElement("gui-toggle")],We),typeof customElements<"u"&&!customElements.get("gui-toggle")&&customElements.define("gui-toggle",We);var ib=Object.defineProperty,ab=Object.getOwnPropertyDescriptor,Jr=(e,t,i,a)=>{for(var r=a>1?void 0:a?ab(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ib(t,i,r),r};let
|
|
2672
|
+
`}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}))}};rt([n.property({type:String})],We.prototype,"uid",2),rt([n.property({type:String})],We.prototype,"label",2),rt([n.property({type:String,attribute:"locale-id"})],We.prototype,"localeId",2),rt([n.property({type:Array})],We.prototype,"errors",2),rt([n.property({type:Boolean})],We.prototype,"touched",2),rt([n.property({type:Boolean})],We.prototype,"required",2),rt([n.property({type:Boolean})],We.prototype,"disabled",2),rt([n.property({type:Boolean,attribute:"readonly"})],We.prototype,"readOnly",2),rt([n.property({type:String})],We.prototype,"value",2),rt([n.property({type:String})],We.prototype,"hint",2),rt([n.property({type:String})],We.prototype,"togglePosition",2),We=rt([n.customElement("gui-toggle")],We),typeof customElements<"u"&&!customElements.get("gui-toggle")&&customElements.define("gui-toggle",We);var ib=Object.defineProperty,ab=Object.getOwnPropertyDescriptor,Jr=(e,t,i,a)=>{for(var r=a>1?void 0:a?ab(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ib(t,i,r),r};let bi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2675
2673
|
<gui-toggle
|
|
2676
2674
|
.uid=${this.widget.uid}
|
|
2677
2675
|
.label=${this.adapter.templateData.label}
|
|
@@ -2686,7 +2684,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2686
2684
|
@change=${this.valueChanged}
|
|
2687
2685
|
@blur=${()=>this.adapter.onBlur()}
|
|
2688
2686
|
></gui-toggle>
|
|
2689
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Jr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2687
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Jr([f.consume({context:m.formContext}),n.property({attribute:!1})],bi.prototype,"formContext",2),Jr([f.provide({context:m.inputContext})],bi.prototype,"adapter",2),bi=Jr([n.customElement("gui-toggle-input")],bi);const rb=Object.freeze(Object.defineProperty({__proto__:null,get ToggleElement(){return bi}},Symbol.toStringTag,{value:"Module"}));var sb=Object.defineProperty,nb=Object.getOwnPropertyDescriptor,st=(e,t,i,a)=>{for(var r=a>1?void 0:a?nb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&sb(t,i,r),r};let Ke=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=void 0,this.required=void 0,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.checkboxPosition="left",this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1,required:this.required}})})}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,checkboxPosition:this.checkboxPosition};return e.checkboxPosition==="right"?this.classList.add("gui-checkbox--right"):this.classList.contains("gui-checkbox--right")&&this.classList.remove("gui-checkbox--right"),d.html`
|
|
2690
2688
|
<label
|
|
2691
2689
|
class="gui-label"
|
|
2692
2690
|
for=${this.uid}
|
|
@@ -2707,14 +2705,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2707
2705
|
</div>
|
|
2708
2706
|
|
|
2709
2707
|
<span class="gui-label__container">
|
|
2710
|
-
|
|
2708
|
+
<span class="gui-label__text"
|
|
2709
|
+
>${e.label}${Xi(e.required)}</span
|
|
2710
|
+
>
|
|
2711
2711
|
</span>
|
|
2712
2712
|
</label>
|
|
2713
2713
|
|
|
2714
2714
|
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
2715
2715
|
${e.hint??d.nothing} ${j(this.uid,e)}
|
|
2716
2716
|
</div>
|
|
2717
|
-
`}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}))}};st([n.property({type:String})],Ke.prototype,"uid",2),st([n.property({type:String})],Ke.prototype,"label",2),st([n.property({type:String,attribute:"locale-id"})],Ke.prototype,"localeId",2),st([n.property({type:Array})],Ke.prototype,"errors",2),st([n.property({type:Boolean})],Ke.prototype,"touched",2),st([n.property({type:Boolean})],Ke.prototype,"required",2),st([n.property({type:Boolean})],Ke.prototype,"disabled",2),st([n.property({type:Boolean,attribute:"readonly"})],Ke.prototype,"readOnly",2),st([n.property({type:String})],Ke.prototype,"value",2),st([n.property({type:String})],Ke.prototype,"hint",2),st([n.property({type:String})],Ke.prototype,"checkboxPosition",2),Ke=st([n.customElement("gui-checkbox")],Ke),typeof customElements<"u"&&!customElements.get("gui-checkbox")&&customElements.define("gui-checkbox",Ke);var ob=Object.defineProperty,lb=Object.getOwnPropertyDescriptor,Xr=(e,t,i,a)=>{for(var r=a>1?void 0:a?lb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ob(t,i,r),r};let
|
|
2717
|
+
`}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}))}};st([n.property({type:String})],Ke.prototype,"uid",2),st([n.property({type:String})],Ke.prototype,"label",2),st([n.property({type:String,attribute:"locale-id"})],Ke.prototype,"localeId",2),st([n.property({type:Array})],Ke.prototype,"errors",2),st([n.property({type:Boolean})],Ke.prototype,"touched",2),st([n.property({type:Boolean})],Ke.prototype,"required",2),st([n.property({type:Boolean})],Ke.prototype,"disabled",2),st([n.property({type:Boolean,attribute:"readonly"})],Ke.prototype,"readOnly",2),st([n.property({type:String})],Ke.prototype,"value",2),st([n.property({type:String})],Ke.prototype,"hint",2),st([n.property({type:String})],Ke.prototype,"checkboxPosition",2),Ke=st([n.customElement("gui-checkbox")],Ke),typeof customElements<"u"&&!customElements.get("gui-checkbox")&&customElements.define("gui-checkbox",Ke);var ob=Object.defineProperty,lb=Object.getOwnPropertyDescriptor,Xr=(e,t,i,a)=>{for(var r=a>1?void 0:a?lb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ob(t,i,r),r};let fi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2718
2718
|
<gui-checkbox
|
|
2719
2719
|
.uid=${this.widget.uid}
|
|
2720
2720
|
.label=${this.adapter.templateData.label}
|
|
@@ -2729,8 +2729,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2729
2729
|
@change=${this.valueChanged}
|
|
2730
2730
|
@blur=${()=>this.adapter.onBlur()}
|
|
2731
2731
|
></gui-checkbox>
|
|
2732
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Xr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2733
|
-
${
|
|
2732
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Xr([f.consume({context:m.formContext}),n.property({attribute:!1})],fi.prototype,"formContext",2),Xr([f.provide({context:m.inputContext})],fi.prototype,"adapter",2),fi=Xr([n.customElement("gui-checkbox-input")],fi);const db=Object.freeze(Object.defineProperty({__proto__:null,get CheckboxElement(){return fi}},Symbol.toStringTag,{value:"Module"}));var ub=Object.defineProperty,pb=Object.getOwnPropertyDescriptor,Me=(e,t,i,a)=>{for(var r=a>1?void 0:a?pb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ub(t,i,r),r};let Se=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 he(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,required:this.required}})})}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 a=Math.max(23,e.scrollWidth);t.width=`${a}px`,t.maxWidth=`${a}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`
|
|
2733
|
+
${oe(this.uid,i)}
|
|
2734
2734
|
|
|
2735
2735
|
<div class="gui-widget">
|
|
2736
2736
|
<input
|
|
@@ -2739,7 +2739,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2739
2739
|
id=${this.uid}
|
|
2740
2740
|
data-cy=${`${this.uid}_number`}
|
|
2741
2741
|
class="gui-widget-input"
|
|
2742
|
-
style=${
|
|
2742
|
+
style=${Dt.styleMap(t)}
|
|
2743
2743
|
value=${this.value}
|
|
2744
2744
|
?required=${this.required}
|
|
2745
2745
|
?disabled=${this.disabled}
|
|
@@ -2781,7 +2781,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2781
2781
|
</div>
|
|
2782
2782
|
|
|
2783
2783
|
${j(this.uid,i)}
|
|
2784
|
-
`}keyDown(e){switch(e.stopPropagation(),to(e),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 i=e.target.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Me([n.property({type:String})],Se.prototype,"uid",2),Me([n.property({type:String})],Se.prototype,"label",2),Me([n.property({type:String})],Se.prototype,"hint",2),Me([n.property({type:String,attribute:"locale-id"})],Se.prototype,"localeId",2),Me([n.property({type:Array})],Se.prototype,"errors",2),Me([n.property({type:Boolean})],Se.prototype,"touched",2),Me([n.property({type:Boolean})],Se.prototype,"required",2),Me([n.property({type:Boolean})],Se.prototype,"disabled",2),Me([n.property({type:Boolean,attribute:"readonly"})],Se.prototype,"readOnly",2),Me([n.property({type:Number})],Se.prototype,"value",2),Me([n.property({type:Number})],Se.prototype,"step",2),Me([n.property({type:String})],Se.prototype,"placeholder",2),Me([n.property({type:String})],Se.prototype,"autocomplete",2),Me([n.property({type:Number})],Se.prototype,"minimum",2),Me([n.property({type:Number})],Se.prototype,"maximum",2),Me([n.property({type:Number})],Se.prototype,"autoGrow",2),Se=Me([n.customElement("gui-number")],Se),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",Se);var hb=Object.defineProperty,cb=Object.getOwnPropertyDescriptor,Qr=(e,t,i,a)=>{for(var r=a>1?void 0:a?cb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&hb(t,i,r),r};let
|
|
2784
|
+
`}keyDown(e){switch(e.stopPropagation(),to(e),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 i=e.target.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Me([n.property({type:String})],Se.prototype,"uid",2),Me([n.property({type:String})],Se.prototype,"label",2),Me([n.property({type:String})],Se.prototype,"hint",2),Me([n.property({type:String,attribute:"locale-id"})],Se.prototype,"localeId",2),Me([n.property({type:Array})],Se.prototype,"errors",2),Me([n.property({type:Boolean})],Se.prototype,"touched",2),Me([n.property({type:Boolean})],Se.prototype,"required",2),Me([n.property({type:Boolean})],Se.prototype,"disabled",2),Me([n.property({type:Boolean,attribute:"readonly"})],Se.prototype,"readOnly",2),Me([n.property({type:Number})],Se.prototype,"value",2),Me([n.property({type:Number})],Se.prototype,"step",2),Me([n.property({type:String})],Se.prototype,"placeholder",2),Me([n.property({type:String})],Se.prototype,"autocomplete",2),Me([n.property({type:Number})],Se.prototype,"minimum",2),Me([n.property({type:Number})],Se.prototype,"maximum",2),Me([n.property({type:Number})],Se.prototype,"autoGrow",2),Se=Me([n.customElement("gui-number")],Se),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",Se);var hb=Object.defineProperty,cb=Object.getOwnPropertyDescriptor,Qr=(e,t,i,a)=>{for(var r=a>1?void 0:a?cb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&hb(t,i,r),r};let vi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2785
2785
|
<gui-number
|
|
2786
2786
|
.uid=${this.widget.uid}
|
|
2787
2787
|
.label=${this.adapter.templateData.label}
|
|
@@ -2801,7 +2801,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2801
2801
|
@input=${this.valueChanged}
|
|
2802
2802
|
@blur=${()=>this.adapter.onBlur()}
|
|
2803
2803
|
></gui-number>
|
|
2804
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Qr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2804
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Qr([f.consume({context:m.formContext}),n.property({attribute:!1})],vi.prototype,"formContext",2),Qr([f.provide({context:m.inputContext})],vi.prototype,"adapter",2),vi=Qr([n.customElement("gui-number-input")],vi);const mb=Object.freeze(Object.defineProperty({__proto__:null,get NumberElement(){return vi}},Symbol.toStringTag,{value:"Module"}));function yb(e){const t=typeof e;return t==="string"||t==="number"}function ao(e,t){return t.find(i=>i.value.toString()===e)?.value}const ro=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!Zc(e[0])){if(yb(e[0]))return e.map(i=>({label:i.toString(),value:i}));if(gb(e[0],t)){const i=bb(e[0],t);return e.map(i)}else throw new Error("Invalid option shape")}return e},gb=(e,{labelField:t,valueField:i})=>{if(e===null||typeof e!="object")return!1;const a=e,r=t?Object.prototype.hasOwnProperty.call(a,t):!1,s=i?Object.prototype.hasOwnProperty.call(a,i):!1;return t&&!r?!1:!(i&&!s)};function bb(e,{labelField:t,valueField:i}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const a=e,r=t&&Object.prototype.hasOwnProperty.call(a,t)?t:void 0,s=i&&Object.prototype.hasOwnProperty.call(a,i)?i:void 0;if(!r&&!s)throw new Error("Neither labelField nor valueField exists on the object");return o=>{if(o===null||typeof o!="object")throw new Error("Item is not an object");const l=o;return{label:r?l[r]:"",value:s?l[s]:""}}}var fb=Object.defineProperty,vb=Object.getOwnPropertyDescriptor,Ve=(e,t,i,a)=>{for(var r=a>1?void 0:a?vb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&fb(t,i,r),r};let Oe=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 he(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,required:this.required}})})}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=ro(this.options,{labelField:this.labelField,valueField:this.valueField});const t=this.value;this.hasMatchingValue=this.options?.length?this.options.find(({value:a})=>a===t)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
|
|
2805
2805
|
${qe.repeat(this.options||[],a=>a?.value,(a,r)=>{const s=this.hasMatchingValue&&a.value===e.value,o=!this.hasMatchingValue&&r===0,l=s||o;return d.html`<label for=${`${this.uid}_${r}`}>
|
|
2806
2806
|
<input
|
|
2807
2807
|
type="radio"
|
|
@@ -2819,7 +2819,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2819
2819
|
${a.label}
|
|
2820
2820
|
</label>`})}
|
|
2821
2821
|
`;return d.html`
|
|
2822
|
-
${
|
|
2822
|
+
${oe(this.uid,e,!1,void 0,!1)}
|
|
2823
2823
|
|
|
2824
2824
|
<div
|
|
2825
2825
|
class="gui-widget${this.direction==="row"?" gui-widget--horizontal":""}"
|
|
@@ -2835,7 +2835,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2835
2835
|
</div>
|
|
2836
2836
|
|
|
2837
2837
|
${j(this.uid,e)}
|
|
2838
|
-
`}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:ao(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ve([n.property({type:String})],Oe.prototype,"uid",2),Ve([n.property({type:String})],Oe.prototype,"label",2),Ve([n.property({type:String,attribute:"locale-id"})],Oe.prototype,"localeId",2),Ve([n.property({type:Array})],Oe.prototype,"errors",2),Ve([n.property({type:Boolean})],Oe.prototype,"touched",2),Ve([n.property({type:Boolean})],Oe.prototype,"required",2),Ve([n.property({type:Boolean})],Oe.prototype,"disabled",2),Ve([n.property({type:Boolean,attribute:"readonly"})],Oe.prototype,"readOnly",2),Ve([n.property({type:String})],Oe.prototype,"value",2),Ve([n.property({type:String})],Oe.prototype,"hint",2),Ve([n.property({type:Array})],Oe.prototype,"options",2),Ve([n.property({type:String})],Oe.prototype,"labelField",2),Ve([n.property({type:String})],Oe.prototype,"valueField",2),Ve([n.property({type:String})],Oe.prototype,"direction",2),Oe=Ve([n.customElement("gui-radiogroup")],Oe),typeof customElements<"u"&&!customElements.get("gui-radiogroup")&&customElements.define("gui-radiogroup",Oe);var Db=Object.defineProperty,wb=Object.getOwnPropertyDescriptor,jr=(e,t,i,a)=>{for(var r=a>1?void 0:a?wb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Db(t,i,r),r};let
|
|
2838
|
+
`}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:ao(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ve([n.property({type:String})],Oe.prototype,"uid",2),Ve([n.property({type:String})],Oe.prototype,"label",2),Ve([n.property({type:String,attribute:"locale-id"})],Oe.prototype,"localeId",2),Ve([n.property({type:Array})],Oe.prototype,"errors",2),Ve([n.property({type:Boolean})],Oe.prototype,"touched",2),Ve([n.property({type:Boolean})],Oe.prototype,"required",2),Ve([n.property({type:Boolean})],Oe.prototype,"disabled",2),Ve([n.property({type:Boolean,attribute:"readonly"})],Oe.prototype,"readOnly",2),Ve([n.property({type:String})],Oe.prototype,"value",2),Ve([n.property({type:String})],Oe.prototype,"hint",2),Ve([n.property({type:Array})],Oe.prototype,"options",2),Ve([n.property({type:String})],Oe.prototype,"labelField",2),Ve([n.property({type:String})],Oe.prototype,"valueField",2),Ve([n.property({type:String})],Oe.prototype,"direction",2),Oe=Ve([n.customElement("gui-radiogroup")],Oe),typeof customElements<"u"&&!customElements.get("gui-radiogroup")&&customElements.define("gui-radiogroup",Oe);var Db=Object.defineProperty,wb=Object.getOwnPropertyDescriptor,jr=(e,t,i,a)=>{for(var r=a>1?void 0:a?wb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Db(t,i,r),r};let Di=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2839
2839
|
<gui-radiogroup
|
|
2840
2840
|
.uid=${this.widget.uid}
|
|
2841
2841
|
.label=${this.adapter.templateData.label}
|
|
@@ -2853,7 +2853,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2853
2853
|
@change=${this.valueChanged}
|
|
2854
2854
|
@blur=${()=>this.adapter.onBlur()}
|
|
2855
2855
|
></gui-radiogroup>
|
|
2856
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};jr([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
2856
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};jr([f.consume({context:m.formContext}),n.property({attribute:!1})],Di.prototype,"formContext",2),jr([f.provide({context:m.inputContext})],Di.prototype,"adapter",2),Di=jr([n.customElement("gui-radiogroup-input")],Di);const $b=Object.freeze(Object.defineProperty({__proto__:null,get RadiogroupElement(){return Di}},Symbol.toStringTag,{value:"Module"}));var kb=Object.defineProperty,Tb=Object.getOwnPropertyDescriptor,Ie=(e,t,i,a)=>{for(var r=a>1?void 0:a?Tb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&kb(t,i,r),r};let we=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.invalidOptionMessage=void 0,this.labelField=void 0,this.valueField=void 0,this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new he(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,required:this.required}})})}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=Qe("select",e);this.options=ro(this.options,{labelField:this.labelField,valueField:this.valueField}),this.hasMatchingValue=this.options?.length?this.options.find(({value:a})=>a===this.value)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
|
|
2857
2857
|
<option value="" disabled selected=${this.hasMatchingValue?d.nothing:""}>
|
|
2858
2858
|
${this.placeholder??"Select an option"}
|
|
2859
2859
|
</option>
|
|
@@ -2864,7 +2864,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2864
2864
|
${a.label}
|
|
2865
2865
|
</option>`)}
|
|
2866
2866
|
`;return d.html`
|
|
2867
|
-
${
|
|
2867
|
+
${oe(this.uid,e)}
|
|
2868
2868
|
|
|
2869
2869
|
<div class="gui-widget">
|
|
2870
2870
|
<select
|
|
@@ -2895,7 +2895,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2895
2895
|
</div>
|
|
2896
2896
|
|
|
2897
2897
|
${j(this.uid,e)}
|
|
2898
|
-
`}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:(this.invalidOptionMessage??"Invalid selection: '{value}' is not a valid option.").replace("{value}",String(this.value))},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:ao(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ie([n.property({type:String})],we.prototype,"uid",2),Ie([n.property({type:String})],we.prototype,"label",2),Ie([n.property({type:String,attribute:"locale-id"})],we.prototype,"localeId",2),Ie([n.property({type:Array})],we.prototype,"errors",2),Ie([n.property({type:Boolean})],we.prototype,"touched",2),Ie([n.property({type:Boolean})],we.prototype,"required",2),Ie([n.property({type:Boolean})],we.prototype,"disabled",2),Ie([n.property({type:Boolean,attribute:"readonly"})],we.prototype,"readOnly",2),Ie([n.property({type:String})],we.prototype,"value",2),Ie([n.property({type:String})],we.prototype,"hint",2),Ie([n.property({type:String})],we.prototype,"icon",2),Ie([n.property({type:String})],we.prototype,"autocomplete",2),Ie([n.property({type:Array})],we.prototype,"options",2),Ie([n.property({type:String})],we.prototype,"placeholder",2),Ie([n.property({type:String,attribute:"invalid-option-message"})],we.prototype,"invalidOptionMessage",2),Ie([n.property({type:String})],we.prototype,"labelField",2),Ie([n.property({type:String})],we.prototype,"valueField",2),we=Ie([n.customElement("gui-select")],we),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",we);var Sb=Object.defineProperty,_b=Object.getOwnPropertyDescriptor,es=(e,t,i,a)=>{for(var r=a>1?void 0:a?_b(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Sb(t,i,r),r};let
|
|
2898
|
+
`}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:(this.invalidOptionMessage??"Invalid selection: '{value}' is not a valid option.").replace("{value}",String(this.value))},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:ao(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ie([n.property({type:String})],we.prototype,"uid",2),Ie([n.property({type:String})],we.prototype,"label",2),Ie([n.property({type:String,attribute:"locale-id"})],we.prototype,"localeId",2),Ie([n.property({type:Array})],we.prototype,"errors",2),Ie([n.property({type:Boolean})],we.prototype,"touched",2),Ie([n.property({type:Boolean})],we.prototype,"required",2),Ie([n.property({type:Boolean})],we.prototype,"disabled",2),Ie([n.property({type:Boolean,attribute:"readonly"})],we.prototype,"readOnly",2),Ie([n.property({type:String})],we.prototype,"value",2),Ie([n.property({type:String})],we.prototype,"hint",2),Ie([n.property({type:String})],we.prototype,"icon",2),Ie([n.property({type:String})],we.prototype,"autocomplete",2),Ie([n.property({type:Array})],we.prototype,"options",2),Ie([n.property({type:String})],we.prototype,"placeholder",2),Ie([n.property({type:String,attribute:"invalid-option-message"})],we.prototype,"invalidOptionMessage",2),Ie([n.property({type:String})],we.prototype,"labelField",2),Ie([n.property({type:String})],we.prototype,"valueField",2),we=Ie([n.customElement("gui-select")],we),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",we);var Sb=Object.defineProperty,_b=Object.getOwnPropertyDescriptor,es=(e,t,i,a)=>{for(var r=a>1?void 0:a?_b(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Sb(t,i,r),r};let wi=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2899
2899
|
<gui-select
|
|
2900
2900
|
.uid=${this.widget.uid}
|
|
2901
2901
|
.label=${this.adapter.templateData.label}
|
|
@@ -2917,8 +2917,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2917
2917
|
@inputError=${this.onInputError}
|
|
2918
2918
|
@blur=${()=>this.adapter.onBlur()}
|
|
2919
2919
|
></gui-select>
|
|
2920
|
-
`}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())}};es([f.consume({context:m.formContext}),n.property({attribute:!1})]
|
|
2921
|
-
${this.label?
|
|
2920
|
+
`}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())}};es([f.consume({context:m.formContext}),n.property({attribute:!1})],wi.prototype,"formContext",2),es([f.provide({context:m.inputContext})],wi.prototype,"adapter",2),wi=es([n.customElement("gui-select-input")],wi);const Ab=Object.freeze(Object.defineProperty({__proto__:null,get SelectElement(){return wi}},Symbol.toStringTag,{value:"Module"}));var Eb=Object.defineProperty,Cb=Object.getOwnPropertyDescriptor,_e=(e,t,i,a)=>{for(var r=a>1?void 0:a?Cb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Eb(t,i,r),r};const Lb=["Enter",",","Tab","blur"];let fe=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 he(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,required:this.required}})}),this.onPillRemove=e=>{if(this.disabled||this.readOnly)return;const t=this.getValue(),i=t.findIndex((r,s)=>this.pillKey(r,s)===e.detail.key);if(i<0)return;const a=t.filter((r,s)=>s!==i);this.emitChange(a),a.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:Lb}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},a=e.map((r,s)=>({key:this.pillKey(r,s),label:r}));return d.html`
|
|
2921
|
+
${this.label?oe(this.uid,t,!1,void 0,!1):d.nothing}
|
|
2922
2922
|
|
|
2923
2923
|
<div class="gui-widget">
|
|
2924
2924
|
<div
|
|
@@ -2934,7 +2934,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2934
2934
|
|
|
2935
2935
|
<gui-pills
|
|
2936
2936
|
class="gui-tags__pills"
|
|
2937
|
-
style=${
|
|
2937
|
+
style=${Dt.styleMap(a.length?{}:{"min-width":0})}
|
|
2938
2938
|
.uid=${this.uid}
|
|
2939
2939
|
.toolbarAriaLabel=${"Selected tags"}
|
|
2940
2940
|
.items=${a}
|
|
@@ -2969,7 +2969,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2969
2969
|
${j(this.uid,t)}
|
|
2970
2970
|
</div>
|
|
2971
2971
|
`}onInputKeydown(e){if(this.disabled||this.readOnly)return;const t=e.target,i=this.getSeparators(),a=t.value,r=t.selectionStart===0&&t.selectionEnd===0;if(e.key==="Enter"&&i.includes("Enter")){e.preventDefault(),this.commitDraft(a)&&(t.value="");return}if(e.key===","&&i.includes(",")){e.preventDefault(),this.commitDraft(a)&&(t.value="");return}if(e.key==="Tab"&&i.includes("Tab")&&a.length>0){this.commitDraft(a)&&(t.value="");return}if(e.key==="Escape"){e.preventDefault(),t.value="";return}const s=this.getValue(),o=this.isCompactMode();if(e.key==="ArrowDown"&&o&&s.length>0){e.preventDefault(),this.enterPillList(0);return}if(e.key==="ArrowLeft"&&!o&&r&&s.length>0){e.preventDefault(),this.enterPillList(s.length-1);return}if(e.key==="Backspace"&&a===""&&s.length>0){e.preventDefault(),this.enterPillList(s.length-1);return}}onInputBlur(e){const t=e.target,i=this.getSeparators(),a=t.value;a.length>0&&i.includes("blur")&&!this.disabled&&!this.readOnly&&this.commitDraft(a)&&(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 a=this.getSeparators().filter(h=>h!=="Enter"&&h!=="Tab"&&h!=="blur");if(a.length===0)return;const r=new RegExp(`[${a.map(h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("")}
|
|
2972
|
-
]`);if(!r.test(t))return;e.preventDefault();const s=e.target instanceof HTMLInputElement?e.target:null,l=((s?.value??"")+t).split(r),u=l.slice(0,-1),p=l[l.length-1]??"";this.commitDraftBatch(u)&&s&&(s.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 a of e){const r=this.trim?a.trim():a;if(r.length!==0&&!(this.allowDuplicates===!1&&i.includes(r))){if(this.limit!==void 0&&i.length>=this.limit)break;i.push(r)}}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))}};_e([n.property({type:String})],fe.prototype,"uid",2),_e([n.property({type:String})],fe.prototype,"label",2),_e([n.property({type:String,attribute:"locale-id"})],fe.prototype,"localeId",2),_e([n.property({type:Array})],fe.prototype,"errors",2),_e([n.property({type:Boolean})],fe.prototype,"touched",2),_e([n.property({type:Boolean})],fe.prototype,"required",2),_e([n.property({type:Boolean})],fe.prototype,"disabled",2),_e([n.property({type:Boolean,attribute:"readonly"})],fe.prototype,"readOnly",2),_e([n.property({type:Array})],fe.prototype,"value",2),_e([n.property({type:String})],fe.prototype,"hint",2),_e([n.property({type:String})],fe.prototype,"placeholder",2),_e([n.property({type:String})],fe.prototype,"icon",2),_e([n.property({type:Array})],fe.prototype,"separators",2),_e([n.property({type:Boolean})],fe.prototype,"allowDuplicates",2),_e([n.property({type:Boolean})],fe.prototype,"trim",2),_e([n.property({type:Number})],fe.prototype,"limit",2),_e([n.property({type:String,attribute:"remove-aria-label"})],fe.prototype,"removeAriaLabel",2),_e([n.property({type:String,attribute:"remove-icon"})],fe.prototype,"removeIcon",2),fe=_e([n.customElement("gui-tags")],fe),typeof customElements<"u"&&!customElements.get("gui-tags")&&customElements.define("gui-tags",fe);var Ib=Object.defineProperty,xb=Object.getOwnPropertyDescriptor,ts=(e,t,i,a)=>{for(var r=a>1?void 0:a?xb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ib(t,i,r),r};let
|
|
2972
|
+
]`);if(!r.test(t))return;e.preventDefault();const s=e.target instanceof HTMLInputElement?e.target:null,l=((s?.value??"")+t).split(r),u=l.slice(0,-1),p=l[l.length-1]??"";this.commitDraftBatch(u)&&s&&(s.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 a of e){const r=this.trim?a.trim():a;if(r.length!==0&&!(this.allowDuplicates===!1&&i.includes(r))){if(this.limit!==void 0&&i.length>=this.limit)break;i.push(r)}}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))}};_e([n.property({type:String})],fe.prototype,"uid",2),_e([n.property({type:String})],fe.prototype,"label",2),_e([n.property({type:String,attribute:"locale-id"})],fe.prototype,"localeId",2),_e([n.property({type:Array})],fe.prototype,"errors",2),_e([n.property({type:Boolean})],fe.prototype,"touched",2),_e([n.property({type:Boolean})],fe.prototype,"required",2),_e([n.property({type:Boolean})],fe.prototype,"disabled",2),_e([n.property({type:Boolean,attribute:"readonly"})],fe.prototype,"readOnly",2),_e([n.property({type:Array})],fe.prototype,"value",2),_e([n.property({type:String})],fe.prototype,"hint",2),_e([n.property({type:String})],fe.prototype,"placeholder",2),_e([n.property({type:String})],fe.prototype,"icon",2),_e([n.property({type:Array})],fe.prototype,"separators",2),_e([n.property({type:Boolean})],fe.prototype,"allowDuplicates",2),_e([n.property({type:Boolean})],fe.prototype,"trim",2),_e([n.property({type:Number})],fe.prototype,"limit",2),_e([n.property({type:String,attribute:"remove-aria-label"})],fe.prototype,"removeAriaLabel",2),_e([n.property({type:String,attribute:"remove-icon"})],fe.prototype,"removeIcon",2),fe=_e([n.customElement("gui-tags")],fe),typeof customElements<"u"&&!customElements.get("gui-tags")&&customElements.define("gui-tags",fe);var Ib=Object.defineProperty,xb=Object.getOwnPropertyDescriptor,ts=(e,t,i,a)=>{for(var r=a>1?void 0:a?xb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ib(t,i,r),r};let $i=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
2973
2973
|
<gui-tags
|
|
2974
2974
|
.uid=${this.widget.uid}
|
|
2975
2975
|
.label=${this.adapter.templateData.label}
|
|
@@ -2991,7 +2991,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2991
2991
|
@change=${this.valueChanged}
|
|
2992
2992
|
@blur=${()=>this.adapter.onBlur()}
|
|
2993
2993
|
></gui-tags>
|
|
2994
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ts([f.consume({context:m.formContext}),n.property({attribute:!1})]
|
|
2994
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ts([f.consume({context:m.formContext}),n.property({attribute:!1})],$i.prototype,"formContext",2),ts([f.provide({context:m.inputContext})],$i.prototype,"adapter",2),$i=ts([n.customElement("gui-tags-input")],$i);const Pb=Object.freeze(Object.defineProperty({__proto__:null,get TagsElement(){return $i}},Symbol.toStringTag,{value:"Module"}));var Mb=Object.defineProperty,Ob=Object.getOwnPropertyDescriptor,ki=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ob(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Mb(t,i,r),r};let Rb=0;const Fb=()=>Rb++;let At=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.isFocused=!1,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-repeater","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}onFocusIn(e){e.stopPropagation(),this.isFocused=!0}onFocusOut(e){e.stopPropagation(),this.adapter.onBlur(),this.isFocused=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0;return d.html`
|
|
2995
2995
|
<div
|
|
2996
2996
|
id=${this.widget.uid}
|
|
2997
2997
|
class=${`gui-repeater__main-card gui-repeater__card ${this.isFocused?"gui-repeater__card--focused":""}`}
|
|
@@ -3052,7 +3052,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3052
3052
|
.errors=${e.errors}
|
|
3053
3053
|
.touched=${e.touched}
|
|
3054
3054
|
></gui-errors>`:d.nothing}
|
|
3055
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}addItem(){const e=[...this.adapter.templateData.value??[],{}];this.adapter.valueChanged(e),this.requestUpdate()}removeItem(e){const t=(this.adapter.templateData.value??[]).filter((i,a)=>e!==a);"structuredClone"in window?this.adapter.valueChanged(structuredClone(t)):this.adapter.valueChanged(JSON.parse(JSON.stringify(t))),this.requestUpdate()}};
|
|
3055
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}addItem(){const e=[...this.adapter.templateData.value??[],{}];this.adapter.valueChanged(e),this.requestUpdate()}removeItem(e){const t=(this.adapter.templateData.value??[]).filter((i,a)=>e!==a);"structuredClone"in window?this.adapter.valueChanged(structuredClone(t)):this.adapter.valueChanged(JSON.parse(JSON.stringify(t))),this.requestUpdate()}};ki([f.consume({context:m.formContext}),n.property({attribute:!1})],At.prototype,"formContext",2),ki([f.provide({context:m.inputContext})],At.prototype,"adapter",2),ki([n.state()],At.prototype,"isFocused",2),ki([n.query(".gui-repeater__main-card")],At.prototype,"_repeaterRef",2),At=ki([n.customElement("gui-repeater-input")],At);const Bb=Object.freeze(Object.defineProperty({__proto__:null,get RepeaterElement(){return At}},Symbol.toStringTag,{value:"Module"}));var Nb=Object.defineProperty,qb=Object.getOwnPropertyDescriptor,is=(e,t,i,a)=>{for(var r=a>1?void 0:a?qb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Nb(t,i,r),r};let Ti=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.LayoutWidgetAdapter,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-flex","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){const e={"gui-flex__widget":!0,"gui-flex__widget--row":this.adapter.templateData.direction==="row","gui-flex__widget--row-reverse":this.adapter.templateData.direction==="row-reverse","gui-flex__widget--column":!this.adapter.templateData.direction||this.adapter.templateData.direction==="column","gui-flex__widget--column-reverse":this.adapter.templateData.direction==="column-reverse","gui-flex__widget--justify-center":this.adapter.templateData.justify==="center","gui-flex__widget--justify-start":this.adapter.templateData.justify==="start","gui-flex__widget--justify-end":this.adapter.templateData.justify==="end","gui-flex__widget--justify-stretch":!this.adapter.templateData.justify||this.adapter.templateData.justify==="stretch","gui-flex__widget--align-start":!this.adapter.templateData.align||this.adapter.templateData.align==="start","gui-flex__widget--align-end":this.adapter.templateData.align==="end","gui-flex__widget--align-center":this.adapter.templateData.align==="center","gui-flex__widget--align-space-between":this.adapter.templateData.align==="space-between","gui-flex__widget--align-space-around":this.adapter.templateData.align==="space-around","gui-flex__widget--align-space-evenly":this.adapter.templateData.align==="space-evenly"};return d.html`
|
|
3056
3056
|
<div
|
|
3057
3057
|
class=${S.classMap(e)}
|
|
3058
3058
|
id=${this.widget?.uid}
|
|
@@ -3060,13 +3060,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3060
3060
|
>
|
|
3061
3061
|
${qe.repeat(this.adapter.templateData.children||[],t=>t?.uid,t=>d.html`<gui-widget .widget=${t}></gui-widget>`)}
|
|
3062
3062
|
</div>
|
|
3063
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};is([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
3063
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};is([f.consume({context:m.formContext}),n.property({attribute:!1})],Ti.prototype,"formContext",2),is([f.provide({context:m.layoutContext})],Ti.prototype,"adapter",2),Ti=is([n.customElement("gui-flex-layout")],Ti);const zb=Object.freeze(Object.defineProperty({__proto__:null,get FlexElement(){return Ti}},Symbol.toStringTag,{value:"Module"}));var Ub=Object.defineProperty,Gb=Object.getOwnPropertyDescriptor,as=(e,t,i,a)=>{for(var r=a>1?void 0:a?Gb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ub(t,i,r),r};let Si=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.LayoutWidgetAdapter,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-grid","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){const e=this.adapter.templateData.direction==="column",t=!e,i=this.adapter.templateData.autoFit??!0,a={"gui-grid__widget":!0,"gui-grid__widget--row":t,"gui-grid__widget--row--auto-fit":t&&i,"gui-grid__widget--column":e,"gui-grid__widget--align-center":this.adapter.templateData.align==="center","gui-grid__widget--align-start":this.adapter.templateData.align==="start","gui-grid__widget--align-end":this.adapter.templateData.align==="end","gui-grid__widget--align-space-between":this.adapter.templateData.align==="space-between","gui-grid__widget--align-space-around":this.adapter.templateData.align==="space-around","gui-grid__widget--align-space-evenly":this.adapter.templateData.align==="space-evenly","gui-grid__widget--align-stretch":!this.adapter.templateData.align||this.adapter.templateData.align==="stretch","gui-grid__widget--justify-center":this.adapter.templateData.justify==="center","gui-grid__widget--justify-start":this.adapter.templateData.justify==="start","gui-grid__widget--justify-end":this.adapter.templateData.justify==="end","gui-grid__widget--justify-stretch":this.adapter.templateData.justify==="stretch"},r=[];return this.adapter.templateData.columnGap!==void 0&&r.push(`column-gap: ${this.adapter.templateData.columnGap}px`),this.adapter.templateData.rowGap!==void 0&&r.push(`row-gap: ${this.adapter.templateData.rowGap}px`),d.html`
|
|
3064
3064
|
<div class=${S.classMap(a)} id=${this.widget?.uid} style=${r.join("; ")}>
|
|
3065
3065
|
${qe.repeat(this.adapter.templateData.children||[],s=>s?.uid,s=>d.html`<div class="gui-grid__cell" style="grid-column: span ${s.size||1}">
|
|
3066
3066
|
<gui-widget .widget=${s}></gui-widget>
|
|
3067
3067
|
</div>`)}
|
|
3068
3068
|
</div>
|
|
3069
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};as([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
3069
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};as([f.consume({context:m.formContext}),n.property({attribute:!1})],Si.prototype,"formContext",2),as([f.provide({context:m.layoutContext})],Si.prototype,"adapter",2),Si=as([n.customElement("gui-grid-layout")],Si);const Vb=Object.freeze(Object.defineProperty({__proto__:null,get GridElement(){return Si}},Symbol.toStringTag,{value:"Module"}));var Zb=Object.defineProperty,Yb=Object.getOwnPropertyDescriptor,ft=(e,t,i,a)=>{for(var r=a>1?void 0:a?Yb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Zb(t,i,r),r};let dt=class extends d.LitElement{constructor(){super(...arguments),this.activeTab="",this.adapter=new m.LayoutWidgetAdapter,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-tabs","gui-field");const e=this.widget.props;this.adapter.context=this.formContext,this.adapter.init(this.widget),this.activeTab=e.defaultOpen??e.tabs[0].uid,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{this.requestUpdate()}))}firstUpdated(e){this.startObserver=ha(this.startSentinel,a=>this.isStartVisible=a),this.endObserver=ha(this.endSentinel,a=>this.isEndVisible=a);const i=this.widget.props.tabs.findIndex(a=>a.uid===this.activeTab);this.tabButtons[i].scrollIntoView({block:"nearest",inline:"nearest"})}render(){if(!this.adapter.templateData)return d.html``;const e=this.widget.children.filter(i=>i.uid===this.activeTab||this.adapter.templateData.renderMode!=="activeOnly"),t={"gui-widget":!0,"gui-widget--horizontal":!0,"gui-tabs--start-shadow":!this.isStartVisible,"gui-tabs--end-shadow":!this.isEndVisible};return d.html`<nav class=${S.classMap(t)} id=${this.widget.uid}>
|
|
3070
3070
|
<ul role="tablist">
|
|
3071
3071
|
<li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
|
|
3072
3072
|
${this.adapter.templateData.tabs?qe.repeat(this.adapter.templateData.tabs,(i,a)=>d.html`
|
|
@@ -3100,7 +3100,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3100
3100
|
aria-labelledby=${`tab_${this.widget.uid}_${a}`}
|
|
3101
3101
|
>
|
|
3102
3102
|
<gui-widget .widget=${i}></gui-widget>
|
|
3103
|
-
</section>`)}`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe()),this.startObserver?.disconnect(),this.endObserver?.disconnect()}onClickTab(e){this.activeTab=e,this.adapter.change(e),this.requestUpdate()}onKeyDown(e){const t=this.widget.props.tabs,i=t.findIndex(s=>s.uid===this.activeTab),a=Array.from(this.tabButtons),r=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const s=i+(r?1:-1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"ArrowRight":{const s=i+(r?-1:1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"Home":this.activeTab=t[0].uid,a[0].focus();break;case"End":this.activeTab=t[t.length-1].uid,a[t.length-1].focus();break;default:return}}};
|
|
3103
|
+
</section>`)}`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe()),this.startObserver?.disconnect(),this.endObserver?.disconnect()}onClickTab(e){this.activeTab=e,this.adapter.change(e),this.requestUpdate()}onKeyDown(e){const t=this.widget.props.tabs,i=t.findIndex(s=>s.uid===this.activeTab),a=Array.from(this.tabButtons),r=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const s=i+(r?1:-1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"ArrowRight":{const s=i+(r?-1:1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"Home":this.activeTab=t[0].uid,a[0].focus();break;case"End":this.activeTab=t[t.length-1].uid,a[t.length-1].focus();break;default:return}}};ft([n.query("#start-sentinel")],dt.prototype,"startSentinel",2),ft([n.query("#end-sentinel")],dt.prototype,"endSentinel",2),ft([n.state()],dt.prototype,"isStartVisible",2),ft([n.state()],dt.prototype,"isEndVisible",2),ft([n.queryAll('button[role="tab"]')],dt.prototype,"tabButtons",2),ft([n.property({type:String})],dt.prototype,"activeTab",2),ft([f.consume({context:m.formContext}),n.property({attribute:!1})],dt.prototype,"formContext",2),ft([f.provide({context:m.layoutContext})],dt.prototype,"adapter",2),dt=ft([n.customElement("gui-tabs-layout")],dt);const Hb=Object.freeze(Object.defineProperty({__proto__:null,get TabsElement(){return dt}},Symbol.toStringTag,{value:"Module"}));var Wb=Object.defineProperty,Kb=Object.getOwnPropertyDescriptor,rs=(e,t,i,a)=>{for(var r=a>1?void 0:a?Kb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Wb(t,i,r),r};let _i=class extends d.LitElement{constructor(){super(...arguments),this.activeSections={},this.adapter=new m.LayoutWidgetAdapter,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-accordion","gui-field");const e=this.widget.props;this.adapter.context=this.formContext,this.adapter.init(this.widget),this.activeSections=e.defaultOpen??{},this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}onClickButton(e){this.widget.props.singleOpen&&Object.keys(this.activeSections).filter(i=>i!==e).forEach(i=>{this.activeSections[i]=!1}),this.activeSections[e]=!this.activeSections[e],this.adapter.change(this.activeSections),this.requestUpdate()}getChild(e){return this.widget.children.find(t=>t.uid===e)}render(){return this.adapter.templateData?d.html`
|
|
3104
3104
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
3105
3105
|
${this.adapter.templateData.sections?qe.repeat(this.adapter.templateData.sections,e=>e.uid,e=>{const t=this.activeSections[e.uid]||this.adapter.templateData.renderMode!=="activeOnly"?d.html`<section
|
|
3106
3106
|
class="gui-widget"
|
|
@@ -3136,7 +3136,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3136
3136
|
${t}
|
|
3137
3137
|
</div>`}):d.nothing}
|
|
3138
3138
|
</div>
|
|
3139
|
-
`:d.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};rs([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
3139
|
+
`:d.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};rs([f.consume({context:m.formContext}),n.property({attribute:!1})],_i.prototype,"formContext",2),rs([f.provide({context:m.layoutContext})],_i.prototype,"adapter",2),_i=rs([n.customElement("gui-accordion-layout")],_i);const Jb=Object.freeze(Object.defineProperty({__proto__:null,get AccordionElement(){return _i}},Symbol.toStringTag,{value:"Module"}));var Xb=Object.defineProperty,Qb=Object.getOwnPropertyDescriptor,ss=(e,t,i,a)=>{for(var r=a>1?void 0:a?Qb(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xb(t,i,r),r};let Ai=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-alert","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`
|
|
3140
3140
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
3141
3141
|
<div
|
|
3142
3142
|
role="alert"
|
|
@@ -3145,13 +3145,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3145
3145
|
${this.adapter.templateData.text}
|
|
3146
3146
|
</div>
|
|
3147
3147
|
</div>
|
|
3148
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ss([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
3148
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ss([f.consume({context:m.formContext}),n.property({attribute:!1})],Ai.prototype,"formContext",2),ss([f.provide({context:m.displayWidgetContext})],Ai.prototype,"adapter",2),Ai=ss([n.customElement("gui-alert-display")],Ai);const jb=Object.freeze(Object.defineProperty({__proto__:null,get AlertElement(){return Ai}},Symbol.toStringTag,{value:"Module"}));var ef=Object.defineProperty,tf=Object.getOwnPropertyDescriptor,ns=(e,t,i,a)=>{for(var r=a>1?void 0:a?tf(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ef(t,i,r),r};let Ei=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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-markdown-text","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`
|
|
3149
3149
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
3150
3150
|
<gui-markdown-text
|
|
3151
3151
|
.md=${this.adapter.templateData.md}
|
|
3152
3152
|
.dependencies=${this.adapter.templateData.deps}
|
|
3153
3153
|
></gui-markdown-text>
|
|
3154
3154
|
</div>
|
|
3155
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ns([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
3155
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ns([f.consume({context:m.formContext}),n.property({attribute:!1})],Ei.prototype,"formContext",2),ns([f.provide({context:m.displayWidgetContext})],Ei.prototype,"adapter",2),Ei=ns([n.customElement("gui-markdown-text-display")],Ei);const af=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownTextElement(){return Ei}},Symbol.toStringTag,{value:"Module"}));var rf=Object.defineProperty,sf=Object.getOwnPropertyDescriptor,os=(e,t,i,a)=>{for(var r=a>1?void 0:a?sf(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&rf(t,i,r),r};let Ci=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.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`
|
|
3156
3156
|
<div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
|
|
3157
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};os([f.consume({context:m.formContext}),n.property({attribute:!1})],
|
|
3157
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};os([f.consume({context:m.formContext}),n.property({attribute:!1})],Ci.prototype,"formContext",2),os([f.provide({context:m.displayWidgetContext})],Ci.prototype,"adapter",2),Ci=os([n.customElement("gui-renderer-component")],Ci);const nf=Object.freeze(Object.defineProperty({__proto__:null,get RendererElement(){return Ci}},Symbol.toStringTag,{value:"Module"}));ue.widgetLoaders=mn,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|