@adyen/bento-vue2 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +67 -10
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/alert.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-filter.css +1 -0
- package/dist/assets/date-range-filter.css +1 -0
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/draggable-handle.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/fixed-scroller.css +1 -1
- package/dist/assets/form-layout-title.css +1 -1
- package/dist/assets/grid-layout.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/input-with-dropdown-filter.css +1 -0
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/table-of-contents.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.D29UQHoA.js → action-bar.DCknEWYe.js} +3 -3
- package/dist/chunks/{action-bar.D29UQHoA.js.map → action-bar.DCknEWYe.js.map} +1 -1
- package/dist/chunks/{ai-tag.BLi-Xoh_.js → ai-tag.DfnRfKPR.js} +2 -2
- package/dist/chunks/{ai-tag.BLi-Xoh_.js.map → ai-tag.DfnRfKPR.js.map} +1 -1
- package/dist/chunks/{alert.BddJPWMN.js → alert.DNS4RH4N.js} +52 -70
- package/dist/chunks/alert.DNS4RH4N.js.map +1 -0
- package/dist/chunks/{anchor-scroller.Clb_9RNz.js → anchor-scroller.BQc3CyTV.js} +2 -2
- package/dist/chunks/{anchor-scroller.Clb_9RNz.js.map → anchor-scroller.BQc3CyTV.js.map} +1 -1
- package/dist/chunks/{base-modal._-Cc6jfi.js → base-modal.BDLjv1Nd.js} +5 -5
- package/dist/chunks/{base-modal._-Cc6jfi.js.map → base-modal.BDLjv1Nd.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.1vZJWN1K.js → button-actions-with-menu.DnzDde3w.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.1vZJWN1K.js.map → button-actions-with-menu.DnzDde3w.js.map} +1 -1
- package/dist/chunks/{button-actions.CdetBz3J.js → button-actions.B332AjJp.js} +2 -2
- package/dist/chunks/button-actions.B332AjJp.js.map +1 -0
- package/dist/chunks/{calendar.BalfhApP.js → calendar.BZDISQai.js} +18 -18
- package/dist/chunks/{calendar.BalfhApP.js.map → calendar.BZDISQai.js.map} +1 -1
- package/dist/chunks/{card.BhhC01dV.js → card.CW8CUymm.js} +3 -3
- package/dist/chunks/{card.BhhC01dV.js.map → card.CW8CUymm.js.map} +1 -1
- package/dist/chunks/{checkbox-group.C-1v4X3c.js → checkbox-group.4OUTLAFJ.js} +3 -3
- package/dist/chunks/{checkbox-group.C-1v4X3c.js.map → checkbox-group.4OUTLAFJ.js.map} +1 -1
- package/dist/chunks/{checkbox.CnuIUi4-.js → checkbox.D-S3f_zM.js} +2 -2
- package/dist/chunks/{checkbox.CnuIUi4-.js.map → checkbox.D-S3f_zM.js.map} +1 -1
- package/dist/chunks/{code-snippet.Bkd8R0vf.js → code-snippet.D9BVc5mO.js} +4 -4
- package/dist/chunks/{code-snippet.Bkd8R0vf.js.map → code-snippet.D9BVc5mO.js.map} +1 -1
- package/dist/chunks/{controls-group.Bku83Fm_.js → controls-group.Bj-gJZ6W.js} +2 -2
- package/dist/chunks/{controls-group.Bku83Fm_.js.map → controls-group.Bj-gJZ6W.js.map} +1 -1
- package/dist/chunks/{copy.B12-P_8A.js → copy.Cmu6Z-5X.js} +3 -3
- package/dist/chunks/{copy.B12-P_8A.js.map → copy.Cmu6Z-5X.js.map} +1 -1
- package/dist/chunks/{dashboard-section.yS2FNoIV.js → dashboard-section.BJGzt3yh.js} +3 -3
- package/dist/chunks/{dashboard-section.yS2FNoIV.js.map → dashboard-section.BJGzt3yh.js.map} +1 -1
- package/dist/chunks/{dashed-underline.RcRbre03.js → dashed-underline.CCGmjCty.js} +3 -3
- package/dist/chunks/{dashed-underline.RcRbre03.js.map → dashed-underline.CCGmjCty.js.map} +1 -1
- package/dist/chunks/{data-grid-template.B5A9whlD.js → data-grid-template.BMdKtfXm.js} +4 -4
- package/dist/chunks/{data-grid-template.B5A9whlD.js.map → data-grid-template.BMdKtfXm.js.map} +1 -1
- package/dist/chunks/{data-grid.Pg5iM8CJ.js → data-grid.DP4IQ00C.js} +20 -20
- package/dist/chunks/{data-grid.Pg5iM8CJ.js.map → data-grid.DP4IQ00C.js.map} +1 -1
- package/dist/chunks/date-filter.DbgzfI2t.js +117 -0
- package/dist/chunks/date-filter.DbgzfI2t.js.map +1 -0
- package/dist/chunks/{date-picker.RFus1MVJ.js → date-picker.DxcdtoNh.js} +7 -7
- package/dist/chunks/{date-picker.RFus1MVJ.js.map → date-picker.DxcdtoNh.js.map} +1 -1
- package/dist/chunks/date-range-filter.DNYsTcZy.js +869 -0
- package/dist/chunks/date-range-filter.DNYsTcZy.js.map +1 -0
- package/dist/chunks/{date-range-picker.B2B4hO6R.js → date-range-picker.Pz5NFYCO.js} +34 -34
- package/dist/chunks/{date-range-picker.B2B4hO6R.js.map → date-range-picker.Pz5NFYCO.js.map} +1 -1
- package/dist/chunks/{date-time-picker.DJxDa81N.js → date-time-picker.DfE8jCuG.js} +5 -5
- package/dist/chunks/{date-time-picker.DJxDa81N.js.map → date-time-picker.DfE8jCuG.js.map} +1 -1
- package/dist/chunks/{draggable-handle.BM07OVdH.js → draggable-handle.De5DnjDK.js} +2 -2
- package/dist/chunks/{draggable-handle.BM07OVdH.js.map → draggable-handle.De5DnjDK.js.map} +1 -1
- package/dist/chunks/{draggable.BczXedk7.js → draggable.B1opQncT.js} +2 -2
- package/dist/chunks/{draggable.BczXedk7.js.map → draggable.B1opQncT.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.BmUNKoNw.js → dropdown-tag.B5vttt56.js} +3 -3
- package/dist/chunks/{dropdown-tag.BmUNKoNw.js.map → dropdown-tag.B5vttt56.js.map} +1 -1
- package/dist/chunks/{dropdown.CpZQYisR.js → dropdown.Dd8RNGXv.js} +963 -918
- package/dist/chunks/dropdown.Dd8RNGXv.js.map +1 -0
- package/dist/chunks/{empty-state.L3DTfiY7.js → empty-state.jbVOuwyN.js} +2 -2
- package/dist/chunks/{empty-state.L3DTfiY7.js.map → empty-state.jbVOuwyN.js.map} +1 -1
- package/dist/chunks/{field-label.BQaDr37D.js → field-label.Bz2PGQ-8.js} +2 -2
- package/dist/chunks/{field-label.BQaDr37D.js.map → field-label.Bz2PGQ-8.js.map} +1 -1
- package/dist/chunks/{file-uploader.Bo17jWtf.js → file-uploader.DmSy3J1u.js} +7 -6
- package/dist/chunks/{file-uploader.Bo17jWtf.js.map → file-uploader.DmSy3J1u.js.map} +1 -1
- package/dist/chunks/filter-bar.U5VrFM6-.js +1865 -0
- package/dist/chunks/filter-bar.U5VrFM6-.js.map +1 -0
- package/dist/chunks/{fixed-scroller.CHmrgoTQ.js → fixed-scroller.CkoOFRzH.js} +3 -3
- package/dist/chunks/{fixed-scroller.CHmrgoTQ.js.map → fixed-scroller.CkoOFRzH.js.map} +1 -1
- package/dist/chunks/{focus-trap.fd6_d2EW.js → focus-trap.BDpcWIxI.js} +1 -2
- package/dist/chunks/{focus-trap.fd6_d2EW.js.map → focus-trap.BDpcWIxI.js.map} +1 -1
- package/dist/chunks/{footer-actions.B8f-gEQV.js → footer-actions.CQYJ8Xvw.js} +2 -2
- package/dist/chunks/{footer-actions.B8f-gEQV.js.map → footer-actions.CQYJ8Xvw.js.map} +1 -1
- package/dist/chunks/{form-layout-title.b2BMYjnl.js → form-layout-title.MjuCRO9t.js} +2 -2
- package/dist/chunks/{form-layout-title.b2BMYjnl.js.map → form-layout-title.MjuCRO9t.js.map} +1 -1
- package/dist/chunks/grid-layout.m-5ySv9K.js +77 -0
- package/dist/chunks/grid-layout.m-5ySv9K.js.map +1 -0
- package/dist/chunks/{header-with-views.BJCjvhem.js → header-with-views.CvcWBdKH.js} +209 -209
- package/dist/chunks/{header-with-views.BJCjvhem.js.map → header-with-views.CvcWBdKH.js.map} +1 -1
- package/dist/chunks/{header.CDiold9n.js → header.CVKe-1fx.js} +4 -4
- package/dist/chunks/{header.CDiold9n.js.map → header.CVKe-1fx.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.BzGVcMqy.js → info-icon-with-popover.BtholUjs.js} +3 -3
- package/dist/chunks/{info-icon-with-popover.BzGVcMqy.js.map → info-icon-with-popover.BtholUjs.js.map} +1 -1
- package/dist/chunks/{info-icon.D11usblr.js → info-icon.D_VTjUV3.js} +3 -3
- package/dist/chunks/{info-icon.D11usblr.js.map → info-icon.D_VTjUV3.js.map} +1 -1
- package/dist/chunks/{input-field-password.D4Jn2yCi.js → input-field-password.DhFP1D1o.js} +4 -4
- package/dist/chunks/{input-field-password.D4Jn2yCi.js.map → input-field-password.DhFP1D1o.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.lV7yePoJ.js → input-field-phone-number.BRxttmou.js} +2 -2
- package/dist/chunks/{input-field-phone-number.lV7yePoJ.js.map → input-field-phone-number.BRxttmou.js.map} +1 -1
- package/dist/chunks/{input-field.90DWNO1a.js → input-field.FsFuEZ1l.js} +3 -3
- package/dist/chunks/{input-field.90DWNO1a.js.map → input-field.FsFuEZ1l.js.map} +1 -1
- package/dist/chunks/{input-time.D7IsprlH.js → input-time.DMBL8dyh.js} +3 -3
- package/dist/chunks/{input-time.D7IsprlH.js.map → input-time.DMBL8dyh.js.map} +1 -1
- package/dist/chunks/input-with-dropdown-filter.DtYX8oGX.js +80 -0
- package/dist/chunks/input-with-dropdown-filter.DtYX8oGX.js.map +1 -0
- package/dist/chunks/{inspector-page.IoC9naSV.js → inspector-page.DvS0wYuG.js} +2 -2
- package/dist/chunks/{inspector-page.IoC9naSV.js.map → inspector-page.DvS0wYuG.js.map} +1 -1
- package/dist/chunks/{inspector.BwtV4rE9.js → inspector.DZau1W4j.js} +2 -2
- package/dist/chunks/{inspector.BwtV4rE9.js.map → inspector.DZau1W4j.js.map} +1 -1
- package/dist/chunks/{list-item.ByyA5h1d.js → list-item.DTHD5vRf.js} +3 -3
- package/dist/chunks/{list-item.ByyA5h1d.js.map → list-item.DTHD5vRf.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.Cp_W_p4z.js → listbox-option-tag.JQxyZV07.js} +2 -2
- package/dist/chunks/{listbox-option-tag.Cp_W_p4z.js.map → listbox-option-tag.JQxyZV07.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.DG8Q-jHL.js → modal-fullscreen.DdlC1oF4.js} +3 -3
- package/dist/chunks/{modal-fullscreen.DG8Q-jHL.js.map → modal-fullscreen.DdlC1oF4.js.map} +1 -1
- package/dist/chunks/{modal.UkzON4bz.js → modal.CcyPb4mE.js} +4 -4
- package/dist/chunks/{modal.UkzON4bz.js.map → modal.CcyPb4mE.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.BzKRuhrd.js → navigation-menu-group.Syx9ckwd.js} +2 -2
- package/dist/chunks/{navigation-menu-group.BzKRuhrd.js.map → navigation-menu-group.Syx9ckwd.js.map} +1 -1
- package/dist/chunks/{pagination.DZEVT-CA.js → pagination.BVGAPUhn.js} +2 -2
- package/dist/chunks/{pagination.DZEVT-CA.js.map → pagination.BVGAPUhn.js.map} +1 -1
- package/dist/chunks/popover.types.CoDfZgDc.js +6 -0
- package/dist/chunks/{popover.types.DvIwSAAp.js.map → popover.types.CoDfZgDc.js.map} +1 -1
- package/dist/chunks/{popper-container.Cj3AWXSd.js → popper-container.Co4j6qME.js} +2 -2
- package/dist/chunks/{popper-container.Cj3AWXSd.js.map → popper-container.Co4j6qME.js.map} +1 -1
- package/dist/chunks/{progress-bar.CaurNYsc.js → progress-bar.BVQrgM_5.js} +2 -2
- package/dist/chunks/{progress-bar.CaurNYsc.js.map → progress-bar.BVQrgM_5.js.map} +1 -1
- package/dist/chunks/promo-banner.CcYpFY9b.js.map +1 -1
- package/dist/chunks/{radio-group.CLbYlzD7.js → radio-group.Do6wZ8p5.js} +3 -3
- package/dist/chunks/{radio-group.CLbYlzD7.js.map → radio-group.Do6wZ8p5.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.5SMm2BbC.js → rich-text-editor.CTJGGcFd.js} +5 -5
- package/dist/chunks/{rich-text-editor.5SMm2BbC.js.map → rich-text-editor.CTJGGcFd.js.map} +1 -1
- package/dist/chunks/{search-bar.DrIwlAQj.js → search-bar.DFvrkNTD.js} +3 -3
- package/dist/chunks/{search-bar.DrIwlAQj.js.map → search-bar.DFvrkNTD.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DRs5yAve.js → secondary-nav.BMsZqzdr.js} +3 -3
- package/dist/chunks/{secondary-nav.DRs5yAve.js.map → secondary-nav.BMsZqzdr.js.map} +1 -1
- package/dist/chunks/{segmented-control.CcQoBTfT.js → segmented-control.CgQbt9HC.js} +2 -2
- package/dist/chunks/{segmented-control.CcQoBTfT.js.map → segmented-control.CgQbt9HC.js.map} +1 -1
- package/dist/chunks/select-avatar-filter.DzuDTc_M.js +51 -0
- package/dist/chunks/select-avatar-filter.DzuDTc_M.js.map +1 -0
- package/dist/chunks/select-country-filter.DfLRX6oH.js +55 -0
- package/dist/chunks/select-country-filter.DfLRX6oH.js.map +1 -0
- package/dist/chunks/select-currency-filter.DZdYgqq3.js +89 -0
- package/dist/chunks/select-currency-filter.DZdYgqq3.js.map +1 -0
- package/dist/chunks/select-payment-method-filter.8NdbJiG5.js +51 -0
- package/dist/chunks/select-payment-method-filter.8NdbJiG5.js.map +1 -0
- package/dist/chunks/select-tag-filter.CTiPiXzG.js +59 -0
- package/dist/chunks/select-tag-filter.CTiPiXzG.js.map +1 -0
- package/dist/chunks/{selection-card-group.BYBAG8ig.js → selection-card-group.BhbzoA3X.js} +3 -3
- package/dist/chunks/{selection-card-group.BYBAG8ig.js.map → selection-card-group.BhbzoA3X.js.map} +1 -1
- package/dist/chunks/{sidepanel.CLbVkH7v.js → sidepanel.CbFGBFMX.js} +8 -8
- package/dist/chunks/sidepanel.CbFGBFMX.js.map +1 -0
- package/dist/chunks/{structured-list-item.BgcR0XlO.js → structured-list-item.C-9xk326.js} +4 -4
- package/dist/chunks/{structured-list-item.BgcR0XlO.js.map → structured-list-item.C-9xk326.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.Do2PZQGm.js → summary-grid.types.C4-lY9Xr.js} +6 -6
- package/dist/chunks/{summary-grid.types.Do2PZQGm.js.map → summary-grid.types.C4-lY9Xr.js.map} +1 -1
- package/dist/chunks/{tab.zeRxc-3T.js → tab.BHaKwojJ.js} +3 -3
- package/dist/chunks/{tab.zeRxc-3T.js.map → tab.BHaKwojJ.js.map} +1 -1
- package/dist/chunks/{tag.CgsX8v2m.js → tag.DSyMRETc.js} +2 -2
- package/dist/chunks/{tag.CgsX8v2m.js.map → tag.DSyMRETc.js.map} +1 -1
- package/dist/chunks/{textarea.DMBnJaB1.js → textarea.DFKus3jR.js} +2 -2
- package/dist/chunks/{textarea.DMBnJaB1.js.map → textarea.DFKus3jR.js.map} +1 -1
- package/dist/chunks/{timeline-item.CS7TCdoU.js → timeline-item.bXwmfW79.js} +80 -68
- package/dist/chunks/timeline-item.bXwmfW79.js.map +1 -0
- package/dist/chunks/{title-details.BhR2nis-.js → title-details.cMpPBjrP.js} +2 -2
- package/dist/chunks/{title-details.BhR2nis-.js.map → title-details.cMpPBjrP.js.map} +1 -1
- package/dist/chunks/{tooltip.BOe7LOfD.js → tooltip.BeDzwoCN.js} +3 -3
- package/dist/chunks/{tooltip.BOe7LOfD.js.map → tooltip.BeDzwoCN.js.map} +1 -1
- package/dist/chunks/{tutorial.DSbBx_2h.js → tutorial.C8ApuHSy.js} +4 -4
- package/dist/chunks/{tutorial.DSbBx_2h.js.map → tutorial.C8ApuHSy.js.map} +1 -1
- package/dist/chunks/typography.Cd386LC_.js.map +1 -1
- package/dist/chunks/{use-date-input-formatter.CouOE5tF.js → use-date-input-formatter.DgTh6Zx4.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.CouOE5tF.js.map → use-date-input-formatter.DgTh6Zx4.js.map} +1 -1
- package/dist/chunks/warning-filled.DI6aB6vH.js +26 -0
- package/dist/chunks/warning-filled.DI6aB6vH.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +1 -1
- package/dist/draggable.js +2 -2
- package/dist/dropdown.js +2 -2
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +57 -57
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/inspector.js +2 -2
- package/dist/internal.js +13 -13
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-menu.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.js +2 -2
- package/dist/popper-container.js +1 -1
- package/dist/progress-bar.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +74 -10
- package/package.json +7 -7
- package/dist/chunks/alert.BddJPWMN.js.map +0 -1
- package/dist/chunks/button-actions.CdetBz3J.js.map +0 -1
- package/dist/chunks/dropdown.CpZQYisR.js.map +0 -1
- package/dist/chunks/filter-bar.Bio9nf9V.js +0 -3132
- package/dist/chunks/filter-bar.Bio9nf9V.js.map +0 -1
- package/dist/chunks/grid-layout.BeCrjPgT.js +0 -75
- package/dist/chunks/grid-layout.BeCrjPgT.js.map +0 -1
- package/dist/chunks/popover.types.DvIwSAAp.js +0 -6
- package/dist/chunks/sidepanel.CLbVkH7v.js.map +0 -1
- package/dist/chunks/timeline-item.CS7TCdoU.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixed-scroller.CHmrgoTQ.js","sources":["../../src/components/internal/fixed-scroller/composables/useFixedScroller.ts","../../src/components/internal/fixed-scroller/fixed-scroller.vue"],"sourcesContent":["import { observeSizeOfElement } from '@/utils/ts/resize';\nimport { computed, nextTick, onMounted, ref, watch } from 'vue';\nimport type { Ref, UnwrapRef } from 'vue';\n\n// Adding an offset of \"1\" so that the border can be shown within the boundaries\nconst OVERFLOW_CLIP_OFFSET = 1;\n// Add the gradient offset to the calculations\nconst GRADIENT_OFFSET = 40;\n\ninterface useFixedScrollerProps {\n contentRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n containerRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n leftButtonRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n rightButtonRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n}\n\n/**\n * Function to calculate the offset of each view and change the \"view\" via offsets\n * through the functions `scrollLeft` and `scrollRight` whilst providing a way to\n * show and hide the buttons based on the current \"view\" via\n * `shouldShowLeftButton` and `shouldShowRightButton`.\n *\n * Each view is pre-calculated (offsetArray) and updated if the content changes as a computed ref:\n * First view: Always 0 (x axis beginning).\n * Last view: total content space - visible width\n * Intermediate views: Previous offset (to the left) plus the visible space taking\n * away the space the buttons take so that the whole view can be rendered\n *\n *\n * @param props - All the necessary references to calculate the scroll\n * @param props.containerRef - Reference to the container, this defines the visible space width\n * @param props.contentRef - Reference to the content itself, this defines the total content width\n * @param props.leftButtonRef - Reference to the left button, used to calculate total space in which the content will be rendered\n * @param props.rightButtonRef - Reference to the right button, used to calculate total space in which the content will be rendered\n * @returns response - Values used in the view to show the buttons and to change the view right or left\n * @returns response.offset - Offset value by which the view will move on the x axis. To be used in `styles`.\n * @returns response.shouldShowLeftButton - Indicates if the button on the left should be shown\n * @returns response.shouldShowRightButton - Indicates if the button on the right should be shown\n * @returns response.maskStyle - CSS custom properties for the content mask, based on the rendered button widths\n * @returns response.scrollLeft - Used to shift the view to the left\n * @returns response.scrollRight - Used to shift the view to the right\n */\nexport const useFixedScroller = ({\n contentRef,\n containerRef,\n leftButtonRef,\n rightButtonRef,\n}: useFixedScrollerProps) => {\n const offset = ref(0);\n const currentView = ref(0);\n\n // Calculated using 'scrollWidth' to get the full width of the content\n const totalContentWidth = ref(0);\n // Calculated using 'clientWidth' to get the rendered componen width\n const visibleSpaceWidth = ref(0);\n\n onMounted(() => {\n observeSizeOfElement(containerRef.value, () => {\n if (containerRef.value) {\n // Set new width when resized\n visibleSpaceWidth.value = containerRef.value.offsetWidth;\n // Reset the offset and view\n currentView.value = 0;\n offset.value = 0;\n }\n });\n\n observeSizeOfElement(contentRef.value, () => {\n totalContentWidth.value = contentRef.value?.scrollWidth;\n\n if (totalContentWidth.value < visibleSpaceWidth.value) {\n // Reset the offset and view\n currentView.value = 0;\n offset.value = 0;\n }\n });\n });\n\n // Sum of the space used by the Left and Right buttons\n // Used to calculate how much space the \"actual\" visible space is\n const buttonsWidth = computed(() => {\n const leftButtonWidth = leftButtonRef.value?.scrollWidth\n ? leftButtonRef.value.scrollWidth + GRADIENT_OFFSET\n : 0;\n const rightButtonWidth = rightButtonRef.value?.scrollWidth\n ? rightButtonRef.value.scrollWidth + GRADIENT_OFFSET\n : 0;\n\n return leftButtonWidth + rightButtonWidth;\n });\n // Total number of pages/views available.\n // Calculated as \"ceil\" because if the space doesn't fit \"one view\" (irrational number) the content flows to the next view (integer).\n const totalViews = computed(() => Math.ceil(totalContentWidth.value / visibleSpaceWidth.value) ?? 0);\n\n // Calculation of offsets per view (index).\n // This allows to easily swap the offset without on-the-fly calculations\n const offsetArray = computed(() => {\n const calculatedOffsetList = new Array(totalViews.value).fill(0);\n\n calculatedOffsetList.forEach((_, index) => {\n // First offset will be 0\n if (index === 0) {\n return;\n }\n\n // Calculate last\n if (index === totalViews.value - 1) {\n calculatedOffsetList[calculatedOffsetList.length - 1] = -(\n totalContentWidth.value -\n visibleSpaceWidth.value +\n OVERFLOW_CLIP_OFFSET\n );\n\n return;\n }\n\n // Calculate each offset - Move 1 view\n const previousOffset = calculatedOffsetList[index - 1];\n calculatedOffsetList[index] = -(visibleSpaceWidth.value + Math.abs(previousOffset) - buttonsWidth.value);\n });\n\n return calculatedOffsetList;\n });\n\n // Hide left button when it's the first view\n const shouldShowLeftButton = computed(() => currentView.value !== 0);\n // Hide right button if it's the last view\n const shouldShowRightButton = computed(\n () => offset.value >= -(totalContentWidth.value - visibleSpaceWidth.value - 1)\n );\n\n // Rendered width (including padding) of each button overlay, used to drive the\n // content mask so the fade matches the area each button occupies. They are 0 when\n // the corresponding button is hidden, which leaves that edge of the content unmasked.\n const leftButtonOverlayWidth = ref(0);\n const rightButtonOverlayWidth = ref(0);\n\n // Buttons are conditionally rendered, so measure them after the visibility update is applied.\n watch(\n shouldShowLeftButton,\n async shown => {\n if (!shown) {\n leftButtonOverlayWidth.value = 0;\n\n return;\n }\n\n await nextTick();\n leftButtonOverlayWidth.value = leftButtonRef.value?.offsetWidth ?? 0;\n },\n { immediate: true }\n );\n\n watch(\n shouldShowRightButton,\n async shown => {\n if (!shown) {\n rightButtonOverlayWidth.value = 0;\n\n return;\n }\n\n await nextTick();\n rightButtonOverlayWidth.value = rightButtonRef.value?.offsetWidth ?? 0;\n },\n { immediate: true }\n );\n\n /**\n * CSS custom properties used by the container mask to match the visible button overlays.\n */\n const maskStyle = computed(() => ({\n '--fixed-scroller-mask-left': `${leftButtonOverlayWidth.value}px`,\n '--fixed-scroller-mask-right': `${rightButtonOverlayWidth.value}px`,\n }));\n\n /**\n * Shifts the current offset by one view to the left.\n */\n const scrollLeft = () => {\n // Do nothing if it is already in page 0\n if (currentView.value === 0) {\n return;\n }\n\n currentView.value -= 1;\n offset.value = offsetArray.value[currentView.value];\n };\n\n /**\n * Shifts the current offset by one view to the right.\n */\n const scrollRight = () => {\n // Do nothing if it is already in last page\n if (currentView.value === totalViews.value - 1) {\n return;\n }\n\n currentView.value += 1;\n offset.value = offsetArray.value[currentView.value];\n };\n\n return {\n offset,\n shouldShowLeftButton,\n shouldShowRightButton,\n maskStyle,\n\n // Methods\n scrollLeft,\n scrollRight,\n };\n};\n","<template>\n <div ref=\"fixedScrollerRef\" class=\"b-fixed-scroller\">\n <div class=\"b-fixed-scroller__container\" :style=\"maskStyle\">\n <div\n ref=\"contentRef\"\n class=\"b-fixed-scroller__content\"\n :style=\"{\n transform: `translateX(${offset}px)`,\n paddingTop: shouldShowLeftButton || shouldShowRightButton ? `${extraPaddingTop}px` : null,\n }\"\n >\n <slot></slot>\n </div>\n </div>\n\n <div\n v-if=\"shouldShowLeftButton\"\n ref=\"leftButtonRef\"\n class=\"b-fixed-scroller__left b-fixed-scroller__button\"\n :class=\"buttonConditionalClasses\"\n >\n <bento-button variant=\"secondary\" :aria-label=\"t('scrollLeft')\" :condensed=\"condensed\" @click=\"scrollLeft\">\n <template #iconLeft>\n <chevron-left-icon svg-title=\"checked\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n <div\n v-if=\"shouldShowRightButton\"\n ref=\"rightButtonRef\"\n class=\"b-fixed-scroller__right b-fixed-scroller__button\"\n :class=\"buttonConditionalClasses\"\n >\n <bento-button\n variant=\"secondary\"\n :aria-label=\"t('scrollRight')\"\n :condensed=\"condensed\"\n @click=\"scrollRight\"\n >\n <template #iconLeft>\n <chevron-right-icon svg-title=\"checked\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import { BentoButton } from '@/components/button';\n import { useFixedScroller } from './composables';\n import { useI18n } from '@/utils/ts/i18n';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const contentRef = ref(null);\n const fixedScrollerRef = ref(null);\n const leftButtonRef = ref(null);\n const rightButtonRef = ref(null);\n\n const props = defineProps({\n /**\n * Applies the condensed style to the buttons\n */\n condensed: { type: Boolean, default: false },\n /**\n * Padding to be applied to the top of the scroller container\n */\n extraPaddingTop: { type: Number, default: 0 },\n /**\n * Padding to be applied to the top of the scroller container\n */\n centered: { type: Boolean, default: false },\n });\n\n const { offset, shouldShowLeftButton, shouldShowRightButton, maskStyle, scrollLeft, scrollRight } =\n useFixedScroller({\n contentRef,\n containerRef: fixedScrollerRef,\n leftButtonRef,\n rightButtonRef,\n });\n\n const buttonConditionalClasses = computed(() => ({\n 'b-fixed-scroller__button--centered': props.centered,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Allows to horizontally scroll content by one view at a time.\n *\n * @example\n * import { FixedScroller } from '@/internal';\n *\n * export default {\n * components: { FixedScroller },\n * template: `\n * <fixed-scroller>\n * <div style=\"display: flex; gap: 8px;\">\n * {{ Content here }}\n * </div>\n * </fixed-scroller>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./fixed-scroller.scss\" />\n"],"names":["OVERFLOW_CLIP_OFFSET","GRADIENT_OFFSET","useFixedScroller","contentRef","containerRef","leftButtonRef","rightButtonRef","offset","ref","currentView","totalContentWidth","visibleSpaceWidth","onMounted","observeSizeOfElement","buttonsWidth","computed","leftButtonWidth","rightButtonWidth","totalViews","offsetArray","calculatedOffsetList","_","index","previousOffset","shouldShowLeftButton","shouldShowRightButton","leftButtonOverlayWidth","rightButtonOverlayWidth","watch","shown","nextTick","maskStyle","__default__","messages","t","useI18n","fixedScrollerRef","scrollLeft","scrollRight","buttonConditionalClasses","props"],"mappings":";;;;;;;AAKA,MAAAA,IAAA,GAEAC,IAAA,IAmCOC,IAAA,CAAA;AAAA,EAA0B,YAAAC;AAAA,EAC7B,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAEJ,MAAA;AACI,QAAAC,IAAAC,EAAA,CAAA,GACAC,IAAAD,EAAA,CAAA,GAGAE,IAAAF,EAAA,CAAA,GAEAG,IAAAH,EAAA,CAAA;AAEA,EAAAI,EAAA,MAAA;AACI,IAAAC,EAAAT,EAAA,OAAA,MAAA;AACI,MAAAA,EAAA,UAEIO,EAAA,QAAAP,EAAA,MAAA,aAEAK,EAAA,QAAA,GACAF,EAAA,QAAA;AAAA,IACJ,CAAA,GAGJM,EAAAV,EAAA,OAAA,MAAA;AACI,MAAAO,EAAA,QAAAP,EAAA,OAAA,aAEAO,EAAA,QAAAC,EAAA,UAEIF,EAAA,QAAA,GACA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EAAA;AAAA,IACD,EAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"fixed-scroller.CkoOFRzH.js","sources":["../../src/components/internal/fixed-scroller/composables/useFixedScroller.ts","../../src/components/internal/fixed-scroller/fixed-scroller.vue"],"sourcesContent":["import { observeSizeOfElement } from '@/utils/ts/resize';\nimport { computed, nextTick, onMounted, ref, watch } from 'vue';\nimport type { Ref, UnwrapRef } from 'vue';\n\n// Adding an offset of \"1\" so that the border can be shown within the boundaries\nconst OVERFLOW_CLIP_OFFSET = 1;\n// Add the gradient offset to the calculations\nconst GRADIENT_OFFSET = 40;\n\ninterface useFixedScrollerProps {\n contentRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n containerRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n leftButtonRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n rightButtonRef?: Ref<UnwrapRef<HTMLDivElement | undefined>>;\n}\n\n/**\n * Function to calculate the offset of each view and change the \"view\" via offsets\n * through the functions `scrollLeft` and `scrollRight` whilst providing a way to\n * show and hide the buttons based on the current \"view\" via\n * `shouldShowLeftButton` and `shouldShowRightButton`.\n *\n * Each view is pre-calculated (offsetArray) and updated if the content changes as a computed ref:\n * First view: Always 0 (x axis beginning).\n * Last view: total content space - visible width\n * Intermediate views: Previous offset (to the left) plus the visible space taking\n * away the space the buttons take so that the whole view can be rendered\n *\n *\n * @param props - All the necessary references to calculate the scroll\n * @param props.containerRef - Reference to the container, this defines the visible space width\n * @param props.contentRef - Reference to the content itself, this defines the total content width\n * @param props.leftButtonRef - Reference to the left button, used to calculate total space in which the content will be rendered\n * @param props.rightButtonRef - Reference to the right button, used to calculate total space in which the content will be rendered\n * @returns response - Values used in the view to show the buttons and to change the view right or left\n * @returns response.offset - Offset value by which the view will move on the x axis. To be used in `styles`.\n * @returns response.shouldShowLeftButton - Indicates if the button on the left should be shown\n * @returns response.shouldShowRightButton - Indicates if the button on the right should be shown\n * @returns response.maskStyle - CSS custom properties for the content mask, based on the rendered button widths\n * @returns response.scrollLeft - Used to shift the view to the left\n * @returns response.scrollRight - Used to shift the view to the right\n */\nexport const useFixedScroller = ({\n contentRef,\n containerRef,\n leftButtonRef,\n rightButtonRef,\n}: useFixedScrollerProps) => {\n const offset = ref(0);\n const currentView = ref(0);\n\n // Calculated using 'scrollWidth' to get the full width of the content\n const totalContentWidth = ref(0);\n // Calculated using 'clientWidth' to get the rendered componen width\n const visibleSpaceWidth = ref(0);\n\n onMounted(() => {\n observeSizeOfElement(containerRef.value, () => {\n if (containerRef.value) {\n // Set new width when resized\n visibleSpaceWidth.value = containerRef.value.offsetWidth;\n // Reset the offset and view\n currentView.value = 0;\n offset.value = 0;\n }\n });\n\n observeSizeOfElement(contentRef.value, () => {\n totalContentWidth.value = contentRef.value?.scrollWidth;\n\n if (totalContentWidth.value < visibleSpaceWidth.value) {\n // Reset the offset and view\n currentView.value = 0;\n offset.value = 0;\n }\n });\n });\n\n // Sum of the space used by the Left and Right buttons\n // Used to calculate how much space the \"actual\" visible space is\n const buttonsWidth = computed(() => {\n const leftButtonWidth = leftButtonRef.value?.scrollWidth\n ? leftButtonRef.value.scrollWidth + GRADIENT_OFFSET\n : 0;\n const rightButtonWidth = rightButtonRef.value?.scrollWidth\n ? rightButtonRef.value.scrollWidth + GRADIENT_OFFSET\n : 0;\n\n return leftButtonWidth + rightButtonWidth;\n });\n // Total number of pages/views available.\n // Calculated as \"ceil\" because if the space doesn't fit \"one view\" (irrational number) the content flows to the next view (integer).\n const totalViews = computed(() => Math.ceil(totalContentWidth.value / visibleSpaceWidth.value) ?? 0);\n\n // Calculation of offsets per view (index).\n // This allows to easily swap the offset without on-the-fly calculations\n const offsetArray = computed(() => {\n const calculatedOffsetList = new Array(totalViews.value).fill(0);\n\n calculatedOffsetList.forEach((_, index) => {\n // First offset will be 0\n if (index === 0) {\n return;\n }\n\n // Calculate last\n if (index === totalViews.value - 1) {\n calculatedOffsetList[calculatedOffsetList.length - 1] = -(\n totalContentWidth.value -\n visibleSpaceWidth.value +\n OVERFLOW_CLIP_OFFSET\n );\n\n return;\n }\n\n // Calculate each offset - Move 1 view\n const previousOffset = calculatedOffsetList[index - 1];\n calculatedOffsetList[index] = -(visibleSpaceWidth.value + Math.abs(previousOffset) - buttonsWidth.value);\n });\n\n return calculatedOffsetList;\n });\n\n // Hide left button when it's the first view\n const shouldShowLeftButton = computed(() => currentView.value !== 0);\n // Hide right button if it's the last view\n const shouldShowRightButton = computed(\n () => offset.value >= -(totalContentWidth.value - visibleSpaceWidth.value - 1)\n );\n\n // Rendered width (including padding) of each button overlay, used to drive the\n // content mask so the fade matches the area each button occupies. They are 0 when\n // the corresponding button is hidden, which leaves that edge of the content unmasked.\n const leftButtonOverlayWidth = ref(0);\n const rightButtonOverlayWidth = ref(0);\n\n // Buttons are conditionally rendered, so measure them after the visibility update is applied.\n watch(\n shouldShowLeftButton,\n async shown => {\n if (!shown) {\n leftButtonOverlayWidth.value = 0;\n\n return;\n }\n\n await nextTick();\n leftButtonOverlayWidth.value = leftButtonRef.value?.offsetWidth ?? 0;\n },\n { immediate: true }\n );\n\n watch(\n shouldShowRightButton,\n async shown => {\n if (!shown) {\n rightButtonOverlayWidth.value = 0;\n\n return;\n }\n\n await nextTick();\n rightButtonOverlayWidth.value = rightButtonRef.value?.offsetWidth ?? 0;\n },\n { immediate: true }\n );\n\n /**\n * CSS custom properties used by the container mask to match the visible button overlays.\n */\n const maskStyle = computed(() => ({\n '--fixed-scroller-mask-left': `${leftButtonOverlayWidth.value}px`,\n '--fixed-scroller-mask-right': `${rightButtonOverlayWidth.value}px`,\n }));\n\n /**\n * Shifts the current offset by one view to the left.\n */\n const scrollLeft = () => {\n // Do nothing if it is already in page 0\n if (currentView.value === 0) {\n return;\n }\n\n currentView.value -= 1;\n offset.value = offsetArray.value[currentView.value];\n };\n\n /**\n * Shifts the current offset by one view to the right.\n */\n const scrollRight = () => {\n // Do nothing if it is already in last page\n if (currentView.value === totalViews.value - 1) {\n return;\n }\n\n currentView.value += 1;\n offset.value = offsetArray.value[currentView.value];\n };\n\n return {\n offset,\n shouldShowLeftButton,\n shouldShowRightButton,\n maskStyle,\n\n // Methods\n scrollLeft,\n scrollRight,\n };\n};\n","<template>\n <div ref=\"fixedScrollerRef\" class=\"b-fixed-scroller\">\n <div class=\"b-fixed-scroller__container\" :style=\"maskStyle\">\n <div\n ref=\"contentRef\"\n class=\"b-fixed-scroller__content\"\n :style=\"{\n transform: `translateX(${offset}px)`,\n paddingTop: shouldShowLeftButton || shouldShowRightButton ? `${extraPaddingTop}px` : null,\n }\"\n >\n <slot></slot>\n </div>\n </div>\n\n <div\n v-if=\"shouldShowLeftButton\"\n ref=\"leftButtonRef\"\n class=\"b-fixed-scroller__left b-fixed-scroller__button\"\n :class=\"buttonConditionalClasses\"\n >\n <bento-button variant=\"secondary\" :aria-label=\"t('scrollLeft')\" :condensed=\"condensed\" @click=\"scrollLeft\">\n <template #iconLeft>\n <chevron-left-icon svg-title=\"checked\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n <div\n v-if=\"shouldShowRightButton\"\n ref=\"rightButtonRef\"\n class=\"b-fixed-scroller__right b-fixed-scroller__button\"\n :class=\"buttonConditionalClasses\"\n >\n <bento-button\n variant=\"secondary\"\n :aria-label=\"t('scrollRight')\"\n :condensed=\"condensed\"\n @click=\"scrollRight\"\n >\n <template #iconLeft>\n <chevron-right-icon svg-title=\"checked\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import { BentoButton } from '@/components/button';\n import { useFixedScroller } from './composables';\n import { useI18n } from '@/utils/ts/i18n';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const contentRef = ref(null);\n const fixedScrollerRef = ref(null);\n const leftButtonRef = ref(null);\n const rightButtonRef = ref(null);\n\n const props = defineProps({\n /**\n * Applies the condensed style to the buttons\n */\n condensed: { type: Boolean, default: false },\n /**\n * Padding to be applied to the top of the scroller container\n */\n extraPaddingTop: { type: Number, default: 0 },\n /**\n * Vertically centers the scroll buttons in the container instead of spacing them from its top and bottom edges\n */\n centered: { type: Boolean, default: false },\n });\n\n const { offset, shouldShowLeftButton, shouldShowRightButton, maskStyle, scrollLeft, scrollRight } =\n useFixedScroller({\n contentRef,\n containerRef: fixedScrollerRef,\n leftButtonRef,\n rightButtonRef,\n });\n\n const buttonConditionalClasses = computed(() => ({\n 'b-fixed-scroller__button--centered': props.centered,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Allows to horizontally scroll content by one view at a time.\n *\n * @example\n * import { FixedScroller } from '@/internal';\n *\n * export default {\n * components: { FixedScroller },\n * template: `\n * <fixed-scroller>\n * <div style=\"display: flex; gap: 8px;\">\n * {{ Content here }}\n * </div>\n * </fixed-scroller>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./fixed-scroller.scss\" />\n"],"names":["OVERFLOW_CLIP_OFFSET","GRADIENT_OFFSET","useFixedScroller","contentRef","containerRef","leftButtonRef","rightButtonRef","offset","ref","currentView","totalContentWidth","visibleSpaceWidth","onMounted","observeSizeOfElement","buttonsWidth","computed","leftButtonWidth","rightButtonWidth","totalViews","offsetArray","calculatedOffsetList","_","index","previousOffset","shouldShowLeftButton","shouldShowRightButton","leftButtonOverlayWidth","rightButtonOverlayWidth","watch","shown","nextTick","maskStyle","__default__","messages","t","useI18n","fixedScrollerRef","scrollLeft","scrollRight","buttonConditionalClasses","props"],"mappings":";;;;;;;AAKA,MAAAA,IAAA,GAEAC,IAAA,IAmCOC,IAAA,CAAA;AAAA,EAA0B,YAAAC;AAAA,EAC7B,cAAAC;AAAA,EACA,eAAA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