@mhmo91/schmancy 0.10.21 → 0.10.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/custom-elements.json +0 -106
  2. package/dist/agent/{overlay.confirm-body-DXus8d-w.js → overlay.confirm-body-xfOh5Q28.js} +0 -4
  3. package/dist/agent/{overlay.confirm-body-DXus8d-w.js.map → overlay.confirm-body-xfOh5Q28.js.map} +1 -1
  4. package/dist/agent/schmancy.agent.js +1835 -1951
  5. package/dist/agent/schmancy.agent.js.map +1 -1
  6. package/dist/agent/schmancy.manifest.json +1 -89
  7. package/dist/badge.cjs +1 -1
  8. package/dist/badge.js +1 -1
  9. package/dist/button-C1IMGS6M.js +446 -0
  10. package/dist/button-C1IMGS6M.js.map +1 -0
  11. package/dist/button-CWNbPPq-.cjs +120 -0
  12. package/dist/button-CWNbPPq-.cjs.map +1 -0
  13. package/dist/button.cjs +1 -120
  14. package/dist/button.js +2 -447
  15. package/dist/content-drawer.cjs +1 -1
  16. package/dist/content-drawer.js +1 -1
  17. package/dist/{date-range-aPSmSBhk.js → date-range-CAqB-B0M.js} +1 -1
  18. package/dist/{date-range-aPSmSBhk.js.map → date-range-CAqB-B0M.js.map} +1 -1
  19. package/dist/{date-range-CsJfjbmi.cjs → date-range-VA1mi1N7.cjs} +1 -1
  20. package/dist/{date-range-CsJfjbmi.cjs.map → date-range-VA1mi1N7.cjs.map} +1 -1
  21. package/dist/date-range.cjs +1 -1
  22. package/dist/date-range.js +1 -1
  23. package/dist/{form-Bz5WamuM.js → form-B-Sm6u25.js} +1 -1
  24. package/dist/{form-Bz5WamuM.js.map → form-B-Sm6u25.js.map} +1 -1
  25. package/dist/{form-PioZDvzA.cjs → form-ha3df3K7.cjs} +1 -1
  26. package/dist/{form-PioZDvzA.cjs.map → form-ha3df3K7.cjs.map} +1 -1
  27. package/dist/form.cjs +1 -1
  28. package/dist/form.js +2 -2
  29. package/dist/handover/agent-runtime-followups.md +1 -1
  30. package/dist/handover/agent-runtime-v1.md +3 -3
  31. package/dist/icons-DJuXwn8D.js +48 -0
  32. package/dist/icons-DJuXwn8D.js.map +1 -0
  33. package/dist/icons-oNRUCAEY.cjs +33 -0
  34. package/dist/icons-oNRUCAEY.cjs.map +1 -0
  35. package/dist/icons.cjs +1 -1
  36. package/dist/icons.js +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +7 -7
  39. package/dist/{menu-CxE16xur.js → menu-Csm6Fg88.js} +1 -1
  40. package/dist/{menu-CxE16xur.js.map → menu-Csm6Fg88.js.map} +1 -1
  41. package/dist/{menu-BOZ2iwed.cjs → menu-DBuZiPyW.cjs} +1 -1
  42. package/dist/{menu-BOZ2iwed.cjs.map → menu-DBuZiPyW.cjs.map} +1 -1
  43. package/dist/menu.cjs +1 -1
  44. package/dist/menu.js +1 -1
  45. package/dist/nav-drawer.cjs +1 -1
  46. package/dist/nav-drawer.js +1 -1
  47. package/dist/navigation-bar.cjs +1 -1
  48. package/dist/navigation-bar.js +1 -1
  49. package/dist/{overlay-D3mdWOLS.js → overlay-CAI2FAp7.js} +3 -2
  50. package/dist/{overlay-D3mdWOLS.js.map → overlay-CAI2FAp7.js.map} +1 -1
  51. package/dist/{overlay-B3gKPWhu.cjs → overlay-CpvmytrQ.cjs} +2 -1
  52. package/dist/{overlay-B3gKPWhu.cjs.map → overlay-CpvmytrQ.cjs.map} +1 -1
  53. package/dist/overlay.cjs +1 -1
  54. package/dist/{overlay.confirm-body-Czi6cMZq.js → overlay.confirm-body-Cq25CkTw.js} +0 -4
  55. package/dist/overlay.confirm-body-Cq25CkTw.js.map +1 -0
  56. package/dist/{overlay.confirm-body-yr0HzS_d.cjs → overlay.confirm-body-QD-5cj3_.cjs} +0 -4
  57. package/dist/overlay.confirm-body-QD-5cj3_.cjs.map +1 -0
  58. package/dist/overlay.js +3 -3
  59. package/dist/{overlay.service-DNs3AWqp.cjs → overlay.service-BG0bqPwJ.cjs} +1 -1
  60. package/dist/{overlay.service-DNs3AWqp.cjs.map → overlay.service-BG0bqPwJ.cjs.map} +1 -1
  61. package/dist/{overlay.service-BfZf3xoD.js → overlay.service-Bpjrhaxh.js} +2 -2
  62. package/dist/{overlay.service-BfZf3xoD.js.map → overlay.service-Bpjrhaxh.js.map} +1 -1
  63. package/dist/skills/overlay.md +4 -0
  64. package/dist/skills/schmancy/overlay.md +4 -0
  65. package/dist/{src-CHd-U-w4.js → src-B15R32Sp.js} +7 -7
  66. package/dist/{src-CHd-U-w4.js.map → src-B15R32Sp.js.map} +1 -1
  67. package/dist/{src-ggWtvpDr.cjs → src-BWQvtOOf.cjs} +1 -1
  68. package/dist/{src-ggWtvpDr.cjs.map → src-BWQvtOOf.cjs.map} +1 -1
  69. package/dist/teleport.cjs +1 -1
  70. package/dist/teleport.js +1 -1
  71. package/package.json +1 -1
  72. package/skills/schmancy/overlay.md +4 -0
  73. package/src/icons/icon.ts +43 -293
  74. package/src/overlay/overlay.component.ts +1 -0
  75. package/src/overlay/overlay.confirm-body.ts +0 -4
  76. package/types/src/icons/icon.d.ts +0 -81
  77. package/dist/button.cjs.map +0 -1
  78. package/dist/button.js.map +0 -1
  79. package/dist/context-6oXCZmZN.js +0 -3
  80. package/dist/context-6oXCZmZN.js.map +0 -1
  81. package/dist/context-CRZeiCqq.cjs +0 -1
  82. package/dist/context-CRZeiCqq.cjs.map +0 -1
  83. package/dist/icons-BgUbHwy8.js +0 -169
  84. package/dist/icons-BgUbHwy8.js.map +0 -1
  85. package/dist/icons-morK4hHz.cjs +0 -52
  86. package/dist/icons-morK4hHz.cjs.map +0 -1
  87. package/dist/overlay.confirm-body-Czi6cMZq.js.map +0 -1
  88. package/dist/overlay.confirm-body-yr0HzS_d.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"date-range-CsJfjbmi.cjs","names":[],"sources":["../node_modules/dayjs/dayjs.min.js","../node_modules/dayjs/plugin/quarterOfYear.js","../src/form/fields/date-range/date-range-helpers.ts","../src/form/fields/date-range/date-range-presets.ts","../src/form/fields/date-range/date-utils.ts","../src/form/fields/date-range/date-range-dialog.ts","../src/form/fields/date-range/date-range.ts"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_quarterOfYear=n()}(this,(function(){\"use strict\";var t=\"month\",n=\"quarter\";return function(e,i){var r=i.prototype;r.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var s=r.add;r.add=function(e,i){return e=Number(e),this.$utils().p(i)===n?this.add(3*e,t):s.bind(this)(e,i)};var u=r.startOf;r.startOf=function(e,i){var r=this.$utils(),s=!!r.u(i)||i;if(r.p(e)===n){var o=this.quarter()-1;return s?this.month(3*o).startOf(t).startOf(\"day\"):this.month(3*o+2).endOf(t).endOf(\"day\")}return u.bind(this)(e,i)}}}));","import dayjs from 'dayjs'\r\n\r\n/**\r\n * Format a date range into a human-readable string\r\n */\r\nexport function formatDateRange(\r\n\tfromValue: string,\r\n\ttoValue: string,\r\n\ttype: 'date' | 'datetime-local',\r\n\tplaceholder: string\r\n): string {\r\n\tif (!fromValue || !toValue) {\r\n\t\treturn placeholder\r\n\t}\r\n\r\n\tconst fromDate = dayjs(fromValue)\r\n\tconst toDate = dayjs(toValue)\r\n\r\n\tif (!fromDate.isValid() || !toDate.isValid()) {\r\n\t\treturn placeholder\r\n\t}\r\n\r\n\t// Format times if needed (for datetime-local)\r\n\tconst fromTime = type === 'datetime-local' ? fromDate.format(' h:mm A') : ''\r\n\tconst toTime = type === 'datetime-local' ? toDate.format(' h:mm A') : ''\r\n\r\n\t// Check if same day\r\n\tif (fromDate.isSame(toDate, 'day')) {\r\n\t\treturn `${fromDate.format('ddd, MMM D, YYYY')}${fromTime}`\r\n\t}\r\n\r\n\t// Check if same month and year\r\n\tif (fromDate.isSame(toDate, 'month') && fromDate.isSame(toDate, 'year')) {\r\n\t\treturn `${fromDate.format('ddd MMM D')} - ${toDate.format('ddd D, YYYY')}${toTime}`\r\n\t}\r\n\r\n\t// Check if same year\r\n\tif (fromDate.isSame(toDate, 'year')) {\r\n\t\treturn `${fromDate.format('ddd MMM D')} - ${toDate.format('ddd MMM D, YYYY')}${toTime}`\r\n\t}\r\n\r\n\t// Different years\r\n\treturn `${fromDate.format('ddd MMM D, YYYY')}${fromTime} - ${toDate.format('ddd MMM D, YYYY')}${toTime}`\r\n}\r\n\r\n/**\r\n * Detect the type of date range (full month, full quarter, etc.)\r\n */\r\nexport interface DateRangeType {\r\n\tisFullMonth: boolean\r\n\tisFullQuarter: boolean\r\n\tisFullYear: boolean\r\n\tisFullWeek: boolean\r\n}\r\n\r\nexport function detectDateRangeType(fromDate: dayjs.Dayjs, toDate: dayjs.Dayjs): DateRangeType {\r\n\treturn {\r\n\t\tisFullMonth: fromDate.date() === 1 && toDate.isSame(fromDate.endOf('month'), 'day'),\r\n\t\tisFullQuarter: fromDate.isSame(fromDate.startOf('quarter'), 'day') && toDate.isSame(toDate.endOf('quarter'), 'day'),\r\n\t\tisFullYear: fromDate.isSame(fromDate.startOf('year'), 'day') && toDate.isSame(toDate.endOf('year'), 'day'),\r\n\t\tisFullWeek: fromDate.day() === 0 && toDate.day() === 6 && toDate.diff(fromDate, 'days') === 6,\r\n\t}\r\n}\r\n\r\n","import dayjs from 'dayjs'\r\n\r\nexport type PresetUnit = dayjs.OpUnitType | 'quarter'\r\n\r\nexport interface DateRangePreset {\r\n\tlabel: string\r\n\trange: { dateFrom: string; dateTo: string }\r\n\tstep: PresetUnit\r\n}\r\n\r\nexport interface PresetCategory {\r\n\tname: string\r\n\tpresets: DateRangePreset[]\r\n}\r\n\r\n/**\r\n * Generate date range presets for different time periods\r\n */\r\nexport function generatePresetCategories(format: string, includeTime: boolean = false): PresetCategory[] {\r\n\tconst categories: PresetCategory[] = []\r\n\r\n\t// Hours category (only for datetime-local)\r\n\tif (includeTime) {\r\n\t\tcategories.push({\r\n\t\t\tname: 'Hours',\r\n\t\t\tpresets: [\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Last 24 Hours',\r\n\t\t\t\t\trange: {\r\n\t\t\t\t\t\tdateFrom: dayjs().subtract(24, 'hours').format(format),\r\n\t\t\t\t\t\tdateTo: dayjs().format(format),\r\n\t\t\t\t\t},\r\n\t\t\t\t\tstep: 'hour',\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Last 12 Hours',\r\n\t\t\t\t\trange: {\r\n\t\t\t\t\t\tdateFrom: dayjs().subtract(12, 'hours').format(format),\r\n\t\t\t\t\t\tdateTo: dayjs().format(format),\r\n\t\t\t\t\t},\r\n\t\t\t\t\tstep: 'hour',\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t})\r\n\t}\r\n\r\n\t// Days category\r\n\tcategories.push({\r\n\t\tname: 'Days',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Today',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('day').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'day',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Yesterday',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'days').startOf('day').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'days').endOf('day').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'day',\r\n\t\t\t},\r\n\t\t\t...generateLastNDaysPresets([7, 14, 30, 60, 90], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Weeks category\r\n\tcategories.push({\r\n\t\tname: 'Weeks',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Week',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('week').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('week').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'week',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Week',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'weeks').startOf('week').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'weeks').endOf('week').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'week',\r\n\t\t\t},\r\n\t\t\t...generateLastNWeeksPresets([2, 4], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Months category\r\n\tcategories.push({\r\n\t\tname: 'Months',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Month',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('month').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('month').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'month',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Month',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'month').startOf('month').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'month').endOf('month').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'month',\r\n\t\t\t},\r\n\t\t\t...generateLastNMonthsPresets([3, 6], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Quarters category\r\n\tcategories.push({\r\n\t\tname: 'Quarters',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Quarter',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('quarter').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('quarter').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'quarter',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Quarter',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'quarter').startOf('quarter').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'quarter').endOf('quarter').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'quarter',\r\n\t\t\t},\r\n\t\t\t...generateLastNQuartersPresets([2, 4], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Years category\r\n\tcategories.push({\r\n\t\tname: 'Years',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Year',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('year').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('year').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'year',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Year',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'year').startOf('year').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'year').endOf('year').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'year',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Year to Date',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('year').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'day',\r\n\t\t\t},\r\n\t\t],\r\n\t})\r\n\r\n\treturn categories\r\n}\r\n\r\n// Helper functions to generate preset arrays\r\nfunction generateLastNDaysPresets(days: number[], format: string): DateRangePreset[] {\r\n\treturn days.map(n => ({\r\n\t\tlabel: `Last ${n} Days`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n - 1, 'days').startOf('day').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'day' as PresetUnit,\r\n\t}))\r\n}\r\n\r\nfunction generateLastNWeeksPresets(weeks: number[], format: string): DateRangePreset[] {\r\n\treturn weeks.map(n => ({\r\n\t\tlabel: `Last ${n} Weeks`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n, 'weeks').startOf('week').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'week' as PresetUnit,\r\n\t}))\r\n}\r\n\r\nfunction generateLastNMonthsPresets(months: number[], format: string): DateRangePreset[] {\r\n\treturn months.map(n => ({\r\n\t\tlabel: `Last ${n} Months`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n, 'months').startOf('month').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'month' as PresetUnit,\r\n\t}))\r\n}\r\n\r\nfunction generateLastNQuartersPresets(quarters: number[], format: string): DateRangePreset[] {\r\n\treturn quarters.map(n => ({\r\n\t\tlabel: `Last ${n} Quarters`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n, 'quarters').startOf('quarter').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'quarter' as PresetUnit,\r\n\t}))\r\n}","import dayjs from 'dayjs'\n\ntype DateFormat = 'YYYY-MM-DD' | 'YYYY-MM-DDTHH:mm'\n\n/**\n * Ensures that a date string conforms to a specific format.\n * If the date is already in the correct format, it returns the original string.\n * If the date is in a different format, it attempts to convert it to the specified format.\n * If the date is invalid or cannot be converted, it returns null.\n *\n * @param dateString The date string to validate and format.\n * @param expectedFormat The expected date format (e.g., 'YYYY-MM-DD', 'YYYY-MM-DDTHH:mm').\n * @returns The formatted date string, or null if the date is invalid.\n */\nfunction enforceDateFormat(dateString: string | undefined, expectedFormat: DateFormat): string | null {\n\tif (!dateString) {\n\t\treturn null // Or handle the undefined case differently if needed\n\t}\n\n\tconst parsedDate = dayjs(dateString)\n\n\tif (!parsedDate.isValid()) {\n\t\treturn null // Date is invalid\n\t}\n\n\treturn parsedDate.format(expectedFormat)\n}\n\n/**\n * Validates if the initial date range values are in the expected format.\n *\n * @param dateFrom The dateFrom value to validate.\n * @param dateTo The dateTo value to validate.\n * @param expectedFormat The expected date format.\n * @returns An object indicating whether each date is valid, and the formatted date or null if invalid.\n */\nfunction validateInitialDateRange(\n\tdateFrom: string | undefined,\n\tdateTo: string | undefined,\n\texpectedFormat: DateFormat,\n): {\n\tdateFrom: string | null\n\tdateTo: string | null\n\tisValid: boolean\n} {\n\tconst formattedDateFrom = enforceDateFormat(dateFrom, expectedFormat)\n\tconst formattedDateTo = enforceDateFormat(dateTo, expectedFormat)\n\n\tconst isValid = formattedDateFrom !== null && formattedDateTo !== null\n\n\treturn {\n\t\tdateFrom: formattedDateFrom,\n\t\tdateTo: formattedDateTo,\n\t\tisValid,\n\t}\n}\n\nexport { validateInitialDateRange }\n","import { SchmancyElement } from '@mixins/index'\nimport dayjs from 'dayjs'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { DateRangePreset, PresetCategory } from './date-range-presets'\n\ninterface PresetGroup {\n\tname: string\n\tpresets: DateRangePreset[]\n}\n\n/**\n * Dialog content component for date range selection\n *\n * Redesigned with chip-based horizontal flow layout:\n * - Quick Select: Today, Yesterday, This Week, This Month\n * - Days: Last 7/14/30/60/90 Days\n * - Periods: Last Week, Last Month, Last Quarter, Last Year\n * - Year to Date: This Week, This Month, This Quarter, This Year, YTD\n * - Custom Range: Manual date inputs at the bottom\n *\n * @element schmancy-date-range-dialog\n */\n@customElement('schmancy-date-range-dialog')\nexport class SchmancyDateRangeDialog extends SchmancyElement {\n\t@property({ type: String }) type: 'date' | 'datetime-local' = 'date'\n\t@property({ type: Object }) dateFrom: { label: string; value: string } = { label: 'From', value: '' }\n\t@property({ type: Object }) dateTo: { label: string; value: string } = { label: 'To', value: '' }\n\t@property({ type: String }) minDate?: string\n\t@property({ type: String }) maxDate?: string\n\t@property({ type: String }) activePreset: string | null = null\n\t@property({ type: Array }) presetCategories: PresetCategory[] = []\n\n\t/**\n\t * Reorganizes presets into the new grouped layout\n\t */\n\tprivate getPresetGroups(): PresetGroup[] {\n\t\tconst allPresets = this.presetCategories.flatMap(c => c.presets)\n\n\t\t// Quick Select: Today, Yesterday, This Week, This Month\n\t\tconst quickSelectLabels = ['Today', 'Yesterday', 'This Week', 'This Month']\n\t\tconst quickSelect = quickSelectLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\t// Days: Last 7/14/30/60/90 Days\n\t\tconst daysLabels = ['Last 7 Days', 'Last 14 Days', 'Last 30 Days', 'Last 60 Days', 'Last 90 Days']\n\t\tconst days = daysLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\t// Periods: Last Week, Last Month, Last Quarter, Last Year\n\t\tconst periodsLabels = ['Last Week', 'Last Month', 'Last Quarter', 'Last Year']\n\t\tconst periods = periodsLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\t// Year to Date: This Week, This Month, This Quarter, This Year, YTD\n\t\tconst ytdLabels = ['This Week', 'This Month', 'This Quarter', 'This Year', 'Year to Date']\n\t\tconst yearToDate = ytdLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\tconst groups: PresetGroup[] = []\n\n\t\tif (quickSelect.length > 0) {\n\t\t\tgroups.push({ name: 'Quick Select', presets: quickSelect })\n\t\t}\n\t\tif (days.length > 0) {\n\t\t\tgroups.push({ name: 'Days', presets: days })\n\t\t}\n\t\tif (periods.length > 0) {\n\t\t\tgroups.push({ name: 'Periods', presets: periods })\n\t\t}\n\t\tif (yearToDate.length > 0) {\n\t\t\tgroups.push({ name: 'Year to Date', presets: yearToDate })\n\t\t}\n\n\t\treturn groups\n\t}\n\n\tprivate handleFromDateChange(e: Event) {\n\t\tconst input = e.target as HTMLInputElement\n\t\tthis.dateFrom = { ...this.dateFrom, value: input.value }\n\n\t\t// If the new start date is after the current end date, adjust the end date\n\t\tif (this.dateTo.value && dayjs(this.dateFrom.value).isAfter(dayjs(this.dateTo.value))) {\n\t\t\tthis.dateTo = { ...this.dateTo, value: this.dateFrom.value }\n\t\t}\n\n\t\tthis.dispatchEvent(new CustomEvent('date-change', {\n\t\t\tdetail: { dateFrom: this.dateFrom.value, dateTo: this.dateTo.value },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\tprivate handleToDateChange(e: Event) {\n\t\tconst input = e.target as HTMLInputElement\n\t\tthis.dateTo = { ...this.dateTo, value: input.value }\n\n\t\tthis.dispatchEvent(new CustomEvent('date-change', {\n\t\t\tdetail: { dateFrom: this.dateFrom.value, dateTo: this.dateTo.value },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\tprivate handlePresetSelection(preset: DateRangePreset, e: Event) {\n\t\te.stopPropagation()\n\t\t// Parent <schmancy-date-range> listens for `preset-select`, applies\n\t\t// the range, and dispatches 'close' on us — `show()` tears down.\n\t\tthis.dispatchEvent(new CustomEvent('preset-select', {\n\t\t\tdetail: { preset },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\tprivate applyManualDateSelection(e: Event) {\n\t\te.stopPropagation()\n\t\t// Validate dates before applying\n\t\tconst fromDate = dayjs(this.dateFrom.value)\n\t\tconst toDate = dayjs(this.dateTo.value)\n\n\t\tif (!fromDate.isValid() || !toDate.isValid()) {\n\t\t\tthis.dispatchEvent(new CustomEvent('announce', {\n\t\t\t\tdetail: { message: 'Invalid date format. Please check your input.' },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true\n\t\t\t}))\n\t\t\treturn\n\t\t}\n\n\t\t// Parent <schmancy-date-range> listens for `apply-dates`, applies the\n\t\t// range, and dispatches 'close' on us — `show()` tears down.\n\t\tthis.dispatchEvent(new CustomEvent('apply-dates', {\n\t\t\tdetail: {\n\t\t\t\tdateFrom: this.dateFrom.value,\n\t\t\t\tdateTo: this.dateTo.value,\n\t\t\t\tswapIfNeeded: fromDate.isAfter(toDate)\n\t\t\t},\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\trender() {\n\t\tconst presetGroups = this.getPresetGroups()\n\n\t\treturn html`\n\t\t\t<div class=\"w-full min-h-[400px] max-h-[80vh] flex flex-col p-4\">\n\t\t\t\t<!-- Preset Groups Section -->\n\t\t\t\t<div class=\"flex-1 overflow-y-auto overflow-x-hidden min-h-0 space-y-4\">\n\t\t\t\t\t${repeat(\n\t\t\t\t\t\tpresetGroups,\n\t\t\t\t\t\tgroup => group.name,\n\t\t\t\t\t\tgroup => html`\n\t\t\t\t\t\t\t<div class=\"space-y-2\">\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"md\" class=\"text-surface-onVariant\">\n\t\t\t\t\t\t\t\t\t${group.name}\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t<div class=\"flex flex-wrap gap-2\">\n\t\t\t\t\t\t\t\t\t${repeat(\n\t\t\t\t\t\t\t\t\t\tgroup.presets,\n\t\t\t\t\t\t\t\t\t\tpreset => preset.label,\n\t\t\t\t\t\t\t\t\t\tpreset => html`\n\t\t\t\t\t\t\t\t\t\t\t<schmancy-filter-chip\n\t\t\t\t\t\t\t\t\t\t\t\t.value=${preset.label}\n\t\t\t\t\t\t\t\t\t\t\t\t.selected=${this.activePreset === preset.label}\n\t\t\t\t\t\t\t\t\t\t\t\t@click=${(e: Event) => this.handlePresetSelection(preset, e)}\n\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"${preset.range.dateFrom} to ${preset.range.dateTo}\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t${preset.label}\n\t\t\t\t\t\t\t\t\t\t\t</schmancy-filter-chip>\n\t\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Divider -->\n\t\t\t\t<schmancy-divider class=\"my-4\"></schmancy-divider>\n\n\t\t\t\t<!-- Custom Range Section -->\n\t\t\t\t<div class=\"space-y-2\">\n\t\t\t\t\t<div class=\"flex items-end gap-3 flex-wrap\">\n\t\t\t\t\t\t<div class=\"flex-1 min-w-[140px]\">\n\t\t\t\t\t\t\t<schmancy-input\n\t\t\t\t\t\t\t\t.type=\"${this.type}\"\n\t\t\t\t\t\t\t\t.label=\"${this.dateFrom.label || 'From'}\"\n\t\t\t\t\t\t\t\t.value=\"${this.dateFrom.value}\"\n\t\t\t\t\t\t\t\tmin=\"${ifDefined(this.minDate)}\"\n\t\t\t\t\t\t\t\tmax=\"${ifDefined(this.maxDate)}\"\n\t\t\t\t\t\t\t\t@change=\"${this.handleFromDateChange}\"\n\t\t\t\t\t\t\t></schmancy-input>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-[140px]\">\n\t\t\t\t\t\t\t<schmancy-input\n\t\t\t\t\t\t\t\t.type=\"${this.type}\"\n\t\t\t\t\t\t\t\t.label=\"${this.dateTo.label || 'To'}\"\n\t\t\t\t\t\t\t\t.value=\"${this.dateTo.value}\"\n\t\t\t\t\t\t\t\tmin=\"${ifDefined(this.dateFrom.value)}\"\n\t\t\t\t\t\t\t\tmax=\"${ifDefined(this.maxDate)}\"\n\t\t\t\t\t\t\t\t@change=\"${this.handleToDateChange}\"\n\t\t\t\t\t\t\t></schmancy-input>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\tvariant=\"filled\"\n\t\t\t\t\t\t\t@click=\"${(e: Event) => this.applyManualDateSelection(e)}\"\n\t\t\t\t\t\t\t?disabled=\"${!this.dateFrom.value || !this.dateTo.value}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tApply\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-date-range-dialog': SchmancyDateRangeDialog\n\t}\n}\n","import dayjs from 'dayjs'\nimport quarterOfYear from 'dayjs/plugin/quarterOfYear'\nimport { html, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { fromEvent, Subscription, takeUntil, timer } from 'rxjs'\nimport { SchmancyFormField } from '@mixins/index'\nimport { show } from '../../../overlay/overlay.service'\nimport { detectDateRangeType, formatDateRange } from './date-range-helpers'\nimport { DateRangePreset, generatePresetCategories, PresetCategory } from './date-range-presets'\nimport { validateInitialDateRange } from './date-utils'\nimport './date-range-dialog'\n\n// Add quarter plugin to dayjs\ndayjs.extend(quarterOfYear)\n\n// Bridge the inner-content events used inside the overlay template down to a\n// `close` event on the same element. `show()` translates a bubbling 'close'\n// event into observable completion + an emission of `event.detail`.\nconst dispatchClose = (target: EventTarget | null): void => {\n\ttarget?.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }))\n}\n\nexport type SchmancyDateRangeChangeEvent = CustomEvent<{\n\tdateFrom: string\n\tdateTo: string\n}>\n\n/**\n * A date range selector that supports presets and manual date input.\n *\n * @element schmancy-date-range\n * @fires change - Fired when the date range changes with dateFrom and dateTo values\n */\n@customElement('schmancy-date-range')\nexport class SchmancyDateRange extends SchmancyFormField() {\n\t// `name`, `disabled`, `required`, `error`, `validationMessage`, `id`,\n\t// `validateOn`, `touched`, `submitted`, `markTouched`, `markSubmitted`,\n\t// FACE wiring, FIELD_CONNECT_EVENT dispatch — all from the mixin.\n\n\t@property({ type: String }) type: 'date' | 'datetime-local' = 'date'\n\t@property({ type: Object }) dateFrom: { label: string; value: string } = { label: 'From', value: '' }\n\t@property({ type: Object }) dateTo: { label: string; value: string } = { label: 'To', value: '' }\n\t@property({ type: String }) minDate?: string\n\t@property({ type: String }) maxDate?: string\n\n\t@property({ type: Array }) customPresets: Array<{\n\t\tlabel: string\n\t\tdateFrom: string\n\t\tdateTo: string\n\t}> = []\n\t@property({ type: String }) format?: string\n\t@property({ type: String }) placeholder = 'Select date range'\n\t@property({ type: Boolean }) clearable = true\n\t@property() step?: 'day' | 'week' | 'month' | 'year' | number\n\t/** When true, collapses to just an icon button on mobile screens */\n\t@property({ type: Boolean }) collapse = false\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private selectedDateRange: string = ''\n\t@state() private activePreset: string | null = null\n\t@state() private announceMessage: string = ''\n\n\t// Default presets\n\tprivate presetRanges: DateRangePreset[] = []\n\n\t// Categorized presets\n\tprivate presetCategories: PresetCategory[] = []\n\n\t// Memoization cache\n\tprivate memoizedPresets = new Map<string, PresetCategory[]>()\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\t// Reset open state when element is moved/removed to prevent stale state\n\t\tthis.isOpen = false\n\t}\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.initPresetRanges()\n\n\t\t// Validate initial date range\n\t\tconst dateFormat = this.getDateFormat() as 'YYYY-MM-DD' | 'YYYY-MM-DDTHH:mm'\n\t\tconst validatedRange = validateInitialDateRange(this.dateFrom.value, this.dateTo.value, dateFormat)\n\n\t\tif (validatedRange.isValid) {\n\t\t\tthis.dateFrom.value = validatedRange.dateFrom!\n\t\t\tthis.dateTo.value = validatedRange.dateTo!\n\t\t\tthis.updateSelectedDateRange()\n\t\t} else {\n\t\t\tconst now = dayjs().format(dateFormat)\n\t\t\tthis.dateFrom.value = now\n\t\t\tthis.dateTo.value = now\n\t\t\tthis.updateSelectedDateRange()\n\t\t}\n\n\t\t// Set up global event handlers using RxJS\n\t\tthis.setupEventHandlers()\n\t}\n\n\tprivate setupEventHandlers() {\n\t\t// Handle keyboard navigation\n\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(event => {\n\t\t\t\tthis.handleKeyboardNavigation(event)\n\t\t\t})\n\t}\n\n\tupdated(changedProps: PropertyValues) {\n\t\tsuper.updated(changedProps)\n\n\t\tif (\n\t\t\t(changedProps.has('dateFrom') || changedProps.has('dateTo')) &&\n\t\t\t(this.dateFrom?.value !== undefined || this.dateTo?.value !== undefined)\n\t\t) {\n\t\t\tthis.updateSelectedDateRange()\n\t\t}\n\t}\n\n\toverride willUpdate(changed: PropertyValues): void {\n\t\tsuper.willUpdate(changed)\n\t\tif (changed.has('dateFrom') || changed.has('dateTo') || changed.has('name')) {\n\t\t\t// Multi-entry FACE submission: setFormValue accepts a FormData\n\t\t\t// object whose entries are appended to the owning form's FormData.\n\t\t\t// native `new FormData(form)` then sees both `${name}From` and\n\t\t\t// `${name}To` without any consumer-side parsing.\n\t\t\tif (this.name && !this.disabled) {\n\t\t\t\tconst fd = new FormData()\n\t\t\t\tif (this.dateFrom?.value) fd.append(`${this.name}From`, this.dateFrom.value)\n\t\t\t\tif (this.dateTo?.value) fd.append(`${this.name}To`, this.dateTo.value)\n\t\t\t\tthis.internals?.setFormValue(fd)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setFormValue(null)\n\t\t\t}\n\t\t\tthis.checkValidity()\n\t\t}\n\t\tif (changed.has('required') || changed.has('disabled')) {\n\t\t\tthis.checkValidity()\n\t\t}\n\t}\n\n\t/**\n\t * Date-range validity is `both dates non-empty` when required.\n\t * (Order/range constraints are out of scope here — they belong to a\n\t * domain-specific schema layer.)\n\t */\n\toverride checkValidity(): boolean {\n\t\tif (this.disabled) {\n\t\t\tthis.internals?.setValidity({})\n\t\t\treturn true\n\t\t}\n\t\tconst fromEmpty = !this.dateFrom?.value\n\t\tconst toEmpty = !this.dateTo?.value\n\t\tconst isValid = !this.required || (!fromEmpty && !toEmpty)\n\t\tconst message = isValid ? '' : 'Please select a date range.'\n\n\t\tthis.internals?.setValidity(\n\t\t\tisValid ? {} : { valueMissing: true },\n\t\t\tisValid ? undefined : message,\n\t\t)\n\n\t\tif (this._shouldShowError()) {\n\t\t\tthis.error = !isValid\n\t\t\tthis.validationMessage = message\n\t\t}\n\t\treturn isValid\n\t}\n\n\t/**\n\t * Override — emit `${name}From` and `${name}To` flat-suffix entries (the\n\t * plan's chosen multi-entry encoding; native to JS consumers without\n\t * server-side bracket parsing).\n\t */\n\toverride toFormEntries(): Array<[string, FormDataEntryValue]> {\n\t\tif (!this.name || this.disabled) return []\n\t\tconst entries: Array<[string, FormDataEntryValue]> = []\n\t\tif (this.dateFrom?.value) entries.push([`${this.name}From`, this.dateFrom.value])\n\t\tif (this.dateTo?.value) entries.push([`${this.name}To`, this.dateTo.value])\n\t\treturn entries\n\t}\n\n\t/** `dirty` tracks the underlying date strings, not the wide-union value. */\n\tprivate _dateFromDefault: string = ''\n\tprivate _dateToDefault: string = ''\n\toverride firstUpdated(changed: PropertyValues): void {\n\t\tsuper.firstUpdated(changed)\n\t\tthis._dateFromDefault = this.dateFrom?.value ?? ''\n\t\tthis._dateToDefault = this.dateTo?.value ?? ''\n\t}\n\toverride get dirty(): boolean {\n\t\treturn (\n\t\t\t(this.dateFrom?.value ?? '') !== this._dateFromDefault ||\n\t\t\t(this.dateTo?.value ?? '') !== this._dateToDefault\n\t\t)\n\t}\n\n\toverride resetForm(): void {\n\t\tthis.dateFrom = { ...this.dateFrom, value: this._dateFromDefault }\n\t\tthis.dateTo = { ...this.dateTo, value: this._dateToDefault }\n\t\tsuper.resetForm()\n\t}\n\n\tprivate initPresetRanges() {\n\t\tconst format = this.getDateFormat()\n\t\tconst cacheKey = `${this.type}-${format}-${JSON.stringify(this.customPresets)}`\n\t\t\n\t\t// Check memoization cache\n\t\tif (this.memoizedPresets.has(cacheKey)) {\n\t\t\tconst cached = this.memoizedPresets.get(cacheKey)!\n\t\t\tthis.presetCategories = cached\n\t\t\tthis.presetRanges = []\n\t\t\tcached.forEach(category => {\n\t\t\t\tthis.presetRanges.push(...category.presets)\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\t// Generate preset categories\n\t\tthis.presetCategories = generatePresetCategories(format, this.type === 'datetime-local')\n\n\t\t// Flatten presets for other methods that expect a flat list\n\t\tthis.presetRanges = []\n\t\tthis.presetCategories.forEach(category => {\n\t\t\tthis.presetRanges.push(...category.presets)\n\t\t})\n\n\t\t// Add custom presets if provided\n\t\tif (this.customPresets && this.customPresets.length > 0) {\n\t\t\tconst customCategory: PresetCategory = {\n\t\t\t\tname: 'Custom',\n\t\t\t\tpresets: this.customPresets.map(preset => ({\n\t\t\t\t\tlabel: preset.label,\n\t\t\t\t\trange: {\n\t\t\t\t\t\tdateFrom: preset.dateFrom,\n\t\t\t\t\t\tdateTo: preset.dateTo,\n\t\t\t\t\t},\n\t\t\t\t\tstep: 'day' as const,\n\t\t\t\t})),\n\t\t\t}\n\n\t\t\tthis.presetCategories.push(customCategory)\n\t\t\tthis.presetRanges.push(...customCategory.presets)\n\t\t}\n\t\t\n\t\t// Cache the result\n\t\tthis.memoizedPresets.set(cacheKey, [...this.presetCategories])\n\t}\n\n\tprivate getDateFormat(): string {\n\t\treturn this.format || (this.type === 'date' ? 'YYYY-MM-DD' : 'YYYY-MM-DDTHH:mm')\n\t}\n\n\t/**\n\t * Creates a concise display format for the selected date range\n\t */\n\tprivate updateSelectedDateRange() {\n\t\t// Find matching preset\n\t\tconst preset = this.presetRanges.find(\n\t\t\tp => p.range.dateFrom === this.dateFrom.value && p.range.dateTo === this.dateTo.value,\n\t\t)\n\n\t\tif (preset) {\n\t\t\t// If matches a preset, just use the preset name\n\t\t\tthis.selectedDateRange = preset.label\n\t\t\tthis.activePreset = preset.label\n\t\t\treturn\n\t\t}\n\n\t\t// If we didn't find a preset match, check if we should update the active preset\n\t\tthis.checkAndUpdateActivePreset(this.dateFrom.value, this.dateTo.value)\n\n\t\t// Custom date range - create concise format\n\t\tthis.activePreset = null\n\t\tthis.selectedDateRange = formatDateRange(this.dateFrom.value, this.dateTo.value, this.type, this.placeholder)\n\t}\n\n\tprivate setDateRange(dateFrom: string, dateTo: string) {\n\t\tthis.dateFrom.value = dateFrom\n\t\tthis.dateTo.value = dateTo\n\t\tthis.updateSelectedDateRange()\n\n\t\t// Announce change to screen readers\n\t\tthis.announceToScreenReader(`Date range updated: ${this.selectedDateRange}`)\n\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<{ dateFrom: string; dateTo: string }>('change', {\n\t\t\t\tdetail: { dateFrom, dateTo },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate toggleDropdown(e: MouseEvent) {\n\t\te.stopPropagation()\n\t\tif (this.disabled || this.step !== undefined) return\n\n\t\tif (this.isOpen) {\n\t\t\tthis.closeDropdown()\n\t\t} else {\n\t\t\tthis.openDropdown(e)\n\t\t}\n\t}\n\n\tprivate _overlaySubscription: Subscription | null = null\n\n\tprivate openDropdown(e?: MouseEvent) {\n\t\tif (this.disabled || this.step !== undefined) return\n\n\t\tthis.dispatchEvent(new CustomEvent('beforeopen', { bubbles: true, composed: true }))\n\t\tthis.isOpen = true\n\n\t\t// Inline-template overlay. Inner handlers dispatch a 'close' event\n\t\t// from the dialog itself (via the module-scoped `dispatchClose`),\n\t\t// which `show()` translates into observable completion + an emission.\n\t\t// Layout (centered vs sheet) is chosen by the overlay system based on\n\t\t// viewport / anchor presence.\n\t\tconst dialogContent = html`\n\t\t\t<schmancy-date-range-dialog\n\t\t\t\t.type=\"${this.type}\"\n\t\t\t\t.dateFrom=\"${this.dateFrom}\"\n\t\t\t\t.dateTo=\"${this.dateTo}\"\n\t\t\t\t.minDate=\"${this.minDate}\"\n\t\t\t\t.maxDate=\"${this.maxDate}\"\n\t\t\t\t.activePreset=\"${this.activePreset}\"\n\t\t\t\t.presetCategories=\"${this.presetCategories}\"\n\t\t\t\t@preset-select=\"${(ev: CustomEvent) => {\n\t\t\t\t\tthis.activePreset = ev.detail.preset.label\n\t\t\t\t\tthis.setDateRange(ev.detail.preset.range.dateFrom, ev.detail.preset.range.dateTo)\n\t\t\t\t\tdispatchClose(ev.currentTarget)\n\t\t\t\t}}\"\n\t\t\t\t@date-change=\"${() => this.updateSelectedDateRange()}\"\n\t\t\t\t@apply-dates=\"${(ev: CustomEvent) => {\n\t\t\t\t\tconst { dateFrom, dateTo, swapIfNeeded } = ev.detail\n\t\t\t\t\tif (swapIfNeeded) {\n\t\t\t\t\t\tthis.setDateRange(dateTo, dateFrom)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.setDateRange(dateFrom, dateTo)\n\t\t\t\t\t}\n\t\t\t\t\tdispatchClose(ev.currentTarget)\n\t\t\t\t}}\"\n\t\t\t\t@announce=\"${(ev: CustomEvent) => this.announceToScreenReader(ev.detail.message)}\"\n\t\t\t></schmancy-date-range-dialog>\n\t\t`\n\n\t\tthis._overlaySubscription?.unsubscribe()\n\t\tthis._overlaySubscription = show(dialogContent, { anchor: e })\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe({\n\t\t\t\tcomplete: () => {\n\t\t\t\t\tthis.isOpen = false\n\t\t\t\t\tthis._overlaySubscription = null\n\t\t\t\t},\n\t\t\t})\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis._overlaySubscription?.unsubscribe()\n\t\tthis._overlaySubscription = null\n\t\tthis.isOpen = false\n\t}\n\n\t/**\n\t * Shifts the date range based on the step property\n\t */\n\tprivate shiftDateRange(direction: number, e: Event) {\n\t\te.stopPropagation()\n\n\t\tif (!this.dateFrom.value || !this.dateTo.value) return\n\n\t\tconst fromDate = dayjs(this.dateFrom.value)\n\t\tconst toDate = dayjs(this.dateTo.value)\n\n\t\tif (!fromDate.isValid() || !toDate.isValid()) return\n\n\t\tconst format = this.getDateFormat()\n\t\tconst dir = direction > 0 ? 1 : -1\n\t\tconst daysDiff = toDate.diff(fromDate, 'day') + 1\n\n\t\t// Determine shift amount and unit\n\t\tlet amount: number\n\t\tlet unit: dayjs.ManipulateType\n\n\t\tif (this.step !== undefined) {\n\t\t\tif (typeof this.step === 'number') {\n\t\t\t\tamount = dir * this.step\n\t\t\t\tunit = 'day'\n\t\t\t} else if (this.step === 'day') {\n\t\t\t\tamount = dir * daysDiff\n\t\t\t\tunit = 'day'\n\t\t\t} else {\n\t\t\t\tamount = dir\n\t\t\t\tunit = this.step\n\t\t\t}\n\t\t} else {\n\t\t\t// Auto-detect based on date range\n\t\t\tconst rangeType = detectDateRangeType(fromDate, toDate)\n\t\t\tif (rangeType.isFullYear) {\n\t\t\t\tamount = dir\n\t\t\t\tunit = 'year'\n\t\t\t} else if (rangeType.isFullMonth) {\n\t\t\t\tamount = dir\n\t\t\t\tunit = 'month'\n\t\t\t} else if (rangeType.isFullWeek) {\n\t\t\t\tamount = dir\n\t\t\t\tunit = 'week'\n\t\t\t} else {\n\t\t\t\tamount = dir * daysDiff\n\t\t\t\tunit = 'day'\n\t\t\t}\n\t\t}\n\n\t\tconst newFromDate = fromDate.add(amount, unit)\n\t\tconst newToDate = toDate.add(amount, unit)\n\n\t\t// Validate against min/max dates\n\t\tif (this.minDate && newFromDate.isBefore(dayjs(this.minDate))) return\n\t\tif (this.maxDate && newToDate.isAfter(dayjs(this.maxDate))) return\n\n\t\t// Update the date range\n\t\tthis.setDateRange(newFromDate.format(format), newToDate.format(format))\n\t\tthis.checkAndUpdateActivePreset(newFromDate.format(format), newToDate.format(format))\n\t}\n\n\t/**\n\t * Handle keyboard navigation for accessibility\n\t */\n\tprivate handleKeyboardNavigation(event: KeyboardEvent) {\n\t\tconst key = event.key\n\t\t\n\t\t// Handle date navigation keys\n\t\tif (this.dateFrom.value && this.dateTo.value && !this.disabled) {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'PageUp':\n\t\t\t\t\tif (event.target === this || this.contains(event.target as Node)) {\n\t\t\t\t\t\tthis.shiftDateRange(-1, event)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'PageDown':\n\t\t\t\t\tif (event.target === this || this.contains(event.target as Node)) {\n\t\t\t\t\t\tthis.shiftDateRange(1, event)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'Home':\n\t\t\t\t\tif (event.ctrlKey && (event.target === this || this.contains(event.target as Node))) {\n\t\t\t\t\t\t// Ctrl+Home: Jump to start of current month\n\t\t\t\t\t\tconst currentFrom = dayjs(this.dateFrom.value)\n\t\t\t\t\t\tconst currentTo = dayjs(this.dateTo.value)\n\t\t\t\t\t\tconst monthStart = currentFrom.startOf('month')\n\t\t\t\t\t\tconst daysDiff = currentTo.diff(currentFrom, 'day')\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.setDateRange(\n\t\t\t\t\t\t\tmonthStart.format(this.getDateFormat()),\n\t\t\t\t\t\t\tmonthStart.add(daysDiff, 'day').format(this.getDateFormat())\n\t\t\t\t\t\t)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'End':\n\t\t\t\t\tif (event.ctrlKey && (event.target === this || this.contains(event.target as Node))) {\n\t\t\t\t\t\t// Ctrl+End: Jump to end of current month\n\t\t\t\t\t\tconst currentFrom = dayjs(this.dateFrom.value)\n\t\t\t\t\t\tconst currentTo = dayjs(this.dateTo.value)\n\t\t\t\t\t\tconst daysDiff = currentTo.diff(currentFrom, 'day')\n\t\t\t\t\t\tconst monthEnd = currentTo.endOf('month')\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.setDateRange(\n\t\t\t\t\t\t\tmonthEnd.subtract(daysDiff, 'day').format(this.getDateFormat()),\n\t\t\t\t\t\t\tmonthEnd.format(this.getDateFormat())\n\t\t\t\t\t\t)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the current date range matches any predefined preset,\n\t * and updates the activePreset accordingly\n\t */\n\tprivate checkAndUpdateActivePreset(fromDate: string, toDate: string) {\n\t\t// Find a preset that matches the current date range\n\t\tconst matchingPreset = this.presetRanges.find(\n\t\t\tpreset => preset.range.dateFrom === fromDate && preset.range.dateTo === toDate,\n\t\t)\n\n\t\tif (matchingPreset) {\n\t\t\tthis.activePreset = matchingPreset.label\n\t\t} else {\n\t\t\tthis.activePreset = null\n\t\t}\n\t}\n\n\t/**\n\t * Check if we can navigate backward\n\t */\n\tprivate canNavigateBackward(): boolean {\n\t\tif (!this.dateFrom.value || !this.minDate) return true\n\t\t\n\t\tconst fromDate = dayjs(this.dateFrom.value)\n\t\tconst minDate = dayjs(this.minDate)\n\t\t\n\t\t// If current start date is already at or before min date, can't go back\n\t\treturn fromDate.isAfter(minDate)\n\t}\n\n\t/**\n\t * Check if we can navigate forward\n\t */\n\tprivate canNavigateForward(): boolean {\n\t\tif (!this.dateTo.value || !this.maxDate) return true\n\t\t\n\t\tconst toDate = dayjs(this.dateTo.value)\n\t\tconst maxDate = dayjs(this.maxDate)\n\t\t\n\t\t// If current end date is already at or after max date, can't go forward\n\t\treturn toDate.isBefore(maxDate)\n\t}\n\n\t/**\n\t * Announce messages to screen readers\n\t */\n\tprivate announceToScreenReader(message: string) {\n\t\tthis.announceMessage = message\n\t\t// Clear the message after announcement\n\t\ttimer(100)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.announceMessage = ''\n\t\t\t})\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative ${this.disabled ? 'opacity-60 pointer-events-none' : ''}\">\n\t\t\t\t<!-- Screen reader announcements -->\n\t\t\t\t<div class=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n\t\t\t\t\t${this.announceMessage}\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Collapsed: icon-only on mobile when collapse=true -->\n\t\t\t\t<schmancy-icon-button\n\t\t\t\t\tclass=\"${this.collapse ? 'lg:hidden' : 'hidden'}\"\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Select date range. Current: ${this.selectedDateRange || 'No date selected'}\"\n\t\t\t\t\t@click=${(e: MouseEvent) => this.toggleDropdown(e)}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t>\n\t\t\t\t\tdate_range\n\t\t\t\t</schmancy-icon-button>\n\n\t\t\t\t<!-- Full UI: always visible when collapse=false, or lg+ when collapse=true -->\n\t\t\t\t<section @click=${(event: Event) => event.stopPropagation()} class=\"${this.collapse ? 'hidden lg:flex' : 'flex'}\">\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Previous ${this.activePreset ? this.activePreset.toLowerCase() : 'date range'}\"\n\t\t\t\t\t\t\t@click=${(e: Event) => this.shiftDateRange(-1, e)}\n\t\t\t\t\t\t\t?disabled=${this.disabled || !this.dateFrom.value || !this.dateTo.value || !this.canNavigateBackward()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tarrow_left\n\t\t\t\t\t\t</schmancy-icon-button>\n\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\tclass=\"w-max\"\n\t\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-haspopup=\"menu\"\n\t\t\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\t\t\taria-label=\"Select date range. Current: ${this.selectedDateRange || 'No date selected'}\"\n\t\t\t\t\t\t\taria-readonly=\"${this.step !== undefined}\"\n\t\t\t\t\t\t\t@click=${(e: MouseEvent) => this.toggleDropdown(e)}\n\t\t\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\t\t\tstyle=\"${this.step !== undefined ? 'cursor: default;' : ''}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${this.selectedDateRange || this.placeholder}\n\t\t\t\t\t\t</schmancy-button>\n\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Next ${this.activePreset ? this.activePreset.toLowerCase() : 'date range'}\"\n\t\t\t\t\t\t\t@click=${(e: Event) => this.shiftDateRange(1, e)}\n\t\t\t\t\t\t\t?disabled=${this.disabled || !this.dateFrom.value || !this.dateTo.value || !this.canNavigateForward()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tarrow_right\n\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t`\n\t}\n}"],"x_google_ignoreList":[0,1],"mappings":"uUAAA,IAAU,EAAA,EAAE,EAAA,UAAA,CAA6M,aAAa,IAAU,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,6FAA6F,EAAE,sFAAsF,EAAE,CAAC,KAAK,KAAK,SAAS,2DAA2D,MAAM,IAAA,C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AA,EAAA,UACjB,CAAE,KAAM,QAAA,CAAA,CAAA,CAAU,EAAA,UAAA,YAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,WAAA,CAAA,CACjB,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAED,CAAE,KAAM,QAAA,CAAA,CAAA,CAAU,EAAA,UAAA,WAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CAGpB,EAAA,UAAA,SAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CACA,EAAA,UAAA,oBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CACA,EAAA,UAAA,eAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CACA,EAAA,UAAA,kBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA5BM,sBAAA,CAAA,CAAsB,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"date-range-VA1mi1N7.cjs","names":[],"sources":["../node_modules/dayjs/dayjs.min.js","../node_modules/dayjs/plugin/quarterOfYear.js","../src/form/fields/date-range/date-range-helpers.ts","../src/form/fields/date-range/date-range-presets.ts","../src/form/fields/date-range/date-utils.ts","../src/form/fields/date-range/date-range-dialog.ts","../src/form/fields/date-range/date-range.ts"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_quarterOfYear=n()}(this,(function(){\"use strict\";var t=\"month\",n=\"quarter\";return function(e,i){var r=i.prototype;r.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var s=r.add;r.add=function(e,i){return e=Number(e),this.$utils().p(i)===n?this.add(3*e,t):s.bind(this)(e,i)};var u=r.startOf;r.startOf=function(e,i){var r=this.$utils(),s=!!r.u(i)||i;if(r.p(e)===n){var o=this.quarter()-1;return s?this.month(3*o).startOf(t).startOf(\"day\"):this.month(3*o+2).endOf(t).endOf(\"day\")}return u.bind(this)(e,i)}}}));","import dayjs from 'dayjs'\r\n\r\n/**\r\n * Format a date range into a human-readable string\r\n */\r\nexport function formatDateRange(\r\n\tfromValue: string,\r\n\ttoValue: string,\r\n\ttype: 'date' | 'datetime-local',\r\n\tplaceholder: string\r\n): string {\r\n\tif (!fromValue || !toValue) {\r\n\t\treturn placeholder\r\n\t}\r\n\r\n\tconst fromDate = dayjs(fromValue)\r\n\tconst toDate = dayjs(toValue)\r\n\r\n\tif (!fromDate.isValid() || !toDate.isValid()) {\r\n\t\treturn placeholder\r\n\t}\r\n\r\n\t// Format times if needed (for datetime-local)\r\n\tconst fromTime = type === 'datetime-local' ? fromDate.format(' h:mm A') : ''\r\n\tconst toTime = type === 'datetime-local' ? toDate.format(' h:mm A') : ''\r\n\r\n\t// Check if same day\r\n\tif (fromDate.isSame(toDate, 'day')) {\r\n\t\treturn `${fromDate.format('ddd, MMM D, YYYY')}${fromTime}`\r\n\t}\r\n\r\n\t// Check if same month and year\r\n\tif (fromDate.isSame(toDate, 'month') && fromDate.isSame(toDate, 'year')) {\r\n\t\treturn `${fromDate.format('ddd MMM D')} - ${toDate.format('ddd D, YYYY')}${toTime}`\r\n\t}\r\n\r\n\t// Check if same year\r\n\tif (fromDate.isSame(toDate, 'year')) {\r\n\t\treturn `${fromDate.format('ddd MMM D')} - ${toDate.format('ddd MMM D, YYYY')}${toTime}`\r\n\t}\r\n\r\n\t// Different years\r\n\treturn `${fromDate.format('ddd MMM D, YYYY')}${fromTime} - ${toDate.format('ddd MMM D, YYYY')}${toTime}`\r\n}\r\n\r\n/**\r\n * Detect the type of date range (full month, full quarter, etc.)\r\n */\r\nexport interface DateRangeType {\r\n\tisFullMonth: boolean\r\n\tisFullQuarter: boolean\r\n\tisFullYear: boolean\r\n\tisFullWeek: boolean\r\n}\r\n\r\nexport function detectDateRangeType(fromDate: dayjs.Dayjs, toDate: dayjs.Dayjs): DateRangeType {\r\n\treturn {\r\n\t\tisFullMonth: fromDate.date() === 1 && toDate.isSame(fromDate.endOf('month'), 'day'),\r\n\t\tisFullQuarter: fromDate.isSame(fromDate.startOf('quarter'), 'day') && toDate.isSame(toDate.endOf('quarter'), 'day'),\r\n\t\tisFullYear: fromDate.isSame(fromDate.startOf('year'), 'day') && toDate.isSame(toDate.endOf('year'), 'day'),\r\n\t\tisFullWeek: fromDate.day() === 0 && toDate.day() === 6 && toDate.diff(fromDate, 'days') === 6,\r\n\t}\r\n}\r\n\r\n","import dayjs from 'dayjs'\r\n\r\nexport type PresetUnit = dayjs.OpUnitType | 'quarter'\r\n\r\nexport interface DateRangePreset {\r\n\tlabel: string\r\n\trange: { dateFrom: string; dateTo: string }\r\n\tstep: PresetUnit\r\n}\r\n\r\nexport interface PresetCategory {\r\n\tname: string\r\n\tpresets: DateRangePreset[]\r\n}\r\n\r\n/**\r\n * Generate date range presets for different time periods\r\n */\r\nexport function generatePresetCategories(format: string, includeTime: boolean = false): PresetCategory[] {\r\n\tconst categories: PresetCategory[] = []\r\n\r\n\t// Hours category (only for datetime-local)\r\n\tif (includeTime) {\r\n\t\tcategories.push({\r\n\t\t\tname: 'Hours',\r\n\t\t\tpresets: [\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Last 24 Hours',\r\n\t\t\t\t\trange: {\r\n\t\t\t\t\t\tdateFrom: dayjs().subtract(24, 'hours').format(format),\r\n\t\t\t\t\t\tdateTo: dayjs().format(format),\r\n\t\t\t\t\t},\r\n\t\t\t\t\tstep: 'hour',\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Last 12 Hours',\r\n\t\t\t\t\trange: {\r\n\t\t\t\t\t\tdateFrom: dayjs().subtract(12, 'hours').format(format),\r\n\t\t\t\t\t\tdateTo: dayjs().format(format),\r\n\t\t\t\t\t},\r\n\t\t\t\t\tstep: 'hour',\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t})\r\n\t}\r\n\r\n\t// Days category\r\n\tcategories.push({\r\n\t\tname: 'Days',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Today',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('day').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'day',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Yesterday',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'days').startOf('day').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'days').endOf('day').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'day',\r\n\t\t\t},\r\n\t\t\t...generateLastNDaysPresets([7, 14, 30, 60, 90], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Weeks category\r\n\tcategories.push({\r\n\t\tname: 'Weeks',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Week',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('week').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('week').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'week',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Week',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'weeks').startOf('week').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'weeks').endOf('week').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'week',\r\n\t\t\t},\r\n\t\t\t...generateLastNWeeksPresets([2, 4], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Months category\r\n\tcategories.push({\r\n\t\tname: 'Months',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Month',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('month').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('month').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'month',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Month',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'month').startOf('month').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'month').endOf('month').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'month',\r\n\t\t\t},\r\n\t\t\t...generateLastNMonthsPresets([3, 6], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Quarters category\r\n\tcategories.push({\r\n\t\tname: 'Quarters',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Quarter',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('quarter').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('quarter').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'quarter',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Quarter',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'quarter').startOf('quarter').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'quarter').endOf('quarter').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'quarter',\r\n\t\t\t},\r\n\t\t\t...generateLastNQuartersPresets([2, 4], format),\r\n\t\t],\r\n\t})\r\n\r\n\t// Years category\r\n\tcategories.push({\r\n\t\tname: 'Years',\r\n\t\tpresets: [\r\n\t\t\t{\r\n\t\t\t\tlabel: 'This Year',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('year').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('year').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'year',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Last Year',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().subtract(1, 'year').startOf('year').format(format),\r\n\t\t\t\t\tdateTo: dayjs().subtract(1, 'year').endOf('year').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'year',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tlabel: 'Year to Date',\r\n\t\t\t\trange: {\r\n\t\t\t\t\tdateFrom: dayjs().startOf('year').format(format),\r\n\t\t\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t\t\t},\r\n\t\t\t\tstep: 'day',\r\n\t\t\t},\r\n\t\t],\r\n\t})\r\n\r\n\treturn categories\r\n}\r\n\r\n// Helper functions to generate preset arrays\r\nfunction generateLastNDaysPresets(days: number[], format: string): DateRangePreset[] {\r\n\treturn days.map(n => ({\r\n\t\tlabel: `Last ${n} Days`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n - 1, 'days').startOf('day').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'day' as PresetUnit,\r\n\t}))\r\n}\r\n\r\nfunction generateLastNWeeksPresets(weeks: number[], format: string): DateRangePreset[] {\r\n\treturn weeks.map(n => ({\r\n\t\tlabel: `Last ${n} Weeks`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n, 'weeks').startOf('week').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'week' as PresetUnit,\r\n\t}))\r\n}\r\n\r\nfunction generateLastNMonthsPresets(months: number[], format: string): DateRangePreset[] {\r\n\treturn months.map(n => ({\r\n\t\tlabel: `Last ${n} Months`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n, 'months').startOf('month').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'month' as PresetUnit,\r\n\t}))\r\n}\r\n\r\nfunction generateLastNQuartersPresets(quarters: number[], format: string): DateRangePreset[] {\r\n\treturn quarters.map(n => ({\r\n\t\tlabel: `Last ${n} Quarters`,\r\n\t\trange: {\r\n\t\t\tdateFrom: dayjs().subtract(n, 'quarters').startOf('quarter').format(format),\r\n\t\t\tdateTo: dayjs().endOf('day').format(format),\r\n\t\t},\r\n\t\tstep: 'quarter' as PresetUnit,\r\n\t}))\r\n}","import dayjs from 'dayjs'\n\ntype DateFormat = 'YYYY-MM-DD' | 'YYYY-MM-DDTHH:mm'\n\n/**\n * Ensures that a date string conforms to a specific format.\n * If the date is already in the correct format, it returns the original string.\n * If the date is in a different format, it attempts to convert it to the specified format.\n * If the date is invalid or cannot be converted, it returns null.\n *\n * @param dateString The date string to validate and format.\n * @param expectedFormat The expected date format (e.g., 'YYYY-MM-DD', 'YYYY-MM-DDTHH:mm').\n * @returns The formatted date string, or null if the date is invalid.\n */\nfunction enforceDateFormat(dateString: string | undefined, expectedFormat: DateFormat): string | null {\n\tif (!dateString) {\n\t\treturn null // Or handle the undefined case differently if needed\n\t}\n\n\tconst parsedDate = dayjs(dateString)\n\n\tif (!parsedDate.isValid()) {\n\t\treturn null // Date is invalid\n\t}\n\n\treturn parsedDate.format(expectedFormat)\n}\n\n/**\n * Validates if the initial date range values are in the expected format.\n *\n * @param dateFrom The dateFrom value to validate.\n * @param dateTo The dateTo value to validate.\n * @param expectedFormat The expected date format.\n * @returns An object indicating whether each date is valid, and the formatted date or null if invalid.\n */\nfunction validateInitialDateRange(\n\tdateFrom: string | undefined,\n\tdateTo: string | undefined,\n\texpectedFormat: DateFormat,\n): {\n\tdateFrom: string | null\n\tdateTo: string | null\n\tisValid: boolean\n} {\n\tconst formattedDateFrom = enforceDateFormat(dateFrom, expectedFormat)\n\tconst formattedDateTo = enforceDateFormat(dateTo, expectedFormat)\n\n\tconst isValid = formattedDateFrom !== null && formattedDateTo !== null\n\n\treturn {\n\t\tdateFrom: formattedDateFrom,\n\t\tdateTo: formattedDateTo,\n\t\tisValid,\n\t}\n}\n\nexport { validateInitialDateRange }\n","import { SchmancyElement } from '@mixins/index'\nimport dayjs from 'dayjs'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { DateRangePreset, PresetCategory } from './date-range-presets'\n\ninterface PresetGroup {\n\tname: string\n\tpresets: DateRangePreset[]\n}\n\n/**\n * Dialog content component for date range selection\n *\n * Redesigned with chip-based horizontal flow layout:\n * - Quick Select: Today, Yesterday, This Week, This Month\n * - Days: Last 7/14/30/60/90 Days\n * - Periods: Last Week, Last Month, Last Quarter, Last Year\n * - Year to Date: This Week, This Month, This Quarter, This Year, YTD\n * - Custom Range: Manual date inputs at the bottom\n *\n * @element schmancy-date-range-dialog\n */\n@customElement('schmancy-date-range-dialog')\nexport class SchmancyDateRangeDialog extends SchmancyElement {\n\t@property({ type: String }) type: 'date' | 'datetime-local' = 'date'\n\t@property({ type: Object }) dateFrom: { label: string; value: string } = { label: 'From', value: '' }\n\t@property({ type: Object }) dateTo: { label: string; value: string } = { label: 'To', value: '' }\n\t@property({ type: String }) minDate?: string\n\t@property({ type: String }) maxDate?: string\n\t@property({ type: String }) activePreset: string | null = null\n\t@property({ type: Array }) presetCategories: PresetCategory[] = []\n\n\t/**\n\t * Reorganizes presets into the new grouped layout\n\t */\n\tprivate getPresetGroups(): PresetGroup[] {\n\t\tconst allPresets = this.presetCategories.flatMap(c => c.presets)\n\n\t\t// Quick Select: Today, Yesterday, This Week, This Month\n\t\tconst quickSelectLabels = ['Today', 'Yesterday', 'This Week', 'This Month']\n\t\tconst quickSelect = quickSelectLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\t// Days: Last 7/14/30/60/90 Days\n\t\tconst daysLabels = ['Last 7 Days', 'Last 14 Days', 'Last 30 Days', 'Last 60 Days', 'Last 90 Days']\n\t\tconst days = daysLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\t// Periods: Last Week, Last Month, Last Quarter, Last Year\n\t\tconst periodsLabels = ['Last Week', 'Last Month', 'Last Quarter', 'Last Year']\n\t\tconst periods = periodsLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\t// Year to Date: This Week, This Month, This Quarter, This Year, YTD\n\t\tconst ytdLabels = ['This Week', 'This Month', 'This Quarter', 'This Year', 'Year to Date']\n\t\tconst yearToDate = ytdLabels\n\t\t\t.map(label => allPresets.find(p => p.label === label))\n\t\t\t.filter((p): p is DateRangePreset => p !== undefined)\n\n\t\tconst groups: PresetGroup[] = []\n\n\t\tif (quickSelect.length > 0) {\n\t\t\tgroups.push({ name: 'Quick Select', presets: quickSelect })\n\t\t}\n\t\tif (days.length > 0) {\n\t\t\tgroups.push({ name: 'Days', presets: days })\n\t\t}\n\t\tif (periods.length > 0) {\n\t\t\tgroups.push({ name: 'Periods', presets: periods })\n\t\t}\n\t\tif (yearToDate.length > 0) {\n\t\t\tgroups.push({ name: 'Year to Date', presets: yearToDate })\n\t\t}\n\n\t\treturn groups\n\t}\n\n\tprivate handleFromDateChange(e: Event) {\n\t\tconst input = e.target as HTMLInputElement\n\t\tthis.dateFrom = { ...this.dateFrom, value: input.value }\n\n\t\t// If the new start date is after the current end date, adjust the end date\n\t\tif (this.dateTo.value && dayjs(this.dateFrom.value).isAfter(dayjs(this.dateTo.value))) {\n\t\t\tthis.dateTo = { ...this.dateTo, value: this.dateFrom.value }\n\t\t}\n\n\t\tthis.dispatchEvent(new CustomEvent('date-change', {\n\t\t\tdetail: { dateFrom: this.dateFrom.value, dateTo: this.dateTo.value },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\tprivate handleToDateChange(e: Event) {\n\t\tconst input = e.target as HTMLInputElement\n\t\tthis.dateTo = { ...this.dateTo, value: input.value }\n\n\t\tthis.dispatchEvent(new CustomEvent('date-change', {\n\t\t\tdetail: { dateFrom: this.dateFrom.value, dateTo: this.dateTo.value },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\tprivate handlePresetSelection(preset: DateRangePreset, e: Event) {\n\t\te.stopPropagation()\n\t\t// Parent <schmancy-date-range> listens for `preset-select`, applies\n\t\t// the range, and dispatches 'close' on us — `show()` tears down.\n\t\tthis.dispatchEvent(new CustomEvent('preset-select', {\n\t\t\tdetail: { preset },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\tprivate applyManualDateSelection(e: Event) {\n\t\te.stopPropagation()\n\t\t// Validate dates before applying\n\t\tconst fromDate = dayjs(this.dateFrom.value)\n\t\tconst toDate = dayjs(this.dateTo.value)\n\n\t\tif (!fromDate.isValid() || !toDate.isValid()) {\n\t\t\tthis.dispatchEvent(new CustomEvent('announce', {\n\t\t\t\tdetail: { message: 'Invalid date format. Please check your input.' },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true\n\t\t\t}))\n\t\t\treturn\n\t\t}\n\n\t\t// Parent <schmancy-date-range> listens for `apply-dates`, applies the\n\t\t// range, and dispatches 'close' on us — `show()` tears down.\n\t\tthis.dispatchEvent(new CustomEvent('apply-dates', {\n\t\t\tdetail: {\n\t\t\t\tdateFrom: this.dateFrom.value,\n\t\t\t\tdateTo: this.dateTo.value,\n\t\t\t\tswapIfNeeded: fromDate.isAfter(toDate)\n\t\t\t},\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}))\n\t}\n\n\trender() {\n\t\tconst presetGroups = this.getPresetGroups()\n\n\t\treturn html`\n\t\t\t<div class=\"w-full min-h-[400px] max-h-[80vh] flex flex-col p-4\">\n\t\t\t\t<!-- Preset Groups Section -->\n\t\t\t\t<div class=\"flex-1 overflow-y-auto overflow-x-hidden min-h-0 space-y-4\">\n\t\t\t\t\t${repeat(\n\t\t\t\t\t\tpresetGroups,\n\t\t\t\t\t\tgroup => group.name,\n\t\t\t\t\t\tgroup => html`\n\t\t\t\t\t\t\t<div class=\"space-y-2\">\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"md\" class=\"text-surface-onVariant\">\n\t\t\t\t\t\t\t\t\t${group.name}\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t<div class=\"flex flex-wrap gap-2\">\n\t\t\t\t\t\t\t\t\t${repeat(\n\t\t\t\t\t\t\t\t\t\tgroup.presets,\n\t\t\t\t\t\t\t\t\t\tpreset => preset.label,\n\t\t\t\t\t\t\t\t\t\tpreset => html`\n\t\t\t\t\t\t\t\t\t\t\t<schmancy-filter-chip\n\t\t\t\t\t\t\t\t\t\t\t\t.value=${preset.label}\n\t\t\t\t\t\t\t\t\t\t\t\t.selected=${this.activePreset === preset.label}\n\t\t\t\t\t\t\t\t\t\t\t\t@click=${(e: Event) => this.handlePresetSelection(preset, e)}\n\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"${preset.range.dateFrom} to ${preset.range.dateTo}\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t${preset.label}\n\t\t\t\t\t\t\t\t\t\t\t</schmancy-filter-chip>\n\t\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Divider -->\n\t\t\t\t<schmancy-divider class=\"my-4\"></schmancy-divider>\n\n\t\t\t\t<!-- Custom Range Section -->\n\t\t\t\t<div class=\"space-y-2\">\n\t\t\t\t\t<div class=\"flex items-end gap-3 flex-wrap\">\n\t\t\t\t\t\t<div class=\"flex-1 min-w-[140px]\">\n\t\t\t\t\t\t\t<schmancy-input\n\t\t\t\t\t\t\t\t.type=\"${this.type}\"\n\t\t\t\t\t\t\t\t.label=\"${this.dateFrom.label || 'From'}\"\n\t\t\t\t\t\t\t\t.value=\"${this.dateFrom.value}\"\n\t\t\t\t\t\t\t\tmin=\"${ifDefined(this.minDate)}\"\n\t\t\t\t\t\t\t\tmax=\"${ifDefined(this.maxDate)}\"\n\t\t\t\t\t\t\t\t@change=\"${this.handleFromDateChange}\"\n\t\t\t\t\t\t\t></schmancy-input>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-[140px]\">\n\t\t\t\t\t\t\t<schmancy-input\n\t\t\t\t\t\t\t\t.type=\"${this.type}\"\n\t\t\t\t\t\t\t\t.label=\"${this.dateTo.label || 'To'}\"\n\t\t\t\t\t\t\t\t.value=\"${this.dateTo.value}\"\n\t\t\t\t\t\t\t\tmin=\"${ifDefined(this.dateFrom.value)}\"\n\t\t\t\t\t\t\t\tmax=\"${ifDefined(this.maxDate)}\"\n\t\t\t\t\t\t\t\t@change=\"${this.handleToDateChange}\"\n\t\t\t\t\t\t\t></schmancy-input>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\tvariant=\"filled\"\n\t\t\t\t\t\t\t@click=\"${(e: Event) => this.applyManualDateSelection(e)}\"\n\t\t\t\t\t\t\t?disabled=\"${!this.dateFrom.value || !this.dateTo.value}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tApply\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-date-range-dialog': SchmancyDateRangeDialog\n\t}\n}\n","import dayjs from 'dayjs'\nimport quarterOfYear from 'dayjs/plugin/quarterOfYear'\nimport { html, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { fromEvent, Subscription, takeUntil, timer } from 'rxjs'\nimport { SchmancyFormField } from '@mixins/index'\nimport { show } from '../../../overlay/overlay.service'\nimport { detectDateRangeType, formatDateRange } from './date-range-helpers'\nimport { DateRangePreset, generatePresetCategories, PresetCategory } from './date-range-presets'\nimport { validateInitialDateRange } from './date-utils'\nimport './date-range-dialog'\n\n// Add quarter plugin to dayjs\ndayjs.extend(quarterOfYear)\n\n// Bridge the inner-content events used inside the overlay template down to a\n// `close` event on the same element. `show()` translates a bubbling 'close'\n// event into observable completion + an emission of `event.detail`.\nconst dispatchClose = (target: EventTarget | null): void => {\n\ttarget?.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }))\n}\n\nexport type SchmancyDateRangeChangeEvent = CustomEvent<{\n\tdateFrom: string\n\tdateTo: string\n}>\n\n/**\n * A date range selector that supports presets and manual date input.\n *\n * @element schmancy-date-range\n * @fires change - Fired when the date range changes with dateFrom and dateTo values\n */\n@customElement('schmancy-date-range')\nexport class SchmancyDateRange extends SchmancyFormField() {\n\t// `name`, `disabled`, `required`, `error`, `validationMessage`, `id`,\n\t// `validateOn`, `touched`, `submitted`, `markTouched`, `markSubmitted`,\n\t// FACE wiring, FIELD_CONNECT_EVENT dispatch — all from the mixin.\n\n\t@property({ type: String }) type: 'date' | 'datetime-local' = 'date'\n\t@property({ type: Object }) dateFrom: { label: string; value: string } = { label: 'From', value: '' }\n\t@property({ type: Object }) dateTo: { label: string; value: string } = { label: 'To', value: '' }\n\t@property({ type: String }) minDate?: string\n\t@property({ type: String }) maxDate?: string\n\n\t@property({ type: Array }) customPresets: Array<{\n\t\tlabel: string\n\t\tdateFrom: string\n\t\tdateTo: string\n\t}> = []\n\t@property({ type: String }) format?: string\n\t@property({ type: String }) placeholder = 'Select date range'\n\t@property({ type: Boolean }) clearable = true\n\t@property() step?: 'day' | 'week' | 'month' | 'year' | number\n\t/** When true, collapses to just an icon button on mobile screens */\n\t@property({ type: Boolean }) collapse = false\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private selectedDateRange: string = ''\n\t@state() private activePreset: string | null = null\n\t@state() private announceMessage: string = ''\n\n\t// Default presets\n\tprivate presetRanges: DateRangePreset[] = []\n\n\t// Categorized presets\n\tprivate presetCategories: PresetCategory[] = []\n\n\t// Memoization cache\n\tprivate memoizedPresets = new Map<string, PresetCategory[]>()\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\t// Reset open state when element is moved/removed to prevent stale state\n\t\tthis.isOpen = false\n\t}\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.initPresetRanges()\n\n\t\t// Validate initial date range\n\t\tconst dateFormat = this.getDateFormat() as 'YYYY-MM-DD' | 'YYYY-MM-DDTHH:mm'\n\t\tconst validatedRange = validateInitialDateRange(this.dateFrom.value, this.dateTo.value, dateFormat)\n\n\t\tif (validatedRange.isValid) {\n\t\t\tthis.dateFrom.value = validatedRange.dateFrom!\n\t\t\tthis.dateTo.value = validatedRange.dateTo!\n\t\t\tthis.updateSelectedDateRange()\n\t\t} else {\n\t\t\tconst now = dayjs().format(dateFormat)\n\t\t\tthis.dateFrom.value = now\n\t\t\tthis.dateTo.value = now\n\t\t\tthis.updateSelectedDateRange()\n\t\t}\n\n\t\t// Set up global event handlers using RxJS\n\t\tthis.setupEventHandlers()\n\t}\n\n\tprivate setupEventHandlers() {\n\t\t// Handle keyboard navigation\n\t\tfromEvent<KeyboardEvent>(document, 'keydown')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(event => {\n\t\t\t\tthis.handleKeyboardNavigation(event)\n\t\t\t})\n\t}\n\n\tupdated(changedProps: PropertyValues) {\n\t\tsuper.updated(changedProps)\n\n\t\tif (\n\t\t\t(changedProps.has('dateFrom') || changedProps.has('dateTo')) &&\n\t\t\t(this.dateFrom?.value !== undefined || this.dateTo?.value !== undefined)\n\t\t) {\n\t\t\tthis.updateSelectedDateRange()\n\t\t}\n\t}\n\n\toverride willUpdate(changed: PropertyValues): void {\n\t\tsuper.willUpdate(changed)\n\t\tif (changed.has('dateFrom') || changed.has('dateTo') || changed.has('name')) {\n\t\t\t// Multi-entry FACE submission: setFormValue accepts a FormData\n\t\t\t// object whose entries are appended to the owning form's FormData.\n\t\t\t// native `new FormData(form)` then sees both `${name}From` and\n\t\t\t// `${name}To` without any consumer-side parsing.\n\t\t\tif (this.name && !this.disabled) {\n\t\t\t\tconst fd = new FormData()\n\t\t\t\tif (this.dateFrom?.value) fd.append(`${this.name}From`, this.dateFrom.value)\n\t\t\t\tif (this.dateTo?.value) fd.append(`${this.name}To`, this.dateTo.value)\n\t\t\t\tthis.internals?.setFormValue(fd)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setFormValue(null)\n\t\t\t}\n\t\t\tthis.checkValidity()\n\t\t}\n\t\tif (changed.has('required') || changed.has('disabled')) {\n\t\t\tthis.checkValidity()\n\t\t}\n\t}\n\n\t/**\n\t * Date-range validity is `both dates non-empty` when required.\n\t * (Order/range constraints are out of scope here — they belong to a\n\t * domain-specific schema layer.)\n\t */\n\toverride checkValidity(): boolean {\n\t\tif (this.disabled) {\n\t\t\tthis.internals?.setValidity({})\n\t\t\treturn true\n\t\t}\n\t\tconst fromEmpty = !this.dateFrom?.value\n\t\tconst toEmpty = !this.dateTo?.value\n\t\tconst isValid = !this.required || (!fromEmpty && !toEmpty)\n\t\tconst message = isValid ? '' : 'Please select a date range.'\n\n\t\tthis.internals?.setValidity(\n\t\t\tisValid ? {} : { valueMissing: true },\n\t\t\tisValid ? undefined : message,\n\t\t)\n\n\t\tif (this._shouldShowError()) {\n\t\t\tthis.error = !isValid\n\t\t\tthis.validationMessage = message\n\t\t}\n\t\treturn isValid\n\t}\n\n\t/**\n\t * Override — emit `${name}From` and `${name}To` flat-suffix entries (the\n\t * plan's chosen multi-entry encoding; native to JS consumers without\n\t * server-side bracket parsing).\n\t */\n\toverride toFormEntries(): Array<[string, FormDataEntryValue]> {\n\t\tif (!this.name || this.disabled) return []\n\t\tconst entries: Array<[string, FormDataEntryValue]> = []\n\t\tif (this.dateFrom?.value) entries.push([`${this.name}From`, this.dateFrom.value])\n\t\tif (this.dateTo?.value) entries.push([`${this.name}To`, this.dateTo.value])\n\t\treturn entries\n\t}\n\n\t/** `dirty` tracks the underlying date strings, not the wide-union value. */\n\tprivate _dateFromDefault: string = ''\n\tprivate _dateToDefault: string = ''\n\toverride firstUpdated(changed: PropertyValues): void {\n\t\tsuper.firstUpdated(changed)\n\t\tthis._dateFromDefault = this.dateFrom?.value ?? ''\n\t\tthis._dateToDefault = this.dateTo?.value ?? ''\n\t}\n\toverride get dirty(): boolean {\n\t\treturn (\n\t\t\t(this.dateFrom?.value ?? '') !== this._dateFromDefault ||\n\t\t\t(this.dateTo?.value ?? '') !== this._dateToDefault\n\t\t)\n\t}\n\n\toverride resetForm(): void {\n\t\tthis.dateFrom = { ...this.dateFrom, value: this._dateFromDefault }\n\t\tthis.dateTo = { ...this.dateTo, value: this._dateToDefault }\n\t\tsuper.resetForm()\n\t}\n\n\tprivate initPresetRanges() {\n\t\tconst format = this.getDateFormat()\n\t\tconst cacheKey = `${this.type}-${format}-${JSON.stringify(this.customPresets)}`\n\t\t\n\t\t// Check memoization cache\n\t\tif (this.memoizedPresets.has(cacheKey)) {\n\t\t\tconst cached = this.memoizedPresets.get(cacheKey)!\n\t\t\tthis.presetCategories = cached\n\t\t\tthis.presetRanges = []\n\t\t\tcached.forEach(category => {\n\t\t\t\tthis.presetRanges.push(...category.presets)\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\t// Generate preset categories\n\t\tthis.presetCategories = generatePresetCategories(format, this.type === 'datetime-local')\n\n\t\t// Flatten presets for other methods that expect a flat list\n\t\tthis.presetRanges = []\n\t\tthis.presetCategories.forEach(category => {\n\t\t\tthis.presetRanges.push(...category.presets)\n\t\t})\n\n\t\t// Add custom presets if provided\n\t\tif (this.customPresets && this.customPresets.length > 0) {\n\t\t\tconst customCategory: PresetCategory = {\n\t\t\t\tname: 'Custom',\n\t\t\t\tpresets: this.customPresets.map(preset => ({\n\t\t\t\t\tlabel: preset.label,\n\t\t\t\t\trange: {\n\t\t\t\t\t\tdateFrom: preset.dateFrom,\n\t\t\t\t\t\tdateTo: preset.dateTo,\n\t\t\t\t\t},\n\t\t\t\t\tstep: 'day' as const,\n\t\t\t\t})),\n\t\t\t}\n\n\t\t\tthis.presetCategories.push(customCategory)\n\t\t\tthis.presetRanges.push(...customCategory.presets)\n\t\t}\n\t\t\n\t\t// Cache the result\n\t\tthis.memoizedPresets.set(cacheKey, [...this.presetCategories])\n\t}\n\n\tprivate getDateFormat(): string {\n\t\treturn this.format || (this.type === 'date' ? 'YYYY-MM-DD' : 'YYYY-MM-DDTHH:mm')\n\t}\n\n\t/**\n\t * Creates a concise display format for the selected date range\n\t */\n\tprivate updateSelectedDateRange() {\n\t\t// Find matching preset\n\t\tconst preset = this.presetRanges.find(\n\t\t\tp => p.range.dateFrom === this.dateFrom.value && p.range.dateTo === this.dateTo.value,\n\t\t)\n\n\t\tif (preset) {\n\t\t\t// If matches a preset, just use the preset name\n\t\t\tthis.selectedDateRange = preset.label\n\t\t\tthis.activePreset = preset.label\n\t\t\treturn\n\t\t}\n\n\t\t// If we didn't find a preset match, check if we should update the active preset\n\t\tthis.checkAndUpdateActivePreset(this.dateFrom.value, this.dateTo.value)\n\n\t\t// Custom date range - create concise format\n\t\tthis.activePreset = null\n\t\tthis.selectedDateRange = formatDateRange(this.dateFrom.value, this.dateTo.value, this.type, this.placeholder)\n\t}\n\n\tprivate setDateRange(dateFrom: string, dateTo: string) {\n\t\tthis.dateFrom.value = dateFrom\n\t\tthis.dateTo.value = dateTo\n\t\tthis.updateSelectedDateRange()\n\n\t\t// Announce change to screen readers\n\t\tthis.announceToScreenReader(`Date range updated: ${this.selectedDateRange}`)\n\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<{ dateFrom: string; dateTo: string }>('change', {\n\t\t\t\tdetail: { dateFrom, dateTo },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate toggleDropdown(e: MouseEvent) {\n\t\te.stopPropagation()\n\t\tif (this.disabled || this.step !== undefined) return\n\n\t\tif (this.isOpen) {\n\t\t\tthis.closeDropdown()\n\t\t} else {\n\t\t\tthis.openDropdown(e)\n\t\t}\n\t}\n\n\tprivate _overlaySubscription: Subscription | null = null\n\n\tprivate openDropdown(e?: MouseEvent) {\n\t\tif (this.disabled || this.step !== undefined) return\n\n\t\tthis.dispatchEvent(new CustomEvent('beforeopen', { bubbles: true, composed: true }))\n\t\tthis.isOpen = true\n\n\t\t// Inline-template overlay. Inner handlers dispatch a 'close' event\n\t\t// from the dialog itself (via the module-scoped `dispatchClose`),\n\t\t// which `show()` translates into observable completion + an emission.\n\t\t// Layout (centered vs sheet) is chosen by the overlay system based on\n\t\t// viewport / anchor presence.\n\t\tconst dialogContent = html`\n\t\t\t<schmancy-date-range-dialog\n\t\t\t\t.type=\"${this.type}\"\n\t\t\t\t.dateFrom=\"${this.dateFrom}\"\n\t\t\t\t.dateTo=\"${this.dateTo}\"\n\t\t\t\t.minDate=\"${this.minDate}\"\n\t\t\t\t.maxDate=\"${this.maxDate}\"\n\t\t\t\t.activePreset=\"${this.activePreset}\"\n\t\t\t\t.presetCategories=\"${this.presetCategories}\"\n\t\t\t\t@preset-select=\"${(ev: CustomEvent) => {\n\t\t\t\t\tthis.activePreset = ev.detail.preset.label\n\t\t\t\t\tthis.setDateRange(ev.detail.preset.range.dateFrom, ev.detail.preset.range.dateTo)\n\t\t\t\t\tdispatchClose(ev.currentTarget)\n\t\t\t\t}}\"\n\t\t\t\t@date-change=\"${() => this.updateSelectedDateRange()}\"\n\t\t\t\t@apply-dates=\"${(ev: CustomEvent) => {\n\t\t\t\t\tconst { dateFrom, dateTo, swapIfNeeded } = ev.detail\n\t\t\t\t\tif (swapIfNeeded) {\n\t\t\t\t\t\tthis.setDateRange(dateTo, dateFrom)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.setDateRange(dateFrom, dateTo)\n\t\t\t\t\t}\n\t\t\t\t\tdispatchClose(ev.currentTarget)\n\t\t\t\t}}\"\n\t\t\t\t@announce=\"${(ev: CustomEvent) => this.announceToScreenReader(ev.detail.message)}\"\n\t\t\t></schmancy-date-range-dialog>\n\t\t`\n\n\t\tthis._overlaySubscription?.unsubscribe()\n\t\tthis._overlaySubscription = show(dialogContent, { anchor: e })\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe({\n\t\t\t\tcomplete: () => {\n\t\t\t\t\tthis.isOpen = false\n\t\t\t\t\tthis._overlaySubscription = null\n\t\t\t\t},\n\t\t\t})\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis._overlaySubscription?.unsubscribe()\n\t\tthis._overlaySubscription = null\n\t\tthis.isOpen = false\n\t}\n\n\t/**\n\t * Shifts the date range based on the step property\n\t */\n\tprivate shiftDateRange(direction: number, e: Event) {\n\t\te.stopPropagation()\n\n\t\tif (!this.dateFrom.value || !this.dateTo.value) return\n\n\t\tconst fromDate = dayjs(this.dateFrom.value)\n\t\tconst toDate = dayjs(this.dateTo.value)\n\n\t\tif (!fromDate.isValid() || !toDate.isValid()) return\n\n\t\tconst format = this.getDateFormat()\n\t\tconst dir = direction > 0 ? 1 : -1\n\t\tconst daysDiff = toDate.diff(fromDate, 'day') + 1\n\n\t\t// Determine shift amount and unit\n\t\tlet amount: number\n\t\tlet unit: dayjs.ManipulateType\n\n\t\tif (this.step !== undefined) {\n\t\t\tif (typeof this.step === 'number') {\n\t\t\t\tamount = dir * this.step\n\t\t\t\tunit = 'day'\n\t\t\t} else if (this.step === 'day') {\n\t\t\t\tamount = dir * daysDiff\n\t\t\t\tunit = 'day'\n\t\t\t} else {\n\t\t\t\tamount = dir\n\t\t\t\tunit = this.step\n\t\t\t}\n\t\t} else {\n\t\t\t// Auto-detect based on date range\n\t\t\tconst rangeType = detectDateRangeType(fromDate, toDate)\n\t\t\tif (rangeType.isFullYear) {\n\t\t\t\tamount = dir\n\t\t\t\tunit = 'year'\n\t\t\t} else if (rangeType.isFullMonth) {\n\t\t\t\tamount = dir\n\t\t\t\tunit = 'month'\n\t\t\t} else if (rangeType.isFullWeek) {\n\t\t\t\tamount = dir\n\t\t\t\tunit = 'week'\n\t\t\t} else {\n\t\t\t\tamount = dir * daysDiff\n\t\t\t\tunit = 'day'\n\t\t\t}\n\t\t}\n\n\t\tconst newFromDate = fromDate.add(amount, unit)\n\t\tconst newToDate = toDate.add(amount, unit)\n\n\t\t// Validate against min/max dates\n\t\tif (this.minDate && newFromDate.isBefore(dayjs(this.minDate))) return\n\t\tif (this.maxDate && newToDate.isAfter(dayjs(this.maxDate))) return\n\n\t\t// Update the date range\n\t\tthis.setDateRange(newFromDate.format(format), newToDate.format(format))\n\t\tthis.checkAndUpdateActivePreset(newFromDate.format(format), newToDate.format(format))\n\t}\n\n\t/**\n\t * Handle keyboard navigation for accessibility\n\t */\n\tprivate handleKeyboardNavigation(event: KeyboardEvent) {\n\t\tconst key = event.key\n\t\t\n\t\t// Handle date navigation keys\n\t\tif (this.dateFrom.value && this.dateTo.value && !this.disabled) {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'PageUp':\n\t\t\t\t\tif (event.target === this || this.contains(event.target as Node)) {\n\t\t\t\t\t\tthis.shiftDateRange(-1, event)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'PageDown':\n\t\t\t\t\tif (event.target === this || this.contains(event.target as Node)) {\n\t\t\t\t\t\tthis.shiftDateRange(1, event)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'Home':\n\t\t\t\t\tif (event.ctrlKey && (event.target === this || this.contains(event.target as Node))) {\n\t\t\t\t\t\t// Ctrl+Home: Jump to start of current month\n\t\t\t\t\t\tconst currentFrom = dayjs(this.dateFrom.value)\n\t\t\t\t\t\tconst currentTo = dayjs(this.dateTo.value)\n\t\t\t\t\t\tconst monthStart = currentFrom.startOf('month')\n\t\t\t\t\t\tconst daysDiff = currentTo.diff(currentFrom, 'day')\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.setDateRange(\n\t\t\t\t\t\t\tmonthStart.format(this.getDateFormat()),\n\t\t\t\t\t\t\tmonthStart.add(daysDiff, 'day').format(this.getDateFormat())\n\t\t\t\t\t\t)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'End':\n\t\t\t\t\tif (event.ctrlKey && (event.target === this || this.contains(event.target as Node))) {\n\t\t\t\t\t\t// Ctrl+End: Jump to end of current month\n\t\t\t\t\t\tconst currentFrom = dayjs(this.dateFrom.value)\n\t\t\t\t\t\tconst currentTo = dayjs(this.dateTo.value)\n\t\t\t\t\t\tconst daysDiff = currentTo.diff(currentFrom, 'day')\n\t\t\t\t\t\tconst monthEnd = currentTo.endOf('month')\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.setDateRange(\n\t\t\t\t\t\t\tmonthEnd.subtract(daysDiff, 'day').format(this.getDateFormat()),\n\t\t\t\t\t\t\tmonthEnd.format(this.getDateFormat())\n\t\t\t\t\t\t)\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the current date range matches any predefined preset,\n\t * and updates the activePreset accordingly\n\t */\n\tprivate checkAndUpdateActivePreset(fromDate: string, toDate: string) {\n\t\t// Find a preset that matches the current date range\n\t\tconst matchingPreset = this.presetRanges.find(\n\t\t\tpreset => preset.range.dateFrom === fromDate && preset.range.dateTo === toDate,\n\t\t)\n\n\t\tif (matchingPreset) {\n\t\t\tthis.activePreset = matchingPreset.label\n\t\t} else {\n\t\t\tthis.activePreset = null\n\t\t}\n\t}\n\n\t/**\n\t * Check if we can navigate backward\n\t */\n\tprivate canNavigateBackward(): boolean {\n\t\tif (!this.dateFrom.value || !this.minDate) return true\n\t\t\n\t\tconst fromDate = dayjs(this.dateFrom.value)\n\t\tconst minDate = dayjs(this.minDate)\n\t\t\n\t\t// If current start date is already at or before min date, can't go back\n\t\treturn fromDate.isAfter(minDate)\n\t}\n\n\t/**\n\t * Check if we can navigate forward\n\t */\n\tprivate canNavigateForward(): boolean {\n\t\tif (!this.dateTo.value || !this.maxDate) return true\n\t\t\n\t\tconst toDate = dayjs(this.dateTo.value)\n\t\tconst maxDate = dayjs(this.maxDate)\n\t\t\n\t\t// If current end date is already at or after max date, can't go forward\n\t\treturn toDate.isBefore(maxDate)\n\t}\n\n\t/**\n\t * Announce messages to screen readers\n\t */\n\tprivate announceToScreenReader(message: string) {\n\t\tthis.announceMessage = message\n\t\t// Clear the message after announcement\n\t\ttimer(100)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.announceMessage = ''\n\t\t\t})\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative ${this.disabled ? 'opacity-60 pointer-events-none' : ''}\">\n\t\t\t\t<!-- Screen reader announcements -->\n\t\t\t\t<div class=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n\t\t\t\t\t${this.announceMessage}\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Collapsed: icon-only on mobile when collapse=true -->\n\t\t\t\t<schmancy-icon-button\n\t\t\t\t\tclass=\"${this.collapse ? 'lg:hidden' : 'hidden'}\"\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Select date range. Current: ${this.selectedDateRange || 'No date selected'}\"\n\t\t\t\t\t@click=${(e: MouseEvent) => this.toggleDropdown(e)}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t>\n\t\t\t\t\tdate_range\n\t\t\t\t</schmancy-icon-button>\n\n\t\t\t\t<!-- Full UI: always visible when collapse=false, or lg+ when collapse=true -->\n\t\t\t\t<section @click=${(event: Event) => event.stopPropagation()} class=\"${this.collapse ? 'hidden lg:flex' : 'flex'}\">\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Previous ${this.activePreset ? this.activePreset.toLowerCase() : 'date range'}\"\n\t\t\t\t\t\t\t@click=${(e: Event) => this.shiftDateRange(-1, e)}\n\t\t\t\t\t\t\t?disabled=${this.disabled || !this.dateFrom.value || !this.dateTo.value || !this.canNavigateBackward()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tarrow_left\n\t\t\t\t\t\t</schmancy-icon-button>\n\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\tclass=\"w-max\"\n\t\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-haspopup=\"menu\"\n\t\t\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\t\t\taria-label=\"Select date range. Current: ${this.selectedDateRange || 'No date selected'}\"\n\t\t\t\t\t\t\taria-readonly=\"${this.step !== undefined}\"\n\t\t\t\t\t\t\t@click=${(e: MouseEvent) => this.toggleDropdown(e)}\n\t\t\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\t\t\tstyle=\"${this.step !== undefined ? 'cursor: default;' : ''}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${this.selectedDateRange || this.placeholder}\n\t\t\t\t\t\t</schmancy-button>\n\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Next ${this.activePreset ? this.activePreset.toLowerCase() : 'date range'}\"\n\t\t\t\t\t\t\t@click=${(e: Event) => this.shiftDateRange(1, e)}\n\t\t\t\t\t\t\t?disabled=${this.disabled || !this.dateFrom.value || !this.dateTo.value || !this.canNavigateForward()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tarrow_right\n\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t`\n\t}\n}"],"x_google_ignoreList":[0,1],"mappings":"uUAAA,IAAU,EAAA,EAAE,EAAA,UAAA,CAA6M,aAAa,IAAU,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,6FAA6F,EAAE,sFAAsF,EAAE,CAAC,KAAK,KAAK,SAAS,2DAA2D,MAAM,IAAA,CAAK,OAAO,wFAAwF,MAAM,IAAA,CAAK,QAAQ,SAAS,EAAA,CAAG,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK,KAAA,CAAM,EAAE,EAAE,IAAI,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,EAAE,IAAI,KAAA,CAAM,EAAE,SAAS,EAAE,EAAE,EAA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A,CAAU,EAAA,UAAA,WAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CAGpB,EAAA,UAAA,SAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CACA,EAAA,UAAA,oBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CACA,EAAA,UAAA,eAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CACA,EAAA,UAAA,kBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA5BM,sBAAA,CAAA,CAAsB,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./date-range-CsJfjbmi.cjs`);Object.defineProperty(exports,`SchmancyDateRange`,{enumerable:!0,get:function(){return e.t}}),exports.validateInitialDateRange=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./date-range-VA1mi1N7.cjs`);Object.defineProperty(exports,`SchmancyDateRange`,{enumerable:!0,get:function(){return e.t}}),exports.validateInitialDateRange=e.n;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./date-range-aPSmSBhk.js";
1
+ import { n as e, t } from "./date-range-CAqB-B0M.js";
2
2
  export { t as SchmancyDateRange, e as validateInitialDateRange };
@@ -3,7 +3,7 @@ import { a as n } from "./active-host-BP0zy_Y9.js";
3
3
  import { o as r } from "./state-CHbIt2Dw.js";
4
4
  import "./autocomplete-Ds3Q2cwR.js";
5
5
  import "./checkbox-BNdg57Om.js";
6
- import "./date-range-aPSmSBhk.js";
6
+ import "./date-range-CAqB-B0M.js";
7
7
  import "./input-Q0fm34Co.js";
8
8
  import "./radio-group-D9MU1Mxz.js";
9
9
  import "./range.js";
@@ -1 +1 @@
1
- {"version":3,"file":"form-Bz5WamuM.js","names":[],"sources":["../src/form/form-state.ts","../src/form/form.ts","../src/form/form-summary.ts"],"sourcesContent":["/**\n * Form-level submit state — consumed by `<schmancy-form>` and any descendant\n * (e.g. `<schmancy-button type=\"submit\">` to drive its loading/aria-busy).\n *\n * `<schmancy-form>` wraps its render output in `<schmancy-context\n * .provides=${[formSubmitState]}>` so each instance gets an isolated copy\n * via the schmancy state library's resolveContextual mechanism. Reads of\n * `formSubmitState.value` and writes via `formSubmitState.set(...)` inside\n * the form's subtree resolve to the per-form copy automatically — no\n * `@lit/context` plumbing in user code.\n */\n\nimport { state } from '../state'\n\nexport type FormError = {\n\tmessage: string\n\tcode?: string\n}\n\nexport type FormSubmitState = {\n\tstatus: 'idle' | 'submitting' | 'success' | 'error'\n\terror: FormError | null\n\t/** Increments on every submit attempt — RHF parity. */\n\tsubmitCount: number\n}\n\nexport const formSubmitState = state<FormSubmitState>('schmancy/form-submit').memory({\n\tstatus: 'idle',\n\terror: null,\n\tsubmitCount: 0,\n})\n","/**\n * `<schmancy-form>` — schmancy form owner with isolated submit state.\n *\n * Architecture:\n * - Extends `SchmancyElement` (shadow DOM, RxJS + `disconnecting` conventions).\n * - Renders content inside `<schmancy-context .provides=${[formSubmitState]}>`\n * so each form instance gets an isolated copy of the submit state via the\n * schmancy state library — no `@lit/context` plumbing in user code.\n * - Inner `<form novalidate>` is the native-semantics trigger for Enter-key\n * submit and `type=submit` button activation.\n * - Fields self-register via `FIELD_CONNECT_EVENT` (composed event from\n * `FormFieldMixin.connectedCallback`). Stale refs (from disconnected\n * fields) are filtered by `isConnected` at iteration time.\n *\n * Schema seam — pass any `{ parse(input): T }` object (zod, valibot, ArkType,\n * etc.) via the `schema` property to get typed `submit` event detail.\n */\n\nimport { html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\nimport { SchmancyElement } from '../../mixins'\nimport { FIELD_CONNECT_EVENT, type IFormFieldMixin } from '../../mixins/formField.mixin'\nimport { formSubmitState, type FormSubmitState, type FormError } from './form-state'\n\n/** Structural type matching zod, valibot, ArkType, etc. — any schema with `.parse()`. */\nexport interface ParseSchema<T = unknown> {\n\tparse(input: unknown): T\n}\n\nconst isButton = (node: EventTarget): node is HTMLElement => {\n\tif (!(node instanceof HTMLElement)) return false\n\treturn node.tagName === 'BUTTON' || node.tagName === 'SCHMANCY-BUTTON'\n}\n\n/** Submit event detail. `data` is typed when `schema` is set. */\nexport type SchmancyFormSubmitDetail<T = Record<string, FormDataEntryValue>> = {\n\tdata: T\n\tformData: FormData\n\t/**\n\t * Register a promise that gates the form's success/error state. If unused,\n\t * the form synchronously flips to `success` after dispatch. If used,\n\t * `success`/`error` reflect the promise's outcome.\n\t */\n\tuntil(p: Promise<unknown>): void\n}\n\n@customElement('schmancy-form')\nexport default class SchmancyForm<TSchema extends ParseSchema | undefined = undefined>\n\textends SchmancyElement {\n\tpublic static readonly tagName: string = 'schmancy-form'\n\n\t/**\n\t * Optional schema for parsing FormData on submit. Anything with a\n\t * `.parse(input)` method works (zod, valibot, ArkType). When set, the\n\t * `submit` event's `detail.data` is typed `z.infer<TSchema>`.\n\t */\n\t@property({ attribute: false })\n\tschema?: TSchema\n\n\t/** Skip built-in browser constraint validation. Mirrors `<form novalidate>`. */\n\t@property({ type: Boolean })\n\tnovalidate: boolean = true\n\n\tprivate _fields = new Set<IFormFieldMixin>()\n\tprivate _submitting = false\n\n\t/**\n\t * Local mirror of the submit-state status — drives the inline live region\n\t * synchronously. Independent of the schmancy-state library's resolution\n\t * chain (which has known cross-await fallback semantics) so the AT-facing\n\t * announcement is always correct for this form instance.\n\t */\n\t@state() private _liveStatus: 'idle' | 'submitting' | 'success' | 'error' = 'idle'\n\t@state() private _liveError: string = ''\n\tprivate _internals: ElementInternals | undefined = (() => {\n\t\ttry {\n\t\t\treturn this.attachInternals()\n\t\t} catch {\n\t\t\treturn undefined\n\t\t}\n\t})()\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Forbid nested <schmancy-form>.\n\t\tif (this.parentElement?.closest('schmancy-form')) {\n\t\t\tconsole.error('[schmancy-form] nested <schmancy-form> is not supported')\n\t\t\treturn\n\t\t}\n\n\t\t// Field registry — composed event from FormFieldMixin.connectedCallback.\n\t\tfromEvent<CustomEvent<IFormFieldMixin>>(this, FIELD_CONNECT_EVENT)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => this._fields.add(e.detail))\n\n\t\t// Submit-trigger interception — slotted descendants live in light DOM\n\t\t// while the inner <form> is in shadow DOM, so native form-association\n\t\t// across the shadow boundary doesn't work for `<button type=submit>`.\n\t\t// Capture clicks on type=submit buttons (native + schmancy-button) and\n\t\t// Enter keys on registered fields, then call the inner form's\n\t\t// requestSubmit() which fires the same native submit event handler\n\t\t// chain that a directly-associated button would have triggered.\n\t\tfromEvent<MouseEvent>(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => this._maybeRequestSubmit(e))\n\t\tfromEvent<KeyboardEvent>(this, 'keydown')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.key !== 'Enter' || e.shiftKey) return\n\t\t\t\t// Skip Enter inside <textarea> (newline) and contenteditable.\n\t\t\t\tconst target = e.target as HTMLElement | null\n\t\t\t\tif (target?.tagName === 'TEXTAREA') return\n\t\t\t\tif (target?.isContentEditable) return\n\t\t\t\tthis._maybeRequestSubmit(e)\n\t\t\t})\n\t}\n\n\tprivate _maybeRequestSubmit(e: Event): void {\n\t\t// On click: trigger only when the target is a type=submit button.\n\t\t// On keydown(Enter): always trigger if focus is on a registered field.\n\t\t// type=reset is handled separately in _maybeReset.\n\t\tif (e.type === 'click') {\n\t\t\tconst path = e.composedPath()\n\t\t\tconst resetBtn = path.find(\n\t\t\t\tnode => isButton(node) && node.getAttribute('type') === 'reset',\n\t\t\t)\n\t\t\tif (resetBtn) {\n\t\t\t\te.preventDefault()\n\t\t\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\t\t\tform?.reset()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst submitBtn = path.find(\n\t\t\t\tnode => isButton(node) && node.getAttribute('type') === 'submit',\n\t\t\t)\n\t\t\tif (!submitBtn) return\n\t\t\te.preventDefault()\n\t\t}\n\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\tform?.requestSubmit()\n\t}\n\n\t/** Active fields — drops stale refs from disconnected nodes. */\n\tprivate get _activeFields(): IFormFieldMixin[] {\n\t\treturn [...this._fields].filter(f => f.isConnected)\n\t}\n\n\tprivate async _onSubmit(e: SubmitEvent): Promise<void> {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t\tif (this._submitting) return\n\n\t\t// If any field has an async validator pending, wait for them all to\n\t\t// settle before deciding validity. This is the hard-block model: the\n\t\t// user clicks submit, the form holds (aria-busy=\"true\"), waits for\n\t\t// validators, then proceeds with the truth they reported.\n\t\tconst pendingValidators = this._activeFields.filter(f => f.isValidating)\n\t\tif (pendingValidators.length > 0) {\n\t\t\tthis._broadcastStatus('submitting')\n\t\t\tawait new Promise<void>(resolve => {\n\t\t\t\tconst tick = () => {\n\t\t\t\t\tif (this._activeFields.every(f => !f.isValidating)) resolve()\n\t\t\t\t\telse requestAnimationFrame(tick)\n\t\t\t\t}\n\t\t\t\ttick()\n\t\t\t})\n\t\t}\n\n\t\t// Phase 4 — submit forces error display on every field.\n\t\tthis._activeFields.forEach(f => f.markSubmitted())\n\n\t\t// Validate; success path entered ONLY if all valid.\n\t\tconst allValid = this._activeFields.every(f => f.checkValidity())\n\t\tconst fs = formSubmitState.value\n\t\tif (!allValid) {\n\t\t\tformSubmitState.set({\n\t\t\t\t...fs,\n\t\t\t\tstatus: 'error',\n\t\t\t\terror: { message: 'Validation failed' },\n\t\t\t})\n\t\t\tthis._broadcastStatus('error', 'Validation failed. Please correct the highlighted fields.')\n\t\t\tconst firstInvalid = this._activeFields.find(f => f.error) as unknown as\n\t\t\t\t| HTMLElement\n\t\t\t\t| undefined\n\t\t\tfirstInvalid?.focus()\n\t\t\treturn\n\t\t}\n\n\t\tthis._submitting = true\n\t\tformSubmitState.set({\n\t\t\t...fs,\n\t\t\tstatus: 'submitting',\n\t\t\terror: null,\n\t\t\tsubmitCount: fs.submitCount + 1,\n\t\t})\n\t\tthis._broadcastStatus('submitting')\n\n\t\t// Build payload from the registered fields' contracted toFormEntries().\n\t\tconst formData = new FormData()\n\t\tfor (const field of this._activeFields) {\n\t\t\tfor (const [k, v] of field.toFormEntries()) formData.append(k, v)\n\t\t}\n\t\tconst raw = Object.fromEntries(formData)\n\t\tconst data = this.schema ? this.schema.parse(raw) : raw\n\n\t\t// Awaitable submit — consumers register promises via e.detail.until(p).\n\t\tconst pending: Promise<unknown>[] = []\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancyFormSubmitDetail<unknown>>('submit', {\n\t\t\t\tdetail: {\n\t\t\t\t\tdata,\n\t\t\t\t\tformData,\n\t\t\t\t\tuntil: (p: Promise<unknown>) => pending.push(p),\n\t\t\t\t},\n\t\t\t}),\n\t\t)\n\n\t\ttry {\n\t\t\tawait Promise.all(pending)\n\t\t\tformSubmitState.set({\n\t\t\t\t...formSubmitState.value,\n\t\t\t\tstatus: 'success',\n\t\t\t\terror: null,\n\t\t\t})\n\t\t\tthis._broadcastStatus('success')\n\t\t} catch (err) {\n\t\t\tconst message = err instanceof Error ? err.message : String(err)\n\t\t\tformSubmitState.set({\n\t\t\t\t...formSubmitState.value,\n\t\t\t\tstatus: 'error',\n\t\t\t\terror: { message },\n\t\t\t})\n\t\t\tthis._broadcastStatus('error', message)\n\t\t} finally {\n\t\t\tthis._submitting = false\n\t\t}\n\t}\n\n\tprivate _onReset(e: Event): void {\n\t\te.stopPropagation()\n\t\tthis._activeFields.forEach(f => f.resetForm())\n\t\tformSubmitState.set({ status: 'idle', error: null, submitCount: 0 })\n\t\tthis._broadcastStatus('idle')\n\t\tthis.dispatchEvent(new CustomEvent('reset'))\n\t}\n\n\tprivate _broadcastStatus(status: FormSubmitState['status'], errorMessage?: string): void {\n\t\tthis._liveStatus = status\n\t\tthis._liveError = errorMessage ?? ''\n\t\tconst states = this._internals?.states\n\t\tif (states) {\n\t\t\tfor (const s of ['submitting', 'success', 'error', 'idle']) states.delete(s)\n\t\t\tstates.add(status)\n\t\t}\n\t\t// aria-busy on the host while submitting (WCAG 2.2 AA — disabled buttons\n\t\t// drop from tab order; keep them focusable, signal busy via aria).\n\t\tif (status === 'submitting') this.setAttribute('aria-busy', 'true')\n\t\telse this.removeAttribute('aria-busy')\n\t\t// Public formstate event — external state stores subscribe without\n\t\t// having to consume formSubmitState directly.\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<FormSubmitState>('formstate', {\n\t\t\t\tdetail: { ...formSubmitState.value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Server-side error mapping (RHF `setError(name, ...)`-equivalent).\n\t * Sets `setCustomValidity(message)` on the matching field and ensures the\n\t * error displays by marking it submitted.\n\t */\n\tpublic setFieldError(name: string, message: string): boolean {\n\t\tconst field = this._activeFields.find(f => f.name === name)\n\t\tif (!field) return false\n\t\tfield.setCustomValidity(message)\n\t\tfield.markSubmitted()\n\t\treturn true\n\t}\n\n\t/**\n\t * Top-of-form error (RHF `setError('root.serverError', ...)`-equivalent).\n\t * Flips form status to 'error' with a structured `FormError`.\n\t */\n\tpublic setFormError(message: string, code?: string): void {\n\t\tformSubmitState.set({\n\t\t\t...formSubmitState.value,\n\t\t\tstatus: 'error',\n\t\t\terror: { message, code } as FormError,\n\t\t})\n\t\tthis._broadcastStatus('error', message)\n\t}\n\n\t/**\n\t * Clear the `submitted` flag on every registered field without resetting\n\t * their values. Wizard pattern: stepping back from a later step should not\n\t * leave the earlier step's fields in aggressive \"show all errors\" mode\n\t * (which `submitted = true` triggers via the `_shouldShowError()` gate).\n\t *\n\t * Pristine fields with `validateOn: 'dirty'` go quiet again. Fields the\n\t * user actually dirtied keep showing their errors (correct UX — those are\n\t * still genuine mistakes the user can see).\n\t */\n\tpublic clearSubmitted(): void {\n\t\tthis._activeFields.forEach(f => f.clearSubmitted())\n\t\tformSubmitState.set({\n\t\t\t...formSubmitState.value,\n\t\t\tstatus: 'idle',\n\t\t\terror: null,\n\t\t})\n\t\tthis._broadcastStatus('idle')\n\t}\n\n\t/** Programmatically submit via the native submitter pipeline. */\n\tpublic submit(): boolean {\n\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\tif (!form) return false\n\t\tform.requestSubmit()\n\t\treturn true\n\t}\n\n\t/** Programmatically reset via native `form.reset()`. */\n\tpublic reset(): void {\n\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\tform?.reset()\n\t}\n\n\tpublic reportValidity(): boolean {\n\t\treturn this._activeFields.every(f => f.reportValidity())\n\t}\n\n\tpublic checkValidity(): boolean {\n\t\treturn this._activeFields.every(f => f.checkValidity())\n\t}\n\n\t/** Snapshot of current form values from the registered fields. */\n\tpublic getFormData(): FormData {\n\t\tconst formData = new FormData()\n\t\tfor (const field of this._activeFields) {\n\t\t\tfor (const [k, v] of field.toFormEntries()) formData.append(k, v)\n\t\t}\n\t\treturn formData\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<schmancy-context .provides=${[formSubmitState]}>\n\t\t\t\t<form\n\t\t\t\t\t?novalidate=${this.novalidate}\n\t\t\t\t\t@submit=${this._onSubmit}\n\t\t\t\t\t@reset=${this._onReset}\n\t\t\t\t>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</form>\n\t\t\t\t<!--\n\t\t\t\t\tForm-level live region — assistive tech announces server-side\n\t\t\t\t\tform errors (validation summary, network failure, server reject)\n\t\t\t\t\there. Visually hidden via the .sr-only convention; consumers\n\t\t\t\t\trender their own visible banner from formSubmitState if they\n\t\t\t\t\twant one. Empty content while idle/submitting/success — only\n\t\t\t\t\terror states populate the region. WCAG 4.1.3 (Status Messages).\n\t\t\t\t-->\n\t\t\t\t<div\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\taria-live=\"assertive\"\n\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\tclass=\"sr-only\"\n\t\t\t\t>${this._liveStatus === 'error' ? this._liveError : ''}</div>\n\t\t\t</schmancy-context>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-form': SchmancyForm\n\t}\n}\n\n// Retained type surfaces — kept exported because downstream code may import\n// them as documentation. The new implementation no longer uses them\n// internally.\n\nexport interface FormElement extends HTMLElement {\n\tname?: string\n\tvalue?: string\n\tdisabled?: boolean\n\ttype?: string\n\tdefaultValue?: string\n}\n\nexport interface CheckableFormElement extends FormElement {\n\tchecked?: boolean\n}\n\nexport interface ValidatableFormElement extends FormElement {\n\treportValidity?: () => boolean\n\tcheckValidity?: () => boolean\n}\n\nexport interface FormEventMap {\n\tsubmit: CustomEvent<SchmancyFormSubmitDetail<unknown>>\n\treset: CustomEvent\n\tformstate: CustomEvent<FormSubmitState>\n}\n","/**\n * `<schmancy-form-summary>` — top-of-form error summary with anchor links to\n * each invalid field. Linear / GOV.UK / GitHub pattern.\n *\n * Drop one inside any `<schmancy-form>`; on submit-failure or when\n * `<schmancy-form>.setFormError(...)` is called, the summary renders a\n * `role=\"alert\"` banner with the form-level error message and a list of\n * links pointing at each invalid field's `id`.\n *\n * Hidden when the form is idle, submitting, or successful — only `error`\n * populates it.\n *\n * @element schmancy-form-summary\n */\n\nimport { html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { SchmancyElement } from '../../mixins'\nimport type SchmancyForm from './form'\n\n@customElement('schmancy-form-summary')\nexport class SchmancyFormSummary extends SchmancyElement {\n\t/**\n\t * Optional heading text. Defaults to a count-based summary\n\t * (\"1 problem with this form\" / \"3 problems with this form\").\n\t */\n\t@property({ type: String }) heading?: string\n\n\t/**\n\t * Render bumper — incremented to force a re-render when the form's state\n\t * changes (the actual content is computed from the DOM in render()).\n\t */\n\t@state() private _bump: number = 0\n\n\tprivate _form: SchmancyForm | null = null\n\tprivate _formObserver?: MutationObserver\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis._form = this.closest('schmancy-form') as SchmancyForm | null\n\t\tif (!this._form) {\n\t\t\tconsole.error('[schmancy-form-summary] must be a descendant of <schmancy-form>')\n\t\t\treturn\n\t\t}\n\t\tconst bump = () => { this._bump++ }\n\t\tthis._formObserver = new MutationObserver(bump)\n\t\t// Form host attribute changes (aria-busy, :state class reflections,\n\t\t// descendant attribute changes for fields' aria-invalid). subtree:true\n\t\t// catches attribute mutations on every descendant including light-DOM\n\t\t// fields and the form's own host.\n\t\tthis._formObserver.observe(this._form, {\n\t\t\tattributes: true,\n\t\t\tsubtree: true,\n\t\t})\n\t\t// Defer live-region observation until the form has rendered its\n\t\t// shadow tree.\n\t\tconst attachLiveRegionObserver = async (): Promise<void> => {\n\t\t\tawait this._form?.updateComplete\n\t\t\tconst liveRegion = this._form?.shadowRoot?.querySelector('[role=\"status\"]')\n\t\t\tif (liveRegion) {\n\t\t\t\tthis._formObserver?.observe(liveRegion, {\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t\tsubtree: true,\n\t\t\t\t})\n\t\t\t}\n\t\t\t// Force a render so the initial state is reflected.\n\t\t\tthis._bump++\n\t\t}\n\t\tvoid attachLiveRegionObserver()\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis._formObserver?.disconnect()\n\t\tthis._formObserver = undefined\n\t\tsuper.disconnectedCallback()\n\t}\n\n\tprivate _readFormStatus(): 'idle' | 'submitting' | 'success' | 'error' {\n\t\tif (!this._form) return 'idle'\n\t\tif (this._form.matches(':state(error)')) return 'error'\n\t\tif (this._form.matches(':state(submitting)')) return 'submitting'\n\t\tif (this._form.matches(':state(success)')) return 'success'\n\t\treturn 'idle'\n\t}\n\n\tprivate _readFormMessage(): string {\n\t\tconst liveRegion = this._form?.shadowRoot?.querySelector('[role=\"status\"]')\n\t\treturn liveRegion?.textContent?.trim() ?? ''\n\t}\n\n\tprivate _readInvalidFields(): Array<{ id: string; label: string; message: string }> {\n\t\tif (!this._form) return []\n\t\tconst result: Array<{ id: string; label: string; message: string }> = []\n\t\tfor (const el of Array.from(this._form.querySelectorAll('*'))) {\n\t\t\tif (!(el instanceof HTMLElement)) continue\n\t\t\tlet isInvalid = false\n\t\t\ttry {\n\t\t\t\tisInvalid = el.matches(':state(invalid)')\n\t\t\t} catch {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (!isInvalid) continue\n\t\t\tconst f = el as HTMLElement & {\n\t\t\t\tlabel?: string\n\t\t\t\tname?: string\n\t\t\t\tvalidationMessage?: string\n\t\t\t}\n\t\t\tresult.push({\n\t\t\t\tid: f.id,\n\t\t\t\tlabel: f.label || f.name || '(field)',\n\t\t\t\tmessage: f.validationMessage || 'Invalid value',\n\t\t\t})\n\t\t}\n\t\treturn result\n\t}\n\n\trender() {\n\t\t// Read everything fresh from the DOM each render — no @state cache, no\n\t\t// re-render loops. The MutationObserver bumps `_bump` to trigger this\n\t\t// render; `_bump` itself is never read here.\n\t\tvoid this._bump\n\n\t\tconst status = this._readFormStatus()\n\t\tif (status !== 'error') return nothing\n\n\t\tconst formMessage = this._readFormMessage()\n\t\tconst invalid = this._readInvalidFields()\n\t\tconst count = invalid.length\n\t\tconst heading =\n\t\t\tthis.heading ??\n\t\t\t(count === 0\n\t\t\t\t? 'There is a problem with this form'\n\t\t\t\t: `There ${count === 1 ? 'is' : 'are'} ${count} problem${count === 1 ? '' : 's'} with this form`)\n\n\t\treturn html`\n\t\t\t<div role=\"alert\" aria-labelledby=\"schmancy-form-summary-heading\">\n\t\t\t\t<h2 id=\"schmancy-form-summary-heading\">${heading}</h2>\n\t\t\t\t${formMessage ? html`<p>${formMessage}</p>` : nothing}\n\t\t\t\t${count > 0\n\t\t\t\t\t? html`\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t${invalid.map(\n\t\t\t\t\t\t\t\tf => html`\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\thref=\"#${f.id}\"\n\t\t\t\t\t\t\t\t\t\t\t@click=${(e: MouseEvent) => this._jumpToField(e, f.id)}\n\t\t\t\t\t\t\t\t\t\t>${f.label}: ${f.message}</a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t`\n\t\t\t\t\t: nothing}\n\t\t\t</div>\n\t\t`\n\t}\n\n\tprivate _jumpToField(e: MouseEvent, fieldId: string): void {\n\t\te.preventDefault()\n\t\tconst target = this._form?.querySelector(`#${CSS.escape(fieldId)}`) as HTMLElement | null\n\t\ttarget?.focus()\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-form-summary': SchmancyFormSummary\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAa,IAAkB,EAAuB,uBAAA,CAAwB,OAAO;CACpF,QAAQ;CACR,OAAO;CACP,aAAa;CAAA,CAAA,ECCR,KAAY,MACX,aAAgB,gBACf,EAAK,YAAY,YAAY,EAAK,YAAY,oBAgBvC,IAAA,cACN,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,EAAA,EAAA,KAAA,aAAA,CAac,GAAA,KAAA,0BAEJ,IAAI,KAAA,EAAA,KAAA,cAAA,CACA,GAAA,KAAA,cAQsD,QAAA,KAAA,aACtC,IAAA,KAAA,oBAAA;GAErC,IAAA;IACC,OAAO,KAAK,i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,KACL,SAAS,OAAO;EAE/B,IAAM,IAAc,KAAK,kBAAA,EACnB,IAAU,KAAK,oBAAA,EACf,IAAQ,EAAQ;EAOtB,OAAO,CAAI;;6CALV,KAAK,YACJ,MAAU,IACR,sCACA,SAAS,MAAU,IAAI,OAAO,MAAA,GAAS,EAAA,UAAgB,MAAU,IAAI,KAAK,IAAA,kBAAA;MAK1E,IAAc,CAAI,MAAM,EAAA,QAAoB,EAAA;MAC5C,IAAQ,IACP,CAAI;;SAEF,EAAQ,KACT,MAAK,CAAI;;;oBAGG,EAAE,GAAA;qBACD,MAAkB,KAAK,aAAa,GAAG,EAAE,GAAA,CAAA;aACjD,EAAE,MAAA,IAAU,EAAE,QAAA;;;;SAMpB,EAAA;;;;CAKN,aAAqB,GAAe,GAAA;EACnC,EAAE,gBAAA,GACa,KAAK,OAAO,cAAc,IAAI,IAAI,OAAO,EAAA,GAAA,GAChD,OAAA;;;AAAA,EAAA,CAxIR,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,WAAA,KAAA,EAAA,EAAA,EAAA,CAM1B,GAAA,CAAA,EAAO,EAAA,WAAA,SAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAZR,EAAc,wBAAA,CAAA,EAAwB,EAAA;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
1
+ {"version":3,"file":"form-B-Sm6u25.js","names":[],"sources":["../src/form/form-state.ts","../src/form/form.ts","../src/form/form-summary.ts"],"sourcesContent":["/**\n * Form-level submit state — consumed by `<schmancy-form>` and any descendant\n * (e.g. `<schmancy-button type=\"submit\">` to drive its loading/aria-busy).\n *\n * `<schmancy-form>` wraps its render output in `<schmancy-context\n * .provides=${[formSubmitState]}>` so each instance gets an isolated copy\n * via the schmancy state library's resolveContextual mechanism. Reads of\n * `formSubmitState.value` and writes via `formSubmitState.set(...)` inside\n * the form's subtree resolve to the per-form copy automatically — no\n * `@lit/context` plumbing in user code.\n */\n\nimport { state } from '../state'\n\nexport type FormError = {\n\tmessage: string\n\tcode?: string\n}\n\nexport type FormSubmitState = {\n\tstatus: 'idle' | 'submitting' | 'success' | 'error'\n\terror: FormError | null\n\t/** Increments on every submit attempt — RHF parity. */\n\tsubmitCount: number\n}\n\nexport const formSubmitState = state<FormSubmitState>('schmancy/form-submit').memory({\n\tstatus: 'idle',\n\terror: null,\n\tsubmitCount: 0,\n})\n","/**\n * `<schmancy-form>` — schmancy form owner with isolated submit state.\n *\n * Architecture:\n * - Extends `SchmancyElement` (shadow DOM, RxJS + `disconnecting` conventions).\n * - Renders content inside `<schmancy-context .provides=${[formSubmitState]}>`\n * so each form instance gets an isolated copy of the submit state via the\n * schmancy state library — no `@lit/context` plumbing in user code.\n * - Inner `<form novalidate>` is the native-semantics trigger for Enter-key\n * submit and `type=submit` button activation.\n * - Fields self-register via `FIELD_CONNECT_EVENT` (composed event from\n * `FormFieldMixin.connectedCallback`). Stale refs (from disconnected\n * fields) are filtered by `isConnected` at iteration time.\n *\n * Schema seam — pass any `{ parse(input): T }` object (zod, valibot, ArkType,\n * etc.) via the `schema` property to get typed `submit` event detail.\n */\n\nimport { html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\nimport { SchmancyElement } from '../../mixins'\nimport { FIELD_CONNECT_EVENT, type IFormFieldMixin } from '../../mixins/formField.mixin'\nimport { formSubmitState, type FormSubmitState, type FormError } from './form-state'\n\n/** Structural type matching zod, valibot, ArkType, etc. — any schema with `.parse()`. */\nexport interface ParseSchema<T = unknown> {\n\tparse(input: unknown): T\n}\n\nconst isButton = (node: EventTarget): node is HTMLElement => {\n\tif (!(node instanceof HTMLElement)) return false\n\treturn node.tagName === 'BUTTON' || node.tagName === 'SCHMANCY-BUTTON'\n}\n\n/** Submit event detail. `data` is typed when `schema` is set. */\nexport type SchmancyFormSubmitDetail<T = Record<string, FormDataEntryValue>> = {\n\tdata: T\n\tformData: FormData\n\t/**\n\t * Register a promise that gates the form's success/error state. If unused,\n\t * the form synchronously flips to `success` after dispatch. If used,\n\t * `success`/`error` reflect the promise's outcome.\n\t */\n\tuntil(p: Promise<unknown>): void\n}\n\n@customElement('schmancy-form')\nexport default class SchmancyForm<TSchema extends ParseSchema | undefined = undefined>\n\textends SchmancyElement {\n\tpublic static readonly tagName: string = 'schmancy-form'\n\n\t/**\n\t * Optional schema for parsing FormData on submit. Anything with a\n\t * `.parse(input)` method works (zod, valibot, ArkType). When set, the\n\t * `submit` event's `detail.data` is typed `z.infer<TSchema>`.\n\t */\n\t@property({ attribute: false })\n\tschema?: TSchema\n\n\t/** Skip built-in browser constraint validation. Mirrors `<form novalidate>`. */\n\t@property({ type: Boolean })\n\tnovalidate: boolean = true\n\n\tprivate _fields = new Set<IFormFieldMixin>()\n\tprivate _submitting = false\n\n\t/**\n\t * Local mirror of the submit-state status — drives the inline live region\n\t * synchronously. Independent of the schmancy-state library's resolution\n\t * chain (which has known cross-await fallback semantics) so the AT-facing\n\t * announcement is always correct for this form instance.\n\t */\n\t@state() private _liveStatus: 'idle' | 'submitting' | 'success' | 'error' = 'idle'\n\t@state() private _liveError: string = ''\n\tprivate _internals: ElementInternals | undefined = (() => {\n\t\ttry {\n\t\t\treturn this.attachInternals()\n\t\t} catch {\n\t\t\treturn undefined\n\t\t}\n\t})()\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\n\t\t// Forbid nested <schmancy-form>.\n\t\tif (this.parentElement?.closest('schmancy-form')) {\n\t\t\tconsole.error('[schmancy-form] nested <schmancy-form> is not supported')\n\t\t\treturn\n\t\t}\n\n\t\t// Field registry — composed event from FormFieldMixin.connectedCallback.\n\t\tfromEvent<CustomEvent<IFormFieldMixin>>(this, FIELD_CONNECT_EVENT)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => this._fields.add(e.detail))\n\n\t\t// Submit-trigger interception — slotted descendants live in light DOM\n\t\t// while the inner <form> is in shadow DOM, so native form-association\n\t\t// across the shadow boundary doesn't work for `<button type=submit>`.\n\t\t// Capture clicks on type=submit buttons (native + schmancy-button) and\n\t\t// Enter keys on registered fields, then call the inner form's\n\t\t// requestSubmit() which fires the same native submit event handler\n\t\t// chain that a directly-associated button would have triggered.\n\t\tfromEvent<MouseEvent>(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => this._maybeRequestSubmit(e))\n\t\tfromEvent<KeyboardEvent>(this, 'keydown')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.key !== 'Enter' || e.shiftKey) return\n\t\t\t\t// Skip Enter inside <textarea> (newline) and contenteditable.\n\t\t\t\tconst target = e.target as HTMLElement | null\n\t\t\t\tif (target?.tagName === 'TEXTAREA') return\n\t\t\t\tif (target?.isContentEditable) return\n\t\t\t\tthis._maybeRequestSubmit(e)\n\t\t\t})\n\t}\n\n\tprivate _maybeRequestSubmit(e: Event): void {\n\t\t// On click: trigger only when the target is a type=submit button.\n\t\t// On keydown(Enter): always trigger if focus is on a registered field.\n\t\t// type=reset is handled separately in _maybeReset.\n\t\tif (e.type === 'click') {\n\t\t\tconst path = e.composedPath()\n\t\t\tconst resetBtn = path.find(\n\t\t\t\tnode => isButton(node) && node.getAttribute('type') === 'reset',\n\t\t\t)\n\t\t\tif (resetBtn) {\n\t\t\t\te.preventDefault()\n\t\t\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\t\t\tform?.reset()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst submitBtn = path.find(\n\t\t\t\tnode => isButton(node) && node.getAttribute('type') === 'submit',\n\t\t\t)\n\t\t\tif (!submitBtn) return\n\t\t\te.preventDefault()\n\t\t}\n\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\tform?.requestSubmit()\n\t}\n\n\t/** Active fields — drops stale refs from disconnected nodes. */\n\tprivate get _activeFields(): IFormFieldMixin[] {\n\t\treturn [...this._fields].filter(f => f.isConnected)\n\t}\n\n\tprivate async _onSubmit(e: SubmitEvent): Promise<void> {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t\tif (this._submitting) return\n\n\t\t// If any field has an async validator pending, wait for them all to\n\t\t// settle before deciding validity. This is the hard-block model: the\n\t\t// user clicks submit, the form holds (aria-busy=\"true\"), waits for\n\t\t// validators, then proceeds with the truth they reported.\n\t\tconst pendingValidators = this._activeFields.filter(f => f.isValidating)\n\t\tif (pendingValidators.length > 0) {\n\t\t\tthis._broadcastStatus('submitting')\n\t\t\tawait new Promise<void>(resolve => {\n\t\t\t\tconst tick = () => {\n\t\t\t\t\tif (this._activeFields.every(f => !f.isValidating)) resolve()\n\t\t\t\t\telse requestAnimationFrame(tick)\n\t\t\t\t}\n\t\t\t\ttick()\n\t\t\t})\n\t\t}\n\n\t\t// Phase 4 — submit forces error display on every field.\n\t\tthis._activeFields.forEach(f => f.markSubmitted())\n\n\t\t// Validate; success path entered ONLY if all valid.\n\t\tconst allValid = this._activeFields.every(f => f.checkValidity())\n\t\tconst fs = formSubmitState.value\n\t\tif (!allValid) {\n\t\t\tformSubmitState.set({\n\t\t\t\t...fs,\n\t\t\t\tstatus: 'error',\n\t\t\t\terror: { message: 'Validation failed' },\n\t\t\t})\n\t\t\tthis._broadcastStatus('error', 'Validation failed. Please correct the highlighted fields.')\n\t\t\tconst firstInvalid = this._activeFields.find(f => f.error) as unknown as\n\t\t\t\t| HTMLElement\n\t\t\t\t| undefined\n\t\t\tfirstInvalid?.focus()\n\t\t\treturn\n\t\t}\n\n\t\tthis._submitting = true\n\t\tformSubmitState.set({\n\t\t\t...fs,\n\t\t\tstatus: 'submitting',\n\t\t\terror: null,\n\t\t\tsubmitCount: fs.submitCount + 1,\n\t\t})\n\t\tthis._broadcastStatus('submitting')\n\n\t\t// Build payload from the registered fields' contracted toFormEntries().\n\t\tconst formData = new FormData()\n\t\tfor (const field of this._activeFields) {\n\t\t\tfor (const [k, v] of field.toFormEntries()) formData.append(k, v)\n\t\t}\n\t\tconst raw = Object.fromEntries(formData)\n\t\tconst data = this.schema ? this.schema.parse(raw) : raw\n\n\t\t// Awaitable submit — consumers register promises via e.detail.until(p).\n\t\tconst pending: Promise<unknown>[] = []\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancyFormSubmitDetail<unknown>>('submit', {\n\t\t\t\tdetail: {\n\t\t\t\t\tdata,\n\t\t\t\t\tformData,\n\t\t\t\t\tuntil: (p: Promise<unknown>) => pending.push(p),\n\t\t\t\t},\n\t\t\t}),\n\t\t)\n\n\t\ttry {\n\t\t\tawait Promise.all(pending)\n\t\t\tformSubmitState.set({\n\t\t\t\t...formSubmitState.value,\n\t\t\t\tstatus: 'success',\n\t\t\t\terror: null,\n\t\t\t})\n\t\t\tthis._broadcastStatus('success')\n\t\t} catch (err) {\n\t\t\tconst message = err instanceof Error ? err.message : String(err)\n\t\t\tformSubmitState.set({\n\t\t\t\t...formSubmitState.value,\n\t\t\t\tstatus: 'error',\n\t\t\t\terror: { message },\n\t\t\t})\n\t\t\tthis._broadcastStatus('error', message)\n\t\t} finally {\n\t\t\tthis._submitting = false\n\t\t}\n\t}\n\n\tprivate _onReset(e: Event): void {\n\t\te.stopPropagation()\n\t\tthis._activeFields.forEach(f => f.resetForm())\n\t\tformSubmitState.set({ status: 'idle', error: null, submitCount: 0 })\n\t\tthis._broadcastStatus('idle')\n\t\tthis.dispatchEvent(new CustomEvent('reset'))\n\t}\n\n\tprivate _broadcastStatus(status: FormSubmitState['status'], errorMessage?: string): void {\n\t\tthis._liveStatus = status\n\t\tthis._liveError = errorMessage ?? ''\n\t\tconst states = this._internals?.states\n\t\tif (states) {\n\t\t\tfor (const s of ['submitting', 'success', 'error', 'idle']) states.delete(s)\n\t\t\tstates.add(status)\n\t\t}\n\t\t// aria-busy on the host while submitting (WCAG 2.2 AA — disabled buttons\n\t\t// drop from tab order; keep them focusable, signal busy via aria).\n\t\tif (status === 'submitting') this.setAttribute('aria-busy', 'true')\n\t\telse this.removeAttribute('aria-busy')\n\t\t// Public formstate event — external state stores subscribe without\n\t\t// having to consume formSubmitState directly.\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<FormSubmitState>('formstate', {\n\t\t\t\tdetail: { ...formSubmitState.value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Server-side error mapping (RHF `setError(name, ...)`-equivalent).\n\t * Sets `setCustomValidity(message)` on the matching field and ensures the\n\t * error displays by marking it submitted.\n\t */\n\tpublic setFieldError(name: string, message: string): boolean {\n\t\tconst field = this._activeFields.find(f => f.name === name)\n\t\tif (!field) return false\n\t\tfield.setCustomValidity(message)\n\t\tfield.markSubmitted()\n\t\treturn true\n\t}\n\n\t/**\n\t * Top-of-form error (RHF `setError('root.serverError', ...)`-equivalent).\n\t * Flips form status to 'error' with a structured `FormError`.\n\t */\n\tpublic setFormError(message: string, code?: string): void {\n\t\tformSubmitState.set({\n\t\t\t...formSubmitState.value,\n\t\t\tstatus: 'error',\n\t\t\terror: { message, code } as FormError,\n\t\t})\n\t\tthis._broadcastStatus('error', message)\n\t}\n\n\t/**\n\t * Clear the `submitted` flag on every registered field without resetting\n\t * their values. Wizard pattern: stepping back from a later step should not\n\t * leave the earlier step's fields in aggressive \"show all errors\" mode\n\t * (which `submitted = true` triggers via the `_shouldShowError()` gate).\n\t *\n\t * Pristine fields with `validateOn: 'dirty'` go quiet again. Fields the\n\t * user actually dirtied keep showing their errors (correct UX — those are\n\t * still genuine mistakes the user can see).\n\t */\n\tpublic clearSubmitted(): void {\n\t\tthis._activeFields.forEach(f => f.clearSubmitted())\n\t\tformSubmitState.set({\n\t\t\t...formSubmitState.value,\n\t\t\tstatus: 'idle',\n\t\t\terror: null,\n\t\t})\n\t\tthis._broadcastStatus('idle')\n\t}\n\n\t/** Programmatically submit via the native submitter pipeline. */\n\tpublic submit(): boolean {\n\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\tif (!form) return false\n\t\tform.requestSubmit()\n\t\treturn true\n\t}\n\n\t/** Programmatically reset via native `form.reset()`. */\n\tpublic reset(): void {\n\t\tconst form = this.shadowRoot?.querySelector('form')\n\t\tform?.reset()\n\t}\n\n\tpublic reportValidity(): boolean {\n\t\treturn this._activeFields.every(f => f.reportValidity())\n\t}\n\n\tpublic checkValidity(): boolean {\n\t\treturn this._activeFields.every(f => f.checkValidity())\n\t}\n\n\t/** Snapshot of current form values from the registered fields. */\n\tpublic getFormData(): FormData {\n\t\tconst formData = new FormData()\n\t\tfor (const field of this._activeFields) {\n\t\t\tfor (const [k, v] of field.toFormEntries()) formData.append(k, v)\n\t\t}\n\t\treturn formData\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<schmancy-context .provides=${[formSubmitState]}>\n\t\t\t\t<form\n\t\t\t\t\t?novalidate=${this.novalidate}\n\t\t\t\t\t@submit=${this._onSubmit}\n\t\t\t\t\t@reset=${this._onReset}\n\t\t\t\t>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</form>\n\t\t\t\t<!--\n\t\t\t\t\tForm-level live region — assistive tech announces server-side\n\t\t\t\t\tform errors (validation summary, network failure, server reject)\n\t\t\t\t\there. Visually hidden via the .sr-only convention; consumers\n\t\t\t\t\trender their own visible banner from formSubmitState if they\n\t\t\t\t\twant one. Empty content while idle/submitting/success — only\n\t\t\t\t\terror states populate the region. WCAG 4.1.3 (Status Messages).\n\t\t\t\t-->\n\t\t\t\t<div\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\taria-live=\"assertive\"\n\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\tclass=\"sr-only\"\n\t\t\t\t>${this._liveStatus === 'error' ? this._liveError : ''}</div>\n\t\t\t</schmancy-context>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-form': SchmancyForm\n\t}\n}\n\n// Retained type surfaces — kept exported because downstream code may import\n// them as documentation. The new implementation no longer uses them\n// internally.\n\nexport interface FormElement extends HTMLElement {\n\tname?: string\n\tvalue?: string\n\tdisabled?: boolean\n\ttype?: string\n\tdefaultValue?: string\n}\n\nexport interface CheckableFormElement extends FormElement {\n\tchecked?: boolean\n}\n\nexport interface ValidatableFormElement extends FormElement {\n\treportValidity?: () => boolean\n\tcheckValidity?: () => boolean\n}\n\nexport interface FormEventMap {\n\tsubmit: CustomEvent<SchmancyFormSubmitDetail<unknown>>\n\treset: CustomEvent\n\tformstate: CustomEvent<FormSubmitState>\n}\n","/**\n * `<schmancy-form-summary>` — top-of-form error summary with anchor links to\n * each invalid field. Linear / GOV.UK / GitHub pattern.\n *\n * Drop one inside any `<schmancy-form>`; on submit-failure or when\n * `<schmancy-form>.setFormError(...)` is called, the summary renders a\n * `role=\"alert\"` banner with the form-level error message and a list of\n * links pointing at each invalid field's `id`.\n *\n * Hidden when the form is idle, submitting, or successful — only `error`\n * populates it.\n *\n * @element schmancy-form-summary\n */\n\nimport { html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { SchmancyElement } from '../../mixins'\nimport type SchmancyForm from './form'\n\n@customElement('schmancy-form-summary')\nexport class SchmancyFormSummary extends SchmancyElement {\n\t/**\n\t * Optional heading text. Defaults to a count-based summary\n\t * (\"1 problem with this form\" / \"3 problems with this form\").\n\t */\n\t@property({ type: String }) heading?: string\n\n\t/**\n\t * Render bumper — incremented to force a re-render when the form's state\n\t * changes (the actual content is computed from the DOM in render()).\n\t */\n\t@state() private _bump: number = 0\n\n\tprivate _form: SchmancyForm | null = null\n\tprivate _formObserver?: MutationObserver\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis._form = this.closest('schmancy-form') as SchmancyForm | null\n\t\tif (!this._form) {\n\t\t\tconsole.error('[schmancy-form-summary] must be a descendant of <schmancy-form>')\n\t\t\treturn\n\t\t}\n\t\tconst bump = () => { this._bump++ }\n\t\tthis._formObserver = new MutationObserver(bump)\n\t\t// Form host attribute changes (aria-busy, :state class reflections,\n\t\t// descendant attribute changes for fields' aria-invalid). subtree:true\n\t\t// catches attribute mutations on every descendant including light-DOM\n\t\t// fields and the form's own host.\n\t\tthis._formObserver.observe(this._form, {\n\t\t\tattributes: true,\n\t\t\tsubtree: true,\n\t\t})\n\t\t// Defer live-region observation until the form has rendered its\n\t\t// shadow tree.\n\t\tconst attachLiveRegionObserver = async (): Promise<void> => {\n\t\t\tawait this._form?.updateComplete\n\t\t\tconst liveRegion = this._form?.shadowRoot?.querySelector('[role=\"status\"]')\n\t\t\tif (liveRegion) {\n\t\t\t\tthis._formObserver?.observe(liveRegion, {\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t\tsubtree: true,\n\t\t\t\t})\n\t\t\t}\n\t\t\t// Force a render so the initial state is reflected.\n\t\t\tthis._bump++\n\t\t}\n\t\tvoid attachLiveRegionObserver()\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis._formObserver?.disconnect()\n\t\tthis._formObserver = undefined\n\t\tsuper.disconnectedCallback()\n\t}\n\n\tprivate _readFormStatus(): 'idle' | 'submitting' | 'success' | 'error' {\n\t\tif (!this._form) return 'idle'\n\t\tif (this._form.matches(':state(error)')) return 'error'\n\t\tif (this._form.matches(':state(submitting)')) return 'submitting'\n\t\tif (this._form.matches(':state(success)')) return 'success'\n\t\treturn 'idle'\n\t}\n\n\tprivate _readFormMessage(): string {\n\t\tconst liveRegion = this._form?.shadowRoot?.querySelector('[role=\"status\"]')\n\t\treturn liveRegion?.textContent?.trim() ?? ''\n\t}\n\n\tprivate _readInvalidFields(): Array<{ id: string; label: string; message: string }> {\n\t\tif (!this._form) return []\n\t\tconst result: Array<{ id: string; label: string; message: string }> = []\n\t\tfor (const el of Array.from(this._form.querySelectorAll('*'))) {\n\t\t\tif (!(el instanceof HTMLElement)) continue\n\t\t\tlet isInvalid = false\n\t\t\ttry {\n\t\t\t\tisInvalid = el.matches(':state(invalid)')\n\t\t\t} catch {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (!isInvalid) continue\n\t\t\tconst f = el as HTMLElement & {\n\t\t\t\tlabel?: string\n\t\t\t\tname?: string\n\t\t\t\tvalidationMessage?: string\n\t\t\t}\n\t\t\tresult.push({\n\t\t\t\tid: f.id,\n\t\t\t\tlabel: f.label || f.name || '(field)',\n\t\t\t\tmessage: f.validationMessage || 'Invalid value',\n\t\t\t})\n\t\t}\n\t\treturn result\n\t}\n\n\trender() {\n\t\t// Read everything fresh from the DOM each render — no @state cache, no\n\t\t// re-render loops. The MutationObserver bumps `_bump` to trigger this\n\t\t// render; `_bump` itself is never read here.\n\t\tvoid this._bump\n\n\t\tconst status = this._readFormStatus()\n\t\tif (status !== 'error') return nothing\n\n\t\tconst formMessage = this._readFormMessage()\n\t\tconst invalid = this._readInvalidFields()\n\t\tconst count = invalid.length\n\t\tconst heading =\n\t\t\tthis.heading ??\n\t\t\t(count === 0\n\t\t\t\t? 'There is a problem with this form'\n\t\t\t\t: `There ${count === 1 ? 'is' : 'are'} ${count} problem${count === 1 ? '' : 's'} with this form`)\n\n\t\treturn html`\n\t\t\t<div role=\"alert\" aria-labelledby=\"schmancy-form-summary-heading\">\n\t\t\t\t<h2 id=\"schmancy-form-summary-heading\">${heading}</h2>\n\t\t\t\t${formMessage ? html`<p>${formMessage}</p>` : nothing}\n\t\t\t\t${count > 0\n\t\t\t\t\t? html`\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t${invalid.map(\n\t\t\t\t\t\t\t\tf => html`\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\thref=\"#${f.id}\"\n\t\t\t\t\t\t\t\t\t\t\t@click=${(e: MouseEvent) => this._jumpToField(e, f.id)}\n\t\t\t\t\t\t\t\t\t\t>${f.label}: ${f.message}</a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t`\n\t\t\t\t\t: nothing}\n\t\t\t</div>\n\t\t`\n\t}\n\n\tprivate _jumpToField(e: MouseEvent, fieldId: string): void {\n\t\te.preventDefault()\n\t\tconst target = this._form?.querySelector(`#${CSS.escape(fieldId)}`) as HTMLElement | null\n\t\ttarget?.focus()\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-form-summary': SchmancyFormSummary\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAa,IAAkB,EAAuB,uBAAA,CAAwB,OAAO;CACpF,QAAQ;CACR,OAAO;CACP,aAAa;CAAA,CAAA,ECCR,KAAY,MACX,aAAgB,gBACf,EAAK,YAAY,YAAY,EAAK,YAAY,oBAgBvC,IAAA,cACN,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,EAAA,EAAA,KAAA,aAAA,CAac,GAAA,KAAA,0BAEJ,IAAI,KAAA,EAAA,KAAA,cAAA,CACA,GAAA,KAAA,cAQsD,QAAA,KAAA,aACtC,IAAA,KAAA,oBAAA;GAErC,IAAA;IACC,OAAO,KAAK,iBAAA;WAAA;IAEZ;;MAAA;;CAAA;EAAA,KAAA,UA7BuC;;CAiCzC,oBAAA;EACC,MAAM,mBAAA,EAGF,KAAK,eAAe,QAAQ,gBAAA,KAMhC,EAAwC,MAAM,EAAA,CAC5C,KAAK,EAAU,KAAK,cAAA,CAAA,CACpB,WAAU,MAAK,KAAK,QAAQ,IAAI,EAAE,OAAA,CAAA,EASpC,EAAsB,MAAM,QAAA,CAC1B,KAAK,EAAU,KAAK,cAAA,CAAA,CACpB,WAAU,MAAK,KAAK,oBAAoB,EAAA,CAAA,EAC1C,EAAyB,MAAM,UAAA,CAC7B,KAAK,EAAU,KAAK,cAAA,CAAA,CACpB,WAAU,MAAA;GACV,IAAI,EAAE,QAAQ,WAAW,EAAE,UAAU;GAErC,IAAM,IAAS,EAAE;GACO,AAApB,GAAQ,YAAY,eACpB,GAAQ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,IAAI,OAAO,EAAA,GAAA,GAChD,OAAA;;;AAAA,EAAA,CAxIR,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,WAAA,KAAA,EAAA,EAAA,EAAA,CAM1B,GAAA,CAAA,EAAO,EAAA,WAAA,SAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAZR,EAAc,wBAAA,CAAA,EAAwB,EAAA;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
@@ -1,4 +1,4 @@
1
- require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-DTCHPEd4.cjs`),t=require(`./active-host-jH3iloCR.cjs`),n=require(`./state-DcGj-pJJ.cjs`);require(`./autocomplete-CfBFDSc3.cjs`),require(`./checkbox-BAqE3sTx.cjs`),require(`./date-range-CsJfjbmi.cjs`),require(`./input-BY9OCQWr.cjs`),require(`./radio-group-bl8K4Gls.cjs`),require(`./range.cjs`),require(`./select-COIfVtZl.cjs`),require(`./switch.cjs`),require(`./textarea-CGD6lAEe.cjs`);let r=require(`rxjs`),i=require(`lit/decorators.js`),a=require(`lit`);var o=n.i(`schmancy/form-submit`).memory({status:`idle`,error:null,submitCount:0}),s=e=>e instanceof HTMLElement&&(e.tagName===`BUTTON`||e.tagName===`SCHMANCY-BUTTON`),c=class extends e.c{constructor(...e){super(...e),this.novalidate=!0,this._fields=new Set,this._submitting=!1,this._liveStatus=`idle`,this._liveError=``,this._internals=(()=>{try{return this.attachInternals()}catch{return}})()}static{this.tagName=`schmancy-form`}connectedCallback(){super.connectedCallback(),this.parentElement?.closest(`schmancy-form`)||((0,r.fromEvent)(this,e.r).pipe((0,r.takeUntil)(this.disconnecting)).subscribe(e=>this._fields.add(e.detail)),(0,r.fromEvent)(this,`click`).pipe((0,r.takeUntil)(this.disconnecting)).subscribe(e=>this._maybeRequestSubmit(e)),(0,r.fromEvent)(this,`keydown`).pipe((0,r.takeUntil)(this.disconnecting)).subscribe(e=>{if(e.key!==`Enter`||e.shiftKey)return;let t=e.target;t?.tagName!==`TEXTAREA`&&(t?.isContentEditable||this._maybeRequestSubmit(e))}))}_maybeRequestSubmit(e){if(e.type===`click`){let t=e.composedPath();if(t.find(e=>s(e)&&e.getAttribute(`type`)===`reset`))return e.preventDefault(),void(this.shadowRoot?.querySelector(`form`))?.reset();if(!t.find(e=>s(e)&&e.getAttribute(`type`)===`submit`))return;e.preventDefault()}(this.shadowRoot?.querySelector(`form`))?.requestSubmit()}get _activeFields(){return[...this._fields].filter(e=>e.isConnected)}async _onSubmit(e){if(e.preventDefault(),e.stopPropagation(),this._submitting)return;this._activeFields.filter(e=>e.isValidating).length>0&&(this._broadcastStatus(`submitting`),await new Promise(e=>{let t=()=>{this._activeFields.every(e=>!e.isValidating)?e():requestAnimationFrame(t)};t()})),this._activeFields.forEach(e=>e.markSubmitted());let t=this._activeFields.every(e=>e.checkValidity()),n=o.value;if(!t)return o.set({...n,status:`error`,error:{message:`Validation failed`}}),this._broadcastStatus(`error`,`Validation failed. Please correct the highlighted fields.`),void this._activeFields.find(e=>e.error)?.focus();this._submitting=!0,o.set({...n,status:`submitting`,error:null,submitCount:n.submitCount+1}),this._broadcastStatus(`submitting`);let r=new FormData;for(let e of this._activeFields)for(let[t,n]of e.toFormEntries())r.append(t,n);let i=Object.fromEntries(r),a=this.schema?this.schema.parse(i):i,s=[];this.dispatchEvent(new CustomEvent(`submit`,{detail:{data:a,formData:r,until:e=>s.push(e)}}));try{await Promise.all(s),o.set({...o.value,status:`success`,error:null}),this._broadcastStatus(`success`)}catch(e){let t=e instanceof Error?e.message:String(e);o.set({...o.value,status:`error`,error:{message:t}}),this._broadcastStatus(`error`,t)}finally{this._submitting=!1}}_onReset(e){e.stopPropagation(),this._activeFields.forEach(e=>e.resetForm()),o.set({status:`idle`,error:null,submitCount:0}),this._broadcastStatus(`idle`),this.dispatchEvent(new CustomEvent(`reset`))}_broadcastStatus(e,t){this._liveStatus=e,this._liveError=t??``;let n=this._internals?.states;if(n){for(let e of[`submitting`,`success`,`error`,`idle`])n.delete(e);n.add(e)}e===`submitting`?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`),this.dispatchEvent(new CustomEvent(`formstate`,{detail:{...o.value},bubbles:!0,composed:!0}))}setFieldError(e,t){let n=this._activeFields.find(t=>t.name===e);return!!n&&(n.setCustomValidity(t),n.markSubmitted(),!0)}setFormError(e,t){o.set({...o.value,status:`error`,error:{message:e,code:t}}),this._broadcastStatus(`error`,e)}clearSubmitted(){this._activeFields.forEach(e=>e.clearSubmitted()),o.set({...o.value,status:`idle`,error:null}),this._broadcastStatus(`idle`)}submit(){let e=this.shadowRoot?.querySelector(`form`);return!!e&&(e.requestSubmit(),!0)}reset(){(this.shadowRoot?.querySelector(`form`))?.reset()}reportValidity(){return this._activeFields.every(e=>e.reportValidity())}checkValidity(){return this._activeFields.every(e=>e.checkValidity())}getFormData(){let e=new FormData;for(let t of this._activeFields)for(let[n,r]of t.toFormEntries())e.append(n,r);return e}render(){return a.html`
1
+ require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-DTCHPEd4.cjs`),t=require(`./active-host-jH3iloCR.cjs`),n=require(`./state-DcGj-pJJ.cjs`);require(`./autocomplete-CfBFDSc3.cjs`),require(`./checkbox-BAqE3sTx.cjs`),require(`./date-range-VA1mi1N7.cjs`),require(`./input-BY9OCQWr.cjs`),require(`./radio-group-bl8K4Gls.cjs`),require(`./range.cjs`),require(`./select-COIfVtZl.cjs`),require(`./switch.cjs`),require(`./textarea-CGD6lAEe.cjs`);let r=require(`rxjs`),i=require(`lit/decorators.js`),a=require(`lit`);var o=n.i(`schmancy/form-submit`).memory({status:`idle`,error:null,submitCount:0}),s=e=>e instanceof HTMLElement&&(e.tagName===`BUTTON`||e.tagName===`SCHMANCY-BUTTON`),c=class extends e.c{constructor(...e){super(...e),this.novalidate=!0,this._fields=new Set,this._submitting=!1,this._liveStatus=`idle`,this._liveError=``,this._internals=(()=>{try{return this.attachInternals()}catch{return}})()}static{this.tagName=`schmancy-form`}connectedCallback(){super.connectedCallback(),this.parentElement?.closest(`schmancy-form`)||((0,r.fromEvent)(this,e.r).pipe((0,r.takeUntil)(this.disconnecting)).subscribe(e=>this._fields.add(e.detail)),(0,r.fromEvent)(this,`click`).pipe((0,r.takeUntil)(this.disconnecting)).subscribe(e=>this._maybeRequestSubmit(e)),(0,r.fromEvent)(this,`keydown`).pipe((0,r.takeUntil)(this.disconnecting)).subscribe(e=>{if(e.key!==`Enter`||e.shiftKey)return;let t=e.target;t?.tagName!==`TEXTAREA`&&(t?.isContentEditable||this._maybeRequestSubmit(e))}))}_maybeRequestSubmit(e){if(e.type===`click`){let t=e.composedPath();if(t.find(e=>s(e)&&e.getAttribute(`type`)===`reset`))return e.preventDefault(),void(this.shadowRoot?.querySelector(`form`))?.reset();if(!t.find(e=>s(e)&&e.getAttribute(`type`)===`submit`))return;e.preventDefault()}(this.shadowRoot?.querySelector(`form`))?.requestSubmit()}get _activeFields(){return[...this._fields].filter(e=>e.isConnected)}async _onSubmit(e){if(e.preventDefault(),e.stopPropagation(),this._submitting)return;this._activeFields.filter(e=>e.isValidating).length>0&&(this._broadcastStatus(`submitting`),await new Promise(e=>{let t=()=>{this._activeFields.every(e=>!e.isValidating)?e():requestAnimationFrame(t)};t()})),this._activeFields.forEach(e=>e.markSubmitted());let t=this._activeFields.every(e=>e.checkValidity()),n=o.value;if(!t)return o.set({...n,status:`error`,error:{message:`Validation failed`}}),this._broadcastStatus(`error`,`Validation failed. Please correct the highlighted fields.`),void this._activeFields.find(e=>e.error)?.focus();this._submitting=!0,o.set({...n,status:`submitting`,error:null,submitCount:n.submitCount+1}),this._broadcastStatus(`submitting`);let r=new FormData;for(let e of this._activeFields)for(let[t,n]of e.toFormEntries())r.append(t,n);let i=Object.fromEntries(r),a=this.schema?this.schema.parse(i):i,s=[];this.dispatchEvent(new CustomEvent(`submit`,{detail:{data:a,formData:r,until:e=>s.push(e)}}));try{await Promise.all(s),o.set({...o.value,status:`success`,error:null}),this._broadcastStatus(`success`)}catch(e){let t=e instanceof Error?e.message:String(e);o.set({...o.value,status:`error`,error:{message:t}}),this._broadcastStatus(`error`,t)}finally{this._submitting=!1}}_onReset(e){e.stopPropagation(),this._activeFields.forEach(e=>e.resetForm()),o.set({status:`idle`,error:null,submitCount:0}),this._broadcastStatus(`idle`),this.dispatchEvent(new CustomEvent(`reset`))}_broadcastStatus(e,t){this._liveStatus=e,this._liveError=t??``;let n=this._internals?.states;if(n){for(let e of[`submitting`,`success`,`error`,`idle`])n.delete(e);n.add(e)}e===`submitting`?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`),this.dispatchEvent(new CustomEvent(`formstate`,{detail:{...o.value},bubbles:!0,composed:!0}))}setFieldError(e,t){let n=this._activeFields.find(t=>t.name===e);return!!n&&(n.setCustomValidity(t),n.markSubmitted(),!0)}setFormError(e,t){o.set({...o.value,status:`error`,error:{message:e,code:t}}),this._broadcastStatus(`error`,e)}clearSubmitted(){this._activeFields.forEach(e=>e.clearSubmitted()),o.set({...o.value,status:`idle`,error:null}),this._broadcastStatus(`idle`)}submit(){let e=this.shadowRoot?.querySelector(`form`);return!!e&&(e.requestSubmit(),!0)}reset(){(this.shadowRoot?.querySelector(`form`))?.reset()}reportValidity(){return this._activeFields.every(e=>e.reportValidity())}checkValidity(){return this._activeFields.every(e=>e.checkValidity())}getFormData(){let e=new FormData;for(let t of this._activeFields)for(let[n,r]of t.toFormEntries())e.append(n,r);return e}render(){return a.html`
2
2
  <schmancy-context .provides=${[o]}>
3
3
  <form
4
4
  ?novalidate=${this.novalidate}