@golemui/gui-lit 1.1.1-rc.3 → 1.2.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/{accordion.element-BIgxl5e9.js → accordion.element-C9GzfKrY.js} +29 -30
- package/alert.element-CHn49Yaf.js +55 -0
- package/button.element-C9fHivSw.js +59 -0
- package/{calendar.element-Cv3RBphf.js → calendar.element-XkojKTJk.js} +30 -31
- package/checkbox.element-DU_tVMXu.js +66 -0
- package/currency.element-BmAH5KS_.js +73 -0
- package/date-picker.element-Bg3rF95F.js +94 -0
- package/{date-time-calendar.element-DlbWZjoe.js → date-time-calendar.element-sywQCeQQ.js} +24 -24
- package/date-time-picker.element-HHpwjWTQ.js +107 -0
- package/{date-time.element-CLLxM2nV.js → date-time.element-ucETvSTC.js} +26 -26
- package/{date.element-B8ZHK9KJ.js → date.element-BEHGxRFF.js} +27 -27
- package/default-list-item-renderer-CuPJ9jUD.js +24 -0
- package/{dropdown.element-DMZ7oL5n.js → dropdown.element-DUqG_p1x.js} +85 -84
- package/{flex.element-DG4Uaj_X.js → flex.element-pwba7621.js} +27 -28
- package/{grid.element-DCZsh-3J.js → grid.element-C8K7_Qi3.js} +29 -30
- package/index.js +1316 -3883
- package/index.umd.cjs +117 -2132
- package/{list.element-ADtUK2na.js → list.element-ZtEMKE2x.js} +41 -40
- package/markdown-text.element-DDm36qD0.js +54 -0
- package/markdown.element-DWz3U9rG.js +84 -0
- package/number.element-VkG5wScD.js +71 -0
- package/package.json +6 -6
- package/password.element-C5vQHq5P.js +72 -0
- package/radiogroup.element-CKdO9HwO.js +69 -0
- package/{range-calendar.element-D5eb2f7p.js → range-calendar.element-BznGrej5.js} +23 -24
- package/{range-date-input.element-C35grlYo.js → range-date-input.element-BloTHRDl.js} +24 -24
- package/range-date-picker.element-DKhwFasW.js +98 -0
- package/{range-date-time-calendar.element-BV0J96Gu.js → range-date-time-calendar.element-CZCET-sb.js} +26 -26
- package/{range-date-time-input.element-CzgRbR9F.js → range-date-time-input.element-Dr2VrYhG.js} +24 -24
- package/range-date-time-picker.element-CYeIMWLp.js +109 -0
- package/{range-time-input.element-BOHLUO8z.js → range-time-input.element-7OZhPQqx.js} +23 -23
- package/range-time-picker.element-D0mRFZkK.js +96 -0
- package/renderer.element-DbsFoBba.js +48 -0
- package/{repeater.element-Da8YN1Vy.js → repeater.element-DGEbwvhY.js} +54 -65
- package/select.element-Bb_9jAVB.js +76 -0
- package/{tabs.element-CvcIA8P3.js → tabs.element-BYDNF_pm.js} +49 -50
- package/tags.element-BSN3i9Gx.js +73 -0
- package/textarea.element-Dl1ZEOqO.js +71 -0
- package/textinput.element-C5Vbbkxq.js +68 -0
- package/{time-picker.element-C3oR0EkQ.js → time-picker.element-Crmj9YDy.js} +26 -26
- package/{time.element-X286nthD.js → time.element-DfSeAZp4.js} +29 -29
- package/toggle.element-ORsprZ2M.js +66 -0
- package/alert.element-DPWq9-0F.js +0 -56
- package/button.element-CJay43iR.js +0 -132
- package/calendar-DleRbmvP.js +0 -267
- package/checkbox.element-CpmrzdH0.js +0 -200
- package/currency.element-Cezgzbbs.js +0 -276
- package/date-DBuYpvcO.js +0 -849
- package/date-input-B3yHsn-g.js +0 -204
- package/date-picker.element-ByZefznr.js +0 -357
- package/date-time-calendar-CB5cNoOX.js +0 -374
- package/date-time-input-DrY68YDX.js +0 -246
- package/date-time-picker.element-CYwmumfq.js +0 -440
- package/day-status-ljexnwEO.js +0 -554
- package/errors-Bs_vYN-_.js +0 -110
- package/focus-leave.controller-2gV0pQd5.js +0 -73
- package/list-D730tmGN.js +0 -297
- package/markdown-text-X-BRJT6K.js +0 -30
- package/markdown-text.element-B8TfVLIO.js +0 -55
- package/markdown.element-D5zcxAUS.js +0 -693
- package/number.element-DEY5tR_y.js +0 -291
- package/numeric-jmOOKz30.js +0 -12
- package/one-of-anKkm7mD.js +0 -50
- package/part-templates-VORbpgs2.js +0 -691
- package/password.element-C1aQh_iz.js +0 -240
- package/pill-ranges-DpvWwP-3.js +0 -48
- package/pills-BDMO2NiR.js +0 -348
- package/popup.controller-B33OvX_y.js +0 -86
- package/radiogroup.element-B2G-XyGx.js +0 -235
- package/range-calendar-D7sG24Kx.js +0 -466
- package/range-commit-8-MmYUyo.js +0 -14
- package/range-date-input-BChaoBC1.js +0 -311
- package/range-date-picker.element-Do5YsL5V.js +0 -434
- package/range-date-time-calendar-DulGK2EQ.js +0 -734
- package/range-date-time-input-8ggqckP7.js +0 -353
- package/range-date-time-picker.element-hi5KdopZ.js +0 -472
- package/range-selection-CU3hxLJE.js +0 -25
- package/range-time-input-D7GFdDeA.js +0 -348
- package/range-time-picker.element-DDNQMA_u.js +0 -470
- package/renderer.element-CNyMn2Lu.js +0 -49
- package/select.element-SDxBhGjz.js +0 -266
- package/tabs-DzSCq_98.js +0 -13
- package/tags.element-Bnhfevp3.js +0 -369
- package/templates-Df7abEkB.js +0 -92
- package/textarea.element-Dx7eYEnl.js +0 -239
- package/textinput.element-BnIoDRmY.js +0 -205
- package/time-input-Kk4EX6at.js +0 -201
- package/time-list-DLcq8BAp.js +0 -217
- package/time-picker-DLj1rhOf.js +0 -299
- package/toggle.element-Dokdat_o.js +0 -203
package/index.umd.cjs
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
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>
|
|
1
|
+
(function(C,ae){typeof exports=="object"&&typeof module<"u"?ae(exports,require("@golemui/gui-shared"),require("@golemui/lit/internals"),require("@golemui/gui-shared/internals"),require("@golemui/core"),require("@golemui/lit"),require("@lit/context"),require("lit"),require("lit/decorators.js"),require("rxjs"),require("@golemui/gui-components/button"),require("@golemui/gui-components/calendar"),require("@golemui/gui-components/date-time-calendar"),require("@golemui/gui-components/range-calendar"),require("@golemui/gui-components/range-date-input"),require("@golemui/gui-components/range-time-input"),require("@golemui/gui-components/range-date-time-input"),require("@golemui/gui-components/range-date-time-calendar"),require("@golemui/gui-components/range-date-time-picker"),require("@golemui/gui-components/range-date-picker"),require("@golemui/gui-components/range-time-picker"),require("@golemui/gui-components/currency"),require("@golemui/gui-components/internals"),require("@golemui/gui-components/date-input"),require("lit/directives/class-map.js"),require("@golemui/gui-components/date-picker"),require("@golemui/gui-components/date-time-picker"),require("@golemui/gui-components/label"),require("@golemui/gui-components/list"),require("@golemui/gui-components/errors"),require("@golemui/gui-components/markdown"),require("@golemui/gui-components/password"),require("@golemui/gui-components/textinput"),require("@golemui/gui-components/time-input"),require("@golemui/gui-components/time-picker"),require("@golemui/gui-components/date-time-input"),require("@golemui/gui-components/textarea"),require("@golemui/gui-components/toggle"),require("@golemui/gui-components/checkbox"),require("@golemui/gui-components/number"),require("@golemui/gui-components/radiogroup"),require("@golemui/gui-components/select"),require("@golemui/gui-components/tags"),require("lit-html/directives/repeat.js"),require("@golemui/gui-components/markdown-text")):typeof define=="function"&&define.amd?define(["exports","@golemui/gui-shared","@golemui/lit/internals","@golemui/gui-shared/internals","@golemui/core","@golemui/lit","@lit/context","lit","lit/decorators.js","rxjs","@golemui/gui-components/button","@golemui/gui-components/calendar","@golemui/gui-components/date-time-calendar","@golemui/gui-components/range-calendar","@golemui/gui-components/range-date-input","@golemui/gui-components/range-time-input","@golemui/gui-components/range-date-time-input","@golemui/gui-components/range-date-time-calendar","@golemui/gui-components/range-date-time-picker","@golemui/gui-components/range-date-picker","@golemui/gui-components/range-time-picker","@golemui/gui-components/currency","@golemui/gui-components/internals","@golemui/gui-components/date-input","lit/directives/class-map.js","@golemui/gui-components/date-picker","@golemui/gui-components/date-time-picker","@golemui/gui-components/label","@golemui/gui-components/list","@golemui/gui-components/errors","@golemui/gui-components/markdown","@golemui/gui-components/password","@golemui/gui-components/textinput","@golemui/gui-components/time-input","@golemui/gui-components/time-picker","@golemui/gui-components/date-time-input","@golemui/gui-components/textarea","@golemui/gui-components/toggle","@golemui/gui-components/checkbox","@golemui/gui-components/number","@golemui/gui-components/radiogroup","@golemui/gui-components/select","@golemui/gui-components/tags","lit-html/directives/repeat.js","@golemui/gui-components/markdown-text"],ae):(C=typeof globalThis<"u"?globalThis:C||self,ae(C["gui-lit"]={},null,C.internals$1,C.internals,C.core,C.lit,C.context,C.lit$1,C.decorators_js,C.rxjs,null,null,null,null,null,null,null,null,null,null,null,null,C.internals$2,null,C.classMap_js,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,C.repeat_js))})(this,(function(C,ae,f,nt,K,d,c,l,m,ot,Oo,Ro,Fo,Zo,jo,qo,No,Vo,Uo,Bo,Wo,Jo,X,Go,O,Yo,Ho,Ko,Xo,Qo,ed,td,ad,rd,id,sd,nd,od,dd,ld,ud,pd,cd,V){"use strict";function p(t,e,a){function i(o,u){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:u,constr:n,traits:new Set},enumerable:!1}),o._zod.traits.has(t))return;o._zod.traits.add(t),e(o,u);const h=n.prototype,g=Object.keys(h);for(let b=0;b<g.length;b++){const v=g[b];v in o||(o[v]=h[v].bind(o))}}const r=a?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:t});function n(o){var u;const h=a?.Parent?new s:this;i(h,o),(u=h._zod).deferred??(u.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(n,"init",{value:i}),Object.defineProperty(n,Symbol.hasInstance,{value:o=>a?.Parent&&o instanceof a.Parent?!0:o?._zod?.traits?.has(t)}),Object.defineProperty(n,"name",{value:t}),n}class U extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class dt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Oa={};function j(t){return Oa}function Ye(t,e){return typeof e=="bigint"?e.toString():e}function He(t){return t==null}function Ke(t){const e=t.startsWith("^")?1:0,a=t.endsWith("$")?t.length-1:t.length;return t.slice(e,a)}const lt=Symbol("evaluating");function y(t,e,a){let i;Object.defineProperty(t,e,{get(){if(i!==lt)return i===void 0&&(i=lt,i=a()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function Ra(...t){const e={};for(const a of t){const i=Object.getOwnPropertyDescriptors(a);Object.assign(e,i)}return Object.defineProperties({},e)}function Fa(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ut="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function pt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Xe(t){if(pt(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const a=e.prototype;return!(pt(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function ct(t){return Xe(t)?{...t}:Array.isArray(t)?[...t]:t}function Qe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ht(t,e,a){const i=new t._zod.constr(e??t._zod.def);return(!e||a?.parent)&&(i._zod.parent=t),i}function $(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}const Za={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 B(t,e=0){if(t.aborted===!0)return!0;for(let a=e;a<t.issues.length;a++)if(t.issues[a]?.continue!==!0)return!0;return!1}function ja(t,e){return e.map(a=>{var i;return(i=a).path??(i.path=[]),a.path.unshift(t),a})}function re(t){return typeof t=="string"?t:t?.message}function q(t,e,a){const i={...t,path:t.path??[]};if(!t.message){const r=re(t.inst?._zod.def?.error?.(t))??re(e?.error?.(t))??re(a.customError?.(t))??re(a.localeError?.(t))??"Invalid input";i.message=r}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function et(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Q(...t){const[e,a,i]=t;return typeof e=="string"?{message:e,code:"custom",input:a,inst:i}:{...e}}const mt=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Ye,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},gt=p("$ZodError",mt),ie=p("$ZodError",mt,{Parent:Error});function qa(t,e=a=>a.message){const a={},i=[];for(const r of t.issues)r.path.length>0?(a[r.path[0]]=a[r.path[0]]||[],a[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:a}}function Na(t,e=a=>a.message){const a={_errors:[]},i=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(n=>i({issues:n}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)a._errors.push(e(s));else{let n=a,o=0;for(;o<s.path.length;){const u=s.path[o];o===s.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(e(s))):n[u]=n[u]||{_errors:[]},n=n[u],o++}}};return i(t),a}const se=t=>(e,a,i,r)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},n=e._zod.run({value:a,issues:[]},s);if(n instanceof Promise)throw new U;if(n.issues.length){const o=new(r?.Err??t)(n.issues.map(u=>q(u,s,j())));throw ut(o,r?.callee),o}return n.value},Va=se(ie),ne=t=>async(e,a,i,r)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let n=e._zod.run({value:a,issues:[]},s);if(n instanceof Promise&&(n=await n),n.issues.length){const o=new(r?.Err??t)(n.issues.map(u=>q(u,s,j())));throw ut(o,r?.callee),o}return n.value},Ua=ne(ie),oe=t=>(e,a,i)=>{const r=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:a,issues:[]},r);if(s instanceof Promise)throw new U;return s.issues.length?{success:!1,error:new(t??gt)(s.issues.map(n=>q(n,r,j())))}:{success:!0,data:s.value}},ft=oe(ie),de=t=>async(e,a,i)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=e._zod.run({value:a,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(n=>q(n,r,j())))}:{success:!0,data:s.value}},bt=de(ie),Ba=t=>(e,a,i)=>{const r=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return se(t)(e,a,r)},Wa=t=>(e,a,i)=>se(t)(e,a,i),Ja=t=>async(e,a,i)=>{const r=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ne(t)(e,a,r)},Ga=t=>async(e,a,i)=>ne(t)(e,a,i),Ya=t=>(e,a,i)=>{const r=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return oe(t)(e,a,r)},Ha=t=>(e,a,i)=>oe(t)(e,a,i),Ka=t=>async(e,a,i)=>{const r=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return de(t)(e,a,r)},Xa=t=>async(e,a,i)=>de(t)(e,a,i),Qa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$t=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,er=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tr=/^(?:(?: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])$/,ar=/^(([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}|:))$/,rr=/^(?=.{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])?)*\.?$/,vt="(?:(?:\\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])))",ir=new RegExp(`^${vt}$`);function _t(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sr(t){return new RegExp(`^${_t(t)}$`)}function nr(t){const e=_t({precision:t.precision}),a=["Z"];t.local&&a.push(""),t.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${e}(?:${a.join("|")})`;return new RegExp(`^${vt}T(?:${i})$`)}const or=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},dr=/^-?\d+$/,lr=/^-?\d+(?:\.\d+)?$/,ur=/^(?:true|false)$/i,pr=/^[^A-Z]*$/,cr=/^[^a-z]*$/,P=p("$ZodCheck",(t,e)=>{var a;t._zod??(t._zod={}),t._zod.def=e,(a=t._zod).onattach??(a.onattach=[])}),yt={number:"number",bigint:"bigint",object:"date"},hr=p("$ZodCheckLessThan",(t,e)=>{P.init(t,e);const a=yt[typeof e.value];t._zod.onattach.push(i=>{const r=i._zod.bag,s=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:a,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),mr=p("$ZodCheckGreaterThan",(t,e)=>{P.init(t,e);const a=yt[typeof e.value];t._zod.onattach.push(i=>{const r=i._zod.bag,s=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:a,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),gr=p("$ZodCheckNumberFormat",(t,e)=>{P.init(t,e),e.format=e.format||"float64";const a=e.format?.includes("int"),i=a?"int":"number",[r,s]=Za[e.format];t._zod.onattach.push(n=>{const o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=s,a&&(o.pattern=dr)}),t._zod.check=n=>{const o=n.value;if(a){if(!Number.isInteger(o)){n.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:o,inst:t});return}if(!Number.isSafeInteger(o)){o>0?n.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):n.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}o<r&&n.issues.push({origin:"number",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>s&&n.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),fr=p("$ZodCheckMaxLength",(t,e)=>{var a;P.init(t,e),(a=t._zod.def).when??(a.when=i=>{const r=i.value;return!He(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{const r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{const r=i.value;if(r.length<=e.maximum)return;const n=et(r);i.issues.push({origin:n,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),br=p("$ZodCheckMinLength",(t,e)=>{var a;P.init(t,e),(a=t._zod.def).when??(a.when=i=>{const r=i.value;return!He(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{const r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{const r=i.value;if(r.length>=e.minimum)return;const n=et(r);i.issues.push({origin:n,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),$r=p("$ZodCheckLengthEquals",(t,e)=>{var a;P.init(t,e),(a=t._zod.def).when??(a.when=i=>{const r=i.value;return!He(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{const r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{const r=i.value,s=r.length;if(s===e.length)return;const n=et(r),o=s>e.length;i.issues.push({origin:n,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),le=p("$ZodCheckStringFormat",(t,e)=>{var a,i;P.init(t,e),t._zod.onattach.push(r=>{const s=r._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(a=t._zod).check??(a.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),vr=p("$ZodCheckRegex",(t,e)=>{le.init(t,e),t._zod.check=a=>{e.pattern.lastIndex=0,!e.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),_r=p("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=pr),le.init(t,e)}),yr=p("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=cr),le.init(t,e)}),Dr=p("$ZodCheckIncludes",(t,e)=>{P.init(t,e);const a=Qe(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${a}`:a);e.pattern=i,t._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),wr=p("$ZodCheckStartsWith",(t,e)=>{P.init(t,e);const a=new RegExp(`^${Qe(e.prefix)}.*`);e.pattern??(e.pattern=a),t._zod.onattach.push(i=>{const r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(a)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),Cr=p("$ZodCheckEndsWith",(t,e)=>{P.init(t,e);const a=new RegExp(`.*${Qe(e.suffix)}$`);e.pattern??(e.pattern=a),t._zod.onattach.push(i=>{const r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(a)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}}),xr=p("$ZodCheckOverwrite",(t,e)=>{P.init(t,e),t._zod.check=a=>{a.value=e.tx(a.value)}}),kr={major:4,minor:3,patch:6},w=p("$ZodType",(t,e)=>{var a;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=kr;const i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(const r of i)for(const s of r._zod.onattach)s(t);if(i.length===0)(a=t._zod).deferred??(a.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const r=(n,o,u)=>{let h=B(n),g;for(const b of o){if(b._zod.def.when){if(!b._zod.def.when(n))continue}else if(h)continue;const v=n.issues.length,_=b._zod.check(n);if(_ instanceof Promise&&u?.async===!1)throw new U;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,n.issues.length!==v&&(h||(h=B(n,v)))});else{if(n.issues.length===v)continue;h||(h=B(n,v))}}return g?g.then(()=>n):n},s=(n,o,u)=>{if(B(n))return n.aborted=!0,n;const h=r(o,i,u);if(h instanceof Promise){if(u.async===!1)throw new U;return h.then(g=>t._zod.parse(g,u))}return t._zod.parse(h,u)};t._zod.run=(n,o)=>{if(o.skipChecks)return t._zod.parse(n,o);if(o.direction==="backward"){const h=t._zod.parse({value:n.value,issues:[]},{...o,skipChecks:!0});return h instanceof Promise?h.then(g=>s(g,n,o)):s(h,n,o)}const u=t._zod.parse(n,o);if(u instanceof Promise){if(o.async===!1)throw new U;return u.then(h=>r(h,i,o))}return r(u,i,o)}}y(t,"~standard",()=>({validate:r=>{try{const s=ft(t,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return bt(t,r).then(n=>n.success?{value:n.data}:{issues:n.error?.issues})}},vendor:"zod",version:1}))}),tt=p("$ZodString",(t,e)=>{w.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??or(t._zod.bag),t._zod.parse=(a,i)=>{if(e.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:t}),a}}),z=p("$ZodStringFormat",(t,e)=>{le.init(t,e),tt.init(t,e)}),Tr=p("$ZodUUID",(t,e)=>{if(e.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=$t(i))}else e.pattern??(e.pattern=$t());z.init(t,e)}),Lr=p("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=er),z.init(t,e)}),Ar=p("$ZodURL",(t,e)=>{z.init(t,e),t._zod.check=a=>{try{const i=a.value.trim(),r=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:a.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:a.value,inst:t,continue:!e.abort})),e.normalize?a.value=r.href:a.value=i;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:t,continue:!e.abort})}}}),Pr=p("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=nr(e)),z.init(t,e)}),Ir=p("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=ir),z.init(t,e)}),zr=p("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=sr(e)),z.init(t,e)}),Mr=p("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Qa),z.init(t,e)}),Er=p("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=tr),z.init(t,e),t._zod.bag.format="ipv4"}),Sr=p("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=ar),z.init(t,e),t._zod.bag.format="ipv6",t._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:t,continue:!e.abort})}}}),Or=p("$ZodCustomStringFormat",(t,e)=>{z.init(t,e),t._zod.check=a=>{e.fn(a.value)||a.issues.push({code:"invalid_format",format:e.format,input:a.value,inst:t,continue:!e.abort})}}),Dt=p("$ZodNumber",(t,e)=>{w.init(t,e),t._zod.pattern=t._zod.bag.pattern??lr,t._zod.parse=(a,i)=>{if(e.coerce)try{a.value=Number(a.value)}catch{}const r=a.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return a;const s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...s?{received:s}:{}}),a}}),Rr=p("$ZodNumberFormat",(t,e)=>{gr.init(t,e),Dt.init(t,e)}),Fr=p("$ZodBoolean",(t,e)=>{w.init(t,e),t._zod.pattern=ur,t._zod.parse=(a,i)=>{if(e.coerce)try{a.value=!!a.value}catch{}const r=a.value;return typeof r=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),a}}),Zr=p("$ZodAny",(t,e)=>{w.init(t,e),t._zod.parse=a=>a});function wt(t,e,a){t.issues.length&&e.issues.push(...ja(a,t.issues)),e.value[a]=t.value}const Ct=p("$ZodArray",(t,e)=>{w.init(t,e),t._zod.parse=(a,i)=>{const r=a.value;if(!Array.isArray(r))return a.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),a;a.value=Array(r.length);const s=[];for(let n=0;n<r.length;n++){const o=r[n],u=e.element._zod.run({value:o,issues:[]},i);u instanceof Promise?s.push(u.then(h=>wt(h,a,n))):wt(u,a,n)}return s.length?Promise.all(s).then(()=>a):a}});function xt(t,e,a,i){for(const s of t)if(s.issues.length===0)return e.value=s.value,e;const r=t.filter(s=>!B(s));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:a,errors:t.map(s=>s.issues.map(n=>q(n,i,j())))}),e)}const jr=p("$ZodUnion",(t,e)=>{w.init(t,e),y(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),y(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),y(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),y(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){const r=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>Ke(s.source)).join("|")})$`)}});const a=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(r,s)=>{if(a)return i(r,s);let n=!1;const o=[];for(const u of e.options){const h=u._zod.run({value:r.value,issues:[]},s);if(h instanceof Promise)o.push(h),n=!0;else{if(h.issues.length===0)return h;o.push(h)}}return n?Promise.all(o).then(u=>xt(u,r,t,s)):xt(o,r,t,s)}}),qr=p("$ZodIntersection",(t,e)=>{w.init(t,e),t._zod.parse=(a,i)=>{const r=a.value,s=e.left._zod.run({value:r,issues:[]},i),n=e.right._zod.run({value:r,issues:[]},i);return s instanceof Promise||n instanceof Promise?Promise.all([s,n]).then(([u,h])=>kt(a,u,h)):kt(a,s,n)}});function at(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Xe(t)&&Xe(e)){const a=Object.keys(e),i=Object.keys(t).filter(s=>a.indexOf(s)!==-1),r={...t,...e};for(const s of i){const n=at(t[s],e[s]);if(!n.valid)return{valid:!1,mergeErrorPath:[s,...n.mergeErrorPath]};r[s]=n.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let i=0;i<t.length;i++){const r=t[i],s=e[i],n=at(r,s);if(!n.valid)return{valid:!1,mergeErrorPath:[i,...n.mergeErrorPath]};a.push(n.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function kt(t,e,a){const i=new Map;let r;for(const o of e.issues)if(o.code==="unrecognized_keys"){r??(r=o);for(const u of o.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else t.issues.push(o);for(const o of a.issues)if(o.code==="unrecognized_keys")for(const u of o.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else t.issues.push(o);const s=[...i].filter(([,o])=>o.l&&o.r).map(([o])=>o);if(s.length&&r&&t.issues.push({...r,keys:s}),B(t))return t;const n=at(e.value,a.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return t.value=n.data,t}const Nr=p("$ZodTransform",(t,e)=>{w.init(t,e),t._zod.parse=(a,i)=>{if(i.direction==="backward")throw new dt(t.constructor.name);const r=e.transform(a.value,a);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(n=>(a.value=n,a));if(r instanceof Promise)throw new U;return a.value=r,a}});function Tt(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const rt=p("$ZodOptional",(t,e)=>{w.init(t,e),t._zod.optin="optional",t._zod.optout="optional",y(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),y(t._zod,"pattern",()=>{const a=e.innerType._zod.pattern;return a?new RegExp(`^(${Ke(a.source)})?$`):void 0}),t._zod.parse=(a,i)=>{if(e.innerType._zod.optin==="optional"){const r=e.innerType._zod.run(a,i);return r instanceof Promise?r.then(s=>Tt(s,a.value)):Tt(r,a.value)}return a.value===void 0?a:e.innerType._zod.run(a,i)}}),Vr=p("$ZodExactOptional",(t,e)=>{rt.init(t,e),y(t._zod,"values",()=>e.innerType._zod.values),y(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(a,i)=>e.innerType._zod.run(a,i)}),Ur=p("$ZodNullable",(t,e)=>{w.init(t,e),y(t._zod,"optin",()=>e.innerType._zod.optin),y(t._zod,"optout",()=>e.innerType._zod.optout),y(t._zod,"pattern",()=>{const a=e.innerType._zod.pattern;return a?new RegExp(`^(${Ke(a.source)}|null)$`):void 0}),y(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(a,i)=>a.value===null?a:e.innerType._zod.run(a,i)}),Br=p("$ZodDefault",(t,e)=>{w.init(t,e),t._zod.optin="optional",y(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(a,i)=>{if(i.direction==="backward")return e.innerType._zod.run(a,i);if(a.value===void 0)return a.value=e.defaultValue,a;const r=e.innerType._zod.run(a,i);return r instanceof Promise?r.then(s=>Lt(s,e)):Lt(r,e)}});function Lt(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const Wr=p("$ZodPrefault",(t,e)=>{w.init(t,e),t._zod.optin="optional",y(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(a,i)=>(i.direction==="backward"||a.value===void 0&&(a.value=e.defaultValue),e.innerType._zod.run(a,i))}),Jr=p("$ZodNonOptional",(t,e)=>{w.init(t,e),y(t._zod,"values",()=>{const a=e.innerType._zod.values;return a?new Set([...a].filter(i=>i!==void 0)):void 0}),t._zod.parse=(a,i)=>{const r=e.innerType._zod.run(a,i);return r instanceof Promise?r.then(s=>At(s,t)):At(r,t)}});function At(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const Gr=p("$ZodCatch",(t,e)=>{w.init(t,e),y(t._zod,"optin",()=>e.innerType._zod.optin),y(t._zod,"optout",()=>e.innerType._zod.optout),y(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(a,i)=>{if(i.direction==="backward")return e.innerType._zod.run(a,i);const r=e.innerType._zod.run(a,i);return r instanceof Promise?r.then(s=>(a.value=s.value,s.issues.length&&(a.value=e.catchValue({...a,error:{issues:s.issues.map(n=>q(n,i,j()))},input:a.value}),a.issues=[]),a)):(a.value=r.value,r.issues.length&&(a.value=e.catchValue({...a,error:{issues:r.issues.map(s=>q(s,i,j()))},input:a.value}),a.issues=[]),a)}}),Yr=p("$ZodPipe",(t,e)=>{w.init(t,e),y(t._zod,"values",()=>e.in._zod.values),y(t._zod,"optin",()=>e.in._zod.optin),y(t._zod,"optout",()=>e.out._zod.optout),y(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(a,i)=>{if(i.direction==="backward"){const s=e.out._zod.run(a,i);return s instanceof Promise?s.then(n=>ue(n,e.in,i)):ue(s,e.in,i)}const r=e.in._zod.run(a,i);return r instanceof Promise?r.then(s=>ue(s,e.out,i)):ue(r,e.out,i)}});function ue(t,e,a){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},a)}const Hr=p("$ZodReadonly",(t,e)=>{w.init(t,e),y(t._zod,"propValues",()=>e.innerType._zod.propValues),y(t._zod,"values",()=>e.innerType._zod.values),y(t._zod,"optin",()=>e.innerType?._zod?.optin),y(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(a,i)=>{if(i.direction==="backward")return e.innerType._zod.run(a,i);const r=e.innerType._zod.run(a,i);return r instanceof Promise?r.then(Pt):Pt(r)}});function Pt(t){return t.value=Object.freeze(t.value),t}const It=p("$ZodCustom",(t,e)=>{P.init(t,e),w.init(t,e),t._zod.parse=(a,i)=>a,t._zod.check=a=>{const i=a.value,r=e.fn(i);if(r instanceof Promise)return r.then(s=>zt(s,a,i,t));zt(r,a,i,t)}});function zt(t,e,a,i){if(!t){const r={code:"custom",input:a,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(Q(r))}}var Mt;class Kr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...a){const i=a[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const a=this._map.get(e);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(e),this}get(e){const a=e._zod.parent;if(a){const i={...this.get(a)??{}};delete i.id;const r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Xr(){return new Kr}(Mt=globalThis).__zod_globalRegistry??(Mt.__zod_globalRegistry=Xr());const ee=globalThis.__zod_globalRegistry;function Qr(t,e){return new t({type:"string",...$(e)})}function ei(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...$(e)})}function ti(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...$(e)})}function ai(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...$(e)})}function ri(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(e)})}function ii(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(e)})}function si(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(e)})}function ni(t,e){return new t({type:"string",format:"date",check:"string_format",...$(e)})}function oi(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...$(e)})}function di(t,e){return new t({type:"string",format:"duration",check:"string_format",...$(e)})}function li(t,e){return new t({type:"number",checks:[],...$(e)})}function ui(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...$(e)})}function pi(t,e){return new t({type:"boolean",...$(e)})}function ci(t){return new t({type:"any"})}function hi(t,e){return new hr({check:"less_than",...$(e),value:t,inclusive:!0})}function mi(t,e){return new mr({check:"greater_than",...$(e),value:t,inclusive:!0})}function pe(t,e){return new fr({check:"max_length",...$(e),maximum:t})}function W(t,e){return new br({check:"min_length",...$(e),minimum:t})}function Et(t,e){return new $r({check:"length_equals",...$(e),length:t})}function St(t,e){return new vr({check:"string_format",format:"regex",...$(e),pattern:t})}function gi(t){return new _r({check:"string_format",format:"lowercase",...$(t)})}function fi(t){return new yr({check:"string_format",format:"uppercase",...$(t)})}function bi(t,e){return new Dr({check:"string_format",format:"includes",...$(e),includes:t})}function $i(t,e){return new wr({check:"string_format",format:"starts_with",...$(e),prefix:t})}function vi(t,e){return new Cr({check:"string_format",format:"ends_with",...$(e),suffix:t})}function J(t){return new xr({check:"overwrite",tx:t})}function _i(t){return J(e=>e.normalize(t))}function yi(){return J(t=>t.trim())}function Di(){return J(t=>t.toLowerCase())}function wi(){return J(t=>t.toUpperCase())}function Ci(){return J(t=>Fa(t))}function xi(t,e,a){return new t({type:"array",element:e,...$(a)})}function Ot(t,e,a){return new t({type:"custom",check:"custom",fn:e,...$(a)})}function Rt(t){const e=ki(a=>(a.addIssue=i=>{if(typeof i=="string")a.issues.push(Q(i,a.value,e._zod.def));else{const r=i;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=a.value),r.inst??(r.inst=e),r.continue??(r.continue=!e._zod.def.abort),a.issues.push(Q(r))}},t(a.value,a)));return e}function ki(t,e){const a=new P({check:"custom",...$(e)});return a._zod.check=t,a}function Ti(t,e,a,i={}){const r=$(i),s={...$(i),check:"string_format",type:"string",format:e,fn:typeof a=="function"?a:o=>a.test(o),...r};return a instanceof RegExp&&(s.pattern=a),new t(s)}function Ft(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ee,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function k(t,e,a={path:[],schemaPath:[]}){var i;const r=t._zod.def,s=e.seen.get(t);if(s)return s.count++,a.schemaPath.includes(t)&&(s.cycle=a.path),s.schema;const n={schema:{},count:1,cycle:void 0,path:a.path};e.seen.set(t,n);const o=t._zod.toJSONSchema?.();if(o)n.schema=o;else{const g={...a,schemaPath:[...a.schemaPath,t],path:a.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,n.schema,g);else{const v=n.schema,_=e.processors[r.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);_(t,e,v,g)}const b=t._zod.parent;b&&(n.ref||(n.ref=b),k(b,e,g),e.seen.get(b).isParent=!0)}const u=e.metadataRegistry.get(t);return u&&Object.assign(n.schema,u),e.io==="input"&&T(t)&&(delete n.schema.examples,delete n.schema.default),e.io==="input"&&n.schema._prefault&&((i=n.schema).default??(i.default=n.schema._prefault)),delete n.schema._prefault,e.seen.get(t).schema}function Zt(t,e){const a=t.seen.get(e);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const n of t.seen.entries()){const o=t.metadataRegistry.get(n[0])?.id;if(o){const u=i.get(o);if(u&&u!==n[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(o,n[0])}}const r=n=>{const o=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const b=t.external.registry.get(n[0])?.id,v=t.external.uri??(Z=>Z);if(b)return{ref:v(b)};const _=n[1].defId??n[1].schema.id??`schema${t.counter++}`;return n[1].defId=_,{defId:_,ref:`${v("__shared")}#/${o}/${_}`}}if(n[1]===a)return{ref:"#"};const h=`#/${o}/`,g=n[1].schema.id??`__schema${t.counter++}`;return{defId:g,ref:h+g}},s=n=>{if(n[1].schema.$ref)return;const o=n[1],{ref:u,defId:h}=r(n);o.def={...o.schema},h&&(o.defId=h);const g=o.schema;for(const b in g)delete g[b];g.$ref=u};if(t.cycles==="throw")for(const n of t.seen.entries()){const o=n[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
|
|
2
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
|
|
4
|
-
class="gui-widget-icon gui-button-icon ${e}"
|
|
5
|
-
data-icon=${e}
|
|
6
|
-
aria-hidden="true"
|
|
7
|
-
></span>`:d.nothing;return d.html`
|
|
8
|
-
<div class="gui-widget">
|
|
9
|
-
<button
|
|
10
|
-
type=${this.actionType??"button"}
|
|
11
|
-
id=${this.uid}
|
|
12
|
-
class=${S.classMap(i)}
|
|
13
|
-
data-cy=${`${this.uid}_button`}
|
|
14
|
-
?disabled=${this.disabled}
|
|
15
|
-
>
|
|
16
|
-
${t==="left"?a:d.nothing}
|
|
17
|
-
${this.label?d.html`<span>${this.label}</span>`:d.nothing}
|
|
18
|
-
${t==="right"?a:d.nothing}
|
|
19
|
-
</button>
|
|
20
|
-
</div>
|
|
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`
|
|
3
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of t.seen.entries()){const o=n[1];if(e===n[0]){s(n);continue}if(t.external){const h=t.external.registry.get(n[0])?.id;if(e!==n[0]&&h){s(n);continue}}if(t.metadataRegistry.get(n[0])?.id){s(n);continue}if(o.cycle){s(n);continue}if(o.count>1&&t.reused==="ref"){s(n);continue}}}function jt(t,e){const a=t.seen.get(e);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=n=>{const o=t.seen.get(n);if(o.ref===null)return;const u=o.def??o.schema,h={...u},g=o.ref;if(o.ref=null,g){i(g);const v=t.seen.get(g),_=v.schema;if(_.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(_)):Object.assign(u,_),Object.assign(u,h),n._zod.parent===g)for(const A in u)A==="$ref"||A==="allOf"||A in h||delete u[A];if(_.$ref&&v.def)for(const A in u)A==="$ref"||A==="allOf"||A in v.def&&JSON.stringify(u[A])===JSON.stringify(v.def[A])&&delete u[A]}const b=n._zod.parent;if(b&&b!==g){i(b);const v=t.seen.get(b);if(v?.schema.$ref&&(u.$ref=v.schema.$ref,v.def))for(const _ in u)_==="$ref"||_==="allOf"||_ in v.def&&JSON.stringify(u[_])===JSON.stringify(v.def[_])&&delete u[_]}t.override({zodSchema:n,jsonSchema:u,path:o.path??[]})};for(const n of[...t.seen.entries()].reverse())i(n[0]);const r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const n=t.external.registry.get(e)?.id;if(!n)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(n)}Object.assign(r,a.def??a.schema);const s=t.external?.defs??{};for(const n of t.seen.entries()){const o=n[1];o.def&&o.defId&&(s[o.defId]=o.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{const n=JSON.parse(JSON.stringify(r));return Object.defineProperty(n,"~standard",{value:{...e["~standard"],jsonSchema:{input:ce(e,"input",t.processors),output:ce(e,"output",t.processors)}},enumerable:!1,writable:!1}),n}catch{throw new Error("Error converting schema to JSON.")}}function T(t,e){const a=e??{seen:new Set};if(a.seen.has(t))return!1;a.seen.add(t);const i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return T(i.element,a);if(i.type==="set")return T(i.valueType,a);if(i.type==="lazy")return T(i.getter(),a);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return T(i.innerType,a);if(i.type==="intersection")return T(i.left,a)||T(i.right,a);if(i.type==="record"||i.type==="map")return T(i.keyType,a)||T(i.valueType,a);if(i.type==="pipe")return T(i.in,a)||T(i.out,a);if(i.type==="object"){for(const r in i.shape)if(T(i.shape[r],a))return!0;return!1}if(i.type==="union"){for(const r of i.options)if(T(r,a))return!0;return!1}if(i.type==="tuple"){for(const r of i.items)if(T(r,a))return!0;return!!(i.rest&&T(i.rest,a))}return!1}const Li=(t,e={})=>a=>{const i=Ft({...a,processors:e});return k(t,i),Zt(i,t),jt(i,t)},ce=(t,e,a={})=>i=>{const{libraryOptions:r,target:s}=i??{},n=Ft({...r??{},target:s,io:e,processors:a});return k(t,n),Zt(n,t),jt(n,t)},Ai={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Pi=(t,e,a,i)=>{const r=a;r.type="string";const{minimum:s,maximum:n,format:o,patterns:u,contentEncoding:h}=t._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof n=="number"&&(r.maxLength=n),o&&(r.format=Ai[o]??o,r.format===""&&delete r.format,o==="time"&&delete r.format),h&&(r.contentEncoding=h),u&&u.size>0){const g=[...u];g.length===1?r.pattern=g[0].source:g.length>1&&(r.allOf=[...g.map(b=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:b.source}))])}},Ii=(t,e,a,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zi=(t,e,a,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Mi=(t,e,a,i)=>{const r=a,s=t._zod.def,{minimum:n,maximum:o}=t._zod.bag;typeof n=="number"&&(r.minItems=n),typeof o=="number"&&(r.maxItems=o),r.type="array",r.items=k(s.element,e,{...i,path:[...i.path,"items"]})},Ei=(t,e,a,i)=>{const r=t._zod.def,s=r.inclusive===!1,n=r.options.map((o,u)=>k(o,e,{...i,path:[...i.path,s?"oneOf":"anyOf",u]}));s?a.oneOf=n:a.anyOf=n},Si=(t,e,a,i)=>{const r=t._zod.def,s=k(r.left,e,{...i,path:[...i.path,"allOf",0]}),n=k(r.right,e,{...i,path:[...i.path,"allOf",1]}),o=h=>"allOf"in h&&Object.keys(h).length===1,u=[...o(s)?s.allOf:[s],...o(n)?n.allOf:[n]];a.allOf=u},Oi=(t,e,a,i)=>{const r=t._zod.def,s=k(r.innerType,e,i),n=e.seen.get(t);e.target==="openapi-3.0"?(n.ref=r.innerType,a.nullable=!0):a.anyOf=[s,{type:"null"}]},Ri=(t,e,a,i)=>{const r=t._zod.def;k(r.innerType,e,i);const s=e.seen.get(t);s.ref=r.innerType},Fi=(t,e,a,i)=>{const r=t._zod.def;k(r.innerType,e,i);const s=e.seen.get(t);s.ref=r.innerType,a.default=JSON.parse(JSON.stringify(r.defaultValue))},Zi=(t,e,a,i)=>{const r=t._zod.def;k(r.innerType,e,i);const s=e.seen.get(t);s.ref=r.innerType,e.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},ji=(t,e,a,i)=>{const r=t._zod.def;k(r.innerType,e,i);const s=e.seen.get(t);s.ref=r.innerType;let n;try{n=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=n},qi=(t,e,a,i)=>{const r=t._zod.def,s=e.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;k(s,e,i);const n=e.seen.get(t);n.ref=s},Ni=(t,e,a,i)=>{const r=t._zod.def;k(r.innerType,e,i);const s=e.seen.get(t);s.ref=r.innerType,a.readOnly=!0},qt=(t,e,a,i)=>{const r=t._zod.def;k(r.innerType,e,i);const s=e.seen.get(t);s.ref=r.innerType},Vi=p("ZodISODateTime",(t,e)=>{Pr.init(t,e),he.init(t,e)});function Ui(t){return si(Vi,t)}const Bi=p("ZodISODate",(t,e)=>{Ir.init(t,e),he.init(t,e)});function Wi(t){return ni(Bi,t)}const Ji=p("ZodISOTime",(t,e)=>{zr.init(t,e),he.init(t,e)});function Gi(t){return oi(Ji,t)}const Yi=p("ZodISODuration",(t,e)=>{Mr.init(t,e),he.init(t,e)});function Hi(t){return di(Yi,t)}const M=p("ZodError",(t,e)=>{gt.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a=>Na(t,a)},flatten:{value:a=>qa(t,a)},addIssue:{value:a=>{t.issues.push(a),t.message=JSON.stringify(t.issues,Ye,2)}},addIssues:{value:a=>{t.issues.push(...a),t.message=JSON.stringify(t.issues,Ye,2)}},isEmpty:{get(){return t.issues.length===0}}})},{Parent:Error}),Ki=se(M),Xi=ne(M),Qi=oe(M),es=de(M),ts=Ba(M),as=Wa(M),rs=Ja(M),is=Ga(M),ss=Ya(M),ns=Ha(M),os=Ka(M),ds=Xa(M),L=p("ZodType",(t,e)=>(w.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ce(t,"input"),output:ce(t,"output")}}),t.toJSONSchema=Li(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...a)=>t.clone(Ra(e,{checks:[...e.checks??[],...a.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),t.with=t.check,t.clone=(a,i)=>ht(t,a,i),t.brand=()=>t,t.register=((a,i)=>(a.add(t,i),t)),t.parse=(a,i)=>Ki(t,a,i,{callee:t.parse}),t.safeParse=(a,i)=>Qi(t,a,i),t.parseAsync=async(a,i)=>Xi(t,a,i,{callee:t.parseAsync}),t.safeParseAsync=async(a,i)=>es(t,a,i),t.spa=t.safeParseAsync,t.encode=(a,i)=>ts(t,a,i),t.decode=(a,i)=>as(t,a,i),t.encodeAsync=async(a,i)=>rs(t,a,i),t.decodeAsync=async(a,i)=>is(t,a,i),t.safeEncode=(a,i)=>ss(t,a,i),t.safeDecode=(a,i)=>ns(t,a,i),t.safeEncodeAsync=async(a,i)=>os(t,a,i),t.safeDecodeAsync=async(a,i)=>ds(t,a,i),t.refine=(a,i)=>t.check(Es(a,i)),t.superRefine=a=>t.check(Ss(a)),t.overwrite=a=>t.check(J(a)),t.optional=()=>Nt(t),t.exactOptional=()=>_s(t),t.nullable=()=>Vt(t),t.nullish=()=>Nt(Vt(t)),t.nonoptional=a=>Ts(t,a),t.array=()=>ps(t),t.or=a=>hs([t,a]),t.and=a=>gs(t,a),t.transform=a=>Ut(t,bs(a)),t.default=a=>ws(t,a),t.prefault=a=>xs(t,a),t.catch=a=>As(t,a),t.pipe=a=>Ut(t,a),t.readonly=()=>zs(t),t.describe=a=>{const i=t.clone();return ee.add(i,{description:a}),i},Object.defineProperty(t,"description",{get(){return ee.get(t)?.description},configurable:!0}),t.meta=(...a)=>{if(a.length===0)return ee.get(t);const i=t.clone();return ee.add(i,a[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=a=>a(t),t)),ls=p("_ZodString",(t,e)=>{tt.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,s)=>Pi(t,i,r);const a=t._zod.bag;t.format=a.format??null,t.minLength=a.minimum??null,t.maxLength=a.maximum??null,t.regex=(...i)=>t.check(St(...i)),t.includes=(...i)=>t.check(bi(...i)),t.startsWith=(...i)=>t.check($i(...i)),t.endsWith=(...i)=>t.check(vi(...i)),t.min=(...i)=>t.check(W(...i)),t.max=(...i)=>t.check(pe(...i)),t.length=(...i)=>t.check(Et(...i)),t.nonempty=(...i)=>t.check(W(1,...i)),t.lowercase=i=>t.check(gi(i)),t.uppercase=i=>t.check(fi(i)),t.trim=()=>t.check(yi()),t.normalize=(...i)=>t.check(_i(...i)),t.toLowerCase=()=>t.check(Di()),t.toUpperCase=()=>t.check(wi()),t.slugify=()=>t.check(Ci())}),he=p("ZodStringFormat",(t,e)=>{z.init(t,e),ls.init(t,e)}),us=p("ZodArray",(t,e)=>{Ct.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Mi(t,a,i,r),t.element=e.element,t.min=(a,i)=>t.check(W(a,i)),t.nonempty=a=>t.check(W(1,a)),t.max=(a,i)=>t.check(pe(a,i)),t.length=(a,i)=>t.check(Et(a,i)),t.unwrap=()=>t.element});function ps(t,e){return xi(us,t,e)}const cs=p("ZodUnion",(t,e)=>{jr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Ei(t,a,i,r),t.options=e.options});function hs(t,e){return new cs({type:"union",options:t,...$(e)})}const ms=p("ZodIntersection",(t,e)=>{qr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Si(t,a,i,r)});function gs(t,e){return new ms({type:"intersection",left:t,right:e})}const fs=p("ZodTransform",(t,e)=>{Nr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>zi(t,a),t._zod.parse=(a,i)=>{if(i.direction==="backward")throw new dt(t.constructor.name);a.addIssue=s=>{if(typeof s=="string")a.issues.push(Q(s,a.value,e));else{const n=s;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=a.value),n.inst??(n.inst=t),a.issues.push(Q(n))}};const r=e.transform(a.value,a);return r instanceof Promise?r.then(s=>(a.value=s,a)):(a.value=r,a)}});function bs(t){return new fs({type:"transform",transform:t})}const $s=p("ZodOptional",(t,e)=>{rt.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>qt(t,a,i,r),t.unwrap=()=>t._zod.def.innerType});function Nt(t){return new $s({type:"optional",innerType:t})}const vs=p("ZodExactOptional",(t,e)=>{Vr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>qt(t,a,i,r),t.unwrap=()=>t._zod.def.innerType});function _s(t){return new vs({type:"optional",innerType:t})}const ys=p("ZodNullable",(t,e)=>{Ur.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Oi(t,a,i,r),t.unwrap=()=>t._zod.def.innerType});function Vt(t){return new ys({type:"nullable",innerType:t})}const Ds=p("ZodDefault",(t,e)=>{Br.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Fi(t,a,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function ws(t,e){return new Ds({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():ct(e)}})}const Cs=p("ZodPrefault",(t,e)=>{Wr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Zi(t,a,i,r),t.unwrap=()=>t._zod.def.innerType});function xs(t,e){return new Cs({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():ct(e)}})}const ks=p("ZodNonOptional",(t,e)=>{Jr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Ri(t,a,i,r),t.unwrap=()=>t._zod.def.innerType});function Ts(t,e){return new ks({type:"nonoptional",innerType:t,...$(e)})}const Ls=p("ZodCatch",(t,e)=>{Gr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>ji(t,a,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function As(t,e){return new Ls({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const Ps=p("ZodPipe",(t,e)=>{Yr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>qi(t,a,i,r),t.in=e.in,t.out=e.out});function Ut(t,e){return new Ps({type:"pipe",in:t,out:e})}const Is=p("ZodReadonly",(t,e)=>{Hr.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Ni(t,a,i,r),t.unwrap=()=>t._zod.def.innerType});function zs(t){return new Is({type:"readonly",innerType:t})}const Ms=p("ZodCustom",(t,e)=>{It.init(t,e),L.init(t,e),t._zod.processJSONSchema=(a,i,r)=>Ii(t,a)});function Es(t,e={}){return Ot(Ms,t,e)}function Ss(t){return Rt(t)}const N=p("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");w.init(t,e),t.def=e,t.type=e.type,t.parse=(a,i)=>Va(t,a,i,{callee:t.parse}),t.safeParse=(a,i)=>ft(t,a,i),t.parseAsync=async(a,i)=>Ua(t,a,i,{callee:t.parseAsync}),t.safeParseAsync=async(a,i)=>bt(t,a,i),t.check=(...a)=>t.clone({...e,checks:[...e.checks??[],...a.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),t.with=t.check,t.clone=(a,i)=>ht(t,a,i),t.brand=()=>t,t.register=((a,i)=>(a.add(t,i),t)),t.apply=a=>a(t)}),Bt=p("ZodMiniString",(t,e)=>{tt.init(t,e),N.init(t,e)});function Wt(t){return Qr(Bt,t)}const G=p("ZodMiniStringFormat",(t,e)=>{z.init(t,e),Bt.init(t,e)}),Os=p("ZodMiniEmail",(t,e)=>{Lr.init(t,e),G.init(t,e)});function Rs(t){return ei(Os,t)}const Fs=p("ZodMiniUUID",(t,e)=>{Tr.init(t,e),G.init(t,e)});function Zs(t){return ti(Fs,t)}const js=p("ZodMiniURL",(t,e)=>{Ar.init(t,e),G.init(t,e)});function qs(t){return ai(js,t)}const Ns=p("ZodMiniIPv4",(t,e)=>{Er.init(t,e),G.init(t,e)});function Vs(t){return ri(Ns,t)}const Us=p("ZodMiniIPv6",(t,e)=>{Sr.init(t,e),G.init(t,e)});function Bs(t){return ii(Us,t)}const Ws=p("ZodMiniCustomStringFormat",(t,e)=>{Or.init(t,e),G.init(t,e)});function Js(t){return Ti(Ws,"hostname",rr,t)}const Jt=p("ZodMiniNumber",(t,e)=>{Dt.init(t,e),N.init(t,e)});function Gt(t){return li(Jt,t)}const Gs=p("ZodMiniNumberFormat",(t,e)=>{Rr.init(t,e),Jt.init(t,e)});function Ys(t){return ui(Gs,t)}const Hs=p("ZodMiniBoolean",(t,e)=>{Fr.init(t,e),N.init(t,e)});function Yt(t){return pi(Hs,t)}const Ks=p("ZodMiniAny",(t,e)=>{Zr.init(t,e),N.init(t,e)});function it(){return ci(Ks)}const Xs=p("ZodMiniArray",(t,e)=>{Ct.init(t,e),N.init(t,e)});function Ht(t,e){return new Xs({type:"array",element:t,...$(e)})}const Qs=p("ZodMiniOptional",(t,e)=>{rt.init(t,e),N.init(t,e)});function en(t){return new Qs({type:"optional",innerType:t})}const tn=p("ZodMiniCustom",(t,e)=>{It.init(t,e),N.init(t,e)});function x(t,e={}){return Ot(tn,t,e)}function Kt(t){return Rt(t)}const st={email:{schema:Rs()},hostname:{schema:Js()},ipv4:{schema:Vs()},ipv6:{schema:Bs()},url:{schema:qs()},uuid:{schema:Zs()},date:{schema:Wi()},time:{schema:Gi()},"date-time":{schema:Ui({local:!0,offset:!0})},duration:{schema:Hi()}},Xt=Object.keys(st),an=t=>(e,a)=>{switch(e.type){case"string":return rn(e,a);case"integer":case"number":return nn(e,a);case"boolean":return on(e,a);case"array":return dn(e,a);case"custom":{if(!t)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return ln(e,t)}default:{const i=e;throw new Error(`Unknown validator config: ${JSON.stringify(i)}. The "type" property must be one of: "string", "number", "integer", "boolean", "array", "custom".`)}}};function D(t,e){if(t!==void 0)return typeof t=="string"?t:e?.translate(t.key,t.params,t.default)??t.default}function rn(t,e){return te(t,a=>{const i=D(a.messages?.invalid,e);let r=i?Wt(i):Wt();if(a.required===!0){const s=D(a.messages?.required,e)??"This field is required";r=r.check(x(n=>n.length>0,{error:s}))}if(typeof a.minLength=="number"){const s=D(a.messages?.minLength,e),n=a.minLength;r=r.check(s?x(o=>o.length>=n,{error:s}):W(n))}if(typeof a.maxLength=="number"){const s=D(a.messages?.maxLength,e),n=a.maxLength;r=r.check(s?x(o=>o.length<=n,{error:s}):pe(n))}if(typeof a.pattern=="string"){const s=D(a.messages?.pattern,e),n=new RegExp(a.pattern);r=r.check(s?x(o=>n.test(o),{error:s}):St(n))}if(a.enum){const s=a.enum,n=D(a.messages?.enum,e);r=r.check(x(o=>s.includes(o),n?{error:n}:void 0))}if(a.const!==void 0){const s=D(a.messages?.const,e);r=r.check(x(n=>n===a.const,s?{error:s}:void 0))}if(a.format!==void 0)if(Xt.includes(a.format)){const s=D(a.messages?.format,e);r=r.check(s?Kt((n,o)=>{const u=K.standardValidate(st[a.format].schema,n);K.isStandardValidateSuccess(u)||o.addIssue({code:"custom",path:[],message:s})}):st[a.format].schema)}else throw new Error(`Unknown string validation format: ${JSON.stringify(a.format)}. The "format" property must be one of: ${Xt.map(s=>`"${s}"`).join(", ")}.`);return r})}const sn=(t,e)=>{if(e===0)return!1;const a=t/e;return Math.abs(a-Math.round(a))<1e-10};function nn(t,e){return te(t,a=>{const i=D(a.messages?.invalid,e);let r=i?Gt(i):Gt();if(a.type==="integer"&&(r=r.check(Ys())),a.minimum!==void 0){const s=D(a.messages?.minimum,e),n=a.minimum;r=r.check(s?x(o=>o>=n,{error:s}):mi(n))}if(a.maximum!==void 0){const s=D(a.messages?.maximum,e),n=a.maximum;r=r.check(s?x(o=>o<=n,{error:s}):hi(n))}if(a.exclusiveMinimum!==void 0){const s=D(a.messages?.exclusiveMinimum,e),n=a.exclusiveMinimum;r=r.check(x(o=>o>n,s?{error:s}:void 0))}if(a.exclusiveMaximum!==void 0){const s=D(a.messages?.exclusiveMaximum,e),n=a.exclusiveMaximum;r=r.check(x(o=>o<n,s?{error:s}:void 0))}if(a.multipleOf!==void 0){const s=D(a.messages?.multipleOf,e),n=a.multipleOf;r=r.check(x(o=>sn(o,n),s?{error:s}:void 0))}if(a.enum){const s=a.enum,n=D(a.messages?.enum,e);r=r.check(x(o=>s.includes(o),n?{error:n}:void 0))}if(a.const!==void 0){const s=D(a.messages?.const,e);r=r.check(x(n=>n===a.const,s?{error:s}:void 0))}return r})}function on(t,e){return te(t,a=>{const i=D(a.messages?.invalid,e);let r=i?Yt(i):Yt();if(a.const!==void 0){const s=D(a.messages?.const,e);r=r.check(x(n=>n===a.const,s?{error:s}:void 0))}return r})}function dn(t,e){return te(t,a=>{const i=D(a.messages?.invalid,e);let r=i?Ht(it(),i):Ht(it());if(a.required===!0){const s=D(a.messages?.required,e)??"This field is required";r=r.check(x(n=>n.length>0,{error:s}))}if(typeof a.minItems=="number"){const s=D(a.messages?.minItems,e),n=a.minItems;r=r.check(s?x(o=>o.length>=n,{error:s}):W(n))}if(typeof a.maxItems=="number"){const s=D(a.messages?.maxItems,e),n=a.maxItems;r=r.check(s?x(o=>o.length<=n,{error:s}):pe(n))}return r})}function ln(t,e){return te(t,a=>{let i=it();return K.filterTap(Object.keys(a),r=>r!=="type"&&r!=="required",r=>{const s=a[r],n=e[r];if(!n){const u=Object.keys(e).map(h=>`"${h}"`).join(", ");throw new Error(`Unknown custom validator rule "${r}". Registered rules: ${u||"(none)"}.`)}const o=n(s);i=i.check(Kt((u,h)=>{const g=K.standardValidate(o,u);if(!K.isStandardValidateSuccess(g)){const b=g.issues[0];h.addIssue({code:"custom",path:[],message:b?.message||`Validation failed for ${r}`})}}))}),i})}function te(t,e){const a=e(t);return t.required?a:en(a)}const Qt={button:async()=>(await Promise.resolve().then(()=>pn)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>hn)).CalendarElement,dateTimeCalendar:async()=>(await Promise.resolve().then(()=>gn)).DateTimeCalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>bn)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>vn)).RangeDateInputElement,rangeTimeInput:async()=>(await Promise.resolve().then(()=>yn)).RangeTimeInputElement,rangeDateTimeInput:async()=>(await Promise.resolve().then(()=>wn)).RangeDateTimeInputElement,rangeDateTimeCalendar:async()=>(await Promise.resolve().then(()=>xn)).RangeDateTimeCalendarElement,rangeDateTimePicker:async()=>(await Promise.resolve().then(()=>Tn)).RangeDateTimePickerElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>An)).RangeDatePickerElement,rangeTimePicker:async()=>(await Promise.resolve().then(()=>In)).RangeTimePickerElement,currency:async()=>(await Promise.resolve().then(()=>Mn)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>Sn)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>Rn)).DatePickerElement,dateTimePicker:async()=>(await Promise.resolve().then(()=>Zn)).DateTimePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>qn)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>Vn)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>Bn)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>Jn)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Yn)).TextinputElement,timeInput:async()=>(await Promise.resolve().then(()=>Kn)).TimeElement,timePicker:async()=>(await Promise.resolve().then(()=>Qn)).TimePickerElement,dateTimeInput:async()=>(await Promise.resolve().then(()=>to)).DateTimeElement,textarea:async()=>(await Promise.resolve().then(()=>ro)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>so)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>oo)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>uo)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>co)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>mo)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>fo)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>_o)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>Do)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>Co)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>ko)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Lo)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Po)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>zo)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>Eo)).RendererElement};class ea extends d.createFormComponent({widgetLoaders:Qt,validators:an,resolveFormInput:nt.resolveFormInput}){}f.safeDefine("gui-form",ea);var un=Object.defineProperty,ta=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&un(e,a,r),r};class me extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.ActionWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
22
4
|
<gui-button
|
|
23
5
|
.uid=${this.widget.uid}
|
|
24
6
|
.actionType=${this.adapter.templateData.actionType??"button"}
|
|
@@ -30,198 +12,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
30
12
|
.iconPosition=${this.adapter.templateData.iconPosition}
|
|
31
13
|
@click=${()=>this.adapter.click()}
|
|
32
14
|
></gui-button>
|
|
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
|
|
34
|
-
class="gui-label"
|
|
35
|
-
for=${e}
|
|
36
|
-
data-cy=${`${e}_label`}
|
|
37
|
-
id=${a?`${e}_${a}_label`:`${e}_label`}
|
|
38
|
-
>
|
|
39
|
-
<span class="gui-label__text"
|
|
40
|
-
>${t.label}${Xi(t.required)}</span
|
|
41
|
-
>
|
|
42
|
-
${En(e,t)} ${i?j(e,t):d.nothing}
|
|
43
|
-
</label>`:d.nothing:t.label?d.html`<span
|
|
44
|
-
class="gui-label"
|
|
45
|
-
data-cy=${`${e}_label`}
|
|
46
|
-
id=${a?`${e}_${a}_label`:`${e}_label`}
|
|
47
|
-
>
|
|
48
|
-
<span class="gui-label__text"
|
|
49
|
-
>${t.label}${Xi(t.required)}</span
|
|
50
|
-
>
|
|
51
|
-
${En(e,t)} ${i?j(e,t):d.nothing}
|
|
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
|
|
53
|
-
class=${S.classMap(a)}
|
|
54
|
-
data-icon=${t.icon}
|
|
55
|
-
aria-hidden="true"
|
|
56
|
-
></span>`}}else return{widgetClasses:i,html:d.html``}},j=(e,t)=>{const i=t.touched&&t.errors&&t.errors.length>0,a={"gui-validator":!0,"gui-validator--empty":!i};return d.html`<ul
|
|
57
|
-
class=${S.classMap(a)}
|
|
58
|
-
id=${`${e}_errors`}
|
|
59
|
-
role="alert"
|
|
60
|
-
data-cy=${i?`${e}_validator-errors`:d.nothing}
|
|
61
|
-
>
|
|
62
|
-
${i?t.errors?.map(r=>d.html`<li class="gui-validator__error" data-cy=${`${e}_validator-error`}>
|
|
63
|
-
${r}
|
|
64
|
-
</li>`):d.nothing}
|
|
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`
|
|
66
|
-
${e.label?oe(e.uid,t,!1,"calendar"):d.nothing}
|
|
67
|
-
|
|
68
|
-
<div class="gui-widget" @focusout=${e.onFocusOut}>
|
|
69
|
-
<div
|
|
70
|
-
id=${`${e.uid}_calendar`}
|
|
71
|
-
class="gui-calendar-input"
|
|
72
|
-
role="group"
|
|
73
|
-
aria-labelledby=${e.label?`${e.uid}_calendar_label`:d.nothing}
|
|
74
|
-
aria-disabled=${e.disabled?"true":d.nothing}
|
|
75
|
-
>
|
|
76
|
-
<div class="gui-visually-hidden" aria-live="polite">${a}</div>
|
|
77
|
-
${e.renderAboveCalendar()}
|
|
78
|
-
<div class="gui-calendar__container">
|
|
79
|
-
${Cn("prev",{icon:e.prevMonthIcon,ariaLabel:e.prevMonthAriaLabel,disabled:!e.canGoPrev,onClick:e.onPrevMonthClick})}
|
|
80
|
-
|
|
81
|
-
<div class="gui-calendar__months-grid">
|
|
82
|
-
${i.map(r=>e.renderMonthPanel(r))}
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
${Cn("next",{icon:e.nextMonthIcon,ariaLabel:e.nextMonthAriaLabel,disabled:!e.canGoNext,onClick:e.onNextMonthClick})}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
${e.errors?.length?j(e.uid,t):d.nothing}
|
|
91
|
-
`}function Cn(e,t){return e==="prev"?d.html`
|
|
92
|
-
<button
|
|
93
|
-
type="button"
|
|
94
|
-
class="gui-button gui-calendar__month-button gui-calendar__month-button--prev"
|
|
95
|
-
?disabled=${t.disabled}
|
|
96
|
-
@click=${t.onClick}
|
|
97
|
-
aria-label=${t.ariaLabel??"Previous month"}
|
|
98
|
-
>
|
|
99
|
-
${t.icon?d.html`<span
|
|
100
|
-
class=${`gui-widget-icon ${t.icon}`}
|
|
101
|
-
data-icon=${t.icon}
|
|
102
|
-
aria-hidden="true"
|
|
103
|
-
></span>`:d.html`<svg
|
|
104
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
105
|
-
width="16"
|
|
106
|
-
height="16"
|
|
107
|
-
viewBox="0 0 256 256"
|
|
108
|
-
aria-hidden="true"
|
|
109
|
-
>
|
|
110
|
-
<path
|
|
111
|
-
d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"
|
|
112
|
-
></path>
|
|
113
|
-
</svg>`}
|
|
114
|
-
</button>
|
|
115
|
-
`:d.html`
|
|
116
|
-
<button
|
|
117
|
-
type="button"
|
|
118
|
-
class="gui-button gui-calendar__month-button gui-calendar__month-button--next"
|
|
119
|
-
?disabled=${t.disabled}
|
|
120
|
-
@click=${t.onClick}
|
|
121
|
-
aria-label=${t.ariaLabel??"Next month"}
|
|
122
|
-
>
|
|
123
|
-
${t.icon?d.html`<span
|
|
124
|
-
class=${`gui-widget-icon ${t.icon}`}
|
|
125
|
-
data-icon=${t.icon}
|
|
126
|
-
aria-hidden="true"
|
|
127
|
-
></span>`:d.html`<svg
|
|
128
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
129
|
-
width="16"
|
|
130
|
-
height="16"
|
|
131
|
-
viewBox="0 0 256 256"
|
|
132
|
-
aria-hidden="true"
|
|
133
|
-
>
|
|
134
|
-
<path
|
|
135
|
-
d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"
|
|
136
|
-
></path>
|
|
137
|
-
</svg>`}
|
|
138
|
-
</button>
|
|
139
|
-
`}function mm(e){const t=$r(e.currentDate,e.offset);return d.html`
|
|
140
|
-
<div class="gui-calendar__panel">
|
|
141
|
-
${e.renderHeader(t)} ${e.renderBelowHeader(e.offset)}
|
|
142
|
-
${e.renderPanelBody(e.offset)}
|
|
143
|
-
</div>
|
|
144
|
-
`}function ji(e){return mm({currentDate:e.currentDate,offset:e.offset,renderHeader:t=>ym(t,{localeId:e.localeId,monthFormat:e.monthFormat,yearSelectorOpen:e.yearSelectorOpen,selectYearAriaLabel:e.selectYearAriaLabel,onToggleYearSelector:e.onToggleYearSelector}),renderBelowHeader:e.renderBelowHeader??(()=>d.nothing),renderPanelBody:e.renderPanelBody})}function ea(e){return e.yearSelectorOpen&&e.offset===0?bm({years:e.years,currentYear:e.currentYear,onSelectYear:e.onSelectYear,onKeydown:e.onYearKeydown,ariaLabel:e.yearGridAriaLabel}):gm(fr(e.getDays(e.offset),7),hm(e.localeId),t=>e.renderDay(t),Sn(e.localeId,$r(e.currentDate,e.offset)))}function ym(e,t){const i=cm(t.localeId,e,t.monthFormat);return d.html`
|
|
145
|
-
<header class="gui-calendar__header">
|
|
146
|
-
<h2>
|
|
147
|
-
${i.map(a=>a.type==="year"?d.html`<button
|
|
148
|
-
type="button"
|
|
149
|
-
class="gui-calendar__year-selector"
|
|
150
|
-
@click=${t.onToggleYearSelector}
|
|
151
|
-
aria-expanded=${t.yearSelectorOpen}
|
|
152
|
-
aria-label=${`${t.selectYearAriaLabel??"Select year"}, ${a.value}`}
|
|
153
|
-
>
|
|
154
|
-
<span class="gui-calendar__year-value">${a.value}</span>
|
|
155
|
-
<span class="gui-calendar__year-arrow" aria-hidden="true">
|
|
156
|
-
<svg
|
|
157
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
158
|
-
width="16"
|
|
159
|
-
height="16"
|
|
160
|
-
viewBox="0 0 256 256"
|
|
161
|
-
>
|
|
162
|
-
<path
|
|
163
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
164
|
-
></path>
|
|
165
|
-
</svg>
|
|
166
|
-
</span>
|
|
167
|
-
</button>`:d.html`<span class="gui-calendar__month-name">${a.value}</span>`)}
|
|
168
|
-
</h2>
|
|
169
|
-
</header>
|
|
170
|
-
`}function gm(e,t,i,a){return d.html`
|
|
171
|
-
<div class="gui-calendar__days-grid" role="grid" aria-label=${a??d.nothing}>
|
|
172
|
-
<div role="row" class="gui-calendar__rows">
|
|
173
|
-
${qe.repeat(t,(r,s)=>s,r=>d.html`<span class="gui-calendar__weekday" role="columnheader">${r}</span>`)}
|
|
174
|
-
</div>
|
|
175
|
-
|
|
176
|
-
${qe.repeat(e,r=>d.html`
|
|
177
|
-
<div role="row" class="gui-calendar__rows">
|
|
178
|
-
${qe.repeat(r,s=>s.date.toISOString(),s=>i(s))}
|
|
179
|
-
</div>
|
|
180
|
-
`)}
|
|
181
|
-
</div>
|
|
182
|
-
`}function bm(e){const t=e.currentYear;return d.html`
|
|
183
|
-
<div
|
|
184
|
-
class="gui-calendar__year-grid"
|
|
185
|
-
role="grid"
|
|
186
|
-
aria-label=${e.ariaLabel??"Year selection"}
|
|
187
|
-
@keydown=${e.onKeydown}
|
|
188
|
-
>
|
|
189
|
-
${fr(e.years,4).map(i=>d.html`
|
|
190
|
-
<div role="row" class="gui-calendar__year-row">
|
|
191
|
-
${i.map(a=>d.html`
|
|
192
|
-
<button
|
|
193
|
-
type="button"
|
|
194
|
-
role="gridcell"
|
|
195
|
-
class="gui-calendar__year-button ${a===t?"current":""}"
|
|
196
|
-
tabindex=${a===t?0:-1}
|
|
197
|
-
data-year=${a}
|
|
198
|
-
@click=${r=>{r.stopPropagation(),e.onSelectYear(a)}}
|
|
199
|
-
aria-selected=${a===t}
|
|
200
|
-
>
|
|
201
|
-
${a}
|
|
202
|
-
</button>
|
|
203
|
-
`)}
|
|
204
|
-
</div>
|
|
205
|
-
`)}
|
|
206
|
-
</div>
|
|
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`
|
|
208
|
-
<button
|
|
209
|
-
type="button"
|
|
210
|
-
role="gridcell"
|
|
211
|
-
class=${S.classMap(t)}
|
|
212
|
-
tabindex=${e.isFocusable?0:-1}
|
|
213
|
-
?disabled=${!e.isCurrentMonth}
|
|
214
|
-
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
215
|
-
aria-label=${Ki(this.localeId,e.date)}
|
|
216
|
-
aria-current=${e.isToday?"date":d.nothing}
|
|
217
|
-
data-date=${ie(e.date)}
|
|
218
|
-
@click=${()=>this.selectDate(e)}
|
|
219
|
-
@keydown=${i=>this._keyboard.handleDayKeydown(i)}
|
|
220
|
-
aria-selected=${e.isSelected}
|
|
221
|
-
>
|
|
222
|
-
${e.dayLabel}
|
|
223
|
-
</button>
|
|
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`
|
|
15
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}ta([c.consume({context:d.formContext}),m.property({attribute:!1})],me.prototype,"formContext"),ta([c.provide({context:d.actionContext})],me.prototype,"adapter"),f.safeDefine("gui-button-interactive",me);const pn=Object.freeze(Object.defineProperty({__proto__:null,ButtonElement:me},Symbol.toStringTag,{value:"Module"}));var cn=Object.defineProperty,aa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&cn(e,a,r),r};class ge extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
225
16
|
<gui-calendar
|
|
226
17
|
.uid=${this.widget.uid}
|
|
227
18
|
.label=${this.adapter.templateData.label}
|
|
@@ -249,242 +40,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
249
40
|
@change=${this.valueChanged}
|
|
250
41
|
@blur=${()=>this.adapter.onBlur()}
|
|
251
42
|
></gui-calendar>
|
|
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`
|
|
253
|
-
${qe.repeat(a.slice(0,u),s,o)}
|
|
254
|
-
<div class="gui-parts__time-cluster ${t.blockClass}__time-cluster" dir="ltr">
|
|
255
|
-
${qe.repeat(a.slice(u,p+1),s,(h,c)=>o(h,u+c))}
|
|
256
|
-
</div>
|
|
257
|
-
${qe.repeat(a.slice(p+1),s,(h,c)=>o(h,p+1+c))}
|
|
258
|
-
`}function Rm(e,t,i,a,r){const s=a.blockClass,o=t.type;if(t.kind==="dayPeriod")return Fm(e,t,i,a,r);const l=o==="year"?`gui-parts__year ${s}__year`:"",u=a.getDisplayValue(e,o),p=parseInt(u,10);return d.html`
|
|
259
|
-
<div class="gui-parts__touch-target ${s}__touch-target">
|
|
260
|
-
<input
|
|
261
|
-
type="text"
|
|
262
|
-
inputmode="numeric"
|
|
263
|
-
role="spinbutton"
|
|
264
|
-
class="gui-parts__part ${s}__part ${l}"
|
|
265
|
-
data-type=${o}
|
|
266
|
-
data-group=${a.groups.length>1?e:d.nothing}
|
|
267
|
-
maxlength=${t.maxLength}
|
|
268
|
-
placeholder=${t.placeholder}
|
|
269
|
-
tabindex=${i}
|
|
270
|
-
aria-label=${a.getPartAriaLabel?.(e,o)??St[o]}
|
|
271
|
-
aria-valuemin=${t.min}
|
|
272
|
-
aria-valuemax=${t.max}
|
|
273
|
-
aria-valuenow=${isNaN(p)?d.nothing:p}
|
|
274
|
-
?disabled=${a.disabled}
|
|
275
|
-
?readonly=${a.partsReadonly}
|
|
276
|
-
autocomplete="off"
|
|
277
|
-
.value=${no.live(a.getDisplayValue(e,o))}
|
|
278
|
-
@keydown=${h=>r.handleKeyDown(h,e,o)}
|
|
279
|
-
@keyup=${h=>r.handleKeyUp(h,e,o)}
|
|
280
|
-
@focus=${r.handleFocus}
|
|
281
|
-
@blur=${h=>r.handleBlur(h,e,o)}
|
|
282
|
-
@change=${h=>r.handleChange(h,e,o)}
|
|
283
|
-
/>
|
|
284
|
-
<div class="gui-parts__visual-underline ${s}__visual-underline"></div>
|
|
285
|
-
</div>
|
|
286
|
-
`}function Fm(e,t,i,a,r){const s=a.blockClass,o=t.type;return d.html`
|
|
287
|
-
<div class="gui-parts__touch-target ${s}__touch-target">
|
|
288
|
-
<button
|
|
289
|
-
type="button"
|
|
290
|
-
class="gui-parts__part gui-parts__dayperiod ${s}__part ${s}__dayperiod"
|
|
291
|
-
data-type=${o}
|
|
292
|
-
data-group=${a.groups.length>1?e:d.nothing}
|
|
293
|
-
tabindex=${i}
|
|
294
|
-
?disabled=${a.disabled}
|
|
295
|
-
aria-label=${a.dayPeriodAriaLabel??"AM/PM"}
|
|
296
|
-
@click=${()=>r.toggleDayPeriod(e,o)}
|
|
297
|
-
@keydown=${r.handleDayPeriodKeyDown}
|
|
298
|
-
@keyup=${l=>r.handleKeyUp(l,e,o)}
|
|
299
|
-
@focus=${r.handleFocus}
|
|
300
|
-
@blur=${l=>r.handleBlur(l,e,o)}
|
|
301
|
-
>
|
|
302
|
-
${a.getDisplayValue(e,o)}
|
|
303
|
-
</button>
|
|
304
|
-
<div class="gui-parts__visual-underline ${s}__visual-underline"></div>
|
|
305
|
-
</div>
|
|
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}
|
|
308
|
-
|
|
309
|
-
<div class="gui-widget">
|
|
310
|
-
<div
|
|
311
|
-
id=${this.uid}
|
|
312
|
-
class="gui-widget-input gui-parts gui-parts-ring gui-time-input ${this.icon?"gui-calendar--icon":""}"
|
|
313
|
-
role="group"
|
|
314
|
-
aria-labelledby=${`${this.uid}_label`}
|
|
315
|
-
>
|
|
316
|
-
${gt("default",t,this._parts)}
|
|
317
|
-
</div>
|
|
318
|
-
${this.icon?d.html`<span
|
|
319
|
-
class=${S.classMap(i)}
|
|
320
|
-
data-icon=${this.icon}
|
|
321
|
-
aria-hidden="true"
|
|
322
|
-
></span>`:d.nothing}
|
|
323
|
-
</div>
|
|
324
|
-
|
|
325
|
-
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
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`
|
|
327
|
-
<button
|
|
328
|
-
type="button"
|
|
329
|
-
role=${i}
|
|
330
|
-
class=${S.classMap(r)}
|
|
331
|
-
tabindex=${t===this.rovingIndex?0:-1}
|
|
332
|
-
?disabled=${e.disabled||this.disabled}
|
|
333
|
-
data-value=${e.value}
|
|
334
|
-
aria-selected=${a}
|
|
335
|
-
aria-disabled=${e.disabled||this.disabled?"true":"false"}
|
|
336
|
-
@click=${s=>this.selectOption(e,s)}
|
|
337
|
-
>
|
|
338
|
-
${e.template}
|
|
339
|
-
</button>
|
|
340
|
-
`}render(){const e=this.timeOptions;if(e.length===0)return d.html`<div class="gui-time-list__empty">
|
|
341
|
-
${this.noAvailableTimesMessage??Tm}
|
|
342
|
-
</div>`;const t=this.effectiveColumns,i=`--gui-time-list-height: ${this.height??300}px; --gui-time-list-item-height: ${this.itemHeight||40}px; --gui-time-list-columns: ${t};`;if(t===1)return d.html`
|
|
343
|
-
<div
|
|
344
|
-
class="gui-time-list__viewport"
|
|
345
|
-
role="listbox"
|
|
346
|
-
style=${i}
|
|
347
|
-
aria-label=${this.label??d.nothing}
|
|
348
|
-
@keydown=${this.onKeyDown}
|
|
349
|
-
>
|
|
350
|
-
${e.map((r,s)=>this.renderOption(r,s,"option"))}
|
|
351
|
-
</div>
|
|
352
|
-
`;const a=fr(e,t);return d.html`
|
|
353
|
-
<div
|
|
354
|
-
class="gui-time-list__viewport gui-time-list__viewport--grid"
|
|
355
|
-
role="grid"
|
|
356
|
-
style=${i}
|
|
357
|
-
aria-label=${this.label??d.nothing}
|
|
358
|
-
@keydown=${this.onKeyDown}
|
|
359
|
-
>
|
|
360
|
-
${a.map((r,s)=>d.html`
|
|
361
|
-
<div role="row" class="gui-time-list__row">
|
|
362
|
-
${r.map((o,l)=>this.renderOption(o,s*t+l,"gridcell"))}
|
|
363
|
-
</div>
|
|
364
|
-
`)}
|
|
365
|
-
</div>
|
|
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)}
|
|
368
|
-
|
|
369
|
-
<div class="gui-widget" @keydown=${this.onKeyDown} @click=${this._popup.onAnchorClick}>
|
|
370
|
-
<gui-time
|
|
371
|
-
id="time-input"
|
|
372
|
-
class=${S.classMap(e.widgetClasses)}
|
|
373
|
-
.uid=${this.uid}
|
|
374
|
-
.hint=${this.hint}
|
|
375
|
-
.showErrors=${!1}
|
|
376
|
-
.errors=${this.errors}
|
|
377
|
-
?touched=${this.touched}
|
|
378
|
-
?required=${this.required}
|
|
379
|
-
?disabled=${this.disabled}
|
|
380
|
-
?readonly=${this.readOnly||!this.allowCustomTime}
|
|
381
|
-
.value=${this.value}
|
|
382
|
-
.icon=${this.icon}
|
|
383
|
-
.localeId=${this.localeId}
|
|
384
|
-
.hourFormat=${this.hourFormat}
|
|
385
|
-
.minuteStep=${this.minuteStep}
|
|
386
|
-
.minTime=${this.minTime}
|
|
387
|
-
.maxTime=${this.maxTime}
|
|
388
|
-
.hourAriaLabel=${this.hourAriaLabel}
|
|
389
|
-
.minuteAriaLabel=${this.minuteAriaLabel}
|
|
390
|
-
.dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
|
|
391
|
-
.minTimeMessage=${this.minTimeMessage}
|
|
392
|
-
.maxTimeMessage=${this.maxTimeMessage}
|
|
393
|
-
@blur=${this.onTimeBlur}
|
|
394
|
-
@focus=${this._popup.show}
|
|
395
|
-
@change=${this.onTimeChange}
|
|
396
|
-
></gui-time>
|
|
397
|
-
<button
|
|
398
|
-
type="button"
|
|
399
|
-
class="gui-time-picker__arrow"
|
|
400
|
-
aria-label=${this.toggleAriaLabel??"Show time list"}
|
|
401
|
-
aria-haspopup="dialog"
|
|
402
|
-
aria-expanded=${this._popup.open?"true":"false"}
|
|
403
|
-
aria-controls=${`${this.uid}_popup`}
|
|
404
|
-
?disabled=${this.disabled}
|
|
405
|
-
@click=${this.onToggleClick}
|
|
406
|
-
>
|
|
407
|
-
<svg
|
|
408
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
409
|
-
width="16"
|
|
410
|
-
height="16"
|
|
411
|
-
viewBox="0 0 256 256"
|
|
412
|
-
aria-hidden="true"
|
|
413
|
-
>
|
|
414
|
-
<path
|
|
415
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
416
|
-
></path>
|
|
417
|
-
</svg>
|
|
418
|
-
</button>
|
|
419
|
-
|
|
420
|
-
<gui-time-list
|
|
421
|
-
id=${`${this.uid}_popup`}
|
|
422
|
-
role="dialog"
|
|
423
|
-
aria-label=${this.label??"Time list"}
|
|
424
|
-
.uid=${this.uid}
|
|
425
|
-
.value=${this.value}
|
|
426
|
-
.label=${this.label}
|
|
427
|
-
.localeId=${this.localeId}
|
|
428
|
-
.hourFormat=${this.hourFormat}
|
|
429
|
-
.minuteStep=${this.minuteStep}
|
|
430
|
-
.minTime=${this.minTime}
|
|
431
|
-
.maxTime=${this.maxTime}
|
|
432
|
-
.disabledRanges=${this.disabledRanges}
|
|
433
|
-
.height=${this.height}
|
|
434
|
-
.itemHeight=${this.itemHeight}
|
|
435
|
-
.columns=${this.columns}
|
|
436
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
437
|
-
?readonly=${this.readOnly}
|
|
438
|
-
?hidden=${!this._popup.open}
|
|
439
|
-
@change=${this.onListChange}
|
|
440
|
-
></gui-time-list>
|
|
441
|
-
</div>
|
|
442
|
-
|
|
443
|
-
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
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`
|
|
445
|
-
<div class="gui-calendar__time-input-row">
|
|
446
|
-
<gui-time-picker
|
|
447
|
-
class="gui-time-picker gui-field"
|
|
448
|
-
.uid=${this.uid?`${this.uid}-time`:void 0}
|
|
449
|
-
.showErrors=${!1}
|
|
450
|
-
?required=${this.required}
|
|
451
|
-
?disabled=${this.disabled||!this._selectedDate}
|
|
452
|
-
?readonly=${this.readOnly}
|
|
453
|
-
.allowCustomTime=${this.allowCustomTime}
|
|
454
|
-
.value=${this._selectedTime}
|
|
455
|
-
.localeId=${this.localeId}
|
|
456
|
-
.hourFormat=${this.hourFormat}
|
|
457
|
-
.minuteStep=${this.minuteStep}
|
|
458
|
-
.minTime=${this.minTime}
|
|
459
|
-
.maxTime=${this.maxTime}
|
|
460
|
-
.disabledRanges=${this.resolvedTimeRanges}
|
|
461
|
-
.columns=${4}
|
|
462
|
-
.minTimeMessage=${this.minTimeMessage}
|
|
463
|
-
.maxTimeMessage=${this.maxTimeMessage}
|
|
464
|
-
.disabledRangeMessage=${this.disabledTimeRangeMessage}
|
|
465
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
466
|
-
@change=${this.onTimePickerChange}
|
|
467
|
-
@listtoggle=${this.onListToggle}
|
|
468
|
-
></gui-time-picker>
|
|
469
|
-
</div>
|
|
470
|
-
`}renderPanelBody(e){return this._timeGridOpen&&!this._nav.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)})}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`
|
|
471
|
-
<button
|
|
472
|
-
type="button"
|
|
473
|
-
role="gridcell"
|
|
474
|
-
class=${S.classMap(t)}
|
|
475
|
-
tabindex=${e.isFocusable?0:-1}
|
|
476
|
-
?disabled=${!e.isCurrentMonth}
|
|
477
|
-
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
478
|
-
aria-label=${Ki(this.localeId,e.date)}
|
|
479
|
-
aria-current=${e.isToday?"date":d.nothing}
|
|
480
|
-
data-date=${ie(e.date)}
|
|
481
|
-
@click=${()=>this.selectDate(e)}
|
|
482
|
-
@keydown=${i=>this._keyboard.handleDayKeydown(i)}
|
|
483
|
-
aria-selected=${e.isSelected}
|
|
484
|
-
>
|
|
485
|
-
${e.dayLabel}
|
|
486
|
-
</button>
|
|
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`
|
|
43
|
+
`}valueChanged(e){const a=e?.target;this.adapter.valueChanged(a.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}aa([c.consume({context:d.formContext}),m.property({attribute:!1})],ge.prototype,"formContext"),aa([c.provide({context:d.inputContext})],ge.prototype,"adapter"),f.safeDefine("gui-calendar-input",ge);const hn=Object.freeze(Object.defineProperty({__proto__:null,CalendarElement:ge},Symbol.toStringTag,{value:"Module"}));var mn=Object.defineProperty,ra=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&mn(e,a,r),r};class fe extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
488
44
|
<gui-date-time-calendar
|
|
489
45
|
.uid=${this.widget.uid}
|
|
490
46
|
.label=${e.label}
|
|
@@ -519,130 +75,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
519
75
|
.maxTimeMessage=${e.maxTimeMessage}
|
|
520
76
|
.disabledTimeRangeMessage=${e.disabledTimeRangeMessage}
|
|
521
77
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
78
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
522
79
|
@change=${this.valueChanged}
|
|
523
80
|
@inputError=${this.onInputError}
|
|
524
81
|
@blur=${()=>this.adapter.onBlur()}
|
|
525
82
|
></gui-date-time-calendar>
|
|
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())}}
|
|
527
|
-
${this.renderStrip()} ${this.bubble?this.renderCompact(e):d.nothing}
|
|
528
|
-
${this.bubble&&this._showDropdown?this.renderDropdown():d.nothing}
|
|
529
|
-
`}renderStrip(){return d.html`
|
|
530
|
-
<div
|
|
531
|
-
class=${S.classMap({"gui-pills__strip-wrapper":!0,"gui-pills--start-shadow":!this._isStartVisible,"gui-pills--end-shadow":!this._isEndVisible})}
|
|
532
|
-
>
|
|
533
|
-
<div
|
|
534
|
-
class="gui-pills__strip"
|
|
535
|
-
role="toolbar"
|
|
536
|
-
aria-label=${this.toolbarAriaLabel}
|
|
537
|
-
tabindex="-1"
|
|
538
|
-
>
|
|
539
|
-
<span class="gui-sentinel gui-sentinel__start"></span>
|
|
540
|
-
${us.repeat(this.items,e=>e.key,(e,t)=>this.renderPill(e,t,!1))}
|
|
541
|
-
<span class="gui-sentinel gui-sentinel__end"></span>
|
|
542
|
-
</div>
|
|
543
|
-
</div>
|
|
544
|
-
`}get dropdownId(){return this.uid?`${this.uid}_pills_dropdown`:void 0}renderCompact(e){return d.html`
|
|
545
|
-
<div class="gui-pills__compact">
|
|
546
|
-
<button
|
|
547
|
-
type="button"
|
|
548
|
-
class="gui-pills__count"
|
|
549
|
-
aria-label=${this.compactAriaLabel??`${e} items`}
|
|
550
|
-
aria-haspopup="true"
|
|
551
|
-
aria-expanded=${this._showDropdown}
|
|
552
|
-
aria-controls=${this.dropdownId??d.nothing}
|
|
553
|
-
?disabled=${this.disabled||this.readOnly}
|
|
554
|
-
@click=${t=>{t.stopPropagation(),this.toggleDropdown()}}
|
|
555
|
-
>
|
|
556
|
-
${e}
|
|
557
|
-
</button>
|
|
558
|
-
</div>
|
|
559
|
-
`}renderDropdown(){return d.html`
|
|
560
|
-
<div
|
|
561
|
-
id=${this.dropdownId??d.nothing}
|
|
562
|
-
class="gui-pills__dropdown"
|
|
563
|
-
role="toolbar"
|
|
564
|
-
aria-orientation="vertical"
|
|
565
|
-
aria-label=${this.toolbarAriaLabel}
|
|
566
|
-
>
|
|
567
|
-
${us.repeat(this.items,e=>`dd-${e.key}`,(e,t)=>this.renderPill(e,t,!0))}
|
|
568
|
-
</div>
|
|
569
|
-
`}renderPill(e,t,i){const a=this.clickable&&!this.disabled&&!this.readOnly;return d.html`
|
|
570
|
-
<button
|
|
571
|
-
type="button"
|
|
572
|
-
class=${S.classMap({"gui-pills__pill":!0,"gui-pills__pill--clickable":a})}
|
|
573
|
-
data-key=${e.key}
|
|
574
|
-
data-index=${t}
|
|
575
|
-
data-in-dropdown=${i}
|
|
576
|
-
tabindex=${this.tabbable&&!this.disabled&&!this.readOnly?0:-1}
|
|
577
|
-
?disabled=${this.disabled||this.readOnly}
|
|
578
|
-
aria-label=${e.ariaLabel??e.label}
|
|
579
|
-
aria-description=${this.removable&&!this.disabled&&!this.readOnly?this.removeAriaLabel:d.nothing}
|
|
580
|
-
@click=${r=>this.onPillClick(r,e)}
|
|
581
|
-
@focus=${this.handlePillFocus}
|
|
582
|
-
@keydown=${r=>this.onPillKeydown(r,e,t)}
|
|
583
|
-
>
|
|
584
|
-
<span class="gui-pills__pill-text">${e.label}</span>
|
|
585
|
-
${this.removable?this.renderRemoveButton(e):d.nothing}
|
|
586
|
-
</button>
|
|
587
|
-
`}renderRemoveButton(e){return d.html`
|
|
588
|
-
<span
|
|
589
|
-
class="gui-pills__pill-remove"
|
|
590
|
-
aria-hidden="true"
|
|
591
|
-
@mousedown=${t=>{t.stopPropagation(),t.preventDefault()}}
|
|
592
|
-
@click=${t=>{t.stopPropagation(),this.emitRemove(e.key,this.items.indexOf(e))}}
|
|
593
|
-
>
|
|
594
|
-
${this.removeIcon?d.html`<span
|
|
595
|
-
class=${`gui-widget-icon ${this.removeIcon}`}
|
|
596
|
-
data-icon=${this.removeIcon}
|
|
597
|
-
aria-hidden="true"
|
|
598
|
-
></span>`:d.html`<svg
|
|
599
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
600
|
-
width="16"
|
|
601
|
-
height="16"
|
|
602
|
-
viewBox="0 0 256 256"
|
|
603
|
-
fill="currentColor"
|
|
604
|
-
aria-hidden="true"
|
|
605
|
-
>
|
|
606
|
-
<path
|
|
607
|
-
d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"
|
|
608
|
-
></path>
|
|
609
|
-
</svg>`}
|
|
610
|
-
</span>
|
|
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`
|
|
612
|
-
<button
|
|
613
|
-
type="button"
|
|
614
|
-
role="gridcell"
|
|
615
|
-
class=${S.classMap(i)}
|
|
616
|
-
tabindex=${e.isFocusable?0:-1}
|
|
617
|
-
?disabled=${!e.isCurrentMonth}
|
|
618
|
-
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
619
|
-
aria-label=${Ki(this.localeId,e.date)}
|
|
620
|
-
aria-current=${e.isToday?"date":d.nothing}
|
|
621
|
-
data-date=${ie(e.date)}
|
|
622
|
-
@click=${a=>this.selectDate(e,a)}
|
|
623
|
-
@mouseover=${()=>this.onMouseOver(e)}
|
|
624
|
-
@focus=${()=>this.onMouseOver(e)}
|
|
625
|
-
@keydown=${a=>this._keyboard.handleDayKeydown(a)}
|
|
626
|
-
aria-selected=${e.isRangeStart||e.isRangeEnd||e.isInRange?"true":"false"}
|
|
627
|
-
>
|
|
628
|
-
${this.renderDayContent(e)}
|
|
629
|
-
</button>
|
|
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`
|
|
631
|
-
<gui-pills
|
|
632
|
-
class="gui-range-calendar__pills"
|
|
633
|
-
.uid=${this.uid}
|
|
634
|
-
.toolbarAriaLabel=${"Selected date ranges"}
|
|
635
|
-
.items=${t}
|
|
636
|
-
.removable=${!0}
|
|
637
|
-
.clickable=${!0}
|
|
638
|
-
.bubble=${!1}
|
|
639
|
-
?disabled=${this.disabled}
|
|
640
|
-
?readonly=${this.readOnly}
|
|
641
|
-
.removeAriaLabel=${this.removePillAriaLabel??"Remove date"}
|
|
642
|
-
@pillremove=${this.onPillRemoveEvent}
|
|
643
|
-
@pillclick=${this.onPillClickEvent}
|
|
644
|
-
></gui-pills>
|
|
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`
|
|
83
|
+
`}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())}}ra([c.consume({context:d.formContext}),m.property({attribute:!1})],fe.prototype,"formContext"),ra([c.provide({context:d.inputContext})],fe.prototype,"adapter"),f.safeDefine("gui-date-time-calendar-input",fe);const gn=Object.freeze(Object.defineProperty({__proto__:null,DateTimeCalendarElement:fe},Symbol.toStringTag,{value:"Module"}));var fn=Object.defineProperty,ia=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&fn(e,a,r),r};class be extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
646
84
|
<gui-range-calendar
|
|
647
85
|
.uid=${this.widget.uid}
|
|
648
86
|
.label=${this.adapter.templateData.label}
|
|
@@ -674,62 +112,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
674
112
|
@inputError=${this.onInputError}
|
|
675
113
|
@blur=${()=>this.adapter.onBlur()}
|
|
676
114
|
></gui-range-calendar>
|
|
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())}}
|
|
678
|
-
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
679
|
-
|
|
680
|
-
<div class="gui-widget">
|
|
681
|
-
<div
|
|
682
|
-
class="gui-widget-input gui-parts-ring gui-range-date-input ${this.icon?"gui-range-date-input--icon":""}"
|
|
683
|
-
role="group"
|
|
684
|
-
aria-label=${this.label??"Date range input"}
|
|
685
|
-
>
|
|
686
|
-
${this.icon?d.html`<span
|
|
687
|
-
class=${S.classMap(a)}
|
|
688
|
-
data-icon=${this.icon}
|
|
689
|
-
aria-hidden="true"
|
|
690
|
-
></span>`:d.nothing}
|
|
691
|
-
|
|
692
|
-
<gui-pills
|
|
693
|
-
class="gui-range-date-input__pills"
|
|
694
|
-
style=${Dt.styleMap(i.length?{}:{"min-width":0})}
|
|
695
|
-
.uid=${this.uid}
|
|
696
|
-
.toolbarAriaLabel=${"Selected date ranges"}
|
|
697
|
-
.items=${i}
|
|
698
|
-
.removable=${!0}
|
|
699
|
-
.clickable=${!0}
|
|
700
|
-
.bubble=${!0}
|
|
701
|
-
?disabled=${this.disabled}
|
|
702
|
-
?readonly=${this.readOnly}
|
|
703
|
-
.removeAriaLabel=${this.removePillAriaLabel??"Remove date"}
|
|
704
|
-
.compactAriaLabel=${`${i.length} date ranges`}
|
|
705
|
-
@pillremove=${this.onPillRemoveEvent}
|
|
706
|
-
@pillclick=${this.onPillClickEvent}
|
|
707
|
-
></gui-pills>
|
|
708
|
-
|
|
709
|
-
<div class="gui-range-date-input__inputs">
|
|
710
|
-
<div
|
|
711
|
-
class="gui-parts gui-range-date-input__field"
|
|
712
|
-
role="group"
|
|
713
|
-
aria-label=${this.startDateAriaLabel??"Start date"}
|
|
714
|
-
>
|
|
715
|
-
${gt("start",t,this._parts)}
|
|
716
|
-
</div>
|
|
717
|
-
|
|
718
|
-
<span class="gui-range-date-input__separator">${this.separator??"-"}</span>
|
|
719
|
-
|
|
720
|
-
<div
|
|
721
|
-
class="gui-parts gui-range-date-input__field"
|
|
722
|
-
role="group"
|
|
723
|
-
aria-label=${this.endDateAriaLabel??"End date"}
|
|
724
|
-
>
|
|
725
|
-
${gt("end",t,this._parts)}
|
|
726
|
-
</div>
|
|
727
|
-
</div>
|
|
728
|
-
</div>
|
|
729
|
-
|
|
730
|
-
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
731
|
-
</div>
|
|
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`
|
|
115
|
+
`}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())}}ia([c.consume({context:d.formContext}),m.property({attribute:!1})],be.prototype,"formContext"),ia([c.provide({context:d.inputContext})],be.prototype,"adapter"),f.safeDefine("gui-range-calendar-input",be);const bn=Object.freeze(Object.defineProperty({__proto__:null,RangeCalendarElement:be},Symbol.toStringTag,{value:"Module"}));var $n=Object.defineProperty,sa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&$n(e,a,r),r};class $e extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
733
116
|
<gui-range-date
|
|
734
117
|
.uid=${this.widget.uid}
|
|
735
118
|
.label=${this.adapter.templateData.label}
|
|
@@ -746,6 +129,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
746
129
|
.monthAriaLabel=${this.adapter.templateData.monthAriaLabel}
|
|
747
130
|
.yearAriaLabel=${this.adapter.templateData.yearAriaLabel}
|
|
748
131
|
.invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
|
|
132
|
+
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
749
133
|
.separator=${this.adapter.templateData.separator}
|
|
750
134
|
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
751
135
|
.startDateAriaLabel=${this.adapter.templateData.startDateAriaLabel}
|
|
@@ -753,62 +137,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
753
137
|
@change=${this.valueChanged}
|
|
754
138
|
@inputError=${this.onInputError}
|
|
755
139
|
></gui-range-date>
|
|
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())}}
|
|
757
|
-
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
758
|
-
|
|
759
|
-
<div class="gui-widget">
|
|
760
|
-
<div
|
|
761
|
-
class="gui-widget-input gui-parts-ring gui-range-time-input ${this.icon?"gui-range-time-input--icon":""}"
|
|
762
|
-
role="group"
|
|
763
|
-
aria-label=${this.label??"Time range input"}
|
|
764
|
-
>
|
|
765
|
-
${this.icon?d.html`<span
|
|
766
|
-
class=${S.classMap(a)}
|
|
767
|
-
data-icon=${this.icon}
|
|
768
|
-
aria-hidden="true"
|
|
769
|
-
></span>`:d.nothing}
|
|
770
|
-
|
|
771
|
-
<gui-pills
|
|
772
|
-
class="gui-range-time-input__pills"
|
|
773
|
-
style=${Dt.styleMap(i.length?{}:{"min-width":0})}
|
|
774
|
-
.uid=${this.uid}
|
|
775
|
-
.toolbarAriaLabel=${"Selected time ranges"}
|
|
776
|
-
.items=${i}
|
|
777
|
-
.removable=${!0}
|
|
778
|
-
.clickable=${!0}
|
|
779
|
-
.bubble=${!0}
|
|
780
|
-
?disabled=${this.disabled}
|
|
781
|
-
?readonly=${this.readOnly}
|
|
782
|
-
.removeAriaLabel=${this.removePillAriaLabel??"Remove time"}
|
|
783
|
-
.compactAriaLabel=${`${i.length} time ranges`}
|
|
784
|
-
@pillremove=${this.onPillRemoveEvent}
|
|
785
|
-
@pillclick=${this.onPillClickEvent}
|
|
786
|
-
></gui-pills>
|
|
787
|
-
|
|
788
|
-
<div class="gui-range-time-input__inputs">
|
|
789
|
-
<div
|
|
790
|
-
class="gui-parts gui-range-time-input__field"
|
|
791
|
-
role="group"
|
|
792
|
-
aria-label=${this.startTimeAriaLabel??"Start time"}
|
|
793
|
-
>
|
|
794
|
-
${gt("start",t,this._parts)}
|
|
795
|
-
</div>
|
|
796
|
-
|
|
797
|
-
<span class="gui-range-time-input__separator">${this.separator??"-"}</span>
|
|
798
|
-
|
|
799
|
-
<div
|
|
800
|
-
class="gui-parts gui-range-time-input__field"
|
|
801
|
-
role="group"
|
|
802
|
-
aria-label=${this.endTimeAriaLabel??"End time"}
|
|
803
|
-
>
|
|
804
|
-
${gt("end",t,this._parts)}
|
|
805
|
-
</div>
|
|
806
|
-
</div>
|
|
807
|
-
</div>
|
|
808
|
-
|
|
809
|
-
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
810
|
-
</div>
|
|
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`
|
|
140
|
+
`}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())}}sa([c.consume({context:d.formContext}),m.property({attribute:!1})],$e.prototype,"formContext"),sa([c.provide({context:d.inputContext})],$e.prototype,"adapter"),f.safeDefine("gui-range-date-input",$e);const vn=Object.freeze(Object.defineProperty({__proto__:null,RangeDateInputElement:$e},Symbol.toStringTag,{value:"Module"}));var _n=Object.defineProperty,na=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&_n(e,a,r),r};class ve extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
812
141
|
<gui-range-time
|
|
813
142
|
.uid=${this.widget.uid}
|
|
814
143
|
.label=${this.adapter.templateData.label}
|
|
@@ -835,65 +164,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
835
164
|
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
836
165
|
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
837
166
|
.rangeOrderMessage=${this.adapter.templateData.rangeOrderMessage}
|
|
167
|
+
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
838
168
|
@change=${this.valueChanged}
|
|
839
169
|
@inputError=${this.onInputError}
|
|
840
170
|
></gui-range-time>
|
|
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())}}
|
|
842
|
-
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
843
|
-
|
|
844
|
-
<div class="gui-widget">
|
|
845
|
-
<div
|
|
846
|
-
class="gui-widget-input gui-parts-ring gui-range-date-time-input ${this.icon?"gui-range-date-time-input--icon":""}"
|
|
847
|
-
role="group"
|
|
848
|
-
aria-label=${this.label??"Date-time range input"}
|
|
849
|
-
>
|
|
850
|
-
${this.icon?d.html`<span
|
|
851
|
-
class=${S.classMap(a)}
|
|
852
|
-
data-icon=${this.icon}
|
|
853
|
-
aria-hidden="true"
|
|
854
|
-
></span>`:d.nothing}
|
|
855
|
-
|
|
856
|
-
<gui-pills
|
|
857
|
-
class="gui-range-date-time-input__pills"
|
|
858
|
-
style=${Dt.styleMap(i.length?{}:{"min-width":0})}
|
|
859
|
-
.uid=${this.uid}
|
|
860
|
-
.toolbarAriaLabel=${"Selected date-time ranges"}
|
|
861
|
-
.items=${i}
|
|
862
|
-
.removable=${!0}
|
|
863
|
-
.clickable=${!0}
|
|
864
|
-
.bubble=${!0}
|
|
865
|
-
?disabled=${this.disabled}
|
|
866
|
-
?readonly=${this.readOnly}
|
|
867
|
-
.removeAriaLabel=${this.removePillAriaLabel??"Remove date-time"}
|
|
868
|
-
.compactAriaLabel=${`${i.length} date-time ranges`}
|
|
869
|
-
@pillremove=${this.onPillRemoveEvent}
|
|
870
|
-
@pillclick=${this.onPillClickEvent}
|
|
871
|
-
></gui-pills>
|
|
872
|
-
|
|
873
|
-
<div class="gui-range-date-time-input__inputs">
|
|
874
|
-
<div
|
|
875
|
-
class="gui-parts gui-range-date-time-input__field"
|
|
876
|
-
role="group"
|
|
877
|
-
aria-label=${this.startDateTimeAriaLabel??"Start date-time"}
|
|
878
|
-
>
|
|
879
|
-
${gt("start",t,this._parts)}
|
|
880
|
-
</div>
|
|
881
|
-
|
|
882
|
-
<span class="gui-range-date-time-input__separator">${this.separator??"-"}</span>
|
|
883
|
-
|
|
884
|
-
<div
|
|
885
|
-
class="gui-parts gui-range-date-time-input__field"
|
|
886
|
-
role="group"
|
|
887
|
-
aria-label=${this.endDateTimeAriaLabel??"End date-time"}
|
|
888
|
-
>
|
|
889
|
-
${gt("end",t,this._parts)}
|
|
890
|
-
</div>
|
|
891
|
-
</div>
|
|
892
|
-
</div>
|
|
893
|
-
|
|
894
|
-
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
895
|
-
</div>
|
|
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`
|
|
171
|
+
`}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())}}na([c.consume({context:d.formContext}),m.property({attribute:!1})],ve.prototype,"formContext"),na([c.provide({context:d.inputContext})],ve.prototype,"adapter"),f.safeDefine("gui-range-time-input",ve);const yn=Object.freeze(Object.defineProperty({__proto__:null,RangeTimeInputElement:ve},Symbol.toStringTag,{value:"Module"}));var Dn=Object.defineProperty,oa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Dn(e,a,r),r};class _e extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
897
172
|
<gui-range-date-time
|
|
898
173
|
.uid=${this.widget.uid}
|
|
899
174
|
.label=${this.adapter.templateData.label}
|
|
@@ -923,106 +198,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
923
198
|
.invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
|
|
924
199
|
.minDateTimeMessage=${this.adapter.templateData.minDateTimeMessage}
|
|
925
200
|
.maxDateTimeMessage=${this.adapter.templateData.maxDateTimeMessage}
|
|
201
|
+
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
926
202
|
@change=${this.valueChanged}
|
|
927
203
|
@inputError=${this.onInputError}
|
|
928
204
|
></gui-range-date-time>
|
|
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())}}
|
|
930
|
-
<div class=${S.classMap(s)}>
|
|
931
|
-
<div
|
|
932
|
-
class=${S.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="start"})}
|
|
933
|
-
>
|
|
934
|
-
<gui-time-picker
|
|
935
|
-
class="gui-time-picker gui-field gui-range-date-time-calendar__start"
|
|
936
|
-
.uid=${this.uid?`${this.uid}-start-time`:void 0}
|
|
937
|
-
.label=${this.startTimeLabel??"Start time"}
|
|
938
|
-
.showErrors=${!1}
|
|
939
|
-
?required=${this.required}
|
|
940
|
-
?disabled=${!t}
|
|
941
|
-
?readonly=${this.readOnly}
|
|
942
|
-
.allowCustomTime=${this.allowCustomTime}
|
|
943
|
-
.value=${this._workingTimeIn}
|
|
944
|
-
.localeId=${this.localeId}
|
|
945
|
-
.hourFormat=${this.hourFormat}
|
|
946
|
-
.minuteStep=${this.minuteStep}
|
|
947
|
-
.minTime=${a.minTime}
|
|
948
|
-
.maxTime=${a.maxTime}
|
|
949
|
-
.disabledRanges=${this.resolvedStartTimeRanges}
|
|
950
|
-
.columns=${4}
|
|
951
|
-
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
952
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
953
|
-
@change=${this.onStartTimeChange}
|
|
954
|
-
@listtoggle=${o=>this.onListToggle(o,"start")}
|
|
955
|
-
></gui-time-picker>
|
|
956
|
-
</div>
|
|
957
|
-
|
|
958
|
-
<div
|
|
959
|
-
class=${S.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="end"})}
|
|
960
|
-
>
|
|
961
|
-
<gui-time-picker
|
|
962
|
-
class="gui-time-picker gui-field gui-range-date-time-calendar__end"
|
|
963
|
-
.uid=${this.uid?`${this.uid}-end-time`:void 0}
|
|
964
|
-
.label=${this.endTimeLabel??"End time"}
|
|
965
|
-
.showErrors=${!1}
|
|
966
|
-
?required=${this.required}
|
|
967
|
-
?disabled=${!i}
|
|
968
|
-
?readonly=${this.readOnly}
|
|
969
|
-
.allowCustomTime=${this.allowCustomTime}
|
|
970
|
-
.value=${this._workingTimeOut}
|
|
971
|
-
.localeId=${this.localeId}
|
|
972
|
-
.hourFormat=${this.hourFormat}
|
|
973
|
-
.minuteStep=${this.minuteStep}
|
|
974
|
-
.minTime=${r.minTime}
|
|
975
|
-
.maxTime=${r.maxTime}
|
|
976
|
-
.disabledRanges=${this.resolvedEndTimeRanges}
|
|
977
|
-
.columns=${4}
|
|
978
|
-
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
979
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
980
|
-
@change=${this.onEndTimeChange}
|
|
981
|
-
@listtoggle=${o=>this.onListToggle(o,"end")}
|
|
982
|
-
></gui-time-picker>
|
|
983
|
-
</div>
|
|
984
|
-
</div>
|
|
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`
|
|
986
|
-
<button
|
|
987
|
-
type="button"
|
|
988
|
-
role="gridcell"
|
|
989
|
-
class=${S.classMap(i)}
|
|
990
|
-
tabindex=${e.isFocusable?0:-1}
|
|
991
|
-
?disabled=${!e.isCurrentMonth}
|
|
992
|
-
aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":d.nothing}
|
|
993
|
-
aria-label=${Ki(this.localeId,e.date)}
|
|
994
|
-
aria-current=${e.isToday?"date":d.nothing}
|
|
995
|
-
data-date=${ie(e.date)}
|
|
996
|
-
@click=${a=>this.selectDate(e,a)}
|
|
997
|
-
@mouseover=${()=>this.onMouseOver(e)}
|
|
998
|
-
@focus=${()=>this.onMouseOver(e)}
|
|
999
|
-
@keydown=${a=>this._keyboard.handleDayKeydown(a)}
|
|
1000
|
-
aria-selected=${e.isRangeStart||e.isRangeEnd||e.isInRange?"true":"false"}
|
|
1001
|
-
>
|
|
1002
|
-
${this.renderDayContent(e)}
|
|
1003
|
-
</button>
|
|
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"
|
|
1005
|
-
>${t}${i}</span
|
|
1006
|
-
>`}renderBadge(e,t,i,a){return d.html`<span class="gui-range-date-time-calendar__${e}" aria-label=${i}
|
|
1007
|
-
>${t}</span
|
|
1008
|
-
><span class="gui-range-date-time-calendar__badge-tooltip" aria-hidden="true"
|
|
1009
|
-
>${a.map(r=>d.html`<span>${r}</span>`)}</span
|
|
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`
|
|
1011
|
-
<gui-pills
|
|
1012
|
-
class="gui-range-calendar__pills"
|
|
1013
|
-
.uid=${this.uid}
|
|
1014
|
-
.toolbarAriaLabel=${"Selected date-time ranges"}
|
|
1015
|
-
.items=${t}
|
|
1016
|
-
.removable=${!0}
|
|
1017
|
-
.clickable=${!0}
|
|
1018
|
-
.bubble=${!1}
|
|
1019
|
-
?disabled=${this.disabled}
|
|
1020
|
-
?readonly=${this.readOnly}
|
|
1021
|
-
.removeAriaLabel=${this.removePillAriaLabel??"Remove date"}
|
|
1022
|
-
@pillremove=${this.onPillRemoveEvent}
|
|
1023
|
-
@pillclick=${this.onPillClickEvent}
|
|
1024
|
-
></gui-pills>
|
|
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`
|
|
205
|
+
`}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())}}oa([c.consume({context:d.formContext}),m.property({attribute:!1})],_e.prototype,"formContext"),oa([c.provide({context:d.inputContext})],_e.prototype,"adapter"),f.safeDefine("gui-range-date-time-input",_e);const wn=Object.freeze(Object.defineProperty({__proto__:null,RangeDateTimeInputElement:_e},Symbol.toStringTag,{value:"Module"}));var Cn=Object.defineProperty,da=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Cn(e,a,r),r};class ye extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
1026
206
|
<gui-range-date-time-calendar
|
|
1027
207
|
.uid=${this.widget.uid}
|
|
1028
208
|
.label=${e.label}
|
|
@@ -1057,127 +237,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1057
237
|
.maxDateTimeMessage=${e.maxDateTimeMessage}
|
|
1058
238
|
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
1059
239
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
240
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
1060
241
|
.dayCountAriaLabel=${e.dayCountAriaLabel}
|
|
1061
242
|
.disabledDayCountAriaLabel=${e.disabledDayCountAriaLabel}
|
|
1062
243
|
@change=${this.valueChanged}
|
|
1063
244
|
@inputError=${this.onInputError}
|
|
1064
245
|
@blur=${()=>this.adapter.onBlur()}
|
|
1065
246
|
></gui-range-date-time-calendar>
|
|
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())}}
|
|
1067
|
-
id=${`${this.uid}_popup`}
|
|
1068
|
-
role="dialog"
|
|
1069
|
-
aria-label=${this.label??"Calendar"}
|
|
1070
|
-
.uid=${this.uid}
|
|
1071
|
-
.hint=${this.hint}
|
|
1072
|
-
?touched=${this.touched}
|
|
1073
|
-
?required=${this.required}
|
|
1074
|
-
?disabled=${this.disabled}
|
|
1075
|
-
?readonly=${this.readOnly}
|
|
1076
|
-
.value=${this.value}
|
|
1077
|
-
.focusDate=${this._focusDate}
|
|
1078
|
-
.hidePills=${!0}
|
|
1079
|
-
.localeId=${this.localeId}
|
|
1080
|
-
.prevMonthIcon=${this.prevMonthIcon}
|
|
1081
|
-
.nextMonthIcon=${this.nextMonthIcon}
|
|
1082
|
-
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
1083
|
-
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
1084
|
-
.selectYearAriaLabel=${this.selectYearAriaLabel}
|
|
1085
|
-
.yearGridAriaLabel=${this.yearGridAriaLabel}
|
|
1086
|
-
.dayFormat=${this.dayFormat}
|
|
1087
|
-
.weekdayFormat=${this.weekdayFormat}
|
|
1088
|
-
.monthFormat=${this.monthFormat}
|
|
1089
|
-
.numberOfMonths=${this.numberOfMonths}
|
|
1090
|
-
.hourFormat=${this.hourFormat}
|
|
1091
|
-
.minuteStep=${this.minuteStep}
|
|
1092
|
-
.allowCustomTime=${this.allowCustomTime}
|
|
1093
|
-
.startTimeLabel=${this.startTimeLabel}
|
|
1094
|
-
.endTimeLabel=${this.endTimeLabel}
|
|
1095
|
-
.minDateTime=${this.minDateTime}
|
|
1096
|
-
.maxDateTime=${this.maxDateTime}
|
|
1097
|
-
.minDateTimeMessage=${this.minDateTimeMessage}
|
|
1098
|
-
.maxDateTimeMessage=${this.maxDateTimeMessage}
|
|
1099
|
-
.disabledRanges=${this.disabledRanges}
|
|
1100
|
-
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
1101
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
1102
|
-
.dayCountAriaLabel=${this.dayCountAriaLabel}
|
|
1103
|
-
.disabledDayCountAriaLabel=${this.disabledDayCountAriaLabel}
|
|
1104
|
-
@blur=${this.onCalendarBlur}
|
|
1105
|
-
@change=${this.onCalendarChange}
|
|
1106
|
-
@inputError=${this.onCalendarInputError}
|
|
1107
|
-
></gui-range-date-time-calendar>`:d.nothing;return d.html`
|
|
1108
|
-
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1109
|
-
|
|
1110
|
-
<div
|
|
1111
|
-
class="gui-widget"
|
|
1112
|
-
@keydown=${this._popup.onAnchorKeyDown}
|
|
1113
|
-
@click=${this._popup.onAnchorClick}
|
|
1114
|
-
>
|
|
1115
|
-
<gui-range-date-time
|
|
1116
|
-
id="date-input"
|
|
1117
|
-
class=${S.classMap(e.widgetClasses)}
|
|
1118
|
-
.uid=${this.uid}
|
|
1119
|
-
.hint=${this.hint}
|
|
1120
|
-
.showErrors=${!1}
|
|
1121
|
-
.errors=${this.errors}
|
|
1122
|
-
?touched=${this.touched}
|
|
1123
|
-
?required=${this.required}
|
|
1124
|
-
?disabled=${this.disabled}
|
|
1125
|
-
?readonly=${this.readOnly}
|
|
1126
|
-
.value=${this.value}
|
|
1127
|
-
.icon=${this.icon}
|
|
1128
|
-
.localeId=${this.localeId}
|
|
1129
|
-
.hourFormat=${this.hourFormat}
|
|
1130
|
-
.minuteStep=${this.minuteStep}
|
|
1131
|
-
.separator=${this.separator}
|
|
1132
|
-
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
1133
|
-
.startDateTimeAriaLabel=${this.startDateTimeAriaLabel}
|
|
1134
|
-
.endDateTimeAriaLabel=${this.endDateTimeAriaLabel}
|
|
1135
|
-
.dayAriaLabel=${this.dayAriaLabel}
|
|
1136
|
-
.monthAriaLabel=${this.monthAriaLabel}
|
|
1137
|
-
.yearAriaLabel=${this.yearAriaLabel}
|
|
1138
|
-
.hourAriaLabel=${this.hourAriaLabel}
|
|
1139
|
-
.minuteAriaLabel=${this.minuteAriaLabel}
|
|
1140
|
-
.dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
|
|
1141
|
-
.invalidDateMessage=${this.invalidDateMessage}
|
|
1142
|
-
.minDateTime=${this.minDateTime}
|
|
1143
|
-
.maxDateTime=${this.maxDateTime}
|
|
1144
|
-
.minDateTimeMessage=${this.minDateTimeMessage}
|
|
1145
|
-
.maxDateTimeMessage=${this.maxDateTimeMessage}
|
|
1146
|
-
.disabledRanges=${this.disabledRanges}
|
|
1147
|
-
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
1148
|
-
@blur=${this.onDateBlur}
|
|
1149
|
-
@focus=${this._popup.show}
|
|
1150
|
-
@change=${this.onDateChange}
|
|
1151
|
-
@pillClick=${this.onPillClick}
|
|
1152
|
-
></gui-range-date-time>
|
|
1153
|
-
<button
|
|
1154
|
-
type="button"
|
|
1155
|
-
class="gui-range-date-time-picker__arrow"
|
|
1156
|
-
aria-label=${this.toggleAriaLabel??"Show calendar"}
|
|
1157
|
-
aria-haspopup="dialog"
|
|
1158
|
-
aria-expanded=${this._popup.open?"true":"false"}
|
|
1159
|
-
aria-controls=${`${this.uid}_popup`}
|
|
1160
|
-
?disabled=${this.disabled}
|
|
1161
|
-
@click=${this.onToggleClick}
|
|
1162
|
-
>
|
|
1163
|
-
<svg
|
|
1164
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
1165
|
-
width="16"
|
|
1166
|
-
height="16"
|
|
1167
|
-
viewBox="0 0 256 256"
|
|
1168
|
-
aria-hidden="true"
|
|
1169
|
-
>
|
|
1170
|
-
<path
|
|
1171
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
1172
|
-
></path>
|
|
1173
|
-
</svg>
|
|
1174
|
-
</button>
|
|
1175
|
-
|
|
1176
|
-
${t}
|
|
1177
|
-
</div>
|
|
1178
|
-
|
|
1179
|
-
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
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`
|
|
247
|
+
`}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())}}da([c.consume({context:d.formContext}),m.property({attribute:!1})],ye.prototype,"formContext"),da([c.provide({context:d.inputContext})],ye.prototype,"adapter"),f.safeDefine("gui-range-date-time-calendar-input",ye);const xn=Object.freeze(Object.defineProperty({__proto__:null,RangeDateTimeCalendarElement:ye},Symbol.toStringTag,{value:"Module"}));var kn=Object.defineProperty,la=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&kn(e,a,r),r};class De extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
1181
248
|
<gui-range-date-time-picker
|
|
1182
249
|
.uid=${this.widget.uid}
|
|
1183
250
|
.label=${e.label}
|
|
@@ -1224,107 +291,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1224
291
|
.maxDateTimeMessage=${e.maxDateTimeMessage}
|
|
1225
292
|
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
1226
293
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
294
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
1227
295
|
.dayCountAriaLabel=${e.dayCountAriaLabel}
|
|
1228
296
|
.disabledDayCountAriaLabel=${e.disabledDayCountAriaLabel}
|
|
1229
297
|
@change=${this.valueChanged}
|
|
1230
298
|
@inputError=${this.onInputError}
|
|
1231
299
|
@blur=${()=>this.adapter.onBlur()}
|
|
1232
300
|
></gui-range-date-time-picker>
|
|
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())}}
|
|
1234
|
-
id=${`${this.uid}_popup`}
|
|
1235
|
-
role="dialog"
|
|
1236
|
-
aria-label=${this.label??"Calendar"}
|
|
1237
|
-
.uid=${this.uid}
|
|
1238
|
-
.hint=${this.hint}
|
|
1239
|
-
?touched=${this.touched}
|
|
1240
|
-
?required=${this.required}
|
|
1241
|
-
?disabled=${this.disabled}
|
|
1242
|
-
?readonly=${this.readOnly}
|
|
1243
|
-
.value=${this.value}
|
|
1244
|
-
.focusDate=${this._focusDate}
|
|
1245
|
-
.prevMonthIcon=${this.prevMonthIcon}
|
|
1246
|
-
.nextMonthIcon=${this.nextMonthIcon}
|
|
1247
|
-
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
1248
|
-
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
1249
|
-
.selectYearAriaLabel=${this.selectYearAriaLabel}
|
|
1250
|
-
.yearGridAriaLabel=${this.yearGridAriaLabel}
|
|
1251
|
-
.dayFormat=${this.dayFormat}
|
|
1252
|
-
.weekdayFormat=${this.weekdayFormat}
|
|
1253
|
-
.monthFormat=${this.monthFormat}
|
|
1254
|
-
.minDate=${this.minDate}
|
|
1255
|
-
.maxDate=${this.maxDate}
|
|
1256
|
-
.disabledRanges=${this.disabledRanges}
|
|
1257
|
-
.disabledDateRangeMessage=${this.disabledDateRangeMessage}
|
|
1258
|
-
.numberOfMonths=${this.numberOfMonths}
|
|
1259
|
-
.localeId=${this.localeId}
|
|
1260
|
-
.hidePills=${!0}
|
|
1261
|
-
.invalidRange=${this._invalidRange}
|
|
1262
|
-
@blur=${this.onCalendarBlur}
|
|
1263
|
-
@change=${this.onCalendarChange}
|
|
1264
|
-
@inputError=${this.onCalendarInputError}
|
|
1265
|
-
></gui-range-calendar>`:d.nothing;return d.html`
|
|
1266
|
-
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1267
|
-
|
|
1268
|
-
<div
|
|
1269
|
-
class="gui-widget"
|
|
1270
|
-
@keydown=${this._popup.onAnchorKeyDown}
|
|
1271
|
-
@click=${this._popup.onAnchorClick}
|
|
1272
|
-
>
|
|
1273
|
-
<gui-range-date
|
|
1274
|
-
id="date-input"
|
|
1275
|
-
class=${S.classMap(e.widgetClasses)}
|
|
1276
|
-
.uid=${this.uid}
|
|
1277
|
-
.hint=${this.hint}
|
|
1278
|
-
.showErrors=${!1}
|
|
1279
|
-
.errors=${this.errors}
|
|
1280
|
-
?touched=${this.touched}
|
|
1281
|
-
?required=${this.required}
|
|
1282
|
-
?disabled=${this.disabled}
|
|
1283
|
-
?readonly=${this.readOnly}
|
|
1284
|
-
.value=${this.value}
|
|
1285
|
-
.icon=${this.icon}
|
|
1286
|
-
.localeId=${this.localeId}
|
|
1287
|
-
.separator=${this.separator}
|
|
1288
|
-
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
1289
|
-
.startDateAriaLabel=${this.startDateAriaLabel}
|
|
1290
|
-
.endDateAriaLabel=${this.endDateAriaLabel}
|
|
1291
|
-
.dayAriaLabel=${this.dayAriaLabel}
|
|
1292
|
-
.monthAriaLabel=${this.monthAriaLabel}
|
|
1293
|
-
.yearAriaLabel=${this.yearAriaLabel}
|
|
1294
|
-
.invalidDateMessage=${this.invalidDateMessage}
|
|
1295
|
-
@blur=${this.onDateBlur}
|
|
1296
|
-
@focus=${this._popup.show}
|
|
1297
|
-
@change=${this.onDateChange}
|
|
1298
|
-
@pillClick=${this.onPillClick}
|
|
1299
|
-
></gui-range-date>
|
|
1300
|
-
<button
|
|
1301
|
-
type="button"
|
|
1302
|
-
class="gui-range-date-picker__arrow"
|
|
1303
|
-
aria-label=${this.toggleAriaLabel??"Show calendar"}
|
|
1304
|
-
aria-haspopup="dialog"
|
|
1305
|
-
aria-expanded=${this._popup.open?"true":"false"}
|
|
1306
|
-
aria-controls=${`${this.uid}_popup`}
|
|
1307
|
-
?disabled=${this.disabled}
|
|
1308
|
-
@click=${this.onToggleClick}
|
|
1309
|
-
>
|
|
1310
|
-
<svg
|
|
1311
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
1312
|
-
width="16"
|
|
1313
|
-
height="16"
|
|
1314
|
-
viewBox="0 0 256 256"
|
|
1315
|
-
aria-hidden="true"
|
|
1316
|
-
>
|
|
1317
|
-
<path
|
|
1318
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
1319
|
-
></path>
|
|
1320
|
-
</svg>
|
|
1321
|
-
</button>
|
|
1322
|
-
|
|
1323
|
-
${t}
|
|
1324
|
-
</div>
|
|
1325
|
-
|
|
1326
|
-
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
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`
|
|
301
|
+
`}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())}}la([c.consume({context:d.formContext}),m.property({attribute:!1})],De.prototype,"formContext"),la([c.provide({context:d.inputContext})],De.prototype,"adapter"),f.safeDefine("gui-range-date-time-picker-input",De);const Tn=Object.freeze(Object.defineProperty({__proto__:null,RangeDateTimePickerElement:De},Symbol.toStringTag,{value:"Module"}));var Ln=Object.defineProperty,ua=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Ln(e,a,r),r};class we extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
1328
302
|
<gui-range-date-picker
|
|
1329
303
|
.uid=${this.widget.uid}
|
|
1330
304
|
.label=${e.label}
|
|
@@ -1362,131 +336,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1362
336
|
.minDateMessage=${e.minDateMessage}
|
|
1363
337
|
.maxDateMessage=${e.maxDateMessage}
|
|
1364
338
|
.disabledDateRangeMessage=${e.disabledDateRangeMessage}
|
|
339
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
1365
340
|
@inputError=${this.onInputError}
|
|
1366
341
|
@blur=${()=>this.adapter.onBlur()}
|
|
1367
342
|
@change=${this.valueChanged}
|
|
1368
343
|
></gui-range-date-picker>
|
|
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())}}
|
|
1370
|
-
class="gui-range-time-picker__panel"
|
|
1371
|
-
id=${`${this.uid}_popup`}
|
|
1372
|
-
role="dialog"
|
|
1373
|
-
aria-label=${this.label??"Time list"}
|
|
1374
|
-
>
|
|
1375
|
-
<div class="gui-range-time-picker__column">
|
|
1376
|
-
<span class="gui-range-time-picker__column-label">${i}</span>
|
|
1377
|
-
<gui-time-list
|
|
1378
|
-
class="gui-range-time-picker__list"
|
|
1379
|
-
.uid=${this.uid}
|
|
1380
|
-
.label=${i}
|
|
1381
|
-
.value=${this._workingIn}
|
|
1382
|
-
.localeId=${this.localeId}
|
|
1383
|
-
.hourFormat=${this.hourFormat}
|
|
1384
|
-
.minuteStep=${this.minuteStep}
|
|
1385
|
-
.minTime=${this.minTime}
|
|
1386
|
-
.maxTime=${this.maxTime}
|
|
1387
|
-
.disabledRanges=${this.disabledRanges}
|
|
1388
|
-
.height=${this.height}
|
|
1389
|
-
.itemHeight=${this.itemHeight}
|
|
1390
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
1391
|
-
?readonly=${this.readOnly}
|
|
1392
|
-
@change=${this.onInListChange}
|
|
1393
|
-
></gui-time-list>
|
|
1394
|
-
</div>
|
|
1395
|
-
|
|
1396
|
-
<div class="gui-range-time-picker__column">
|
|
1397
|
-
<span class="gui-range-time-picker__column-label">${a}</span>
|
|
1398
|
-
<gui-time-list
|
|
1399
|
-
class="gui-range-time-picker__list"
|
|
1400
|
-
.uid=${this.uid}
|
|
1401
|
-
.label=${a}
|
|
1402
|
-
.value=${this._workingOut}
|
|
1403
|
-
.localeId=${this.localeId}
|
|
1404
|
-
.hourFormat=${this.hourFormat}
|
|
1405
|
-
.minuteStep=${this.minuteStep}
|
|
1406
|
-
.minTime=${t.minTime}
|
|
1407
|
-
.maxTime=${t.maxTime}
|
|
1408
|
-
.disabledRanges=${this.disabledRanges}
|
|
1409
|
-
.height=${this.height}
|
|
1410
|
-
.itemHeight=${this.itemHeight}
|
|
1411
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
1412
|
-
?disabled=${!this._workingIn}
|
|
1413
|
-
?readonly=${this.readOnly}
|
|
1414
|
-
@change=${this.onOutListChange}
|
|
1415
|
-
></gui-time-list>
|
|
1416
|
-
</div>
|
|
1417
|
-
</div>`:d.nothing;return d.html`
|
|
1418
|
-
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1419
|
-
|
|
1420
|
-
<div
|
|
1421
|
-
class="gui-widget"
|
|
1422
|
-
@keydown=${this._popup.onAnchorKeyDown}
|
|
1423
|
-
@click=${this._popup.onAnchorClick}
|
|
1424
|
-
>
|
|
1425
|
-
<gui-range-time
|
|
1426
|
-
id="time-input"
|
|
1427
|
-
class=${S.classMap(e.widgetClasses)}
|
|
1428
|
-
.uid=${this.uid}
|
|
1429
|
-
.hint=${this.hint}
|
|
1430
|
-
.showErrors=${!1}
|
|
1431
|
-
.errors=${this.errors}
|
|
1432
|
-
?touched=${this.touched}
|
|
1433
|
-
?required=${this.required}
|
|
1434
|
-
?disabled=${this.disabled}
|
|
1435
|
-
?readonly=${this.readOnly}
|
|
1436
|
-
.allowCustomTime=${this.allowCustomTime??!1}
|
|
1437
|
-
.value=${this.value}
|
|
1438
|
-
.icon=${this.icon}
|
|
1439
|
-
.localeId=${this.localeId}
|
|
1440
|
-
.separator=${this.separator}
|
|
1441
|
-
.hourFormat=${this.hourFormat}
|
|
1442
|
-
.minuteStep=${this.minuteStep}
|
|
1443
|
-
.minTime=${this.minTime}
|
|
1444
|
-
.maxTime=${this.maxTime}
|
|
1445
|
-
.disabledRanges=${this.disabledRanges}
|
|
1446
|
-
.minTimeMessage=${this.minTimeMessage}
|
|
1447
|
-
.maxTimeMessage=${this.maxTimeMessage}
|
|
1448
|
-
.rangeOrderMessage=${this.rangeOrderMessage}
|
|
1449
|
-
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
1450
|
-
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
1451
|
-
.startTimeAriaLabel=${this.startTimeAriaLabel}
|
|
1452
|
-
.endTimeAriaLabel=${this.endTimeAriaLabel}
|
|
1453
|
-
.hourAriaLabel=${this.hourAriaLabel}
|
|
1454
|
-
.minuteAriaLabel=${this.minuteAriaLabel}
|
|
1455
|
-
.dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
|
|
1456
|
-
@blur=${this.onInputBlur}
|
|
1457
|
-
@focus=${this._popup.show}
|
|
1458
|
-
@change=${this.onInputChange}
|
|
1459
|
-
@partsChange=${this.onPartsChange}
|
|
1460
|
-
@pillClick=${this.onPillClick}
|
|
1461
|
-
></gui-range-time>
|
|
1462
|
-
<button
|
|
1463
|
-
type="button"
|
|
1464
|
-
class="gui-range-time-picker__arrow"
|
|
1465
|
-
aria-label=${this.toggleAriaLabel??"Show time list"}
|
|
1466
|
-
aria-haspopup="dialog"
|
|
1467
|
-
aria-expanded=${this._popup.open?"true":"false"}
|
|
1468
|
-
aria-controls=${`${this.uid}_popup`}
|
|
1469
|
-
?disabled=${this.disabled}
|
|
1470
|
-
@click=${this.onToggleClick}
|
|
1471
|
-
>
|
|
1472
|
-
<svg
|
|
1473
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
1474
|
-
width="16"
|
|
1475
|
-
height="16"
|
|
1476
|
-
viewBox="0 0 256 256"
|
|
1477
|
-
aria-hidden="true"
|
|
1478
|
-
>
|
|
1479
|
-
<path
|
|
1480
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
1481
|
-
></path>
|
|
1482
|
-
</svg>
|
|
1483
|
-
</button>
|
|
1484
|
-
|
|
1485
|
-
${r}
|
|
1486
|
-
</div>
|
|
1487
|
-
|
|
1488
|
-
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
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`
|
|
344
|
+
`}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())}}ua([c.consume({context:d.formContext}),m.property({attribute:!1})],we.prototype,"formContext"),ua([c.provide({context:d.inputContext})],we.prototype,"adapter"),f.safeDefine("gui-range-date-picker-input",we);const An=Object.freeze(Object.defineProperty({__proto__:null,RangeDatePickerElement:we},Symbol.toStringTag,{value:"Module"}));var Pn=Object.defineProperty,pa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Pn(e,a,r),r};class Ce extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
1490
345
|
<gui-range-time-picker
|
|
1491
346
|
.uid=${this.widget.uid}
|
|
1492
347
|
.label=${e.label}
|
|
@@ -1522,43 +377,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1522
377
|
.rangeOrderMessage=${e.rangeOrderMessage}
|
|
1523
378
|
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
1524
379
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
380
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
1525
381
|
@inputError=${this.onInputError}
|
|
1526
382
|
@blur=${()=>this.adapter.onBlur()}
|
|
1527
383
|
@change=${this.valueChanged}
|
|
1528
384
|
></gui-range-time-picker>
|
|
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())}}
|
|
1530
|
-
${oe(this.uid,e)}
|
|
1531
|
-
|
|
1532
|
-
<div class="gui-widget">
|
|
1533
|
-
<input
|
|
1534
|
-
type="number"
|
|
1535
|
-
inputmode="decimal"
|
|
1536
|
-
id=${this.uid}
|
|
1537
|
-
data-cy=${`${this.uid}_currency`}
|
|
1538
|
-
class=${S.classMap(i)}
|
|
1539
|
-
step=${this.step&&this.step>0?this.step:d.nothing}
|
|
1540
|
-
.value=${this.value??""}
|
|
1541
|
-
?required=${this.required}
|
|
1542
|
-
?disabled=${this.disabled}
|
|
1543
|
-
?readonly=${this.readOnly}
|
|
1544
|
-
placeholder=${this.placeholder||d.nothing}
|
|
1545
|
-
autocomplete=${this.autocomplete||d.nothing}
|
|
1546
|
-
@input=${this.handleInput}
|
|
1547
|
-
@beforeinput=${eo}
|
|
1548
|
-
@keydown=${to}
|
|
1549
|
-
@focus=${this.handleFocus}
|
|
1550
|
-
@blur=${this.handleBlur}
|
|
1551
|
-
/>
|
|
1552
|
-
${this.displayValue?d.html`<span
|
|
1553
|
-
aria-hidden="true"
|
|
1554
|
-
class="gui-currency__format-value ${this.icon?"gui-currency__format-value--icon":""}"
|
|
1555
|
-
>${this.displayValue}</span
|
|
1556
|
-
>`:d.nothing}
|
|
1557
|
-
${t.html}
|
|
1558
|
-
</div>
|
|
1559
|
-
|
|
1560
|
-
${j(this.uid,e)}
|
|
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`
|
|
385
|
+
`}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())}}pa([c.consume({context:d.formContext}),m.property({attribute:!1})],Ce.prototype,"formContext"),pa([c.provide({context:d.inputContext})],Ce.prototype,"adapter"),f.safeDefine("gui-range-time-picker-input",Ce);const In=Object.freeze(Object.defineProperty({__proto__:null,RangeTimePickerElement:Ce},Symbol.toStringTag,{value:"Module"}));var zn=Object.defineProperty,ca=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&zn(e,a,r),r};class xe extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
1562
386
|
<gui-currency
|
|
1563
387
|
.uid=${this.widget.uid}
|
|
1564
388
|
.label=${this.adapter.templateData.label}
|
|
@@ -1580,29 +404,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1580
404
|
@input=${this.valueChanged}
|
|
1581
405
|
@blur=${()=>this.adapter.onBlur()}
|
|
1582
406
|
></gui-currency>
|
|
1583
|
-
`}valueChanged(e){const
|
|
1584
|
-
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
1585
|
-
|
|
1586
|
-
<div class="gui-widget">
|
|
1587
|
-
<div
|
|
1588
|
-
id=${this.uid}
|
|
1589
|
-
class="gui-widget-input gui-parts gui-parts-ring gui-date-input ${this.icon?"gui-calendar--icon":""}"
|
|
1590
|
-
role="group"
|
|
1591
|
-
aria-labelledby=${`${this.uid}_label`}
|
|
1592
|
-
>
|
|
1593
|
-
${gt("default",t,this._parts)}
|
|
1594
|
-
</div>
|
|
1595
|
-
${this.icon?d.html`<span
|
|
1596
|
-
class=${S.classMap(i)}
|
|
1597
|
-
data-icon=${this.icon}
|
|
1598
|
-
aria-hidden="true"
|
|
1599
|
-
></span>`:d.nothing}
|
|
1600
|
-
</div>
|
|
1601
|
-
|
|
1602
|
-
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
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`
|
|
407
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}ca([c.consume({context:d.formContext}),m.property({attribute:!1})],xe.prototype,"formContext"),ca([c.provide({context:d.inputContext})],xe.prototype,"adapter"),f.safeDefine("gui-currency-input",xe);const Mn=Object.freeze(Object.defineProperty({__proto__:null,CurrencyElement:xe},Symbol.toStringTag,{value:"Module"}));var En=Object.defineProperty,ha=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&En(e,a,r),r};class ke extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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=X.addIcon("date",this.adapter.templateData);return l.html`
|
|
1604
408
|
<gui-date
|
|
1605
|
-
class=${
|
|
409
|
+
class=${O.classMap(e.widgetClasses)}
|
|
1606
410
|
.uid=${this.widget.uid}
|
|
1607
411
|
.label=${this.adapter.templateData.label}
|
|
1608
412
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -1622,95 +426,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1622
426
|
.maxDate=${this.adapter.templateData.maxDate}
|
|
1623
427
|
.minDateMessage=${this.adapter.templateData.minDateMessage}
|
|
1624
428
|
.maxDateMessage=${this.adapter.templateData.maxDateMessage}
|
|
429
|
+
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
1625
430
|
@inputError=${this.onInputError}
|
|
1626
431
|
@blur=${()=>this.adapter.onBlur()}
|
|
1627
432
|
@change=${this.valueChanged}
|
|
1628
433
|
></gui-date>
|
|
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())}}
|
|
1630
|
-
id=${`${this.uid}_popup`}
|
|
1631
|
-
role="dialog"
|
|
1632
|
-
aria-label=${this.label??"Calendar"}
|
|
1633
|
-
.uid=${this.uid}
|
|
1634
|
-
.hint=${this.hint}
|
|
1635
|
-
?touched=${this.touched}
|
|
1636
|
-
?required=${this.required}
|
|
1637
|
-
?disabled=${this.disabled}
|
|
1638
|
-
?readonly=${this.readOnly}
|
|
1639
|
-
.value=${this.value}
|
|
1640
|
-
.prevMonthIcon=${this.prevMonthIcon}
|
|
1641
|
-
.nextMonthIcon=${this.nextMonthIcon}
|
|
1642
|
-
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
1643
|
-
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
1644
|
-
.selectYearAriaLabel=${this.selectYearAriaLabel}
|
|
1645
|
-
.yearGridAriaLabel=${this.yearGridAriaLabel}
|
|
1646
|
-
.dayFormat=${this.dayFormat}
|
|
1647
|
-
.weekdayFormat=${this.weekdayFormat}
|
|
1648
|
-
.monthFormat=${this.monthFormat}
|
|
1649
|
-
.minDate=${this.minDate}
|
|
1650
|
-
.maxDate=${this.maxDate}
|
|
1651
|
-
.disabledRanges=${this.disabledRanges}
|
|
1652
|
-
.numberOfMonths=${this.numberOfMonths}
|
|
1653
|
-
.localeId=${this.localeId}
|
|
1654
|
-
@blur=${this.onCalendarBlur}
|
|
1655
|
-
@change=${this.onCalendarChange}
|
|
1656
|
-
></gui-calendar>`:d.nothing;return d.html`
|
|
1657
|
-
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1658
|
-
|
|
1659
|
-
<div
|
|
1660
|
-
class="gui-widget"
|
|
1661
|
-
@keydown=${this._popup.onAnchorKeyDown}
|
|
1662
|
-
@click=${this._popup.onAnchorClick}
|
|
1663
|
-
>
|
|
1664
|
-
<gui-date
|
|
1665
|
-
id="date-input"
|
|
1666
|
-
class=${S.classMap(e.widgetClasses)}
|
|
1667
|
-
.uid=${this.uid}
|
|
1668
|
-
.hint=${this.hint}
|
|
1669
|
-
.showErrors=${!1}
|
|
1670
|
-
.errors=${this.errors}
|
|
1671
|
-
?touched=${this.touched}
|
|
1672
|
-
?required=${this.required}
|
|
1673
|
-
?disabled=${this.disabled}
|
|
1674
|
-
?readonly=${this.readOnly}
|
|
1675
|
-
.value=${this.value}
|
|
1676
|
-
.icon=${this.icon}
|
|
1677
|
-
.localeId=${this.localeId}
|
|
1678
|
-
.dayAriaLabel=${this.dayAriaLabel}
|
|
1679
|
-
.monthAriaLabel=${this.monthAriaLabel}
|
|
1680
|
-
.yearAriaLabel=${this.yearAriaLabel}
|
|
1681
|
-
.invalidDateMessage=${this.invalidDateMessage}
|
|
1682
|
-
@blur=${this.onDateBlur}
|
|
1683
|
-
@focus=${this._popup.show}
|
|
1684
|
-
@change=${this.onDateChange}
|
|
1685
|
-
></gui-date>
|
|
1686
|
-
<button
|
|
1687
|
-
type="button"
|
|
1688
|
-
class="gui-date-picker__arrow"
|
|
1689
|
-
aria-label=${this.toggleAriaLabel??"Show calendar"}
|
|
1690
|
-
aria-haspopup="dialog"
|
|
1691
|
-
aria-expanded=${this._popup.open?"true":"false"}
|
|
1692
|
-
aria-controls=${`${this.uid}_popup`}
|
|
1693
|
-
?disabled=${this.disabled}
|
|
1694
|
-
@click=${this.onToggleClick}
|
|
1695
|
-
>
|
|
1696
|
-
<svg
|
|
1697
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
1698
|
-
width="16"
|
|
1699
|
-
height="16"
|
|
1700
|
-
viewBox="0 0 256 256"
|
|
1701
|
-
aria-hidden="true"
|
|
1702
|
-
>
|
|
1703
|
-
<path
|
|
1704
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
1705
|
-
></path>
|
|
1706
|
-
</svg>
|
|
1707
|
-
</button>
|
|
1708
|
-
|
|
1709
|
-
${t}
|
|
1710
|
-
</div>
|
|
1711
|
-
|
|
1712
|
-
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
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`
|
|
434
|
+
`}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())}}ha([c.consume({context:d.formContext}),m.property({attribute:!1})],ke.prototype,"formContext"),ha([c.provide({context:d.inputContext})],ke.prototype,"adapter"),f.safeDefine("gui-date-input",ke);const Sn=Object.freeze(Object.defineProperty({__proto__:null,DateElement:ke},Symbol.toStringTag,{value:"Module"}));var On=Object.defineProperty,ma=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&On(e,a,r),r};class Te extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
1714
435
|
<gui-date-picker
|
|
1715
436
|
.uid=${this.widget.uid}
|
|
1716
437
|
.label=${e.label}
|
|
@@ -1744,134 +465,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1744
465
|
.minDateMessage=${e.minDateMessage}
|
|
1745
466
|
.maxDateMessage=${e.maxDateMessage}
|
|
1746
467
|
.disabledDateRangeMessage=${e.disabledDateRangeMessage}
|
|
468
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
1747
469
|
@inputError=${this.onInputError}
|
|
1748
470
|
@blur=${()=>this.adapter.onBlur()}
|
|
1749
471
|
@change=${this.valueChanged}
|
|
1750
472
|
></gui-date-picker>
|
|
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())}}
|
|
1752
|
-
${this.label?oe(this.uid,e,!1,void 0,!1):d.nothing}
|
|
1753
|
-
|
|
1754
|
-
<div class="gui-widget">
|
|
1755
|
-
<div
|
|
1756
|
-
id=${this.uid}
|
|
1757
|
-
class="gui-widget-input gui-parts gui-parts-ring gui-date-time-input ${this.icon?"gui-calendar--icon":""}"
|
|
1758
|
-
role="group"
|
|
1759
|
-
aria-labelledby=${`${this.uid}_label`}
|
|
1760
|
-
>
|
|
1761
|
-
${gt("default",t,this._parts)}
|
|
1762
|
-
</div>
|
|
1763
|
-
${this.icon?d.html`<span
|
|
1764
|
-
class=${S.classMap(i)}
|
|
1765
|
-
data-icon=${this.icon}
|
|
1766
|
-
aria-hidden="true"
|
|
1767
|
-
></span>`:d.nothing}
|
|
1768
|
-
</div>
|
|
1769
|
-
|
|
1770
|
-
${this.showErrors&&this.errors?.length?j(this.uid,e):d.nothing}
|
|
1771
|
-
`}validateAndEmit(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"){this.requestUpdate();return}if(a.kind==="invalid"){this.dispatchEvent(new CustomEvent("inputError",{detail:{message:a.message},bubbles:!0})),this.requestUpdate();return}const s=this.boundsError(a.iso,a.instant);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()}};K([n.property({type:String})],V.prototype,"uid",2),K([n.property({type:String})],V.prototype,"label",2),K([n.property({type:String,attribute:"locale-id"})],V.prototype,"localeId",2),K([n.property({type:Array})],V.prototype,"errors",2),K([n.property({type:Boolean})],V.prototype,"showErrors",2),K([n.property({type:Boolean})],V.prototype,"touched",2),K([n.property({type:Boolean})],V.prototype,"required",2),K([n.property({type:Boolean})],V.prototype,"disabled",2),K([n.property({type:Boolean,attribute:"readonly"})],V.prototype,"readOnly",2),K([n.property({type:String})],V.prototype,"icon",2),K([n.property({type:String})],V.prototype,"hint",2),K([n.property({type:String})],V.prototype,"dayAriaLabel",2),K([n.property({type:String})],V.prototype,"monthAriaLabel",2),K([n.property({type:String})],V.prototype,"yearAriaLabel",2),K([n.property({type:String})],V.prototype,"hourAriaLabel",2),K([n.property({type:String})],V.prototype,"minuteAriaLabel",2),K([n.property({type:String})],V.prototype,"dayPeriodAriaLabel",2),K([n.property({type:String,attribute:"hour-format"})],V.prototype,"hourFormat",2),K([n.property({type:Number,attribute:"minute-step"})],V.prototype,"minuteStep",2),K([n.property({type:String,attribute:"invalid-date-message"})],V.prototype,"invalidDateMessage",2),K([n.property({type:String})],V.prototype,"value",2),K([n.property({type:String,attribute:"min-date"})],V.prototype,"minDate",2),K([n.property({type:String,attribute:"max-date"})],V.prototype,"maxDate",2),K([n.property({type:String,attribute:"min-time"})],V.prototype,"minTime",2),K([n.property({type:String,attribute:"max-time"})],V.prototype,"maxTime",2),K([n.property({type:String,attribute:"min-date-message"})],V.prototype,"minDateMessage",2),K([n.property({type:String,attribute:"max-date-message"})],V.prototype,"maxDateMessage",2),K([n.property({type:String,attribute:"min-time-message"})],V.prototype,"minTimeMessage",2),K([n.property({type:String,attribute:"max-time-message"})],V.prototype,"maxTimeMessage",2),V=K([n.customElement("gui-date-time")],V),typeof customElements<"u"&&!customElements.get("gui-date-time")&&customElements.define("gui-date-time",V);var tg=Object.defineProperty,ig=Object.getOwnPropertyDescriptor,T=(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&&tg(t,i,r),r};let k=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.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.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.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledTimeRanges=void 0,this.allowCustomTime=!1,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledTimeRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._popup=new Rt(this,{focusRestoreSelector:"gui-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")?"ignore":e.closest(".gui-date-time-input__part")||e.closest("gui-date-time-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-date-time-calendar
|
|
1772
|
-
id=${`${this.uid}_popup`}
|
|
1773
|
-
role="dialog"
|
|
1774
|
-
aria-label=${this.label??"Calendar"}
|
|
1775
|
-
.uid=${this.uid}
|
|
1776
|
-
.hint=${this.hint}
|
|
1777
|
-
?touched=${this.touched}
|
|
1778
|
-
?required=${this.required}
|
|
1779
|
-
?disabled=${this.disabled}
|
|
1780
|
-
?readonly=${this.readOnly}
|
|
1781
|
-
.value=${this.value}
|
|
1782
|
-
.prevMonthIcon=${this.prevMonthIcon}
|
|
1783
|
-
.nextMonthIcon=${this.nextMonthIcon}
|
|
1784
|
-
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
1785
|
-
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
1786
|
-
.selectYearAriaLabel=${this.selectYearAriaLabel}
|
|
1787
|
-
.yearGridAriaLabel=${this.yearGridAriaLabel}
|
|
1788
|
-
.dayFormat=${this.dayFormat}
|
|
1789
|
-
.weekdayFormat=${this.weekdayFormat}
|
|
1790
|
-
.monthFormat=${this.monthFormat}
|
|
1791
|
-
.minDate=${this.minDate}
|
|
1792
|
-
.maxDate=${this.maxDate}
|
|
1793
|
-
.disabledRanges=${this.disabledRanges}
|
|
1794
|
-
.numberOfMonths=${this.numberOfMonths}
|
|
1795
|
-
.localeId=${this.localeId}
|
|
1796
|
-
.hourFormat=${this.hourFormat}
|
|
1797
|
-
.minuteStep=${this.minuteStep}
|
|
1798
|
-
.minTime=${this.minTime}
|
|
1799
|
-
.maxTime=${this.maxTime}
|
|
1800
|
-
.disabledTimeRanges=${this.disabledTimeRanges}
|
|
1801
|
-
.allowCustomTime=${this.allowCustomTime}
|
|
1802
|
-
.minTimeMessage=${this.minTimeMessage}
|
|
1803
|
-
.maxTimeMessage=${this.maxTimeMessage}
|
|
1804
|
-
.disabledTimeRangeMessage=${this.disabledTimeRangeMessage}
|
|
1805
|
-
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
1806
|
-
@blur=${this.onCalendarBlur}
|
|
1807
|
-
@change=${this.onCalendarChange}
|
|
1808
|
-
></gui-date-time-calendar>`:d.nothing;return d.html`
|
|
1809
|
-
${oe(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
|
|
1810
|
-
|
|
1811
|
-
<div
|
|
1812
|
-
class="gui-widget"
|
|
1813
|
-
@keydown=${this._popup.onAnchorKeyDown}
|
|
1814
|
-
@click=${this._popup.onAnchorClick}
|
|
1815
|
-
>
|
|
1816
|
-
<gui-date-time
|
|
1817
|
-
id="date-input"
|
|
1818
|
-
class=${S.classMap(e.widgetClasses)}
|
|
1819
|
-
.uid=${this.uid}
|
|
1820
|
-
.hint=${this.hint}
|
|
1821
|
-
.showErrors=${!1}
|
|
1822
|
-
.errors=${this.errors}
|
|
1823
|
-
?touched=${this.touched}
|
|
1824
|
-
?required=${this.required}
|
|
1825
|
-
?disabled=${this.disabled}
|
|
1826
|
-
?readonly=${this.readOnly}
|
|
1827
|
-
.value=${this.value}
|
|
1828
|
-
.icon=${this.icon}
|
|
1829
|
-
.localeId=${this.localeId}
|
|
1830
|
-
.hourFormat=${this.hourFormat}
|
|
1831
|
-
.minuteStep=${this.minuteStep}
|
|
1832
|
-
.minTime=${this.minTime}
|
|
1833
|
-
.maxTime=${this.maxTime}
|
|
1834
|
-
.dayAriaLabel=${this.dayAriaLabel}
|
|
1835
|
-
.monthAriaLabel=${this.monthAriaLabel}
|
|
1836
|
-
.yearAriaLabel=${this.yearAriaLabel}
|
|
1837
|
-
.hourAriaLabel=${this.hourAriaLabel}
|
|
1838
|
-
.minuteAriaLabel=${this.minuteAriaLabel}
|
|
1839
|
-
.dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
|
|
1840
|
-
.invalidDateMessage=${this.invalidDateMessage}
|
|
1841
|
-
.minTimeMessage=${this.minTimeMessage}
|
|
1842
|
-
.maxTimeMessage=${this.maxTimeMessage}
|
|
1843
|
-
@blur=${this.onDateBlur}
|
|
1844
|
-
@focus=${this._popup.show}
|
|
1845
|
-
@change=${this.onDateChange}
|
|
1846
|
-
></gui-date-time>
|
|
1847
|
-
<button
|
|
1848
|
-
type="button"
|
|
1849
|
-
class="gui-date-time-picker__arrow"
|
|
1850
|
-
aria-label=${this.toggleAriaLabel??"Show calendar"}
|
|
1851
|
-
aria-haspopup="dialog"
|
|
1852
|
-
aria-expanded=${this._popup.open?"true":"false"}
|
|
1853
|
-
aria-controls=${`${this.uid}_popup`}
|
|
1854
|
-
?disabled=${this.disabled}
|
|
1855
|
-
@click=${this.onToggleClick}
|
|
1856
|
-
>
|
|
1857
|
-
<svg
|
|
1858
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
1859
|
-
width="16"
|
|
1860
|
-
height="16"
|
|
1861
|
-
viewBox="0 0 256 256"
|
|
1862
|
-
aria-hidden="true"
|
|
1863
|
-
>
|
|
1864
|
-
<path
|
|
1865
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
1866
|
-
></path>
|
|
1867
|
-
</svg>
|
|
1868
|
-
</button>
|
|
1869
|
-
|
|
1870
|
-
${t}
|
|
1871
|
-
</div>
|
|
1872
|
-
|
|
1873
|
-
${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
|
|
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`
|
|
473
|
+
`}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())}}ma([c.consume({context:d.formContext}),m.property({attribute:!1})],Te.prototype,"formContext"),ma([c.provide({context:d.inputContext})],Te.prototype,"adapter"),f.safeDefine("gui-date-picker-input",Te);const Rn=Object.freeze(Object.defineProperty({__proto__:null,DatePickerElement:Te},Symbol.toStringTag,{value:"Module"}));var Fn=Object.defineProperty,ga=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Fn(e,a,r),r};class Le extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
1875
474
|
<gui-date-time-picker
|
|
1876
475
|
.uid=${this.widget.uid}
|
|
1877
476
|
.label=${e.label}
|
|
@@ -1918,38 +517,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1918
517
|
.maxTimeMessage=${e.maxTimeMessage}
|
|
1919
518
|
.disabledTimeRangeMessage=${e.disabledTimeRangeMessage}
|
|
1920
519
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
520
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
1921
521
|
@inputError=${this.onInputError}
|
|
1922
522
|
@blur=${()=>this.adapter.onBlur()}
|
|
1923
523
|
@change=${this.valueChanged}
|
|
1924
524
|
></gui-date-time-picker>
|
|
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())}}
|
|
525
|
+
`}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())}}ga([c.consume({context:d.formContext}),m.property({attribute:!1})],Le.prototype,"formContext"),ga([c.provide({context:d.inputContext})],Le.prototype,"adapter"),f.safeDefine("gui-date-time-picker-input",Le);const Zn=Object.freeze(Object.defineProperty({__proto__:null,DateTimePickerElement:Le},Symbol.toStringTag,{value:"Module"})),fa=t=>{const e={"gui-list__item":!0,"gui-list__item-selected":!!t.selected,"gui-list__item-focused":!!t.focused,"gui-list__item-disabled":!!t.disabled};return l.html`
|
|
1926
526
|
<div
|
|
1927
527
|
role="option"
|
|
1928
|
-
class=${
|
|
1929
|
-
aria-selected=${
|
|
1930
|
-
aria-disabled=${
|
|
528
|
+
class=${O.classMap(e)}
|
|
529
|
+
aria-selected=${t.selected?"true":"false"}
|
|
530
|
+
aria-disabled=${t.disabled?"true":"false"}
|
|
1931
531
|
>
|
|
1932
|
-
${
|
|
532
|
+
${t.template}
|
|
1933
533
|
</div>
|
|
1934
|
-
`};var
|
|
1935
|
-
<div
|
|
1936
|
-
class="gui-list__scroll-viewport"
|
|
1937
|
-
style="max-height: ${e}px; min-height: 40px; overflow-y: auto; position: relative; display: block;"
|
|
1938
|
-
@scroll="${this.onScroll}"
|
|
1939
|
-
>
|
|
1940
|
-
<div
|
|
1941
|
-
class="gui-list__spacer"
|
|
1942
|
-
style="height: ${i}px; width: 1px; opacity: 0; pointer-events: none;"
|
|
1943
|
-
></div>
|
|
1944
|
-
|
|
1945
|
-
<div
|
|
1946
|
-
class="gui-list__content"
|
|
1947
|
-
style="transform: translateY(${a}px); position: absolute; top: 0; left: 0; width: 100%;"
|
|
1948
|
-
>
|
|
1949
|
-
<slot></slot>
|
|
1950
|
-
</div>
|
|
1951
|
-
</div>
|
|
1952
|
-
`}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this._items.findIndex(t=>t.value===this.value);this.scrollToIndex(e)}scrollToIndex(e){const t=this.itemHeight??40,i=this.height??300,a=e*t,r=a+t,s=this.viewportElement.scrollTop,o=s+i;a<s?this.viewportElement.scrollTop=a:r>o&&(this.viewportElement.scrollTop=r-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0}))}findEnabledIndex(e,t){for(let i=e;i>=0&&i<this._items.length;i+=t)if(!this._items[i]?.disabled)return i;return-1}setFocusedIndex(e){e<0||e>=this.items.length||(this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0})))}updateItems(){this._items=hg(this.items,{valueField:this.valueField}),this.dispatchEvent(new CustomEvent("gui-update-items",{detail:this._items,bubbles:!0,composed:!0}))}emitRangeChange(){const{startIndex:e,endIndex:t}=this.calculateRange();this.dispatchEvent(new CustomEvent("gui-range-change",{detail:{startIndex:e,endIndex:t},bubbles:!0,composed:!0}))}measureViewport(){this.viewportElement&&(this._viewportHeight=this.viewportElement.offsetHeight,this.emitRangeChange())}onScroll(e){const t=e.target;this._scrollTop=t.scrollTop}calculateRange(){const e=this.itemHeight??40,t=this.items?.length??0,i=Math.ceil(this._viewportHeight/e),a=Math.floor(this._scrollTop/e),r=Math.max(0,a-this.buffer),s=Math.min(t,a+i+this.buffer),o=r*e;return{startIndex:r,endIndex:s,offsetY:o}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("focus",this.onFocus),this.removeEventListener("focusout",this.onFocusOut)}};Le([n.property({type:String})],De.prototype,"uid",2),Le([n.property({type:Boolean})],De.prototype,"touched",2),Le([n.property({type:Boolean})],De.prototype,"required",2),Le([n.property({type:Boolean})],De.prototype,"disabled",2),Le([n.property({type:Boolean,attribute:"readonly"})],De.prototype,"readOnly",2),Le([n.property({type:String})],De.prototype,"value",2),Le([n.property({type:String})],De.prototype,"valueField",2),Le([n.property({type:String})],De.prototype,"label",2),Le([n.property({type:String})],De.prototype,"hint",2),Le([n.property({type:Array})],De.prototype,"items",2),Le([n.property({type:Number})],De.prototype,"itemHeight",2),Le([n.property({type:Number})],De.prototype,"height",2),Le([n.state()],De.prototype,"_items",2),Le([n.state()],De.prototype,"_scrollTop",2),Le([n.state()],De.prototype,"_viewportHeight",2),Le([n.state()],De.prototype,"_focusedIndex",2),Le([n.query(".gui-list__scroll-viewport")],De.prototype,"viewportElement",2),De=Le([n.customElement("gui-list")],De),typeof customElements<"u"&&!customElements.get("gui-list")&&customElements.define("gui-list",De);var yg=Object.defineProperty,gg=Object.getOwnPropertyDescriptor,ca=(e,t,i,a)=>{for(var r=a>1?void 0:a?gg(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 Bt=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.errors=[],this.touched=!1}createRenderRoot(){return this}render(){return super.render(),d.html`${j(this.uid,{touched:this.touched,errors:this.errors})}`}};ca([n.property({type:String})],Bt.prototype,"uid",2),ca([n.property({type:Array})],Bt.prototype,"errors",2),ca([n.property({type:Boolean})],Bt.prototype,"touched",2),Bt=ca([n.customElement("gui-errors")],Bt),typeof customElements<"u"&&!customElements.get("gui-errors")&&customElements.define("gui-errors",Bt);var bg=Object.defineProperty,fg=Object.getOwnPropertyDescriptor,at=(e,t,i,a)=>{for(var r=a>1?void 0:a?fg(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&&bg(t,i,r),r};let Ye=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.debouncer=new ds.Subject,this.subscriptions=[],this._range={start:0,end:10},this._filteredItems=[],this._listItems=[],this._focusedIndex=-1,this._isFiltering=!1,this._isListVisible=!1,this._selectedItem=void 0,this._ignoreNextFocus=!1,this.onDocumentClick=e=>{if(!this._isListVisible)return;const t=e.composedPath(),i=this._inputRef&&t.includes(this._inputRef),a=this._listRef&&t.includes(this._listRef);!i&&!a&&(this._isListVisible=!1)}}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-dropdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this._filteredItems=this.adapter.templateData.items,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems?.length===0&&this._filteredItems?.length===0&&(this._filteredItems=e.items,this._listItems=e.items),this.requestUpdate()}),this.debouncer.pipe(ds.debounceTime(this.adapter.templateData.inputDebounce??500)).subscribe(e=>{this._filterItems(e)}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){const t=e.detail||[];if(this._listItems=t,!this._selectedItem&&this.adapter.templateData.value!=null){const i=t.find(a=>a.value===this.adapter.templateData.value);i&&(this._selectedItem=i)}}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){if(this.adapter.templateData.readonly||e.disabled)return;const i=this.adapter.templateData;this.adapter.valueChanged(e.value),this.adapter.filterChanged(""),this._focusedIndex=t,this._selectedItem=e,this._isFiltering=!1,this._isListVisible=!1,this._listRef&&(this._listRef.focusItemAtIndex(t),this._inputRef.value=i.valueField?e.template[i.valueField]:e.template)}_onValueChange(e){const t=e.detail.value;this.adapter.valueChanged(t),this.adapter.filterChanged(""),this._selectedItem=this._listItems.find(i=>i.value===t),this._isFiltering=!1,this._isListVisible=!1}async _onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isListVisible=!0,await this.updateComplete,this._listRef.focus(),this._listRef.scrollToSelectedIndex();break;case"Enter":this._inputRef.value||(this.adapter.valueChanged(null),this._isListVisible=!1,this._isFiltering=!1);break}}_onInput(e){const t=e.target.value;this.debouncer.next(t)}_filterItems(e){const t=this.adapter.templateData,i=!!this.widget.on?.filter;if(this.adapter.filterChanged(e),e&&!i){this._isFiltering=!0,this._isListVisible=!0;const a=t.searchFields??[t.labelField,t.valueField].filter(l=>!!l),r=a.length>0,o=(t.items||[]).filter(l=>{if(l===null||typeof l!="object")return l!=null&&l.toString().toLowerCase().includes(e.toLowerCase());const p=Object.keys(l),h=(c,y)=>c||l[y].toString().toLowerCase().includes(e.toLowerCase());return r?p.filter(c=>a.includes(c)).reduce(h,!1):p.reduce(h,!1)});this._filteredItems=[...o]}else this._isFiltering=!1,this._filteredItems=[...t.items]}_onWidgetKeyDown(e){e.key!=="Escape"||!this._isListVisible||(e.preventDefault(),e.stopPropagation(),this._isListVisible=!1,this._isFiltering=!1,this._ignoreNextFocus=!0,this._inputRef?.focus(),setTimeout(()=>{this._ignoreNextFocus=!1}))}async _onFocus(){this._ignoreNextFocus||(this._isListVisible=!0,await this.updateComplete,this._listRef.scrollToSelectedIndex())}_onFocusOutInput(e){const t=e.relatedTarget;t&&this.contains(t)||(this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1)}_onBlur(){this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),a=this.adapter.getItemRenderer(e.itemRenderer,io),s=this._selectedItem?.template!==null&&typeof this._selectedItem?.template=="object"?e.labelField??"label":null,o=s?this._selectedItem?.template[s]:this._selectedItem?.template,l=!!this.widget.on?.filter;return d.html`
|
|
534
|
+
`};var jn=Object.defineProperty,E=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&jn(e,a,r),r};class I extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.debouncer=new ot.Subject,this.subscriptions=[],this._range={start:0,end:10},this._filteredItems=[],this._listItems=[],this._focusedIndex=-1,this._isFiltering=!1,this._isListVisible=!1,this._selectedItem=void 0,this._ignoreNextFocus=!1,this.onDocumentClick=e=>{if(!this._isListVisible)return;const a=e.composedPath(),i=this._inputRef&&a.includes(this._inputRef),r=this._listRef&&a.includes(this._listRef);!i&&!r&&(this._isListVisible=!1)}}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-dropdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this._filteredItems=this.adapter.templateData.items,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems?.length===0&&this._filteredItems?.length===0&&(this._filteredItems=e.items,this._listItems=e.items),this.requestUpdate()}),this.debouncer.pipe(ot.debounceTime(this.adapter.templateData.inputDebounce??500)).subscribe(e=>{this._filterItems(e)}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){const a=e.detail||[];if(this._listItems=a,!this._selectedItem&&this.adapter.templateData.value!=null){const i=a.find(r=>r.value===this.adapter.templateData.value);i&&(this._selectedItem=i)}}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,a){if(this.adapter.templateData.readonly||e.disabled)return;const i=this.adapter.templateData;this.adapter.valueChanged(e.value),this.adapter.filterChanged(""),this._focusedIndex=a,this._selectedItem=e,this._isFiltering=!1,this._isListVisible=!1,this._listRef&&(this._listRef.focusItemAtIndex(a),this._inputRef.value=i.valueField?e.template[i.valueField]:e.template)}_onValueChange(e){const a=e.detail.value;this.adapter.valueChanged(a),this.adapter.filterChanged(""),this._selectedItem=this._listItems.find(i=>i.value===a),this._isFiltering=!1,this._isListVisible=!1}async _onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isListVisible=!0,await this.updateComplete,this._listRef.focus(),this._listRef.scrollToSelectedIndex();break;case"Enter":this._inputRef.value||(this.adapter.valueChanged(null),this._isListVisible=!1,this._isFiltering=!1);break}}_onInput(e){const a=e.target.value;this.debouncer.next(a)}_filterItems(e){const a=this.adapter.templateData,i=!!this.widget.on?.filter;if(this.adapter.filterChanged(e),e&&!i){this._isFiltering=!0,this._isListVisible=!0;const r=a.searchFields??[a.labelField,a.valueField].filter(u=>!!u),s=r.length>0,o=(a.items||[]).filter(u=>{if(u===null||typeof u!="object")return u!=null&&u.toString().toLowerCase().includes(e.toLowerCase());const g=Object.keys(u),b=(v,_)=>v||u[_].toString().toLowerCase().includes(e.toLowerCase());return s?g.filter(v=>r.includes(v)).reduce(b,!1):g.reduce(b,!1)});this._filteredItems=[...o]}else this._isFiltering=!1,this._filteredItems=[...a.items]}_onWidgetKeyDown(e){e.key!=="Escape"||!this._isListVisible||(e.preventDefault(),e.stopPropagation(),this._isListVisible=!1,this._isFiltering=!1,this._ignoreNextFocus=!0,this._inputRef?.focus(),setTimeout(()=>{this._ignoreNextFocus=!1}))}async _onFocus(){this._ignoreNextFocus||(this._isListVisible=!0,await this.updateComplete,this._listRef.scrollToSelectedIndex())}_onFocusOutInput(e){const a=e.relatedTarget;a&&this.contains(a)||(this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1)}_onBlur(){this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1}render(){const e=this.adapter.templateData,a=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),r=this.adapter.getItemRenderer(e.itemRenderer,fa),n=this._selectedItem?.template!==null&&typeof this._selectedItem?.template=="object"?e.labelField??"label":null,o=n?this._selectedItem?.template[n]:this._selectedItem?.template,u=!!this.widget.on?.filter;return l.html`
|
|
1953
535
|
<gui-label
|
|
1954
536
|
.targetElement=${[this._listRef,this._inputRef]}
|
|
1955
537
|
.uid=${this.widget.uid}
|
|
@@ -1973,7 +555,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1973
555
|
?disabled=${e.disabled}
|
|
1974
556
|
?readonly=${e.readonly}
|
|
1975
557
|
placeholder=${e.placeholder??""}
|
|
1976
|
-
autocomplete=${e.autocomplete||
|
|
558
|
+
autocomplete=${e.autocomplete||l.nothing}
|
|
1977
559
|
@keydown=${this._onKeyDown}
|
|
1978
560
|
@input=${this._onInput}
|
|
1979
561
|
@focusout=${this._onFocusOutInput}
|
|
@@ -1981,8 +563,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1981
563
|
aria-expanded=${this._isListVisible?"true":"false"}
|
|
1982
564
|
aria-controls=${`${this.widget.uid}-list`}
|
|
1983
565
|
aria-autocomplete="list"
|
|
1984
|
-
aria-labelledby=${e.label?`${this.widget.uid}_label`:
|
|
1985
|
-
aria-describedby=${e.hint?`${this.widget.uid}_hint`:
|
|
566
|
+
aria-labelledby=${e.label?`${this.widget.uid}_label`:l.nothing}
|
|
567
|
+
aria-describedby=${e.hint?`${this.widget.uid}_hint`:l.nothing}
|
|
1986
568
|
/>
|
|
1987
569
|
<span class="gui-dropdown__arrow"
|
|
1988
570
|
><svg
|
|
@@ -2002,7 +584,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2002
584
|
.uid=${this.widget.uid}
|
|
2003
585
|
.value=${e.value??""}
|
|
2004
586
|
.valueField=${e.valueField}
|
|
2005
|
-
.items=${this._isFiltering&&!
|
|
587
|
+
.items=${this._isFiltering&&!u?this._filteredItems:e.items}
|
|
2006
588
|
.itemHeight=${e.itemHeight}
|
|
2007
589
|
.height=${e.height}
|
|
2008
590
|
?required=${e.validator?.required}
|
|
@@ -2017,29 +599,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2017
599
|
@blur=${this._onBlur}
|
|
2018
600
|
@change=${this._onValueChange}
|
|
2019
601
|
>
|
|
2020
|
-
${i.map((
|
|
602
|
+
${i.map((h,g)=>{const b=this._range.start+g,v=e.value===h.value,_=this._focusedIndex===b,Z=!!e.disabled||!!h.disabled,A=e.labelField??"label",So=h.template!==null&&typeof h.template=="object"&&A&&!e.itemRenderer?h.template[A]:h.template;return l.html`
|
|
2021
603
|
<div
|
|
2022
604
|
role="option"
|
|
2023
605
|
tabindex="-1"
|
|
2024
606
|
class="gui-list__item-wrapper"
|
|
2025
|
-
id="${this.widget.uid}-item-${
|
|
607
|
+
id="${this.widget.uid}-item-${b}"
|
|
2026
608
|
style="height: ${e.itemHeight||40}px"
|
|
2027
|
-
aria-selected=${
|
|
2028
|
-
aria-disabled=${
|
|
2029
|
-
@click=${()=>this._onClickItem(
|
|
609
|
+
aria-selected=${v?"true":"false"}
|
|
610
|
+
aria-disabled=${Z?"true":"false"}
|
|
611
|
+
@click=${()=>this._onClickItem(h,b)}
|
|
2030
612
|
>
|
|
2031
|
-
${
|
|
613
|
+
${r({template:So,value:h.value,index:b,selected:v,disabled:Z,focused:_})}
|
|
2032
614
|
</div>
|
|
2033
615
|
`})}
|
|
2034
616
|
</gui-list>
|
|
2035
617
|
</div>
|
|
2036
618
|
|
|
2037
|
-
${
|
|
619
|
+
${a?l.html`<gui-errors
|
|
2038
620
|
.uid=${this.widget.uid}
|
|
2039
621
|
.errors=${e.errors}
|
|
2040
622
|
.touched=${e.touched}
|
|
2041
|
-
></gui-errors>`:
|
|
2042
|
-
`}}
|
|
623
|
+
></gui-errors>`:l.nothing}
|
|
624
|
+
`}}E([c.consume({context:d.formContext}),m.property({attribute:!1})],I.prototype,"formContext"),E([c.provide({context:d.inputContext})],I.prototype,"adapter"),E([m.state()],I.prototype,"_range"),E([m.state()],I.prototype,"_filteredItems"),E([m.state()],I.prototype,"_listItems"),E([m.state()],I.prototype,"_focusedIndex"),E([m.state()],I.prototype,"_isFiltering"),E([m.state()],I.prototype,"_isListVisible"),E([m.state()],I.prototype,"_selectedItem"),E([m.query("input")],I.prototype,"_inputRef"),E([m.query("gui-list")],I.prototype,"_listRef"),f.safeDefine("gui-dropdown-input",I);const qn=Object.freeze(Object.defineProperty({__proto__:null,DropdownElement:I},Symbol.toStringTag,{value:"Module"}));var Nn=Object.defineProperty,Y=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Nn(e,a,r),r};class R extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[],this._range={start:0,end:10},this._listItems=[],this._focusedIndex=-1}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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,a=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),r=this.adapter.getItemRenderer(e.itemRenderer,fa);return l.html`
|
|
2043
625
|
<gui-label
|
|
2044
626
|
.targetElement=${this._guiListRef}
|
|
2045
627
|
.uid=${this.widget.uid}
|
|
@@ -2063,311 +645,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2063
645
|
?touched=${e.touched}
|
|
2064
646
|
?disabled=${e.disabled}
|
|
2065
647
|
?readonly=${e.readonly}
|
|
2066
|
-
aria-labelledby=${e.label?`${this.widget.uid}_label`:
|
|
2067
|
-
aria-describedby=${e.hint?`${this.widget.uid}_hint`:
|
|
648
|
+
aria-labelledby=${e.label?`${this.widget.uid}_label`:l.nothing}
|
|
649
|
+
aria-describedby=${e.hint?`${this.widget.uid}_hint`:l.nothing}
|
|
2068
650
|
@gui-range-change=${this._onRangeChange}
|
|
2069
651
|
@gui-update-items=${this._onUpdateItems}
|
|
2070
652
|
@gui-focus-change=${this._onFocusChange}
|
|
2071
653
|
@blur=${()=>this.adapter.onBlur()}
|
|
2072
654
|
@change=${this._valueChanged}
|
|
2073
655
|
>
|
|
2074
|
-
${i.map((
|
|
656
|
+
${i.map((s,n)=>{const o=this._range.start+n,u=e.value===s.value,h=this._focusedIndex===o,g=!!e.disabled||!!s.disabled,b=e.labelField??"label",_=s.template!==null&&typeof s.template=="object"&&b&&!e.itemRenderer?s.template[b]:s.template;return l.html`
|
|
2075
657
|
<div
|
|
2076
658
|
role="option"
|
|
2077
659
|
tabindex="-1"
|
|
2078
660
|
class="gui-list__item-wrapper"
|
|
2079
661
|
id="${this.widget.uid}-item-${o}"
|
|
2080
662
|
style="height: ${e.itemHeight||40}px"
|
|
2081
|
-
aria-selected=${
|
|
2082
|
-
aria-disabled=${
|
|
2083
|
-
@click=${()=>this._onClickItem(
|
|
663
|
+
aria-selected=${u?"true":"false"}
|
|
664
|
+
aria-disabled=${g?"true":"false"}
|
|
665
|
+
@click=${()=>this._onClickItem(s,o)}
|
|
2084
666
|
>
|
|
2085
|
-
${
|
|
667
|
+
${r({template:_,value:s.value,index:o,selected:u,disabled:g,focused:h})}
|
|
2086
668
|
</div>
|
|
2087
669
|
`})}
|
|
2088
670
|
</gui-list>
|
|
2089
671
|
</div>
|
|
2090
672
|
|
|
2091
|
-
${
|
|
673
|
+
${a?l.html`<gui-errors
|
|
2092
674
|
.uid=${this.widget.uid}
|
|
2093
675
|
.errors=${e.errors}
|
|
2094
676
|
.touched=${e.touched}
|
|
2095
|
-
></gui-errors>`:
|
|
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,
|
|
2097
|
-
${s}
|
|
2098
|
-
<span> / ${e.maxLength}</span>
|
|
2099
|
-
</div>`}const a={"min-height":`${e.minimumHeight}px`};return d.html`
|
|
2100
|
-
${oe(this.uid,e)}
|
|
2101
|
-
|
|
2102
|
-
<div
|
|
2103
|
-
class=${S.classMap({"gui-widget":!0,"gui-markdown--with-preview":this.splitViewActive})}
|
|
2104
|
-
>
|
|
2105
|
-
<nav
|
|
2106
|
-
class="gui-markdown__toolbar"
|
|
2107
|
-
role="toolbar"
|
|
2108
|
-
aria-label=${this.toolbarAriaLabel??"Text formatting"}
|
|
2109
|
-
>
|
|
2110
|
-
<ul role="presentation">
|
|
2111
|
-
${(this.tools??["H","B","I","S","Q","L","|","OL","UL"]).map(r=>this.renderToolbarItem(r))}
|
|
2112
|
-
<li role="presentation">
|
|
2113
|
-
<button
|
|
2114
|
-
type="button"
|
|
2115
|
-
class=${S.classMap({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--active":this.splitViewActive})}
|
|
2116
|
-
?disabled=${this.disabled}
|
|
2117
|
-
aria-label=${this.splitViewTitle??"Split View"}
|
|
2118
|
-
aria-pressed=${this.splitViewActive?"true":"false"}
|
|
2119
|
-
@click=${this.splitView}
|
|
2120
|
-
title=${this.splitViewTitle??"Split View"}
|
|
2121
|
-
>
|
|
2122
|
-
<svg
|
|
2123
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2124
|
-
width="20"
|
|
2125
|
-
height="20"
|
|
2126
|
-
viewBox="0 0 256 256"
|
|
2127
|
-
aria-hidden="true"
|
|
2128
|
-
>
|
|
2129
|
-
<path
|
|
2130
|
-
d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h64V200H56ZM200,200H136V56h64V200Z"
|
|
2131
|
-
></path>
|
|
2132
|
-
</svg>
|
|
2133
|
-
</button>
|
|
2134
|
-
</li>
|
|
2135
|
-
</ul>
|
|
2136
|
-
</nav>
|
|
2137
|
-
|
|
2138
|
-
<div class="gui-markdown__container">
|
|
2139
|
-
<textarea
|
|
2140
|
-
id=${ma.ifDefined(this.uid)}
|
|
2141
|
-
class=${S.classMap(t)}
|
|
2142
|
-
style=${Dt.styleMap(a)}
|
|
2143
|
-
?required=${e.required}
|
|
2144
|
-
?disabled=${e.disabled}
|
|
2145
|
-
?readonly=${e.readonly}
|
|
2146
|
-
placeholder=${ma.ifDefined(e.placeholder)}
|
|
2147
|
-
autocomplete=${this.autocomplete||d.nothing}
|
|
2148
|
-
.value=${this.value||""}
|
|
2149
|
-
@input=${this.valueChanged}
|
|
2150
|
-
@keyup=${this.detectFormats}
|
|
2151
|
-
@mouseup=${this.detectFormats}
|
|
2152
|
-
@blur=${this.onBlur}
|
|
2153
|
-
></textarea>
|
|
2154
|
-
|
|
2155
|
-
${this.splitViewActive?d.html`
|
|
2156
|
-
<section
|
|
2157
|
-
data-cy=${ma.ifDefined(this.uid?`${this.uid}_markdown`:d.nothing)}
|
|
2158
|
-
class="gui-markdown__preview"
|
|
2159
|
-
style=${Dt.styleMap(a)}
|
|
2160
|
-
>
|
|
2161
|
-
<gui-markdown-text
|
|
2162
|
-
.md=${this.value||""}
|
|
2163
|
-
.dependencies=${this.dependencies}
|
|
2164
|
-
></gui-markdown-text>
|
|
2165
|
-
</section>
|
|
2166
|
-
`:d.nothing}
|
|
2167
|
-
</div>
|
|
2168
|
-
</div>
|
|
2169
|
-
|
|
2170
|
-
<div class="gui-markdown--validation">
|
|
2171
|
-
<div>${j(this.uid,e)}</div>
|
|
2172
|
-
${i}
|
|
2173
|
-
</div>
|
|
2174
|
-
`}recalculateAutoGrow(){if(!this.autoGrow)return;const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const t=window.getComputedStyle(e),i=parseFloat(t.paddingTop),a=parseFloat(t.paddingBottom),r=i+a;e.style.height="auto",e.style.height=`${Math.max(this.minimumHeight??120,e.scrollHeight-r)}px`}splitView(){this.disabled||(this.splitViewActive=!this.splitViewActive)}renderToolbarItem(e){switch(e){case"H":return d.html`<li role="presentation">
|
|
2175
|
-
<button
|
|
2176
|
-
type="button"
|
|
2177
|
-
class=${this.toolbarBtnClass("heading")}
|
|
2178
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2179
|
-
aria-label=${this.headingTitle??"Heading"}
|
|
2180
|
-
aria-pressed=${this.activeFormats.heading?"true":"false"}
|
|
2181
|
-
@click=${this.applyFormat("# ","","heading")}
|
|
2182
|
-
title=${this.headingTitle??"Heading"}
|
|
2183
|
-
>
|
|
2184
|
-
<svg
|
|
2185
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2186
|
-
width="20"
|
|
2187
|
-
height="20"
|
|
2188
|
-
viewBox="0 0 256 256"
|
|
2189
|
-
aria-hidden="true"
|
|
2190
|
-
>
|
|
2191
|
-
<path
|
|
2192
|
-
d="M212,56V200a12,12,0,0,1-24,0V140H68v60a12,12,0,0,1-24,0V56a12,12,0,0,1,24,0v60H188V56a12,12,0,0,1,24,0Z"
|
|
2193
|
-
></path>
|
|
2194
|
-
</svg>
|
|
2195
|
-
</button>
|
|
2196
|
-
</li>`;case"B":return d.html`<li role="presentation">
|
|
2197
|
-
<button
|
|
2198
|
-
type="button"
|
|
2199
|
-
class=${this.toolbarBtnClass("bold")}
|
|
2200
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2201
|
-
aria-label=${this.boldTitle??"Bold"}
|
|
2202
|
-
aria-pressed=${this.activeFormats.bold?"true":"false"}
|
|
2203
|
-
@click=${this.applyFormat("**","**","bold")}
|
|
2204
|
-
title=${this.boldTitle??"Bold"}
|
|
2205
|
-
>
|
|
2206
|
-
<svg
|
|
2207
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2208
|
-
width="20"
|
|
2209
|
-
height="20"
|
|
2210
|
-
viewBox="0 0 256 256"
|
|
2211
|
-
aria-hidden="true"
|
|
2212
|
-
>
|
|
2213
|
-
<path
|
|
2214
|
-
d="M185.08,114.46A48,48,0,0,0,148,36H80A12,12,0,0,0,68,48V200a12,12,0,0,0,12,12h80a52,52,0,0,0,25.08-97.54ZM92,60h56a24,24,0,0,1,0,48H92Zm68,128H92V132h68a28,28,0,0,1,0,56Z"
|
|
2215
|
-
></path>
|
|
2216
|
-
</svg>
|
|
2217
|
-
</button>
|
|
2218
|
-
</li>`;case"I":return d.html`<li role="presentation">
|
|
2219
|
-
<button
|
|
2220
|
-
type="button"
|
|
2221
|
-
class=${this.toolbarBtnClass("italic")}
|
|
2222
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2223
|
-
aria-label=${this.italicTitle??"Italic"}
|
|
2224
|
-
aria-pressed=${this.activeFormats.italic?"true":"false"}
|
|
2225
|
-
@click=${this.applyFormat("_","_","italic")}
|
|
2226
|
-
title=${this.italicTitle??"Italic"}
|
|
2227
|
-
>
|
|
2228
|
-
<svg
|
|
2229
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2230
|
-
width="20"
|
|
2231
|
-
height="20"
|
|
2232
|
-
viewBox="0 0 256 256"
|
|
2233
|
-
aria-hidden="true"
|
|
2234
|
-
>
|
|
2235
|
-
<path
|
|
2236
|
-
d="M204,56a12,12,0,0,1-12,12H160.65l-40,120H144a12,12,0,0,1,0,24H64a12,12,0,0,1,0-24H95.35l40-120H112a12,12,0,0,1,0-24h80A12,12,0,0,1,204,56Z"
|
|
2237
|
-
></path>
|
|
2238
|
-
</svg>
|
|
2239
|
-
</button>
|
|
2240
|
-
</li>`;case"S":return d.html`<li role="presentation">
|
|
2241
|
-
<button
|
|
2242
|
-
type="button"
|
|
2243
|
-
class=${this.toolbarBtnClass("strikethrough")}
|
|
2244
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2245
|
-
aria-label=${this.strikethroughTitle??"Strikethrough"}
|
|
2246
|
-
aria-pressed=${this.activeFormats.strikethrough?"true":"false"}
|
|
2247
|
-
@click=${this.applyFormat("~~","~~","strikethrough")}
|
|
2248
|
-
title=${this.strikethroughTitle??"Strikethrough"}
|
|
2249
|
-
>
|
|
2250
|
-
<svg
|
|
2251
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2252
|
-
width="20"
|
|
2253
|
-
height="20"
|
|
2254
|
-
viewBox="0 0 256 256"
|
|
2255
|
-
aria-hidden="true"
|
|
2256
|
-
>
|
|
2257
|
-
<path
|
|
2258
|
-
d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"
|
|
2259
|
-
></path>
|
|
2260
|
-
</svg>
|
|
2261
|
-
</button>
|
|
2262
|
-
</li>`;case"Q":return d.html`<li role="presentation">
|
|
2263
|
-
<button
|
|
2264
|
-
type="button"
|
|
2265
|
-
class=${this.toolbarBtnClass("quote")}
|
|
2266
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2267
|
-
aria-label=${this.quoteTitle??"Quote"}
|
|
2268
|
-
aria-pressed=${this.activeFormats.quote?"true":"false"}
|
|
2269
|
-
@click=${this.applyFormat("> ","","quote")}
|
|
2270
|
-
title=${this.quoteTitle??"Quote"}
|
|
2271
|
-
>
|
|
2272
|
-
<svg
|
|
2273
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2274
|
-
width="20"
|
|
2275
|
-
height="20"
|
|
2276
|
-
viewBox="0 0 256 256"
|
|
2277
|
-
aria-hidden="true"
|
|
2278
|
-
>
|
|
2279
|
-
<path
|
|
2280
|
-
d="M100,52H40A20,20,0,0,0,20,72v64a20,20,0,0,0,20,20H96v4a28,28,0,0,1-28,28,12,12,0,0,0,0,24,52.06,52.06,0,0,0,52-52V72A20,20,0,0,0,100,52Zm-4,80H44V76H96ZM216,52H156a20,20,0,0,0-20,20v64a20,20,0,0,0,20,20h56v4a28,28,0,0,1-28,28,12,12,0,0,0,0,24,52.06,52.06,0,0,0,52-52V72A20,20,0,0,0,216,52Zm-4,80H160V76h52Z"
|
|
2281
|
-
></path>
|
|
2282
|
-
</svg>
|
|
2283
|
-
</button>
|
|
2284
|
-
</li>`;case"L":return d.html`<li role="presentation">
|
|
2285
|
-
<button
|
|
2286
|
-
type="button"
|
|
2287
|
-
class=${this.toolbarBtnClass("link")}
|
|
2288
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2289
|
-
aria-label=${this.linkTitle??"Link"}
|
|
2290
|
-
aria-pressed=${this.activeFormats.link?"true":"false"}
|
|
2291
|
-
@click=${this.applyFormat("[","](url)","link")}
|
|
2292
|
-
title=${this.linkTitle??"Link"}
|
|
2293
|
-
>
|
|
2294
|
-
<svg
|
|
2295
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2296
|
-
width="20"
|
|
2297
|
-
height="20"
|
|
2298
|
-
viewBox="0 0 256 256"
|
|
2299
|
-
aria-hidden="true"
|
|
2300
|
-
>
|
|
2301
|
-
<path
|
|
2302
|
-
d="M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z"
|
|
2303
|
-
></path>
|
|
2304
|
-
</svg>
|
|
2305
|
-
</button>
|
|
2306
|
-
</li>`;case"OL":return d.html`<li role="presentation">
|
|
2307
|
-
<button
|
|
2308
|
-
type="button"
|
|
2309
|
-
class=${this.toolbarBtnClass("orderedList")}
|
|
2310
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2311
|
-
aria-label=${this.orderedListTitle??"Ordered List"}
|
|
2312
|
-
aria-pressed=${this.activeFormats.orderedList?"true":"false"}
|
|
2313
|
-
@click=${this.applyFormat("1. ","","orderedList")}
|
|
2314
|
-
title=${this.orderedListTitle??"Ordered List"}
|
|
2315
|
-
>
|
|
2316
|
-
<svg
|
|
2317
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2318
|
-
width="20"
|
|
2319
|
-
height="20"
|
|
2320
|
-
viewBox="0 0 256 256"
|
|
2321
|
-
aria-hidden="true"
|
|
2322
|
-
>
|
|
2323
|
-
<path
|
|
2324
|
-
d="M228,128a12,12,0,0,1-12,12H116a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128ZM116,76H216a12,12,0,0,0,0-24H116a12,12,0,0,0,0,24ZM216,180H116a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,59.31V104a12,12,0,0,0,24,0V40A12,12,0,0,0,50.64,29.27l-16,8a12,12,0,0,0,9.36,22Zm39.73,96.86a27.7,27.7,0,0,0-11.2-18.63A28.89,28.89,0,0,0,32.9,143a27.71,27.71,0,0,0-4.17,7.54,12,12,0,0,0,22.55,8.21,4,4,0,0,1,.58-1,4.78,4.78,0,0,1,6.5-.82,3.82,3.82,0,0,1,1.61,2.6,3.63,3.63,0,0,1-.77,2.77l-.13.17L30.39,200.82A12,12,0,0,0,40,220H72a12,12,0,0,0,0-24H64l14.28-19.11A27.48,27.48,0,0,0,83.73,156.17Z"
|
|
2325
|
-
></path>
|
|
2326
|
-
</svg>
|
|
2327
|
-
</button>
|
|
2328
|
-
</li>`;case"UL":return d.html`<li role="presentation">
|
|
2329
|
-
<button
|
|
2330
|
-
type="button"
|
|
2331
|
-
class=${this.toolbarBtnClass("unorderedList")}
|
|
2332
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2333
|
-
aria-label=${this.unorderedListTitle??"Unordered List"}
|
|
2334
|
-
aria-pressed=${this.activeFormats.unorderedList?"true":"false"}
|
|
2335
|
-
@click=${this.applyFormat("- ","","unorderedList")}
|
|
2336
|
-
title=${this.unorderedListTitle??"Unordered List"}
|
|
2337
|
-
>
|
|
2338
|
-
<svg
|
|
2339
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2340
|
-
width="20"
|
|
2341
|
-
height="20"
|
|
2342
|
-
viewBox="0 0 256 256"
|
|
2343
|
-
aria-hidden="true"
|
|
2344
|
-
>
|
|
2345
|
-
<path
|
|
2346
|
-
d="M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z"
|
|
2347
|
-
></path>
|
|
2348
|
-
</svg>
|
|
2349
|
-
</button>
|
|
2350
|
-
</li>`;case"|":return d.html`<li role="presentation">
|
|
2351
|
-
<span class="gui-markdown__toolbar-separator">
|
|
2352
|
-
<svg
|
|
2353
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2354
|
-
width="20"
|
|
2355
|
-
height="20"
|
|
2356
|
-
viewBox="0 0 256 256"
|
|
2357
|
-
aria-hidden="true"
|
|
2358
|
-
>
|
|
2359
|
-
<path d="M140,24V232a12,12,0,0,1-24,0V24a12,12,0,0,1,24,0Z"></path>
|
|
2360
|
-
</svg>
|
|
2361
|
-
</span>
|
|
2362
|
-
</li>`;default:return d.nothing}}toolbarBtnClass(e){return S.classMap({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--disabled":this.disabled===!0||this.readOnly===!0,"gui-markdown__toolbar-button--active":!!e&&!!this.activeFormats[e]})}detectFormats(){const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const{selectionStart:t,value:i}=e,a=i.lastIndexOf(`
|
|
2363
|
-
`,t-1)+1,r=i.indexOf(`
|
|
2364
|
-
`,t),s=i.substring(a,r===-1?i.length:r);this.activeFormats={heading:/^#{1,6}\s/.test(s),bold:this.isInsideInlineFormat(i,t,"**"),italic:this.isInsideInlineFormat(i,t,"_"),strikethrough:this.isInsideInlineFormat(i,t,"~~"),quote:s.startsWith("> "),link:this.isInsideLink(i,t),orderedList:/^\d+\.\s/.test(s),unorderedList:s.startsWith("- ")}}isInsideInlineFormat(e,t,i){const a=e.lastIndexOf(`
|
|
2365
|
-
`,t-1)+1,r=e.indexOf(`
|
|
2366
|
-
`,t),s=e.substring(a,r===-1?e.length:r),o=t-a;let l=0;for(;l<s.length;){const u=s.indexOf(i,l);if(u===-1)break;const p=s.indexOf(i,u+i.length);if(p===-1)break;if(o>=u&&o<=p+i.length)return!0;l=p+i.length}return!1}isInsideLink(e,t){const i=e.lastIndexOf(`
|
|
2367
|
-
`,t-1)+1,a=e.indexOf(`
|
|
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(`
|
|
2369
|
-
`,r-1)+1,l=s.indexOf(`
|
|
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`
|
|
677
|
+
></gui-errors>`:l.nothing}
|
|
678
|
+
`}_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,a){this.adapter.templateData.disabled||e.disabled||(this.adapter.valueChanged(e.value),this._focusedIndex=a,this._guiListRef&&typeof this._guiListRef.focusItemAtIndex=="function"&&this._guiListRef.focusItemAtIndex(a))}_valueChanged(e){this.adapter.templateData.readonly||this.adapter.valueChanged(e.detail.value)}}Y([c.consume({context:d.formContext}),m.property({attribute:!1})],R.prototype,"formContext"),Y([c.provide({context:d.inputContext})],R.prototype,"adapter"),Y([m.state()],R.prototype,"_range"),Y([m.state()],R.prototype,"_listItems"),Y([m.state()],R.prototype,"_focusedIndex"),Y([m.query("gui-list")],R.prototype,"_guiListRef"),f.safeDefine("gui-list-input",R);const Vn=Object.freeze(Object.defineProperty({__proto__:null,ListElement:R},Symbol.toStringTag,{value:"Module"}));var Un=Object.defineProperty,ba=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Un(e,a,r),r};class Ae extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2371
679
|
<gui-markdown
|
|
2372
680
|
.uid=${this.widget.uid}
|
|
2373
681
|
.label=${this.adapter.templateData.label}
|
|
@@ -2400,41 +708,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2400
708
|
@input=${this.valueChanged}
|
|
2401
709
|
@blur=${()=>this.adapter.onBlur()}
|
|
2402
710
|
></gui-markdown>
|
|
2403
|
-
`}valueChanged(e){const
|
|
2404
|
-
${oe(this.uid,e)}
|
|
2405
|
-
|
|
2406
|
-
<div class="gui-widget">
|
|
2407
|
-
<input
|
|
2408
|
-
type=${this.showPassword?"text":"password"}
|
|
2409
|
-
id=${this.uid}
|
|
2410
|
-
data-cy=${`${this.uid}_password`}
|
|
2411
|
-
class=${S.classMap(i)}
|
|
2412
|
-
value=${this.value}
|
|
2413
|
-
?required=${this.required}
|
|
2414
|
-
?disabled=${this.disabled}
|
|
2415
|
-
?readonly=${this.readOnly}
|
|
2416
|
-
placeholder=${this.placeholder||d.nothing}
|
|
2417
|
-
autocomplete=${this.autocomplete||d.nothing}
|
|
2418
|
-
@input=${this.valueChanged}
|
|
2419
|
-
@blur=${this.onBlur}
|
|
2420
|
-
/>
|
|
2421
|
-
${t.html}
|
|
2422
|
-
<button
|
|
2423
|
-
class=${`gui-password__toggle gui-widget-icon ${this.showPassword&&e.showPasswordIcon?e.showPasswordIcon:""} ${!this.showPassword&&e.hidePasswordIcon?e.hidePasswordIcon:""}`}
|
|
2424
|
-
data-icon=${this.showPassword?e.showPasswordIcon:e.hidePasswordIcon}
|
|
2425
|
-
type="button"
|
|
2426
|
-
?disabled=${this.disabled}
|
|
2427
|
-
aria-label=${this.showPassword?e.hidePasswordLabel??"Hide password":e.showPasswordLabel??"Show password"}
|
|
2428
|
-
@click=${()=>this.showPassword=!this.showPassword}
|
|
2429
|
-
>
|
|
2430
|
-
${e.showPasswordIcon||e.hidePasswordIcon?d.nothing:d.html`<span aria-hidden="true"
|
|
2431
|
-
>${this.showPassword?e.hidePasswordLabel??"Hide":e.showPasswordLabel??"Show"}</span
|
|
2432
|
-
>`}
|
|
2433
|
-
</button>
|
|
2434
|
-
</div>
|
|
2435
|
-
|
|
2436
|
-
${j(this.uid,e)}
|
|
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`
|
|
711
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}ba([c.consume({context:d.formContext}),m.property({attribute:!1})],Ae.prototype,"formContext"),ba([c.provide({context:d.inputContext})],Ae.prototype,"adapter"),f.safeDefine("gui-markdown-input",Ae);const Bn=Object.freeze(Object.defineProperty({__proto__:null,MarkdownElement:Ae},Symbol.toStringTag,{value:"Module"}));var Wn=Object.defineProperty,$a=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Wn(e,a,r),r};class Pe extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2438
712
|
<gui-password
|
|
2439
713
|
.uid=${this.widget.uid}
|
|
2440
714
|
.label=${this.adapter.templateData.label}
|
|
@@ -2455,29 +729,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2455
729
|
@input=${this.valueChanged}
|
|
2456
730
|
@blur=${()=>this.adapter.onBlur()}
|
|
2457
731
|
></gui-password>
|
|
2458
|
-
`}valueChanged(e){const
|
|
2459
|
-
${oe(this.uid,e)}
|
|
2460
|
-
|
|
2461
|
-
<div class="gui-widget">
|
|
2462
|
-
<input
|
|
2463
|
-
type="text"
|
|
2464
|
-
id=${this.uid}
|
|
2465
|
-
data-cy=${`${this.uid}_textinput`}
|
|
2466
|
-
class=${S.classMap(i)}
|
|
2467
|
-
value=${this.value}
|
|
2468
|
-
?required=${this.required}
|
|
2469
|
-
?disabled=${this.disabled}
|
|
2470
|
-
?readonly=${this.readOnly}
|
|
2471
|
-
placeholder=${this.placeholder||d.nothing}
|
|
2472
|
-
autocomplete=${this.autocomplete||d.nothing}
|
|
2473
|
-
@input=${this.valueChanged}
|
|
2474
|
-
@blur=${this.onBlur}
|
|
2475
|
-
/>
|
|
2476
|
-
${t.html}
|
|
2477
|
-
</div>
|
|
2478
|
-
|
|
2479
|
-
${j(this.uid,e)}
|
|
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`
|
|
732
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}$a([c.consume({context:d.formContext}),m.property({attribute:!1})],Pe.prototype,"formContext"),$a([c.provide({context:d.inputContext})],Pe.prototype,"adapter"),f.safeDefine("gui-password-input",Pe);const Jn=Object.freeze(Object.defineProperty({__proto__:null,PasswordElement:Pe},Symbol.toStringTag,{value:"Module"}));var Gn=Object.defineProperty,va=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Gn(e,a,r),r};class Ie extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2481
733
|
<gui-textinput
|
|
2482
734
|
.uid=${this.widget.uid}
|
|
2483
735
|
.label=${this.adapter.templateData.label}
|
|
@@ -2494,9 +746,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2494
746
|
@input=${this.valueChanged}
|
|
2495
747
|
@blur=${()=>this.adapter.onBlur()}
|
|
2496
748
|
></gui-textinput>
|
|
2497
|
-
`}valueChanged(e){const
|
|
749
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}va([c.consume({context:d.formContext}),m.property({attribute:!1})],Ie.prototype,"formContext"),va([c.provide({context:d.inputContext})],Ie.prototype,"adapter"),f.safeDefine("gui-textinput-input",Ie);const Yn=Object.freeze(Object.defineProperty({__proto__:null,TextinputElement:Ie},Symbol.toStringTag,{value:"Module"}));var Hn=Object.defineProperty,_a=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Hn(e,a,r),r};class ze extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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=X.addIcon("time",this.adapter.templateData);return l.html`
|
|
2498
750
|
<gui-time
|
|
2499
|
-
class=${
|
|
751
|
+
class=${O.classMap(e.widgetClasses)}
|
|
2500
752
|
.uid=${this.widget.uid}
|
|
2501
753
|
.label=${this.adapter.templateData.label}
|
|
2502
754
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -2517,11 +769,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2517
769
|
.maxTime=${this.adapter.templateData.maxTime}
|
|
2518
770
|
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
2519
771
|
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
772
|
+
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
2520
773
|
@inputError=${this.onInputError}
|
|
2521
774
|
@blur=${()=>this.adapter.onBlur()}
|
|
2522
775
|
@change=${this.valueChanged}
|
|
2523
776
|
></gui-time>
|
|
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())}}
|
|
777
|
+
`}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())}}_a([c.consume({context:d.formContext}),m.property({attribute:!1})],ze.prototype,"formContext"),_a([c.provide({context:d.inputContext})],ze.prototype,"adapter"),f.safeDefine("gui-time-input",ze);const Kn=Object.freeze(Object.defineProperty({__proto__:null,TimeElement:ze},Symbol.toStringTag,{value:"Module"}));var Xn=Object.defineProperty,ya=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Xn(e,a,r),r};class Me extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
2525
778
|
<gui-time-picker
|
|
2526
779
|
.uid=${this.widget.uid}
|
|
2527
780
|
.label=${e.label}
|
|
@@ -2550,13 +803,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2550
803
|
.maxTimeMessage=${e.maxTimeMessage}
|
|
2551
804
|
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
2552
805
|
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
806
|
+
.incompleteMessage=${e.incompleteMessage}
|
|
2553
807
|
@inputError=${this.onInputError}
|
|
2554
808
|
@blur=${()=>this.adapter.onBlur()}
|
|
2555
809
|
@change=${this.valueChanged}
|
|
2556
810
|
></gui-time-picker>
|
|
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())}}
|
|
811
|
+
`}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())}}ya([c.consume({context:d.formContext}),m.property({attribute:!1})],Me.prototype,"formContext"),ya([c.provide({context:d.inputContext})],Me.prototype,"adapter"),f.safeDefine("gui-time-picker-input",Me);const Qn=Object.freeze(Object.defineProperty({__proto__:null,TimePickerElement:Me},Symbol.toStringTag,{value:"Module"}));var eo=Object.defineProperty,Da=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&eo(e,a,r),r};class Ee extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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=X.addIcon("date-time",this.adapter.templateData);return l.html`
|
|
2558
812
|
<gui-date-time
|
|
2559
|
-
class=${
|
|
813
|
+
class=${O.classMap(e.widgetClasses)}
|
|
2560
814
|
.uid=${this.widget.uid}
|
|
2561
815
|
.label=${this.adapter.templateData.label}
|
|
2562
816
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -2583,40 +837,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2583
837
|
.maxDateMessage=${this.adapter.templateData.maxDateMessage}
|
|
2584
838
|
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
2585
839
|
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
840
|
+
.incompleteMessage=${this.adapter.templateData.incompleteMessage}
|
|
2586
841
|
.hourFormat=${this.adapter.templateData.hourFormat}
|
|
2587
842
|
.minuteStep=${this.adapter.templateData.minuteStep}
|
|
2588
843
|
@inputError=${this.onInputError}
|
|
2589
844
|
@blur=${()=>this.adapter.onBlur()}
|
|
2590
845
|
@change=${this.valueChanged}
|
|
2591
846
|
></gui-date-time>
|
|
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())}}
|
|
2593
|
-
${s}
|
|
2594
|
-
<span> / ${e.maxLength}</span>
|
|
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`
|
|
2596
|
-
${oe(this.uid,e)}
|
|
2597
|
-
|
|
2598
|
-
<div class="gui-widget">
|
|
2599
|
-
<textarea
|
|
2600
|
-
id=${this.uid}
|
|
2601
|
-
data-cy=${`${this.uid}_textarea`}
|
|
2602
|
-
class="gui-widget-input"
|
|
2603
|
-
style=${Dt.styleMap(i)}
|
|
2604
|
-
?required=${e.required}
|
|
2605
|
-
?disabled=${e.disabled}
|
|
2606
|
-
?readonly=${e.readonly}
|
|
2607
|
-
placeholder=${e.placeholder||d.nothing}
|
|
2608
|
-
autocomplete=${this.autocomplete||d.nothing}
|
|
2609
|
-
.value=${this.value||""}
|
|
2610
|
-
@input=${this.valueChanged}
|
|
2611
|
-
@blur=${this.onBlur}
|
|
2612
|
-
></textarea>
|
|
2613
|
-
</div>
|
|
2614
|
-
|
|
2615
|
-
<div class="gui-textarea--validation">
|
|
2616
|
-
<div>${j(this.uid,e)}</div>
|
|
2617
|
-
${t}
|
|
2618
|
-
</div>
|
|
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`
|
|
847
|
+
`}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())}}Da([c.consume({context:d.formContext}),m.property({attribute:!1})],Ee.prototype,"formContext"),Da([c.provide({context:d.inputContext})],Ee.prototype,"adapter"),f.safeDefine("gui-date-time-input",Ee);const to=Object.freeze(Object.defineProperty({__proto__:null,DateTimeElement:Ee},Symbol.toStringTag,{value:"Module"}));var ao=Object.defineProperty,wa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&ao(e,a,r),r};class Se extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2620
848
|
<gui-textarea
|
|
2621
849
|
.uid=${this.widget.uid}
|
|
2622
850
|
.label=${this.adapter.templateData.label}
|
|
@@ -2636,40 +864,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2636
864
|
@input=${this.valueChanged}
|
|
2637
865
|
@blur=${()=>this.adapter.onBlur()}
|
|
2638
866
|
></gui-textarea>
|
|
2639
|
-
`}valueChanged(e){const
|
|
2640
|
-
<label
|
|
2641
|
-
class="gui-label"
|
|
2642
|
-
for=${this.uid}
|
|
2643
|
-
data-cy=${`${this.uid}_label`}
|
|
2644
|
-
id=${`${this.uid}_label`}
|
|
2645
|
-
>
|
|
2646
|
-
<div class="gui-widget gui-widget--horizontal gui-toggle--switch">
|
|
2647
|
-
<input
|
|
2648
|
-
type="checkbox"
|
|
2649
|
-
role="switch"
|
|
2650
|
-
id=${this.uid}
|
|
2651
|
-
data-cy=${`${this.uid}_toggle`}
|
|
2652
|
-
?checked=${e.value}
|
|
2653
|
-
?required=${e.required}
|
|
2654
|
-
?disabled=${e.disabled||e.readonly}
|
|
2655
|
-
@change=${this.valueChanged}
|
|
2656
|
-
@blur=${this.onBlur}
|
|
2657
|
-
/>
|
|
2658
|
-
|
|
2659
|
-
<span class="gui-toggle--slider" role="presentation"></span>
|
|
2660
|
-
</div>
|
|
2661
|
-
|
|
2662
|
-
<span class="gui-label__container">
|
|
2663
|
-
<span class="gui-label__text"
|
|
2664
|
-
>${e.label}${Xi(e.required)}</span
|
|
2665
|
-
>
|
|
2666
|
-
</span>
|
|
2667
|
-
</label>
|
|
2668
|
-
|
|
2669
|
-
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
2670
|
-
${e.hint??d.nothing} ${j(this.uid,e)}
|
|
2671
|
-
</div>
|
|
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`
|
|
867
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}wa([c.consume({context:d.formContext}),m.property({attribute:!1})],Se.prototype,"formContext"),wa([c.provide({context:d.inputContext})],Se.prototype,"adapter"),f.safeDefine("gui-textarea-input",Se);const ro=Object.freeze(Object.defineProperty({__proto__:null,TextareaElement:Se},Symbol.toStringTag,{value:"Module"}));var io=Object.defineProperty,Ca=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&io(e,a,r),r};class Oe extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2673
868
|
<gui-toggle
|
|
2674
869
|
.uid=${this.widget.uid}
|
|
2675
870
|
.label=${this.adapter.templateData.label}
|
|
@@ -2684,37 +879,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2684
879
|
@change=${this.valueChanged}
|
|
2685
880
|
@blur=${()=>this.adapter.onBlur()}
|
|
2686
881
|
></gui-toggle>
|
|
2687
|
-
`}valueChanged(e){const
|
|
2688
|
-
<label
|
|
2689
|
-
class="gui-label"
|
|
2690
|
-
for=${this.uid}
|
|
2691
|
-
data-cy=${`${this.uid}_label`}
|
|
2692
|
-
id=${`${this.uid}_label`}
|
|
2693
|
-
>
|
|
2694
|
-
<div class="gui-widget gui-widget--horizontal">
|
|
2695
|
-
<input
|
|
2696
|
-
type="checkbox"
|
|
2697
|
-
id=${this.uid}
|
|
2698
|
-
data-cy=${`${this.uid}_checkbox`}
|
|
2699
|
-
?checked=${this.value}
|
|
2700
|
-
?required=${this.required}
|
|
2701
|
-
?disabled=${this.disabled||this.readOnly}
|
|
2702
|
-
@change=${this.valueChanged}
|
|
2703
|
-
@blur=${this.onBlur}
|
|
2704
|
-
/>
|
|
2705
|
-
</div>
|
|
2706
|
-
|
|
2707
|
-
<span class="gui-label__container">
|
|
2708
|
-
<span class="gui-label__text"
|
|
2709
|
-
>${e.label}${Xi(e.required)}</span
|
|
2710
|
-
>
|
|
2711
|
-
</span>
|
|
2712
|
-
</label>
|
|
2713
|
-
|
|
2714
|
-
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
2715
|
-
${e.hint??d.nothing} ${j(this.uid,e)}
|
|
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 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`
|
|
882
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Ca([c.consume({context:d.formContext}),m.property({attribute:!1})],Oe.prototype,"formContext"),Ca([c.provide({context:d.inputContext})],Oe.prototype,"adapter"),f.safeDefine("gui-toggle-input",Oe);const so=Object.freeze(Object.defineProperty({__proto__:null,ToggleElement:Oe},Symbol.toStringTag,{value:"Module"}));var no=Object.defineProperty,xa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&no(e,a,r),r};class Re extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2718
883
|
<gui-checkbox
|
|
2719
884
|
.uid=${this.widget.uid}
|
|
2720
885
|
.label=${this.adapter.templateData.label}
|
|
@@ -2729,59 +894,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2729
894
|
@change=${this.valueChanged}
|
|
2730
895
|
@blur=${()=>this.adapter.onBlur()}
|
|
2731
896
|
></gui-checkbox>
|
|
2732
|
-
`}valueChanged(e){const
|
|
2733
|
-
${oe(this.uid,i)}
|
|
2734
|
-
|
|
2735
|
-
<div class="gui-widget">
|
|
2736
|
-
<input
|
|
2737
|
-
type="number"
|
|
2738
|
-
inputmode="decimal"
|
|
2739
|
-
id=${this.uid}
|
|
2740
|
-
data-cy=${`${this.uid}_number`}
|
|
2741
|
-
class="gui-widget-input"
|
|
2742
|
-
style=${Dt.styleMap(t)}
|
|
2743
|
-
value=${this.value}
|
|
2744
|
-
?required=${this.required}
|
|
2745
|
-
?disabled=${this.disabled}
|
|
2746
|
-
?readonly=${this.readOnly}
|
|
2747
|
-
step=${typeof this.step=="number"?this.step:d.nothing}
|
|
2748
|
-
min=${Number(this.minimum)?this.minimum:d.nothing}
|
|
2749
|
-
max=${Number(this.maximum)?this.maximum:d.nothing}
|
|
2750
|
-
placeholder=${this.placeholder||d.nothing}
|
|
2751
|
-
autocomplete=${this.autocomplete||d.nothing}
|
|
2752
|
-
@input=${this.valueChanged}
|
|
2753
|
-
@beforeinput=${eo}
|
|
2754
|
-
@keydown=${this.keyDown}
|
|
2755
|
-
@blur=${this.onBlur}
|
|
2756
|
-
/>
|
|
2757
|
-
<span class="gui-number__decoration">
|
|
2758
|
-
<svg
|
|
2759
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2760
|
-
width="12"
|
|
2761
|
-
height="12"
|
|
2762
|
-
viewBox="0 0 256 256"
|
|
2763
|
-
aria-hidden="true"
|
|
2764
|
-
>
|
|
2765
|
-
<path
|
|
2766
|
-
d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"
|
|
2767
|
-
></path>
|
|
2768
|
-
</svg>
|
|
2769
|
-
<svg
|
|
2770
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2771
|
-
width="12"
|
|
2772
|
-
height="12"
|
|
2773
|
-
viewBox="0 0 256 256"
|
|
2774
|
-
aria-hidden="true"
|
|
2775
|
-
>
|
|
2776
|
-
<path
|
|
2777
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
2778
|
-
></path>
|
|
2779
|
-
</svg>
|
|
2780
|
-
</span>
|
|
2781
|
-
</div>
|
|
2782
|
-
|
|
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 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`
|
|
897
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}xa([c.consume({context:d.formContext}),m.property({attribute:!1})],Re.prototype,"formContext"),xa([c.provide({context:d.inputContext})],Re.prototype,"adapter"),f.safeDefine("gui-checkbox-input",Re);const oo=Object.freeze(Object.defineProperty({__proto__:null,CheckboxElement:Re},Symbol.toStringTag,{value:"Module"}));var lo=Object.defineProperty,ka=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&lo(e,a,r),r};class Fe extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2785
898
|
<gui-number
|
|
2786
899
|
.uid=${this.widget.uid}
|
|
2787
900
|
.label=${this.adapter.templateData.label}
|
|
@@ -2801,41 +914,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2801
914
|
@input=${this.valueChanged}
|
|
2802
915
|
@blur=${()=>this.adapter.onBlur()}
|
|
2803
916
|
></gui-number>
|
|
2804
|
-
`}valueChanged(e){const
|
|
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
|
-
<input
|
|
2807
|
-
type="radio"
|
|
2808
|
-
tabindex=${l?"0":"-1"}
|
|
2809
|
-
id=${`${this.uid}_${r}`}
|
|
2810
|
-
data-cy=${`${this.uid}_radiogroup_${r}`}
|
|
2811
|
-
name=${this.uid}
|
|
2812
|
-
value=${a.value}
|
|
2813
|
-
?checked=${s}
|
|
2814
|
-
?required=${e.required}
|
|
2815
|
-
?disabled=${e.disabled||e.readonly}
|
|
2816
|
-
@change=${this.valueChanged}
|
|
2817
|
-
@blur=${this.onBlur}
|
|
2818
|
-
/>
|
|
2819
|
-
${a.label}
|
|
2820
|
-
</label>`})}
|
|
2821
|
-
`;return d.html`
|
|
2822
|
-
${oe(this.uid,e,!1,void 0,!1)}
|
|
2823
|
-
|
|
2824
|
-
<div
|
|
2825
|
-
class="gui-widget${this.direction==="row"?" gui-widget--horizontal":""}"
|
|
2826
|
-
role="radiogroup"
|
|
2827
|
-
id=${this.uid}
|
|
2828
|
-
aria-labelledby=${e.label?`${this.uid}_label`:d.nothing}
|
|
2829
|
-
aria-describedby=${e.hint?`${this.uid}_hint`:d.nothing}
|
|
2830
|
-
aria-required=${this.required?"true":d.nothing}
|
|
2831
|
-
aria-invalid=${this.touched&&this.errors?.length?"true":d.nothing}
|
|
2832
|
-
aria-errormessage=${this.touched&&this.errors?.length?`${this.uid}_errors`:d.nothing}
|
|
2833
|
-
>
|
|
2834
|
-
${i}
|
|
2835
|
-
</div>
|
|
2836
|
-
|
|
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 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`
|
|
917
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}ka([c.consume({context:d.formContext}),m.property({attribute:!1})],Fe.prototype,"formContext"),ka([c.provide({context:d.inputContext})],Fe.prototype,"adapter"),f.safeDefine("gui-number-input",Fe);const uo=Object.freeze(Object.defineProperty({__proto__:null,NumberElement:Fe},Symbol.toStringTag,{value:"Module"}));var po=Object.defineProperty,Ta=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&po(e,a,r),r};class Ze extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2839
918
|
<gui-radiogroup
|
|
2840
919
|
.uid=${this.widget.uid}
|
|
2841
920
|
.label=${this.adapter.templateData.label}
|
|
@@ -2853,49 +932,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2853
932
|
@change=${this.valueChanged}
|
|
2854
933
|
@blur=${()=>this.adapter.onBlur()}
|
|
2855
934
|
></gui-radiogroup>
|
|
2856
|
-
`}valueChanged(e){const
|
|
2857
|
-
<option value="" disabled selected=${this.hasMatchingValue?d.nothing:""}>
|
|
2858
|
-
${this.placeholder??"Select an option"}
|
|
2859
|
-
</option>
|
|
2860
|
-
${qe.repeat(this.options||[],a=>a?.value,a=>d.html`<option
|
|
2861
|
-
value=${a.value}
|
|
2862
|
-
selected=${this.hasMatchingValue&&a.value===this.value?"":d.nothing}
|
|
2863
|
-
>
|
|
2864
|
-
${a.label}
|
|
2865
|
-
</option>`)}
|
|
2866
|
-
`;return d.html`
|
|
2867
|
-
${oe(this.uid,e)}
|
|
2868
|
-
|
|
2869
|
-
<div class="gui-widget">
|
|
2870
|
-
<select
|
|
2871
|
-
id=${this.uid}
|
|
2872
|
-
data-cy=${`${this.uid}_select`}
|
|
2873
|
-
class=${S.classMap({"gui-widget-input":!0,...t.widgetClasses})}
|
|
2874
|
-
?required=${e.required}
|
|
2875
|
-
?disabled=${e.disabled||e.readonly}
|
|
2876
|
-
autocomplete=${this.autocomplete||d.nothing}
|
|
2877
|
-
@change=${this.valueChanged}
|
|
2878
|
-
@blur=${this.onBlur}
|
|
2879
|
-
>
|
|
2880
|
-
${i}
|
|
2881
|
-
</select>
|
|
2882
|
-
<span class="gui-select__arrow"
|
|
2883
|
-
><svg
|
|
2884
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2885
|
-
width="16"
|
|
2886
|
-
height="16"
|
|
2887
|
-
viewBox="0 0 256 256"
|
|
2888
|
-
aria-hidden="true"
|
|
2889
|
-
>
|
|
2890
|
-
<path
|
|
2891
|
-
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
2892
|
-
></path></svg
|
|
2893
|
-
></span>
|
|
2894
|
-
${t.html}
|
|
2895
|
-
</div>
|
|
2896
|
-
|
|
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 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`
|
|
935
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Ta([c.consume({context:d.formContext}),m.property({attribute:!1})],Ze.prototype,"formContext"),Ta([c.provide({context:d.inputContext})],Ze.prototype,"adapter"),f.safeDefine("gui-radiogroup-input",Ze);const co=Object.freeze(Object.defineProperty({__proto__:null,RadiogroupElement:Ze},Symbol.toStringTag,{value:"Module"}));var ho=Object.defineProperty,La=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&ho(e,a,r),r};class je extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2899
936
|
<gui-select
|
|
2900
937
|
.uid=${this.widget.uid}
|
|
2901
938
|
.label=${this.adapter.templateData.label}
|
|
@@ -2917,59 +954,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2917
954
|
@inputError=${this.onInputError}
|
|
2918
955
|
@blur=${()=>this.adapter.onBlur()}
|
|
2919
956
|
></gui-select>
|
|
2920
|
-
`}valueChanged(e){const
|
|
2921
|
-
${this.label?oe(this.uid,t,!1,void 0,!1):d.nothing}
|
|
2922
|
-
|
|
2923
|
-
<div class="gui-widget">
|
|
2924
|
-
<div
|
|
2925
|
-
class=${S.classMap({"gui-widget-input":!0,"gui-tags-input":!0,"gui-tags-input--icon":!!this.icon})}
|
|
2926
|
-
role="group"
|
|
2927
|
-
aria-label=${this.label??"Tags input"}
|
|
2928
|
-
>
|
|
2929
|
-
${this.icon?d.html`<span
|
|
2930
|
-
class=${S.classMap(i)}
|
|
2931
|
-
data-icon=${this.icon}
|
|
2932
|
-
aria-hidden="true"
|
|
2933
|
-
></span>`:d.nothing}
|
|
2934
|
-
|
|
2935
|
-
<gui-pills
|
|
2936
|
-
class="gui-tags__pills"
|
|
2937
|
-
style=${Dt.styleMap(a.length?{}:{"min-width":0})}
|
|
2938
|
-
.uid=${this.uid}
|
|
2939
|
-
.toolbarAriaLabel=${"Selected tags"}
|
|
2940
|
-
.items=${a}
|
|
2941
|
-
.removable=${!0}
|
|
2942
|
-
.clickable=${!1}
|
|
2943
|
-
.bubble=${!0}
|
|
2944
|
-
.tabbable=${!1}
|
|
2945
|
-
?disabled=${this.disabled}
|
|
2946
|
-
?readonly=${this.readOnly}
|
|
2947
|
-
.removeAriaLabel=${this.getRemoveAriaLabel()}
|
|
2948
|
-
.removeIcon=${this.removeIcon}
|
|
2949
|
-
.compactAriaLabel=${`${e.length} tags`}
|
|
2950
|
-
@pillremove=${this.onPillRemove}
|
|
2951
|
-
@pillkeydown=${this.onPillKeydown}
|
|
2952
|
-
></gui-pills>
|
|
2953
|
-
|
|
2954
|
-
<input
|
|
2955
|
-
type="text"
|
|
2956
|
-
id=${this.uid}
|
|
2957
|
-
data-cy=${`${this.uid}_tags-input`}
|
|
2958
|
-
class="gui-tags__input"
|
|
2959
|
-
?disabled=${this.disabled}
|
|
2960
|
-
?readonly=${this.readOnly}
|
|
2961
|
-
placeholder=${this.placeholder||d.nothing}
|
|
2962
|
-
@keydown=${this.onInputKeydown}
|
|
2963
|
-
@blur=${this.onInputBlur}
|
|
2964
|
-
@paste=${this.onPaste}
|
|
2965
|
-
@change=${r=>r.stopPropagation()}
|
|
2966
|
-
/>
|
|
2967
|
-
</div>
|
|
2968
|
-
|
|
2969
|
-
${j(this.uid,t)}
|
|
2970
|
-
</div>
|
|
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 $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`
|
|
957
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}La([c.consume({context:d.formContext}),m.property({attribute:!1})],je.prototype,"formContext"),La([c.provide({context:d.inputContext})],je.prototype,"adapter"),f.safeDefine("gui-select-input",je);const mo=Object.freeze(Object.defineProperty({__proto__:null,SelectElement:je},Symbol.toStringTag,{value:"Module"}));var go=Object.defineProperty,Aa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&go(e,a,r),r};class qe extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(),l.html`
|
|
2973
958
|
<gui-tags
|
|
2974
959
|
.uid=${this.widget.uid}
|
|
2975
960
|
.label=${this.adapter.templateData.label}
|
|
@@ -2991,7 +976,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2991
976
|
@change=${this.valueChanged}
|
|
2992
977
|
@blur=${()=>this.adapter.onBlur()}
|
|
2993
978
|
></gui-tags>
|
|
2994
|
-
`}valueChanged(e){const
|
|
979
|
+
`}valueChanged(e){const a=e.detail.value;this.adapter.valueChanged(a)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Aa([c.consume({context:d.formContext}),m.property({attribute:!1})],qe.prototype,"formContext"),Aa([c.provide({context:d.inputContext})],qe.prototype,"adapter"),f.safeDefine("gui-tags-input",qe);const fo=Object.freeze(Object.defineProperty({__proto__:null,TagsElement:qe},Symbol.toStringTag,{value:"Module"}));var bo=Object.defineProperty,Ne=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&bo(e,a,r),r};let $o=0;const vo=()=>$o++;class H extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.InputWidgetAdapter,this.isFocused=!1,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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,a=e.touched&&e.errors&&e.errors.length>0;return l.html`
|
|
2995
980
|
<div
|
|
2996
981
|
id=${this.widget.uid}
|
|
2997
982
|
class=${`gui-repeater__main-card gui-repeater__card ${this.isFocused?"gui-repeater__card--focused":""}`}
|
|
@@ -3007,31 +992,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3007
992
|
.required=${e.validator?.required}
|
|
3008
993
|
.native=${!1}
|
|
3009
994
|
></gui-label>
|
|
3010
|
-
${e.value?
|
|
995
|
+
${e.value?V.repeat(e.value,i=>nt.getItemKey(i,vo),(i,r)=>l.html`
|
|
3011
996
|
<div class="gui-repeater__card">
|
|
3012
997
|
<div class="gui-repeater__card-header">
|
|
3013
|
-
${e.title?
|
|
3014
|
-
>${e.title} ${
|
|
3015
|
-
>`:
|
|
998
|
+
${e.title?l.html`<span class="gui-repeater__card-title"
|
|
999
|
+
>${e.title} ${r+1}</span
|
|
1000
|
+
>`:l.nothing}
|
|
3016
1001
|
<button
|
|
3017
1002
|
type="button"
|
|
3018
1003
|
tabindex="0"
|
|
3019
1004
|
class="gui-button gui-button--sm gui-repeater__remove-btn"
|
|
3020
|
-
@click=${()=>this.removeItem(
|
|
1005
|
+
@click=${()=>this.removeItem(r)}
|
|
3021
1006
|
>
|
|
3022
|
-
${e.removeButtonIcon?
|
|
1007
|
+
${e.removeButtonIcon?l.html`<span
|
|
3023
1008
|
class="gui-widget-icon gui-button-icon ${e.removeButtonIcon}"
|
|
3024
1009
|
data-icon=${e.removeButtonIcon}
|
|
3025
|
-
></span>`:
|
|
1010
|
+
></span>`:l.nothing}
|
|
3026
1011
|
${e.removeLabel??"Remove"}
|
|
3027
1012
|
</button>
|
|
3028
1013
|
</div>
|
|
3029
1014
|
<gui-repeater-widget
|
|
3030
|
-
.repeaterIndex=${
|
|
1015
|
+
.repeaterIndex=${r}
|
|
3031
1016
|
.widget=${e.template}
|
|
3032
1017
|
></gui-repeater-widget>
|
|
3033
1018
|
</div>
|
|
3034
|
-
`):
|
|
1019
|
+
`):l.nothing}
|
|
3035
1020
|
|
|
3036
1021
|
<button
|
|
3037
1022
|
type="button"
|
|
@@ -3040,69 +1025,69 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3040
1025
|
@click=${()=>this.addItem()}
|
|
3041
1026
|
?disabled=${!!(e.limit&&e.limit===e.value?.length)}
|
|
3042
1027
|
>
|
|
3043
|
-
${e.addButtonIcon?
|
|
1028
|
+
${e.addButtonIcon?l.html`<span
|
|
3044
1029
|
class="gui-widget-icon gui-button-icon ${e.addButtonIcon}"
|
|
3045
1030
|
data-icon=${e.addButtonIcon}
|
|
3046
|
-
></span>`:
|
|
1031
|
+
></span>`:l.nothing}
|
|
3047
1032
|
${e.addLabel??"Add"}
|
|
3048
1033
|
</button>
|
|
3049
1034
|
</div>
|
|
3050
|
-
${
|
|
1035
|
+
${a?l.html`<gui-errors
|
|
3051
1036
|
.uid=${this.widget.uid}
|
|
3052
1037
|
.errors=${e.errors}
|
|
3053
1038
|
.touched=${e.touched}
|
|
3054
|
-
></gui-errors>`:
|
|
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
|
|
1039
|
+
></gui-errors>`:l.nothing}
|
|
1040
|
+
`}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 a=(this.adapter.templateData.value??[]).filter((i,r)=>e!==r);"structuredClone"in window?this.adapter.valueChanged(structuredClone(a)):this.adapter.valueChanged(JSON.parse(JSON.stringify(a))),this.requestUpdate()}}Ne([c.consume({context:d.formContext}),m.property({attribute:!1})],H.prototype,"formContext"),Ne([c.provide({context:d.inputContext})],H.prototype,"adapter"),Ne([m.state()],H.prototype,"isFocused"),Ne([m.query(".gui-repeater__main-card")],H.prototype,"_repeaterRef"),f.safeDefine("gui-repeater-input",H);const _o=Object.freeze(Object.defineProperty({__proto__:null,RepeaterElement:H},Symbol.toStringTag,{value:"Module"}));var yo=Object.defineProperty,Pa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&yo(e,a,r),r};class Ve extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
3056
1041
|
<div
|
|
3057
|
-
class=${
|
|
1042
|
+
class=${O.classMap(e)}
|
|
3058
1043
|
id=${this.widget?.uid}
|
|
3059
1044
|
style=${this.adapter.templateData.gap?`gap: ${this.adapter.templateData.gap}px`:""}
|
|
3060
1045
|
>
|
|
3061
|
-
${
|
|
1046
|
+
${V.repeat(this.adapter.templateData.children||[],a=>a?.uid,a=>l.html`<gui-widget .widget=${a}></gui-widget>`)}
|
|
3062
1047
|
</div>
|
|
3063
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}
|
|
3064
|
-
<div class=${
|
|
3065
|
-
${
|
|
3066
|
-
<gui-widget .widget=${
|
|
1048
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Pa([c.consume({context:d.formContext}),m.property({attribute:!1})],Ve.prototype,"formContext"),Pa([c.provide({context:d.layoutContext})],Ve.prototype,"adapter"),f.safeDefine("gui-flex-layout",Ve);const Do=Object.freeze(Object.defineProperty({__proto__:null,FlexElement:Ve},Symbol.toStringTag,{value:"Module"}));var wo=Object.defineProperty,Ia=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&wo(e,a,r),r};class Ue extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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",a=!e,i=this.adapter.templateData.autoFit??!0,r={"gui-grid__widget":!0,"gui-grid__widget--row":a,"gui-grid__widget--row--auto-fit":a&&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"},s=[];return this.adapter.templateData.columnGap!==void 0&&s.push(`column-gap: ${this.adapter.templateData.columnGap}px`),this.adapter.templateData.rowGap!==void 0&&s.push(`row-gap: ${this.adapter.templateData.rowGap}px`),l.html`
|
|
1049
|
+
<div class=${O.classMap(r)} id=${this.widget?.uid} style=${s.join("; ")}>
|
|
1050
|
+
${V.repeat(this.adapter.templateData.children||[],n=>n?.uid,n=>l.html`<div class="gui-grid__cell" style="grid-column: span ${n.size||1}">
|
|
1051
|
+
<gui-widget .widget=${n}></gui-widget>
|
|
3067
1052
|
</div>`)}
|
|
3068
1053
|
</div>
|
|
3069
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}
|
|
1054
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Ia([c.consume({context:d.formContext}),m.property({attribute:!1})],Ue.prototype,"formContext"),Ia([c.provide({context:d.layoutContext})],Ue.prototype,"adapter"),f.safeDefine("gui-grid-layout",Ue);const Co=Object.freeze(Object.defineProperty({__proto__:null,GridElement:Ue},Symbol.toStringTag,{value:"Module"}));var xo=Object.defineProperty,F=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&xo(e,a,r),r};class S extends l.LitElement{constructor(){super(...arguments),this.activeTab="",this.adapter=new d.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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=X.createIntersectionObserver(this.startSentinel,r=>this.isStartVisible=r),this.endObserver=X.createIntersectionObserver(this.endSentinel,r=>this.isEndVisible=r);const i=this.widget.props.tabs.findIndex(r=>r.uid===this.activeTab);this.tabButtons[i].scrollIntoView({block:"nearest",inline:"nearest"})}render(){if(!this.adapter.templateData)return l.html``;const e=this.widget.children.filter(i=>i.uid===this.activeTab||this.adapter.templateData.renderMode!=="activeOnly"),a={"gui-widget":!0,"gui-widget--horizontal":!0,"gui-tabs--start-shadow":!this.isStartVisible,"gui-tabs--end-shadow":!this.isEndVisible};return l.html`<nav class=${O.classMap(a)} id=${this.widget.uid}>
|
|
3070
1055
|
<ul role="tablist">
|
|
3071
1056
|
<li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
|
|
3072
|
-
${this.adapter.templateData.tabs?
|
|
1057
|
+
${this.adapter.templateData.tabs?V.repeat(this.adapter.templateData.tabs,(i,r)=>l.html`
|
|
3073
1058
|
<li role="presentation">
|
|
3074
1059
|
<button
|
|
3075
1060
|
type="button"
|
|
3076
1061
|
role="tab"
|
|
3077
1062
|
tabindex=${i.uid===this.activeTab?"0":"-1"}
|
|
3078
|
-
data-cy=${`tab_${this.widget.uid}_${
|
|
3079
|
-
id=${`tab_${this.widget.uid}_${
|
|
3080
|
-
aria-controls=${`tabpanel_${this.widget.uid}_${
|
|
1063
|
+
data-cy=${`tab_${this.widget.uid}_${r}`}
|
|
1064
|
+
id=${`tab_${this.widget.uid}_${r}`}
|
|
1065
|
+
aria-controls=${`tabpanel_${this.widget.uid}_${r}`}
|
|
3081
1066
|
aria-selected=${i.uid===this.activeTab?"true":"false"}
|
|
3082
|
-
class=${
|
|
1067
|
+
class=${O.classMap({active:i.uid===this.activeTab})}
|
|
3083
1068
|
@click=${()=>this.onClickTab(i.uid)}
|
|
3084
1069
|
@keydown=${this.onKeyDown}
|
|
3085
|
-
@focus=${
|
|
1070
|
+
@focus=${s=>s.target.scrollIntoView({block:"nearest",inline:"nearest"})}
|
|
3086
1071
|
>
|
|
3087
1072
|
${i.label}
|
|
3088
1073
|
</button>
|
|
3089
1074
|
</li>
|
|
3090
|
-
`):
|
|
1075
|
+
`):l.nothing}
|
|
3091
1076
|
<li role="presentation" id="end-sentinel" class="gui-sentinel gui-sentinel__end"></li>
|
|
3092
1077
|
</ul>
|
|
3093
1078
|
</nav>
|
|
3094
|
-
${
|
|
1079
|
+
${V.repeat(e,i=>i?.uid,(i,r)=>l.html`<section
|
|
3095
1080
|
role="tabpanel"
|
|
3096
1081
|
tabindex="0"
|
|
3097
|
-
data-cy=${`tabpanel_${this.widget.uid}_${
|
|
3098
|
-
id=${`tabpanel_${this.widget.uid}_${
|
|
1082
|
+
data-cy=${`tabpanel_${this.widget.uid}_${r}`}
|
|
1083
|
+
id=${`tabpanel_${this.widget.uid}_${r}`}
|
|
3099
1084
|
?hidden=${i.uid!==this.activeTab&&this.adapter.templateData.renderMode!=="activeOnly"}
|
|
3100
|
-
aria-labelledby=${`tab_${this.widget.uid}_${
|
|
1085
|
+
aria-labelledby=${`tab_${this.widget.uid}_${r}`}
|
|
3101
1086
|
>
|
|
3102
1087
|
<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
|
|
1088
|
+
</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 a=this.widget.props.tabs,i=a.findIndex(n=>n.uid===this.activeTab),r=Array.from(this.tabButtons),s=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const n=i+(s?1:-1);n>=0&&n<a.length&&(this.activeTab=a[n].uid,r[n].focus());break}case"ArrowRight":{const n=i+(s?-1:1);n>=0&&n<a.length&&(this.activeTab=a[n].uid,r[n].focus());break}case"Home":this.activeTab=a[0].uid,r[0].focus();break;case"End":this.activeTab=a[a.length-1].uid,r[a.length-1].focus();break;default:return}}}F([m.query("#start-sentinel")],S.prototype,"startSentinel"),F([m.query("#end-sentinel")],S.prototype,"endSentinel"),F([m.state()],S.prototype,"isStartVisible"),F([m.state()],S.prototype,"isEndVisible"),F([m.queryAll('button[role="tab"]')],S.prototype,"tabButtons"),F([m.property({type:String})],S.prototype,"activeTab"),F([c.consume({context:d.formContext}),m.property({attribute:!1})],S.prototype,"formContext"),F([c.provide({context:d.layoutContext})],S.prototype,"adapter"),f.safeDefine("gui-tabs-layout",S);const ko=Object.freeze(Object.defineProperty({__proto__:null,TabsElement:S},Symbol.toStringTag,{value:"Module"}));var To=Object.defineProperty,za=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&To(e,a,r),r};class Be extends l.LitElement{constructor(){super(...arguments),this.activeSections={},this.adapter=new d.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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(a=>a.uid===e)}render(){return this.adapter.templateData?l.html`
|
|
3104
1089
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
3105
|
-
${this.adapter.templateData.sections?
|
|
1090
|
+
${this.adapter.templateData.sections?V.repeat(this.adapter.templateData.sections,e=>e.uid,e=>{const a=this.activeSections[e.uid]||this.adapter.templateData.renderMode!=="activeOnly"?l.html`<section
|
|
3106
1091
|
class="gui-widget"
|
|
3107
1092
|
role="region"
|
|
3108
1093
|
id=${`accordion_section_${e.uid}`}
|
|
@@ -3110,11 +1095,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3110
1095
|
aria-labelledby=${`accordion_button_${e.uid}`}
|
|
3111
1096
|
>
|
|
3112
1097
|
<gui-widget .widget=${this.getChild(e.uid)}></gui-widget>
|
|
3113
|
-
</section>`:
|
|
1098
|
+
</section>`:l.nothing;return l.html`<div class="gui-accordion__section">
|
|
3114
1099
|
<button
|
|
3115
1100
|
type="button"
|
|
3116
1101
|
tabindex="0"
|
|
3117
|
-
class=${
|
|
1102
|
+
class=${O.classMap({active:this.activeSections[e.uid]})}
|
|
3118
1103
|
id=${`accordion_button_${e.uid}`}
|
|
3119
1104
|
aria-controls=${`accordion_section_${e.uid}`}
|
|
3120
1105
|
aria-expanded=${this.activeSections[e.uid]?"true":"false"}
|
|
@@ -3133,10 +1118,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3133
1118
|
></span>
|
|
3134
1119
|
</button>
|
|
3135
1120
|
|
|
3136
|
-
${
|
|
3137
|
-
</div>`}):
|
|
1121
|
+
${a}
|
|
1122
|
+
</div>`}):l.nothing}
|
|
3138
1123
|
</div>
|
|
3139
|
-
`:
|
|
1124
|
+
`:l.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}za([c.consume({context:d.formContext}),m.property({attribute:!1})],Be.prototype,"formContext"),za([c.provide({context:d.layoutContext})],Be.prototype,"adapter"),f.safeDefine("gui-accordion-layout",Be);const Lo=Object.freeze(Object.defineProperty({__proto__:null,AccordionElement:Be},Symbol.toStringTag,{value:"Module"}));var Ao=Object.defineProperty,Ma=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Ao(e,a,r),r};class We extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
3140
1125
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
3141
1126
|
<div
|
|
3142
1127
|
role="alert"
|
|
@@ -3145,13 +1130,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3145
1130
|
${this.adapter.templateData.text}
|
|
3146
1131
|
</div>
|
|
3147
1132
|
</div>
|
|
3148
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}
|
|
1133
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Ma([c.consume({context:d.formContext}),m.property({attribute:!1})],We.prototype,"formContext"),Ma([c.provide({context:d.displayWidgetContext})],We.prototype,"adapter"),f.safeDefine("gui-alert-display",We);const Po=Object.freeze(Object.defineProperty({__proto__:null,AlertElement:We},Symbol.toStringTag,{value:"Module"}));var Io=Object.defineProperty,Ea=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Io(e,a,r),r};class Je extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
3149
1134
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
3150
1135
|
<gui-markdown-text
|
|
3151
1136
|
.md=${this.adapter.templateData.md}
|
|
3152
1137
|
.dependencies=${this.adapter.templateData.deps}
|
|
3153
1138
|
></gui-markdown-text>
|
|
3154
1139
|
</div>
|
|
3155
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}
|
|
1140
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Ea([c.consume({context:d.formContext}),m.property({attribute:!1})],Je.prototype,"formContext"),Ea([c.provide({context:d.displayWidgetContext})],Je.prototype,"adapter"),f.safeDefine("gui-markdown-text-display",Je);const zo=Object.freeze(Object.defineProperty({__proto__:null,MarkdownTextElement:Je},Symbol.toStringTag,{value:"Module"}));var Mo=Object.defineProperty,Sa=(t,e,a,i)=>{for(var r=void 0,s=t.length-1,n;s>=0;s--)(n=t[s])&&(r=n(e,a,r)||r);return r&&Mo(e,a,r),r};class Ge extends l.LitElement{constructor(){super(...arguments),this.adapter=new d.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const a=this.adapter.templateData.size;a?this.style.flex=String(a):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 l.html`
|
|
3156
1141
|
<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())}}
|
|
1142
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}Sa([c.consume({context:d.formContext}),m.property({attribute:!1})],Ge.prototype,"formContext"),Sa([c.provide({context:d.displayWidgetContext})],Ge.prototype,"adapter"),f.safeDefine("gui-renderer-component",Ge);const Eo=Object.freeze(Object.defineProperty({__proto__:null,RendererElement:Ge},Symbol.toStringTag,{value:"Module"}));C.FormElement=ea,C.widgetLoaders=Qt,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
|