{"version":3,"sources":["../../../../src/components/Calendar/CalendarDay/renderCalendarDay.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { CalendarDayState, CalendarDaySlots } from './CalendarDay.types';\n\n/**\n * Render the final JSX of CalendarDay.\n */\nexport const renderCalendarDay = (state: CalendarDayState): JSXElement => {\n  assertSlots<CalendarDaySlots>(state);\n\n  return (\n    <state.root>\n      <state.header>\n        <state.heading />\n        <state.navigation>\n          <state.previousMonthButton />\n          <state.nextMonthButton />\n          {state.closeButton && <state.closeButton />}\n        </state.navigation>\n      </state.header>\n      <state.grid>\n        {renderWeekdayHeader(state)}\n        {state.body.children !== undefined ? <state.body /> : renderCalendarDayBody(state)}\n      </state.grid>\n    </state.root>\n  );\n};\n\n/**\n * Render the body of the CalendarDay when state.body.children not provided.\n */\nconst renderCalendarDayBody = (state: CalendarDayState) => {\n  assertSlots<CalendarDaySlots>(state);\n\n  return (\n    <state.body>\n      {state.weeks.map(week => {\n        const weekProps = state.getDayRowProps(week);\n\n        return (\n          <tr key={week.key} {...weekProps.root}>\n            {weekProps.weekNumber && <th {...weekProps.weekNumber} />}\n            {week.days.map(day => {\n              const dayProps = state.getDayCellProps(day);\n              return (\n                <td key={day.key} {...dayProps.root}>\n                  <button {...dayProps.button}>\n                    {dayProps.button.children !== undefined ? (\n                      dayProps.button.children\n                    ) : (\n                      <>\n                        <span {...dayProps.label} />\n                        {dayProps.marker && <span {...dayProps.marker} />}\n                      </>\n                    )}\n                  </button>\n                </td>\n              );\n            })}\n          </tr>\n        );\n      })}\n    </state.body>\n  );\n};\n\nconst renderWeekdayHeader = (state: CalendarDayState) => {\n  assertSlots<CalendarDaySlots>(state);\n  const weekdayRowProps = state.getDayRowProps(state.weekdayRow);\n\n  return (\n    <thead>\n      <tr {...weekdayRowProps.root}>\n        {weekdayRowProps.weekNumber && <th {...weekdayRowProps.weekNumber} />}\n        {state.weekdayRow.cells.map(cell => (\n          <th key={cell.key} {...state.getWeekdayCellProps(cell).root} />\n        ))}\n      </tr>\n    </thead>\n  );\n};\n"],"names":["renderCalendarDay","state","assertSlots","root","header","heading","navigation","previousMonthButton","nextMonthButton","closeButton","grid","renderWeekdayHeader","body","children","undefined","renderCalendarDayBody","weeks","map","week","weekProps","getDayRowProps","tr","weekNumber","th","days","day","dayProps","getDayCellProps","td","button","span","label","marker","key","weekdayRowProps","weekdayRow","thead","cells","cell","getWeekdayCellProps"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;;;;+BAQpCA;;;eAAAA;;;;gCAPe;AAOrB,MAAMA,oBAAoB,CAACC;IAChCC,IAAAA,2BAAW,EAAmBD;IAE9B,qBACE,sBAACA,MAAME,IAAI;;0BACT,sBAACF,MAAMG,MAAM;;kCACX,qBAACH,MAAMI,OAAO;kCACd,sBAACJ,MAAMK,UAAU;;0CACf,qBAACL,MAAMM,mBAAmB;0CAC1B,qBAACN,MAAMO,eAAe;4BACrBP,MAAMQ,WAAW,kBAAI,qBAACR,MAAMQ,WAAW;;;;;0BAG5C,sBAACR,MAAMS,IAAI;;oBACRC,oBAAoBV;oBACpBA,MAAMW,IAAI,CAACC,QAAQ,KAAKC,0BAAY,qBAACb,MAAMW,IAAI,QAAMG,sBAAsBd;;;;;AAIpF;AAEA;;CAEC,GACD,MAAMc,wBAAwB,CAACd;IAC7BC,IAAAA,2BAAW,EAAmBD;IAE9B,qBACE,qBAACA,MAAMW,IAAI;kBACRX,MAAMe,KAAK,CAACC,GAAG,CAACC,CAAAA;YACf,MAAMC,YAAYlB,MAAMmB,cAAc,CAACF;YAEvC,qBACE,sBAACG;gBAAmB,GAAGF,UAAUhB,IAAI;;oBAClCgB,UAAUG,UAAU,kBAAI,qBAACC;wBAAI,GAAGJ,UAAUG,UAAU;;oBACpDJ,KAAKM,IAAI,CAACP,GAAG,CAACQ,CAAAA;wBACb,MAAMC,WA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