@salla.sa/twilight-components 2.14.261 → 2.14.262
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/cjs/{app-globals-9KVXzA9b.js → app-globals-e3kKmuwC.js} +3 -3
- package/dist/cjs/{app-globals-9KVXzA9b.js.map → app-globals-e3kKmuwC.js.map} +1 -1
- package/dist/cjs/{index-CfmOwvmC.js → index-BJv-nH8x.js} +4 -4
- package/dist/cjs/index-BJv-nH8x.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion_4.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{app-globals-BgG-hCSq.js → app-globals-VqthM5f6.js} +3 -3
- package/dist/esm/{app-globals-BgG-hCSq.js.map → app-globals-VqthM5f6.js.map} +1 -1
- package/dist/esm/{index-LSZwJPPB.js → index-gdhHvm6V.js} +4 -4
- package/dist/esm/index-gdhHvm6V.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion_4.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm-es5/{app-globals-BgG-hCSq.js → app-globals-VqthM5f6.js} +2 -2
- package/dist/esm-es5/{app-globals-BgG-hCSq.js.map → app-globals-VqthM5f6.js.map} +1 -1
- package/dist/esm-es5/{index-LSZwJPPB.js → index-gdhHvm6V.js} +3 -3
- package/dist/esm-es5/index-gdhHvm6V.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion_4.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +4 -4
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm-es5/salla-order-details.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-64c8b0e2.system.entry.js → p-00d05d4c.system.entry.js} +2 -2
- package/dist/twilight/{p-de2b1078.system.entry.js → p-07327345.system.entry.js} +2 -2
- package/dist/twilight/{p-1f93b886.system.entry.js → p-16493b31.system.entry.js} +2 -2
- package/dist/twilight/{p-ea832823.system.entry.js → p-18eaeb07.system.entry.js} +2 -2
- package/dist/twilight/{p-09bc1f72.system.entry.js → p-1e3e4a84.system.entry.js} +2 -2
- package/dist/twilight/{p-aa49c07f.entry.js → p-1e4e21ab.entry.js} +2 -2
- package/dist/twilight/{p-fcfd9a2b.entry.js → p-1e5c48d0.entry.js} +2 -2
- package/dist/twilight/{p-39d68fc1.system.entry.js → p-229e4f73.system.entry.js} +2 -2
- package/dist/twilight/{p-4eef3c0e.system.entry.js → p-2314d050.system.entry.js} +2 -2
- package/dist/twilight/{p-059405fc.system.entry.js → p-243cd247.system.entry.js} +2 -2
- package/dist/twilight/{p-143dd94c.system.entry.js → p-28cc1200.system.entry.js} +2 -2
- package/dist/twilight/{p-ce02710a.entry.js → p-2f3b050a.entry.js} +2 -2
- package/dist/twilight/{p-c09565da.entry.js → p-36f043a4.entry.js} +2 -2
- package/dist/twilight/{p-f0cc5b35.entry.js → p-37bdeacb.entry.js} +2 -2
- package/dist/twilight/{p-0e1cd76c.system.entry.js → p-42aa8f00.system.entry.js} +3 -3
- package/dist/twilight/{p-47de107e.entry.js → p-4446d80b.entry.js} +6 -6
- package/dist/twilight/{p-88e53a1e.system.entry.js → p-4f54efd1.system.entry.js} +2 -2
- package/dist/twilight/{p-9e6c5671.entry.js → p-513eb3ab.entry.js} +2 -2
- package/dist/twilight/{p-fa5ead87.entry.js → p-51563172.entry.js} +2 -2
- package/dist/twilight/{p-d660efad.entry.js → p-545204c4.entry.js} +2 -2
- package/dist/twilight/{p-1f8bf87a.entry.js → p-58702c6a.entry.js} +2 -2
- package/dist/twilight/{p-c38dbed0.entry.js → p-5fb7d021.entry.js} +2 -2
- package/dist/twilight/{p-b0d88d59.entry.js → p-6234d5b1.entry.js} +2 -2
- package/dist/twilight/{p-5bae6d14.system.entry.js → p-66440eaf.system.entry.js} +2 -2
- package/dist/twilight/{p-c5fa09d1.system.entry.js → p-68e96348.system.entry.js} +2 -2
- package/dist/twilight/{p-675d4ab7.entry.js → p-6d9239fa.entry.js} +2 -2
- package/dist/twilight/{p-d1ef5396.entry.js → p-7a849013.entry.js} +2 -2
- package/dist/twilight/{p-d62c20f1.system.entry.js → p-7d8494a1.system.entry.js} +2 -2
- package/dist/twilight/{p-Xd4af-0t.system.js.map → p-7hzBIbI9.system.js.map} +1 -1
- package/dist/twilight/{p-fe0234a1.entry.js → p-8aa7e30f.entry.js} +2 -2
- package/dist/twilight/{p-87d32e2f.entry.js → p-8f3dec24.entry.js} +2 -2
- package/dist/twilight/{p-Cnbdx_CN.system.js.map → p-93DWpqSw.system.js.map} +1 -1
- package/dist/twilight/{p-4806aee6.system.entry.js → p-953d84e6.system.entry.js} +2 -2
- package/dist/twilight/{p-d3a36873.entry.js → p-9a8f94bd.entry.js} +2 -2
- package/dist/twilight/{p-H5xAa3Fp.system.js.map → p-B1BJxOVi.system.js.map} +1 -1
- package/dist/twilight/{p-B52cxJwt.system.js → p-BEQYXrdz.system.js} +2 -2
- package/dist/twilight/{p-B52cxJwt.system.js.map → p-BEQYXrdz.system.js.map} +1 -1
- package/dist/twilight/{p-CNqf1L3p.system.js.map → p-BKXNNMLm.system.js.map} +1 -1
- package/dist/twilight/{p-DQg5Q6X-.js → p-BReGkw3Y.js} +2 -2
- package/dist/twilight/{p-DQg5Q6X-.js.map → p-BReGkw3Y.js.map} +1 -1
- package/dist/twilight/{p-BMe9fgvJ.system.js.map → p-Bmkf6XAv.system.js.map} +1 -1
- package/dist/twilight/{p-DN3CCyG-.system.js.map → p-BmwVeBpY.system.js.map} +1 -1
- package/dist/twilight/{p-CLHJmBGj.system.js.map → p-BvtfE2-2.system.js.map} +1 -1
- package/dist/twilight/{p-BBjPvuu7.system.js.map → p-C6KNQG1y.system.js.map} +1 -1
- package/dist/twilight/{p-D3JDyRUW.system.js.map → p-C8x80jPq.system.js.map} +1 -1
- package/dist/twilight/{p-BC-cnFy-.system.js.map → p-CClJfpon.system.js.map} +1 -1
- package/dist/twilight/{p-Cb9M2a-j.system.js.map → p-CLWUAiQH.system.js.map} +1 -1
- package/dist/twilight/{p-jGMZVThE.system.js.map → p-COFul74p.system.js.map} +1 -1
- package/dist/twilight/{p-DaTp8sB1.system.js.map → p-COYoK3Au.system.js.map} +1 -1
- package/dist/twilight/{p-B7SRc_rs.system.js.map → p-CXqdittj.system.js.map} +1 -1
- package/dist/twilight/{p-C51w7Au-.system.js.map → p-Cbo44k63.system.js.map} +1 -1
- package/dist/twilight/{p-DS9HrJPI.system.js.map → p-D-3lG5I2.system.js.map} +1 -1
- package/dist/twilight/{p-B4sHNRyB.system.js.map → p-D3R0t76R.system.js.map} +1 -1
- package/dist/twilight/{p-D8jKZnWs.system.js.map → p-D6LCDuHg.system.js.map} +1 -1
- package/dist/twilight/{p-8i-yI1XS.system.js.map → p-DBvyXCi6.system.js.map} +1 -1
- package/dist/twilight/{p-DzjfnKbb.system.js.map → p-DJmCwgGP.system.js.map} +1 -1
- package/dist/twilight/{p-C_Jmr6ar.system.js.map → p-DR264Rhr.system.js.map} +1 -1
- package/dist/twilight/{p-DHFCX5Dz.system.js.map → p-DbmggJGw.system.js.map} +1 -1
- package/dist/twilight/{p-DVEvrSjN.system.js.map → p-Dko7YEnJ.system.js.map} +1 -1
- package/dist/twilight/{p-DNiwBHdX.system.js.map → p-DmPhtn_C.system.js.map} +1 -1
- package/dist/twilight/{p-BtWTphPP.system.js.map → p-DnJZZ7tb.system.js.map} +1 -1
- package/dist/twilight/{p-NCpDIEN8.system.js.map → p-DoWBCSPK.system.js.map} +1 -1
- package/dist/twilight/{p-MzTS1h7j.system.js.map → p-DpeEK_nM.system.js.map} +1 -1
- package/dist/twilight/{p-aff393D5.system.js.map → p-Dr_IaU2s.system.js.map} +1 -1
- package/dist/twilight/{p-CGmIt4gq.system.js.map → p-J6Yhk9LX.system.js.map} +1 -1
- package/dist/twilight/{p-Co12cj-7.system.js.map → p-UvhFktOU.system.js.map} +1 -1
- package/dist/twilight/{p-BL3DMysj.system.js.map → p-WTZEldbP.system.js.map} +1 -1
- package/dist/twilight/{p-d02a08e9.entry.js → p-a13b8146.entry.js} +2 -2
- package/dist/twilight/{p-f80b373d.system.entry.js → p-a15f23df.system.entry.js} +2 -2
- package/dist/twilight/{p-b94bc357.entry.js → p-a2128c52.entry.js} +2 -2
- package/dist/twilight/{p-ccffcd08.entry.js → p-a48c5028.entry.js} +2 -2
- package/dist/twilight/{p-aa357e2b.system.entry.js → p-a51585ee.system.entry.js} +2 -2
- package/dist/twilight/{p-2957c27c.entry.js → p-a56f6418.entry.js} +2 -2
- package/dist/twilight/{p-528aa2c4.system.entry.js → p-afecdf40.system.entry.js} +2 -2
- package/dist/twilight/{p-008a771c.entry.js → p-b589f4db.entry.js} +2 -2
- package/dist/twilight/{p-f1218836.system.entry.js → p-b9708fef.system.entry.js} +2 -2
- package/dist/twilight/{p-B2wed4KP.system.js.map → p-bGMoB2qG.system.js.map} +1 -1
- package/dist/twilight/{p-42bcde7d.entry.js → p-bad5d163.entry.js} +2 -2
- package/dist/twilight/{p-6a8ba65f.system.entry.js → p-c0871d45.system.entry.js} +2 -2
- package/dist/twilight/{p-6b1753ce.entry.js → p-c0951c06.entry.js} +2 -2
- package/dist/twilight/{p-5271a9e8.entry.js → p-c7973d48.entry.js} +2 -2
- package/dist/twilight/{p-188e8d1c.system.entry.js → p-c9fdaf20.system.entry.js} +3 -3
- package/dist/twilight/{p-3ede6721.entry.js → p-caac9050.entry.js} +2 -2
- package/dist/twilight/{p-71bd4d79.system.entry.js → p-d17bcd5b.system.entry.js} +2 -2
- package/dist/twilight/{p-6ad30bc0.entry.js → p-e2930923.entry.js} +2 -2
- package/dist/twilight/{p-b7572664.entry.js → p-e5ab5482.entry.js} +2 -2
- package/dist/twilight/{p-a13fcfe1.entry.js → p-e63915a5.entry.js} +2 -2
- package/dist/twilight/{p-68285203.system.entry.js → p-e6558318.system.entry.js} +2 -2
- package/dist/twilight/{p-81b99416.system.entry.js → p-e8c5510b.system.entry.js} +2 -2
- package/dist/twilight/{p-68327c54.entry.js → p-eb8c92b5.entry.js} +2 -2
- package/dist/twilight/{p-53e00642.system.entry.js → p-ef0d3f01.system.entry.js} +2 -2
- package/dist/twilight/{p-DaMdjqfe.system.js.map → p-etxkGBiL.system.js.map} +1 -1
- package/dist/twilight/{p-275332fa.system.entry.js → p-f065dc14.system.entry.js} +2 -2
- package/dist/twilight/{p-d1ca52ee.system.entry.js → p-f0aabe3f.system.entry.js} +2 -2
- package/dist/twilight/p-f1e1d569.system.entry.js +5 -0
- package/dist/twilight/{p-0407da23.entry.js → p-f342f449.entry.js} +2 -2
- package/dist/twilight/{p-2ed6d081.system.entry.js → p-f65cfedf.system.entry.js} +2 -2
- package/dist/twilight/{p-64de4869.system.entry.js → p-f9981248.system.entry.js} +2 -2
- package/dist/twilight/{p-a6961af5.entry.js → p-fbc449aa.entry.js} +2 -2
- package/dist/twilight/{p-e5eae8ce.system.entry.js → p-fc0f5c2e.system.entry.js} +2 -2
- package/dist/twilight/{p-9847a4f4.entry.js → p-fc37604a.entry.js} +2 -2
- package/dist/twilight/{p-dad1b603.system.entry.js → p-fc72825e.system.entry.js} +2 -2
- package/dist/twilight/{p-ef823dbd.system.entry.js → p-fc7808d3.system.entry.js} +2 -2
- package/dist/twilight/{p-LSZwJPPB.js → p-gdhHvm6V.js} +3 -3
- package/dist/twilight/p-gdhHvm6V.js.map +1 -0
- package/dist/twilight/{p-CCJYFUxF.system.js.map → p-kuWGCb9j.system.js.map} +1 -1
- package/dist/twilight/{p-Ce2XJNsy.system.js → p-sMaYJNRW.system.js} +3 -3
- package/dist/twilight/p-sMaYJNRW.system.js.map +1 -0
- package/dist/twilight/{p-BMCxvVxH.system.js → p-womksxIV.system.js} +2 -2
- package/dist/twilight/{p-BMCxvVxH.system.js.map → p-womksxIV.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-CfmOwvmC.js.map +0 -1
- package/dist/esm/index-LSZwJPPB.js.map +0 -1
- package/dist/esm-es5/index-LSZwJPPB.js.map +0 -1
- package/dist/twilight/p-13a2e582.system.entry.js +0 -5
- package/dist/twilight/p-Ce2XJNsy.system.js.map +0 -1
- package/dist/twilight/p-LSZwJPPB.js.map +0 -1
- /package/dist/twilight/{p-64c8b0e2.system.entry.js.map → p-00d05d4c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-de2b1078.system.entry.js.map → p-07327345.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1f93b886.system.entry.js.map → p-16493b31.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ea832823.system.entry.js.map → p-18eaeb07.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-09bc1f72.system.entry.js.map → p-1e3e4a84.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-aa49c07f.entry.js.map → p-1e4e21ab.entry.js.map} +0 -0
- /package/dist/twilight/{p-fcfd9a2b.entry.js.map → p-1e5c48d0.entry.js.map} +0 -0
- /package/dist/twilight/{p-39d68fc1.system.entry.js.map → p-229e4f73.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4eef3c0e.system.entry.js.map → p-2314d050.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-059405fc.system.entry.js.map → p-243cd247.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-143dd94c.system.entry.js.map → p-28cc1200.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ce02710a.entry.js.map → p-2f3b050a.entry.js.map} +0 -0
- /package/dist/twilight/{p-c09565da.entry.js.map → p-36f043a4.entry.js.map} +0 -0
- /package/dist/twilight/{p-f0cc5b35.entry.js.map → p-37bdeacb.entry.js.map} +0 -0
- /package/dist/twilight/{p-0e1cd76c.system.entry.js.map → p-42aa8f00.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-47de107e.entry.js.map → p-4446d80b.entry.js.map} +0 -0
- /package/dist/twilight/{p-88e53a1e.system.entry.js.map → p-4f54efd1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9e6c5671.entry.js.map → p-513eb3ab.entry.js.map} +0 -0
- /package/dist/twilight/{p-fa5ead87.entry.js.map → p-51563172.entry.js.map} +0 -0
- /package/dist/twilight/{p-d660efad.entry.js.map → p-545204c4.entry.js.map} +0 -0
- /package/dist/twilight/{p-1f8bf87a.entry.js.map → p-58702c6a.entry.js.map} +0 -0
- /package/dist/twilight/{p-c38dbed0.entry.js.map → p-5fb7d021.entry.js.map} +0 -0
- /package/dist/twilight/{p-b0d88d59.entry.js.map → p-6234d5b1.entry.js.map} +0 -0
- /package/dist/twilight/{p-5bae6d14.system.entry.js.map → p-66440eaf.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c5fa09d1.system.entry.js.map → p-68e96348.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-675d4ab7.entry.js.map → p-6d9239fa.entry.js.map} +0 -0
- /package/dist/twilight/{p-d1ef5396.entry.js.map → p-7a849013.entry.js.map} +0 -0
- /package/dist/twilight/{p-d62c20f1.system.entry.js.map → p-7d8494a1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fe0234a1.entry.js.map → p-8aa7e30f.entry.js.map} +0 -0
- /package/dist/twilight/{p-87d32e2f.entry.js.map → p-8f3dec24.entry.js.map} +0 -0
- /package/dist/twilight/{p-4806aee6.system.entry.js.map → p-953d84e6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d3a36873.entry.js.map → p-9a8f94bd.entry.js.map} +0 -0
- /package/dist/twilight/{p-d02a08e9.entry.js.map → p-a13b8146.entry.js.map} +0 -0
- /package/dist/twilight/{p-f80b373d.system.entry.js.map → p-a15f23df.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b94bc357.entry.js.map → p-a2128c52.entry.js.map} +0 -0
- /package/dist/twilight/{p-ccffcd08.entry.js.map → p-a48c5028.entry.js.map} +0 -0
- /package/dist/twilight/{p-aa357e2b.system.entry.js.map → p-a51585ee.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2957c27c.entry.js.map → p-a56f6418.entry.js.map} +0 -0
- /package/dist/twilight/{p-528aa2c4.system.entry.js.map → p-afecdf40.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-008a771c.entry.js.map → p-b589f4db.entry.js.map} +0 -0
- /package/dist/twilight/{p-f1218836.system.entry.js.map → p-b9708fef.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-42bcde7d.entry.js.map → p-bad5d163.entry.js.map} +0 -0
- /package/dist/twilight/{p-6a8ba65f.system.entry.js.map → p-c0871d45.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6b1753ce.entry.js.map → p-c0951c06.entry.js.map} +0 -0
- /package/dist/twilight/{p-5271a9e8.entry.js.map → p-c7973d48.entry.js.map} +0 -0
- /package/dist/twilight/{p-188e8d1c.system.entry.js.map → p-c9fdaf20.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3ede6721.entry.js.map → p-caac9050.entry.js.map} +0 -0
- /package/dist/twilight/{p-71bd4d79.system.entry.js.map → p-d17bcd5b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6ad30bc0.entry.js.map → p-e2930923.entry.js.map} +0 -0
- /package/dist/twilight/{p-b7572664.entry.js.map → p-e5ab5482.entry.js.map} +0 -0
- /package/dist/twilight/{p-a13fcfe1.entry.js.map → p-e63915a5.entry.js.map} +0 -0
- /package/dist/twilight/{p-68285203.system.entry.js.map → p-e6558318.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-81b99416.system.entry.js.map → p-e8c5510b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-68327c54.entry.js.map → p-eb8c92b5.entry.js.map} +0 -0
- /package/dist/twilight/{p-53e00642.system.entry.js.map → p-ef0d3f01.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-275332fa.system.entry.js.map → p-f065dc14.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d1ca52ee.system.entry.js.map → p-f0aabe3f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-13a2e582.system.entry.js.map → p-f1e1d569.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0407da23.entry.js.map → p-f342f449.entry.js.map} +0 -0
- /package/dist/twilight/{p-2ed6d081.system.entry.js.map → p-f65cfedf.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-64de4869.system.entry.js.map → p-f9981248.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a6961af5.entry.js.map → p-fbc449aa.entry.js.map} +0 -0
- /package/dist/twilight/{p-e5eae8ce.system.entry.js.map → p-fc0f5c2e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9847a4f4.entry.js.map → p-fc37604a.entry.js.map} +0 -0
- /package/dist/twilight/{p-dad1b603.system.entry.js.map → p-fc72825e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ef823dbd.system.entry.js.map → p-fc7808d3.system.entry.js.map} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,i,e,n){function a(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function o(t){try{l(n.next(t))}catch(t){r(t)}}function s(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?e(t.value):a(t.value).then(o,s)}l((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(i){return l([t,i])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(e=0)),e)try{if(n=1,a&&(r=s[0]&2?a["return"]:s[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;if(a=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;a=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];a=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,i,e){if(e||arguments.length===2)for(var n=0,a=i.length,r;n<a;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return t.concat(r||Array.prototype.slice.call(i))};var _0;
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as getDefaultExportFromCjs,F as Fragment,i as axios}from"./index-LSZwJPPB.js";import{a as anime}from"./anime.es-CgtvEd63.js";import{A as ArrowDownIcon,S as SpecialDiscountIcon}from"./special-discount-yRO-ZESF.js";import{I as IconVerified}from"./check-uTyAzPSy.js";import{H as Helper}from"./Helper-DGKT_pIJ.js";import{a as arrowLeft}from"./arrow-left-BedNk7k1.js";import{S as ShoppingBag}from"./shopping-bag-DiKTtDW5.js";import{p as plusIcon,m as minusIcon}from"./minus-DfeagqF1.js";import{M as MailIcon}from"./mail-DmgxDvXL.js";import{w as whatsapp$1}from"./whatsapp2-DWksgowB.js";import{f as facebook,t as twitter}from"./twitter-Dz7o69vX.js";import{G as GiftIcon}from"./gift-C0JNGIpa.js";import{C as CameraIcon}from"./camera-C6jIkM-X.js";var PendingOrdersIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>cart</title>\n<path d="M15.426 28.084c0-1.412-0.85-2.684-2.156-3.226-1.305-0.54-2.807-0.241-3.805 0.758-0.999 0.998-1.298 2.5-0.758 3.805 0.54 1.303 1.815 2.155 3.226 2.155 1.928-0.003 3.49-1.564 3.492-3.492h0.001zM10.597 28.084h0.001c0-0.54 0.326-1.027 0.825-1.235 0.498-0.206 1.074-0.091 1.455 0.29 0.383 0.382 0.497 0.957 0.29 1.456-0.208 0.5-0.695 0.825-1.235 0.825-0.355 0-0.695-0.142-0.944-0.391-0.251-0.251-0.392-0.591-0.392-0.946h-0.001l0.001 0.001zM28.23 28.084c0-1.412-0.85-2.684-2.155-3.226-1.305-0.54-2.807-0.241-3.806 0.758s-1.297 2.5-0.756 3.805c0.54 1.303 1.813 2.155 3.226 2.155 1.927-0.003 3.49-1.564 3.491-3.492zM23.401 28.084c0-0.54 0.326-1.027 0.825-1.235 0.5-0.206 1.075-0.091 1.457 0.29s0.497 0.957 0.289 1.456c-0.206 0.5-0.693 0.825-1.233 0.825-0.738 0-1.337-0.599-1.337-1.337l-0.001 0.001zM1.953 0.234l-0.342-0.059c-0.29-0.064-0.594-0.004-0.839 0.166-0.247 0.169-0.414 0.436-0.463 0.734-0.050 0.3 0.023 0.607 0.201 0.85s0.444 0.402 0.738 0.44l0.341 0.059c1.825 0.324 3.248 1.794 3.548 3.662l1.981 12.369h-0.001c0.218 1.387 0.913 2.651 1.96 3.563s2.379 1.412 3.754 1.41h14.242c0.601 0 1.088-0.498 1.088-1.112s-0.487-1.112-1.088-1.112h-14.242c-1.679-0.001-3.139-1.183-3.525-2.854h11.463c1.614 0.004 3.188-0.518 4.493-1.49 1.305-0.973 2.271-2.346 2.762-3.918l1.298-4.136c0.145-0.455 0.065-0.953-0.213-1.336-0.278-0.385-0.72-0.608-1.187-0.602h-20.467l-0.181-1.141c-0.218-1.367-0.849-2.631-1.802-3.615-0.954-0.983-2.184-1.64-3.518-1.878h-0.001zM26.946 9.096l-0.993 3.169v-0.001c-0.353 1.122-1.044 2.101-1.975 2.796s-2.056 1.067-3.208 1.067h-11.833l-1.125-7.042 19.134 0.011z"></path>\n</svg>\n';var WalletIcon$1='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>full-wallet</title>\n<path d="M29 12h-26c-0.668-0.008-1.284-0.226-1.787-0.59l0.009 0.006c-0.744-0.552-1.222-1.428-1.222-2.416 0-1.657 1.343-3 2.999-3h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0h-6c-0.552 0-1 0.448-1 1 0 0.326 0.156 0.616 0.397 0.798l0.002 0.002c0.167 0.12 0.374 0.194 0.599 0.2l0.001 0h26c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM27 12c-0.552 0-1-0.448-1-1v0-3h-3c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM29 30h-26c-1.657 0-3-1.343-3-3v0-18c0-0.552 0.448-1 1-1s1 0.448 1 1v0 18c0 0.552 0.448 1 1 1v0h25v-5c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM29 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM31 24h-7c-2.209 0-4-1.791-4-4s1.791-4 4-4v0h7c0.552 0 1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2v0h6v-4zM25 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-2.306 1.152c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 3.2-1.6c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1v0zM21 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-15.104 7.552c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 16-8c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0z"></path>\n</svg>\n';var sallaAddProductButtonCss=":host{display:block}salla-add-product-button[width=wide]{width:100%}";var SallaAddProductButton=function(){function t(t){var i=this;registerInstance(this,t);this.success=createEvent(this,"success");this.failed=createEvent(this,"failed");this.hostAttributes={};this.hasPreOrder=false;this.productStatus="sale";this.productType="product";this.selectedOptions=[];this.buyNowText=salla.lang.get("pages.products.buy_now");salla.lang.onLoaded((function(){i.buyNowText=salla.lang.get("pages.products.buy_now")}))}t.prototype.getLabel=function(){if(this.productStatus==="sale"&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy&&this.isApplePayActive){return PendingOrdersIcon}if(this.hasPreOrder){return salla.lang.get("pages.products.pre_order_now")}if(this.productStatus==="sale"&&this.productType==="booking"){return salla.lang.get("pages.cart.book_now")}if(this.productStatus==="sale"){return salla.lang.get("pages.cart.add_to_cart")}if(this.productType!=="donating"){return salla.lang.get("pages.products.out_of_stock")}return salla.lang.get("pages.products.donation_exceed")};t.prototype.addProductToCart=function(t){var i=this;var e;if(this.productType==="booking"){t.preventDefault();return this.addBookingProduct()}if(this.hostAttributes.type==="submit"){return false}t.preventDefault();(e=this.btn)===null||e===void 0?void 0:e.disable();var n=Object.entries({id:this.productId,donation_amount:this.donatingAmount,quantity:this.quantity,endpoint:"quickAdd"}).reduce((function(t,i){var e=i[0],n=i[1];return n?(t[e]=n,t):t}),{});return salla.cart.addItem(n).then((function(t){var e;i.selectedOptions=[];(e=i.btn)===null||e===void 0?void 0:e.enable();i.success.emit(t)})).catch((function(t){var e;i.failed.emit(t);(e=i.btn)===null||e===void 0?void 0:e.enable()}))};t.prototype.addBookingProduct=function(){var t=this;if(salla.config.isGuest()){salla.auth.api.setAfterLoginEvent("booking::add",this.productId);salla.event.dispatch("login::open");return}return salla.booking.add(this.productId).then((function(i){return t.success.emit(i)})).catch((function(i){return t.failed.emit(i)}))};t.prototype.getBtnAttributes=function(){for(var t=0;t<this.host.attributes.length;t++){if(!["id","class"].includes(this.host.attributes[t].name)){this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value}}return this.hostAttributes};t.prototype.getQuickBuyBtnAttributes=function(){return Object.assign(Object.assign({},this.getBtnAttributes()),{type:this.supportStickyBar&&window.innerWidth<=768?"plain":this.productType=="donating"?"donate":"buy"})};t.prototype.miniCheckoutWidget=function(){var t=salla.config.get("store.id");if(!t){return}return h("salla-mini-checkout-widget",{language:salla.lang.locale,"store-id":t,config:{user:salla.config.get("user"),failure_url:window.location.href},products:[this.productId],api:salla.config.get("store.api"),outline:true,"form-selector":"form.product-form",class:"s-add-product-button-mini-checkout"},h("div",{slot:"widget-label",class:"s-add-product-button-mini-checkout-content"},h("span",{innerHTML:WalletIcon$1}),this.buyNowText))};t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){var i,e,n;document.documentElement.classList.add("hydrated");t.showQuickBuy=t.quickBuy&&salla.config.get("store.settings.buy_now")&&t.productStatus=="sale"&&t.productType!=="booking";t.isApplePayActive=((i=window.ApplePaySession)===null||i===void 0?void 0:i.canMakePayments())&&((e=salla.config.get("store.settings.payments"))===null||e===void 0?void 0:e.includes("apple_pay"))&&salla.config.get("store.settings.is_salla_gateway",false);t.passedLabel=t.host.innerHTML.replace("\x3c!----\x3e","").trim();if(!!t.passedLabel&&window.innerWidth>=768){return(n=t.btn)===null||n===void 0?void 0:n.setText(t.passedLabel)}if(t.host.getAttribute("type")==="submit"&&t.supportStickyBar){window.addEventListener("resize",(function(){var i;return(i=t.btn)===null||i===void 0?void 0:i.setText(window.innerWidth>=768&&!!t.passedLabel?t.passedLabel:t.getLabel())}))}}))};t.prototype.render=function(){var t=this;var i;if((i=this.host.closest(".swiper-slide"))===null||i===void 0?void 0:i.classList.contains("swiper-slide-duplicate")){return""}if(this.hasSubscribedOptions){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes(),{"is-subscribed":true}),h("span",{class:"s-hidden"},h("slot",null))))}if(this.productStatus==="out-and-notify"&&this.channels||this.hasOutOfStockOption){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes()),h("span",{class:"s-hidden"},h("slot",null))))}return h(Host,{class:{"s-add-product-button-with-quick-buy":this.showQuickBuy,"s-add-product-button-with-sticky-bar":this.supportStickyBar,"s-add-product-button-with-apple-pay":this.showQuickBuy&&this.isApplePayActive}},h("div",{class:{"s-add-product-button-main":this.showQuickBuy,"w-full":!document.getElementById("fast-checkout-js")||["financial_support","donating"].includes(this.productType)}},h("salla-button",Object.assign({color:this.productStatus==="sale"?"primary":"light",type:"button",fill:this.productStatus==="sale"?"solid":"outline",ref:function(i){return t.btn=i},onClick:function(i){return t.addProductToCart(i)},disabled:this.productStatus!=="sale"},this.getBtnAttributes(),{"loader-position":"center"}),h("slot",null)),this.showQuickBuy&&!!document.getElementById("fast-checkout-js")&&!["financial_support","donating"].includes(this.productType)?this.miniCheckoutWidget():""),this.showQuickBuy&&this.isApplePayActive?h("salla-quick-buy",Object.assign({},this.getQuickBuyBtnAttributes())):"")};t.prototype.componentDidLoad=function(){var t=this;if(!this.notifyOptionsAvailability){return}salla.event.on("product-options::change",(function(i){return __awaiter(t,void 0,void 0,(function(){var t,e,n,a,r,o;var s=this;return __generator(this,(function(l){switch(l.label){case 0:if(!["thumbnail","color","single-option"].includes(i.option.type)){return[2]}this.hasSubscribedOptions=false;n=this;return[4,(t=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||t===void 0?void 0:t.getSelectedOptions()];case 1:n.selectedOptions=l.sent();a=this;return[4,(e=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||e===void 0?void 0:e.hasOutOfStockOption()];case 2:a.hasOutOfStockOption=l.sent();r=salla.storage.get("product-".concat(this.productId,"-subscribed-options"));if(!r&&!this.subscribedOptions||!this.hasOutOfStockOption){return[2]}if(salla.config.isGuest()){o=r?r.map((function(t){return t.split(",").map((function(t){return parseInt(t)}))})):[];this.hasSubscribedOptions=o.length>0&&o.some((function(t){return t.every((function(t){return s.selectedOptions.some((function(i){return i.id===t}))}))}))}else{this.hasSubscribedOptions=this.subscribedOptions&&this.subscribedOptions!=="null"&&this.subscribedOptions!=="[]"?JSON.parse(this.subscribedOptions).some((function(t){return t.every((function(t){return s.selectedOptions.some((function(i){return i.id===t}))}))})):false}return[2]}}))}))}))};t.prototype.componentDidRender=function(){var t=this;var i,e;if(!!this.passedLabel&&(!this.supportStickyBar||window.innerWidth>=768)){(i=this.btn)===null||i===void 0?void 0:i.setText(this.passedLabel);return}(e=this.btn)===null||e===void 0?void 0:e.setText(this.getLabel());salla.lang.onLoaded((function(){var i;return(i=t.btn)===null||i===void 0?void 0:i.setText(t.getLabel())}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaAddProductButton.style=sallaAddProductButtonCss;var informationIcon='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n';var sallaAlertCss=":host{display:block}";var SallaAlert=function(){function t(t){registerInstance(this,t);this.variant="info"}t.prototype.renderIcon=function(){var t=this.icon||this.variant;if(t==="none")return null;switch(t){case"success":return h("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},h("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return h("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},h("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return h("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},h("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return h("span",{innerHTML:informationIcon})}};t.prototype.render=function(){return h(Host,{key:"3b5dd808399eeda5d930454542cd41cca26b0cc3",class:"s-alert-wrapper s-alert-".concat(this.variant)},h("span",{key:"4f58234774d1afc790fb83bff983ca9366faa349",class:"s-alert-icon"},this.renderIcon()),h("span",{key:"10eb3f87e6e77dcc5406a24f866feee1cc1f46ef",class:"s-alert-text"},this.message,h("slot",{key:"3656e15aeb25fb7285e88f694c090bad3b32dfbd"})))};return t}();SallaAlert.style=sallaAlertCss;var infoIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n';var ImageIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>image</title>\n<path d="M21.333 6.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM21.333 12c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.597 1.333-1.333 1.333zM24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 0.969 0.219 1.884 0.592 2.715 0.013 0.024 0.025 0.048 0.039 0.072 1.059 2.284 3.359 3.88 6.036 3.88h16c3.676 0 6.667-2.991 6.667-6.667v-16c0-3.676-2.991-6.667-6.667-6.667zM8 28c-1.376 0-2.592-0.699-3.312-1.76l7.312-9.401 8.681 11.161zM28 24c0 2.187-1.765 3.964-3.945 3.995l-11.003-14.147c-0.505-0.649-1.599-0.649-2.104 0l-6.948 8.933v-14.781c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4z"></path>\n</svg>\n';var moneyIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var checkCircleIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n';var sallaBottomAlertCss=":host{display:block}";var SallaBottomAlert=function(){function t(t){var i=this;registerInstance(this,t);this.storeId=salla.config.get("store.id");this.template=salla.config.get("store.template");this.loading=false;this.templateData={};this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");this.defaultActionLabel=salla.lang.get("common.elements.know_more");this.storeFeatures=salla.lang.get("common.elements.store_features");this.storeDetails=salla.lang.get("common.elements.store_details");this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر");this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل");this.theDeveloper=salla.lang.get("common.elements.the_developer");this.templateInformation=salla.lang.get("common.elements.template_information");this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");this.isRtl=salla.config.get("theme.is_rtl",true);this.storeName=salla.config.get("store.name");this.type="popup";salla.lang.onLoaded((function(){i.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");i.defaultActionLabel=salla.lang.get("common.elements.know_more");i.storeFeatures=salla.lang.get("common.elements.store_features");i.storeDetails=salla.lang.get("common.elements.store_details");i.templateInformation=salla.lang.get("common.elements.template_information");i.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price_details","السعر يشمل");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price_details","Price Includes");setTimeout((function(){i.storePrice=salla.lang.get("common.elements.store_price");i.theDeveloper=salla.lang.get("common.elements.the_developer");i.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل")}),100)}))}t.prototype.open=function(){var t=this;return this.drawer.open().then((function(){return t.handleTemplateRequest()}))};t.prototype.getDefaultMessage=function(){return this.isRtl?this.defaultMessage.substring(0,this.defaultMessage.lastIndexOf(" ")):this.defaultMessage.split(" ").slice(0,-2).join(" ")};t.prototype.handleTemplateRequest=function(){var t=this;if(Object.keys(this.templateData).length){return}this.drawer.loading();return salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((function(i){t.drawer.setTitle(t.storeDetails+" "+t.storeName);t.templateData=i.data;t.drawer.stopLoading()})).catch((function(){t.drawer.close()}))};t.prototype.handleAction=function(){if(this.type==="link"){window.location.href=this.actionUrl}if(this.type==="popup"){this.open()}};t.prototype.popup=function(){var t=this;var i,e,n,a,r,o,s,l;return h("salla-drawer",{class:"s-bottom-alert-modal",ref:function(i){return t.drawer=i},"no-padding":true},Object.keys(this.templateData).length?[h("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},h("div",{class:{"s-bottom-alert-modal-content":true}},((i=this.templateData)===null||i===void 0?void 0:i.features)?[h("div",{class:"s-bottom-alert-modal-content-title"},h("i",{innerHTML:ImageIcon,class:"s-bottom-alert-modal-content-icon"}),h("span",null,this.storeFeatures)),h("div",{class:"s-bottom-alert-modal-content-features",innerHTML:(e=this.templateData)===null||e===void 0?void 0:e.features})]:""),h("div",{class:{"s-bottom-alert-modal-content":true,"s-bottom-alert-modal-content-extra-padding":(n=this.templateData)===null||n===void 0?void 0:n.price}},((a=this.templateData)===null||a===void 0?void 0:a.features)?[h("div",{class:"s-bottom-alert-modal-content-title"},h("i",{innerHTML:moneyIcon,class:"s-bottom-alert-modal-content-icon"}),h("span",null,this.storePriceDetails)),h("div",{class:"s-bottom-alert-modal-content-price-details"},(o=(r=this.templateData)===null||r===void 0?void 0:r.price_details)===null||o===void 0?void 0:o.items.map((function(t){return h("div",{class:"s-bottom-alert-modal-content-price-details-item"},h("i",{innerHTML:checkCircleIcon,class:"s-bottom-alert-modal-content-price-details-item-icon"}),h("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},t.name),h("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(t.price)}))})))]:""),((s=this.templateData)===null||s===void 0?void 0:s.link)?h("div",{class:"s-bottom-alert-modal-content-footer"},h("salla-button",{color:"primary",size:"medium",width:"wide",href:(l=this.templateData)===null||l===void 0?void 0:l.link},h("i",{innerHTML:PendingOrdersIcon}),this.buyTheTemplate)):"")]:"")};t.prototype.render=function(){var t=this;var i=this.template&&typeof this.template==="object"&&Object.keys(this.template).length>0;var e=i&&this.template.developer;var n=e!==undefined;var a=n&&(e===null||e===void 0?void 0:e.name);var r=null;return h(Host,{key:"d980894737723f3a389a1b4ce0e684accfdd0262",class:"s-bottom-alert-wrapper"},h("div",{key:"7866b293146601653c0734058c4bd73f91c45944",class:"s-bottom-alert-content"},h("div",{key:"dd1c11c4db4868d989510ab6b815688398311892",class:"s-bottom-alert-icon"},this.icon?h("i",{class:this.icon}):h("i",{innerHTML:infoIcon})),h("div",{key:"cd45028c6fe863fa9370edb5a4fb08b1a83dc437",class:"s-bottom-alert-message"},this.message?this.message:i?h("span",null,this.getDefaultMessage()," ",h("a",{href:"#",class:{"s-bottom-alert-message-highlight":true,"s-bottom-alert-message-link":r},target:"","aria-label":"Developer"},a?a:this.theDeveloper)," ",h("span",{class:"s-bottom-alert-message-splitter"},"|")," ",this.storePrice,":"," ",h("span",{class:"s-bottom-alert-message-highlight",innerHTML:salla.money(this.template.price)})):this.defaultMessage),this.type!=="banner"&&h("div",{key:"6690d6627d1d7c9f4173da13d72ed062ad9ef468",class:"s-bottom-alert-action"},h("salla-button",{key:"c4978d89a326fe6aacc00c49f50fb202950fda62",href:this.actionUrl,size:"medium",onClick:function(){return t.handleAction()},width:"normal"},this.actionLabel||this.defaultActionLabel)),this.type==="popup"&&this.popup()))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaBottomAlert.style=sallaBottomAlertCss;var ArrowLeftIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_left</title>\n<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>\n</svg>\n';var ArrowRightIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_right</title>\n<path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>\n</svg>\n';var sallaBreadcrumbCss=":host{display:block}";var SallaBreadcrumb=function(){function t(t){registerInstance(this,t);var i,e;this.sessionStorageKey="breadcrumb_snapshot";this.itemSlot=((i=this.host.querySelector('[slot="item"]'))===null||i===void 0?void 0:i.outerHTML)||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>';this.iconSlot=(e=this.host.querySelector('[slot="icon"]'))===null||e===void 0?void 0:e.outerHTML}t.prototype.componentWillLoad=function(){var t=this;return new Promise((function(t){return salla.onReady((function(){return salla.lang.onLoaded(t)}))})).then((function(){if(salla.url.is_page("index")){throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")}})).then((function(){if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",true)){throw new Error("salla-breadcrumb:: merchant disabled the feature")}})).then((function(){var i;var e=salla.config.get("page");if(!e||!e.slug){salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!');t.breadcrumbs=[];return}var n=t.getSessionBreadcrumbs();if(e.slug==="product.single"&&n&&n.length>0){n.push({title:e.title,url:e.url});t.breadcrumbs=t.setBreadcrumbsFromArray(n);t.storeBreadcrumbSnapshot()}else if(n&&n.length>0){if(t.isNewPage(e,n)){t.breadcrumbs=t.generateBreadcrumbs(e);t.storeBreadcrumbSnapshot()}else{t.breadcrumbs=t.setBreadcrumbsFromArray(n)}}else{t.breadcrumbs=t.generateBreadcrumbs(e);t.storeBreadcrumbSnapshot()}if((i=t.breadcrumbs)===null||i===void 0?void 0:i.length){t.breadcrumbs[t.breadcrumbs.length-1].is_last=true}return t.breadcrumbs})).catch((function(i){salla.logger.error("salla-breadcrumb:: unexpected error!",i);t.breadcrumbs=[]}))};t.prototype.getSessionBreadcrumbs=function(){if(new URLSearchParams(window.location.search).get("from")==="search-bar"){return[]}return JSON.parse(sessionStorage.getItem(this.sessionStorageKey)||"[]")};t.prototype.isNewPage=function(t,i){var e=i[i.length-1];return(e===null||e===void 0?void 0:e.url)!==t.url};t.prototype.setBreadcrumbsFromArray=function(t){return t.map((function(i,e){return Object.assign(Object.assign({},i),{is_last:e===t.length-1})}))};t.prototype.sanitizeBreadcrumbTitle=function(t,i){if(i===void 0){i=1}if(!t.includes("|")){return t.trim()}return t.split("|").map((function(t){return t.trim()}))[i]};t.prototype.generateBreadcrumbs=function(t){var i,e;var n=[];if(t.slug==="product.single"){var a=this.getSessionBreadcrumbs();if(a.length>0&&((i=a[1])===null||i===void 0?void 0:i.url)===((e=t.parent)===null||e===void 0?void 0:e.url)){return this.setBreadcrumbsFromArray(__spreadArray(__spreadArray([],a,true),[t],false))}}var r=t;while(r){if(r.title){n.unshift({title:r.title,url:r.url})}r=r.parent}if(t.slug.includes("customer")&&t.slug!=="customer.profile"){n.unshift({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")})}if(t.slug.includes("blog")){n.unshift({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")})}if(t.slug==="brands.single"){n.unshift({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")})}if(!t.title&&t.slug==="loyalty"){n.unshift({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")})}n.unshift({title:salla.lang.get("common.titles.home"),url:salla.url.get("")});return n};t.prototype.storeBreadcrumbSnapshot=function(){try{var t=salla.config.get("page");if((t===null||t===void 0?void 0:t.slug)==="product.single"){return}var i=__spreadArray([],this.breadcrumbs,true);var e=i.length-1;if(e>=0){i[e].url=window.location.href}var n=JSON.stringify(i);sessionStorage.setItem(this.sessionStorageKey,n)}catch(t){salla.logger.error("salla-breadcrumb:: Failed to store breadcrumb snapshot in sessionStorage.",t)}};t.prototype.render=function(){var t=this;if(this.breadcrumbs.length<=1){salla.log("salla-breadcrumb:: There is no breadcrumbs!");return null}return h("ol",{class:{"s-breadcrumb-wrapper":true,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((function(i){var e=salla.config.get("page.slug")==="product.single";var n=e&&i.is_last?i.title:t.sanitizeBreadcrumbTitle(i.title);var a=t.itemSlot.replace(/\{url\}/g,i.url).replace(/\{title\}/g,n);return[h("div",{class:"s-breadcrumb-slot",innerHTML:a}),t.getArrowDomForItem(i)]})))};t.prototype.getArrowDomForItem=function(t){if(t.is_last){return""}var i=this.iconSlot||(salla.config.get("theme.is_rtl",true)?ArrowLeftIcon:ArrowRightIcon);return h("li",{class:"s-breadcrumb-arrow"},h("div",{class:{"s-breadcrumb-icon-slot":true,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:i}))};t.prototype.componentDidRender=function(){var t,i,e;this.host.querySelectorAll(".s-breadcrumb-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((function(t){return t.replaceWith(t.querySelector("svg"))}));(t=this.host.querySelector('[slot="item"]'))===null||t===void 0?void 0:t.remove();(i=this.host.querySelector('[slot="icon"]'))===null||i===void 0?void 0:i.remove();var n=(e=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1])===null||e===void 0?void 0:e.querySelector("a");n&&n.replaceWith(n.firstChild)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaBreadcrumb.style=sallaBreadcrumbCss;var sallaButtonCss="";var SallaButton=function(){function t(t){registerInstance(this,t);this.hostAttributes={};this.shape="btn";this.color="primary";this.fill="solid";this.size="medium";this.width="normal";this.loading=false;this.disabled=false;this.loaderPosition="after";this.type="button"}t.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.loaderPosition=="center")this.text.classList.add("s-button-hide");this.host.setAttribute("loading","");return[2,this.host]}))}))};t.prototype.stop=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.removeAttribute("loading");this.host.querySelector("button").removeAttribute("loading");if(this.loaderPosition=="center")this.text.classList.remove("s-button-hide");return[2,this.host]}))}))};t.prototype.setText=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.text.innerHTML=t;return[2,this.host]}))}))};t.prototype.disable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.setAttribute("disabled","");return[2,this.host]}))}))};t.prototype.enable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.removeAttribute("disabled");return[2,this.host]}))}))};t.prototype.getBtnAttributes=function(){for(var t=0;t<this.host.attributes.length;t++){if(!["color","fill","size","width","id"].includes(this.host.attributes[t].name)){this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value}}this.hostAttributes.type=this.hostAttributes.type||this.type;this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+(this.fill=="none"?"fill-none":this.fill)+(this.size!="medium"?" s-button-"+this.size:"")+(this.width!="normal"?" s-button-"+this.width:"")+(this.shape=="link"?" s-button-"+this.color+"-link":"")+(this.shape!="link"&&this.fill!="outline"?" s-button-"+this.color:"")+(this.fill=="outline"?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+(this.shape=="icon"?" s-button-loader-center":" s-button-loader-"+this.loaderPosition);return this.hostAttributes};t.prototype.button=function(){var t=this;return h("button",Object.assign({},this.getBtnAttributes(),{disabled:this.disabled}),h("span",{class:"s-button-text",ref:function(i){return t.text=i}},h("slot",null)),this.loading?h("span",{class:"s-button-loader"}):"")};t.prototype.render=function(){var t;return((t=this.host.closest(".swiper-slide"))===null||t===void 0?void 0:t.classList.contains("swiper-slide-duplicate"))?"":h(Host,{class:"s-button-wrap"},this.href?h("a",{href:this.href},this.button()):this.button())};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaButton.style=sallaButtonCss;var sallaCartSummaryCss="";var SallaCartSummary=function(){function t(t){var i=this;registerInstance(this,t);this.cartSummaryCount=salla.storage.get("cart.summary.count")||0;this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0;this.cartLabel=salla.config.get("user.language_code")==="ar"?"السلة":"Cart";salla.cart.event.onUpdated((function(t){i.cartSummaryCount=t.count||0;i.cartSummaryTotal=t.total||0}))}t.prototype.animateToCart=function(t){return __awaiter(this,void 0,void 0,(function(){var i,e,n,a,r,o,s,l,u,c,f,d;return __generator(this,(function(h){document.querySelectorAll(".s-cart-thumb").forEach((function(t){return t.remove()}));if(!(t===null||t===void 0?void 0:t.src)){salla.log("Failed to get the img element");return[2]}i=this.host.querySelector("#s-cart-icon"),e=i.getBoundingClientRect(),n=e.top+window.scrollY,a=e.left+window.scrollX;r=t.getBoundingClientRect(),o=t.offsetWidth+"px",s=t.offsetHeight+"px",l=r.top,u=r.left;c=document.createElement("img");c.src=t.getAttribute("src");c.className="s-cart-thumb";c.setAttribute("style","object-fit:cover; width:"+o+"; height:"+s+"; top:"+l+"px; left:"+u+"px;z-index:99999999; ");document.body.append(c);f=document.querySelector(".s-cart-thumb");i.classList.remove("animated","rubberBand");d=new anime.timeline;d.add({targets:f,width:[150,30],height:[150,30],top:[l,window.scrollY>0?n-window.scrollY-40:n-40],left:[u,a],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:f,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?n-window.scrollY-40:n-40,window.scrollY>0?n-window.scrollY+10:n+10],left:[a,a+10]},"-=500").add({complete:function(){i.classList.add("animated","rubberBand");f.remove()}},"-=1700");return[2]}))}))};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.getCartLink=function(){var t=salla.url.get("cart");var i=salla.config.get("store.scope",salla.storage.get("scope"));if(i&&i.id){try{var e=new URL(t);e.searchParams.set("scope",i.id);return e.toString()}catch(e){var n=t.includes("?")?"&":"?";return"".concat(t).concat(n,"scope=").concat(encodeURIComponent(i.id))}}return t};t.prototype.render=function(){return h(Host,{key:"9438bba26da9472fd505b4797fae50877103b9aa"},h("a",{key:"f0c8b59b4878525d189fafb89a50654b239e96fd",class:"s-cart-summary-wrapper",href:this.getCartLink()},h("div",{key:"91b633322061063ab214f2c9409eb156da210bc2",id:"s-cart-icon"},h("slot",{key:"ccf02e30d94dd3485e219528ace2d56651c52456",name:"icon"},h("i",{key:"f102e391d9175cf9881c84063b33993c832c426b",class:"s-cart-summary-icon",innerHTML:PendingOrdersIcon}))),h("span",{key:"3bf1db1728d57b526c9e60ce284f7128226586b5",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),h("p",{key:"57aa05278d5c30395d263aca978e4be8676d3a25",class:"s-cart-summary-content"},this.showCartLabel&&h("span",{key:"06d9c96ff9224023608a859fbec427f370c9e522",class:"s-cart-summary-label"},this.cartLabel),h("b",{key:"d8c05640c7e3579cd04fbdd29251f96f6e47bfa5",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaCartSummary.style=sallaCartSummaryCss;var vanillaPicker$1={exports:{}};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as getDefaultExportFromCjs,F as Fragment,i as axios}from"./index-gdhHvm6V.js";import{a as anime}from"./anime.es-CgtvEd63.js";import{A as ArrowDownIcon,S as SpecialDiscountIcon}from"./special-discount-yRO-ZESF.js";import{I as IconVerified}from"./check-uTyAzPSy.js";import{H as Helper}from"./Helper-DGKT_pIJ.js";import{a as arrowLeft}from"./arrow-left-BedNk7k1.js";import{S as ShoppingBag}from"./shopping-bag-DiKTtDW5.js";import{p as plusIcon,m as minusIcon}from"./minus-DfeagqF1.js";import{M as MailIcon}from"./mail-DmgxDvXL.js";import{w as whatsapp$1}from"./whatsapp2-DWksgowB.js";import{f as facebook,t as twitter}from"./twitter-Dz7o69vX.js";import{G as GiftIcon}from"./gift-C0JNGIpa.js";import{C as CameraIcon}from"./camera-C6jIkM-X.js";var PendingOrdersIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>cart</title>\n<path d="M15.426 28.084c0-1.412-0.85-2.684-2.156-3.226-1.305-0.54-2.807-0.241-3.805 0.758-0.999 0.998-1.298 2.5-0.758 3.805 0.54 1.303 1.815 2.155 3.226 2.155 1.928-0.003 3.49-1.564 3.492-3.492h0.001zM10.597 28.084h0.001c0-0.54 0.326-1.027 0.825-1.235 0.498-0.206 1.074-0.091 1.455 0.29 0.383 0.382 0.497 0.957 0.29 1.456-0.208 0.5-0.695 0.825-1.235 0.825-0.355 0-0.695-0.142-0.944-0.391-0.251-0.251-0.392-0.591-0.392-0.946h-0.001l0.001 0.001zM28.23 28.084c0-1.412-0.85-2.684-2.155-3.226-1.305-0.54-2.807-0.241-3.806 0.758s-1.297 2.5-0.756 3.805c0.54 1.303 1.813 2.155 3.226 2.155 1.927-0.003 3.49-1.564 3.491-3.492zM23.401 28.084c0-0.54 0.326-1.027 0.825-1.235 0.5-0.206 1.075-0.091 1.457 0.29s0.497 0.957 0.289 1.456c-0.206 0.5-0.693 0.825-1.233 0.825-0.738 0-1.337-0.599-1.337-1.337l-0.001 0.001zM1.953 0.234l-0.342-0.059c-0.29-0.064-0.594-0.004-0.839 0.166-0.247 0.169-0.414 0.436-0.463 0.734-0.050 0.3 0.023 0.607 0.201 0.85s0.444 0.402 0.738 0.44l0.341 0.059c1.825 0.324 3.248 1.794 3.548 3.662l1.981 12.369h-0.001c0.218 1.387 0.913 2.651 1.96 3.563s2.379 1.412 3.754 1.41h14.242c0.601 0 1.088-0.498 1.088-1.112s-0.487-1.112-1.088-1.112h-14.242c-1.679-0.001-3.139-1.183-3.525-2.854h11.463c1.614 0.004 3.188-0.518 4.493-1.49 1.305-0.973 2.271-2.346 2.762-3.918l1.298-4.136c0.145-0.455 0.065-0.953-0.213-1.336-0.278-0.385-0.72-0.608-1.187-0.602h-20.467l-0.181-1.141c-0.218-1.367-0.849-2.631-1.802-3.615-0.954-0.983-2.184-1.64-3.518-1.878h-0.001zM26.946 9.096l-0.993 3.169v-0.001c-0.353 1.122-1.044 2.101-1.975 2.796s-2.056 1.067-3.208 1.067h-11.833l-1.125-7.042 19.134 0.011z"></path>\n</svg>\n';var WalletIcon$1='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>full-wallet</title>\n<path d="M29 12h-26c-0.668-0.008-1.284-0.226-1.787-0.59l0.009 0.006c-0.744-0.552-1.222-1.428-1.222-2.416 0-1.657 1.343-3 2.999-3h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0h-6c-0.552 0-1 0.448-1 1 0 0.326 0.156 0.616 0.397 0.798l0.002 0.002c0.167 0.12 0.374 0.194 0.599 0.2l0.001 0h26c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM27 12c-0.552 0-1-0.448-1-1v0-3h-3c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM29 30h-26c-1.657 0-3-1.343-3-3v0-18c0-0.552 0.448-1 1-1s1 0.448 1 1v0 18c0 0.552 0.448 1 1 1v0h25v-5c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM29 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM31 24h-7c-2.209 0-4-1.791-4-4s1.791-4 4-4v0h7c0.552 0 1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2v0h6v-4zM25 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-2.306 1.152c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 3.2-1.6c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1v0zM21 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-15.104 7.552c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 16-8c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0z"></path>\n</svg>\n';var sallaAddProductButtonCss=":host{display:block}salla-add-product-button[width=wide]{width:100%}";var SallaAddProductButton=function(){function t(t){var i=this;registerInstance(this,t);this.success=createEvent(this,"success");this.failed=createEvent(this,"failed");this.hostAttributes={};this.hasPreOrder=false;this.productStatus="sale";this.productType="product";this.selectedOptions=[];this.buyNowText=salla.lang.get("pages.products.buy_now");salla.lang.onLoaded((function(){i.buyNowText=salla.lang.get("pages.products.buy_now")}))}t.prototype.getLabel=function(){if(this.productStatus==="sale"&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy&&this.isApplePayActive){return PendingOrdersIcon}if(this.hasPreOrder){return salla.lang.get("pages.products.pre_order_now")}if(this.productStatus==="sale"&&this.productType==="booking"){return salla.lang.get("pages.cart.book_now")}if(this.productStatus==="sale"){return salla.lang.get("pages.cart.add_to_cart")}if(this.productType!=="donating"){return salla.lang.get("pages.products.out_of_stock")}return salla.lang.get("pages.products.donation_exceed")};t.prototype.addProductToCart=function(t){var i=this;var e;if(this.productType==="booking"){t.preventDefault();return this.addBookingProduct()}if(this.hostAttributes.type==="submit"){return false}t.preventDefault();(e=this.btn)===null||e===void 0?void 0:e.disable();var n=Object.entries({id:this.productId,donation_amount:this.donatingAmount,quantity:this.quantity,endpoint:"quickAdd"}).reduce((function(t,i){var e=i[0],n=i[1];return n?(t[e]=n,t):t}),{});return salla.cart.addItem(n).then((function(t){var e;i.selectedOptions=[];(e=i.btn)===null||e===void 0?void 0:e.enable();i.success.emit(t)})).catch((function(t){var e;i.failed.emit(t);(e=i.btn)===null||e===void 0?void 0:e.enable()}))};t.prototype.addBookingProduct=function(){var t=this;if(salla.config.isGuest()){salla.auth.api.setAfterLoginEvent("booking::add",this.productId);salla.event.dispatch("login::open");return}return salla.booking.add(this.productId).then((function(i){return t.success.emit(i)})).catch((function(i){return t.failed.emit(i)}))};t.prototype.getBtnAttributes=function(){for(var t=0;t<this.host.attributes.length;t++){if(!["id","class"].includes(this.host.attributes[t].name)){this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value}}return this.hostAttributes};t.prototype.getQuickBuyBtnAttributes=function(){return Object.assign(Object.assign({},this.getBtnAttributes()),{type:this.supportStickyBar&&window.innerWidth<=768?"plain":this.productType=="donating"?"donate":"buy"})};t.prototype.miniCheckoutWidget=function(){var t=salla.config.get("store.id");if(!t){return}return h("salla-mini-checkout-widget",{language:salla.lang.locale,"store-id":t,config:{user:salla.config.get("user"),failure_url:window.location.href},products:[this.productId],api:salla.config.get("store.api"),outline:true,"form-selector":"form.product-form",class:"s-add-product-button-mini-checkout"},h("div",{slot:"widget-label",class:"s-add-product-button-mini-checkout-content"},h("span",{innerHTML:WalletIcon$1}),this.buyNowText))};t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){var i,e,n;document.documentElement.classList.add("hydrated");t.showQuickBuy=t.quickBuy&&salla.config.get("store.settings.buy_now")&&t.productStatus=="sale"&&t.productType!=="booking";t.isApplePayActive=((i=window.ApplePaySession)===null||i===void 0?void 0:i.canMakePayments())&&((e=salla.config.get("store.settings.payments"))===null||e===void 0?void 0:e.includes("apple_pay"))&&salla.config.get("store.settings.is_salla_gateway",false);t.passedLabel=t.host.innerHTML.replace("\x3c!----\x3e","").trim();if(!!t.passedLabel&&window.innerWidth>=768){return(n=t.btn)===null||n===void 0?void 0:n.setText(t.passedLabel)}if(t.host.getAttribute("type")==="submit"&&t.supportStickyBar){window.addEventListener("resize",(function(){var i;return(i=t.btn)===null||i===void 0?void 0:i.setText(window.innerWidth>=768&&!!t.passedLabel?t.passedLabel:t.getLabel())}))}}))};t.prototype.render=function(){var t=this;var i;if((i=this.host.closest(".swiper-slide"))===null||i===void 0?void 0:i.classList.contains("swiper-slide-duplicate")){return""}if(this.hasSubscribedOptions){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes(),{"is-subscribed":true}),h("span",{class:"s-hidden"},h("slot",null))))}if(this.productStatus==="out-and-notify"&&this.channels||this.hasOutOfStockOption){return h(Host,null,h("salla-product-availability",Object.assign({},this.getBtnAttributes()),h("span",{class:"s-hidden"},h("slot",null))))}return h(Host,{class:{"s-add-product-button-with-quick-buy":this.showQuickBuy,"s-add-product-button-with-sticky-bar":this.supportStickyBar,"s-add-product-button-with-apple-pay":this.showQuickBuy&&this.isApplePayActive}},h("div",{class:{"s-add-product-button-main":this.showQuickBuy,"w-full":!document.getElementById("fast-checkout-js")||["financial_support","donating"].includes(this.productType)}},h("salla-button",Object.assign({color:this.productStatus==="sale"?"primary":"light",type:"button",fill:this.productStatus==="sale"?"solid":"outline",ref:function(i){return t.btn=i},onClick:function(i){return t.addProductToCart(i)},disabled:this.productStatus!=="sale"},this.getBtnAttributes(),{"loader-position":"center"}),h("slot",null)),this.showQuickBuy&&!!document.getElementById("fast-checkout-js")&&!["financial_support","donating"].includes(this.productType)?this.miniCheckoutWidget():""),this.showQuickBuy&&this.isApplePayActive?h("salla-quick-buy",Object.assign({},this.getQuickBuyBtnAttributes())):"")};t.prototype.componentDidLoad=function(){var t=this;if(!this.notifyOptionsAvailability){return}salla.event.on("product-options::change",(function(i){return __awaiter(t,void 0,void 0,(function(){var t,e,n,a,r,o;var s=this;return __generator(this,(function(l){switch(l.label){case 0:if(!["thumbnail","color","single-option"].includes(i.option.type)){return[2]}this.hasSubscribedOptions=false;n=this;return[4,(t=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||t===void 0?void 0:t.getSelectedOptions()];case 1:n.selectedOptions=l.sent();a=this;return[4,(e=document.querySelector('salla-product-options[product-id="'.concat(this.productId,'"]')))===null||e===void 0?void 0:e.hasOutOfStockOption()];case 2:a.hasOutOfStockOption=l.sent();r=salla.storage.get("product-".concat(this.productId,"-subscribed-options"));if(!r&&!this.subscribedOptions||!this.hasOutOfStockOption){return[2]}if(salla.config.isGuest()){o=r?r.map((function(t){return t.split(",").map((function(t){return parseInt(t)}))})):[];this.hasSubscribedOptions=o.length>0&&o.some((function(t){return t.every((function(t){return s.selectedOptions.some((function(i){return i.id===t}))}))}))}else{this.hasSubscribedOptions=this.subscribedOptions&&this.subscribedOptions!=="null"&&this.subscribedOptions!=="[]"?JSON.parse(this.subscribedOptions).some((function(t){return t.every((function(t){return s.selectedOptions.some((function(i){return i.id===t}))}))})):false}return[2]}}))}))}))};t.prototype.componentDidRender=function(){var t=this;var i,e;if(!!this.passedLabel&&(!this.supportStickyBar||window.innerWidth>=768)){(i=this.btn)===null||i===void 0?void 0:i.setText(this.passedLabel);return}(e=this.btn)===null||e===void 0?void 0:e.setText(this.getLabel());salla.lang.onLoaded((function(){var i;return(i=t.btn)===null||i===void 0?void 0:i.setText(t.getLabel())}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaAddProductButton.style=sallaAddProductButtonCss;var informationIcon='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n';var sallaAlertCss=":host{display:block}";var SallaAlert=function(){function t(t){registerInstance(this,t);this.variant="info"}t.prototype.renderIcon=function(){var t=this.icon||this.variant;if(t==="none")return null;switch(t){case"success":return h("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},h("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return h("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},h("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return h("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},h("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return h("span",{innerHTML:informationIcon})}};t.prototype.render=function(){return h(Host,{key:"3b5dd808399eeda5d930454542cd41cca26b0cc3",class:"s-alert-wrapper s-alert-".concat(this.variant)},h("span",{key:"4f58234774d1afc790fb83bff983ca9366faa349",class:"s-alert-icon"},this.renderIcon()),h("span",{key:"10eb3f87e6e77dcc5406a24f866feee1cc1f46ef",class:"s-alert-text"},this.message,h("slot",{key:"3656e15aeb25fb7285e88f694c090bad3b32dfbd"})))};return t}();SallaAlert.style=sallaAlertCss;var infoIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n';var ImageIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>image</title>\n<path d="M21.333 6.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM21.333 12c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.597 1.333-1.333 1.333zM24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 0.969 0.219 1.884 0.592 2.715 0.013 0.024 0.025 0.048 0.039 0.072 1.059 2.284 3.359 3.88 6.036 3.88h16c3.676 0 6.667-2.991 6.667-6.667v-16c0-3.676-2.991-6.667-6.667-6.667zM8 28c-1.376 0-2.592-0.699-3.312-1.76l7.312-9.401 8.681 11.161zM28 24c0 2.187-1.765 3.964-3.945 3.995l-11.003-14.147c-0.505-0.649-1.599-0.649-2.104 0l-6.948 8.933v-14.781c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4z"></path>\n</svg>\n';var moneyIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var checkCircleIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n';var sallaBottomAlertCss=":host{display:block}";var SallaBottomAlert=function(){function t(t){var i=this;registerInstance(this,t);this.storeId=salla.config.get("store.id");this.template=salla.config.get("store.template");this.loading=false;this.templateData={};this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");this.defaultActionLabel=salla.lang.get("common.elements.know_more");this.storeFeatures=salla.lang.get("common.elements.store_features");this.storeDetails=salla.lang.get("common.elements.store_details");this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر");this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل");this.theDeveloper=salla.lang.get("common.elements.the_developer");this.templateInformation=salla.lang.get("common.elements.template_information");this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");this.isRtl=salla.config.get("theme.is_rtl",true);this.storeName=salla.config.get("store.name");this.type="popup";salla.lang.onLoaded((function(){i.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store");i.defaultActionLabel=salla.lang.get("common.elements.know_more");i.storeFeatures=salla.lang.get("common.elements.store_features");i.storeDetails=salla.lang.get("common.elements.store_details");i.templateInformation=salla.lang.get("common.elements.template_information");i.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer");salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price_details","السعر يشمل");salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price_details","Price Includes");setTimeout((function(){i.storePrice=salla.lang.get("common.elements.store_price");i.theDeveloper=salla.lang.get("common.elements.the_developer");i.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل")}),100)}))}t.prototype.open=function(){var t=this;return this.drawer.open().then((function(){return t.handleTemplateRequest()}))};t.prototype.getDefaultMessage=function(){return this.isRtl?this.defaultMessage.substring(0,this.defaultMessage.lastIndexOf(" ")):this.defaultMessage.split(" ").slice(0,-2).join(" ")};t.prototype.handleTemplateRequest=function(){var t=this;if(Object.keys(this.templateData).length){return}this.drawer.loading();return salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((function(i){t.drawer.setTitle(t.storeDetails+" "+t.storeName);t.templateData=i.data;t.drawer.stopLoading()})).catch((function(){t.drawer.close()}))};t.prototype.handleAction=function(){if(this.type==="link"){window.location.href=this.actionUrl}if(this.type==="popup"){this.open()}};t.prototype.popup=function(){var t=this;var i,e,n,a,r,o,s,l;return h("salla-drawer",{class:"s-bottom-alert-modal",ref:function(i){return t.drawer=i},"no-padding":true},Object.keys(this.templateData).length?[h("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},h("div",{class:{"s-bottom-alert-modal-content":true}},((i=this.templateData)===null||i===void 0?void 0:i.features)?[h("div",{class:"s-bottom-alert-modal-content-title"},h("i",{innerHTML:ImageIcon,class:"s-bottom-alert-modal-content-icon"}),h("span",null,this.storeFeatures)),h("div",{class:"s-bottom-alert-modal-content-features",innerHTML:(e=this.templateData)===null||e===void 0?void 0:e.features})]:""),h("div",{class:{"s-bottom-alert-modal-content":true,"s-bottom-alert-modal-content-extra-padding":(n=this.templateData)===null||n===void 0?void 0:n.price}},((a=this.templateData)===null||a===void 0?void 0:a.features)?[h("div",{class:"s-bottom-alert-modal-content-title"},h("i",{innerHTML:moneyIcon,class:"s-bottom-alert-modal-content-icon"}),h("span",null,this.storePriceDetails)),h("div",{class:"s-bottom-alert-modal-content-price-details"},(o=(r=this.templateData)===null||r===void 0?void 0:r.price_details)===null||o===void 0?void 0:o.items.map((function(t){return h("div",{class:"s-bottom-alert-modal-content-price-details-item"},h("i",{innerHTML:checkCircleIcon,class:"s-bottom-alert-modal-content-price-details-item-icon"}),h("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},t.name),h("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(t.price)}))})))]:""),((s=this.templateData)===null||s===void 0?void 0:s.link)?h("div",{class:"s-bottom-alert-modal-content-footer"},h("salla-button",{color:"primary",size:"medium",width:"wide",href:(l=this.templateData)===null||l===void 0?void 0:l.link},h("i",{innerHTML:PendingOrdersIcon}),this.buyTheTemplate)):"")]:"")};t.prototype.render=function(){var t=this;var i=this.template&&typeof this.template==="object"&&Object.keys(this.template).length>0;var e=i&&this.template.developer;var n=e!==undefined;var a=n&&(e===null||e===void 0?void 0:e.name);var r=null;return h(Host,{key:"d980894737723f3a389a1b4ce0e684accfdd0262",class:"s-bottom-alert-wrapper"},h("div",{key:"7866b293146601653c0734058c4bd73f91c45944",class:"s-bottom-alert-content"},h("div",{key:"dd1c11c4db4868d989510ab6b815688398311892",class:"s-bottom-alert-icon"},this.icon?h("i",{class:this.icon}):h("i",{innerHTML:infoIcon})),h("div",{key:"cd45028c6fe863fa9370edb5a4fb08b1a83dc437",class:"s-bottom-alert-message"},this.message?this.message:i?h("span",null,this.getDefaultMessage()," ",h("a",{href:"#",class:{"s-bottom-alert-message-highlight":true,"s-bottom-alert-message-link":r},target:"","aria-label":"Developer"},a?a:this.theDeveloper)," ",h("span",{class:"s-bottom-alert-message-splitter"},"|")," ",this.storePrice,":"," ",h("span",{class:"s-bottom-alert-message-highlight",innerHTML:salla.money(this.template.price)})):this.defaultMessage),this.type!=="banner"&&h("div",{key:"6690d6627d1d7c9f4173da13d72ed062ad9ef468",class:"s-bottom-alert-action"},h("salla-button",{key:"c4978d89a326fe6aacc00c49f50fb202950fda62",href:this.actionUrl,size:"medium",onClick:function(){return t.handleAction()},width:"normal"},this.actionLabel||this.defaultActionLabel)),this.type==="popup"&&this.popup()))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaBottomAlert.style=sallaBottomAlertCss;var ArrowLeftIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_left</title>\n<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>\n</svg>\n';var ArrowRightIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_right</title>\n<path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>\n</svg>\n';var sallaBreadcrumbCss=":host{display:block}";var SallaBreadcrumb=function(){function t(t){registerInstance(this,t);var i,e;this.sessionStorageKey="breadcrumb_snapshot";this.itemSlot=((i=this.host.querySelector('[slot="item"]'))===null||i===void 0?void 0:i.outerHTML)||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>';this.iconSlot=(e=this.host.querySelector('[slot="icon"]'))===null||e===void 0?void 0:e.outerHTML}t.prototype.componentWillLoad=function(){var t=this;return new Promise((function(t){return salla.onReady((function(){return salla.lang.onLoaded(t)}))})).then((function(){if(salla.url.is_page("index")){throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")}})).then((function(){if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",true)){throw new Error("salla-breadcrumb:: merchant disabled the feature")}})).then((function(){var i;var e=salla.config.get("page");if(!e||!e.slug){salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!');t.breadcrumbs=[];return}var n=t.getSessionBreadcrumbs();if(e.slug==="product.single"&&n&&n.length>0){n.push({title:e.title,url:e.url});t.breadcrumbs=t.setBreadcrumbsFromArray(n);t.storeBreadcrumbSnapshot()}else if(n&&n.length>0){if(t.isNewPage(e,n)){t.breadcrumbs=t.generateBreadcrumbs(e);t.storeBreadcrumbSnapshot()}else{t.breadcrumbs=t.setBreadcrumbsFromArray(n)}}else{t.breadcrumbs=t.generateBreadcrumbs(e);t.storeBreadcrumbSnapshot()}if((i=t.breadcrumbs)===null||i===void 0?void 0:i.length){t.breadcrumbs[t.breadcrumbs.length-1].is_last=true}return t.breadcrumbs})).catch((function(i){salla.logger.error("salla-breadcrumb:: unexpected error!",i);t.breadcrumbs=[]}))};t.prototype.getSessionBreadcrumbs=function(){if(new URLSearchParams(window.location.search).get("from")==="search-bar"){return[]}return JSON.parse(sessionStorage.getItem(this.sessionStorageKey)||"[]")};t.prototype.isNewPage=function(t,i){var e=i[i.length-1];return(e===null||e===void 0?void 0:e.url)!==t.url};t.prototype.setBreadcrumbsFromArray=function(t){return t.map((function(i,e){return Object.assign(Object.assign({},i),{is_last:e===t.length-1})}))};t.prototype.sanitizeBreadcrumbTitle=function(t,i){if(i===void 0){i=1}if(!t.includes("|")){return t.trim()}return t.split("|").map((function(t){return t.trim()}))[i]};t.prototype.generateBreadcrumbs=function(t){var i,e;var n=[];if(t.slug==="product.single"){var a=this.getSessionBreadcrumbs();if(a.length>0&&((i=a[1])===null||i===void 0?void 0:i.url)===((e=t.parent)===null||e===void 0?void 0:e.url)){return this.setBreadcrumbsFromArray(__spreadArray(__spreadArray([],a,true),[t],false))}}var r=t;while(r){if(r.title){n.unshift({title:r.title,url:r.url})}r=r.parent}if(t.slug.includes("customer")&&t.slug!=="customer.profile"){n.unshift({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")})}if(t.slug.includes("blog")){n.unshift({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")})}if(t.slug==="brands.single"){n.unshift({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")})}if(!t.title&&t.slug==="loyalty"){n.unshift({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")})}n.unshift({title:salla.lang.get("common.titles.home"),url:salla.url.get("")});return n};t.prototype.storeBreadcrumbSnapshot=function(){try{var t=salla.config.get("page");if((t===null||t===void 0?void 0:t.slug)==="product.single"){return}var i=__spreadArray([],this.breadcrumbs,true);var e=i.length-1;if(e>=0){i[e].url=window.location.href}var n=JSON.stringify(i);sessionStorage.setItem(this.sessionStorageKey,n)}catch(t){salla.logger.error("salla-breadcrumb:: Failed to store breadcrumb snapshot in sessionStorage.",t)}};t.prototype.render=function(){var t=this;if(this.breadcrumbs.length<=1){salla.log("salla-breadcrumb:: There is no breadcrumbs!");return null}return h("ol",{class:{"s-breadcrumb-wrapper":true,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((function(i){var e=salla.config.get("page.slug")==="product.single";var n=e&&i.is_last?i.title:t.sanitizeBreadcrumbTitle(i.title);var a=t.itemSlot.replace(/\{url\}/g,i.url).replace(/\{title\}/g,n);return[h("div",{class:"s-breadcrumb-slot",innerHTML:a}),t.getArrowDomForItem(i)]})))};t.prototype.getArrowDomForItem=function(t){if(t.is_last){return""}var i=this.iconSlot||(salla.config.get("theme.is_rtl",true)?ArrowLeftIcon:ArrowRightIcon);return h("li",{class:"s-breadcrumb-arrow"},h("div",{class:{"s-breadcrumb-icon-slot":true,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:i}))};t.prototype.componentDidRender=function(){var t,i,e;this.host.querySelectorAll(".s-breadcrumb-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((function(t){return t.replaceWith(t.querySelector("svg"))}));(t=this.host.querySelector('[slot="item"]'))===null||t===void 0?void 0:t.remove();(i=this.host.querySelector('[slot="icon"]'))===null||i===void 0?void 0:i.remove();var n=(e=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1])===null||e===void 0?void 0:e.querySelector("a");n&&n.replaceWith(n.firstChild)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaBreadcrumb.style=sallaBreadcrumbCss;var sallaButtonCss="";var SallaButton=function(){function t(t){registerInstance(this,t);this.hostAttributes={};this.shape="btn";this.color="primary";this.fill="solid";this.size="medium";this.width="normal";this.loading=false;this.disabled=false;this.loaderPosition="after";this.type="button"}t.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.loaderPosition=="center")this.text.classList.add("s-button-hide");this.host.setAttribute("loading","");return[2,this.host]}))}))};t.prototype.stop=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.removeAttribute("loading");this.host.querySelector("button").removeAttribute("loading");if(this.loaderPosition=="center")this.text.classList.remove("s-button-hide");return[2,this.host]}))}))};t.prototype.setText=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.text.innerHTML=t;return[2,this.host]}))}))};t.prototype.disable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.setAttribute("disabled","");return[2,this.host]}))}))};t.prototype.enable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.removeAttribute("disabled");return[2,this.host]}))}))};t.prototype.getBtnAttributes=function(){for(var t=0;t<this.host.attributes.length;t++){if(!["color","fill","size","width","id"].includes(this.host.attributes[t].name)){this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value}}this.hostAttributes.type=this.hostAttributes.type||this.type;this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+(this.fill=="none"?"fill-none":this.fill)+(this.size!="medium"?" s-button-"+this.size:"")+(this.width!="normal"?" s-button-"+this.width:"")+(this.shape=="link"?" s-button-"+this.color+"-link":"")+(this.shape!="link"&&this.fill!="outline"?" s-button-"+this.color:"")+(this.fill=="outline"?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+(this.shape=="icon"?" s-button-loader-center":" s-button-loader-"+this.loaderPosition);return this.hostAttributes};t.prototype.button=function(){var t=this;return h("button",Object.assign({},this.getBtnAttributes(),{disabled:this.disabled}),h("span",{class:"s-button-text",ref:function(i){return t.text=i}},h("slot",null)),this.loading?h("span",{class:"s-button-loader"}):"")};t.prototype.render=function(){var t;return((t=this.host.closest(".swiper-slide"))===null||t===void 0?void 0:t.classList.contains("swiper-slide-duplicate"))?"":h(Host,{class:"s-button-wrap"},this.href?h("a",{href:this.href},this.button()):this.button())};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaButton.style=sallaButtonCss;var sallaCartSummaryCss="";var SallaCartSummary=function(){function t(t){var i=this;registerInstance(this,t);this.cartSummaryCount=salla.storage.get("cart.summary.count")||0;this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0;this.cartLabel=salla.config.get("user.language_code")==="ar"?"السلة":"Cart";salla.cart.event.onUpdated((function(t){i.cartSummaryCount=t.count||0;i.cartSummaryTotal=t.total||0}))}t.prototype.animateToCart=function(t){return __awaiter(this,void 0,void 0,(function(){var i,e,n,a,r,o,s,l,u,c,f,d;return __generator(this,(function(h){document.querySelectorAll(".s-cart-thumb").forEach((function(t){return t.remove()}));if(!(t===null||t===void 0?void 0:t.src)){salla.log("Failed to get the img element");return[2]}i=this.host.querySelector("#s-cart-icon"),e=i.getBoundingClientRect(),n=e.top+window.scrollY,a=e.left+window.scrollX;r=t.getBoundingClientRect(),o=t.offsetWidth+"px",s=t.offsetHeight+"px",l=r.top,u=r.left;c=document.createElement("img");c.src=t.getAttribute("src");c.className="s-cart-thumb";c.setAttribute("style","object-fit:cover; width:"+o+"; height:"+s+"; top:"+l+"px; left:"+u+"px;z-index:99999999; ");document.body.append(c);f=document.querySelector(".s-cart-thumb");i.classList.remove("animated","rubberBand");d=new anime.timeline;d.add({targets:f,width:[150,30],height:[150,30],top:[l,window.scrollY>0?n-window.scrollY-40:n-40],left:[u,a],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:f,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?n-window.scrollY-40:n-40,window.scrollY>0?n-window.scrollY+10:n+10],left:[a,a+10]},"-=500").add({complete:function(){i.classList.add("animated","rubberBand");f.remove()}},"-=1700");return[2]}))}))};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.getCartLink=function(){var t=salla.url.get("cart");var i=salla.config.get("store.scope",salla.storage.get("scope"));if(i&&i.id){try{var e=new URL(t);e.searchParams.set("scope",i.id);return e.toString()}catch(e){var n=t.includes("?")?"&":"?";return"".concat(t).concat(n,"scope=").concat(encodeURIComponent(i.id))}}return t};t.prototype.render=function(){return h(Host,{key:"9438bba26da9472fd505b4797fae50877103b9aa"},h("a",{key:"f0c8b59b4878525d189fafb89a50654b239e96fd",class:"s-cart-summary-wrapper",href:this.getCartLink()},h("div",{key:"91b633322061063ab214f2c9409eb156da210bc2",id:"s-cart-icon"},h("slot",{key:"ccf02e30d94dd3485e219528ace2d56651c52456",name:"icon"},h("i",{key:"f102e391d9175cf9881c84063b33993c832c426b",class:"s-cart-summary-icon",innerHTML:PendingOrdersIcon}))),h("span",{key:"3bf1db1728d57b526c9e60ce284f7128226586b5",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),h("p",{key:"57aa05278d5c30395d263aca978e4be8676d3a25",class:"s-cart-summary-content"},this.showCartLabel&&h("span",{key:"06d9c96ff9224023608a859fbec427f370c9e522",class:"s-cart-summary-label"},this.cartLabel),h("b",{key:"d8c05640c7e3579cd04fbdd29251f96f6e47bfa5",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaCartSummary.style=sallaCartSummaryCss;var vanillaPicker$1={exports:{}};
|
|
5
5
|
/*!
|
|
6
6
|
* vanilla-picker v2.12.3
|
|
7
7
|
* https://vanilla-picker.js.org
|
|
8
8
|
*
|
|
9
9
|
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
10
10
|
* Released under the ISC license.
|
|
11
|
-
*/var vanillaPicker=vanillaPicker$1.exports;var hasRequiredVanillaPicker;function requireVanillaPicker(){if(hasRequiredVanillaPicker)return vanillaPicker$1.exports;hasRequiredVanillaPicker=1;(function(t,i){(function(i,e){t.exports=e()})(vanillaPicker,(function(){var t=function(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}};var i=function(){function t(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}return function(i,e,n){if(e)t(i.prototype,e);if(n)t(i,n);return i}}();var e=function(){function t(t,i){var e=[];var n=true;var a=false;var r=undefined;try{for(var o=t[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){e.push(s.value);if(i&&e.length===i)break}}catch(t){a=true;r=t}finally{try{if(!n&&o["return"])o["return"]()}finally{if(a)throw r}}return e}return function(i,e){if(Array.isArray(i)){return i}else if(Symbol.iterator in Object(i)){return t(i,e)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0};String.prototype.padStart=String.prototype.padStart||function(t,i){var e=this;while(e.length<t){e=i+e}return e};var n={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function a(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var e=i>0?t.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):t.toString();return e||"0"}var r=function(){function r(i,n,a,o){t(this,r);var s=this;function l(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),n=e(i,4),a=n[0],o=n[1],l=n[2],u=n[3];if(u===undefined){u=1}a/=360;o/=100;l/=100;s.hsla=[a,o,l,u]}else if(t.startsWith("rgb")){var c=t.match(/([\-\d\.e]+)/g).map(Number),f=e(c,4),d=f[0],h=f[1],p=f[2],v=f[3];if(v===undefined){v=1}s.rgba=[d,h,p,v]}else{if(t.startsWith("#")){s.rgba=r.hexToRgb(t)}else{s.rgba=r.nameToRgb(t)||r.hexToRgb(t)}}}if(i===undefined);else if(Array.isArray(i)){this.rgba=i}else if(a===undefined){var u=i&&""+i;if(u){l(u.toLowerCase())}}else{this.rgba=[i,n,a,o===undefined?1:o]}}i(r,[{key:"printRGB",value:function t(i){var e=i?this.rgba:this.rgba.slice(0,3),n=e.map((function(t,i){return a(t,i===3?3:0)}));return i?"rgba("+n+")":"rgb("+n+")"}},{key:"printHSL",value:function t(i){var e=[360,100,100,1],n=["","%","%",""];var r=i?this.hsla:this.hsla.slice(0,3),o=r.map((function(t,i){return a(t*e[i],i===3?3:1)+n[i]}));return i?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function t(i){var e=this.hex;return i?e:e.substring(0,7)}},{key:"rgba",get:function t(){if(this._rgba){return this._rgba}if(!this._hsla){throw new Error("No color is set")}return this._rgba=r.hslToRgb(this._hsla)},set:function t(i){if(i.length===3){i[3]=1}this._rgba=i;this._hsla=null}},{key:"rgbString",get:function t(){return this.printRGB()}},{key:"rgbaString",get:function t(){return this.printRGB(true)}},{key:"hsla",get:function t(){if(this._hsla){return this._hsla}if(!this._rgba){throw new Error("No color is set")}return this._hsla=r.rgbToHsl(this._rgba)},set:function t(i){if(i.length===3){i[3]=1}this._hsla=i;this._rgba=null}},{key:"hslString",get:function t(){return this.printHSL()}},{key:"hslaString",get:function t(){return this.printHSL(true)}},{key:"hex",get:function t(){var i=this.rgba,e=i.map((function(t,i){return i<3?t.toString(16):Math.round(t*255).toString(16)}));return"#"+e.map((function(t){return t.padStart(2,"0")})).join("")},set:function t(i){this.rgba=r.hexToRgb(i)}}],[{key:"hexToRgb",value:function t(i){var e=(i.startsWith("#")?i.slice(1):i).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/)){throw new Error("Unknown hex color; "+i)}var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));n[3]=n[3]/255;return n}},{key:"nameToRgb",value:function t(i){var e=i.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),a=n[e];return a===undefined?a:r.hexToRgb(a.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function t(i){var n=e(i,4),a=n[0],r=n[1],o=n[2],s=n[3];a/=255;r/=255;o/=255;var l=Math.max(a,r,o),u=Math.min(a,r,o);var c=void 0,f=void 0,d=(l+u)/2;if(l===u){c=f=0}else{var h=l-u;f=d>.5?h/(2-l-u):h/(l+u);switch(l){case a:c=(r-o)/h+(r<o?6:0);break;case r:c=(o-a)/h+2;break;case o:c=(a-r)/h+4;break}c/=6}return[c,f,d,s]}},{key:"hslToRgb",value:function t(i){var n=e(i,4),a=n[0],r=n[1],o=n[2],s=n[3];var l=void 0,u=void 0,c=void 0;if(r===0){l=u=c=o}else{var f=function t(i,e,n){if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return i+(e-i)*6*n;if(n<1/2)return e;if(n<2/3)return i+(e-i)*(2/3-n)*6;return i};var d=o<.5?o*(1+r):o+r-o*r,h=2*o-d;l=f(h,d,a+1/3);u=f(h,d,a);c=f(h,d,a-1/3)}var p=[l*255,u*255,c*255].map(Math.round);p[3]=s;return p}}]);return r}();var o=function(){function e(){t(this,e);this._events=[]}i(e,[{key:"add",value:function t(i,e,n){i.addEventListener(e,n,false);this._events.push({target:i,type:e,handler:n})}},{key:"remove",value:function t(i,n,a){this._events=this._events.filter((function(t){var r=true;if(i&&i!==t.target){r=false}if(n&&n!==t.type){r=false}if(a&&a!==t.handler){r=false}if(r){e._doRemove(t.target,t.type,t.handler)}return!r}))}},{key:"destroy",value:function t(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)}));this._events=[]}}],[{key:"_doRemove",value:function t(i,e,n){i.removeEventListener(e,n,false)}}]);return e}();function s(t){var i=document.createElement("div");i.innerHTML=t;return i.firstElementChild}function l(t,i,e){var n=false;function a(t,i,e){return Math.max(i,Math.min(t,e))}function r(t,r,o){if(o){n=true}if(!n){return}t.preventDefault();var s=i.getBoundingClientRect(),l=s.width,u=s.height,c=r.clientX,f=r.clientY;var d=a(c-s.left,0,l),h=a(f-s.top,0,u);e(d/l,h/u)}function o(t,i){var e=t.buttons===undefined?t.which:t.buttons;if(e===1){r(t,t,i)}else{n=false}}function s(t,i){if(t.touches.length===1){r(t,t.touches[0],i)}else{n=false}}t.add(i,"mousedown",(function(t){o(t,true)}));t.add(i,"touchstart",(function(t){s(t,true)}));t.add(window,"mousemove",o);t.add(i,"touchmove",s);t.add(window,"mouseup",(function(t){n=false}));t.add(i,"touchend",(function(t){n=false}));t.add(i,"touchcancel",(function(t){n=false}))}var u="linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em";var c=360;var f="keydown",d="mousedown",h="focusin";function p(t,i){return(i||document).querySelector(t)}function v(t){t.preventDefault();t.stopPropagation()}function g(t,i,e,n,a){t.add(i,f,(function(t){if(e.indexOf(t.key)>=0){n(t)}}))}var _=function(){function e(i){t(this,e);this.settings={popup:"right",layout:"default",alpha:true,editor:true,editorFormat:"hex",cancelButton:false,defaultColor:"#0cf"};this._events=new o;this.onChange=null;this.onDone=null;this.onOpen=null;this.onClose=null;this.setOptions(i)}i(e,[{key:"setOptions",value:function t(i){var e=this;if(!i){return}var n=this.settings;function a(t,i,e){for(var n in t){i[n]=t[n]}}if(i instanceof HTMLElement){n.parent=i}else{if(n.parent&&i.parent&&n.parent!==i.parent){this._events.remove(n.parent);this._popupInited=false}a(i,n);if(i.onChange){this.onChange=i.onChange}if(i.onDone){this.onDone=i.onDone}if(i.onOpen){this.onOpen=i.onOpen}if(i.onClose){this.onClose=i.onClose}var r=i.color||i.colour;if(r){this._setColor(r)}}var o=n.parent;if(o&&n.popup&&!this._popupInited){var s=function t(i){return e.openHandler(i)};this._events.add(o,"click",s);g(this._events,o,[" ","Spacebar","Enter"],s);this._popupInited=true}else if(i.parent&&!n.popup){this.show()}}},{key:"openHandler",value:function t(i){if(this.show()){i&&i.preventDefault();this.settings.parent.style.pointerEvents="none";var e=i&&i.type===f?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100);if(this.onOpen){this.onOpen(this.colour)}}}},{key:"closeHandler",value:function t(i){var e=i&&i.type;var n=false;if(!i){n=true}else if(e===d||e===h){var a=(this.__containedEvent||0)+100;if(i.timeStamp>a){n=true}}else{v(i);n=true}if(n&&this.hide()){this.settings.parent.style.pointerEvents="";if(e!==d){this.settings.parent.focus()}if(this.onClose){this.onClose(this.colour)}}}},{key:"movePopup",value:function t(i,e){this.closeHandler();this.setOptions(i);if(e){this.openHandler()}}},{key:"setColor",value:function t(i,e){this._setColor(i,{silent:e})}},{key:"_setColor",value:function t(i,e){if(typeof i==="string"){i=i.trim()}if(!i){return}e=e||{};var n=void 0;try{n=new r(i)}catch(t){if(e.failSilently){return}throw t}if(!this.settings.alpha){var a=n.hsla;a[3]=1;n.hsla=a}this.colour=this.color=n;this._setHSLA(null,null,null,null,e)}},{key:"setColour",value:function t(i,e){this.setColor(i,e)}},{key:"show",value:function t(){var i=this.settings.parent;if(!i){return false}if(this.domElement){var e=this._toggleDOM(true);this._setPosition();return e}var n=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>';var a=s(n);this.domElement=a;this._domH=p(".picker_hue",a);this._domSL=p(".picker_sl",a);this._domA=p(".picker_alpha",a);this._domEdit=p(".picker_editor input",a);this._domSample=p(".picker_sample",a);this._domOkay=p(".picker_done button",a);this._domCancel=p(".picker_cancel button",a);a.classList.add("layout_"+this.settings.layout);if(!this.settings.alpha){a.classList.add("no_alpha")}if(!this.settings.editor){a.classList.add("no_editor")}if(!this.settings.cancelButton){a.classList.add("no_cancel")}this._ifPopup((function(){return a.classList.add("popup")}));this._setPosition();if(this.colour){this._updateUI()}else{this._setColor(this.settings.defaultColor)}this._bindEvents();return true}},{key:"hide",value:function t(){return this._toggleDOM(false)}},{key:"destroy",value:function t(){this._events.destroy();if(this.domElement){this.settings.parent.removeChild(this.domElement)}}},{key:"_bindEvents",value:function t(){var i=this;var e=this,n=this.domElement,a=this._events;function r(t,i,e){a.add(t,i,e)}r(n,"click",(function(t){return t.preventDefault()}));l(a,this._domH,(function(t,i){return e._setHSLA(t)}));l(a,this._domSL,(function(t,i){return e._setHSLA(null,t,1-i)}));if(this.settings.alpha){l(a,this._domA,(function(t,i){return e._setHSLA(null,null,null,1-i)}))}var o=this._domEdit;{r(o,"input",(function(t){e._setColor(this.value,{fromEditor:true,failSilently:true})}));r(o,"focus",(function(t){var i=this;if(i.selectionStart===i.selectionEnd){i.select()}}))}this._ifPopup((function(){var t=function t(e){return i.closeHandler(e)};r(window,d,t);r(window,h,t);g(a,n,["Esc","Escape"],t);var e=function t(e){i.__containedEvent=e.timeStamp};r(n,d,e);r(n,h,e);r(i._domCancel,"click",t)}));var s=function t(e){i._ifPopup((function(){return i.closeHandler(e)}));if(i.onDone){i.onDone(i.colour)}};r(this._domOkay,"click",s);g(a,n,["Enter"],s)}},{key:"_setPosition",value:function t(){var i=this.settings.parent,e=this.domElement;if(i!==e.parentNode){i.appendChild(e)}this._ifPopup((function(t){if(getComputedStyle(i).position==="static"){i.style.position="relative"}var n=t===true?"popup_right":"popup_"+t;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){if(t===n){e.classList.add(t)}else{e.classList.remove(t)}}));e.classList.add(n)}))}},{key:"_setHSLA",value:function t(i,e,n,a,r){r=r||{};var o=this.colour,s=o.hsla;[i,e,n,a].forEach((function(t,i){if(t||t===0){s[i]=t}}));o.hsla=s;this._updateUI(r);if(this.onChange&&!r.silent){this.onChange(o)}}},{key:"_updateUI",value:function t(i){if(!this.domElement){return}i=i||{};var e=this.colour,n=e.hsla,a="hsl("+n[0]*c+", 100%, 50%)",r=e.hslString,o=e.hslaString;var s=this._domH,l=this._domSL,f=this._domA,d=p(".picker_selector",s),h=p(".picker_selector",l),v=p(".picker_selector",f);function g(t,i,e){i.style.left=e*100+"%"}function _(t,i,e){i.style.top=e*100+"%"}g(s,d,n[0]);this._domSL.style.backgroundColor=this._domH.style.color=a;g(l,h,n[1]);_(l,h,1-n[2]);l.style.color=r;_(f,v,1-n[3]);var m=r,b=m.replace("hsl","hsla").replace(")",", 0)"),w="linear-gradient("+[m,b]+")";this._domA.style.background=w+", "+u;if(!i.fromEditor){var x=this.settings.editorFormat,y=this.settings.alpha;var k=void 0;switch(x){case"rgb":k=e.printRGB(y);break;case"hsl":k=e.printHSL(y);break;default:k=e.printHex(y)}this._domEdit.value=k}this._domSample.style.color=o}},{key:"_ifPopup",value:function t(i,e){if(this.settings.parent&&this.settings.popup){i&&i(this.settings.popup)}else{e&&e()}}},{key:"_toggleDOM",value:function t(i){var e=this.domElement;if(!e){return false}var n=i?"":"none",a=e.style.display!==n;if(a){e.style.display=n}return a}}]);return e}();{var m=document.createElement("style");m.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}';document.documentElement.firstElementChild.appendChild(m);_.StyleElement=m}return _}))})(vanillaPicker$1);return vanillaPicker$1.exports}var vanillaPickerExports=requireVanillaPicker();var Picker=getDefaultExportFromCjs(vanillaPickerExports);var sallaColorPickerCss="";var SallaColorPicker=function(){function t(t){registerInstance(this,t);this.colorChanged=createEvent(this,"colorChanged");this.invalidInput=createEvent(this,"invalidInput");this.submitted=createEvent(this,"submitted");this.popupOpened=createEvent(this,"popupOpened");this.popupClosed=createEvent(this,"popupClosed");this.name="color";this.required=false;this.format="hex";this.showCancelButton=false;this.showTextField=true;this.enableAlpha=false}t.prototype.colorChangeHandler=function(t){this.colorInput.value=t.hex;this.colorChanged.emit(t)};t.prototype.submittedHandler=function(t){this.setColorValue(t.rgbaString,true);this.canvas.style.backgroundColor=t.rgbString;this.colorInput.value=t.hex;this.colorInput.dispatchEvent(new window.Event("change",{bubbles:true}));this.submitted.emit(t)};t.prototype.popupOpenedHandler=function(t){this.setPopInPosition();this.popupOpened.emit(t)};t.prototype.popupClosedHandler=function(t){this.popupClosed.emit(t)};t.prototype.setPickerOption=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.picker.setOptions(t);return[2]}))}))};t.prototype.movePopUp=function(t,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.movePopup(t,i);return[2]}))}))};t.prototype.setColorValue=function(t,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.setColor(t,i);return[2]}))}))};t.prototype.openPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.show();return[2]}))}))};t.prototype.closePicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.hide();return[2]}))}))};t.prototype.destroyPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.destroy();return[2]}))}))};t.prototype.componentWillLoad=function(){var t=this;salla.onReady((function(){t.color=t.color?t.color:salla.config.get("theme.color.primary","#5dd5c4")}))};t.prototype.setPopInPosition=function(){var t=this.host.querySelector(".picker_wrapper");var i=this.host.querySelector(".s-color-picker-widget").getBoundingClientRect();var e=window.innerWidth/2-i.width/2;var n=e>i.x;var a=e<i.x;var r=e===i.x;var o=window.innerWidth<768;if(o&&n){t.style.left="0"}if(o&&a){t.style.left="auto"}if(!o||o&&(!a&&!n||r)){t.style.left="-95px"}};t.prototype.initColorPicker=function(){var t=this;this.picker=new Picker({parent:this.host,color:this.color,popup:"bottom",alpha:this.enableAlpha,editor:this.showTextField,editorFormat:this.format,cancelButton:this.showCancelButton,onChange:function(i){return t.colorChangeHandler(i)},onDone:function(i){return t.submittedHandler(i)},onOpen:function(i){return t.popupOpenedHandler(i)},onClose:function(i){return t.popupClosedHandler(i)}})};t.prototype.render=function(){var t=this;return h(Host,{key:"692d43f617dbaa05e170c32c725eb4adcc01ec78",class:"s-color-picker-main"},h("slot",{key:"33166575c005f01e1557ac665749e206f05cc499",name:"widget"},h("div",{key:"60bf746f0e2b336da837d62e962fefeaf63a9a2c",class:"s-color-picker-widget"},h("div",{key:"62c56bc83a9315052ac3c21841f284b416407945",class:"s-color-picker-widget-canvas",ref:function(i){return t.canvas=i}}),h("span",{key:"3f1869950f457659a3c52d8148fd386ce1171caa",innerHTML:ArrowDownIcon}))),h("input",{key:"7fa3f08df14f03e9a4cf33e41eeb9f34b1a9dbfe",class:"s-hidden",name:this.name,required:this.required,value:this.color,ref:function(i){return t.colorInput=i}}))};t.prototype.componentDidLoad=function(){var t=this;this.canvas.style.backgroundColor=this.color;this.initColorPicker();this.colorInput.addEventListener("invalid",(function(i){t.invalidInput.emit(i)}));this.colorInput.addEventListener("input",(function(){t.colorInput.setCustomValidity("");t.colorInput.reportValidity()}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaColorPicker.style=sallaColorPickerCss;var sallaCommentFormCss=":host{display:block}";var SallaCommentForm=function(){function t(t){var i=this;registerInstance(this,t);this.placeholder=salla.lang.get("blocks.comments.placeholder");this.submitText=salla.lang.get("blocks.comments.submit");salla.lang.onLoaded((function(){i.placeholder=salla.lang.get("blocks.comments.placeholder");i.submitText=salla.lang.get("blocks.comments.submit")}));salla.onReady((function(){i.canComment=salla.config.get("user.can_comment");i.itemId=salla.config.get("page.id");i.type=salla.url.is_page("page-single")?"page":salla.url.is_page("blog.single")?"blog":"product"}))}t.prototype.submit=function(){var t=this;if(!this.commentForm.reportValidity()){salla.log("CommentForm:: validation error!");return}this.submitBtn.load().then((function(){return salla.comment.add({id:t.itemId,comment:t.commentField.value,type:t.type})})).finally((function(){return t.submitBtn.stop}))};t.prototype.render=function(){var t=this;return h(Host,{key:"305789ae94c288c8ca485ab10ae87a71f31d1042"},!!this.canComment?h("form",{ref:function(i){return t.commentForm=i}},h("div",{class:"s-comment-form-wrapper"},this.showAvatar?h("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",h("div",{class:"s-comment-form-content"},h("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:function(i){return t.commentField=i},placeholder:this.placeholder,class:"s-comment-form-input",required:true}),h("br",null),h("div",{class:"s-comment-form-action"},h("salla-button",{ref:function(i){return t.submitBtn=i},"loader-position":"center",onClick:function(){return t.submit()}},this.submitText))))):"")};return t}();SallaCommentForm.style=sallaCommentFormCss;var Reply='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n';var ThumbsUp='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>thumbs-up</title>\n<path d="M26.667 10.667h-8.261l1.279-3.38c0.723-1.911 0.087-4.051-1.549-5.203-0.909-0.639-2.004-0.881-3.085-0.684-1.101 0.203-2.061 0.837-2.703 1.787l-5.452 8.067c-0.148 0.22-0.228 0.48-0.228 0.747v12c0 3.676 2.991 6.667 6.667 6.667h8.688c2.535 0 4.817-1.407 5.955-3.671l2.548-5.063c0.093-0.187 0.143-0.392 0.143-0.6v-6.667c0-2.205-1.795-4-4-4zM28 21.017l-2.405 4.78c-0.683 1.359-2.052 2.203-3.573 2.203h-8.688c-2.205 0-4-1.795-4-4v-11.592l5.223-7.728c0.237-0.352 0.584-0.585 0.975-0.657 0.367-0.067 0.749 0.017 1.068 0.241 0.631 0.444 0.879 1.317 0.591 2.079l-1.963 5.185c-0.156 0.409-0.099 0.869 0.149 1.229s0.66 0.576 1.099 0.576h10.192c0.735 0 1.333 0.599 1.333 1.333zM2.667 10.667c-0.736 0-1.333 0.597-1.333 1.333v16c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-16c0-0.736-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var sallaCommentsCss$1=":host{display:block}";var SallaCommentItem=function(){function t(t){var i=this;registerInstance(this,t);this.has_bought_trans=salla.lang.get("blocks.comments.has_bought");this.rated_trans=salla.lang.get("pages.rating.rated");this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");this.has_order_trans=salla.lang.get("blocks.comments.has_order");this.allowLikes=salla.config.get("store.settings.rating.allow_likes");this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images");this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد");this.likesCount=0;this.likedComments=[];salla.lang.onLoaded((function(){var t=function(t,i,e){return new Promise((function(n){salla.helpers.setNested(salla.lang.messages[t],i,e);n(true)}))};var e=function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return[4,t("ar.trans","blocks.comments.helpful","مفيد")];case 1:i.sent();return[4,t("en.trans","blocks.comments.helpful","Helpful")];case 2:i.sent();this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد");return[2]}}))}))};i.has_bought_trans=salla.lang.get("blocks.comments.has_bought");i.rated_trans=salla.lang.get("pages.rating.rated");i.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");i.has_order_trans=salla.lang.get("blocks.comments.has_order");e()}))}t.prototype.componentDidLoad=function(){this.likesCount=this.comment.likes_count;try{this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");if(this.likedComments.includes(this.comment.id)){this.likeBtn.classList.add("liked");this.likeBtn.fill="solid"}}catch(t){salla.log("Bad json for liked_comments")}};t.prototype.getReplies=function(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]};t.prototype.getDate=function(t){var i=t.split(" ")[0];var e=i.split("-"),n=e[0],a=e[1],r=e[2];var o="".concat(parseInt(r,10),"/").concat(parseInt(a,10),"/").concat(parseInt(n,10));return o};t.prototype.getTime=function(t){var i=t.split(" "),e=i[1];var n=e.split(":"),a=n[0],r=n[1];var o="".concat(parseInt(a,10),":").concat(parseInt(r,10));return o};t.prototype.toggleLike=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n;return __generator(this,(function(a){switch(a.label){case 0:if(salla.config.isGuest()){return[2,salla.notify.error(salla.lang.get("common.messages.must_login"))]}this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");t=this.likedComments.includes(this.comment.id);a.label=1;case 1:a.trys.push([1,3,,4]);i=t?"rating/".concat(this.comment.id,"/unlike"):"rating/".concat(this.comment.id,"/like");return[4,salla.api.request(i,"","put")];case 2:e=a.sent();salla.log(e.message);if(t){this.likeBtn.classList.remove("liked");this.likeBtn.fill="outline";this.updateLikedComments(this.comment.id,false);this.likesCount--}else{this.likeBtn.classList.add("liked");this.likeBtn.fill="solid";this.updateLikedComments(this.comment.id,true);this.likesCount++}return[3,4];case 3:n=a.sent();if(n.response.status==409){if(this.likeBtn.classList.contains("liked")){this.likeBtn.fill="outline";this.likeBtn.classList.remove("liked");this.updateLikedComments(this.comment.id,false);this.likesCount--}else{this.likeBtn.fill="solid";this.likeBtn.classList.add("liked");salla.logger.warn("Like already exists");this.updateLikedComments(this.comment.id,true)}}return[3,4];case 4:return[2]}}))}))};t.prototype.updateLikedComments=function(t,i){this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");if(i){if(!this.likedComments.includes(t)){this.likedComments.push(t)}}else{this.likedComments=this.likedComments.filter((function(i){return i!==t}))}localStorage.setItem("liked_comments",JSON.stringify(this.likedComments))};t.prototype.render=function(){var t=this;var i,e,n,a,r,o;var s=this.comment.type=="admin";return h(Host,{key:"98e314383c34c566ab9e05efeebae51e5b694681",class:s?"s-comments-item-admin":"s-comments-item"},h("div",{key:"a704f11fd7f4bc227eb2f986360afb3c2875c6ab",class:{"s-comments-item-wrapper":!s,"s-comments-item-admin-wrapper":s},id:"s-comments-item-".concat(this.comment.id)},h("div",{key:"8b0c0a9422003621eb5d8d6a54893fc0a18d4cc9",class:"s-comments-item-inner s-comments-flex-1"},s&&h("span",{key:"7f421290726abe2391da37178e01265badf4fd08",class:"s-comments-item-reply-icon",innerHTML:Reply}),h("div",{key:"61ef5759d54603f1b886de9126ab771437fe2e98",class:"s-comments-item-avatar"},h("img",{key:"67b668cc17d3d0747cd128efa961540858750fbf","data-src":(i=this.comment)===null||i===void 0?void 0:i.avatar,alt:(e=this.comment)===null||e===void 0?void 0:e.name,src:(n=this.comment)===null||n===void 0?void 0:n.avatar,class:"s-comments-item-avatar-img lazy"})),h("div",{key:"fc42c8a69538f09f8f3f9c0e5555d39b9dc4a6ac",class:"s-comments-flex-1"},h("div",{key:"7b2b3de758fed9ae73e0032b6cf895ce1df99883",class:"s-comments-item-user-wrapper"},h("div",{key:"1d4187d935e209354587a900f912a4eb19b066df",class:"s-comments-item-user-info"},h("h3",{key:"2a45f7ad245c41a2fd5a69bd909e093effed8453",class:"s-comments-item-user-info-name"},(a=this.comment)===null||a===void 0?void 0:a.name),(this.comment.has_order||!!this.comment.rating)&&!this.comment.is_pending&&!this.hideBought?h("div",{class:"s-comments-flex"},this.comment.has_order?[h("span",{class:"s-comments-item-has-order-check-icon",innerHTML:IconVerified}),h("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,!!this.comment.rating?h("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null):null),h("p",{key:"c934abc4f8dd94bc349d85d00a5984aef672d9d9",class:"s-comments-item-timestamp s-ltr"}," ",this.getDate((r=this.comment.created_at)===null||r===void 0?void 0:r.date)," ",h("span",{key:"acef6d6af07b12501a61d074ad566692bb02456a",class:"s-comments-item-time"}," - ",this.getTime((o=this.comment.created_at)===null||o===void 0?void 0:o.date)," ")),!!this.comment.rating||!!this.comment.stars?h("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating||this.comment.stars}):null),h("div",{key:"9bedec8066878f113623e9ab27c203836eea2db5",class:"s-comments-item-content"},h("p",{key:"0f8b1bf62ac5afc1449b160884945003b70e55f0",innerHTML:this.comment.content}),this.allowAttachImages&&h("div",{key:"df920f8e2758aedc313b4502f554157fb216c15d",class:"s-comments-item-images"},this.comment.images.map((function(i,e){return h("img",{key:e,src:i,alt:"",onClick:function(){return t.modal.open()}})})),h("salla-modal",{key:"0743d9159e0cf4061b1969953f58fdebf49ee9e2",ref:function(i){return t.modal=i},width:"sm"},h("salla-slider",{key:"00a15b0dca213ddf64f3346da6849ce0dde7f638",id:"s-comments-item-".concat(this.comment.id,"-images"),class:"s-comments-item-images-slider",type:"thumbs","auto-height":true,showControls:this.comment.images.length>1?true:false,"show-thumbs-controls":"false"},h("div",{key:"21e593664598eab16e56990c43aba10dcc526752",slot:"items"},this.comment.images.map((function(t,i){return h("img",{key:i,src:t,alt:""})}))),h("div",{key:"8998e861f37fc30c488d60b016c68db0b09483ee",slot:"thumbs"},this.comment.images.map((function(t,i){return h("div",{class:"s-comments-item-images-slider-thumb"},h("img",{key:i,src:t,alt:""}))})))))),this.allowLikes&&!s&&salla.url.is_page("product.single")?h("salla-button",{ref:function(i){return t.likeBtn=i},class:"s-comments-item-like-btn ".concat(this.likedComments.includes(this.comment.id)?"liked":""),loaderPosition:"center",fill:"outline",size:"small",onClick:function(){return t.toggleLike()}},h("span",null,this.helpfulLabel," ",this.likesCount>0?"(".concat(this.likesCount,")"):""),h("span",{innerHTML:ThumbsUp})):"",this.comment.is_pending?h("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),!!this.getReplies().length&&!s?this.getReplies().map((function(t){return h("div",null,h("salla-comment-item",{comment:t}))})):null))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaCommentItem.style=sallaCommentsCss$1;var CommentType;(function(t){t["PAGE"]="page";t["PRODUCT"]="product";t["BLOG"]="blog"})(CommentType||(CommentType={}));var ChatBubbles='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>chat-bubbles</title>\n<path d="M15.333 17.333c4.779 0 8.667-3.888 8.667-8.667s-3.888-8.667-8.667-8.667h-6.667c-4.779 0-8.667 3.888-8.667 8.667 0 2.985 1.513 5.712 4 7.297v4.703c0 0.497 0.277 0.953 0.717 1.183 0.195 0.1 0.405 0.151 0.616 0.151 0.269 0 0.536-0.081 0.764-0.241l6.323-4.425zM11.236 14.908l-4.569 3.199v-2.913c0-0.5-0.28-0.959-0.725-1.187-2.020-1.035-3.275-3.080-3.275-5.34 0-3.308 2.692-6 6-6h6.667c3.308 0 6 2.692 6 6s-2.692 6-6 6h-3.333c-0.273 0-0.54 0.084-0.764 0.241zM29.196 12.964c-0.543-0.5-1.388-0.464-1.884 0.077-0.5 0.541-0.465 1.385 0.077 1.884 1.253 1.156 1.944 2.72 1.944 4.408 0 2.26-1.255 4.305-3.275 5.339-0.445 0.228-0.725 0.687-0.725 1.188v2.572l-5.441-2.939c-0.195-0.104-0.412-0.16-0.633-0.16h-2.592c-1.688 0-3.309-0.724-4.451-1.988-0.492-0.545-1.335-0.591-1.883-0.096-0.547 0.493-0.589 1.336-0.096 1.883 1.644 1.823 3.988 2.868 6.429 2.868h2.255l7.111 3.84c0.199 0.107 0.417 0.16 0.635 0.16 0.236 0 0.472-0.063 0.683-0.188 0.404-0.241 0.651-0.676 0.651-1.145v-4.036c2.487-1.585 4-4.311 4-7.297 0-2.407-1.023-4.727-2.804-6.369z"></path>\n</svg>\n';var sallaCommentsCss=":host{display:block}";var SallaComments=function(){function t(t){var i=this;registerInstance(this,t);this.type=CommentType.PAGE;this.showFormAvatar=false;this.hideBought=false;this.testimonials=false;this.noComments=salla.lang.get("blocks.comments.no_comments");this.comment_title=salla.lang.get("blocks.comments.title");this.comment_name=salla.lang.get("blocks.comments.comment");this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary");this.allowLikes=salla.config.get("store.settings.rating.allow_likes");salla.onReady((function(){i.allowLikes=salla.config.get("store.settings.rating.allow_likes");i.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")}));salla.lang.onLoaded((function(){i.comment_title=salla.lang.get("blocks.comments.title");i.comment_name=salla.lang.get("blocks.comments.comment");i.noComments=salla.lang.get("pages.rating.no_ratings");var t=function(t,i,e){return new Promise((function(n){salla.helpers.setNested(salla.lang.messages[t],i,e);n(true)}))};var e=function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return[4,t("ar.trans","blocks.comments.most_helpful","الأكثر إفادة")];case 1:i.sent();return[4,t("en.trans","blocks.comments.most_helpful","Most helpful")];case 2:i.sent();this.mostHelpfulLabel=salla.lang.get("blocks.comments.most_helpful");this.comment_title=salla.lang.get("blocks.comments.title");this.comment_name=salla.lang.get("blocks.comments.comment");this.noComments=salla.lang.get("pages.rating.no_ratings");return[2]}}))}))};e()}))}t.prototype.pluralize=function(t,i){var e=t.split("|");var n=[{condition:i===0,index:0},{condition:i===1,index:1},{condition:i===2,index:2},{condition:i>2&&i<=10,index:3},{condition:i>=11,index:4}];var a=(n.find((function(t){var i=t.condition;return i}))||{index:e.length-1}).index;var r=e[a];return r.replace(":count",salla.helpers.number(i.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")};t.prototype.wrapConsoleError=function(){if(Salla.infiniteScroll.errorWrapped){return}(function(){var t=console.error.bind(console);console.error=function(){var i=[];for(var e=0;e<arguments.length;e++){i[e]=arguments[e]}var n=i[0];if(typeof n==="string"&&n.toLowerCase().replace(/\s/g,"").includes("infinitescroll")){return console.log.apply(console,i)}return t.apply(void 0,i)}})();Salla.infiniteScroll.errorWrapped=true};t.prototype.initiateInfiniteScroll=function(){var t=this;var i,e,n;if(!this.wrapper){console.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.wrapConsoleError();this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return t.nextPage},history:false,nextPage:this.nextPage,scrollThreshold:false},true);(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("request",(function(i){t.loading()}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(i){t.pagination=i.pagination;t.nextPage=typeof i.pagination.links==="object"&&!!i.pagination.links.next?i.pagination.links.next:null;for(var e=0,n=t.handleResponse(i);e<n.length;e++){var a=n[e];t.wrapper.append(a)}var r=t.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");t.animateItems(r);t.loading(false)}));(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("error",(function(t){salla.console.error("Error loading more comments:",t)}))};t.prototype.loading=function(t){if(t===void 0){t=true}var i;var e=(i=this.status)===null||i===void 0?void 0:i.querySelector(".s-button-text");if(e){Helper.toggleElementClassIf(e,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.animateItems=function(t){anime({targets:t,opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,i){return i*100},easing:"easeOutExpo",complete:function(i){for(var e=0,n=t;e<n.length;e++){var a=n[e];a.classList.add("animated")}}})};t.prototype.reload=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){this.showPlaceholder=false;if(this.wrapper){this.wrapper.innerHTML="";t=document.createElement("salla-loading");this.wrapper.append(t)}this.nextPage=null;this.loadInitialData();return[2]}))}))};t.prototype.getCommentHTML=function(t){var i=document.createElement("salla-comment-item");i.comment=t;i.hideBought=this.hideBought;return i};t.prototype.handleResponse=function(t){var i=this;var e;return((e=t.data)===null||e===void 0?void 0:e.map((function(t){return i.getCommentHTML(t)})))||[]};t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){t.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})).then((function(){return t.loading()})).then((function(){t.hideTitle=t.hideTitle||t.testimonials;t.hideForm=t.hideForm||t.testimonials;return t.loadInitialData()}))};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n;var a=this;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,5,,6]);t={data:[],pagination:{}};i=new URLSearchParams(window.location.search);if(i.has("sort")){this.sort=i.get("sort")}if(!this.testimonials)return[3,2];e={sort:this.sort,type:"store"};return[4,salla.api.request("reviews",{params:e},"get")];case 1:t=r.sent();return[3,4];case 2:return[4,salla.api.comment.getComments(this.type,this.itemId)];case 3:t=r.sent();r.label=4;case 4:if(!t.data||!t.data.length){this.showPlaceholder=false;this.loading(false);return[2]}if(this.wrapper){this.wrapper.innerHTML=""}this.comments=t.data;this.pagination=t.pagination;this.total=t.pagination.total;this.nextPage=typeof t.pagination.links==="object"&&!!t.pagination.links.next?t.pagination.links.next:null;setTimeout((function(){for(var i=0,e=a.handleResponse(t);i<e.length;i++){var n=e[i];a.wrapper.append(n)}a.initiateInfiniteScroll();var r=a.wrapper.querySelectorAll("salla-comment-item:not(.animated)");a.animateItems(r)}),100);return[3,6];case 5:n=r.sent();console.error("Error loading initial data:",n);this.showPlaceholder=true;this.loading(false);return[3,6];case 6:return[2]}}))}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage();return[2]}))}))};t.prototype.render=function(){var t=this;if(this.showPlaceholder){return h("div",null,!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&!this.testimonials?h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}):"",h("div",{class:"s-comments-placeholder"},h("span",{innerHTML:ChatBubbles}),h("p",null,this.noComments)))}return h("div",{class:"s-comments s-comments-".concat(this.testimonials?"testimonials":this.type)},h("div",{class:"".concat(this.type===CommentType.PAGE?"s-comments-page-container":"s-comments-container")},!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),salla.url.is_page("product.single")?h("salla-reviews-summary",{itemId:this.itemId}):"",h("div",{class:"s-comments-header ".concat(this.total?"has-total":"")},!!this.total&&h("span",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),!!this.total&&!this.testimonials&&this.type!==CommentType.BLOG?h("div",{class:"s-comments-filter-wrapper"},h("label",{class:"s-comments-filter-label",htmlFor:"comments-filter"},salla.lang.get("pages.categories.sorting")),h("select",{id:"comments-filter",class:"s-form-control s-comments-sort-input",onChange:function(i){t.sort=i.target.value;t.reload()}},h("option",{value:"latest",selected:true},salla.lang.get("pages.testimonials.sort_by_date_desc")),h("option",{value:"oldest"},salla.lang.get("pages.testimonials.sort_by_date_asc")),this.allowLikes&&h("option",{value:"most_helpful"},this.mostHelpfulLabel))):""),h("div",{ref:function(i){t.wrapper=i}}),this.nextPage&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(i){t.status=i}},h("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary",type:"button"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(i){t.btnLoader=i},style:{display:"none"}})))))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaComments.style=sallaCommentsCss;var sallaCountDownCss="";var SallaCountDown=function(){function t(t){var i=this;registerInstance(this,t);this.size="md";this.color="dark";this.digits="auto";this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض");this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");this.offerEnded=false;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);salla.lang.onLoaded((function(){i.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");i.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");i.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");i.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");i.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");i.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")}));if(this.date&&this.isValidDate(this.date)){this.startCountDown()}}t.prototype.endCountDown=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){clearInterval(this.countInterval);this.offerEnded=true;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);return[2]}))}))};t.prototype.componentWillLoad=function(){var t;if(typeof this.preOrder==="string"){try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch(t){this.normalizedPreOrder=undefined}}else{this.normalizedPreOrder=this.preOrder}if((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.end_date){this.date=this.normalizedPreOrder.end_date;if(this.date&&this.isValidDate(this.date)){this.startCountDown()}}};t.prototype.isValidDate=function(t){var i=t.includes("-"),e=t.split(" "),n;if(i){n=e[0].replace(/-/g,"/")}else{n=e[0]}return!isNaN(Date.parse(n))};t.prototype.number=function(t){return salla.helpers.number(t,this.digits==="en")};t.prototype.startCountDown=function(){var t=this;var i=new Date(this.date.replace(/-/g,"/"));if(this.endOfDay||this.date.split(" ").length===1){i.setHours(23,59,59,999)}var e=i.getTime();this.countInterval=setInterval((function(){var i=(new Date).getTime();var n=e-i;t.days=t.number(Math.floor(n/(1e3*60*60*24)));t.hours=t.number(Math.floor(n%(1e3*60*60*24)/(1e3*60*60)));t.minutes=t.number(Math.floor(n%(1e3*60*60)/(1e3*60)));t.seconds=t.number(Math.floor(n%(1e3*60)/1e3));if(n<0){t.endCountDown()}}),1e3)};t.prototype.renderCountDown=function(){return h("ul",{class:"s-count-down-list ".concat(this.boxed?"s-count-down-boxed":""," ").concat(this.offerEnded?"s-count-down-ended":""," s-count-down-").concat(this.size," s-count-down-").concat(this.color)},h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&h("div",{class:"s-count-down-item-label"},this.secondsLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&h("div",{class:"s-count-down-item-label"},this.minutesLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&h("div",{class:"s-count-down-item-label"},this.hoursLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.days),this.labeled&&h("div",{class:"s-count-down-item-label"},this.daysLabel)))};t.prototype.renderInvalidDate=function(){return h("div",{class:"s-count-down-text-center"},this.invalidDate)};t.prototype.renderOfferEnded=function(){return h("div",{class:"s-count-down-end-text"},!!this.endText?this.endText:this.endLabel)};t.prototype.renderPreOrderToBeAvailableOn=function(){var t,i,e;if(!((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.availability_date)||!this.isValidDate((i=this.normalizedPreOrder)===null||i===void 0?void 0:i.availability_date))return null;return h("div",{class:"s-count-down-info-message"},h("i",{class:"sicon-info"}),h("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),h("span",null,new Date((e=this.normalizedPreOrder)===null||e===void 0?void 0:e.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"})))};t.prototype.renderPreOrderCountDown=function(){var t;if(!((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.activate_countdown))return null;return h("div",{class:"s-count-down-pre-order-container"},h("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown())};t.prototype.renderPreOrder=function(){var t;return h("div",null,typeof this.normalizedPreOrder==="object"&&((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.availability_date)&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())};t.prototype.renderContent=function(){if(!this.date)return null;if(!this.isValidDate(this.date)){return this.renderInvalidDate()}if(this.preOrder){return this.renderPreOrder()}return this.renderCountDown()};t.prototype.render=function(){return h(Host,{key:"1e6baaf061a5cee7aeed3af6f4f02a7edf654885",class:"s-count-down-wrapper ".concat(this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":"")},this.renderContent(),this.offerEnded&&this.renderOfferEnded())};return t}();SallaCountDown.style=sallaCountDownCss;var HOOKS=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"];var defaults={_disable:[],allowInput:false,allowInvalidPreload:false,altFormat:"F j, Y",altInput:false,altInputClass:"form-control input",animate:typeof window==="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:true,clickOpens:true,closeOnSelect:true,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:false,enableSeconds:false,enableTime:false,errorHandler:function(t){return typeof console!=="undefined"&&console.warn(t)},getWeek:function(t){var i=new Date(t.getTime());i.setHours(0,0,0,0);i.setDate(i.getDate()+3-(i.getDay()+6)%7);var e=new Date(i.getFullYear(),0,4);return 1+Math.round(((i.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:false,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:false,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:undefined,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:false,showMonths:1,static:false,time_24hr:false,weekNumbers:false,wrap:false};var english={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var i=t%100;if(i>3&&i<21)return"th";switch(i%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:false};var pad=function(t,i){if(i===void 0){i=2}return("000"+t).slice(i*-1)};var int=function(t){return t===true?1:0};function debounce(t,i){var e;return function(){var n=this;var a=arguments;clearTimeout(e);e=setTimeout((function(){return t.apply(n,a)}),i)}}var arrayify=function(t){return t instanceof Array?t:[t]};function toggleClass(t,i,e){if(e===true)return t.classList.add(i);t.classList.remove(i)}function createElement(t,i,e){var n=window.document.createElement(t);i=i||"";e=e||"";n.className=i;if(e!==undefined)n.textContent=e;return n}function clearNode(t){while(t.firstChild)t.removeChild(t.firstChild)}function findParent(t,i){if(i(t))return t;else if(t.parentNode)return findParent(t.parentNode,i);return undefined}function createNumberInput(t,i){var e=createElement("div","numInputWrapper"),n=createElement("input","numInput "+t),a=createElement("span","arrowUp"),r=createElement("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1){n.type="number"}else{n.type="text";n.pattern="\\d*"}if(i!==undefined)for(var o in i)n.setAttribute(o,i[o]);e.appendChild(n);e.appendChild(a);e.appendChild(r);return e}function getEventTarget(t){try{if(typeof t.composedPath==="function"){var i=t.composedPath();return i[0]}return t.target}catch(i){return t.target}}var doNothing=function(){return undefined};var monthToStr=function(t,i,e){return e.months[i?"shorthand":"longhand"][t]};var revFormat={D:doNothing,F:function(t,i,e){t.setMonth(e.months.longhand.indexOf(i))},G:function(t,i){t.setHours((t.getHours()>=12?12:0)+parseFloat(i))},H:function(t,i){t.setHours(parseFloat(i))},J:function(t,i){t.setDate(parseFloat(i))},K:function(t,i,e){t.setHours(t.getHours()%12+12*int(new RegExp(e.amPM[1],"i").test(i)))},M:function(t,i,e){t.setMonth(e.months.shorthand.indexOf(i))},S:function(t,i){t.setSeconds(parseFloat(i))},U:function(t,i){return new Date(parseFloat(i)*1e3)},W:function(t,i,e){var n=parseInt(i);var a=new Date(t.getFullYear(),0,2+(n-1)*7,0,0,0,0);a.setDate(a.getDate()-a.getDay()+e.firstDayOfWeek);return a},Y:function(t,i){t.setFullYear(parseFloat(i))},Z:function(t,i){return new Date(i)},d:function(t,i){t.setDate(parseFloat(i))},h:function(t,i){t.setHours((t.getHours()>=12?12:0)+parseFloat(i))},i:function(t,i){t.setMinutes(parseFloat(i))},j:function(t,i){t.setDate(parseFloat(i))},l:doNothing,m:function(t,i){t.setMonth(parseFloat(i)-1)},n:function(t,i){t.setMonth(parseFloat(i)-1)},s:function(t,i){t.setSeconds(parseFloat(i))},u:function(t,i){return new Date(parseFloat(i))},w:doNothing,y:function(t,i){t.setFullYear(2e3+parseFloat(i))}};var tokenRegex={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"};var formats={Z:function(t){return t.toISOString()},D:function(t,i,e){return i.weekdays.shorthand[formats.w(t,i,e)]},F:function(t,i,e){return monthToStr(formats.n(t,i,e)-1,false,i)},G:function(t,i,e){return pad(formats.h(t,i,e))},H:function(t){return pad(t.getHours())},J:function(t,i){return i.ordinal!==undefined?t.getDate()+i.ordinal(t.getDate()):t.getDate()},K:function(t,i){return i.amPM[int(t.getHours()>11)]},M:function(t,i){return monthToStr(t.getMonth(),true,i)},S:function(t){return pad(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,i,e){return e.getWeek(t)},Y:function(t){return pad(t.getFullYear(),4)},d:function(t){return pad(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return pad(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,i){return i.weekdays.longhand[t.getDay()]},m:function(t){return pad(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}};var createDateFormatter=function(t){var i=t.config,e=i===void 0?defaults:i,n=t.l10n,a=n===void 0?english:n,r=t.isMobile,o=r===void 0?false:r;return function(t,i,n){var r=n||a;if(e.formatDate!==undefined&&!o){return e.formatDate(t,i,r)}return i.split("").map((function(i,n,a){return formats[i]&&a[n-1]!=="\\"?formats[i](t,r,e):i!=="\\"?i:""})).join("")}};var createDateParser=function(t){var i=t.config,e=i===void 0?defaults:i,n=t.l10n,a=n===void 0?english:n;return function(t,i,n,r){if(t!==0&&!t)return undefined;var o=r||a;var s;var l=t;if(t instanceof Date)s=new Date(t.getTime());else if(typeof t!=="string"&&t.toFixed!==undefined)s=new Date(t);else if(typeof t==="string"){var u=i||(e||defaults).dateFormat;var c=String(t).trim();if(c==="today"){s=new Date;n=true}else if(e&&e.parseDate){s=e.parseDate(t,u)}else if(/Z$/.test(c)||/GMT$/.test(c)){s=new Date(t)}else{var f=void 0,d=[];for(var h=0,p=0,v="";h<u.length;h++){var g=u[h];var _=g==="\\";var m=u[h-1]==="\\"||_;if(tokenRegex[g]&&!m){v+=tokenRegex[g];var b=new RegExp(v).exec(t);if(b&&(f=true)){d[g!=="Y"?"push":"unshift"]({fn:revFormat[g],val:b[++p]})}}else if(!_)v+="."}s=!e||!e.noCalendar?new Date((new Date).getFullYear(),0,1,0,0,0,0):new Date((new Date).setHours(0,0,0,0));d.forEach((function(t){var i=t.fn,e=t.val;return s=i(s,e,o)||s}));s=f?s:undefined}}if(!(s instanceof Date&&!isNaN(s.getTime()))){e.errorHandler(new Error("Invalid date provided: "+l));return undefined}if(n===true)s.setHours(0,0,0,0);return s}};function compareDates(t,i,e){if(e===void 0){e=true}if(e!==false){return new Date(t.getTime()).setHours(0,0,0,0)-new Date(i.getTime()).setHours(0,0,0,0)}return t.getTime()-i.getTime()}var isBetween=function(t,i,e){return t>Math.min(i,e)&&t<Math.max(i,e)};var calculateSecondsSinceMidnight=function(t,i,e){return t*3600+i*60+e};var parseSeconds=function(t){var i=Math.floor(t/3600),e=(t-i*3600)/60;return[i,e,t-i*3600-e*60]};var duration={DAY:864e5};function getDefaultHours(t){var i=t.defaultHour;var e=t.defaultMinute;var n=t.defaultSeconds;if(t.minDate!==undefined){var a=t.minDate.getHours();var r=t.minDate.getMinutes();var o=t.minDate.getSeconds();if(i<a){i=a}if(i===a&&e<r){e=r}if(i===a&&e===r&&n<o)n=t.minDate.getSeconds()}if(t.maxDate!==undefined){var s=t.maxDate.getHours();var l=t.maxDate.getMinutes();i=Math.min(i,s);if(i===s)e=Math.min(l,e);if(i===s&&e===l)n=t.maxDate.getSeconds()}return{hours:i,minutes:e,seconds:n}}if(typeof Object.assign!=="function"){Object.assign=function(t){var i=[];for(var e=1;e<arguments.length;e++){i[e-1]=arguments[e]}if(!t){throw TypeError("Cannot convert undefined or null to object")}var n=function(i){if(i){Object.keys(i).forEach((function(e){return t[e]=i[e]}))}};for(var a=0,r=i;a<r.length;a++){var o=r[a];n(o)}return t}}var __assign=undefined&&undefined.__assign||function(){__assign=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++){i=arguments[e];for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a))t[a]=i[a]}return t};return __assign.apply(this,arguments)};var __spreadArrays=undefined&&undefined.__spreadArrays||function(){for(var t=0,i=0,e=arguments.length;i<e;i++)t+=arguments[i].length;for(var n=Array(t),a=0,i=0;i<e;i++)for(var r=arguments[i],o=0,s=r.length;o<s;o++,a++)n[a]=r[o];return n};var DEBOUNCED_CHANGE_MS=300;function FlatpickrInstance(t,i){var e={config:__assign(__assign({},defaults),flatpickr.defaultConfig),l10n:english};e.parseDate=createDateParser({config:e.config,l10n:e.l10n});e._handlers=[];e.pluginElements=[];e.loadedPlugins=[];e._bind=v;e._setHoursFromDate=d;e._positionCalendar=it;e.changeMonth=G;e.changeYear=U;e.clear=F;e.close=N;e.onMouseOver=Z;e._createElement=createElement;e.createDay=y;e.destroy=B;e.isEnabled=V;e.jumpToDate=m;e.updateValue=kt;e.open=Q;e.redraw=at;e.set=lt;e.setDate=ct;e.toggle=gt;function n(){e.utils={getDaysInMonth:function(t,i){if(t===void 0){t=e.currentMonth}if(i===void 0){i=e.currentYear}if(t===1&&(i%4===0&&i%100!==0||i%400===0))return 29;return e.l10n.daysInMonth[t]}}}function a(){e.element=e.input=t;e.isOpen=false;J();tt();ht();dt();n();if(!e.isMobile)x();_();if(e.selectedDates.length||e.config.noCalendar){if(e.config.enableTime){d(e.config.noCalendar?e.latestSelectedDateObj:undefined)}kt(false)}s();var i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);if(!e.isMobile&&i){it()}_t("onReady")}function r(){var t;return((t=e.calendarContainer)===null||t===void 0?void 0:t.getRootNode()).activeElement||document.activeElement}function o(t){return t.bind(e)}function s(){var t=e.config;if(t.weekNumbers===false&&t.showMonths===1){return}else if(t.noCalendar!==true){window.requestAnimationFrame((function(){if(e.calendarContainer!==undefined){e.calendarContainer.style.visibility="hidden";e.calendarContainer.style.display="block"}if(e.daysContainer!==undefined){var i=(e.days.offsetWidth+1)*t.showMonths;e.daysContainer.style.width=i+"px";e.calendarContainer.style.width=i+(e.weekWrapper!==undefined?e.weekWrapper.offsetWidth:0)+"px";e.calendarContainer.style.removeProperty("visibility");e.calendarContainer.style.removeProperty("display")}}))}}function l(t){if(e.selectedDates.length===0){var i=e.config.minDate===undefined||compareDates(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime());var n=getDefaultHours(e.config);i.setHours(n.hours,n.minutes,n.seconds,i.getMilliseconds());e.selectedDates=[i];e.latestSelectedDateObj=i}if(t!==undefined&&t.type!=="blur"){It(t)}var a=e._input.value;f();kt();if(e._input.value!==a){e._debouncedChange()}}function u(t,i){return t%12+12*int(i===e.l10n.amPM[1])}function c(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}function f(){if(e.hourElement===undefined||e.minuteElement===undefined)return;var t=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(e.minuteElement.value,10)||0)%60,n=e.secondElement!==undefined?(parseInt(e.secondElement.value,10)||0)%60:0;if(e.amPM!==undefined){t=u(t,e.amPM.textContent)}var a=e.config.minTime!==undefined||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&compareDates(e.latestSelectedDateObj,e.config.minDate,true)===0;var r=e.config.maxTime!==undefined||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&compareDates(e.latestSelectedDateObj,e.config.maxDate,true)===0;if(e.config.maxTime!==undefined&&e.config.minTime!==undefined&&e.config.minTime>e.config.maxTime){var o=calculateSecondsSinceMidnight(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds());var s=calculateSecondsSinceMidnight(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds());var l=calculateSecondsSinceMidnight(t,i,n);if(l>s&&l<o){var c=parseSeconds(o);t=c[0];i=c[1];n=c[2]}}else{if(r){var f=e.config.maxTime!==undefined?e.config.maxTime:e.config.maxDate;t=Math.min(t,f.getHours());if(t===f.getHours())i=Math.min(i,f.getMinutes());if(i===f.getMinutes())n=Math.min(n,f.getSeconds())}if(a){var d=e.config.minTime!==undefined?e.config.minTime:e.config.minDate;t=Math.max(t,d.getHours());if(t===d.getHours()&&i<d.getMinutes())i=d.getMinutes();if(i===d.getMinutes())n=Math.max(n,d.getSeconds())}}h(t,i,n)}function d(t){var i=t||e.latestSelectedDateObj;if(i&&i instanceof Date){h(i.getHours(),i.getMinutes(),i.getSeconds())}}function h(t,i,n){if(e.latestSelectedDateObj!==undefined){e.latestSelectedDateObj.setHours(t%24,i,n||0,0)}if(!e.hourElement||!e.minuteElement||e.isMobile)return;e.hourElement.value=pad(!e.config.time_24hr?(12+t)%12+12*int(t%12===0):t);e.minuteElement.value=pad(i);if(e.amPM!==undefined)e.amPM.textContent=e.l10n.amPM[int(t>=12)];if(e.secondElement!==undefined)e.secondElement.value=pad(n)}function p(t){var i=getEventTarget(t);var e=parseInt(i.value)+(t.delta||0);if(e/1e3>1||t.key==="Enter"&&!/[^\d]/.test(e.toString())){U(e)}}function v(t,i,n,a){if(i instanceof Array)return i.forEach((function(i){return v(t,i,n,a)}));if(t instanceof Array)return t.forEach((function(t){return v(t,i,n,a)}));t.addEventListener(i,n,a);e._handlers.push({remove:function(){return t.removeEventListener(i,n,a)}})}function g(){_t("onChange")}function _(){if(e.config.wrap){["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+t+"]"),(function(i){return v(i,"click",e[t])}))}))}if(e.isMobile){vt();return}var t=debounce(X,50);e._debouncedChange=debounce(g,DEBOUNCED_CHANGE_MS);if(e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent))v(e.daysContainer,"mouseover",(function(t){if(e.config.mode==="range")Z(getEventTarget(t))}));v(e._input,"keydown",Y);if(e.calendarContainer!==undefined){v(e.calendarContainer,"keydown",Y)}if(!e.config.inline&&!e.config.static)v(window,"resize",t);if(window.ontouchstart!==undefined)v(window.document,"touchstart",H);else v(window.document,"mousedown",H);v(window.document,"focus",H,{capture:true});if(e.config.clickOpens===true){v(e._input,"focus",e.open);v(e._input,"click",e.open)}if(e.daysContainer!==undefined){v(e.monthNav,"click",Et);v(e.monthNav,["keyup","increment"],p);v(e.daysContainer,"click",ot)}if(e.timeContainer!==undefined&&e.minuteElement!==undefined&&e.hourElement!==undefined){var i=function(t){return getEventTarget(t).select()};v(e.timeContainer,["increment"],l);v(e.timeContainer,"blur",l,{capture:true});v(e.timeContainer,"click",b);v([e.hourElement,e.minuteElement],["focus","click"],i);if(e.secondElement!==undefined)v(e.secondElement,"focus",(function(){return e.secondElement&&e.secondElement.select()}));if(e.amPM!==undefined){v(e.amPM,"click",(function(t){l(t)}))}}if(e.config.allowInput){v(e._input,"blur",W)}}function m(t,i){var n=t!==undefined?e.parseDate(t):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now);var a=e.currentYear;var r=e.currentMonth;try{if(n!==undefined){e.currentYear=n.getFullYear();e.currentMonth=n.getMonth()}}catch(t){t.message="Invalid date supplied: "+n;e.config.errorHandler(t)}if(i&&e.currentYear!==a){_t("onYearChange");M()}if(i&&(e.currentYear!==a||e.currentMonth!==r)){_t("onMonthChange")}e.redraw()}function b(t){var i=getEventTarget(t);if(~i.className.indexOf("arrow"))w(t,i.classList.contains("arrowUp")?1:-1)}function w(t,i,e){var n=t&&getEventTarget(t);var a=e||n&&n.parentNode&&n.parentNode.firstChild;var r=mt("increment");r.delta=i;a&&a.dispatchEvent(r)}function x(){var t=window.document.createDocumentFragment();e.calendarContainer=createElement("div","flatpickr-calendar");e.calendarContainer.tabIndex=-1;if(!e.config.noCalendar){t.appendChild(O());e.innerContainer=createElement("div","flatpickr-innerContainer");if(e.config.weekNumbers){var i=z(),n=i.weekWrapper,a=i.weekNumbers;e.innerContainer.appendChild(n);e.weekNumbers=a;e.weekWrapper=n}e.rContainer=createElement("div","flatpickr-rContainer");e.rContainer.appendChild(C());if(!e.daysContainer){e.daysContainer=createElement("div","flatpickr-days");e.daysContainer.tabIndex=-1}S();e.rContainer.appendChild(e.daysContainer);e.innerContainer.appendChild(e.rContainer);t.appendChild(e.innerContainer)}if(e.config.enableTime){t.appendChild(R())}toggleClass(e.calendarContainer,"rangeMode",e.config.mode==="range");toggleClass(e.calendarContainer,"animate",e.config.animate===true);toggleClass(e.calendarContainer,"multiMonth",e.config.showMonths>1);e.calendarContainer.appendChild(t);var r=e.config.appendTo!==undefined&&e.config.appendTo.nodeType!==undefined;if(e.config.inline||e.config.static){e.calendarContainer.classList.add(e.config.inline?"inline":"static");if(e.config.inline){if(!r&&e.element.parentNode)e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling);else if(e.config.appendTo!==undefined)e.config.appendTo.appendChild(e.calendarContainer)}if(e.config.static){var o=createElement("div","flatpickr-wrapper");if(e.element.parentNode)e.element.parentNode.insertBefore(o,e.element);o.appendChild(e.element);if(e.altInput)o.appendChild(e.altInput);o.appendChild(e.calendarContainer)}}if(!e.config.static&&!e.config.inline)(e.config.appendTo!==undefined?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function y(t,i,n,a){var r=V(i,true),o=createElement("span",t,i.getDate().toString());o.dateObj=i;o.$i=a;o.setAttribute("aria-label",e.formatDate(i,e.config.ariaDateFormat));if(t.indexOf("hidden")===-1&&compareDates(i,e.now)===0){e.todayDateElem=o;o.classList.add("today");o.setAttribute("aria-current","date")}if(r){o.tabIndex=-1;if(bt(i)){o.classList.add("selected");e.selectedDateElem=o;if(e.config.mode==="range"){toggleClass(o,"startRange",e.selectedDates[0]&&compareDates(i,e.selectedDates[0],true)===0);toggleClass(o,"endRange",e.selectedDates[1]&&compareDates(i,e.selectedDates[1],true)===0);if(t==="nextMonthDay")o.classList.add("inRange")}}}else{o.classList.add("flatpickr-disabled")}if(e.config.mode==="range"){if(wt(i)&&!bt(i))o.classList.add("inRange")}if(e.weekNumbers&&e.config.showMonths===1&&t!=="prevMonthDay"&&a%7===6){e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(i)+"</span>")}_t("onDayCreate",o);return o}function k(t){t.focus();if(e.config.mode==="range")Z(t)}function E(t){var i=t>0?0:e.config.showMonths-1;var n=t>0?e.config.showMonths:-1;for(var a=i;a!=n;a+=t){var r=e.daysContainer.children[a];var o=t>0?0:r.children.length-1;var s=t>0?r.children.length:-1;for(var l=o;l!=s;l+=t){var u=r.children[l];if(u.className.indexOf("hidden")===-1&&V(u.dateObj))return u}}return undefined}function I(t,i){var n=t.className.indexOf("Month")===-1?t.dateObj.getMonth():e.currentMonth;var a=i>0?e.config.showMonths:-1;var r=i>0?1:-1;for(var o=n-e.currentMonth;o!=a;o+=r){var s=e.daysContainer.children[o];var l=n-e.currentMonth===o?t.$i+i:i<0?s.children.length-1:0;var u=s.children.length;for(var c=l;c>=0&&c<u&&c!=(i>0?u:-1);c+=r){var f=s.children[c];if(f.className.indexOf("hidden")===-1&&V(f.dateObj)&&Math.abs(t.$i-c)>=Math.abs(i))return k(f)}}e.changeMonth(r);T(E(r),0);return undefined}function T(t,i){var n=r();var a=q(n||document.body);var o=t!==undefined?t:a?n:e.selectedDateElem!==undefined&&q(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==undefined&&q(e.todayDateElem)?e.todayDateElem:E(i>0?1:-1);if(o===undefined){e._input.focus()}else if(!a){k(o)}else{I(o,i)}}function A(t,i){var n=(new Date(t,i,1).getDay()-e.l10n.firstDayOfWeek+7)%7;var a=e.utils.getDaysInMonth((i-1+12)%12,t);var r=e.utils.getDaysInMonth(i,t),o=window.document.createDocumentFragment(),s=e.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",u=s?"nextMonthDay hidden":"nextMonthDay";var c=a+1-n,f=0;for(;c<=a;c++,f++){o.appendChild(y("flatpickr-day "+l,new Date(t,i-1,c),c,f))}for(c=1;c<=r;c++,f++){o.appendChild(y("flatpickr-day",new Date(t,i,c),c,f))}for(var d=r+1;d<=42-n&&(e.config.showMonths===1||f%7!==0);d++,f++){o.appendChild(y("flatpickr-day "+u,new Date(t,i+1,d%r),d,f))}var h=createElement("div","dayContainer");h.appendChild(o);return h}function S(){if(e.daysContainer===undefined){return}clearNode(e.daysContainer);if(e.weekNumbers)clearNode(e.weekNumbers);var t=document.createDocumentFragment();for(var i=0;i<e.config.showMonths;i++){var n=new Date(e.currentYear,e.currentMonth,1);n.setMonth(e.currentMonth+i);t.appendChild(A(n.getFullYear(),n.getMonth()))}e.daysContainer.appendChild(t);e.days=e.daysContainer.firstChild;if(e.config.mode==="range"&&e.selectedDates.length===1){Z()}}function M(){if(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")return;var t=function(t){if(e.config.minDate!==undefined&&e.currentYear===e.config.minDate.getFullYear()&&t<e.config.minDate.getMonth()){return false}return!(e.config.maxDate!==undefined&&e.currentYear===e.config.maxDate.getFullYear()&&t>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1;e.monthsDropdownContainer.innerHTML="";for(var i=0;i<12;i++){if(!t(i))continue;var n=createElement("option","flatpickr-monthDropdown-month");n.value=new Date(e.currentYear,i).getMonth().toString();n.textContent=monthToStr(i,e.config.shorthandCurrentMonth,e.l10n);n.tabIndex=-1;if(e.currentMonth===i){n.selected=true}e.monthsDropdownContainer.appendChild(n)}}function D(){var t=createElement("div","flatpickr-month");var i=window.document.createDocumentFragment();var n;if(e.config.showMonths>1||e.config.monthSelectorType==="static"){n=createElement("span","cur-month")}else{e.monthsDropdownContainer=createElement("select","flatpickr-monthDropdown-months");e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel);v(e.monthsDropdownContainer,"change",(function(t){var i=getEventTarget(t);var n=parseInt(i.value,10);e.changeMonth(n-e.currentMonth);_t("onMonthChange")}));M();n=e.monthsDropdownContainer}var a=createNumberInput("cur-year",{tabindex:"-1"});var r=a.getElementsByTagName("input")[0];r.setAttribute("aria-label",e.l10n.yearAriaLabel);if(e.config.minDate){r.setAttribute("min",e.config.minDate.getFullYear().toString())}if(e.config.maxDate){r.setAttribute("max",e.config.maxDate.getFullYear().toString());r.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear()}var o=createElement("div","flatpickr-current-month");o.appendChild(n);o.appendChild(a);i.appendChild(o);t.appendChild(i);return{container:t,yearElement:r,monthElement:n}}function P(){clearNode(e.monthNav);e.monthNav.appendChild(e.prevMonthNav);if(e.config.showMonths){e.yearElements=[];e.monthElements=[]}for(var t=e.config.showMonths;t--;){var i=D();e.yearElements.push(i.yearElement);e.monthElements.push(i.monthElement);e.monthNav.appendChild(i.container)}e.monthNav.appendChild(e.nextMonthNav)}function O(){e.monthNav=createElement("div","flatpickr-months");e.yearElements=[];e.monthElements=[];e.prevMonthNav=createElement("span","flatpickr-prev-month");e.prevMonthNav.innerHTML=e.config.prevArrow;e.nextMonthNav=createElement("span","flatpickr-next-month");e.nextMonthNav.innerHTML=e.config.nextArrow;P();Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(t){if(e.__hidePrevMonthArrow!==t){toggleClass(e.prevMonthNav,"flatpickr-disabled",t);e.__hidePrevMonthArrow=t}}});Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(t){if(e.__hideNextMonthArrow!==t){toggleClass(e.nextMonthNav,"flatpickr-disabled",t);e.__hideNextMonthArrow=t}}});e.currentYearElement=e.yearElements[0];xt();return e.monthNav}function R(){e.calendarContainer.classList.add("hasTime");if(e.config.noCalendar)e.calendarContainer.classList.add("noCalendar");var t=getDefaultHours(e.config);e.timeContainer=createElement("div","flatpickr-time");e.timeContainer.tabIndex=-1;var i=createElement("span","flatpickr-time-separator",":");var n=createNumberInput("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=n.getElementsByTagName("input")[0];var a=createNumberInput("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});e.minuteElement=a.getElementsByTagName("input")[0];e.hourElement.tabIndex=e.minuteElement.tabIndex=-1;e.hourElement.value=pad(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?t.hours:c(t.hours));e.minuteElement.value=pad(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():t.minutes);e.hourElement.setAttribute("step",e.config.hourIncrement.toString());e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString());e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1");e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12");e.hourElement.setAttribute("maxlength","2");e.minuteElement.setAttribute("min","0");e.minuteElement.setAttribute("max","59");e.minuteElement.setAttribute("maxlength","2");e.timeContainer.appendChild(n);e.timeContainer.appendChild(i);e.timeContainer.appendChild(a);if(e.config.time_24hr)e.timeContainer.classList.add("time24hr");if(e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var r=createNumberInput("flatpickr-second");e.secondElement=r.getElementsByTagName("input")[0];e.secondElement.value=pad(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():t.seconds);e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step"));e.secondElement.setAttribute("min","0");e.secondElement.setAttribute("max","59");e.secondElement.setAttribute("maxlength","2");e.timeContainer.appendChild(createElement("span","flatpickr-time-separator",":"));e.timeContainer.appendChild(r)}if(!e.config.time_24hr){e.amPM=createElement("span","flatpickr-am-pm",e.l10n.amPM[int((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]);e.amPM.title=e.l10n.toggleTitle;e.amPM.tabIndex=-1;e.timeContainer.appendChild(e.amPM)}return e.timeContainer}function C(){if(!e.weekdayContainer)e.weekdayContainer=createElement("div","flatpickr-weekdays");else clearNode(e.weekdayContainer);for(var t=e.config.showMonths;t--;){var i=createElement("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(i)}L();return e.weekdayContainer}function L(){if(!e.weekdayContainer){return}var t=e.l10n.firstDayOfWeek;var i=__spreadArrays(e.l10n.weekdays.shorthand);if(t>0&&t<i.length){i=__spreadArrays(i.splice(t,i.length),i.splice(0,t))}for(var n=e.config.showMonths;n--;){e.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+i.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function z(){e.calendarContainer.classList.add("hasWeeks");var t=createElement("div","flatpickr-weekwrapper");t.appendChild(createElement("span","flatpickr-weekday",e.l10n.weekAbbreviation));var i=createElement("div","flatpickr-weeks");t.appendChild(i);return{weekWrapper:t,weekNumbers:i}}function G(t,i){if(i===void 0){i=true}var n=i?t:t-e.currentMonth;if(n<0&&e._hidePrevMonthArrow===true||n>0&&e._hideNextMonthArrow===true)return;e.currentMonth+=n;if(e.currentMonth<0||e.currentMonth>11){e.currentYear+=e.currentMonth>11?1:-1;e.currentMonth=(e.currentMonth+12)%12;_t("onYearChange");M()}S();_t("onMonthChange");xt()}function F(t,i){if(t===void 0){t=true}if(i===void 0){i=true}e.input.value="";if(e.altInput!==undefined)e.altInput.value="";if(e.mobileInput!==undefined)e.mobileInput.value="";e.selectedDates=[];e.latestSelectedDateObj=undefined;if(i===true){e.currentYear=e._initialDate.getFullYear();e.currentMonth=e._initialDate.getMonth()}if(e.config.enableTime===true){var n=getDefaultHours(e.config),a=n.hours,r=n.minutes,o=n.seconds;h(a,r,o)}e.redraw();if(t)_t("onChange")}function N(){e.isOpen=false;if(!e.isMobile){if(e.calendarContainer!==undefined){e.calendarContainer.classList.remove("open")}if(e._input!==undefined){e._input.classList.remove("active")}}_t("onClose")}function B(){if(e.config!==undefined)_t("onDestroy");for(var t=e._handlers.length;t--;){e._handlers[t].remove()}e._handlers=[];if(e.mobileInput){if(e.mobileInput.parentNode)e.mobileInput.parentNode.removeChild(e.mobileInput);e.mobileInput=undefined}else if(e.calendarContainer&&e.calendarContainer.parentNode){if(e.config.static&&e.calendarContainer.parentNode){var i=e.calendarContainer.parentNode;i.lastChild&&i.removeChild(i.lastChild);if(i.parentNode){while(i.firstChild)i.parentNode.insertBefore(i.firstChild,i);i.parentNode.removeChild(i)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer)}if(e.altInput){e.input.type="text";if(e.altInput.parentNode)e.altInput.parentNode.removeChild(e.altInput);delete e.altInput}if(e.input){e.input.type=e.input._type;e.input.classList.remove("flatpickr-input");e.input.removeAttribute("readonly")}["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete e[t]}catch(t){}}))}function j(t){return e.calendarContainer.contains(t)}function H(t){if(e.isOpen&&!e.config.inline){var i=getEventTarget(t);var n=j(i);var a=i===e.input||i===e.altInput||e.element.contains(i)||t.path&&t.path.indexOf&&(~t.path.indexOf(e.input)||~t.path.indexOf(e.altInput));var r=!a&&!n&&!j(t.relatedTarget);var o=!e.config.ignoredFocusElements.some((function(t){return t.contains(i)}));if(r&&o){if(e.config.allowInput){e.setDate(e._input.value,false,e.config.altInput?e.config.altFormat:e.config.dateFormat)}if(e.timeContainer!==undefined&&e.minuteElement!==undefined&&e.hourElement!==undefined&&e.input.value!==""&&e.input.value!==undefined){l()}e.close();if(e.config&&e.config.mode==="range"&&e.selectedDates.length===1)e.clear(false)}}}function U(t){if(!t||e.config.minDate&&t<e.config.minDate.getFullYear()||e.config.maxDate&&t>e.config.maxDate.getFullYear())return;var i=t,n=e.currentYear!==i;e.currentYear=i||e.currentYear;if(e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()){e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth)}else if(e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()){e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)}if(n){e.redraw();_t("onYearChange");M()}}function V(t,i){var n;if(i===void 0){i=true}var a=e.parseDate(t,undefined,i);if(e.config.minDate&&a&&compareDates(a,e.config.minDate,i!==undefined?i:!e.minDateHasTime)<0||e.config.maxDate&&a&&compareDates(a,e.config.maxDate,i!==undefined?i:!e.maxDateHasTime)>0)return false;if(!e.config.enable&&e.config.disable.length===0)return true;if(a===undefined)return false;var r=!!e.config.enable,o=(n=e.config.enable)!==null&&n!==void 0?n:e.config.disable;for(var s=0,l=void 0;s<o.length;s++){l=o[s];if(typeof l==="function"&&l(a))return r;else if(l instanceof Date&&a!==undefined&&l.getTime()===a.getTime())return r;else if(typeof l==="string"){var u=e.parseDate(l,undefined,true);return u&&u.getTime()===a.getTime()?r:!r}else if(typeof l==="object"&&a!==undefined&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return r}return!r}function q(t){if(e.daysContainer!==undefined)return t.className.indexOf("hidden")===-1&&t.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(t);return false}function W(t){var i=t.target===e._input;var n=e._input.value.trimEnd()!==yt();if(i&&n&&!(t.relatedTarget&&j(t.relatedTarget))){e.setDate(e._input.value,true,t.target===e.altInput?e.config.altFormat:e.config.dateFormat)}}function Y(i){var n=getEventTarget(i);var a=e.config.wrap?t.contains(n):n===e._input;var o=e.config.allowInput;var s=e.isOpen&&(!o||!a);var u=e.config.inline&&a&&!o;if(i.keyCode===13&&a){if(o){e.setDate(e._input.value,true,n===e.altInput?e.config.altFormat:e.config.dateFormat);e.close();return n.blur()}else{e.open()}}else if(j(n)||s||u){var c=!!e.timeContainer&&e.timeContainer.contains(n);switch(i.keyCode){case 13:if(c){i.preventDefault();l();rt()}else ot(i);break;case 27:i.preventDefault();rt();break;case 8:case 46:if(a&&!e.config.allowInput){i.preventDefault();e.clear()}break;case 37:case 39:if(!c&&!a){i.preventDefault();var d=r();if(e.daysContainer!==undefined&&(o===false||d&&q(d))){var h=i.keyCode===39?1:-1;if(!i.ctrlKey)T(undefined,h);else{i.stopPropagation();G(h);T(E(1),0)}}}else if(e.hourElement)e.hourElement.focus();break;case 38:case 40:i.preventDefault();var p=i.keyCode===40?1:-1;if(e.daysContainer&&n.$i!==undefined||n===e.input||n===e.altInput){if(i.ctrlKey){i.stopPropagation();U(e.currentYear-p);T(E(1),0)}else if(!c)T(undefined,p*7)}else if(n===e.currentYearElement){U(e.currentYear-p)}else if(e.config.enableTime){if(!c&&e.hourElement)e.hourElement.focus();l(i);e._debouncedChange()}break;case 9:if(c){var v=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter((function(t){return t}));var g=v.indexOf(n);if(g!==-1){var _=v[g+(i.shiftKey?-1:1)];i.preventDefault();(_||e._input).focus()}}else if(!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(n)&&i.shiftKey){i.preventDefault();e._input.focus()}break}}if(e.amPM!==undefined&&n===e.amPM){switch(i.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0];f();kt();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1];f();kt();break}}if(a||j(n)){_t("onKeyDown",i)}}function Z(t,i){if(i===void 0){i="flatpickr-day"}if(e.selectedDates.length!==1||t&&(!t.classList.contains(i)||t.classList.contains("flatpickr-disabled")))return;var n=t?t.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),a=e.parseDate(e.selectedDates[0],undefined,true).getTime(),r=Math.min(n,e.selectedDates[0].getTime()),o=Math.max(n,e.selectedDates[0].getTime());var s=false;var l=0,u=0;for(var c=r;c<o;c+=duration.DAY){if(!V(new Date(c),true)){s=s||c>r&&c<o;if(c<a&&(!l||c>l))l=c;else if(c>a&&(!u||c<u))u=c}}var f=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+i));f.forEach((function(i){var r=i.dateObj;var o=r.getTime();var c=l>0&&o<l||u>0&&o>u;if(c){i.classList.add("notAllowed");["inRange","startRange","endRange"].forEach((function(t){i.classList.remove(t)}));return}else if(s&&!c)return;["startRange","inRange","endRange","notAllowed"].forEach((function(t){i.classList.remove(t)}));if(t!==undefined){t.classList.add(n<=e.selectedDates[0].getTime()?"startRange":"endRange");if(a<n&&o===a)i.classList.add("startRange");else if(a>n&&o===a)i.classList.add("endRange");if(o>=l&&(u===0||o<=u)&&isBetween(o,a,n))i.classList.add("inRange")}}))}function X(){if(e.isOpen&&!e.config.static&&!e.config.inline)it()}function Q(t,i){if(i===void 0){i=e._positionElement}if(e.isMobile===true){if(t){t.preventDefault();var n=getEventTarget(t);if(n){n.blur()}}if(e.mobileInput!==undefined){e.mobileInput.focus();e.mobileInput.click()}_t("onOpen");return}else if(e._input.disabled||e.config.inline){return}var a=e.isOpen;e.isOpen=true;if(!a){e.calendarContainer.classList.add("open");e._input.classList.add("active");_t("onOpen");it(i)}if(e.config.enableTime===true&&e.config.noCalendar===true){if(e.config.allowInput===false&&(t===undefined||!e.timeContainer.contains(t.relatedTarget))){setTimeout((function(){return e.hourElement.select()}),50)}}}function $(t){return function(i){var n=e.config["_"+t+"Date"]=e.parseDate(i,e.config.dateFormat);var a=e.config["_"+(t==="min"?"max":"min")+"Date"];if(n!==undefined){e[t==="min"?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0}if(e.selectedDates){e.selectedDates=e.selectedDates.filter((function(t){return V(t)}));if(!e.selectedDates.length&&t==="min")d(n);kt()}if(e.daysContainer){at();if(n!==undefined)e.currentYearElement[t]=n.getFullYear().toString();else e.currentYearElement.removeAttribute(t);e.currentYearElement.disabled=!!a&&n!==undefined&&a.getFullYear()===n.getFullYear()}}}function J(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"];var a=__assign(__assign({},JSON.parse(JSON.stringify(t.dataset||{}))),i);var r={};e.config.parseDate=a.parseDate;e.config.formatDate=a.formatDate;Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(t){e.config._enable=ft(t)}});Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(t){e.config._disable=ft(t)}});var s=a.mode==="time";if(!a.dateFormat&&(a.enableTime||s)){var l=flatpickr.defaultConfig.dateFormat||defaults.dateFormat;r.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var u=flatpickr.defaultConfig.altFormat||defaults.altFormat;r.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):u+(" h:i"+(a.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:$("min")});Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:$("max")});var c=function(t){return function(i){e.config[t==="min"?"_minTime":"_maxTime"]=e.parseDate(i,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:c("min")});Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:c("max")});if(a.mode==="time"){e.config.noCalendar=true;e.config.enableTime=true}Object.assign(e.config,r,a);for(var f=0;f<n.length;f++)e.config[n[f]]=e.config[n[f]]===true||e.config[n[f]]==="true";HOOKS.filter((function(t){return e.config[t]!==undefined})).forEach((function(t){e.config[t]=arrayify(e.config[t]||[]).map(o)}));e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var f=0;f<e.config.plugins.length;f++){var d=e.config.plugins[f](e)||{};for(var h in d){if(HOOKS.indexOf(h)>-1){e.config[h]=arrayify(d[h]).map(o).concat(e.config[h])}else if(typeof a[h]==="undefined")e.config[h]=d[h]}}if(!a.altInputClass){e.config.altInputClass=K().className+" "+e.config.altInputClass}_t("onParseConfig")}function K(){return e.config.wrap?t.querySelector("[data-input]"):t}function tt(){if(typeof e.config.locale!=="object"&&typeof flatpickr.l10ns[e.config.locale]==="undefined")e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale));e.l10n=__assign(__assign({},flatpickr.l10ns.default),typeof e.config.locale==="object"?e.config.locale:e.config.locale!=="default"?flatpickr.l10ns[e.config.locale]:undefined);tokenRegex.D="("+e.l10n.weekdays.shorthand.join("|")+")";tokenRegex.l="("+e.l10n.weekdays.longhand.join("|")+")";tokenRegex.M="("+e.l10n.months.shorthand.join("|")+")";tokenRegex.F="("+e.l10n.months.longhand.join("|")+")";tokenRegex.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var n=__assign(__assign({},i),JSON.parse(JSON.stringify(t.dataset||{})));if(n.time_24hr===undefined&&flatpickr.defaultConfig.time_24hr===undefined){e.config.time_24hr=e.l10n.time_24hr}e.formatDate=createDateFormatter(e);e.parseDate=createDateParser({config:e.config,l10n:e.l10n})}function it(t){if(typeof e.config.position==="function"){return void e.config.position(e,t)}if(e.calendarContainer===undefined)return;_t("onPreCalendarPosition");var i=t||e._positionElement;var n=Array.prototype.reduce.call(e.calendarContainer.children,(function(t,i){return t+i.offsetHeight}),0),a=e.calendarContainer.offsetWidth,r=e.config.position.split(" "),o=r[0],s=r.length>1?r[1]:null,l=i.getBoundingClientRect(),u=window.innerHeight-l.bottom,c=o==="above"||o!=="below"&&u<n&&l.top>n;var f=window.pageYOffset+l.top+(!c?i.offsetHeight+2:-n-2);toggleClass(e.calendarContainer,"arrowTop",!c);toggleClass(e.calendarContainer,"arrowBottom",c);if(e.config.inline)return;var d=window.pageXOffset+l.left;var h=false;var p=false;if(s==="center"){d-=(a-l.width)/2;h=true}else if(s==="right"){d-=a-l.width;p=true}toggleClass(e.calendarContainer,"arrowLeft",!h&&!p);toggleClass(e.calendarContainer,"arrowCenter",h);toggleClass(e.calendarContainer,"arrowRight",p);var v=window.document.body.offsetWidth-(window.pageXOffset+l.right);var g=d+a>window.document.body.offsetWidth;var _=v+a>window.document.body.offsetWidth;toggleClass(e.calendarContainer,"rightMost",g);if(e.config.static)return;e.calendarContainer.style.top=f+"px";if(!g){e.calendarContainer.style.left=d+"px";e.calendarContainer.style.right="auto"}else if(!_){e.calendarContainer.style.left="auto";e.calendarContainer.style.right=v+"px"}else{var m=et();if(m===undefined)return;var b=window.document.body.offsetWidth;var w=Math.max(0,b/2-a/2);var x=".flatpickr-calendar.centerMost:before";var y=".flatpickr-calendar.centerMost:after";var k=m.cssRules.length;var E="{left:"+l.left+"px;right:auto;}";toggleClass(e.calendarContainer,"rightMost",false);toggleClass(e.calendarContainer,"centerMost",true);m.insertRule(x+","+y+E,k);e.calendarContainer.style.left=w+"px";e.calendarContainer.style.right="auto"}}function et(){var t=null;for(var i=0;i<document.styleSheets.length;i++){var e=document.styleSheets[i];if(!e.cssRules)continue;t=e;break}return t!=null?t:nt()}function nt(){var t=document.createElement("style");document.head.appendChild(t);return t.sheet}function at(){if(e.config.noCalendar||e.isMobile)return;M();xt();S()}function rt(){e._input.focus();if(window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==undefined){setTimeout(e.close,0)}else{e.close()}}function ot(t){t.preventDefault();t.stopPropagation();var i=function(t){return t.classList&&t.classList.contains("flatpickr-day")&&!t.classList.contains("flatpickr-disabled")&&!t.classList.contains("notAllowed")};var n=findParent(getEventTarget(t),i);if(n===undefined)return;var a=n;var r=e.latestSelectedDateObj=new Date(a.dateObj.getTime());var o=(r.getMonth()<e.currentMonth||r.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";e.selectedDateElem=a;if(e.config.mode==="single")e.selectedDates=[r];else if(e.config.mode==="multiple"){var s=bt(r);if(s)e.selectedDates.splice(parseInt(s),1);else e.selectedDates.push(r)}else if(e.config.mode==="range"){if(e.selectedDates.length===2){e.clear(false,false)}e.latestSelectedDateObj=r;e.selectedDates.push(r);if(compareDates(r,e.selectedDates[0],true)!==0)e.selectedDates.sort((function(t,i){return t.getTime()-i.getTime()}))}f();if(o){var l=e.currentYear!==r.getFullYear();e.currentYear=r.getFullYear();e.currentMonth=r.getMonth();if(l){_t("onYearChange");M()}_t("onMonthChange")}xt();S();kt();if(!o&&e.config.mode!=="range"&&e.config.showMonths===1)k(a);else if(e.selectedDateElem!==undefined&&e.hourElement===undefined){e.selectedDateElem&&e.selectedDateElem.focus()}if(e.hourElement!==undefined)e.hourElement!==undefined&&e.hourElement.focus();if(e.config.closeOnSelect){var u=e.config.mode==="single"&&!e.config.enableTime;var c=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;if(u||c){rt()}}g()}var st={locale:[tt,L],showMonths:[P,s,C],minDate:[m],maxDate:[m],positionElement:[pt],clickOpens:[function(){if(e.config.clickOpens===true){v(e._input,"focus",e.open);v(e._input,"click",e.open)}else{e._input.removeEventListener("focus",e.open);e._input.removeEventListener("click",e.open)}}]};function lt(t,i){if(t!==null&&typeof t==="object"){Object.assign(e.config,t);for(var n in t){if(st[n]!==undefined)st[n].forEach((function(t){return t()}))}}else{e.config[t]=i;if(st[t]!==undefined)st[t].forEach((function(t){return t()}));else if(HOOKS.indexOf(t)>-1)e.config[t]=arrayify(i)}e.redraw();kt(true)}function ut(t,i){var n=[];if(t instanceof Array)n=t.map((function(t){return e.parseDate(t,i)}));else if(t instanceof Date||typeof t==="number")n=[e.parseDate(t,i)];else if(typeof t==="string"){switch(e.config.mode){case"single":case"time":n=[e.parseDate(t,i)];break;case"multiple":n=t.split(e.config.conjunction).map((function(t){return e.parseDate(t,i)}));break;case"range":n=t.split(e.l10n.rangeSeparator).map((function(t){return e.parseDate(t,i)}));break}}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));e.selectedDates=e.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&V(t,false)}));if(e.config.mode==="range")e.selectedDates.sort((function(t,i){return t.getTime()-i.getTime()}))}function ct(t,i,n){if(i===void 0){i=false}if(n===void 0){n=e.config.dateFormat}if(t!==0&&!t||t instanceof Array&&t.length===0)return e.clear(i);ut(t,n);e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1];e.redraw();m(undefined,i);d();if(e.selectedDates.length===0){e.clear(false)}kt(i);if(i)_t("onChange")}function ft(t){return t.slice().map((function(t){if(typeof t==="string"||typeof t==="number"||t instanceof Date){return e.parseDate(t,undefined,true)}else if(t&&typeof t==="object"&&t.from&&t.to)return{from:e.parseDate(t.from,undefined),to:e.parseDate(t.to,undefined)};return t})).filter((function(t){return t}))}function dt(){e.selectedDates=[];e.now=e.parseDate(e.config.now)||new Date;var t=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);if(t)ut(t,e.config.dateFormat);e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now;e.currentYear=e._initialDate.getFullYear();e.currentMonth=e._initialDate.getMonth();if(e.selectedDates.length>0)e.latestSelectedDateObj=e.selectedDates[0];if(e.config.minTime!==undefined)e.config.minTime=e.parseDate(e.config.minTime,"H:i");if(e.config.maxTime!==undefined)e.config.maxTime=e.parseDate(e.config.maxTime,"H:i");e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0);e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function ht(){e.input=K();if(!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type;e.input.type="text";e.input.classList.add("flatpickr-input");e._input=e.input;if(e.config.altInput){e.altInput=createElement(e.input.nodeName,e.config.altInputClass);e._input=e.altInput;e.altInput.placeholder=e.input.placeholder;e.altInput.disabled=e.input.disabled;e.altInput.required=e.input.required;e.altInput.tabIndex=e.input.tabIndex;e.altInput.type="text";e.input.setAttribute("type","hidden");if(!e.config.static&&e.input.parentNode)e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)}if(!e.config.allowInput)e._input.setAttribute("readonly","readonly");pt()}function pt(){e._positionElement=e.config.positionElement||e._input}function vt(){var t=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=createElement("input",e.input.className+" flatpickr-mobile");e.mobileInput.tabIndex=1;e.mobileInput.type=t;e.mobileInput.disabled=e.input.disabled;e.mobileInput.required=e.input.required;e.mobileInput.placeholder=e.input.placeholder;e.mobileFormatStr=t==="datetime-local"?"Y-m-d\\TH:i:S":t==="date"?"Y-m-d":"H:i:S";if(e.selectedDates.length>0){e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)}if(e.config.minDate)e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d");if(e.config.maxDate)e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d");if(e.input.getAttribute("step"))e.mobileInput.step=String(e.input.getAttribute("step"));e.input.type="hidden";if(e.altInput!==undefined)e.altInput.type="hidden";try{if(e.input.parentNode)e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch(t){}v(e.mobileInput,"change",(function(t){e.setDate(getEventTarget(t).value,false,e.mobileFormatStr);_t("onChange");_t("onClose")}))}function gt(t){if(e.isOpen===true)return e.close();e.open(t)}function _t(t,i){if(e.config===undefined)return;var n=e.config[t];if(n!==undefined&&n.length>0){for(var a=0;n[a]&&a<n.length;a++)n[a](e.selectedDates,e.input.value,e,i)}if(t==="onChange"){e.input.dispatchEvent(mt("change"));e.input.dispatchEvent(mt("input"))}}function mt(t){var i=document.createEvent("Event");i.initEvent(t,true,true);return i}function bt(t){for(var i=0;i<e.selectedDates.length;i++){var n=e.selectedDates[i];if(n instanceof Date&&compareDates(n,t)===0)return""+i}return false}function wt(t){if(e.config.mode!=="range"||e.selectedDates.length<2)return false;return compareDates(t,e.selectedDates[0])>=0&&compareDates(t,e.selectedDates[1])<=0}function xt(){if(e.config.noCalendar||e.isMobile||!e.monthNav)return;e.yearElements.forEach((function(t,i){var n=new Date(e.currentYear,e.currentMonth,1);n.setMonth(e.currentMonth+i);if(e.config.showMonths>1||e.config.monthSelectorType==="static"){e.monthElements[i].textContent=monthToStr(n.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" "}else{e.monthsDropdownContainer.value=n.getMonth().toString()}t.value=n.getFullYear().toString()}));e._hidePrevMonthArrow=e.config.minDate!==undefined&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear());e._hideNextMonthArrow=e.config.maxDate!==undefined&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear())}function yt(t){var i=t||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map((function(t){return e.formatDate(t,i)})).filter((function(t,i,n){return e.config.mode!=="range"||e.config.enableTime||n.indexOf(t)===i})).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function kt(t){if(t===void 0){t=true}if(e.mobileInput!==undefined&&e.mobileFormatStr){e.mobileInput.value=e.latestSelectedDateObj!==undefined?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""}e.input.value=yt(e.config.dateFormat);if(e.altInput!==undefined){e.altInput.value=yt(e.config.altFormat)}if(t!==false)_t("onValueUpdate")}function Et(t){var i=getEventTarget(t);var n=e.prevMonthNav.contains(i);var a=e.nextMonthNav.contains(i);if(n||a){G(n?-1:1)}else if(e.yearElements.indexOf(i)>=0){i.select()}else if(i.classList.contains("arrowUp")){e.changeYear(e.currentYear+1)}else if(i.classList.contains("arrowDown")){e.changeYear(e.currentYear-1)}}function It(t){t.preventDefault();var i=t.type==="keydown",n=getEventTarget(t),a=n;if(e.amPM!==undefined&&n===e.amPM){e.amPM.textContent=e.l10n.amPM[int(e.amPM.textContent===e.l10n.amPM[0])]}var r=parseFloat(a.getAttribute("min")),o=parseFloat(a.getAttribute("max")),s=parseFloat(a.getAttribute("step")),l=parseInt(a.value,10),u=t.delta||(i?t.which===38?1:-1:0);var c=l+s*u;if(typeof a.value!=="undefined"&&a.value.length===2){var f=a===e.hourElement,d=a===e.minuteElement;if(c<r){c=o+c+int(!f)+(int(f)&&int(!e.amPM));if(d)w(undefined,-1,e.hourElement)}else if(c>o){c=a===e.hourElement?c-o-int(!e.amPM):r;if(d)w(undefined,1,e.hourElement)}if(e.amPM&&f&&(s===1?c+l===23:Math.abs(c-l)>s)){e.amPM.textContent=e.l10n.amPM[int(e.amPM.textContent===e.l10n.amPM[0])]}a.value=pad(c)}}a();return e}function _flatpickr(t,i){var e=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement}));var n=[];for(var a=0;a<e.length;a++){var r=e[a];try{if(r.getAttribute("data-fp-omit")!==null)continue;if(r._flatpickr!==undefined){r._flatpickr.destroy();r._flatpickr=undefined}r._flatpickr=FlatpickrInstance(r,i||{});n.push(r._flatpickr)}catch(t){console.error(t)}}return n.length===1?n[0]:n}if(typeof HTMLElement!=="undefined"&&typeof HTMLCollection!=="undefined"&&typeof NodeList!=="undefined"){HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return _flatpickr(this,t)};HTMLElement.prototype.flatpickr=function(t){return _flatpickr([this],t)}}var flatpickr=function(t,i){if(typeof t==="string"){return _flatpickr(window.document.querySelectorAll(t),i)}else if(t instanceof Node){return _flatpickr([t],i)}else{return _flatpickr(t,i)}};flatpickr.defaultConfig={};flatpickr.l10ns={en:__assign({},english),default:__assign({},english)};flatpickr.localize=function(t){flatpickr.l10ns.default=__assign(__assign({},flatpickr.l10ns.default),t)};flatpickr.setDefaults=function(t){flatpickr.defaultConfig=__assign(__assign({},flatpickr.defaultConfig),t)};flatpickr.parseDate=createDateParser({});flatpickr.formatDate=createDateFormatter({});flatpickr.compareDates=compareDates;if(typeof jQuery!=="undefined"&&typeof jQuery.fn!=="undefined"){jQuery.fn.flatpickr=function(t){return _flatpickr(this,t)}}Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t==="string"?parseInt(t,10):t))};if(typeof window!=="undefined"){window.flatpickr=flatpickr}var sallaDatetimePickerCss='.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\'\';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}';var SallaDatetimePicker=function(){function t(t){registerInstance(this,t);this.picked=createEvent(this,"picked");this.invalidInput=createEvent(this,"invalidInput");this.value=null;this.placeholder=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time");this.allowInput=true;this.allowInvalidPreload=false;this.altFormat="F j, Y";this.altInput=false;this.appendTo=undefined;this.ariaDateFormat="F j, Y";this.autoFillDefaultTime=true;this.clickOpens=true;this.closeOnSelect=true;this.dateFormat="Y-m-d";this.defaultHour=12;this.defaultMinute=0;this.defaultSeconds=0;this.disable=[];this.disableMobile=false;this.enable=[function(t){return true}];this.enableSeconds=false;this.enableTime=false;this.hourIncrement=1;this.inline=false;this.locale="en";this.maxDate=null;this.maxTime=null;this.minDate=null;this.minTime=null;this.minuteIncrement=5;this.mode="single";this.monthSelectorType="dropdown";this.nextArrow='<span class="sicon-keyboard_arrow_right"></span>';this.noCalendar=false;this.position="auto";this.prevArrow='<span class="sicon-keyboard_arrow_left"></span>';this.shorthandCurrentMonth=false;this.static=false;this.showMonths=1;this.time_24hr=false;this.weekNumbers=false;this.wrap=false;this.disabled=false}t.prototype.render=function(){var t=this;return h("div",{key:"4332a123c72d1cf71468339536d9e73f32333791",class:"s-datetime-picker"},h("input",{key:"99ae8a3a48042f43ea525fae0999d67ad216f9ce",type:"datetime",name:this.name,value:this.value,required:this.required,disabled:this.disabled,placeholder:this.placeholder,class:"s-datetime-picker-input",ref:function(i){return t.dateInput=i}}))};t.prototype.componentDidLoad=function(){var t=this;var i={allowInput:this.allowInput,allowInvalidPreload:this.allowInvalidPreload,altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,appendTo:this.appendTo,ariaDateFormat:this.ariaDateFormat,autoFillDefaultTime:this.autoFillDefaultTime,clickOpens:this.clickOpens,closeOnSelect:this.closeOnSelect,conjunction:this.conjunction,dateFormat:this.dateFormat,defaultDate:!!this.value?Date.parse(this.value):this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,defaultSeconds:this.defaultSeconds,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableSeconds:this.enableSeconds,enableTime:this.enableTime,formatDate:this.formatDate,hourIncrement:this.hourIncrement,inline:this.inline,locale:this.locale,maxDate:this.maxDate,maxTime:this.maxTime,minDate:this.minDate,minTime:this.minTime,minuteIncrement:this.minuteIncrement,mode:this.mode,monthSelectorType:this.monthSelectorType,nextArrow:this.nextArrow,noCalendar:this.noCalendar,parseDate:this.dateParser,position:this.position,positionElement:this.positionElement,prevArrow:this.prevArrow,shorthandCurrentMonth:this.shorthandCurrentMonth,static:this.static,showMonths:this.showMonths,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,onChange:function(i,e){return t.picked.emit(t.value=e)}};flatpickr(this.dateInput,i);this.dateInput.addEventListener("invalid",(function(i){t.invalidInput.emit(i)}));this.dateInput.addEventListener("input",(function(){t.dateInput.setCustomValidity("");t.dateInput.reportValidity()}))};return t}();SallaDatetimePicker.style=sallaDatetimePickerCss;var Cancel='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>cancel</title>\n<path d="M17.885 16l7.057-7.057c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-7.057 7.057-7.057-7.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l7.057 7.057-7.057 7.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l7.057-7.057 7.057 7.057c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';var AlertEngineIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert-engine</title>\n<path d="M16 18.673c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM2.667 16c0-3.092 1.083-6.105 3.047-8.484 0.469-0.568 0.389-1.408-0.179-1.877-0.568-0.468-1.408-0.388-1.877 0.179-2.359 2.857-3.657 6.473-3.657 10.183s1.299 7.325 3.657 10.183c0.264 0.319 0.645 0.484 1.029 0.484 0.299 0 0.6-0.1 0.848-0.305 0.568-0.469 0.648-1.309 0.179-1.877-1.964-2.379-3.047-5.392-3.047-8.484zM16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM28.343 5.817c-0.469-0.567-1.307-0.647-1.877-0.179-0.568 0.469-0.648 1.309-0.179 1.877 1.964 2.379 3.047 5.392 3.047 8.484s-1.083 6.105-3.047 8.484c-0.469 0.568-0.389 1.408 0.179 1.877 0.249 0.205 0.549 0.305 0.848 0.305 0.384 0 0.765-0.165 1.028-0.484 2.36-2.857 3.659-6.473 3.659-10.183s-1.299-7.325-3.657-10.183z"></path>\n</svg>\n';var CheckCircle2='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check-circle2</title>\n<path d="M29.333 14.133c-0.8 0-1.333 0.533-1.333 1.333v1.2c0 6.667-5.333 12-12 12 0 0 0 0 0 0-6.667 0-12-5.333-12-12s5.333-12 12-12c0 0 0 0 0 0 1.733 0 3.333 0.4 4.933 1.067 0.667 0.267 1.467 0 1.733-0.667s0-1.467-0.667-1.733c-1.867-0.8-3.867-1.333-6-1.333 0 0 0 0 0 0-8.133 0-14.667 6.533-14.667 14.667s6.533 14.667 14.667 14.667c0 0 0 0 0 0 8.133 0 14.667-6.533 14.667-14.667v-1.2c0-0.8-0.533-1.333-1.333-1.333zM12.933 14.4c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l4 4c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4l13.333-13.333c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-12.4 12.4-3.067-3.067z"></path>\n</svg>\n';var sallaDrawerCss="";var SallaDrawer=function(){function t(t){var i=this;registerInstance(this,t);this.drawerVisibilityChanged=createEvent(this,"drawerVisibilityChanged");this.isClosable=true;this.width="md";this.position="right";this.visible=false;this.hasSkeleton=false;this.isLoading=false;this.subTitleFirst=false;this.noPadding=false;this.subTitle="";this.centered=false;this.iconStyle=undefined;salla.event.on("drawer::open",(function(t){return t==i.host.id&&i.open()}));salla.event.on("drawer::close",(function(t){return t==i.host.id&&i.close()}));this.drawerTitle=this.host.getAttribute("drawer-title")}t.prototype.handleVisible=function(t){var i=this;if(!t){this.drawerVisibilityChanged.emit(false);this.toggleDrawer(false);return}this.drawerVisibilityChanged.emit(true);this.host.classList.remove("s-hidden");setTimeout((function(){return i.toggleDrawer(true)}))};t.prototype.handleKeyUp=function(t){if(t.key==="Escape"){this.closeDrawer()}};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.setAttribute("visible","");this.handleAutoFocus();return[2,this.host]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.removeAttribute("visible");return[2,this.host]}))}))};t.prototype.setTitle=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.drawerTitle=t;return[2,this.host]}))}))};t.prototype.loading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isLoading=true;return[2,this.host]}))}))};t.prototype.stopLoading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isLoading=false;return[2,this.host]}))}))};t.prototype.handleAutoFocus=function(){var t=this.host.querySelector("input, textarea, select");if(!t){return}setTimeout((function(){t.focus()}),100)};t.prototype.toggleDrawer=function(t){var i=this;var e=this.host.querySelector(".s-drawer-body");Helper.toggleElementClassIf(e,"s-drawer-entering","s-drawer-leaving",(function(){return t})).toggleElementClassIf(this.overlay,"s-drawer-entering","s-drawer-overlay-leaving",(function(){return t})).toggleElementClassIf(document.body,"drawer-is-open","drawer-is-closed",(function(){return t}));if(!t){setTimeout((function(){return i.host.classList.add("s-hidden")}),350)}};t.prototype.closeDrawer=function(t){if(!this.isClosable){return}salla.event.dispatch("drawer::close",{reason:t});this.host.removeAttribute("visible")};t.prototype.iconBlockClasses=function(){return{"s-drawer-icon":true,"s-drawer-bg-error":this.iconStyle=="error","s-drawer-bg-success":this.iconStyle=="success","s-drawer-bg-normal":!this.iconStyle,"s-drawer-bg-primary":this.iconStyle=="primary"}};t.prototype.getWidth=function(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width};t.prototype.render=function(){var t=this;this.host.id=this.host.id||"salla-drawer";if(this.isLoading){return h(Host,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:function(i){return t.handleKeyUp(i)}},h("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:function(i){return t.overlay=i},onClick:function(){return t.closeDrawer("backdropClick")}}),h("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},h("div",{class:"s-drawer-body flex justify-center s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},h("slot",{name:"loading"},h("salla-loading",null)),h("div",{class:"s-hidden"},h("slot",null)))))}return h(Host,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog"},h("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:function(i){return t.overlay=i},onClick:function(){return t.closeDrawer("backdropClick")}}),h("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},h("div",{class:"s-drawer-body s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},h("div",{class:{"s-drawer-header":true,"s-drawer-is-center":this.centered}},this.isClosable?h("button",{class:"s-drawer-close",onClick:function(){return t.closeDrawer("closeButtonClick")},type:"button"},h("span",{innerHTML:Cancel})):"",this.drawerTitle||this.subTitle?h("div",{class:"s-drawer-header-inner"},h("slot",{name:"icon"},!!this.iconStyle?h("div",{class:this.iconBlockClasses(),innerHTML:this.iconStyle=="error"?AlertEngineIcon:CheckCircle2}):""),h("div",{class:"s-drawer-header-content"},this.drawerTitle?h("div",{class:{"s-drawer-title":true,"s-drawer-title-below":this.subTitleFirst},innerHTML:this.drawerTitle}):"",this.subTitle?h("p",{class:{"s-drawer-sub-title":true},innerHTML:this.subTitle}):"")):""),h("slot",null),h("slot",{name:"footer"}))))};t.prototype.componentDidLoad=function(){document.body.append(this.host)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{visible:["handleVisible"]}},enumerable:false,configurable:true});return t}();SallaDrawer.style=sallaDrawerCss;var filepond$1={exports:{}};
|
|
11
|
+
*/var vanillaPicker=vanillaPicker$1.exports;var hasRequiredVanillaPicker;function requireVanillaPicker(){if(hasRequiredVanillaPicker)return vanillaPicker$1.exports;hasRequiredVanillaPicker=1;(function(t,i){(function(i,e){t.exports=e()})(vanillaPicker,(function(){var t=function(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}};var i=function(){function t(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}return function(i,e,n){if(e)t(i.prototype,e);if(n)t(i,n);return i}}();var e=function(){function t(t,i){var e=[];var n=true;var a=false;var r=undefined;try{for(var o=t[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){e.push(s.value);if(i&&e.length===i)break}}catch(t){a=true;r=t}finally{try{if(!n&&o["return"])o["return"]()}finally{if(a)throw r}}return e}return function(i,e){if(Array.isArray(i)){return i}else if(Symbol.iterator in Object(i)){return t(i,e)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0};String.prototype.padStart=String.prototype.padStart||function(t,i){var e=this;while(e.length<t){e=i+e}return e};var n={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function a(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var e=i>0?t.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):t.toString();return e||"0"}var r=function(){function r(i,n,a,o){t(this,r);var s=this;function l(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),n=e(i,4),a=n[0],o=n[1],l=n[2],u=n[3];if(u===undefined){u=1}a/=360;o/=100;l/=100;s.hsla=[a,o,l,u]}else if(t.startsWith("rgb")){var c=t.match(/([\-\d\.e]+)/g).map(Number),f=e(c,4),d=f[0],h=f[1],p=f[2],v=f[3];if(v===undefined){v=1}s.rgba=[d,h,p,v]}else{if(t.startsWith("#")){s.rgba=r.hexToRgb(t)}else{s.rgba=r.nameToRgb(t)||r.hexToRgb(t)}}}if(i===undefined);else if(Array.isArray(i)){this.rgba=i}else if(a===undefined){var u=i&&""+i;if(u){l(u.toLowerCase())}}else{this.rgba=[i,n,a,o===undefined?1:o]}}i(r,[{key:"printRGB",value:function t(i){var e=i?this.rgba:this.rgba.slice(0,3),n=e.map((function(t,i){return a(t,i===3?3:0)}));return i?"rgba("+n+")":"rgb("+n+")"}},{key:"printHSL",value:function t(i){var e=[360,100,100,1],n=["","%","%",""];var r=i?this.hsla:this.hsla.slice(0,3),o=r.map((function(t,i){return a(t*e[i],i===3?3:1)+n[i]}));return i?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function t(i){var e=this.hex;return i?e:e.substring(0,7)}},{key:"rgba",get:function t(){if(this._rgba){return this._rgba}if(!this._hsla){throw new Error("No color is set")}return this._rgba=r.hslToRgb(this._hsla)},set:function t(i){if(i.length===3){i[3]=1}this._rgba=i;this._hsla=null}},{key:"rgbString",get:function t(){return this.printRGB()}},{key:"rgbaString",get:function t(){return this.printRGB(true)}},{key:"hsla",get:function t(){if(this._hsla){return this._hsla}if(!this._rgba){throw new Error("No color is set")}return this._hsla=r.rgbToHsl(this._rgba)},set:function t(i){if(i.length===3){i[3]=1}this._hsla=i;this._rgba=null}},{key:"hslString",get:function t(){return this.printHSL()}},{key:"hslaString",get:function t(){return this.printHSL(true)}},{key:"hex",get:function t(){var i=this.rgba,e=i.map((function(t,i){return i<3?t.toString(16):Math.round(t*255).toString(16)}));return"#"+e.map((function(t){return t.padStart(2,"0")})).join("")},set:function t(i){this.rgba=r.hexToRgb(i)}}],[{key:"hexToRgb",value:function t(i){var e=(i.startsWith("#")?i.slice(1):i).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/)){throw new Error("Unknown hex color; "+i)}var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));n[3]=n[3]/255;return n}},{key:"nameToRgb",value:function t(i){var e=i.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),a=n[e];return a===undefined?a:r.hexToRgb(a.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function t(i){var n=e(i,4),a=n[0],r=n[1],o=n[2],s=n[3];a/=255;r/=255;o/=255;var l=Math.max(a,r,o),u=Math.min(a,r,o);var c=void 0,f=void 0,d=(l+u)/2;if(l===u){c=f=0}else{var h=l-u;f=d>.5?h/(2-l-u):h/(l+u);switch(l){case a:c=(r-o)/h+(r<o?6:0);break;case r:c=(o-a)/h+2;break;case o:c=(a-r)/h+4;break}c/=6}return[c,f,d,s]}},{key:"hslToRgb",value:function t(i){var n=e(i,4),a=n[0],r=n[1],o=n[2],s=n[3];var l=void 0,u=void 0,c=void 0;if(r===0){l=u=c=o}else{var f=function t(i,e,n){if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return i+(e-i)*6*n;if(n<1/2)return e;if(n<2/3)return i+(e-i)*(2/3-n)*6;return i};var d=o<.5?o*(1+r):o+r-o*r,h=2*o-d;l=f(h,d,a+1/3);u=f(h,d,a);c=f(h,d,a-1/3)}var p=[l*255,u*255,c*255].map(Math.round);p[3]=s;return p}}]);return r}();var o=function(){function e(){t(this,e);this._events=[]}i(e,[{key:"add",value:function t(i,e,n){i.addEventListener(e,n,false);this._events.push({target:i,type:e,handler:n})}},{key:"remove",value:function t(i,n,a){this._events=this._events.filter((function(t){var r=true;if(i&&i!==t.target){r=false}if(n&&n!==t.type){r=false}if(a&&a!==t.handler){r=false}if(r){e._doRemove(t.target,t.type,t.handler)}return!r}))}},{key:"destroy",value:function t(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)}));this._events=[]}}],[{key:"_doRemove",value:function t(i,e,n){i.removeEventListener(e,n,false)}}]);return e}();function s(t){var i=document.createElement("div");i.innerHTML=t;return i.firstElementChild}function l(t,i,e){var n=false;function a(t,i,e){return Math.max(i,Math.min(t,e))}function r(t,r,o){if(o){n=true}if(!n){return}t.preventDefault();var s=i.getBoundingClientRect(),l=s.width,u=s.height,c=r.clientX,f=r.clientY;var d=a(c-s.left,0,l),h=a(f-s.top,0,u);e(d/l,h/u)}function o(t,i){var e=t.buttons===undefined?t.which:t.buttons;if(e===1){r(t,t,i)}else{n=false}}function s(t,i){if(t.touches.length===1){r(t,t.touches[0],i)}else{n=false}}t.add(i,"mousedown",(function(t){o(t,true)}));t.add(i,"touchstart",(function(t){s(t,true)}));t.add(window,"mousemove",o);t.add(i,"touchmove",s);t.add(window,"mouseup",(function(t){n=false}));t.add(i,"touchend",(function(t){n=false}));t.add(i,"touchcancel",(function(t){n=false}))}var u="linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em";var c=360;var f="keydown",d="mousedown",h="focusin";function p(t,i){return(i||document).querySelector(t)}function v(t){t.preventDefault();t.stopPropagation()}function g(t,i,e,n,a){t.add(i,f,(function(t){if(e.indexOf(t.key)>=0){n(t)}}))}var _=function(){function e(i){t(this,e);this.settings={popup:"right",layout:"default",alpha:true,editor:true,editorFormat:"hex",cancelButton:false,defaultColor:"#0cf"};this._events=new o;this.onChange=null;this.onDone=null;this.onOpen=null;this.onClose=null;this.setOptions(i)}i(e,[{key:"setOptions",value:function t(i){var e=this;if(!i){return}var n=this.settings;function a(t,i,e){for(var n in t){i[n]=t[n]}}if(i instanceof HTMLElement){n.parent=i}else{if(n.parent&&i.parent&&n.parent!==i.parent){this._events.remove(n.parent);this._popupInited=false}a(i,n);if(i.onChange){this.onChange=i.onChange}if(i.onDone){this.onDone=i.onDone}if(i.onOpen){this.onOpen=i.onOpen}if(i.onClose){this.onClose=i.onClose}var r=i.color||i.colour;if(r){this._setColor(r)}}var o=n.parent;if(o&&n.popup&&!this._popupInited){var s=function t(i){return e.openHandler(i)};this._events.add(o,"click",s);g(this._events,o,[" ","Spacebar","Enter"],s);this._popupInited=true}else if(i.parent&&!n.popup){this.show()}}},{key:"openHandler",value:function t(i){if(this.show()){i&&i.preventDefault();this.settings.parent.style.pointerEvents="none";var e=i&&i.type===f?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100);if(this.onOpen){this.onOpen(this.colour)}}}},{key:"closeHandler",value:function t(i){var e=i&&i.type;var n=false;if(!i){n=true}else if(e===d||e===h){var a=(this.__containedEvent||0)+100;if(i.timeStamp>a){n=true}}else{v(i);n=true}if(n&&this.hide()){this.settings.parent.style.pointerEvents="";if(e!==d){this.settings.parent.focus()}if(this.onClose){this.onClose(this.colour)}}}},{key:"movePopup",value:function t(i,e){this.closeHandler();this.setOptions(i);if(e){this.openHandler()}}},{key:"setColor",value:function t(i,e){this._setColor(i,{silent:e})}},{key:"_setColor",value:function t(i,e){if(typeof i==="string"){i=i.trim()}if(!i){return}e=e||{};var n=void 0;try{n=new r(i)}catch(t){if(e.failSilently){return}throw t}if(!this.settings.alpha){var a=n.hsla;a[3]=1;n.hsla=a}this.colour=this.color=n;this._setHSLA(null,null,null,null,e)}},{key:"setColour",value:function t(i,e){this.setColor(i,e)}},{key:"show",value:function t(){var i=this.settings.parent;if(!i){return false}if(this.domElement){var e=this._toggleDOM(true);this._setPosition();return e}var n=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>';var a=s(n);this.domElement=a;this._domH=p(".picker_hue",a);this._domSL=p(".picker_sl",a);this._domA=p(".picker_alpha",a);this._domEdit=p(".picker_editor input",a);this._domSample=p(".picker_sample",a);this._domOkay=p(".picker_done button",a);this._domCancel=p(".picker_cancel button",a);a.classList.add("layout_"+this.settings.layout);if(!this.settings.alpha){a.classList.add("no_alpha")}if(!this.settings.editor){a.classList.add("no_editor")}if(!this.settings.cancelButton){a.classList.add("no_cancel")}this._ifPopup((function(){return a.classList.add("popup")}));this._setPosition();if(this.colour){this._updateUI()}else{this._setColor(this.settings.defaultColor)}this._bindEvents();return true}},{key:"hide",value:function t(){return this._toggleDOM(false)}},{key:"destroy",value:function t(){this._events.destroy();if(this.domElement){this.settings.parent.removeChild(this.domElement)}}},{key:"_bindEvents",value:function t(){var i=this;var e=this,n=this.domElement,a=this._events;function r(t,i,e){a.add(t,i,e)}r(n,"click",(function(t){return t.preventDefault()}));l(a,this._domH,(function(t,i){return e._setHSLA(t)}));l(a,this._domSL,(function(t,i){return e._setHSLA(null,t,1-i)}));if(this.settings.alpha){l(a,this._domA,(function(t,i){return e._setHSLA(null,null,null,1-i)}))}var o=this._domEdit;{r(o,"input",(function(t){e._setColor(this.value,{fromEditor:true,failSilently:true})}));r(o,"focus",(function(t){var i=this;if(i.selectionStart===i.selectionEnd){i.select()}}))}this._ifPopup((function(){var t=function t(e){return i.closeHandler(e)};r(window,d,t);r(window,h,t);g(a,n,["Esc","Escape"],t);var e=function t(e){i.__containedEvent=e.timeStamp};r(n,d,e);r(n,h,e);r(i._domCancel,"click",t)}));var s=function t(e){i._ifPopup((function(){return i.closeHandler(e)}));if(i.onDone){i.onDone(i.colour)}};r(this._domOkay,"click",s);g(a,n,["Enter"],s)}},{key:"_setPosition",value:function t(){var i=this.settings.parent,e=this.domElement;if(i!==e.parentNode){i.appendChild(e)}this._ifPopup((function(t){if(getComputedStyle(i).position==="static"){i.style.position="relative"}var n=t===true?"popup_right":"popup_"+t;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){if(t===n){e.classList.add(t)}else{e.classList.remove(t)}}));e.classList.add(n)}))}},{key:"_setHSLA",value:function t(i,e,n,a,r){r=r||{};var o=this.colour,s=o.hsla;[i,e,n,a].forEach((function(t,i){if(t||t===0){s[i]=t}}));o.hsla=s;this._updateUI(r);if(this.onChange&&!r.silent){this.onChange(o)}}},{key:"_updateUI",value:function t(i){if(!this.domElement){return}i=i||{};var e=this.colour,n=e.hsla,a="hsl("+n[0]*c+", 100%, 50%)",r=e.hslString,o=e.hslaString;var s=this._domH,l=this._domSL,f=this._domA,d=p(".picker_selector",s),h=p(".picker_selector",l),v=p(".picker_selector",f);function g(t,i,e){i.style.left=e*100+"%"}function _(t,i,e){i.style.top=e*100+"%"}g(s,d,n[0]);this._domSL.style.backgroundColor=this._domH.style.color=a;g(l,h,n[1]);_(l,h,1-n[2]);l.style.color=r;_(f,v,1-n[3]);var m=r,b=m.replace("hsl","hsla").replace(")",", 0)"),w="linear-gradient("+[m,b]+")";this._domA.style.background=w+", "+u;if(!i.fromEditor){var x=this.settings.editorFormat,y=this.settings.alpha;var k=void 0;switch(x){case"rgb":k=e.printRGB(y);break;case"hsl":k=e.printHSL(y);break;default:k=e.printHex(y)}this._domEdit.value=k}this._domSample.style.color=o}},{key:"_ifPopup",value:function t(i,e){if(this.settings.parent&&this.settings.popup){i&&i(this.settings.popup)}else{e&&e()}}},{key:"_toggleDOM",value:function t(i){var e=this.domElement;if(!e){return false}var n=i?"":"none",a=e.style.display!==n;if(a){e.style.display=n}return a}}]);return e}();{var m=document.createElement("style");m.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}';document.documentElement.firstElementChild.appendChild(m);_.StyleElement=m}return _}))})(vanillaPicker$1);return vanillaPicker$1.exports}var vanillaPickerExports=requireVanillaPicker();var Picker=getDefaultExportFromCjs(vanillaPickerExports);var sallaColorPickerCss="";var SallaColorPicker=function(){function t(t){registerInstance(this,t);this.colorChanged=createEvent(this,"colorChanged");this.invalidInput=createEvent(this,"invalidInput");this.submitted=createEvent(this,"submitted");this.popupOpened=createEvent(this,"popupOpened");this.popupClosed=createEvent(this,"popupClosed");this.name="color";this.required=false;this.format="hex";this.showCancelButton=false;this.showTextField=true;this.enableAlpha=false}t.prototype.colorChangeHandler=function(t){this.colorInput.value=t.hex;this.colorChanged.emit(t)};t.prototype.submittedHandler=function(t){this.setColorValue(t.rgbaString,true);this.canvas.style.backgroundColor=t.rgbString;this.colorInput.value=t.hex;this.colorInput.dispatchEvent(new window.Event("change",{bubbles:true}));this.submitted.emit(t)};t.prototype.popupOpenedHandler=function(t){this.setPopInPosition();this.popupOpened.emit(t)};t.prototype.popupClosedHandler=function(t){this.popupClosed.emit(t)};t.prototype.setPickerOption=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.picker.setOptions(t);return[2]}))}))};t.prototype.movePopUp=function(t,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.movePopup(t,i);return[2]}))}))};t.prototype.setColorValue=function(t,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.picker.setColor(t,i);return[2]}))}))};t.prototype.openPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.show();return[2]}))}))};t.prototype.closePicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.hide();return[2]}))}))};t.prototype.destroyPicker=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.picker.destroy();return[2]}))}))};t.prototype.componentWillLoad=function(){var t=this;salla.onReady((function(){t.color=t.color?t.color:salla.config.get("theme.color.primary","#5dd5c4")}))};t.prototype.setPopInPosition=function(){var t=this.host.querySelector(".picker_wrapper");var i=this.host.querySelector(".s-color-picker-widget").getBoundingClientRect();var e=window.innerWidth/2-i.width/2;var n=e>i.x;var a=e<i.x;var r=e===i.x;var o=window.innerWidth<768;if(o&&n){t.style.left="0"}if(o&&a){t.style.left="auto"}if(!o||o&&(!a&&!n||r)){t.style.left="-95px"}};t.prototype.initColorPicker=function(){var t=this;this.picker=new Picker({parent:this.host,color:this.color,popup:"bottom",alpha:this.enableAlpha,editor:this.showTextField,editorFormat:this.format,cancelButton:this.showCancelButton,onChange:function(i){return t.colorChangeHandler(i)},onDone:function(i){return t.submittedHandler(i)},onOpen:function(i){return t.popupOpenedHandler(i)},onClose:function(i){return t.popupClosedHandler(i)}})};t.prototype.render=function(){var t=this;return h(Host,{key:"692d43f617dbaa05e170c32c725eb4adcc01ec78",class:"s-color-picker-main"},h("slot",{key:"33166575c005f01e1557ac665749e206f05cc499",name:"widget"},h("div",{key:"60bf746f0e2b336da837d62e962fefeaf63a9a2c",class:"s-color-picker-widget"},h("div",{key:"62c56bc83a9315052ac3c21841f284b416407945",class:"s-color-picker-widget-canvas",ref:function(i){return t.canvas=i}}),h("span",{key:"3f1869950f457659a3c52d8148fd386ce1171caa",innerHTML:ArrowDownIcon}))),h("input",{key:"7fa3f08df14f03e9a4cf33e41eeb9f34b1a9dbfe",class:"s-hidden",name:this.name,required:this.required,value:this.color,ref:function(i){return t.colorInput=i}}))};t.prototype.componentDidLoad=function(){var t=this;this.canvas.style.backgroundColor=this.color;this.initColorPicker();this.colorInput.addEventListener("invalid",(function(i){t.invalidInput.emit(i)}));this.colorInput.addEventListener("input",(function(){t.colorInput.setCustomValidity("");t.colorInput.reportValidity()}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaColorPicker.style=sallaColorPickerCss;var sallaCommentFormCss=":host{display:block}";var SallaCommentForm=function(){function t(t){var i=this;registerInstance(this,t);this.placeholder=salla.lang.get("blocks.comments.placeholder");this.submitText=salla.lang.get("blocks.comments.submit");salla.lang.onLoaded((function(){i.placeholder=salla.lang.get("blocks.comments.placeholder");i.submitText=salla.lang.get("blocks.comments.submit")}));salla.onReady((function(){i.canComment=salla.config.get("user.can_comment");i.itemId=salla.config.get("page.id");i.type=salla.url.is_page("page-single")?"page":salla.url.is_page("blog.single")?"blog":"product"}))}t.prototype.submit=function(){var t=this;if(!this.commentForm.reportValidity()){salla.log("CommentForm:: validation error!");return}this.submitBtn.load().then((function(){return salla.comment.add({id:t.itemId,comment:t.commentField.value,type:t.type})})).finally((function(){return t.submitBtn.stop}))};t.prototype.render=function(){var t=this;return h(Host,{key:"305789ae94c288c8ca485ab10ae87a71f31d1042"},!!this.canComment?h("form",{ref:function(i){return t.commentForm=i}},h("div",{class:"s-comment-form-wrapper"},this.showAvatar?h("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",h("div",{class:"s-comment-form-content"},h("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:function(i){return t.commentField=i},placeholder:this.placeholder,class:"s-comment-form-input",required:true}),h("br",null),h("div",{class:"s-comment-form-action"},h("salla-button",{ref:function(i){return t.submitBtn=i},"loader-position":"center",onClick:function(){return t.submit()}},this.submitText))))):"")};return t}();SallaCommentForm.style=sallaCommentFormCss;var Reply='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n';var ThumbsUp='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>thumbs-up</title>\n<path d="M26.667 10.667h-8.261l1.279-3.38c0.723-1.911 0.087-4.051-1.549-5.203-0.909-0.639-2.004-0.881-3.085-0.684-1.101 0.203-2.061 0.837-2.703 1.787l-5.452 8.067c-0.148 0.22-0.228 0.48-0.228 0.747v12c0 3.676 2.991 6.667 6.667 6.667h8.688c2.535 0 4.817-1.407 5.955-3.671l2.548-5.063c0.093-0.187 0.143-0.392 0.143-0.6v-6.667c0-2.205-1.795-4-4-4zM28 21.017l-2.405 4.78c-0.683 1.359-2.052 2.203-3.573 2.203h-8.688c-2.205 0-4-1.795-4-4v-11.592l5.223-7.728c0.237-0.352 0.584-0.585 0.975-0.657 0.367-0.067 0.749 0.017 1.068 0.241 0.631 0.444 0.879 1.317 0.591 2.079l-1.963 5.185c-0.156 0.409-0.099 0.869 0.149 1.229s0.66 0.576 1.099 0.576h10.192c0.735 0 1.333 0.599 1.333 1.333zM2.667 10.667c-0.736 0-1.333 0.597-1.333 1.333v16c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-16c0-0.736-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var sallaCommentsCss$1=":host{display:block}";var SallaCommentItem=function(){function t(t){var i=this;registerInstance(this,t);this.has_bought_trans=salla.lang.get("blocks.comments.has_bought");this.rated_trans=salla.lang.get("pages.rating.rated");this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");this.has_order_trans=salla.lang.get("blocks.comments.has_order");this.allowLikes=salla.config.get("store.settings.rating.allow_likes");this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images");this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد");this.likesCount=0;this.likedComments=[];salla.lang.onLoaded((function(){var t=function(t,i,e){return new Promise((function(n){salla.helpers.setNested(salla.lang.messages[t],i,e);n(true)}))};var e=function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return[4,t("ar.trans","blocks.comments.helpful","مفيد")];case 1:i.sent();return[4,t("en.trans","blocks.comments.helpful","Helpful")];case 2:i.sent();this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد");return[2]}}))}))};i.has_bought_trans=salla.lang.get("blocks.comments.has_bought");i.rated_trans=salla.lang.get("pages.rating.rated");i.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval");i.has_order_trans=salla.lang.get("blocks.comments.has_order");e()}))}t.prototype.componentDidLoad=function(){this.likesCount=this.comment.likes_count;try{this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");if(this.likedComments.includes(this.comment.id)){this.likeBtn.classList.add("liked");this.likeBtn.fill="solid"}}catch(t){salla.log("Bad json for liked_comments")}};t.prototype.getReplies=function(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]};t.prototype.getDate=function(t){var i=t.split(" ")[0];var e=i.split("-"),n=e[0],a=e[1],r=e[2];var o="".concat(parseInt(r,10),"/").concat(parseInt(a,10),"/").concat(parseInt(n,10));return o};t.prototype.getTime=function(t){var i=t.split(" "),e=i[1];var n=e.split(":"),a=n[0],r=n[1];var o="".concat(parseInt(a,10),":").concat(parseInt(r,10));return o};t.prototype.toggleLike=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n;return __generator(this,(function(a){switch(a.label){case 0:if(salla.config.isGuest()){return[2,salla.notify.error(salla.lang.get("common.messages.must_login"))]}this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");t=this.likedComments.includes(this.comment.id);a.label=1;case 1:a.trys.push([1,3,,4]);i=t?"rating/".concat(this.comment.id,"/unlike"):"rating/".concat(this.comment.id,"/like");return[4,salla.api.request(i,"","put")];case 2:e=a.sent();salla.log(e.message);if(t){this.likeBtn.classList.remove("liked");this.likeBtn.fill="outline";this.updateLikedComments(this.comment.id,false);this.likesCount--}else{this.likeBtn.classList.add("liked");this.likeBtn.fill="solid";this.updateLikedComments(this.comment.id,true);this.likesCount++}return[3,4];case 3:n=a.sent();if(n.response.status==409){if(this.likeBtn.classList.contains("liked")){this.likeBtn.fill="outline";this.likeBtn.classList.remove("liked");this.updateLikedComments(this.comment.id,false);this.likesCount--}else{this.likeBtn.fill="solid";this.likeBtn.classList.add("liked");salla.logger.warn("Like already exists");this.updateLikedComments(this.comment.id,true)}}return[3,4];case 4:return[2]}}))}))};t.prototype.updateLikedComments=function(t,i){this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");if(i){if(!this.likedComments.includes(t)){this.likedComments.push(t)}}else{this.likedComments=this.likedComments.filter((function(i){return i!==t}))}localStorage.setItem("liked_comments",JSON.stringify(this.likedComments))};t.prototype.render=function(){var t=this;var i,e,n,a,r,o;var s=this.comment.type=="admin";return h(Host,{key:"98e314383c34c566ab9e05efeebae51e5b694681",class:s?"s-comments-item-admin":"s-comments-item"},h("div",{key:"a704f11fd7f4bc227eb2f986360afb3c2875c6ab",class:{"s-comments-item-wrapper":!s,"s-comments-item-admin-wrapper":s},id:"s-comments-item-".concat(this.comment.id)},h("div",{key:"8b0c0a9422003621eb5d8d6a54893fc0a18d4cc9",class:"s-comments-item-inner s-comments-flex-1"},s&&h("span",{key:"7f421290726abe2391da37178e01265badf4fd08",class:"s-comments-item-reply-icon",innerHTML:Reply}),h("div",{key:"61ef5759d54603f1b886de9126ab771437fe2e98",class:"s-comments-item-avatar"},h("img",{key:"67b668cc17d3d0747cd128efa961540858750fbf","data-src":(i=this.comment)===null||i===void 0?void 0:i.avatar,alt:(e=this.comment)===null||e===void 0?void 0:e.name,src:(n=this.comment)===null||n===void 0?void 0:n.avatar,class:"s-comments-item-avatar-img lazy"})),h("div",{key:"fc42c8a69538f09f8f3f9c0e5555d39b9dc4a6ac",class:"s-comments-flex-1"},h("div",{key:"7b2b3de758fed9ae73e0032b6cf895ce1df99883",class:"s-comments-item-user-wrapper"},h("div",{key:"1d4187d935e209354587a900f912a4eb19b066df",class:"s-comments-item-user-info"},h("h3",{key:"2a45f7ad245c41a2fd5a69bd909e093effed8453",class:"s-comments-item-user-info-name"},(a=this.comment)===null||a===void 0?void 0:a.name),(this.comment.has_order||!!this.comment.rating)&&!this.comment.is_pending&&!this.hideBought?h("div",{class:"s-comments-flex"},this.comment.has_order?[h("span",{class:"s-comments-item-has-order-check-icon",innerHTML:IconVerified}),h("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,!!this.comment.rating?h("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null):null),h("p",{key:"c934abc4f8dd94bc349d85d00a5984aef672d9d9",class:"s-comments-item-timestamp s-ltr"}," ",this.getDate((r=this.comment.created_at)===null||r===void 0?void 0:r.date)," ",h("span",{key:"acef6d6af07b12501a61d074ad566692bb02456a",class:"s-comments-item-time"}," - ",this.getTime((o=this.comment.created_at)===null||o===void 0?void 0:o.date)," ")),!!this.comment.rating||!!this.comment.stars?h("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating||this.comment.stars}):null),h("div",{key:"9bedec8066878f113623e9ab27c203836eea2db5",class:"s-comments-item-content"},h("p",{key:"0f8b1bf62ac5afc1449b160884945003b70e55f0",innerHTML:this.comment.content}),this.allowAttachImages&&h("div",{key:"df920f8e2758aedc313b4502f554157fb216c15d",class:"s-comments-item-images"},this.comment.images.map((function(i,e){return h("img",{key:e,src:i,alt:"",onClick:function(){return t.modal.open()}})})),h("salla-modal",{key:"0743d9159e0cf4061b1969953f58fdebf49ee9e2",ref:function(i){return t.modal=i},width:"sm"},h("salla-slider",{key:"00a15b0dca213ddf64f3346da6849ce0dde7f638",id:"s-comments-item-".concat(this.comment.id,"-images"),class:"s-comments-item-images-slider",type:"thumbs","auto-height":true,showControls:this.comment.images.length>1?true:false,"show-thumbs-controls":"false"},h("div",{key:"21e593664598eab16e56990c43aba10dcc526752",slot:"items"},this.comment.images.map((function(t,i){return h("img",{key:i,src:t,alt:""})}))),h("div",{key:"8998e861f37fc30c488d60b016c68db0b09483ee",slot:"thumbs"},this.comment.images.map((function(t,i){return h("div",{class:"s-comments-item-images-slider-thumb"},h("img",{key:i,src:t,alt:""}))})))))),this.allowLikes&&!s&&salla.url.is_page("product.single")?h("salla-button",{ref:function(i){return t.likeBtn=i},class:"s-comments-item-like-btn ".concat(this.likedComments.includes(this.comment.id)?"liked":""),loaderPosition:"center",fill:"outline",size:"small",onClick:function(){return t.toggleLike()}},h("span",null,this.helpfulLabel," ",this.likesCount>0?"(".concat(this.likesCount,")"):""),h("span",{innerHTML:ThumbsUp})):"",this.comment.is_pending?h("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),!!this.getReplies().length&&!s?this.getReplies().map((function(t){return h("div",null,h("salla-comment-item",{comment:t}))})):null))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaCommentItem.style=sallaCommentsCss$1;var CommentType;(function(t){t["PAGE"]="page";t["PRODUCT"]="product";t["BLOG"]="blog"})(CommentType||(CommentType={}));var ChatBubbles='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>chat-bubbles</title>\n<path d="M15.333 17.333c4.779 0 8.667-3.888 8.667-8.667s-3.888-8.667-8.667-8.667h-6.667c-4.779 0-8.667 3.888-8.667 8.667 0 2.985 1.513 5.712 4 7.297v4.703c0 0.497 0.277 0.953 0.717 1.183 0.195 0.1 0.405 0.151 0.616 0.151 0.269 0 0.536-0.081 0.764-0.241l6.323-4.425zM11.236 14.908l-4.569 3.199v-2.913c0-0.5-0.28-0.959-0.725-1.187-2.020-1.035-3.275-3.080-3.275-5.34 0-3.308 2.692-6 6-6h6.667c3.308 0 6 2.692 6 6s-2.692 6-6 6h-3.333c-0.273 0-0.54 0.084-0.764 0.241zM29.196 12.964c-0.543-0.5-1.388-0.464-1.884 0.077-0.5 0.541-0.465 1.385 0.077 1.884 1.253 1.156 1.944 2.72 1.944 4.408 0 2.26-1.255 4.305-3.275 5.339-0.445 0.228-0.725 0.687-0.725 1.188v2.572l-5.441-2.939c-0.195-0.104-0.412-0.16-0.633-0.16h-2.592c-1.688 0-3.309-0.724-4.451-1.988-0.492-0.545-1.335-0.591-1.883-0.096-0.547 0.493-0.589 1.336-0.096 1.883 1.644 1.823 3.988 2.868 6.429 2.868h2.255l7.111 3.84c0.199 0.107 0.417 0.16 0.635 0.16 0.236 0 0.472-0.063 0.683-0.188 0.404-0.241 0.651-0.676 0.651-1.145v-4.036c2.487-1.585 4-4.311 4-7.297 0-2.407-1.023-4.727-2.804-6.369z"></path>\n</svg>\n';var sallaCommentsCss=":host{display:block}";var SallaComments=function(){function t(t){var i=this;registerInstance(this,t);this.type=CommentType.PAGE;this.showFormAvatar=false;this.hideBought=false;this.testimonials=false;this.noComments=salla.lang.get("blocks.comments.no_comments");this.comment_title=salla.lang.get("blocks.comments.title");this.comment_name=salla.lang.get("blocks.comments.comment");this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary");this.allowLikes=salla.config.get("store.settings.rating.allow_likes");salla.onReady((function(){i.allowLikes=salla.config.get("store.settings.rating.allow_likes");i.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")}));salla.lang.onLoaded((function(){i.comment_title=salla.lang.get("blocks.comments.title");i.comment_name=salla.lang.get("blocks.comments.comment");i.noComments=salla.lang.get("pages.rating.no_ratings");var t=function(t,i,e){return new Promise((function(n){salla.helpers.setNested(salla.lang.messages[t],i,e);n(true)}))};var e=function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return[4,t("ar.trans","blocks.comments.most_helpful","الأكثر إفادة")];case 1:i.sent();return[4,t("en.trans","blocks.comments.most_helpful","Most helpful")];case 2:i.sent();this.mostHelpfulLabel=salla.lang.get("blocks.comments.most_helpful");this.comment_title=salla.lang.get("blocks.comments.title");this.comment_name=salla.lang.get("blocks.comments.comment");this.noComments=salla.lang.get("pages.rating.no_ratings");return[2]}}))}))};e()}))}t.prototype.pluralize=function(t,i){var e=t.split("|");var n=[{condition:i===0,index:0},{condition:i===1,index:1},{condition:i===2,index:2},{condition:i>2&&i<=10,index:3},{condition:i>=11,index:4}];var a=(n.find((function(t){var i=t.condition;return i}))||{index:e.length-1}).index;var r=e[a];return r.replace(":count",salla.helpers.number(i.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")};t.prototype.wrapConsoleError=function(){if(Salla.infiniteScroll.errorWrapped){return}(function(){var t=console.error.bind(console);console.error=function(){var i=[];for(var e=0;e<arguments.length;e++){i[e]=arguments[e]}var n=i[0];if(typeof n==="string"&&n.toLowerCase().replace(/\s/g,"").includes("infinitescroll")){return console.log.apply(console,i)}return t.apply(void 0,i)}})();Salla.infiniteScroll.errorWrapped=true};t.prototype.initiateInfiniteScroll=function(){var t=this;var i,e,n;if(!this.wrapper){console.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.wrapConsoleError();this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return t.nextPage},history:false,nextPage:this.nextPage,scrollThreshold:false},true);(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("request",(function(i){t.loading()}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(i){t.pagination=i.pagination;t.nextPage=typeof i.pagination.links==="object"&&!!i.pagination.links.next?i.pagination.links.next:null;for(var e=0,n=t.handleResponse(i);e<n.length;e++){var a=n[e];t.wrapper.append(a)}var r=t.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");t.animateItems(r);t.loading(false)}));(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("error",(function(t){salla.console.error("Error loading more comments:",t)}))};t.prototype.loading=function(t){if(t===void 0){t=true}var i;var e=(i=this.status)===null||i===void 0?void 0:i.querySelector(".s-button-text");if(e){Helper.toggleElementClassIf(e,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.animateItems=function(t){anime({targets:t,opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,i){return i*100},easing:"easeOutExpo",complete:function(i){for(var e=0,n=t;e<n.length;e++){var a=n[e];a.classList.add("animated")}}})};t.prototype.reload=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){this.showPlaceholder=false;if(this.wrapper){this.wrapper.innerHTML="";t=document.createElement("salla-loading");this.wrapper.append(t)}this.nextPage=null;this.loadInitialData();return[2]}))}))};t.prototype.getCommentHTML=function(t){var i=document.createElement("salla-comment-item");i.comment=t;i.hideBought=this.hideBought;return i};t.prototype.handleResponse=function(t){var i=this;var e;return((e=t.data)===null||e===void 0?void 0:e.map((function(t){return i.getCommentHTML(t)})))||[]};t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){t.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})).then((function(){return t.loading()})).then((function(){t.hideTitle=t.hideTitle||t.testimonials;t.hideForm=t.hideForm||t.testimonials;return t.loadInitialData()}))};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n;var a=this;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,5,,6]);t={data:[],pagination:{}};i=new URLSearchParams(window.location.search);if(i.has("sort")){this.sort=i.get("sort")}if(!this.testimonials)return[3,2];e={sort:this.sort,type:"store"};return[4,salla.api.request("reviews",{params:e},"get")];case 1:t=r.sent();return[3,4];case 2:return[4,salla.api.comment.getComments(this.type,this.itemId)];case 3:t=r.sent();r.label=4;case 4:if(!t.data||!t.data.length){this.showPlaceholder=false;this.loading(false);return[2]}if(this.wrapper){this.wrapper.innerHTML=""}this.comments=t.data;this.pagination=t.pagination;this.total=t.pagination.total;this.nextPage=typeof t.pagination.links==="object"&&!!t.pagination.links.next?t.pagination.links.next:null;setTimeout((function(){for(var i=0,e=a.handleResponse(t);i<e.length;i++){var n=e[i];a.wrapper.append(n)}a.initiateInfiniteScroll();var r=a.wrapper.querySelectorAll("salla-comment-item:not(.animated)");a.animateItems(r)}),100);return[3,6];case 5:n=r.sent();console.error("Error loading initial data:",n);this.showPlaceholder=true;this.loading(false);return[3,6];case 6:return[2]}}))}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage();return[2]}))}))};t.prototype.render=function(){var t=this;if(this.showPlaceholder){return h("div",null,!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&!this.testimonials?h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}):"",h("div",{class:"s-comments-placeholder"},h("span",{innerHTML:ChatBubbles}),h("p",null,this.noComments)))}return h("div",{class:"s-comments s-comments-".concat(this.testimonials?"testimonials":this.type)},h("div",{class:"".concat(this.type===CommentType.PAGE?"s-comments-page-container":"s-comments-container")},!!this.total&&!this.hideTitle?h("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&h("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),salla.url.is_page("product.single")?h("salla-reviews-summary",{itemId:this.itemId}):"",h("div",{class:"s-comments-header ".concat(this.total?"has-total":"")},!!this.total&&h("span",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),!!this.total&&!this.testimonials&&this.type!==CommentType.BLOG?h("div",{class:"s-comments-filter-wrapper"},h("label",{class:"s-comments-filter-label",htmlFor:"comments-filter"},salla.lang.get("pages.categories.sorting")),h("select",{id:"comments-filter",class:"s-form-control s-comments-sort-input",onChange:function(i){t.sort=i.target.value;t.reload()}},h("option",{value:"latest",selected:true},salla.lang.get("pages.testimonials.sort_by_date_desc")),h("option",{value:"oldest"},salla.lang.get("pages.testimonials.sort_by_date_asc")),this.allowLikes&&h("option",{value:"most_helpful"},this.mostHelpfulLabel))):""),h("div",{ref:function(i){t.wrapper=i}}),this.nextPage&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(i){t.status=i}},h("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary",type:"button"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(i){t.btnLoader=i},style:{display:"none"}})))))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaComments.style=sallaCommentsCss;var sallaCountDownCss="";var SallaCountDown=function(){function t(t){var i=this;registerInstance(this,t);this.size="md";this.color="dark";this.digits="auto";this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض");this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");this.offerEnded=false;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);salla.lang.onLoaded((function(){i.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم");i.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة");i.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة");i.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح");i.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية");i.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")}));if(this.date&&this.isValidDate(this.date)){this.startCountDown()}}t.prototype.endCountDown=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){clearInterval(this.countInterval);this.offerEnded=true;this.days=this.number(0);this.hours=this.number(0);this.minutes=this.number(0);this.seconds=this.number(0);return[2]}))}))};t.prototype.componentWillLoad=function(){var t;if(typeof this.preOrder==="string"){try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch(t){this.normalizedPreOrder=undefined}}else{this.normalizedPreOrder=this.preOrder}if((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.end_date){this.date=this.normalizedPreOrder.end_date;if(this.date&&this.isValidDate(this.date)){this.startCountDown()}}};t.prototype.isValidDate=function(t){var i=t.includes("-"),e=t.split(" "),n;if(i){n=e[0].replace(/-/g,"/")}else{n=e[0]}return!isNaN(Date.parse(n))};t.prototype.number=function(t){return salla.helpers.number(t,this.digits==="en")};t.prototype.startCountDown=function(){var t=this;var i=new Date(this.date.replace(/-/g,"/"));if(this.endOfDay||this.date.split(" ").length===1){i.setHours(23,59,59,999)}var e=i.getTime();this.countInterval=setInterval((function(){var i=(new Date).getTime();var n=e-i;t.days=t.number(Math.floor(n/(1e3*60*60*24)));t.hours=t.number(Math.floor(n%(1e3*60*60*24)/(1e3*60*60)));t.minutes=t.number(Math.floor(n%(1e3*60*60)/(1e3*60)));t.seconds=t.number(Math.floor(n%(1e3*60)/1e3));if(n<0){t.endCountDown()}}),1e3)};t.prototype.renderCountDown=function(){return h("ul",{class:"s-count-down-list ".concat(this.boxed?"s-count-down-boxed":""," ").concat(this.offerEnded?"s-count-down-ended":""," s-count-down-").concat(this.size," s-count-down-").concat(this.color)},h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&h("div",{class:"s-count-down-item-label"},this.secondsLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&h("div",{class:"s-count-down-item-label"},this.minutesLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&h("div",{class:"s-count-down-item-label"},this.hoursLabel)),h("li",{class:"s-count-down-item"},h("div",{class:"s-count-down-item-value"},this.days),this.labeled&&h("div",{class:"s-count-down-item-label"},this.daysLabel)))};t.prototype.renderInvalidDate=function(){return h("div",{class:"s-count-down-text-center"},this.invalidDate)};t.prototype.renderOfferEnded=function(){return h("div",{class:"s-count-down-end-text"},!!this.endText?this.endText:this.endLabel)};t.prototype.renderPreOrderToBeAvailableOn=function(){var t,i,e;if(!((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.availability_date)||!this.isValidDate((i=this.normalizedPreOrder)===null||i===void 0?void 0:i.availability_date))return null;return h("div",{class:"s-count-down-info-message"},h("i",{class:"sicon-info"}),h("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),h("span",null,new Date((e=this.normalizedPreOrder)===null||e===void 0?void 0:e.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"})))};t.prototype.renderPreOrderCountDown=function(){var t;if(!((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.activate_countdown))return null;return h("div",{class:"s-count-down-pre-order-container"},h("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown())};t.prototype.renderPreOrder=function(){var t;return h("div",null,typeof this.normalizedPreOrder==="object"&&((t=this.normalizedPreOrder)===null||t===void 0?void 0:t.availability_date)&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())};t.prototype.renderContent=function(){if(!this.date)return null;if(!this.isValidDate(this.date)){return this.renderInvalidDate()}if(this.preOrder){return this.renderPreOrder()}return this.renderCountDown()};t.prototype.render=function(){return h(Host,{key:"1e6baaf061a5cee7aeed3af6f4f02a7edf654885",class:"s-count-down-wrapper ".concat(this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":"")},this.renderContent(),this.offerEnded&&this.renderOfferEnded())};return t}();SallaCountDown.style=sallaCountDownCss;var HOOKS=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"];var defaults={_disable:[],allowInput:false,allowInvalidPreload:false,altFormat:"F j, Y",altInput:false,altInputClass:"form-control input",animate:typeof window==="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:true,clickOpens:true,closeOnSelect:true,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:false,enableSeconds:false,enableTime:false,errorHandler:function(t){return typeof console!=="undefined"&&console.warn(t)},getWeek:function(t){var i=new Date(t.getTime());i.setHours(0,0,0,0);i.setDate(i.getDate()+3-(i.getDay()+6)%7);var e=new Date(i.getFullYear(),0,4);return 1+Math.round(((i.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:false,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:false,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:undefined,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:false,showMonths:1,static:false,time_24hr:false,weekNumbers:false,wrap:false};var english={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var i=t%100;if(i>3&&i<21)return"th";switch(i%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:false};var pad=function(t,i){if(i===void 0){i=2}return("000"+t).slice(i*-1)};var int=function(t){return t===true?1:0};function debounce(t,i){var e;return function(){var n=this;var a=arguments;clearTimeout(e);e=setTimeout((function(){return t.apply(n,a)}),i)}}var arrayify=function(t){return t instanceof Array?t:[t]};function toggleClass(t,i,e){if(e===true)return t.classList.add(i);t.classList.remove(i)}function createElement(t,i,e){var n=window.document.createElement(t);i=i||"";e=e||"";n.className=i;if(e!==undefined)n.textContent=e;return n}function clearNode(t){while(t.firstChild)t.removeChild(t.firstChild)}function findParent(t,i){if(i(t))return t;else if(t.parentNode)return findParent(t.parentNode,i);return undefined}function createNumberInput(t,i){var e=createElement("div","numInputWrapper"),n=createElement("input","numInput "+t),a=createElement("span","arrowUp"),r=createElement("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1){n.type="number"}else{n.type="text";n.pattern="\\d*"}if(i!==undefined)for(var o in i)n.setAttribute(o,i[o]);e.appendChild(n);e.appendChild(a);e.appendChild(r);return e}function getEventTarget(t){try{if(typeof t.composedPath==="function"){var i=t.composedPath();return i[0]}return t.target}catch(i){return t.target}}var doNothing=function(){return undefined};var monthToStr=function(t,i,e){return e.months[i?"shorthand":"longhand"][t]};var revFormat={D:doNothing,F:function(t,i,e){t.setMonth(e.months.longhand.indexOf(i))},G:function(t,i){t.setHours((t.getHours()>=12?12:0)+parseFloat(i))},H:function(t,i){t.setHours(parseFloat(i))},J:function(t,i){t.setDate(parseFloat(i))},K:function(t,i,e){t.setHours(t.getHours()%12+12*int(new RegExp(e.amPM[1],"i").test(i)))},M:function(t,i,e){t.setMonth(e.months.shorthand.indexOf(i))},S:function(t,i){t.setSeconds(parseFloat(i))},U:function(t,i){return new Date(parseFloat(i)*1e3)},W:function(t,i,e){var n=parseInt(i);var a=new Date(t.getFullYear(),0,2+(n-1)*7,0,0,0,0);a.setDate(a.getDate()-a.getDay()+e.firstDayOfWeek);return a},Y:function(t,i){t.setFullYear(parseFloat(i))},Z:function(t,i){return new Date(i)},d:function(t,i){t.setDate(parseFloat(i))},h:function(t,i){t.setHours((t.getHours()>=12?12:0)+parseFloat(i))},i:function(t,i){t.setMinutes(parseFloat(i))},j:function(t,i){t.setDate(parseFloat(i))},l:doNothing,m:function(t,i){t.setMonth(parseFloat(i)-1)},n:function(t,i){t.setMonth(parseFloat(i)-1)},s:function(t,i){t.setSeconds(parseFloat(i))},u:function(t,i){return new Date(parseFloat(i))},w:doNothing,y:function(t,i){t.setFullYear(2e3+parseFloat(i))}};var tokenRegex={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"};var formats={Z:function(t){return t.toISOString()},D:function(t,i,e){return i.weekdays.shorthand[formats.w(t,i,e)]},F:function(t,i,e){return monthToStr(formats.n(t,i,e)-1,false,i)},G:function(t,i,e){return pad(formats.h(t,i,e))},H:function(t){return pad(t.getHours())},J:function(t,i){return i.ordinal!==undefined?t.getDate()+i.ordinal(t.getDate()):t.getDate()},K:function(t,i){return i.amPM[int(t.getHours()>11)]},M:function(t,i){return monthToStr(t.getMonth(),true,i)},S:function(t){return pad(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,i,e){return e.getWeek(t)},Y:function(t){return pad(t.getFullYear(),4)},d:function(t){return pad(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return pad(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,i){return i.weekdays.longhand[t.getDay()]},m:function(t){return pad(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}};var createDateFormatter=function(t){var i=t.config,e=i===void 0?defaults:i,n=t.l10n,a=n===void 0?english:n,r=t.isMobile,o=r===void 0?false:r;return function(t,i,n){var r=n||a;if(e.formatDate!==undefined&&!o){return e.formatDate(t,i,r)}return i.split("").map((function(i,n,a){return formats[i]&&a[n-1]!=="\\"?formats[i](t,r,e):i!=="\\"?i:""})).join("")}};var createDateParser=function(t){var i=t.config,e=i===void 0?defaults:i,n=t.l10n,a=n===void 0?english:n;return function(t,i,n,r){if(t!==0&&!t)return undefined;var o=r||a;var s;var l=t;if(t instanceof Date)s=new Date(t.getTime());else if(typeof t!=="string"&&t.toFixed!==undefined)s=new Date(t);else if(typeof t==="string"){var u=i||(e||defaults).dateFormat;var c=String(t).trim();if(c==="today"){s=new Date;n=true}else if(e&&e.parseDate){s=e.parseDate(t,u)}else if(/Z$/.test(c)||/GMT$/.test(c)){s=new Date(t)}else{var f=void 0,d=[];for(var h=0,p=0,v="";h<u.length;h++){var g=u[h];var _=g==="\\";var m=u[h-1]==="\\"||_;if(tokenRegex[g]&&!m){v+=tokenRegex[g];var b=new RegExp(v).exec(t);if(b&&(f=true)){d[g!=="Y"?"push":"unshift"]({fn:revFormat[g],val:b[++p]})}}else if(!_)v+="."}s=!e||!e.noCalendar?new Date((new Date).getFullYear(),0,1,0,0,0,0):new Date((new Date).setHours(0,0,0,0));d.forEach((function(t){var i=t.fn,e=t.val;return s=i(s,e,o)||s}));s=f?s:undefined}}if(!(s instanceof Date&&!isNaN(s.getTime()))){e.errorHandler(new Error("Invalid date provided: "+l));return undefined}if(n===true)s.setHours(0,0,0,0);return s}};function compareDates(t,i,e){if(e===void 0){e=true}if(e!==false){return new Date(t.getTime()).setHours(0,0,0,0)-new Date(i.getTime()).setHours(0,0,0,0)}return t.getTime()-i.getTime()}var isBetween=function(t,i,e){return t>Math.min(i,e)&&t<Math.max(i,e)};var calculateSecondsSinceMidnight=function(t,i,e){return t*3600+i*60+e};var parseSeconds=function(t){var i=Math.floor(t/3600),e=(t-i*3600)/60;return[i,e,t-i*3600-e*60]};var duration={DAY:864e5};function getDefaultHours(t){var i=t.defaultHour;var e=t.defaultMinute;var n=t.defaultSeconds;if(t.minDate!==undefined){var a=t.minDate.getHours();var r=t.minDate.getMinutes();var o=t.minDate.getSeconds();if(i<a){i=a}if(i===a&&e<r){e=r}if(i===a&&e===r&&n<o)n=t.minDate.getSeconds()}if(t.maxDate!==undefined){var s=t.maxDate.getHours();var l=t.maxDate.getMinutes();i=Math.min(i,s);if(i===s)e=Math.min(l,e);if(i===s&&e===l)n=t.maxDate.getSeconds()}return{hours:i,minutes:e,seconds:n}}if(typeof Object.assign!=="function"){Object.assign=function(t){var i=[];for(var e=1;e<arguments.length;e++){i[e-1]=arguments[e]}if(!t){throw TypeError("Cannot convert undefined or null to object")}var n=function(i){if(i){Object.keys(i).forEach((function(e){return t[e]=i[e]}))}};for(var a=0,r=i;a<r.length;a++){var o=r[a];n(o)}return t}}var __assign=undefined&&undefined.__assign||function(){__assign=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++){i=arguments[e];for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a))t[a]=i[a]}return t};return __assign.apply(this,arguments)};var __spreadArrays=undefined&&undefined.__spreadArrays||function(){for(var t=0,i=0,e=arguments.length;i<e;i++)t+=arguments[i].length;for(var n=Array(t),a=0,i=0;i<e;i++)for(var r=arguments[i],o=0,s=r.length;o<s;o++,a++)n[a]=r[o];return n};var DEBOUNCED_CHANGE_MS=300;function FlatpickrInstance(t,i){var e={config:__assign(__assign({},defaults),flatpickr.defaultConfig),l10n:english};e.parseDate=createDateParser({config:e.config,l10n:e.l10n});e._handlers=[];e.pluginElements=[];e.loadedPlugins=[];e._bind=v;e._setHoursFromDate=d;e._positionCalendar=it;e.changeMonth=G;e.changeYear=U;e.clear=F;e.close=N;e.onMouseOver=Z;e._createElement=createElement;e.createDay=y;e.destroy=B;e.isEnabled=V;e.jumpToDate=m;e.updateValue=kt;e.open=Q;e.redraw=at;e.set=lt;e.setDate=ct;e.toggle=gt;function n(){e.utils={getDaysInMonth:function(t,i){if(t===void 0){t=e.currentMonth}if(i===void 0){i=e.currentYear}if(t===1&&(i%4===0&&i%100!==0||i%400===0))return 29;return e.l10n.daysInMonth[t]}}}function a(){e.element=e.input=t;e.isOpen=false;K();tt();ht();dt();n();if(!e.isMobile)x();_();if(e.selectedDates.length||e.config.noCalendar){if(e.config.enableTime){d(e.config.noCalendar?e.latestSelectedDateObj:undefined)}kt(false)}s();var i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);if(!e.isMobile&&i){it()}_t("onReady")}function r(){var t;return((t=e.calendarContainer)===null||t===void 0?void 0:t.getRootNode()).activeElement||document.activeElement}function o(t){return t.bind(e)}function s(){var t=e.config;if(t.weekNumbers===false&&t.showMonths===1){return}else if(t.noCalendar!==true){window.requestAnimationFrame((function(){if(e.calendarContainer!==undefined){e.calendarContainer.style.visibility="hidden";e.calendarContainer.style.display="block"}if(e.daysContainer!==undefined){var i=(e.days.offsetWidth+1)*t.showMonths;e.daysContainer.style.width=i+"px";e.calendarContainer.style.width=i+(e.weekWrapper!==undefined?e.weekWrapper.offsetWidth:0)+"px";e.calendarContainer.style.removeProperty("visibility");e.calendarContainer.style.removeProperty("display")}}))}}function l(t){if(e.selectedDates.length===0){var i=e.config.minDate===undefined||compareDates(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime());var n=getDefaultHours(e.config);i.setHours(n.hours,n.minutes,n.seconds,i.getMilliseconds());e.selectedDates=[i];e.latestSelectedDateObj=i}if(t!==undefined&&t.type!=="blur"){It(t)}var a=e._input.value;f();kt();if(e._input.value!==a){e._debouncedChange()}}function u(t,i){return t%12+12*int(i===e.l10n.amPM[1])}function c(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}function f(){if(e.hourElement===undefined||e.minuteElement===undefined)return;var t=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(e.minuteElement.value,10)||0)%60,n=e.secondElement!==undefined?(parseInt(e.secondElement.value,10)||0)%60:0;if(e.amPM!==undefined){t=u(t,e.amPM.textContent)}var a=e.config.minTime!==undefined||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&compareDates(e.latestSelectedDateObj,e.config.minDate,true)===0;var r=e.config.maxTime!==undefined||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&compareDates(e.latestSelectedDateObj,e.config.maxDate,true)===0;if(e.config.maxTime!==undefined&&e.config.minTime!==undefined&&e.config.minTime>e.config.maxTime){var o=calculateSecondsSinceMidnight(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds());var s=calculateSecondsSinceMidnight(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds());var l=calculateSecondsSinceMidnight(t,i,n);if(l>s&&l<o){var c=parseSeconds(o);t=c[0];i=c[1];n=c[2]}}else{if(r){var f=e.config.maxTime!==undefined?e.config.maxTime:e.config.maxDate;t=Math.min(t,f.getHours());if(t===f.getHours())i=Math.min(i,f.getMinutes());if(i===f.getMinutes())n=Math.min(n,f.getSeconds())}if(a){var d=e.config.minTime!==undefined?e.config.minTime:e.config.minDate;t=Math.max(t,d.getHours());if(t===d.getHours()&&i<d.getMinutes())i=d.getMinutes();if(i===d.getMinutes())n=Math.max(n,d.getSeconds())}}h(t,i,n)}function d(t){var i=t||e.latestSelectedDateObj;if(i&&i instanceof Date){h(i.getHours(),i.getMinutes(),i.getSeconds())}}function h(t,i,n){if(e.latestSelectedDateObj!==undefined){e.latestSelectedDateObj.setHours(t%24,i,n||0,0)}if(!e.hourElement||!e.minuteElement||e.isMobile)return;e.hourElement.value=pad(!e.config.time_24hr?(12+t)%12+12*int(t%12===0):t);e.minuteElement.value=pad(i);if(e.amPM!==undefined)e.amPM.textContent=e.l10n.amPM[int(t>=12)];if(e.secondElement!==undefined)e.secondElement.value=pad(n)}function p(t){var i=getEventTarget(t);var e=parseInt(i.value)+(t.delta||0);if(e/1e3>1||t.key==="Enter"&&!/[^\d]/.test(e.toString())){U(e)}}function v(t,i,n,a){if(i instanceof Array)return i.forEach((function(i){return v(t,i,n,a)}));if(t instanceof Array)return t.forEach((function(t){return v(t,i,n,a)}));t.addEventListener(i,n,a);e._handlers.push({remove:function(){return t.removeEventListener(i,n,a)}})}function g(){_t("onChange")}function _(){if(e.config.wrap){["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+t+"]"),(function(i){return v(i,"click",e[t])}))}))}if(e.isMobile){vt();return}var t=debounce(X,50);e._debouncedChange=debounce(g,DEBOUNCED_CHANGE_MS);if(e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent))v(e.daysContainer,"mouseover",(function(t){if(e.config.mode==="range")Z(getEventTarget(t))}));v(e._input,"keydown",Y);if(e.calendarContainer!==undefined){v(e.calendarContainer,"keydown",Y)}if(!e.config.inline&&!e.config.static)v(window,"resize",t);if(window.ontouchstart!==undefined)v(window.document,"touchstart",H);else v(window.document,"mousedown",H);v(window.document,"focus",H,{capture:true});if(e.config.clickOpens===true){v(e._input,"focus",e.open);v(e._input,"click",e.open)}if(e.daysContainer!==undefined){v(e.monthNav,"click",Et);v(e.monthNav,["keyup","increment"],p);v(e.daysContainer,"click",ot)}if(e.timeContainer!==undefined&&e.minuteElement!==undefined&&e.hourElement!==undefined){var i=function(t){return getEventTarget(t).select()};v(e.timeContainer,["increment"],l);v(e.timeContainer,"blur",l,{capture:true});v(e.timeContainer,"click",b);v([e.hourElement,e.minuteElement],["focus","click"],i);if(e.secondElement!==undefined)v(e.secondElement,"focus",(function(){return e.secondElement&&e.secondElement.select()}));if(e.amPM!==undefined){v(e.amPM,"click",(function(t){l(t)}))}}if(e.config.allowInput){v(e._input,"blur",W)}}function m(t,i){var n=t!==undefined?e.parseDate(t):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now);var a=e.currentYear;var r=e.currentMonth;try{if(n!==undefined){e.currentYear=n.getFullYear();e.currentMonth=n.getMonth()}}catch(t){t.message="Invalid date supplied: "+n;e.config.errorHandler(t)}if(i&&e.currentYear!==a){_t("onYearChange");M()}if(i&&(e.currentYear!==a||e.currentMonth!==r)){_t("onMonthChange")}e.redraw()}function b(t){var i=getEventTarget(t);if(~i.className.indexOf("arrow"))w(t,i.classList.contains("arrowUp")?1:-1)}function w(t,i,e){var n=t&&getEventTarget(t);var a=e||n&&n.parentNode&&n.parentNode.firstChild;var r=mt("increment");r.delta=i;a&&a.dispatchEvent(r)}function x(){var t=window.document.createDocumentFragment();e.calendarContainer=createElement("div","flatpickr-calendar");e.calendarContainer.tabIndex=-1;if(!e.config.noCalendar){t.appendChild(O());e.innerContainer=createElement("div","flatpickr-innerContainer");if(e.config.weekNumbers){var i=z(),n=i.weekWrapper,a=i.weekNumbers;e.innerContainer.appendChild(n);e.weekNumbers=a;e.weekWrapper=n}e.rContainer=createElement("div","flatpickr-rContainer");e.rContainer.appendChild(C());if(!e.daysContainer){e.daysContainer=createElement("div","flatpickr-days");e.daysContainer.tabIndex=-1}S();e.rContainer.appendChild(e.daysContainer);e.innerContainer.appendChild(e.rContainer);t.appendChild(e.innerContainer)}if(e.config.enableTime){t.appendChild(R())}toggleClass(e.calendarContainer,"rangeMode",e.config.mode==="range");toggleClass(e.calendarContainer,"animate",e.config.animate===true);toggleClass(e.calendarContainer,"multiMonth",e.config.showMonths>1);e.calendarContainer.appendChild(t);var r=e.config.appendTo!==undefined&&e.config.appendTo.nodeType!==undefined;if(e.config.inline||e.config.static){e.calendarContainer.classList.add(e.config.inline?"inline":"static");if(e.config.inline){if(!r&&e.element.parentNode)e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling);else if(e.config.appendTo!==undefined)e.config.appendTo.appendChild(e.calendarContainer)}if(e.config.static){var o=createElement("div","flatpickr-wrapper");if(e.element.parentNode)e.element.parentNode.insertBefore(o,e.element);o.appendChild(e.element);if(e.altInput)o.appendChild(e.altInput);o.appendChild(e.calendarContainer)}}if(!e.config.static&&!e.config.inline)(e.config.appendTo!==undefined?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function y(t,i,n,a){var r=V(i,true),o=createElement("span",t,i.getDate().toString());o.dateObj=i;o.$i=a;o.setAttribute("aria-label",e.formatDate(i,e.config.ariaDateFormat));if(t.indexOf("hidden")===-1&&compareDates(i,e.now)===0){e.todayDateElem=o;o.classList.add("today");o.setAttribute("aria-current","date")}if(r){o.tabIndex=-1;if(bt(i)){o.classList.add("selected");e.selectedDateElem=o;if(e.config.mode==="range"){toggleClass(o,"startRange",e.selectedDates[0]&&compareDates(i,e.selectedDates[0],true)===0);toggleClass(o,"endRange",e.selectedDates[1]&&compareDates(i,e.selectedDates[1],true)===0);if(t==="nextMonthDay")o.classList.add("inRange")}}}else{o.classList.add("flatpickr-disabled")}if(e.config.mode==="range"){if(wt(i)&&!bt(i))o.classList.add("inRange")}if(e.weekNumbers&&e.config.showMonths===1&&t!=="prevMonthDay"&&a%7===6){e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(i)+"</span>")}_t("onDayCreate",o);return o}function k(t){t.focus();if(e.config.mode==="range")Z(t)}function E(t){var i=t>0?0:e.config.showMonths-1;var n=t>0?e.config.showMonths:-1;for(var a=i;a!=n;a+=t){var r=e.daysContainer.children[a];var o=t>0?0:r.children.length-1;var s=t>0?r.children.length:-1;for(var l=o;l!=s;l+=t){var u=r.children[l];if(u.className.indexOf("hidden")===-1&&V(u.dateObj))return u}}return undefined}function I(t,i){var n=t.className.indexOf("Month")===-1?t.dateObj.getMonth():e.currentMonth;var a=i>0?e.config.showMonths:-1;var r=i>0?1:-1;for(var o=n-e.currentMonth;o!=a;o+=r){var s=e.daysContainer.children[o];var l=n-e.currentMonth===o?t.$i+i:i<0?s.children.length-1:0;var u=s.children.length;for(var c=l;c>=0&&c<u&&c!=(i>0?u:-1);c+=r){var f=s.children[c];if(f.className.indexOf("hidden")===-1&&V(f.dateObj)&&Math.abs(t.$i-c)>=Math.abs(i))return k(f)}}e.changeMonth(r);T(E(r),0);return undefined}function T(t,i){var n=r();var a=q(n||document.body);var o=t!==undefined?t:a?n:e.selectedDateElem!==undefined&&q(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==undefined&&q(e.todayDateElem)?e.todayDateElem:E(i>0?1:-1);if(o===undefined){e._input.focus()}else if(!a){k(o)}else{I(o,i)}}function A(t,i){var n=(new Date(t,i,1).getDay()-e.l10n.firstDayOfWeek+7)%7;var a=e.utils.getDaysInMonth((i-1+12)%12,t);var r=e.utils.getDaysInMonth(i,t),o=window.document.createDocumentFragment(),s=e.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",u=s?"nextMonthDay hidden":"nextMonthDay";var c=a+1-n,f=0;for(;c<=a;c++,f++){o.appendChild(y("flatpickr-day "+l,new Date(t,i-1,c),c,f))}for(c=1;c<=r;c++,f++){o.appendChild(y("flatpickr-day",new Date(t,i,c),c,f))}for(var d=r+1;d<=42-n&&(e.config.showMonths===1||f%7!==0);d++,f++){o.appendChild(y("flatpickr-day "+u,new Date(t,i+1,d%r),d,f))}var h=createElement("div","dayContainer");h.appendChild(o);return h}function S(){if(e.daysContainer===undefined){return}clearNode(e.daysContainer);if(e.weekNumbers)clearNode(e.weekNumbers);var t=document.createDocumentFragment();for(var i=0;i<e.config.showMonths;i++){var n=new Date(e.currentYear,e.currentMonth,1);n.setMonth(e.currentMonth+i);t.appendChild(A(n.getFullYear(),n.getMonth()))}e.daysContainer.appendChild(t);e.days=e.daysContainer.firstChild;if(e.config.mode==="range"&&e.selectedDates.length===1){Z()}}function M(){if(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")return;var t=function(t){if(e.config.minDate!==undefined&&e.currentYear===e.config.minDate.getFullYear()&&t<e.config.minDate.getMonth()){return false}return!(e.config.maxDate!==undefined&&e.currentYear===e.config.maxDate.getFullYear()&&t>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1;e.monthsDropdownContainer.innerHTML="";for(var i=0;i<12;i++){if(!t(i))continue;var n=createElement("option","flatpickr-monthDropdown-month");n.value=new Date(e.currentYear,i).getMonth().toString();n.textContent=monthToStr(i,e.config.shorthandCurrentMonth,e.l10n);n.tabIndex=-1;if(e.currentMonth===i){n.selected=true}e.monthsDropdownContainer.appendChild(n)}}function D(){var t=createElement("div","flatpickr-month");var i=window.document.createDocumentFragment();var n;if(e.config.showMonths>1||e.config.monthSelectorType==="static"){n=createElement("span","cur-month")}else{e.monthsDropdownContainer=createElement("select","flatpickr-monthDropdown-months");e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel);v(e.monthsDropdownContainer,"change",(function(t){var i=getEventTarget(t);var n=parseInt(i.value,10);e.changeMonth(n-e.currentMonth);_t("onMonthChange")}));M();n=e.monthsDropdownContainer}var a=createNumberInput("cur-year",{tabindex:"-1"});var r=a.getElementsByTagName("input")[0];r.setAttribute("aria-label",e.l10n.yearAriaLabel);if(e.config.minDate){r.setAttribute("min",e.config.minDate.getFullYear().toString())}if(e.config.maxDate){r.setAttribute("max",e.config.maxDate.getFullYear().toString());r.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear()}var o=createElement("div","flatpickr-current-month");o.appendChild(n);o.appendChild(a);i.appendChild(o);t.appendChild(i);return{container:t,yearElement:r,monthElement:n}}function P(){clearNode(e.monthNav);e.monthNav.appendChild(e.prevMonthNav);if(e.config.showMonths){e.yearElements=[];e.monthElements=[]}for(var t=e.config.showMonths;t--;){var i=D();e.yearElements.push(i.yearElement);e.monthElements.push(i.monthElement);e.monthNav.appendChild(i.container)}e.monthNav.appendChild(e.nextMonthNav)}function O(){e.monthNav=createElement("div","flatpickr-months");e.yearElements=[];e.monthElements=[];e.prevMonthNav=createElement("span","flatpickr-prev-month");e.prevMonthNav.innerHTML=e.config.prevArrow;e.nextMonthNav=createElement("span","flatpickr-next-month");e.nextMonthNav.innerHTML=e.config.nextArrow;P();Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(t){if(e.__hidePrevMonthArrow!==t){toggleClass(e.prevMonthNav,"flatpickr-disabled",t);e.__hidePrevMonthArrow=t}}});Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(t){if(e.__hideNextMonthArrow!==t){toggleClass(e.nextMonthNav,"flatpickr-disabled",t);e.__hideNextMonthArrow=t}}});e.currentYearElement=e.yearElements[0];xt();return e.monthNav}function R(){e.calendarContainer.classList.add("hasTime");if(e.config.noCalendar)e.calendarContainer.classList.add("noCalendar");var t=getDefaultHours(e.config);e.timeContainer=createElement("div","flatpickr-time");e.timeContainer.tabIndex=-1;var i=createElement("span","flatpickr-time-separator",":");var n=createNumberInput("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=n.getElementsByTagName("input")[0];var a=createNumberInput("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});e.minuteElement=a.getElementsByTagName("input")[0];e.hourElement.tabIndex=e.minuteElement.tabIndex=-1;e.hourElement.value=pad(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?t.hours:c(t.hours));e.minuteElement.value=pad(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():t.minutes);e.hourElement.setAttribute("step",e.config.hourIncrement.toString());e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString());e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1");e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12");e.hourElement.setAttribute("maxlength","2");e.minuteElement.setAttribute("min","0");e.minuteElement.setAttribute("max","59");e.minuteElement.setAttribute("maxlength","2");e.timeContainer.appendChild(n);e.timeContainer.appendChild(i);e.timeContainer.appendChild(a);if(e.config.time_24hr)e.timeContainer.classList.add("time24hr");if(e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var r=createNumberInput("flatpickr-second");e.secondElement=r.getElementsByTagName("input")[0];e.secondElement.value=pad(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():t.seconds);e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step"));e.secondElement.setAttribute("min","0");e.secondElement.setAttribute("max","59");e.secondElement.setAttribute("maxlength","2");e.timeContainer.appendChild(createElement("span","flatpickr-time-separator",":"));e.timeContainer.appendChild(r)}if(!e.config.time_24hr){e.amPM=createElement("span","flatpickr-am-pm",e.l10n.amPM[int((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]);e.amPM.title=e.l10n.toggleTitle;e.amPM.tabIndex=-1;e.timeContainer.appendChild(e.amPM)}return e.timeContainer}function C(){if(!e.weekdayContainer)e.weekdayContainer=createElement("div","flatpickr-weekdays");else clearNode(e.weekdayContainer);for(var t=e.config.showMonths;t--;){var i=createElement("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(i)}L();return e.weekdayContainer}function L(){if(!e.weekdayContainer){return}var t=e.l10n.firstDayOfWeek;var i=__spreadArrays(e.l10n.weekdays.shorthand);if(t>0&&t<i.length){i=__spreadArrays(i.splice(t,i.length),i.splice(0,t))}for(var n=e.config.showMonths;n--;){e.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+i.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function z(){e.calendarContainer.classList.add("hasWeeks");var t=createElement("div","flatpickr-weekwrapper");t.appendChild(createElement("span","flatpickr-weekday",e.l10n.weekAbbreviation));var i=createElement("div","flatpickr-weeks");t.appendChild(i);return{weekWrapper:t,weekNumbers:i}}function G(t,i){if(i===void 0){i=true}var n=i?t:t-e.currentMonth;if(n<0&&e._hidePrevMonthArrow===true||n>0&&e._hideNextMonthArrow===true)return;e.currentMonth+=n;if(e.currentMonth<0||e.currentMonth>11){e.currentYear+=e.currentMonth>11?1:-1;e.currentMonth=(e.currentMonth+12)%12;_t("onYearChange");M()}S();_t("onMonthChange");xt()}function F(t,i){if(t===void 0){t=true}if(i===void 0){i=true}e.input.value="";if(e.altInput!==undefined)e.altInput.value="";if(e.mobileInput!==undefined)e.mobileInput.value="";e.selectedDates=[];e.latestSelectedDateObj=undefined;if(i===true){e.currentYear=e._initialDate.getFullYear();e.currentMonth=e._initialDate.getMonth()}if(e.config.enableTime===true){var n=getDefaultHours(e.config),a=n.hours,r=n.minutes,o=n.seconds;h(a,r,o)}e.redraw();if(t)_t("onChange")}function N(){e.isOpen=false;if(!e.isMobile){if(e.calendarContainer!==undefined){e.calendarContainer.classList.remove("open")}if(e._input!==undefined){e._input.classList.remove("active")}}_t("onClose")}function B(){if(e.config!==undefined)_t("onDestroy");for(var t=e._handlers.length;t--;){e._handlers[t].remove()}e._handlers=[];if(e.mobileInput){if(e.mobileInput.parentNode)e.mobileInput.parentNode.removeChild(e.mobileInput);e.mobileInput=undefined}else if(e.calendarContainer&&e.calendarContainer.parentNode){if(e.config.static&&e.calendarContainer.parentNode){var i=e.calendarContainer.parentNode;i.lastChild&&i.removeChild(i.lastChild);if(i.parentNode){while(i.firstChild)i.parentNode.insertBefore(i.firstChild,i);i.parentNode.removeChild(i)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer)}if(e.altInput){e.input.type="text";if(e.altInput.parentNode)e.altInput.parentNode.removeChild(e.altInput);delete e.altInput}if(e.input){e.input.type=e.input._type;e.input.classList.remove("flatpickr-input");e.input.removeAttribute("readonly")}["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete e[t]}catch(t){}}))}function j(t){return e.calendarContainer.contains(t)}function H(t){if(e.isOpen&&!e.config.inline){var i=getEventTarget(t);var n=j(i);var a=i===e.input||i===e.altInput||e.element.contains(i)||t.path&&t.path.indexOf&&(~t.path.indexOf(e.input)||~t.path.indexOf(e.altInput));var r=!a&&!n&&!j(t.relatedTarget);var o=!e.config.ignoredFocusElements.some((function(t){return t.contains(i)}));if(r&&o){if(e.config.allowInput){e.setDate(e._input.value,false,e.config.altInput?e.config.altFormat:e.config.dateFormat)}if(e.timeContainer!==undefined&&e.minuteElement!==undefined&&e.hourElement!==undefined&&e.input.value!==""&&e.input.value!==undefined){l()}e.close();if(e.config&&e.config.mode==="range"&&e.selectedDates.length===1)e.clear(false)}}}function U(t){if(!t||e.config.minDate&&t<e.config.minDate.getFullYear()||e.config.maxDate&&t>e.config.maxDate.getFullYear())return;var i=t,n=e.currentYear!==i;e.currentYear=i||e.currentYear;if(e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()){e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth)}else if(e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()){e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)}if(n){e.redraw();_t("onYearChange");M()}}function V(t,i){var n;if(i===void 0){i=true}var a=e.parseDate(t,undefined,i);if(e.config.minDate&&a&&compareDates(a,e.config.minDate,i!==undefined?i:!e.minDateHasTime)<0||e.config.maxDate&&a&&compareDates(a,e.config.maxDate,i!==undefined?i:!e.maxDateHasTime)>0)return false;if(!e.config.enable&&e.config.disable.length===0)return true;if(a===undefined)return false;var r=!!e.config.enable,o=(n=e.config.enable)!==null&&n!==void 0?n:e.config.disable;for(var s=0,l=void 0;s<o.length;s++){l=o[s];if(typeof l==="function"&&l(a))return r;else if(l instanceof Date&&a!==undefined&&l.getTime()===a.getTime())return r;else if(typeof l==="string"){var u=e.parseDate(l,undefined,true);return u&&u.getTime()===a.getTime()?r:!r}else if(typeof l==="object"&&a!==undefined&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return r}return!r}function q(t){if(e.daysContainer!==undefined)return t.className.indexOf("hidden")===-1&&t.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(t);return false}function W(t){var i=t.target===e._input;var n=e._input.value.trimEnd()!==yt();if(i&&n&&!(t.relatedTarget&&j(t.relatedTarget))){e.setDate(e._input.value,true,t.target===e.altInput?e.config.altFormat:e.config.dateFormat)}}function Y(i){var n=getEventTarget(i);var a=e.config.wrap?t.contains(n):n===e._input;var o=e.config.allowInput;var s=e.isOpen&&(!o||!a);var u=e.config.inline&&a&&!o;if(i.keyCode===13&&a){if(o){e.setDate(e._input.value,true,n===e.altInput?e.config.altFormat:e.config.dateFormat);e.close();return n.blur()}else{e.open()}}else if(j(n)||s||u){var c=!!e.timeContainer&&e.timeContainer.contains(n);switch(i.keyCode){case 13:if(c){i.preventDefault();l();rt()}else ot(i);break;case 27:i.preventDefault();rt();break;case 8:case 46:if(a&&!e.config.allowInput){i.preventDefault();e.clear()}break;case 37:case 39:if(!c&&!a){i.preventDefault();var d=r();if(e.daysContainer!==undefined&&(o===false||d&&q(d))){var h=i.keyCode===39?1:-1;if(!i.ctrlKey)T(undefined,h);else{i.stopPropagation();G(h);T(E(1),0)}}}else if(e.hourElement)e.hourElement.focus();break;case 38:case 40:i.preventDefault();var p=i.keyCode===40?1:-1;if(e.daysContainer&&n.$i!==undefined||n===e.input||n===e.altInput){if(i.ctrlKey){i.stopPropagation();U(e.currentYear-p);T(E(1),0)}else if(!c)T(undefined,p*7)}else if(n===e.currentYearElement){U(e.currentYear-p)}else if(e.config.enableTime){if(!c&&e.hourElement)e.hourElement.focus();l(i);e._debouncedChange()}break;case 9:if(c){var v=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter((function(t){return t}));var g=v.indexOf(n);if(g!==-1){var _=v[g+(i.shiftKey?-1:1)];i.preventDefault();(_||e._input).focus()}}else if(!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(n)&&i.shiftKey){i.preventDefault();e._input.focus()}break}}if(e.amPM!==undefined&&n===e.amPM){switch(i.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0];f();kt();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1];f();kt();break}}if(a||j(n)){_t("onKeyDown",i)}}function Z(t,i){if(i===void 0){i="flatpickr-day"}if(e.selectedDates.length!==1||t&&(!t.classList.contains(i)||t.classList.contains("flatpickr-disabled")))return;var n=t?t.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),a=e.parseDate(e.selectedDates[0],undefined,true).getTime(),r=Math.min(n,e.selectedDates[0].getTime()),o=Math.max(n,e.selectedDates[0].getTime());var s=false;var l=0,u=0;for(var c=r;c<o;c+=duration.DAY){if(!V(new Date(c),true)){s=s||c>r&&c<o;if(c<a&&(!l||c>l))l=c;else if(c>a&&(!u||c<u))u=c}}var f=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+i));f.forEach((function(i){var r=i.dateObj;var o=r.getTime();var c=l>0&&o<l||u>0&&o>u;if(c){i.classList.add("notAllowed");["inRange","startRange","endRange"].forEach((function(t){i.classList.remove(t)}));return}else if(s&&!c)return;["startRange","inRange","endRange","notAllowed"].forEach((function(t){i.classList.remove(t)}));if(t!==undefined){t.classList.add(n<=e.selectedDates[0].getTime()?"startRange":"endRange");if(a<n&&o===a)i.classList.add("startRange");else if(a>n&&o===a)i.classList.add("endRange");if(o>=l&&(u===0||o<=u)&&isBetween(o,a,n))i.classList.add("inRange")}}))}function X(){if(e.isOpen&&!e.config.static&&!e.config.inline)it()}function Q(t,i){if(i===void 0){i=e._positionElement}if(e.isMobile===true){if(t){t.preventDefault();var n=getEventTarget(t);if(n){n.blur()}}if(e.mobileInput!==undefined){e.mobileInput.focus();e.mobileInput.click()}_t("onOpen");return}else if(e._input.disabled||e.config.inline){return}var a=e.isOpen;e.isOpen=true;if(!a){e.calendarContainer.classList.add("open");e._input.classList.add("active");_t("onOpen");it(i)}if(e.config.enableTime===true&&e.config.noCalendar===true){if(e.config.allowInput===false&&(t===undefined||!e.timeContainer.contains(t.relatedTarget))){setTimeout((function(){return e.hourElement.select()}),50)}}}function $(t){return function(i){var n=e.config["_"+t+"Date"]=e.parseDate(i,e.config.dateFormat);var a=e.config["_"+(t==="min"?"max":"min")+"Date"];if(n!==undefined){e[t==="min"?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0}if(e.selectedDates){e.selectedDates=e.selectedDates.filter((function(t){return V(t)}));if(!e.selectedDates.length&&t==="min")d(n);kt()}if(e.daysContainer){at();if(n!==undefined)e.currentYearElement[t]=n.getFullYear().toString();else e.currentYearElement.removeAttribute(t);e.currentYearElement.disabled=!!a&&n!==undefined&&a.getFullYear()===n.getFullYear()}}}function K(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"];var a=__assign(__assign({},JSON.parse(JSON.stringify(t.dataset||{}))),i);var r={};e.config.parseDate=a.parseDate;e.config.formatDate=a.formatDate;Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(t){e.config._enable=ft(t)}});Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(t){e.config._disable=ft(t)}});var s=a.mode==="time";if(!a.dateFormat&&(a.enableTime||s)){var l=flatpickr.defaultConfig.dateFormat||defaults.dateFormat;r.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var u=flatpickr.defaultConfig.altFormat||defaults.altFormat;r.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):u+(" h:i"+(a.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:$("min")});Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:$("max")});var c=function(t){return function(i){e.config[t==="min"?"_minTime":"_maxTime"]=e.parseDate(i,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:c("min")});Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:c("max")});if(a.mode==="time"){e.config.noCalendar=true;e.config.enableTime=true}Object.assign(e.config,r,a);for(var f=0;f<n.length;f++)e.config[n[f]]=e.config[n[f]]===true||e.config[n[f]]==="true";HOOKS.filter((function(t){return e.config[t]!==undefined})).forEach((function(t){e.config[t]=arrayify(e.config[t]||[]).map(o)}));e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var f=0;f<e.config.plugins.length;f++){var d=e.config.plugins[f](e)||{};for(var h in d){if(HOOKS.indexOf(h)>-1){e.config[h]=arrayify(d[h]).map(o).concat(e.config[h])}else if(typeof a[h]==="undefined")e.config[h]=d[h]}}if(!a.altInputClass){e.config.altInputClass=J().className+" "+e.config.altInputClass}_t("onParseConfig")}function J(){return e.config.wrap?t.querySelector("[data-input]"):t}function tt(){if(typeof e.config.locale!=="object"&&typeof flatpickr.l10ns[e.config.locale]==="undefined")e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale));e.l10n=__assign(__assign({},flatpickr.l10ns.default),typeof e.config.locale==="object"?e.config.locale:e.config.locale!=="default"?flatpickr.l10ns[e.config.locale]:undefined);tokenRegex.D="("+e.l10n.weekdays.shorthand.join("|")+")";tokenRegex.l="("+e.l10n.weekdays.longhand.join("|")+")";tokenRegex.M="("+e.l10n.months.shorthand.join("|")+")";tokenRegex.F="("+e.l10n.months.longhand.join("|")+")";tokenRegex.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var n=__assign(__assign({},i),JSON.parse(JSON.stringify(t.dataset||{})));if(n.time_24hr===undefined&&flatpickr.defaultConfig.time_24hr===undefined){e.config.time_24hr=e.l10n.time_24hr}e.formatDate=createDateFormatter(e);e.parseDate=createDateParser({config:e.config,l10n:e.l10n})}function it(t){if(typeof e.config.position==="function"){return void e.config.position(e,t)}if(e.calendarContainer===undefined)return;_t("onPreCalendarPosition");var i=t||e._positionElement;var n=Array.prototype.reduce.call(e.calendarContainer.children,(function(t,i){return t+i.offsetHeight}),0),a=e.calendarContainer.offsetWidth,r=e.config.position.split(" "),o=r[0],s=r.length>1?r[1]:null,l=i.getBoundingClientRect(),u=window.innerHeight-l.bottom,c=o==="above"||o!=="below"&&u<n&&l.top>n;var f=window.pageYOffset+l.top+(!c?i.offsetHeight+2:-n-2);toggleClass(e.calendarContainer,"arrowTop",!c);toggleClass(e.calendarContainer,"arrowBottom",c);if(e.config.inline)return;var d=window.pageXOffset+l.left;var h=false;var p=false;if(s==="center"){d-=(a-l.width)/2;h=true}else if(s==="right"){d-=a-l.width;p=true}toggleClass(e.calendarContainer,"arrowLeft",!h&&!p);toggleClass(e.calendarContainer,"arrowCenter",h);toggleClass(e.calendarContainer,"arrowRight",p);var v=window.document.body.offsetWidth-(window.pageXOffset+l.right);var g=d+a>window.document.body.offsetWidth;var _=v+a>window.document.body.offsetWidth;toggleClass(e.calendarContainer,"rightMost",g);if(e.config.static)return;e.calendarContainer.style.top=f+"px";if(!g){e.calendarContainer.style.left=d+"px";e.calendarContainer.style.right="auto"}else if(!_){e.calendarContainer.style.left="auto";e.calendarContainer.style.right=v+"px"}else{var m=et();if(m===undefined)return;var b=window.document.body.offsetWidth;var w=Math.max(0,b/2-a/2);var x=".flatpickr-calendar.centerMost:before";var y=".flatpickr-calendar.centerMost:after";var k=m.cssRules.length;var E="{left:"+l.left+"px;right:auto;}";toggleClass(e.calendarContainer,"rightMost",false);toggleClass(e.calendarContainer,"centerMost",true);m.insertRule(x+","+y+E,k);e.calendarContainer.style.left=w+"px";e.calendarContainer.style.right="auto"}}function et(){var t=null;for(var i=0;i<document.styleSheets.length;i++){var e=document.styleSheets[i];if(!e.cssRules)continue;t=e;break}return t!=null?t:nt()}function nt(){var t=document.createElement("style");document.head.appendChild(t);return t.sheet}function at(){if(e.config.noCalendar||e.isMobile)return;M();xt();S()}function rt(){e._input.focus();if(window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==undefined){setTimeout(e.close,0)}else{e.close()}}function ot(t){t.preventDefault();t.stopPropagation();var i=function(t){return t.classList&&t.classList.contains("flatpickr-day")&&!t.classList.contains("flatpickr-disabled")&&!t.classList.contains("notAllowed")};var n=findParent(getEventTarget(t),i);if(n===undefined)return;var a=n;var r=e.latestSelectedDateObj=new Date(a.dateObj.getTime());var o=(r.getMonth()<e.currentMonth||r.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";e.selectedDateElem=a;if(e.config.mode==="single")e.selectedDates=[r];else if(e.config.mode==="multiple"){var s=bt(r);if(s)e.selectedDates.splice(parseInt(s),1);else e.selectedDates.push(r)}else if(e.config.mode==="range"){if(e.selectedDates.length===2){e.clear(false,false)}e.latestSelectedDateObj=r;e.selectedDates.push(r);if(compareDates(r,e.selectedDates[0],true)!==0)e.selectedDates.sort((function(t,i){return t.getTime()-i.getTime()}))}f();if(o){var l=e.currentYear!==r.getFullYear();e.currentYear=r.getFullYear();e.currentMonth=r.getMonth();if(l){_t("onYearChange");M()}_t("onMonthChange")}xt();S();kt();if(!o&&e.config.mode!=="range"&&e.config.showMonths===1)k(a);else if(e.selectedDateElem!==undefined&&e.hourElement===undefined){e.selectedDateElem&&e.selectedDateElem.focus()}if(e.hourElement!==undefined)e.hourElement!==undefined&&e.hourElement.focus();if(e.config.closeOnSelect){var u=e.config.mode==="single"&&!e.config.enableTime;var c=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;if(u||c){rt()}}g()}var st={locale:[tt,L],showMonths:[P,s,C],minDate:[m],maxDate:[m],positionElement:[pt],clickOpens:[function(){if(e.config.clickOpens===true){v(e._input,"focus",e.open);v(e._input,"click",e.open)}else{e._input.removeEventListener("focus",e.open);e._input.removeEventListener("click",e.open)}}]};function lt(t,i){if(t!==null&&typeof t==="object"){Object.assign(e.config,t);for(var n in t){if(st[n]!==undefined)st[n].forEach((function(t){return t()}))}}else{e.config[t]=i;if(st[t]!==undefined)st[t].forEach((function(t){return t()}));else if(HOOKS.indexOf(t)>-1)e.config[t]=arrayify(i)}e.redraw();kt(true)}function ut(t,i){var n=[];if(t instanceof Array)n=t.map((function(t){return e.parseDate(t,i)}));else if(t instanceof Date||typeof t==="number")n=[e.parseDate(t,i)];else if(typeof t==="string"){switch(e.config.mode){case"single":case"time":n=[e.parseDate(t,i)];break;case"multiple":n=t.split(e.config.conjunction).map((function(t){return e.parseDate(t,i)}));break;case"range":n=t.split(e.l10n.rangeSeparator).map((function(t){return e.parseDate(t,i)}));break}}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));e.selectedDates=e.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&V(t,false)}));if(e.config.mode==="range")e.selectedDates.sort((function(t,i){return t.getTime()-i.getTime()}))}function ct(t,i,n){if(i===void 0){i=false}if(n===void 0){n=e.config.dateFormat}if(t!==0&&!t||t instanceof Array&&t.length===0)return e.clear(i);ut(t,n);e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1];e.redraw();m(undefined,i);d();if(e.selectedDates.length===0){e.clear(false)}kt(i);if(i)_t("onChange")}function ft(t){return t.slice().map((function(t){if(typeof t==="string"||typeof t==="number"||t instanceof Date){return e.parseDate(t,undefined,true)}else if(t&&typeof t==="object"&&t.from&&t.to)return{from:e.parseDate(t.from,undefined),to:e.parseDate(t.to,undefined)};return t})).filter((function(t){return t}))}function dt(){e.selectedDates=[];e.now=e.parseDate(e.config.now)||new Date;var t=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);if(t)ut(t,e.config.dateFormat);e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now;e.currentYear=e._initialDate.getFullYear();e.currentMonth=e._initialDate.getMonth();if(e.selectedDates.length>0)e.latestSelectedDateObj=e.selectedDates[0];if(e.config.minTime!==undefined)e.config.minTime=e.parseDate(e.config.minTime,"H:i");if(e.config.maxTime!==undefined)e.config.maxTime=e.parseDate(e.config.maxTime,"H:i");e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0);e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function ht(){e.input=J();if(!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type;e.input.type="text";e.input.classList.add("flatpickr-input");e._input=e.input;if(e.config.altInput){e.altInput=createElement(e.input.nodeName,e.config.altInputClass);e._input=e.altInput;e.altInput.placeholder=e.input.placeholder;e.altInput.disabled=e.input.disabled;e.altInput.required=e.input.required;e.altInput.tabIndex=e.input.tabIndex;e.altInput.type="text";e.input.setAttribute("type","hidden");if(!e.config.static&&e.input.parentNode)e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)}if(!e.config.allowInput)e._input.setAttribute("readonly","readonly");pt()}function pt(){e._positionElement=e.config.positionElement||e._input}function vt(){var t=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=createElement("input",e.input.className+" flatpickr-mobile");e.mobileInput.tabIndex=1;e.mobileInput.type=t;e.mobileInput.disabled=e.input.disabled;e.mobileInput.required=e.input.required;e.mobileInput.placeholder=e.input.placeholder;e.mobileFormatStr=t==="datetime-local"?"Y-m-d\\TH:i:S":t==="date"?"Y-m-d":"H:i:S";if(e.selectedDates.length>0){e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)}if(e.config.minDate)e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d");if(e.config.maxDate)e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d");if(e.input.getAttribute("step"))e.mobileInput.step=String(e.input.getAttribute("step"));e.input.type="hidden";if(e.altInput!==undefined)e.altInput.type="hidden";try{if(e.input.parentNode)e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch(t){}v(e.mobileInput,"change",(function(t){e.setDate(getEventTarget(t).value,false,e.mobileFormatStr);_t("onChange");_t("onClose")}))}function gt(t){if(e.isOpen===true)return e.close();e.open(t)}function _t(t,i){if(e.config===undefined)return;var n=e.config[t];if(n!==undefined&&n.length>0){for(var a=0;n[a]&&a<n.length;a++)n[a](e.selectedDates,e.input.value,e,i)}if(t==="onChange"){e.input.dispatchEvent(mt("change"));e.input.dispatchEvent(mt("input"))}}function mt(t){var i=document.createEvent("Event");i.initEvent(t,true,true);return i}function bt(t){for(var i=0;i<e.selectedDates.length;i++){var n=e.selectedDates[i];if(n instanceof Date&&compareDates(n,t)===0)return""+i}return false}function wt(t){if(e.config.mode!=="range"||e.selectedDates.length<2)return false;return compareDates(t,e.selectedDates[0])>=0&&compareDates(t,e.selectedDates[1])<=0}function xt(){if(e.config.noCalendar||e.isMobile||!e.monthNav)return;e.yearElements.forEach((function(t,i){var n=new Date(e.currentYear,e.currentMonth,1);n.setMonth(e.currentMonth+i);if(e.config.showMonths>1||e.config.monthSelectorType==="static"){e.monthElements[i].textContent=monthToStr(n.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" "}else{e.monthsDropdownContainer.value=n.getMonth().toString()}t.value=n.getFullYear().toString()}));e._hidePrevMonthArrow=e.config.minDate!==undefined&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear());e._hideNextMonthArrow=e.config.maxDate!==undefined&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear())}function yt(t){var i=t||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map((function(t){return e.formatDate(t,i)})).filter((function(t,i,n){return e.config.mode!=="range"||e.config.enableTime||n.indexOf(t)===i})).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function kt(t){if(t===void 0){t=true}if(e.mobileInput!==undefined&&e.mobileFormatStr){e.mobileInput.value=e.latestSelectedDateObj!==undefined?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""}e.input.value=yt(e.config.dateFormat);if(e.altInput!==undefined){e.altInput.value=yt(e.config.altFormat)}if(t!==false)_t("onValueUpdate")}function Et(t){var i=getEventTarget(t);var n=e.prevMonthNav.contains(i);var a=e.nextMonthNav.contains(i);if(n||a){G(n?-1:1)}else if(e.yearElements.indexOf(i)>=0){i.select()}else if(i.classList.contains("arrowUp")){e.changeYear(e.currentYear+1)}else if(i.classList.contains("arrowDown")){e.changeYear(e.currentYear-1)}}function It(t){t.preventDefault();var i=t.type==="keydown",n=getEventTarget(t),a=n;if(e.amPM!==undefined&&n===e.amPM){e.amPM.textContent=e.l10n.amPM[int(e.amPM.textContent===e.l10n.amPM[0])]}var r=parseFloat(a.getAttribute("min")),o=parseFloat(a.getAttribute("max")),s=parseFloat(a.getAttribute("step")),l=parseInt(a.value,10),u=t.delta||(i?t.which===38?1:-1:0);var c=l+s*u;if(typeof a.value!=="undefined"&&a.value.length===2){var f=a===e.hourElement,d=a===e.minuteElement;if(c<r){c=o+c+int(!f)+(int(f)&&int(!e.amPM));if(d)w(undefined,-1,e.hourElement)}else if(c>o){c=a===e.hourElement?c-o-int(!e.amPM):r;if(d)w(undefined,1,e.hourElement)}if(e.amPM&&f&&(s===1?c+l===23:Math.abs(c-l)>s)){e.amPM.textContent=e.l10n.amPM[int(e.amPM.textContent===e.l10n.amPM[0])]}a.value=pad(c)}}a();return e}function _flatpickr(t,i){var e=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement}));var n=[];for(var a=0;a<e.length;a++){var r=e[a];try{if(r.getAttribute("data-fp-omit")!==null)continue;if(r._flatpickr!==undefined){r._flatpickr.destroy();r._flatpickr=undefined}r._flatpickr=FlatpickrInstance(r,i||{});n.push(r._flatpickr)}catch(t){console.error(t)}}return n.length===1?n[0]:n}if(typeof HTMLElement!=="undefined"&&typeof HTMLCollection!=="undefined"&&typeof NodeList!=="undefined"){HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return _flatpickr(this,t)};HTMLElement.prototype.flatpickr=function(t){return _flatpickr([this],t)}}var flatpickr=function(t,i){if(typeof t==="string"){return _flatpickr(window.document.querySelectorAll(t),i)}else if(t instanceof Node){return _flatpickr([t],i)}else{return _flatpickr(t,i)}};flatpickr.defaultConfig={};flatpickr.l10ns={en:__assign({},english),default:__assign({},english)};flatpickr.localize=function(t){flatpickr.l10ns.default=__assign(__assign({},flatpickr.l10ns.default),t)};flatpickr.setDefaults=function(t){flatpickr.defaultConfig=__assign(__assign({},flatpickr.defaultConfig),t)};flatpickr.parseDate=createDateParser({});flatpickr.formatDate=createDateFormatter({});flatpickr.compareDates=compareDates;if(typeof jQuery!=="undefined"&&typeof jQuery.fn!=="undefined"){jQuery.fn.flatpickr=function(t){return _flatpickr(this,t)}}Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t==="string"?parseInt(t,10):t))};if(typeof window!=="undefined"){window.flatpickr=flatpickr}var sallaDatetimePickerCss='.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\'\';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}';var SallaDatetimePicker=function(){function t(t){registerInstance(this,t);this.picked=createEvent(this,"picked");this.invalidInput=createEvent(this,"invalidInput");this.value=null;this.placeholder=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time");this.allowInput=true;this.allowInvalidPreload=false;this.altFormat="F j, Y";this.altInput=false;this.appendTo=undefined;this.ariaDateFormat="F j, Y";this.autoFillDefaultTime=true;this.clickOpens=true;this.closeOnSelect=true;this.dateFormat="Y-m-d";this.defaultHour=12;this.defaultMinute=0;this.defaultSeconds=0;this.disable=[];this.disableMobile=false;this.enable=[function(t){return true}];this.enableSeconds=false;this.enableTime=false;this.hourIncrement=1;this.inline=false;this.locale="en";this.maxDate=null;this.maxTime=null;this.minDate=null;this.minTime=null;this.minuteIncrement=5;this.mode="single";this.monthSelectorType="dropdown";this.nextArrow='<span class="sicon-keyboard_arrow_right"></span>';this.noCalendar=false;this.position="auto";this.prevArrow='<span class="sicon-keyboard_arrow_left"></span>';this.shorthandCurrentMonth=false;this.static=false;this.showMonths=1;this.time_24hr=false;this.weekNumbers=false;this.wrap=false;this.disabled=false}t.prototype.render=function(){var t=this;return h("div",{key:"4332a123c72d1cf71468339536d9e73f32333791",class:"s-datetime-picker"},h("input",{key:"99ae8a3a48042f43ea525fae0999d67ad216f9ce",type:"datetime",name:this.name,value:this.value,required:this.required,disabled:this.disabled,placeholder:this.placeholder,class:"s-datetime-picker-input",ref:function(i){return t.dateInput=i}}))};t.prototype.componentDidLoad=function(){var t=this;var i={allowInput:this.allowInput,allowInvalidPreload:this.allowInvalidPreload,altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,appendTo:this.appendTo,ariaDateFormat:this.ariaDateFormat,autoFillDefaultTime:this.autoFillDefaultTime,clickOpens:this.clickOpens,closeOnSelect:this.closeOnSelect,conjunction:this.conjunction,dateFormat:this.dateFormat,defaultDate:!!this.value?Date.parse(this.value):this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,defaultSeconds:this.defaultSeconds,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableSeconds:this.enableSeconds,enableTime:this.enableTime,formatDate:this.formatDate,hourIncrement:this.hourIncrement,inline:this.inline,locale:this.locale,maxDate:this.maxDate,maxTime:this.maxTime,minDate:this.minDate,minTime:this.minTime,minuteIncrement:this.minuteIncrement,mode:this.mode,monthSelectorType:this.monthSelectorType,nextArrow:this.nextArrow,noCalendar:this.noCalendar,parseDate:this.dateParser,position:this.position,positionElement:this.positionElement,prevArrow:this.prevArrow,shorthandCurrentMonth:this.shorthandCurrentMonth,static:this.static,showMonths:this.showMonths,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,onChange:function(i,e){return t.picked.emit(t.value=e)}};flatpickr(this.dateInput,i);this.dateInput.addEventListener("invalid",(function(i){t.invalidInput.emit(i)}));this.dateInput.addEventListener("input",(function(){t.dateInput.setCustomValidity("");t.dateInput.reportValidity()}))};return t}();SallaDatetimePicker.style=sallaDatetimePickerCss;var Cancel='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>cancel</title>\n<path d="M17.885 16l7.057-7.057c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-7.057 7.057-7.057-7.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l7.057 7.057-7.057 7.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l7.057-7.057 7.057 7.057c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';var AlertEngineIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert-engine</title>\n<path d="M16 18.673c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM2.667 16c0-3.092 1.083-6.105 3.047-8.484 0.469-0.568 0.389-1.408-0.179-1.877-0.568-0.468-1.408-0.388-1.877 0.179-2.359 2.857-3.657 6.473-3.657 10.183s1.299 7.325 3.657 10.183c0.264 0.319 0.645 0.484 1.029 0.484 0.299 0 0.6-0.1 0.848-0.305 0.568-0.469 0.648-1.309 0.179-1.877-1.964-2.379-3.047-5.392-3.047-8.484zM16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM28.343 5.817c-0.469-0.567-1.307-0.647-1.877-0.179-0.568 0.469-0.648 1.309-0.179 1.877 1.964 2.379 3.047 5.392 3.047 8.484s-1.083 6.105-3.047 8.484c-0.469 0.568-0.389 1.408 0.179 1.877 0.249 0.205 0.549 0.305 0.848 0.305 0.384 0 0.765-0.165 1.028-0.484 2.36-2.857 3.659-6.473 3.659-10.183s-1.299-7.325-3.657-10.183z"></path>\n</svg>\n';var CheckCircle2='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check-circle2</title>\n<path d="M29.333 14.133c-0.8 0-1.333 0.533-1.333 1.333v1.2c0 6.667-5.333 12-12 12 0 0 0 0 0 0-6.667 0-12-5.333-12-12s5.333-12 12-12c0 0 0 0 0 0 1.733 0 3.333 0.4 4.933 1.067 0.667 0.267 1.467 0 1.733-0.667s0-1.467-0.667-1.733c-1.867-0.8-3.867-1.333-6-1.333 0 0 0 0 0 0-8.133 0-14.667 6.533-14.667 14.667s6.533 14.667 14.667 14.667c0 0 0 0 0 0 8.133 0 14.667-6.533 14.667-14.667v-1.2c0-0.8-0.533-1.333-1.333-1.333zM12.933 14.4c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l4 4c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4l13.333-13.333c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-12.4 12.4-3.067-3.067z"></path>\n</svg>\n';var sallaDrawerCss="";var SallaDrawer=function(){function t(t){var i=this;registerInstance(this,t);this.drawerVisibilityChanged=createEvent(this,"drawerVisibilityChanged");this.isClosable=true;this.width="md";this.position="right";this.visible=false;this.hasSkeleton=false;this.isLoading=false;this.subTitleFirst=false;this.noPadding=false;this.subTitle="";this.centered=false;this.iconStyle=undefined;salla.event.on("drawer::open",(function(t){return t==i.host.id&&i.open()}));salla.event.on("drawer::close",(function(t){return t==i.host.id&&i.close()}));this.drawerTitle=this.host.getAttribute("drawer-title")}t.prototype.handleVisible=function(t){var i=this;if(!t){this.drawerVisibilityChanged.emit(false);this.toggleDrawer(false);return}this.drawerVisibilityChanged.emit(true);this.host.classList.remove("s-hidden");setTimeout((function(){return i.toggleDrawer(true)}))};t.prototype.handleKeyUp=function(t){if(t.key==="Escape"){this.closeDrawer()}};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.setAttribute("visible","");this.handleAutoFocus();return[2,this.host]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.host.removeAttribute("visible");return[2,this.host]}))}))};t.prototype.setTitle=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.drawerTitle=t;return[2,this.host]}))}))};t.prototype.loading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isLoading=true;return[2,this.host]}))}))};t.prototype.stopLoading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isLoading=false;return[2,this.host]}))}))};t.prototype.handleAutoFocus=function(){var t=this.host.querySelector("input, textarea, select");if(!t){return}setTimeout((function(){t.focus()}),100)};t.prototype.toggleDrawer=function(t){var i=this;var e=this.host.querySelector(".s-drawer-body");Helper.toggleElementClassIf(e,"s-drawer-entering","s-drawer-leaving",(function(){return t})).toggleElementClassIf(this.overlay,"s-drawer-entering","s-drawer-overlay-leaving",(function(){return t})).toggleElementClassIf(document.body,"drawer-is-open","drawer-is-closed",(function(){return t}));if(!t){setTimeout((function(){return i.host.classList.add("s-hidden")}),350)}};t.prototype.closeDrawer=function(t){if(!this.isClosable){return}salla.event.dispatch("drawer::close",{reason:t});this.host.removeAttribute("visible")};t.prototype.iconBlockClasses=function(){return{"s-drawer-icon":true,"s-drawer-bg-error":this.iconStyle=="error","s-drawer-bg-success":this.iconStyle=="success","s-drawer-bg-normal":!this.iconStyle,"s-drawer-bg-primary":this.iconStyle=="primary"}};t.prototype.getWidth=function(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width};t.prototype.render=function(){var t=this;this.host.id=this.host.id||"salla-drawer";if(this.isLoading){return h(Host,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:function(i){return t.handleKeyUp(i)}},h("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:function(i){return t.overlay=i},onClick:function(){return t.closeDrawer("backdropClick")}}),h("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},h("div",{class:"s-drawer-body flex justify-center s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},h("slot",{name:"loading"},h("salla-loading",null)),h("div",{class:"s-hidden"},h("slot",null)))))}return h(Host,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog"},h("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:function(i){return t.overlay=i},onClick:function(){return t.closeDrawer("backdropClick")}}),h("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},h("div",{class:"s-drawer-body s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},h("div",{class:{"s-drawer-header":true,"s-drawer-is-center":this.centered}},this.isClosable?h("button",{class:"s-drawer-close",onClick:function(){return t.closeDrawer("closeButtonClick")},type:"button"},h("span",{innerHTML:Cancel})):"",this.drawerTitle||this.subTitle?h("div",{class:"s-drawer-header-inner"},h("slot",{name:"icon"},!!this.iconStyle?h("div",{class:this.iconBlockClasses(),innerHTML:this.iconStyle=="error"?AlertEngineIcon:CheckCircle2}):""),h("div",{class:"s-drawer-header-content"},this.drawerTitle?h("div",{class:{"s-drawer-title":true,"s-drawer-title-below":this.subTitleFirst},innerHTML:this.drawerTitle}):"",this.subTitle?h("p",{class:{"s-drawer-sub-title":true},innerHTML:this.subTitle}):"")):""),h("slot",null),h("slot",{name:"footer"}))))};t.prototype.componentDidLoad=function(){document.body.append(this.host)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{visible:["handleVisible"]}},enumerable:false,configurable:true});return t}();SallaDrawer.style=sallaDrawerCss;var filepond$1={exports:{}};
|
|
12
12
|
/*!
|
|
13
13
|
* FilePond 4.32.8
|
|
14
14
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
15
15
|
* Please visit https://pqina.nl/filepond/ for details.
|
|
16
|
-
*/var filepond=filepond$1.exports;var hasRequiredFilepond;function requireFilepond(){if(hasRequiredFilepond)return filepond$1.exports;hasRequiredFilepond=1;(function(t,i){(function(t,e){e(i)})(filepond,(function(t){var i=function t(i){return i instanceof HTMLElement};var e=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var a=Object.assign({},i);var r=[];var o=[];var s=function t(){return Object.assign({},a)};var l=function t(){var i=[].concat(r);r.length=0;return i};var u=function t(){var i=[].concat(o);o.length=0;i.forEach((function(t){var i=t.type,e=t.data;c(i,e)}))};var c=function t(i,e,n){if(n&&!document.hidden){o.push({type:i,data:e});return}if(p[i]){p[i](e)}r.push({type:i,data:e})};var f=function t(i){var e;for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++){a[r-1]=arguments[r]}return h[i]?(e=h)[i].apply(e,a):null};var d={getState:s,processActionQueue:l,processDispatchQueue:u,dispatch:c,query:f};var h={};e.forEach((function(t){h=Object.assign({},t(a),{},h)}));var p={};n.forEach((function(t){p=Object.assign({},t(c,f,a),{},p)}));return d};var n=function t(i,e,n){if(typeof n==="function"){i[e]=n;return}Object.defineProperty(i,e,Object.assign({},n))};var a=function t(i,e){for(var n in i){if(!i.hasOwnProperty(n)){continue}e(n,i[n])}};var r=function t(i){var e={};a(i,(function(t){n(e,t,i[t])}));return e};var o=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(n===null){return i.getAttribute(e)||i.hasAttribute(e)}i.setAttribute(e,n)};var s="http://www.w3.org/2000/svg";var l=["svg","path"];var u=function t(i){return l.includes(i)};var c=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(typeof e==="object"){n=e;e=null}var r=u(i)?document.createElementNS(s,i):document.createElement(i);if(e){if(u(i)){o(r,"class",e)}else{r.className=e}}a(n,(function(t,i){o(r,t,i)}));return r};var f=function t(i){return function(t,e){if(typeof e!=="undefined"&&i.children[e]){i.insertBefore(t,i.children[e])}else{i.appendChild(t)}}};var d=function t(i,e){return function(t,i){if(typeof i!=="undefined"){e.splice(i,0,t)}else{e.push(t)}return t}};var h=function t(i,e){return function(t){e.splice(e.indexOf(t),1);if(t.element.parentNode){i.removeChild(t.element)}return t}};var p=function(){return typeof window!=="undefined"&&typeof window.document!=="undefined"}();var v=function t(){return p};var g=v()?c("svg"):{};var _="children"in g?function(t){return t.children.length}:function(t){return t.childNodes.length};var m=function t(i,e,n,a){var r=n[0]||i.left;var o=n[1]||i.top;var s=r+i.width;var l=o+i.height*(a[1]||1);var u={element:Object.assign({},i),inner:{left:i.left,top:i.top,right:i.right,bottom:i.bottom},outer:{left:r,top:o,right:s,bottom:l}};e.filter((function(t){return!t.isRectIgnored()})).map((function(t){return t.rect})).forEach((function(t){b(u.inner,Object.assign({},t.inner));b(u.outer,Object.assign({},t.outer))}));w(u.inner);u.outer.bottom+=u.element.marginBottom;u.outer.right+=u.element.marginRight;w(u.outer);return u};var b=function t(i,e){e.top+=i.top;e.right+=i.left;e.bottom+=i.top;e.left+=i.left;if(e.bottom>i.bottom){i.bottom=e.bottom}if(e.right>i.right){i.right=e.right}};var w=function t(i){i.width=i.right-i.left;i.height=i.bottom-i.top};var x=function t(i){return typeof i==="number"};var y=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:.001;return Math.abs(i-e)<a&&Math.abs(n)<a};var k=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=i.stiffness,n=e===void 0?.5:e,a=i.damping,o=a===void 0?.75:a,s=i.mass,l=s===void 0?10:s;var u=null;var c=null;var f=0;var d=false;var h=function t(i,e){if(d)return;if(!(x(u)&&x(c))){d=true;f=0;return}var a=-(c-u)*n;f+=a/l;c+=f;f*=o;if(y(c,u,f)||e){c=u;f=0;d=true;v.onupdate(c);v.oncomplete(c)}else{v.onupdate(c)}};var p=function t(i){if(x(i)&&!x(c)){c=i}if(u===null){u=i;c=i}u=i;if(c===u||typeof u==="undefined"){d=true;f=0;v.onupdate(c);v.oncomplete(c);return}d=false};var v=r({interpolate:h,target:{set:p,get:function t(){return u}},resting:{get:function t(){return d}},onupdate:function t(i){},oncomplete:function t(i){}});return v};var E=function t(i){return i<.5?2*i*i:-1+(4-2*i)*i};var I=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=i.duration,n=e===void 0?500:e,a=i.easing,o=a===void 0?E:a,s=i.delay,l=s===void 0?0:s;var u=null;var c;var f;var d=true;var h=false;var p=null;var v=function t(i,e){if(d||p===null)return;if(u===null){u=i}if(i-u<l)return;c=i-u-l;if(c>=n||e){c=1;f=h?0:1;g.onupdate(f*p);g.oncomplete(f*p);d=true}else{f=c/n;g.onupdate((c>=0?o(h?1-f:f):0)*p)}};var g=r({interpolate:v,target:{get:function t(){return h?0:p},set:function t(i){if(p===null){p=i;g.onupdate(i);g.oncomplete(i);return}if(i<p){p=1;h=true}else{h=false;p=i}d=false;u=null}},resting:{get:function t(){return d}},onupdate:function t(i){},oncomplete:function t(i){}});return g};var T={spring:k,tween:I};var A=function t(i,e,n){var a=i[e]&&typeof i[e][n]==="object"?i[e][n]:i[e]||i;var r=typeof a==="string"?a:a.type;var o=typeof a==="object"?Object.assign({},a):{};return T[r]?T[r](o):null};var S=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;e=Array.isArray(e)?e:[e];e.forEach((function(t){i.forEach((function(i){var e=i;var r=function t(){return n[i]};var o=function t(e){return n[i]=e};if(typeof i==="object"){e=i.key;r=i.getter||r;o=i.setter||o}if(t[e]&&!a){return}t[e]={get:r,set:o}}))}))};var M=function t(i){var e=i.mixinConfig,n=i.viewProps,r=i.viewInternalAPI,o=i.viewExternalAPI;var s=Object.assign({},n);var t=[];a(e,(function(i,e){var a=A(e);if(!a){return}a.onupdate=function(t){n[i]=t};a.target=s[i];var l={key:i,setter:function t(i){if(a.target===i){return}a.target=i},getter:function t(){return n[i]}};S([l],[r,o],n,true);t.push(a)}));return{write:function i(e){var n=document.hidden;var a=true;t.forEach((function(t){if(!t.resting)a=false;t.interpolate(e,n)}));return a},destroy:function t(){}}};var D=function t(i){return function(t,e){i.addEventListener(t,e)}};var P=function t(i){return function(t,e){i.removeEventListener(t,e)}};var O=function t(i){var e=i.viewExternalAPI,n=i.view;var a=[];var r=D(n.element);var o=P(n.element);e.on=function(t,i){a.push({type:t,fn:i});r(t,i)};e.off=function(t,i){a.splice(a.findIndex((function(e){return e.type===t&&e.fn===i})),1);o(t,i)};return{write:function t(){return true},destroy:function t(){a.forEach((function(t){o(t.type,t.fn)}))}}};var R=function t(i){var e=i.mixinConfig,n=i.viewProps,a=i.viewExternalAPI;S(e,a,n)};var C=function t(i){return i!=null};var L={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0};var z=function t(i){var e=i.mixinConfig,n=i.viewProps,a=i.viewInternalAPI,r=i.viewExternalAPI,o=i.view;var s=Object.assign({},n);var l={};S(e,[a,r],n);var u=function t(){return[n["translateX"]||0,n["translateY"]||0]};var c=function t(){return[n["scaleX"]||0,n["scaleY"]||0]};var f=function t(){return o.rect?m(o.rect,o.childViews,u(),c()):null};a.rect={get:f};r.rect={get:f};e.forEach((function(t){n[t]=typeof s[t]==="undefined"?L[t]:s[t]}));return{write:function t(){if(!G(l,n)){return}F(o.element,n);Object.assign(l,Object.assign({},n));return true},destroy:function t(){}}};var G=function t(i,e){if(Object.keys(i).length!==Object.keys(e).length){return true}for(var n in e){if(e[n]!==i[n]){return true}}return false};var F=function t(i,e){var n=e.opacity,a=e.perspective,r=e.translateX,o=e.translateY,s=e.scaleX,l=e.scaleY,u=e.rotateX,c=e.rotateY,f=e.rotateZ,d=e.originX,h=e.originY,p=e.width,v=e.height;var g="";var _="";if(C(d)||C(h)){_+="transform-origin: "+(d||0)+"px "+(h||0)+"px;"}if(C(a)){g+="perspective("+a+"px) "}if(C(r)||C(o)){g+="translate3d("+(r||0)+"px, "+(o||0)+"px, 0) "}if(C(s)||C(l)){g+="scale3d("+(C(s)?s:1)+", "+(C(l)?l:1)+", 1) "}if(C(f)){g+="rotateZ("+f+"rad) "}if(C(u)){g+="rotateX("+u+"rad) "}if(C(c)){g+="rotateY("+c+"rad) "}if(g.length){_+="transform:"+g+";"}if(C(n)){_+="opacity:"+n+";";if(n===0){_+="visibility:hidden;"}if(n<1){_+="pointer-events:none;"}}if(C(v)){_+="height:"+v+"px;"}if(C(p)){_+="width:"+p+"px;"}var m=i.elementCurrentStyle||"";if(_.length!==m.length||_!==m){i.style.cssText=_;i.elementCurrentStyle=_}};var N={styles:z,listeners:O,animations:M,apis:R};var B=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!e.layoutCalculated){i.paddingTop=parseInt(n.paddingTop,10)||0;i.marginTop=parseInt(n.marginTop,10)||0;i.marginRight=parseInt(n.marginRight,10)||0;i.marginBottom=parseInt(n.marginBottom,10)||0;i.marginLeft=parseInt(n.marginLeft,10)||0;e.layoutCalculated=true}i.left=e.offsetLeft||0;i.top=e.offsetTop||0;i.width=e.offsetWidth||0;i.height=e.offsetHeight||0;i.right=i.left+i.width;i.bottom=i.top+i.height;i.scrollTop=e.scrollTop;i.hidden=e.offsetParent===null;return i};var j=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=i.tag,n=e===void 0?"div":e,a=i.name,o=a===void 0?null:a,s=i.attributes,l=s===void 0?{}:s,u=i.read,p=u===void 0?function(){}:u,v=i.write,g=v===void 0?function(){}:v,b=i.create,w=b===void 0?function(){}:b,x=i.destroy,y=x===void 0?function(){}:x,k=i.filterFrameActionsForChild,E=k===void 0?function(t,i){return i}:k,I=i.didCreateView,T=I===void 0?function(){}:I,A=i.didWriteView,S=A===void 0?function(){}:A,M=i.ignoreRect,D=M===void 0?false:M,P=i.ignoreRectUpdate,O=P===void 0?false:P,R=i.mixins,C=R===void 0?[]:R;return function(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var e=c(n,"filepond--"+o,l);var a=window.getComputedStyle(e,null);var s=B();var u=null;var v=false;var b=[];var x=[];var k={};var I={};var A=[g];var M=[p];var P=[y];var R=function t(){return e};var L=function t(){return b.concat()};var z=function t(){return k};var G=function t(i){return function(t,e){return t(i,e)}};var F=function t(){if(u){return u}u=m(s,b,[0,0],[1,1]);return u};var j=function t(){return a};var H=function t(){u=null;b.forEach((function(t){return t._read()}));var n=!(O&&s.width&&s.height);if(n){B(s,e,a)}var r={root:X,props:i,rect:s};M.forEach((function(t){return t(r)}))};var U=function t(e,n,a){var r=n.length===0;A.forEach((function(t){var o=t({props:i,root:X,actions:n,timestamp:e,shouldOptimize:a});if(o===false){r=false}}));x.forEach((function(t){var i=t.write(e);if(i===false){r=false}}));b.filter((function(t){return!!t.element.parentNode})).forEach((function(t){var i=t._write(e,E(t,n),a);if(!i){r=false}}));b.forEach((function(t,i){if(t.element.parentNode){return}X.appendChild(t.element,i);t._read();t._write(e,E(t,n),a);r=false}));v=r;S({props:i,root:X,actions:n,timestamp:e});return r};var V=function t(){x.forEach((function(t){return t.destroy()}));P.forEach((function(t){t({root:X,props:i})}));b.forEach((function(t){return t._destroy()}))};var q={element:{get:R},style:{get:j},childViews:{get:L}};var W=Object.assign({},q,{rect:{get:F},ref:{get:z},is:function t(i){return o===i},appendChild:f(e),createChildView:G(t),linkView:function t(i){b.push(i);return i},unlinkView:function t(i){b.splice(b.indexOf(i),1)},appendChildView:d(e,b),removeChildView:h(e,b),registerWriter:function t(i){return A.push(i)},registerReader:function t(i){return M.push(i)},registerDestroyer:function t(i){return P.push(i)},invalidateLayout:function t(){return e.layoutCalculated=false},dispatch:t.dispatch,query:t.query});var Y={element:{get:R},childViews:{get:L},rect:{get:F},resting:{get:function t(){return v}},isRectIgnored:function t(){return D},_read:H,_write:U,_destroy:V};var Z=Object.assign({},q,{rect:{get:function t(){return s}}});Object.keys(C).sort((function(t,i){if(t==="styles"){return 1}else if(i==="styles"){return-1}return 0})).forEach((function(t){var e=N[t]({mixinConfig:C[t],viewProps:i,viewState:I,viewInternalAPI:W,viewExternalAPI:Y,view:r(Z)});if(e){x.push(e)}}));var X=r(W);w({root:X,props:i});var Q=_(e);b.forEach((function(t,i){X.appendChild(t.element,Q+i)}));T(X);return r(Y)}};var H=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:60;var a="__framePainter";if(window[a]){window[a].readers.push(i);window[a].writers.push(e);return}window[a]={readers:[i],writers:[e]};var r=window[a];var o=1e3/n;var s=null;var l=null;var u=null;var c=null;var f=function t(){if(document.hidden){u=function t(){return window.setTimeout((function(){return d(performance.now())}),o)};c=function t(){return window.clearTimeout(l)}}else{u=function t(){return window.requestAnimationFrame(d)};c=function t(){return window.cancelAnimationFrame(l)}}};document.addEventListener("visibilitychange",(function(){if(c)c();f();d(performance.now())}));var d=function t(i){l=u(t);if(!s){s=i}var e=i-s;if(e<=o){return}s=i-e%o;r.readers.forEach((function(t){return t()}));r.writers.forEach((function(t){return t(i)}))};f();d(performance.now());return{pause:function t(){c(l)}}};var U=function t(i,e){return function(t){var n=t.root,a=t.props,r=t.actions,o=r===void 0?[]:r,s=t.timestamp,l=t.shouldOptimize;o.filter((function(t){return i[t.type]})).forEach((function(t){return i[t.type]({root:n,props:a,action:t.data,timestamp:s,shouldOptimize:l})}));if(e){e({root:n,props:a,actions:o,timestamp:s,shouldOptimize:l})}}};var V=function t(i,e){return e.parentNode.insertBefore(i,e)};var q=function t(i,e){return e.parentNode.insertBefore(i,e.nextSibling)};var W=function t(i){return Array.isArray(i)};var Y=function t(i){return i==null};var Z=function t(i){return i.trim()};var X=function t(i){return""+i};var Q=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:",";if(Y(i)){return[]}if(W(i)){return i}return X(i).split(e).map(Z).filter((function(t){return t.length}))};var $=function t(i){return typeof i==="boolean"};var J=function t(i){return $(i)?i:i==="true"};var K=function t(i){return typeof i==="string"};var tt=function t(i){return x(i)?i:K(i)?X(i).replace(/[a-z]+/gi,""):0};var it=function t(i){return parseInt(tt(i),10)};var et=function t(i){return parseFloat(tt(i))};var nt=function t(i){return x(i)&&isFinite(i)&&Math.floor(i)===i};var at=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;if(nt(i)){return i}var n=X(i).trim();if(/MB$/i.test(n)){n=n.replace(/MB$i/,"").trim();return it(n)*e*e}if(/KB/i.test(n)){n=n.replace(/KB$i/,"").trim();return it(n)*e}return it(n)};var rt=function t(i){return typeof i==="function"};var ot=function t(i){var e=self;var n=i.split(".");var a=null;while(a=n.shift()){e=e[a];if(!e){return null}}return e};var st={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"};var lt=function t(i){var e={};e.url=K(i)?i:i.url||"";e.timeout=i.timeout?parseInt(i.timeout,10):0;e.headers=i.headers?i.headers:{};a(st,(function(t){e[t]=ut(t,i[t],st[t],e.timeout,e.headers)}));e.process=i.process||K(i)||i.url?e.process:null;e.remove=i.remove||null;delete e.headers;return e};var ut=function t(i,e,n,a,r){if(e===null){return null}if(typeof e==="function"){return e}var o={url:n==="GET"||n==="PATCH"?"?"+i+"=":"",method:n,headers:r,withCredentials:false,timeout:a,onload:null,ondata:null,onerror:null};if(K(e)){o.url=e;return o}Object.assign(o,e);if(K(o.headers)){var s=o.headers.split(/:(.+)/);o.headers={header:s[0],value:s[1]}}o.withCredentials=J(o.withCredentials);return o};var ct=function t(i){return lt(i)};var ft=function t(i){return i===null};var dt=function t(i){return typeof i==="object"&&i!==null};var ht=function t(i){return dt(i)&&K(i.url)&&dt(i.process)&&dt(i.revert)&&dt(i.restore)&&dt(i.fetch)};var pt=function t(i){if(W(i)){return"array"}if(ft(i)){return"null"}if(nt(i)){return"int"}if(/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(i)){return"bytes"}if(ht(i)){return"api"}return typeof i};var vt=function t(i){return i.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",')};var gt={array:Q,boolean:J,int:function t(i){return pt(i)==="bytes"?at(i):it(i)},number:et,float:et,bytes:at,string:function t(i){return rt(i)?i:X(i)},function:function t(i){return ot(i)},serverapi:ct,object:function t(i){try{return JSON.parse(vt(i))}catch(t){return null}}};var _t=function t(i,e){return gt[e](i)};var mt=function t(i,e,n){if(i===e){return i}var a=pt(i);if(a!==n){var r=_t(i,n);a=pt(r);if(r===null){throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"'}else{i=r}}return i};var bt=function t(i,e){var n=i;return{enumerable:true,get:function t(){return n},set:function t(a){n=mt(a,i,e)}}};var wt=function t(i){var e={};a(i,(function(t){var n=i[t];e[t]=bt(n[0],n[1])}));return r(e)};var xt=function t(i){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:wt(i)}};var yt=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return i.split(/(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join(e)};var kt=function t(i,e){var n={};a(e,(function(t){n[t]={get:function e(){return i.getState().options[t]},set:function e(n){i.dispatch("SET_"+yt(t,"_").toUpperCase(),{value:n})}}}));return n};var Et=function t(i){return function(t,e,n){var r={};a(i,(function(i){var e=yt(i,"_").toUpperCase();r["SET_"+e]=function(a){try{n.options[i]=a.value}catch(t){}t("DID_SET_"+e,{value:n.options[i]})}}));return r}};var It=function t(i){return function(t){var e={};a(i,(function(i){e["GET_"+yt(i,"_").toUpperCase()]=function(e){return t.options[i]}}));return e}};var Tt={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5};var At=function t(){return Math.random().toString(36).substring(2,11)};function St(t,i){if(t==null)return{};var e={};var n=Object.keys(t);var a,r;for(r=0;r<n.length;r++){a=n[r];if(i.indexOf(a)>=0)continue;e[a]=t[a]}return e}function Mt(t,i){if(t==null)return{};var e=St(t,i);var n,a;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(a=0;a<r.length;a++){n=r[a];if(i.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,n))continue;e[n]=t[n]}}return e}function Dt(t){return Pt(t)||Ot(t)||Rt()}function Pt(t){if(Array.isArray(t)){for(var i=0,e=new Array(t.length);i<t.length;i++)e[i]=t[i];return e}}function Ot(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function Rt(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Ct=function t(i,e){return i.splice(e,1)};var Lt=function t(i,e){if(e){i()}else if(document.hidden){Promise.resolve(1).then(i)}else{setTimeout(i,0)}};var zt=function t(){var i=[];var e=function t(e,n){Ct(i,i.findIndex((function(t){return t.event===e&&(t.cb===n||!n)})))};var n=function t(e,n,a){i.filter((function(t){return t.event===e})).map((function(t){return t.cb})).forEach((function(t){return Lt((function(){return t.apply(void 0,Dt(n))}),a)}))};return{fireSync:function t(i){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++){a[r-1]=arguments[r]}n(i,a,true)},fire:function t(i){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++){a[r-1]=arguments[r]}n(i,a,false)},on:function t(e,n){i.push({event:e,cb:n})},onOnce:function t(n,a){i.push({event:n,cb:function t(){e(n,a);a.apply(void 0,arguments)}})},off:e}};var Gt=function t(i,e,n){Object.getOwnPropertyNames(i).filter((function(t){return!n.includes(t)})).forEach((function(t){return Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))};var Ft=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"];var Nt=function t(i){var e={};Gt(i,e,Ft);return e};var Bt=function t(i){i.forEach((function(t,e){if(t.released){Ct(i,e)}}))};var jt={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8};var Ht={INPUT:1,LIMBO:2,LOCAL:3};var Ut=function t(i){return/[^0-9]+/.exec(i)};var Vt=function t(){return Ut(1.1.toLocaleString())[0]};var qt=function t(){var i=Vt();var e=1e3.toLocaleString();var n=1e3.toString();if(e!==n){return Ut(e)[0]}return i==="."?",":"."};var Wt={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"};var Yt=[];var Zt=function t(i,e,n){return new Promise((function(t,a){var r=Yt.filter((function(t){return t.key===i})).map((function(t){return t.cb}));if(r.length===0){t(e);return}var o=r.shift();r.reduce((function(t,i){return t.then((function(t){return i(t,n)}))}),o(e,n)).then((function(i){return t(i)})).catch((function(t){return a(t)}))}))};var Xt=function t(i,e,n){return Yt.filter((function(t){return t.key===i})).map((function(t){return t.cb(e,n)}))};var Qt=function t(i,e){return Yt.push({key:i,cb:e})};var $t=function t(i){return Object.assign(ti,i)};var Jt=function t(){return Object.assign({},ti)};var Kt=function t(i){a(i,(function(t,i){if(!ti[t]){return}ti[t][0]=mt(i,ti[t][0],ti[t][1])}))};var ti={id:[null,Wt.STRING],name:["filepond",Wt.STRING],disabled:[false,Wt.BOOLEAN],className:[null,Wt.STRING],required:[false,Wt.BOOLEAN],captureMethod:[null,Wt.STRING],allowSyncAcceptAttribute:[true,Wt.BOOLEAN],allowDrop:[true,Wt.BOOLEAN],allowBrowse:[true,Wt.BOOLEAN],allowPaste:[true,Wt.BOOLEAN],allowMultiple:[false,Wt.BOOLEAN],allowReplace:[true,Wt.BOOLEAN],allowRevert:[true,Wt.BOOLEAN],allowRemove:[true,Wt.BOOLEAN],allowProcess:[true,Wt.BOOLEAN],allowReorder:[false,Wt.BOOLEAN],allowDirectoriesOnly:[false,Wt.BOOLEAN],storeAsFile:[false,Wt.BOOLEAN],forceRevert:[false,Wt.BOOLEAN],maxFiles:[null,Wt.INT],checkValidity:[false,Wt.BOOLEAN],itemInsertLocationFreedom:[true,Wt.BOOLEAN],itemInsertLocation:["before",Wt.STRING],itemInsertInterval:[75,Wt.INT],dropOnPage:[false,Wt.BOOLEAN],dropOnElement:[true,Wt.BOOLEAN],dropValidation:[false,Wt.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],Wt.ARRAY],instantUpload:[true,Wt.BOOLEAN],maxParallelUploads:[2,Wt.INT],allowMinimumUploadDuration:[true,Wt.BOOLEAN],chunkUploads:[false,Wt.BOOLEAN],chunkForce:[false,Wt.BOOLEAN],chunkSize:[5e6,Wt.INT],chunkRetryDelays:[[500,1e3,3e3],Wt.ARRAY],server:[null,Wt.SERVER_API],fileSizeBase:[1e3,Wt.INT],labelFileSizeBytes:["bytes",Wt.STRING],labelFileSizeKilobytes:["KB",Wt.STRING],labelFileSizeMegabytes:["MB",Wt.STRING],labelFileSizeGigabytes:["GB",Wt.STRING],labelDecimalSeparator:[Vt(),Wt.STRING],labelThousandsSeparator:[qt(),Wt.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',Wt.STRING],labelInvalidField:["Field contains invalid files",Wt.STRING],labelFileWaitingForSize:["Waiting for size",Wt.STRING],labelFileSizeNotAvailable:["Size not available",Wt.STRING],labelFileCountSingular:["file in list",Wt.STRING],labelFileCountPlural:["files in list",Wt.STRING],labelFileLoading:["Loading",Wt.STRING],labelFileAdded:["Added",Wt.STRING],labelFileLoadError:["Error during load",Wt.STRING],labelFileRemoved:["Removed",Wt.STRING],labelFileRemoveError:["Error during remove",Wt.STRING],labelFileProcessing:["Uploading",Wt.STRING],labelFileProcessingComplete:["Upload complete",Wt.STRING],labelFileProcessingAborted:["Upload cancelled",Wt.STRING],labelFileProcessingError:["Error during upload",Wt.STRING],labelFileProcessingRevertError:["Error during revert",Wt.STRING],labelTapToCancel:["tap to cancel",Wt.STRING],labelTapToRetry:["tap to retry",Wt.STRING],labelTapToUndo:["tap to undo",Wt.STRING],labelButtonRemoveItem:["Remove",Wt.STRING],labelButtonAbortItemLoad:["Abort",Wt.STRING],labelButtonRetryItemLoad:["Retry",Wt.STRING],labelButtonAbortItemProcessing:["Cancel",Wt.STRING],labelButtonUndoItemProcessing:["Undo",Wt.STRING],labelButtonRetryItemProcessing:["Retry",Wt.STRING],labelButtonProcessItem:["Upload",Wt.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',Wt.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],oninit:[null,Wt.FUNCTION],onwarning:[null,Wt.FUNCTION],onerror:[null,Wt.FUNCTION],onactivatefile:[null,Wt.FUNCTION],oninitfile:[null,Wt.FUNCTION],onaddfilestart:[null,Wt.FUNCTION],onaddfileprogress:[null,Wt.FUNCTION],onaddfile:[null,Wt.FUNCTION],onprocessfilestart:[null,Wt.FUNCTION],onprocessfileprogress:[null,Wt.FUNCTION],onprocessfileabort:[null,Wt.FUNCTION],onprocessfilerevert:[null,Wt.FUNCTION],onprocessfile:[null,Wt.FUNCTION],onprocessfiles:[null,Wt.FUNCTION],onremovefile:[null,Wt.FUNCTION],onpreparefile:[null,Wt.FUNCTION],onupdatefiles:[null,Wt.FUNCTION],onreorderfiles:[null,Wt.FUNCTION],beforeDropFile:[null,Wt.FUNCTION],beforeAddFile:[null,Wt.FUNCTION],beforeRemoveFile:[null,Wt.FUNCTION],beforePrepareFile:[null,Wt.FUNCTION],stylePanelLayout:[null,Wt.STRING],stylePanelAspectRatio:[null,Wt.STRING],styleItemPanelAspectRatio:[null,Wt.STRING],styleButtonRemoveItemPosition:["left",Wt.STRING],styleButtonProcessItemPosition:["right",Wt.STRING],styleLoadIndicatorPosition:["right",Wt.STRING],styleProgressIndicatorPosition:["right",Wt.STRING],styleButtonRemoveItemAlign:[false,Wt.BOOLEAN],files:[[],Wt.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],Wt.ARRAY]};var ii=function t(i,e){if(Y(e)){return i[0]||null}if(nt(e)){return i[e]||null}if(typeof e==="object"){e=e.id}return i.find((function(t){return t.id===e}))||null};var ei=function t(i){if(Y(i)){return i}if(/:/.test(i)){var e=i.split(":");return e[1]/e[0]}return parseFloat(i)};var ni=function t(i){return i.filter((function(t){return!t.archived}))};var ai={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4};var ri=null;var oi=function t(){if(ri===null){try{var i=new DataTransfer;i.items.add(new File(["hello world"],"This_Works.txt"));var e=document.createElement("input");e.setAttribute("type","file");e.files=i.files;ri=e.files.length===1}catch(t){ri=false}}return ri};var si=[jt.LOAD_ERROR,jt.PROCESSING_ERROR,jt.PROCESSING_REVERT_ERROR];var li=[jt.LOADING,jt.PROCESSING,jt.PROCESSING_QUEUED,jt.INIT];var ui=[jt.PROCESSING_COMPLETE];var ci=function t(i){return si.includes(i.status)};var fi=function t(i){return li.includes(i.status)};var di=function t(i){return ui.includes(i.status)};var hi=function t(i){return dt(i.options.server)&&(dt(i.options.server.process)||rt(i.options.server.process))};var pi=function t(i){return{GET_STATUS:function t(){var e=ni(i.items);var n=ai.EMPTY,a=ai.ERROR,r=ai.BUSY,o=ai.IDLE,s=ai.READY;if(e.length===0)return n;if(e.some(ci))return a;if(e.some(fi))return r;if(e.some(di))return s;return o},GET_ITEM:function t(e){return ii(i.items,e)},GET_ACTIVE_ITEM:function t(e){return ii(ni(i.items),e)},GET_ACTIVE_ITEMS:function t(){return ni(i.items)},GET_ITEMS:function t(){return i.items},GET_ITEM_NAME:function t(e){var n=ii(i.items,e);return n?n.filename:null},GET_ITEM_SIZE:function t(e){var n=ii(i.items,e);return n?n.fileSize:null},GET_STYLES:function t(){return Object.keys(i.options).filter((function(t){return/^style/.test(t)})).map((function(t){return{name:t,value:i.options[t]}}))},GET_PANEL_ASPECT_RATIO:function t(){var e=/circle/.test(i.options.stylePanelLayout);var n=e?1:ei(i.options.stylePanelAspectRatio);return n},GET_ITEM_PANEL_ASPECT_RATIO:function t(){return i.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function t(e){return ni(i.items).filter((function(t){return t.status===e}))},GET_TOTAL_ITEMS:function t(){return ni(i.items).length},SHOULD_UPDATE_FILE_INPUT:function t(){return i.options.storeAsFile&&oi()&&!hi(i)},IS_ASYNC:function t(){return hi(i)},GET_FILE_SIZE_LABELS:function t(i){return{labelBytes:i("GET_LABEL_FILE_SIZE_BYTES")||undefined,labelKilobytes:i("GET_LABEL_FILE_SIZE_KILOBYTES")||undefined,labelMegabytes:i("GET_LABEL_FILE_SIZE_MEGABYTES")||undefined,labelGigabytes:i("GET_LABEL_FILE_SIZE_GIGABYTES")||undefined}}}};var vi=function t(i){var e=ni(i.items).length;if(!i.options.allowMultiple){return e===0}var n=i.options.maxFiles;if(n===null){return true}if(e<n){return true}return false};var gi=function t(i,e,n){return Math.max(Math.min(n,i),e)};var _i=function t(i,e,n){return i.splice(e,0,n)};var mi=function t(i,e,n){if(Y(e)){return null}if(typeof n==="undefined"){i.push(e);return e}n=gi(n,0,i.length);_i(i,n,e);return e};var bi=function t(i){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(i)};var wi=function t(i){return(""+i).split("/").pop().split("?").shift()};var xi=function t(i){return i.split(".").pop()};var yi=function t(i){if(typeof i!=="string"){return""}var e=i.split("/").pop();if(/svg/.test(e)){return"svg"}if(/zip|compressed/.test(e)){return"zip"}if(/plain/.test(e)){return"txt"}if(/msword/.test(e)){return"doc"}if(/[a-z]+/.test(e)){if(e==="jpeg"){return"jpg"}return e}return""};var ki=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return(e+i).slice(-e.length)};var Ei=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:new Date;return i.getFullYear()+"-"+ki(i.getMonth()+1,"00")+"-"+ki(i.getDate(),"00")+"_"+ki(i.getHours(),"00")+"-"+ki(i.getMinutes(),"00")+"-"+ki(i.getSeconds(),"00")};var Ii=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var r=typeof n==="string"?i.slice(0,i.size,n):i.slice(0,i.size,i.type);r.lastModifiedDate=new Date;if(i._relativePath)r._relativePath=i._relativePath;if(!K(e)){e=Ei()}if(e&&a===null&&xi(e)){r.name=e}else{a=a||yi(r.type);r.name=e+(a?"."+a:"")}return r};var Ti=function t(){return window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder};var Ai=function t(i,e){var n=Ti();if(n){var a=new n;a.append(i);return a.getBlob(e)}return new Blob([i],{type:e})};var Si=function t(i,e){var n=new ArrayBuffer(i.length);var a=new Uint8Array(n);for(var r=0;r<i.length;r++){a[r]=i.charCodeAt(r)}return Ai(n,e)};var Mi=function t(i){return(/^data:(.+);/.exec(i)||[])[1]||null};var Di=function t(i){var e=i.split(",")[1];return e.replace(/\s/g,"")};var Pi=function t(i){return atob(Di(i))};var Oi=function t(i){var e=Mi(i);var n=Pi(i);return Si(n,e)};var Ri=function t(i,e,n){return Ii(Oi(i),e,null,n)};var Ci=function t(i){if(!/^content-disposition:/i.test(i))return null;var e=i.split(/filename=|filename\*=.+''/).splice(1).map((function(t){return t.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(t){return t.length}));return e.length?decodeURI(e[e.length-1]):null};var Li=function t(i){if(/content-length:/i.test(i)){var e=i.match(/[0-9]+/)[0];return e?parseInt(e,10):null}return null};var zi=function t(i){if(/x-content-transfer-id:/i.test(i)){var e=(i.split(":")[1]||"").trim();return e||null}return null};var Gi=function t(i){var e={source:null,name:null,size:null};var n=i.split("\n");var a=true;var r=false;var o=undefined;try{for(var s=n[Symbol.iterator](),l;!(a=(l=s.next()).done);a=true){var u=l.value;var c=Ci(u);if(c){e.name=c;continue}var f=Li(u);if(f){e.size=f;continue}var d=zi(u);if(d){e.source=d;continue}}}catch(t){r=true;o=t}finally{try{if(!a&&s.return!=null){s.return()}}finally{if(r){throw o}}}return e};var Fi=function t(i){var e={source:null,complete:false,progress:0,size:null,timestamp:null,duration:0,request:null};var n=function t(){return e.progress};var a=function t(){if(e.request&&e.request.abort){e.request.abort()}};var r=function t(){var i=e.source;s.fire("init",i);if(i instanceof File){s.fire("load",i)}else if(i instanceof Blob){s.fire("load",Ii(i,i.name))}else if(bi(i)){s.fire("load",Ri(i))}else{o(i)}};var o=function t(n){if(!i){s.fire("error",{type:"error",body:"Can't load URL",code:400});return}e.timestamp=Date.now();e.request=i(n,(function(t){e.duration=Date.now()-e.timestamp;e.complete=true;if(t instanceof Blob){t=Ii(t,t.name||wi(n))}s.fire("load",t instanceof Blob?t:t?t.body:null)}),(function(t){s.fire("error",typeof t==="string"?{type:"error",code:0,body:t}:t)}),(function(t,i,n){if(n){e.size=n}e.duration=Date.now()-e.timestamp;if(!t){e.progress=null;return}e.progress=i/n;s.fire("progress",e.progress)}),(function(){s.fire("abort")}),(function(t){var i=Gi(typeof t==="string"?t:t.headers);s.fire("meta",{size:e.size||i.size,filename:i.name,source:i.source})}))};var s=Object.assign({},zt(),{setSource:function t(i){return e.source=i},getProgress:n,abort:a,load:r});return s};var Ni=function t(i){return/GET|HEAD/.test(i)};var Bi=function t(i,e,n){var a={onheaders:function t(){},onprogress:function t(){},onload:function t(){},ontimeout:function t(){},onerror:function t(){},onabort:function t(){},abort:function t(){r=true;s.abort()}};var r=false;var o=false;n=Object.assign({method:"POST",headers:{},withCredentials:false},n);e=encodeURI(e);if(Ni(n.method)&&i){e=""+e+encodeURIComponent(typeof i==="string"?i:JSON.stringify(i))}var s=new XMLHttpRequest;var l=Ni(n.method)?s:s.upload;l.onprogress=function(t){if(r){return}a.onprogress(t.lengthComputable,t.loaded,t.total)};s.onreadystatechange=function(){if(s.readyState<2){return}if(s.readyState===4&&s.status===0){return}if(o){return}o=true;a.onheaders(s)};s.onload=function(){if(s.status>=200&&s.status<300){a.onload(s)}else{a.onerror(s)}};s.onerror=function(){return a.onerror(s)};s.onabort=function(){r=true;a.onabort()};s.ontimeout=function(){return a.ontimeout(s)};s.open(n.method,e,true);if(nt(n.timeout)){s.timeout=n.timeout}Object.keys(n.headers).forEach((function(t){var i=unescape(encodeURIComponent(n.headers[t]));s.setRequestHeader(t,i)}));if(n.responseType){s.responseType=n.responseType}if(n.withCredentials){s.withCredentials=true}s.send(i);return a};var ji=function t(i,e,n,a){return{type:i,code:e,body:n,headers:a}};var Hi=function t(i){return function(t){i(ji("error",0,"Timeout",t.getAllResponseHeaders()))}};var Ui=function t(i){return/\?/.test(i)};var Vi=function t(){var i="";for(var e=arguments.length,n=new Array(e),a=0;a<e;a++){n[a]=arguments[a]}n.forEach((function(t){i+=Ui(i)&&Ui(t)?t.replace(/\?/,"&"):t}));return i};var qi=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var e=arguments.length>1?arguments[1]:undefined;if(typeof e==="function"){return e}if(!e||!K(e.url)){return null}var n=e.onload||function(t){return t};var a=e.onerror||function(t){return null};return function(t,r,o,s,l,u){var c=Bi(t,Vi(i,e.url),Object.assign({},e,{responseType:"blob"}));c.onload=function(i){var a=i.getAllResponseHeaders();var o=Gi(a).name||wi(t);r(ji("load",i.status,e.method==="HEAD"?null:Ii(n(i.response),o),a))};c.onerror=function(t){o(ji("error",t.status,a(t.response)||t.statusText,t.getAllResponseHeaders()))};c.onheaders=function(t){u(ji("headers",t.status,null,t.getAllResponseHeaders()))};c.ontimeout=Hi(o);c.onprogress=s;c.onabort=l;return c}};var Wi={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4};var Yi=function t(i,e,n,a,r,o,s,l,u,c,f){var d=[];var h=f.chunkTransferId,p=f.chunkServer,v=f.chunkSize,g=f.chunkRetryDelays;var _={serverId:h,aborted:false};var m=e.ondata||function(t){return t};var b=e.onload||function(t,i){return i==="HEAD"?t.getResponseHeader("Upload-Offset"):t.response};var w=e.onerror||function(t){return null};var x=function t(o){var l=new FormData;if(dt(r))l.append(n,JSON.stringify(r));var u=typeof e.headers==="function"?e.headers(a,r):Object.assign({},e.headers,{"Upload-Length":a.size});var c=Object.assign({},e,{headers:u});var f=Bi(m(l),Vi(i,e.url),c);f.onload=function(t){return o(b(t,c.method))};f.onerror=function(t){return s(ji("error",t.status,w(t.response)||t.statusText,t.getAllResponseHeaders()))};f.ontimeout=Hi(s)};var y=function t(n){var a=Vi(i,p.url,_.serverId);var r=typeof e.headers==="function"?e.headers(_.serverId):Object.assign({},e.headers);var o={headers:r,method:"HEAD"};var l=Bi(null,a,o);l.onload=function(t){return n(b(t,o.method))};l.onerror=function(t){return s(ji("error",t.status,w(t.response)||t.statusText,t.getAllResponseHeaders()))};l.ontimeout=Hi(s)};var k=Math.floor(a.size/v);for(var E=0;E<=k;E++){var I=E*v;var T=a.slice(I,I+v,"application/offset+octet-stream");d[E]={index:E,size:T.size,offset:I,data:T,file:a,progress:0,retries:Dt(g),status:Wi.QUEUED,error:null,request:null,timeout:null}}var A=function t(){return o(_.serverId)};var S=function t(i){return i.status===Wi.QUEUED||i.status===Wi.ERROR};var M=function t(e){if(_.aborted)return;e=e||d.find(S);if(!e){if(d.every((function(t){return t.status===Wi.COMPLETE}))){A()}return}e.status=Wi.PROCESSING;e.progress=null;var n=p.ondata||function(t){return t};var r=p.onerror||function(t){return null};var o=p.onload||function(){};var l=Vi(i,p.url,_.serverId);var c=typeof p.headers==="function"?p.headers(e):Object.assign({},p.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":e.offset,"Upload-Length":a.size,"Upload-Name":a.name});var f=e.request=Bi(n(e.data),l,Object.assign({},p,{headers:c}));f.onload=function(t){o(t,e.index,d.length);e.status=Wi.COMPLETE;e.request=null;O()};f.onprogress=function(t,i,n){e.progress=t?i:null;P()};f.onerror=function(t){e.status=Wi.ERROR;e.request=null;e.error=r(t.response)||t.statusText;if(!D(e)){s(ji("error",t.status,r(t.response)||t.statusText,t.getAllResponseHeaders()))}};f.ontimeout=function(t){e.status=Wi.ERROR;e.request=null;if(!D(e)){Hi(s)(t)}};f.onabort=function(){e.status=Wi.QUEUED;e.request=null;u()}};var D=function t(i){if(i.retries.length===0)return false;i.status=Wi.WAITING;clearTimeout(i.timeout);i.timeout=setTimeout((function(){M(i)}),i.retries.shift());return true};var P=function t(){var i=d.reduce((function(t,i){if(t===null||i.progress===null)return null;return t+i.progress}),0);if(i===null)return l(false,0,0);var e=d.reduce((function(t,i){return t+i.size}),0);l(true,i,e)};var O=function t(){var i=d.filter((function(t){return t.status===Wi.PROCESSING})).length;if(i>=1)return;M()};var R=function t(){d.forEach((function(t){clearTimeout(t.timeout);if(t.request){t.request.abort()}}))};if(!_.serverId){x((function(t){if(_.aborted)return;c(t);_.serverId=t;O()}))}else{y((function(t){if(_.aborted)return;d.filter((function(i){return i.offset<t})).forEach((function(t){t.status=Wi.COMPLETE;t.progress=t.size}));O()}))}return{abort:function t(){_.aborted=true;R()}}};var Zi=function t(i,e,n,a){return function(t,r,o,s,l,u,c){if(!t)return;var f=a.chunkUploads;var d=f&&t.size>a.chunkSize;var h=f&&(d||a.chunkForce);if(t instanceof Blob&&h)return Yi(i,e,n,t,r,o,s,l,u,c,a);var p=e.ondata||function(t){return t};var v=e.onload||function(t){return t};var g=e.onerror||function(t){return null};var _=typeof e.headers==="function"?e.headers(t,r)||{}:Object.assign({},e.headers);var m=Object.assign({},e,{headers:_});var b=new FormData;if(dt(r)){b.append(n,JSON.stringify(r))}(t instanceof Blob?[{name:null,file:t}]:t).forEach((function(t){b.append(n,t.file,t.name===null?t.file.name:""+t.name+t.file.name)}));var w=Bi(p(b),Vi(i,e.url),m);w.onload=function(t){o(ji("load",t.status,v(t.response),t.getAllResponseHeaders()))};w.onerror=function(t){s(ji("error",t.status,g(t.response)||t.statusText,t.getAllResponseHeaders()))};w.ontimeout=Hi(s);w.onprogress=l;w.onabort=u;return w}};var Xi=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var e=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var a=arguments.length>3?arguments[3]:undefined;if(typeof e==="function")return function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}return e.apply(void 0,[n].concat(i,[a]))};if(!e||!K(e.url))return null;return Zi(i,e,n,a)};var Qi=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var e=arguments.length>1?arguments[1]:undefined;if(typeof e==="function"){return e}if(!e||!K(e.url)){return function(t,i){return i()}}var n=e.onload||function(t){return t};var a=e.onerror||function(t){return null};return function(t,r,o){var s=Bi(t,i+e.url,e);s.onload=function(t){r(ji("load",t.status,n(t.response),t.getAllResponseHeaders()))};s.onerror=function(t){o(ji("error",t.status,a(t.response)||t.statusText,t.getAllResponseHeaders()))};s.ontimeout=Hi(o);return s}};var $i=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return i+Math.random()*(e-i)};var Ji=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:25;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:250;var r=null;var o=Date.now();var s=function t(){var s=Date.now()-o;var l=$i(n,a);if(s+l>e){l=s+l-e}var u=s/e;if(u>=1||document.hidden){i(1);return}i(u);r=setTimeout(t,l)};if(e>0)s();return{clear:function t(){clearTimeout(r)}}};var Ki=function t(i,e){var n={complete:false,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null};var a=e.allowMinimumUploadDuration;var r=function t(e,r){var o=function t(){if(n.duration===0||n.progress===null)return;c.fire("progress",c.getProgress())};var s=function t(){n.complete=true;c.fire("load-perceived",n.response.body)};c.fire("start");n.timestamp=Date.now();n.perceivedPerformanceUpdater=Ji((function(t){n.perceivedProgress=t;n.perceivedDuration=Date.now()-n.timestamp;o();if(n.response&&n.perceivedProgress===1&&!n.complete){s()}}),a?$i(750,1500):0);n.request=i(e,r,(function(t){n.response=dt(t)?t:{type:"load",code:200,body:""+t,headers:{}};n.duration=Date.now()-n.timestamp;n.progress=1;c.fire("load",n.response.body);if(!a||a&&n.perceivedProgress===1){s()}}),(function(t){n.perceivedPerformanceUpdater.clear();c.fire("error",dt(t)?t:{type:"error",code:0,body:""+t})}),(function(t,i,e){n.duration=Date.now()-n.timestamp;n.progress=t?i/e:null;o()}),(function(){n.perceivedPerformanceUpdater.clear();c.fire("abort",n.response?n.response.body:null)}),(function(t){c.fire("transfer",t)}))};var o=function t(){if(!n.request)return;n.perceivedPerformanceUpdater.clear();if(n.request.abort)n.request.abort();n.complete=true};var s=function t(){o();n.complete=false;n.perceivedProgress=0;n.progress=0;n.timestamp=null;n.perceivedDuration=0;n.duration=0;n.request=null;n.response=null};var l=a?function(){return n.progress?Math.min(n.progress,n.perceivedProgress):null}:function(){return n.progress||null};var u=a?function(){return Math.min(n.duration,n.perceivedDuration)}:function(){return n.duration};var c=Object.assign({},zt(),{process:r,abort:o,getProgress:l,getDuration:u,reset:s});return c};var te=function t(i){return i.substring(0,i.lastIndexOf("."))||i};var ie=function t(i){var e=[i.name,i.size,i.type];if(i instanceof Blob||bi(i)){e[0]=i.name||Ei()}else if(bi(i)){e[1]=i.length;e[2]=Mi(i)}else if(K(i)){e[0]=wi(i);e[1]=0;e[2]="application/octet-stream"}return{name:e[0],size:e[1],type:e[2]}};var ee=function t(i){return!!(i instanceof File||i instanceof Blob&&i.name)};var ne=function t(i){if(!dt(i))return i;var e=W(i)?[]:{};for(var n in i){if(!i.hasOwnProperty(n))continue;var a=i[n];e[n]=a&&dt(a)?t(a):a}return e};var ae=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=At();var o={archived:false,frozen:false,released:false,source:null,file:n,serverFileReference:e,transferId:null,processingAborted:false,status:e?jt.PROCESSING_COMPLETE:jt.INIT,activeLoader:null,activeProcessor:null};var s=null;var l={};var u=function t(i){return o.status=i};var c=function t(i){if(o.released||o.frozen)return;for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a<e;a++){n[a-1]=arguments[a]}E.fire.apply(E,[i].concat(n))};var f=function t(){return xi(o.file.name)};var d=function t(){return o.file.type};var h=function t(){return o.file.size};var p=function t(){return o.file};var v=function t(e,n,a){o.source=e;E.fireSync("init");if(o.file){E.fireSync("load-skip");return}o.file=ie(e);n.on("init",(function(){c("load-init")}));n.on("meta",(function(t){o.file.size=t.size;o.file.filename=t.filename;if(t.source){i=Ht.LIMBO;o.serverFileReference=t.source;o.status=jt.PROCESSING_COMPLETE}c("load-meta")}));n.on("progress",(function(t){u(jt.LOADING);c("load-progress",t)}));n.on("error",(function(t){u(jt.LOAD_ERROR);c("load-request-error",t)}));n.on("abort",(function(){u(jt.INIT);c("load-abort")}));n.on("load",(function(t){o.activeLoader=null;var e=function t(e){o.file=ee(e)?e:o.file;if(i===Ht.LIMBO&&o.serverFileReference){u(jt.PROCESSING_COMPLETE)}else{u(jt.IDLE)}c("load")};var n=function i(e){o.file=t;c("load-meta");u(jt.LOAD_ERROR);c("load-file-error",e)};if(o.serverFileReference){e(t);return}a(t,e,n)}));n.setSource(e);o.activeLoader=n;n.load()};var g=function t(){if(!o.activeLoader){return}o.activeLoader.load()};var _=function t(){if(o.activeLoader){o.activeLoader.abort();return}u(jt.INIT);c("load-abort")};var m=function t(i,e){if(o.processingAborted){o.processingAborted=false;return}u(jt.PROCESSING);s=null;if(!(o.file instanceof Blob)){E.on("load",(function(){t(i,e)}));return}i.on("load",(function(t){o.transferId=null;o.serverFileReference=t}));i.on("transfer",(function(t){o.transferId=t}));i.on("load-perceived",(function(t){o.activeProcessor=null;o.transferId=null;o.serverFileReference=t;u(jt.PROCESSING_COMPLETE);c("process-complete",t)}));i.on("start",(function(){c("process-start")}));i.on("error",(function(t){o.activeProcessor=null;u(jt.PROCESSING_ERROR);c("process-error",t)}));i.on("abort",(function(t){o.activeProcessor=null;o.serverFileReference=t;u(jt.IDLE);c("process-abort");if(s){s()}}));i.on("progress",(function(t){c("process-progress",t)}));var n=function t(e){if(o.archived)return;i.process(e,Object.assign({},l))};var a=console.error;e(o.file,n,a);o.activeProcessor=i};var b=function t(){o.processingAborted=false;u(jt.PROCESSING_QUEUED)};var w=function t(){return new Promise((function(t){if(!o.activeProcessor){o.processingAborted=true;u(jt.IDLE);c("process-abort");t();return}s=function i(){t()};o.activeProcessor.abort()}))};var x=function t(i,e){return new Promise((function(t,n){var a=o.serverFileReference!==null?o.serverFileReference:o.transferId;if(a===null){t();return}i(a,(function(){o.serverFileReference=null;o.transferId=null;t()}),(function(i){if(!e){t();return}u(jt.PROCESSING_REVERT_ERROR);c("process-revert-error");n(i)}));u(jt.IDLE);c("process-revert")}))};var y=function t(i,e,n){var a=i.split(".");var r=a[0];var o=a.pop();var s=l;a.forEach((function(t){return s=s[t]}));if(JSON.stringify(s[o])===JSON.stringify(e))return;s[o]=e;c("metadata-update",{key:r,value:l[r],silent:n})};var k=function t(i){return ne(i?l[i]:l)};var E=Object.assign({id:{get:function t(){return a}},origin:{get:function t(){return i},set:function t(e){return i=e}},serverId:{get:function t(){return o.serverFileReference}},transferId:{get:function t(){return o.transferId}},status:{get:function t(){return o.status}},filename:{get:function t(){return o.file.name}},filenameWithoutExtension:{get:function t(){return te(o.file.name)}},fileExtension:{get:f},fileType:{get:d},fileSize:{get:h},file:{get:p},relativePath:{get:function t(){return o.file._relativePath}},source:{get:function t(){return o.source}},getMetadata:k,setMetadata:function t(i,e,n){if(dt(i)){var a=i;Object.keys(a).forEach((function(t){y(t,a[t],e)}));return i}y(i,e,n);return e},extend:function t(i,e){return I[i]=e},abortLoad:_,retryLoad:g,requestProcessing:b,abortProcessing:w,load:v,process:m,revert:x},zt(),{freeze:function t(){return o.frozen=true},release:function t(){return o.released=true},released:{get:function t(){return o.released}},archive:function t(){return o.archived=true},archived:{get:function t(){return o.archived}},setFile:function t(i){return o.file=i}});var I=r(E);return I};var re=function t(i,e){if(Y(e)){return 0}if(!K(e)){return-1}return i.findIndex((function(t){return t.id===e}))};var oe=function t(i,e){var n=re(i,e);if(n<0){return}return i[n]||null};var se=function t(i,e,n,a,r,o){var s=Bi(null,i,{method:"GET",responseType:"blob"});s.onload=function(t){var n=t.getAllResponseHeaders();var a=Gi(n).name||wi(i);e(ji("load",t.status,Ii(t.response,a),n))};s.onerror=function(t){n(ji("error",t.status,t.statusText,t.getAllResponseHeaders()))};s.onheaders=function(t){o(ji("headers",t.status,null,t.getAllResponseHeaders()))};s.ontimeout=Hi(n);s.onprogress=a;s.onabort=r;return s};var le=function t(i){if(i.indexOf("//")===0){i=location.protocol+i}return i.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]};var ue=function t(i){return(i.indexOf(":")>-1||i.indexOf("//")>-1)&&le(location.href)!==le(i)};var ce=function t(i){return function(){return rt(i)?i.apply(void 0,arguments):i}};var fe=function t(i){return!ee(i.file)};var de=function t(i,e){clearTimeout(e.listUpdateTimeout);e.listUpdateTimeout=setTimeout((function(){i("DID_UPDATE_ITEMS",{items:ni(e.items)})}),0)};var he=function t(i){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a<e;a++){n[a-1]=arguments[a]}return new Promise((function(t){if(!i){return t(true)}var e=i.apply(void 0,n);if(e==null){return t(true)}if(typeof e==="boolean"){return t(e)}if(typeof e.then==="function"){e.then(t)}}))};var pe=function t(i,e){i.items.sort((function(t,i){return e(Nt(t),Nt(i))}))};var ve=function t(i,e){return function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=t.query,a=t.success,r=a===void 0?function(){}:a,o=t.failure,s=o===void 0?function(){}:o,l=Mt(t,["query","success","failure"]);var u=ii(i.items,n);if(!u){s({error:ji("error",0,"Item not found"),file:null});return}e(u,r,s,l||{})}};var ge=function t(i,e,n){return{ABORT_ALL:function t(){ni(n.items).forEach((function(t){t.freeze();t.abortLoad();t.abortProcessing()}))},DID_SET_FILES:function t(e){var a=e.value,r=a===void 0?[]:a;var o=r.map((function(t){return{source:t.source?t.source:t,options:t.options}}));var s=ni(n.items);s.forEach((function(t){if(!o.find((function(i){return i.source===t.source||i.source===t.file}))){i("REMOVE_ITEM",{query:t,remove:false})}}));s=ni(n.items);o.forEach((function(t,e){if(s.find((function(i){return i.source===t.source||i.file===t.source})))return;i("ADD_ITEM",Object.assign({},t,{interactionMethod:Tt.NONE,index:e}))}))},DID_UPDATE_ITEM_METADATA:function t(a){var r=a.id,o=a.action,s=a.change;if(s.silent)return;clearTimeout(n.itemUpdateTimeout);n.itemUpdateTimeout=setTimeout((function(){var t=oe(n.items,r);if(!e("IS_ASYNC")){Zt("SHOULD_PREPARE_OUTPUT",false,{item:t,query:e,action:o,change:s}).then((function(n){var a=e("GET_BEFORE_PREPARE_FILE");if(a)n=a(t,n);if(!n)return;i("REQUEST_PREPARE_OUTPUT",{query:r,item:t,success:function t(e){i("DID_PREPARE_OUTPUT",{id:r,file:e})}},true)}));return}if(t.origin===Ht.LOCAL){i("DID_LOAD_ITEM",{id:t.id,error:null,serverFileReference:t.source})}var a=function t(){setTimeout((function(){i("REQUEST_ITEM_PROCESSING",{query:r})}),32)};var l=function i(r){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(r?a:function(){}).catch((function(){}))};var u=function i(e){t.abortProcessing().then(e?a:function(){})};if(t.status===jt.PROCESSING_COMPLETE){return l(n.options.instantUpload)}if(t.status===jt.PROCESSING){return u(n.options.instantUpload)}if(n.options.instantUpload){a()}}),0)},MOVE_ITEM:function t(i){var e=i.query,a=i.index;var r=ii(n.items,e);if(!r)return;var o=n.items.indexOf(r);a=gi(a,0,n.items.length-1);if(o===a)return;n.items.splice(a,0,n.items.splice(o,1)[0])},SORT:function t(a){var r=a.compare;pe(n,r);i("DID_SORT_ITEMS",{items:e("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function t(n){var a=n.items,r=n.index,o=n.interactionMethod,s=n.success,l=s===void 0?function(){}:s,u=n.failure,c=u===void 0?function(){}:u;var f=r;if(r===-1||typeof r==="undefined"){var d=e("GET_ITEM_INSERT_LOCATION");var h=e("GET_TOTAL_ITEMS");f=d==="before"?0:h}var p=e("GET_IGNORED_FILES");var v=function t(i){return ee(i)?!p.includes(i.name.toLowerCase()):!Y(i)};var g=a.filter(v);var _=g.map((function(t){return new Promise((function(e,n){i("ADD_ITEM",{interactionMethod:o,source:t.source||t,success:e,failure:n,index:f++,options:t.options||{}})}))}));Promise.all(_).then(l).catch(c)},ADD_ITEM:function t(a){var r=a.source,o=a.index,s=o===void 0?-1:o,l=a.interactionMethod,u=a.success,c=u===void 0?function(){}:u,f=a.failure,d=f===void 0?function(){}:f,h=a.options,p=h===void 0?{}:h;if(Y(r)){d({error:ji("error",0,"No source"),file:null});return}if(ee(r)&&n.options.ignoredFiles.includes(r.name.toLowerCase())){return}if(!vi(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var v=ji("warning",0,"Max files");i("DID_THROW_MAX_FILES",{source:r,error:v});d({error:v,file:null});return}var g=ni(n.items)[0];if(g.status===jt.PROCESSING_COMPLETE||g.status===jt.PROCESSING_REVERT_ERROR){var _=e("GET_FORCE_REVERT");g.revert(Qi(n.options.server.url,n.options.server.revert),_).then((function(){if(!_)return;i("ADD_ITEM",{source:r,index:s,interactionMethod:l,success:c,failure:d,options:p})})).catch((function(){}));if(_)return}i("REMOVE_ITEM",{query:g.id})}var m=p.type==="local"?Ht.LOCAL:p.type==="limbo"?Ht.LIMBO:Ht.INPUT;var b=ae(m,m===Ht.INPUT?null:r,p.file);Object.keys(p.metadata||{}).forEach((function(t){b.setMetadata(t,p.metadata[t])}));Xt("DID_CREATE_ITEM",b,{query:e,dispatch:i});var w=e("GET_ITEM_INSERT_LOCATION");if(!n.options.itemInsertLocationFreedom){s=w==="before"?-1:n.items.length}mi(n.items,b,s);if(rt(w)&&r){pe(n,w)}var x=b.id;b.on("init",(function(){i("DID_INIT_ITEM",{id:x})}));b.on("load-init",(function(){i("DID_START_ITEM_LOAD",{id:x})}));b.on("load-meta",(function(){i("DID_UPDATE_ITEM_META",{id:x})}));b.on("load-progress",(function(t){i("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:x,progress:t})}));b.on("load-request-error",(function(t){var e=ce(n.options.labelFileLoadError)(t);if(t.code>=400&&t.code<500){i("DID_THROW_ITEM_INVALID",{id:x,error:t,status:{main:e,sub:t.code+" ("+t.body+")"}});d({error:t,file:Nt(b)});return}i("DID_THROW_ITEM_LOAD_ERROR",{id:x,error:t,status:{main:e,sub:n.options.labelTapToRetry}})}));b.on("load-file-error",(function(t){i("DID_THROW_ITEM_INVALID",{id:x,error:t.status,status:t.status});d({error:t.status,file:Nt(b)})}));b.on("load-abort",(function(){i("REMOVE_ITEM",{query:x})}));b.on("load-skip",(function(){b.on("metadata-update",(function(t){if(!ee(b.file))return;i("DID_UPDATE_ITEM_METADATA",{id:x,change:t})}));i("COMPLETE_LOAD_ITEM",{query:x,item:b,data:{source:r,success:c}})}));b.on("load",(function(){var t=function t(a){if(!a){i("REMOVE_ITEM",{query:x});return}b.on("metadata-update",(function(t){i("DID_UPDATE_ITEM_METADATA",{id:x,change:t})}));Zt("SHOULD_PREPARE_OUTPUT",false,{item:b,query:e}).then((function(t){var a=e("GET_BEFORE_PREPARE_FILE");if(a)t=a(b,t);var o=function t(){i("COMPLETE_LOAD_ITEM",{query:x,item:b,data:{source:r,success:c}});de(i,n)};if(t){i("REQUEST_PREPARE_OUTPUT",{query:x,item:b,success:function t(e){i("DID_PREPARE_OUTPUT",{id:x,file:e});o()}},true);return}o()}))};Zt("DID_LOAD_ITEM",b,{query:e,dispatch:i}).then((function(){he(e("GET_BEFORE_ADD_FILE"),Nt(b)).then(t)})).catch((function(e){if(!e||!e.error||!e.status)return t(false);i("DID_THROW_ITEM_INVALID",{id:x,error:e.error,status:e.status})}))}));b.on("process-start",(function(){i("DID_START_ITEM_PROCESSING",{id:x})}));b.on("process-progress",(function(t){i("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:x,progress:t})}));b.on("process-error",(function(t){i("DID_THROW_ITEM_PROCESSING_ERROR",{id:x,error:t,status:{main:ce(n.options.labelFileProcessingError)(t),sub:n.options.labelTapToRetry}})}));b.on("process-revert-error",(function(t){i("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:x,error:t,status:{main:ce(n.options.labelFileProcessingRevertError)(t),sub:n.options.labelTapToRetry}})}));b.on("process-complete",(function(t){i("DID_COMPLETE_ITEM_PROCESSING",{id:x,error:null,serverFileReference:t});i("DID_DEFINE_VALUE",{id:x,value:t})}));b.on("process-abort",(function(){i("DID_ABORT_ITEM_PROCESSING",{id:x})}));b.on("process-revert",(function(){i("DID_REVERT_ITEM_PROCESSING",{id:x});i("DID_DEFINE_VALUE",{id:x,value:null})}));i("DID_ADD_ITEM",{id:x,index:s,interactionMethod:l});de(i,n);var y=n.options.server||{},k=y.url,E=y.load,I=y.restore,T=y.fetch;b.load(r,Fi(m===Ht.INPUT?K(r)&&ue(r)?T?qi(k,T):se:se:m===Ht.LIMBO?qi(k,I):qi(k,E)),(function(t,i,n){Zt("LOAD_FILE",t,{query:e}).then(i).catch(n)}))},REQUEST_PREPARE_OUTPUT:function t(i){var n=i.item,a=i.success,r=i.failure,o=r===void 0?function(){}:r;var s={error:ji("error",0,"Item not found"),file:null};if(n.archived)return o(s);Zt("PREPARE_OUTPUT",n.file,{query:e,item:n}).then((function(t){Zt("COMPLETE_PREPARE_OUTPUT",t,{query:e,item:n}).then((function(t){if(n.archived)return o(s);a(t)}))}))},COMPLETE_LOAD_ITEM:function t(a){var r=a.item,o=a.data;var s=o.success,l=o.source;var u=e("GET_ITEM_INSERT_LOCATION");if(rt(u)&&l){pe(n,u)}i("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.origin===Ht.INPUT?null:l});s(Nt(r));if(r.origin===Ht.LOCAL){i("DID_LOAD_LOCAL_ITEM",{id:r.id});return}if(r.origin===Ht.LIMBO){i("DID_COMPLETE_ITEM_PROCESSING",{id:r.id,error:null,serverFileReference:l});i("DID_DEFINE_VALUE",{id:r.id,value:r.serverId||l});return}if(e("IS_ASYNC")&&n.options.instantUpload){i("REQUEST_ITEM_PROCESSING",{query:r.id})}},RETRY_ITEM_LOAD:ve(n,(function(t){t.retryLoad()})),REQUEST_ITEM_PREPARE:ve(n,(function(t,e,n){i("REQUEST_PREPARE_OUTPUT",{query:t.id,item:t,success:function n(a){i("DID_PREPARE_OUTPUT",{id:t.id,file:a});e({file:t,output:a})},failure:n},true)})),REQUEST_ITEM_PROCESSING:ve(n,(function(t,a,r){var o=t.status===jt.IDLE||t.status===jt.PROCESSING_ERROR;if(!o){var s=function e(){return i("REQUEST_ITEM_PROCESSING",{query:t,success:a,failure:r})};var l=function t(){return document.hidden?s():setTimeout(s,32)};if(t.status===jt.PROCESSING_COMPLETE||t.status===jt.PROCESSING_REVERT_ERROR){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(l).catch((function(){}))}else if(t.status===jt.PROCESSING){t.abortProcessing().then(l)}return}if(t.status===jt.PROCESSING_QUEUED)return;t.requestProcessing();i("DID_REQUEST_ITEM_PROCESSING",{id:t.id});i("PROCESS_ITEM",{query:t,success:a,failure:r},true)})),PROCESS_ITEM:ve(n,(function(t,a,r){var o=e("GET_MAX_PARALLEL_UPLOADS");var s=e("GET_ITEMS_BY_STATUS",jt.PROCESSING).length;if(s===o){n.processingQueue.push({id:t.id,success:a,failure:r});return}if(t.status===jt.PROCESSING)return;var l=function t(){var e=n.processingQueue.shift();if(!e)return;var a=e.id,r=e.success,o=e.failure;var s=ii(n.items,a);if(!s||s.archived){t();return}i("PROCESS_ITEM",{query:a,success:r,failure:o},true)};t.onOnce("process-complete",(function(){a(Nt(t));l();var r=n.options.server;var o=n.options.instantUpload;if(o&&t.origin===Ht.LOCAL&&rt(r.remove)){var s=function t(){};t.origin=Ht.LIMBO;n.options.server.remove(t.source,s,s)}var u=e("GET_ITEMS_BY_STATUS",jt.PROCESSING_COMPLETE).length===n.items.length;if(u){i("DID_COMPLETE_ITEM_PROCESSING_ALL")}}));t.onOnce("process-error",(function(i){r({error:i,file:Nt(t)});l()}));var u=n.options;t.process(Ki(Xi(u.server.url,u.server.process,u.name,{chunkTransferId:t.transferId,chunkServer:u.server.patch,chunkUploads:u.chunkUploads,chunkForce:u.chunkForce,chunkSize:u.chunkSize,chunkRetryDelays:u.chunkRetryDelays}),{allowMinimumUploadDuration:e("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(n,a,r){Zt("PREPARE_OUTPUT",n,{query:e,item:t}).then((function(e){i("DID_PREPARE_OUTPUT",{id:t.id,file:e});a(e)})).catch(r)}))})),RETRY_ITEM_PROCESSING:ve(n,(function(t){i("REQUEST_ITEM_PROCESSING",{query:t})})),REQUEST_REMOVE_ITEM:ve(n,(function(t){he(e("GET_BEFORE_REMOVE_FILE"),Nt(t)).then((function(e){if(!e){return}i("REMOVE_ITEM",{query:t})}))})),RELEASE_ITEM:ve(n,(function(t){t.release()})),REMOVE_ITEM:ve(n,(function(t,a,r,o){var s=function e(){var r=t.id;oe(n.items,r).archive();i("DID_REMOVE_ITEM",{error:null,id:r,item:t});de(i,n);a(Nt(t))};var l=n.options.server;if(t.origin===Ht.LOCAL&&l&&rt(l.remove)&&o.remove!==false){i("DID_START_ITEM_REMOVE",{id:t.id});l.remove(t.source,(function(){return s()}),(function(e){i("DID_THROW_ITEM_REMOVE_ERROR",{id:t.id,error:ji("error",0,e,null),status:{main:ce(n.options.labelFileRemoveError)(e),sub:n.options.labelTapToRetry}})}))}else{if(o.revert&&t.origin!==Ht.LOCAL&&t.serverId!==null||n.options.chunkUploads&&t.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT"))}s()}})),ABORT_ITEM_LOAD:ve(n,(function(t){t.abortLoad()})),ABORT_ITEM_PROCESSING:ve(n,(function(t){if(t.serverId){i("REVERT_ITEM_PROCESSING",{id:t.id});return}t.abortProcessing().then((function(){var e=n.options.instantUpload;if(e){i("REMOVE_ITEM",{query:t.id})}}))})),REQUEST_REVERT_ITEM_PROCESSING:ve(n,(function(t){if(!n.options.instantUpload){i("REVERT_ITEM_PROCESSING",{query:t});return}var a=function e(n){if(!n)return;i("REVERT_ITEM_PROCESSING",{query:t})};var r=e("GET_BEFORE_REMOVE_FILE");if(!r){return a(true)}var o=r(Nt(t));if(o==null){return a(true)}if(typeof o==="boolean"){return a(o)}if(typeof o.then==="function"){o.then(a)}})),REVERT_ITEM_PROCESSING:ve(n,(function(t){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then((function(){var e=n.options.instantUpload||fe(t);if(e){i("REMOVE_ITEM",{query:t.id})}})).catch((function(){}))})),SET_OPTIONS:function t(e){var n=e.options;var a=Object.keys(n);var r=_e.filter((function(t){return a.includes(t)}));var o=[].concat(Dt(r),Dt(Object.keys(n).filter((function(t){return!r.includes(t)}))));o.forEach((function(t){i("SET_"+yt(t,"_").toUpperCase(),{value:n[t]})}))}}};var _e=["server"];var me=function t(i){return i};var be=function t(i){return document.createElement(i)};var we=function t(i,e){var n=i.childNodes[0];if(!n){n=document.createTextNode(e);i.appendChild(n)}else if(e!==n.nodeValue){n.nodeValue=e}};var xe=function t(i,e,n,a){var r=(a%360-90)*Math.PI/180;return{x:i+n*Math.cos(r),y:e+n*Math.sin(r)}};var ye=function t(i,e,n,a,r,o){var s=xe(i,e,n,r);var l=xe(i,e,n,a);return["M",s.x,s.y,"A",n,n,0,o,0,l.x,l.y].join(" ")};var ke=function t(i,e,n,a,r){var o=1;if(r>a&&r-a<=.5){o=0}if(a>r&&a-r>=.5){o=0}return ye(i,e,n,Math.min(.9999,a)*360,Math.min(.9999,r)*360,o)};var Ee=function t(i){var e=i.root,n=i.props;n.spin=false;n.progress=0;n.opacity=0;var a=c("svg");e.ref.path=c("path",{"stroke-width":2,"stroke-linecap":"round"});a.appendChild(e.ref.path);e.ref.svg=a;e.appendChild(a)};var Ie=function t(i){var e=i.root,n=i.props;if(n.opacity===0){return}if(n.align){e.element.dataset.align=n.align}var a=parseInt(o(e.ref.path,"stroke-width"),10);var r=e.rect.element.width*.5;var s=0;var l=0;if(n.spin){s=0;l=.5}else{s=0;l=n.progress}var u=ke(r,r,r-a,s,l);o(e.ref.path,"d",u);o(e.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)};var Te=j({tag:"div",name:"progress-indicator",ignoreRectUpdate:true,ignoreRect:true,create:Ee,write:Ie,mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}});var Ae=function t(i){var e=i.root,n=i.props;e.element.innerHTML=(n.icon||"")+("<span>"+n.label+"</span>");n.isDisabled=false};var Se=function t(i){var e=i.root,n=i.props;var a=n.isDisabled;var r=e.query("GET_DISABLED")||n.opacity===0;if(r&&!a){n.isDisabled=true;o(e.element,"disabled","disabled")}else if(!r&&a){n.isDisabled=false;e.element.removeAttribute("disabled")}};var Me=j({tag:"button",attributes:{type:"button"},ignoreRect:true,ignoreRectUpdate:true,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:true},create:Ae,write:Se});var De=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:".";var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e3;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var r=a.labelBytes,o=r===void 0?"bytes":r,s=a.labelKilobytes,l=s===void 0?"KB":s,u=a.labelMegabytes,c=u===void 0?"MB":u,f=a.labelGigabytes,d=f===void 0?"GB":f;i=Math.round(Math.abs(i));var h=n;var p=n*n;var v=n*n*n;if(i<h){return i+" "+o}if(i<p){return Math.floor(i/h)+" "+l}if(i<v){return Pe(i/p,1,e)+" "+c}return Pe(i/v,2,e)+" "+d};var Pe=function t(i,e,n){return i.toFixed(e).split(".").filter((function(t){return t!=="0"})).join(n)};var Oe=function t(i){var e=i.root,n=i.props;var a=be("span");a.className="filepond--file-info-main";o(a,"aria-hidden","true");e.appendChild(a);e.ref.fileName=a;var r=be("span");r.className="filepond--file-info-sub";e.appendChild(r);e.ref.fileSize=r;we(r,e.query("GET_LABEL_FILE_WAITING_FOR_SIZE"));we(a,me(e.query("GET_ITEM_NAME",n.id)))};var Re=function t(i){var e=i.root,n=i.props;we(e.ref.fileSize,De(e.query("GET_ITEM_SIZE",n.id),".",e.query("GET_FILE_SIZE_BASE"),e.query("GET_FILE_SIZE_LABELS",e.query)));we(e.ref.fileName,me(e.query("GET_ITEM_NAME",n.id)))};var Ce=function t(i){var e=i.root,n=i.props;if(nt(e.query("GET_ITEM_SIZE",n.id))){Re({root:e,props:n});return}we(e.ref.fileSize,e.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))};var Le=j({name:"file-info",ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:Re,DID_UPDATE_ITEM_META:Re,DID_THROW_ITEM_LOAD_ERROR:Ce,DID_THROW_ITEM_INVALID:Ce}),didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},create:Oe,mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}});var ze=function t(i){return Math.round(i*100)};var Ge=function t(i){var e=i.root;var n=be("span");n.className="filepond--file-status-main";e.appendChild(n);e.ref.main=n;var a=be("span");a.className="filepond--file-status-sub";e.appendChild(a);e.ref.sub=a;Fe({root:e,action:{progress:null}})};var Fe=function t(i){var e=i.root,n=i.action;var a=n.progress===null?e.query("GET_LABEL_FILE_LOADING"):e.query("GET_LABEL_FILE_LOADING")+" "+ze(n.progress)+"%";we(e.ref.main,a);we(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))};var Ne=function t(i){var e=i.root,n=i.action;var a=n.progress===null?e.query("GET_LABEL_FILE_PROCESSING"):e.query("GET_LABEL_FILE_PROCESSING")+" "+ze(n.progress)+"%";we(e.ref.main,a);we(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))};var Be=function t(i){var e=i.root;we(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING"));we(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))};var je=function t(i){var e=i.root;we(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_ABORTED"));we(e.ref.sub,e.query("GET_LABEL_TAP_TO_RETRY"))};var He=function t(i){var e=i.root;we(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_COMPLETE"));we(e.ref.sub,e.query("GET_LABEL_TAP_TO_UNDO"))};var Ue=function t(i){var e=i.root;we(e.ref.main,"");we(e.ref.sub,"")};var Ve=function t(i){var e=i.root,n=i.action;we(e.ref.main,n.status.main);we(e.ref.sub,n.status.sub)};var qe=j({name:"file-status",ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:Ue,DID_REVERT_ITEM_PROCESSING:Ue,DID_REQUEST_ITEM_PROCESSING:Be,DID_ABORT_ITEM_PROCESSING:je,DID_COMPLETE_ITEM_PROCESSING:He,DID_UPDATE_ITEM_PROCESS_PROGRESS:Ne,DID_UPDATE_ITEM_LOAD_PROGRESS:Fe,DID_THROW_ITEM_LOAD_ERROR:Ve,DID_THROW_ITEM_INVALID:Ve,DID_THROW_ITEM_PROCESSING_ERROR:Ve,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Ve,DID_THROW_ITEM_REMOVE_ERROR:Ve}),didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},create:Ge,mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}});var We={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}};var Ye=[];a(We,(function(t){Ye.push(t)}));var Ze=function t(i){if(tn(i)==="right")return 0;var e=i.ref.buttonRemoveItem.rect.element;return e.hidden?null:e.width+e.left};var Xe=function t(i){var e=i.ref.buttonAbortItemLoad.rect.element;return e.width};var Qe=function t(i){return Math.floor(i.ref.buttonRemoveItem.rect.element.height/4)};var $e=function t(i){return Math.floor(i.ref.buttonRemoveItem.rect.element.left/2)};var Je=function t(i){return i.query("GET_STYLE_LOAD_INDICATOR_POSITION")};var Ke=function t(i){return i.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")};var tn=function t(i){return i.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")};var en={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:Je},processProgressIndicator:{opacity:0,align:Ke},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}};var nn={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Ze},status:{translateX:Ze}};var an={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}};var rn={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{translateX:Ze,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:tn},info:{translateX:Ze},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:tn},buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{opacity:1,translateX:Ze}},DID_LOAD_ITEM:nn,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{translateX:Ze}},DID_START_ITEM_PROCESSING:an,DID_REQUEST_ITEM_PROCESSING:an,DID_UPDATE_ITEM_PROCESS_PROGRESS:an,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:Ze}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Ze},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:nn};var on=j({create:function t(i){var e=i.root;e.element.innerHTML=e.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:true,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}});var sn=function t(i){var e=i.root,n=i.props;var r=Object.keys(We).reduce((function(t,i){t[i]=Object.assign({},We[i]);return t}),{});var o=n.id;var s=e.query("GET_ALLOW_REVERT");var l=e.query("GET_ALLOW_REMOVE");var u=e.query("GET_ALLOW_PROCESS");var c=e.query("GET_INSTANT_UPLOAD");var f=e.query("IS_ASYNC");var d=e.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");var h;if(f){if(u&&!s){h=function t(i){return!/RevertItemProcessing/.test(i)}}else if(!u&&s){h=function t(i){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(i)}}else if(!u&&!s){h=function t(i){return!/Process/.test(i)}}}else{h=function t(i){return!/Process/.test(i)}}var p=h?Ye.filter(h):Ye.concat();if(c&&s){r["RevertItemProcessing"].label="GET_LABEL_BUTTON_REMOVE_ITEM";r["RevertItemProcessing"].icon="GET_ICON_REMOVE"}if(f&&!s){var v=rn["DID_COMPLETE_ITEM_PROCESSING"];v.info.translateX=$e;v.info.translateY=Qe;v.status.translateY=Qe;v.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(f&&!u){["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(t){rn[t].status.translateY=Qe}));rn["DID_THROW_ITEM_PROCESSING_ERROR"].status.translateX=Xe}if(d&&s){r["RevertItemProcessing"].align="BUTTON_REMOVE_ITEM_POSITION";var g=rn["DID_COMPLETE_ITEM_PROCESSING"];g.info.translateX=Ze;g.status.translateY=Qe;g.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(!l){r["RemoveItem"].disabled=true}a(r,(function(t,i){var n=e.createChildView(Me,{label:e.query(i.label),icon:e.query(i.icon),opacity:0});if(p.includes(t)){e.appendChildView(n)}if(i.disabled){n.element.setAttribute("disabled","disabled");n.element.setAttribute("hidden","hidden")}n.element.dataset.align=e.query("GET_STYLE_"+i.align);n.element.classList.add(i.className);n.on("click",(function(t){t.stopPropagation();if(i.disabled)return;e.dispatch(i.action,{query:o})}));e.ref["button"+t]=n}));e.ref.processingCompleteIndicator=e.appendChildView(e.createChildView(on));e.ref.processingCompleteIndicator.element.dataset.align=e.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION");e.ref.info=e.appendChildView(e.createChildView(Le,{id:o}));e.ref.status=e.appendChildView(e.createChildView(qe,{id:o}));var _=e.appendChildView(e.createChildView(Te,{opacity:0,align:e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));_.element.classList.add("filepond--load-indicator");e.ref.loadProgressIndicator=_;var m=e.appendChildView(e.createChildView(Te,{opacity:0,align:e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));m.element.classList.add("filepond--process-indicator");e.ref.processProgressIndicator=m;e.ref.activeStyles=[]};var ln=function t(i){var e=i.root,n=i.actions,r=i.props;un({root:e,actions:n,props:r});var o=n.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return rn[t.type]}));if(o){e.ref.activeStyles=[];var s=rn[o.type];a(en,(function(t,i){var n=e.ref[t];a(i,(function(i,a){var r=s[t]&&typeof s[t][i]!=="undefined"?s[t][i]:a;e.ref.activeStyles.push({control:n,key:i,value:r})}))}))}e.ref.activeStyles.forEach((function(t){var i=t.control,n=t.key,a=t.value;i[n]=typeof a==="function"?a(e):a}))};var un=U({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function t(i){var e=i.root,n=i.action;e.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function t(i){var e=i.root,n=i.action;e.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function t(i){var e=i.root,n=i.action;e.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function t(i){var e=i.root;e.ref.processProgressIndicator.spin=true;e.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function t(i){var e=i.root;e.ref.loadProgressIndicator.spin=true;e.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function t(i){var e=i.root;e.ref.processProgressIndicator.spin=true;e.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function t(i){var e=i.root,n=i.action;e.ref.loadProgressIndicator.spin=false;e.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function t(i){var e=i.root,n=i.action;e.ref.processProgressIndicator.spin=false;e.ref.processProgressIndicator.progress=n.progress}});var cn=j({create:sn,write:ln,didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},name:"file"});var fn=function t(i){var e=i.root,n=i.props;e.ref.fileName=be("legend");e.appendChild(e.ref.fileName);e.ref.file=e.appendChildView(e.createChildView(cn,{id:n.id}));e.ref.data=false};var dn=function t(i){var e=i.root,n=i.props;we(e.ref.fileName,me(e.query("GET_ITEM_NAME",n.id)))};var hn=j({create:fn,ignoreRect:true,write:U({DID_LOAD_ITEM:dn}),didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},tag:"fieldset",name:"file-wrapper"});var pn={type:"spring",damping:.6,mass:7};var vn=function t(i){var e=i.root,n=i.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:pn},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:pn},styles:["translateY"]}}].forEach((function(t){gn(e,t,n.name)}));e.element.classList.add("filepond--"+n.name);e.ref.scalable=null};var gn=function t(i,e,n){var a=j({name:"panel-"+e.name+" filepond--"+n,mixins:e.mixins,ignoreRectUpdate:true});var r=i.createChildView(a,e.props);i.ref[e.name]=i.appendChildView(r)};var _n=function t(i){var e=i.root,n=i.props;if(e.ref.scalable===null||n.scalable!==e.ref.scalable){e.ref.scalable=$(n.scalable)?n.scalable:true;e.element.dataset.scalable=e.ref.scalable}if(!n.height)return;var a=e.ref.top.rect.element;var r=e.ref.bottom.rect.element;var o=Math.max(a.height+r.height,n.height);e.ref.center.translateY=a.height;e.ref.center.scaleY=(o-a.height-r.height)/100;e.ref.bottom.translateY=o-r.height};var mn=j({name:"panel",read:function t(i){var e=i.root,n=i.props;return n.heightCurrent=e.ref.bottom.translateY},write:_n,create:vn,ignoreRect:true,mixins:{apis:["height","heightCurrent","scalable"]}});var bn=function t(i){var e=i.map((function(t){return t.id}));var n=undefined;return{setIndex:function t(i){n=i},getIndex:function t(){return n},getItemIndex:function t(i){return e.indexOf(i.id)}}};var wn={type:"spring",stiffness:.75,damping:.45,mass:10};var xn="spring";var yn={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"};var kn=function t(i){var e=i.root,n=i.props;e.ref.handleClick=function(t){return e.dispatch("DID_ACTIVATE_ITEM",{id:n.id})};e.element.id="filepond--item-"+n.id;e.element.addEventListener("click",e.ref.handleClick);e.ref.container=e.appendChildView(e.createChildView(hn,{id:n.id}));e.ref.panel=e.appendChildView(e.createChildView(mn,{name:"item-panel"}));e.ref.panel.height=null;n.markedForRemoval=false;if(!e.query("GET_ALLOW_REORDER"))return;e.element.dataset.dragState="idle";var a=function t(i){if(!i.isPrimary)return;var a=false;var r={x:i.pageX,y:i.pageY};n.dragOrigin={x:e.translateX,y:e.translateY};n.dragCenter={x:i.offsetX,y:i.offsetY};var o=bn(e.query("GET_ACTIVE_ITEMS"));e.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:o});var s=function t(i){if(!i.isPrimary)return;i.stopPropagation();i.preventDefault();n.dragOffset={x:i.pageX-r.x,y:i.pageY-r.y};var s=n.dragOffset.x*n.dragOffset.x+n.dragOffset.y*n.dragOffset.y;if(s>16&&!a){a=true;e.element.removeEventListener("click",e.ref.handleClick)}e.dispatch("DID_DRAG_ITEM",{id:n.id,dragState:o})};var l=function t(i){if(!i.isPrimary)return;n.dragOffset={x:i.pageX-r.x,y:i.pageY-r.y};c()};var u=function t(){c()};var c=function t(){document.removeEventListener("pointercancel",u);document.removeEventListener("pointermove",s);document.removeEventListener("pointerup",l);e.dispatch("DID_DROP_ITEM",{id:n.id,dragState:o});if(a){setTimeout((function(){return e.element.addEventListener("click",e.ref.handleClick)}),0)}};document.addEventListener("pointercancel",u);document.addEventListener("pointermove",s);document.addEventListener("pointerup",l)};e.element.addEventListener("pointerdown",a)};var En=U({DID_UPDATE_PANEL_HEIGHT:function t(i){var e=i.root,n=i.action;e.height=n.height}});var In=U({DID_GRAB_ITEM:function t(i){var e=i.root,n=i.props;n.dragOrigin={x:e.translateX,y:e.translateY}},DID_DRAG_ITEM:function t(i){var e=i.root;e.element.dataset.dragState="drag"},DID_DROP_ITEM:function t(i){var e=i.root,n=i.props;n.dragOffset=null;n.dragOrigin=null;e.element.dataset.dragState="drop"}},(function(t){var i=t.root,e=t.actions,n=t.props,a=t.shouldOptimize;if(i.element.dataset.dragState==="drop"){if(i.scaleX<=1){i.element.dataset.dragState="idle"}}var r=e.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return yn[t.type]}));if(r&&r.type!==n.currentState){n.currentState=r.type;i.element.dataset.filepondItemState=yn[n.currentState]||""}var o=i.query("GET_ITEM_PANEL_ASPECT_RATIO")||i.query("GET_PANEL_ASPECT_RATIO");if(!o){En({root:i,actions:e,props:n});if(!i.height&&i.ref.container.rect.element.height>0){i.height=i.ref.container.rect.element.height}}else if(!a){i.height=i.rect.element.width*o}if(a){i.ref.panel.height=null}i.ref.panel.height=i.height}));var Tn=j({create:kn,write:In,destroy:function t(i){var e=i.root,n=i.props;e.element.removeEventListener("click",e.ref.handleClick);e.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:xn,scaleY:xn,translateX:wn,translateY:wn,opacity:{type:"tween",duration:150}}}});var An=function(t,i){return Math.max(1,Math.floor((t+1)/i))};var Sn=function t(i,e,n){if(!n)return;var a=i.rect.element.width;var r=e.length;var o=null;if(r===0||n.top<e[0].rect.element.top)return-1;var s=e[0];var l=s.rect.element;var u=l.marginLeft+l.marginRight;var c=l.width+u;var f=An(a,c);if(f===1){for(var d=0;d<r;d++){var h=e[d];var p=h.rect.outer.top+h.rect.element.height*.5;if(n.top<p){return d}}return r}var v=l.marginTop+l.marginBottom;var g=l.height+v;for(var _=0;_<r;_++){var m=_%f;var b=Math.floor(_/f);var w=m*c;var x=b*g;var y=x-l.marginTop;var k=w+c;var E=x+g+l.marginBottom;if(n.top<E&&n.top>y){if(n.left<k){return _}else if(_!==r-1){o=_}else{o=null}}}if(o!==null){return o}return r};var Mn={height:0,width:0,get getHeight(){return this.height},set setHeight(t){if(this.height===0||t===0)this.height=t},get getWidth(){return this.width},set setWidth(t){if(this.width===0||t===0)this.width=t}};var Dn=function t(i){var e=i.root;o(e.element,"role","list");e.ref.lastItemSpanwDate=Date.now()};var Pn=function t(i){var e=i.root,n=i.action;var a=n.id,r=n.index,o=n.interactionMethod;e.ref.addIndex=r;var s=Date.now();var l=s;var u=1;if(o!==Tt.NONE){u=0;var c=e.query("GET_ITEM_INSERT_INTERVAL");var f=s-e.ref.lastItemSpanwDate;l=f<c?s+(c-f):s}e.ref.lastItemSpanwDate=l;e.appendChildView(e.createChildView(Tn,{spawnDate:l,id:a,opacity:u,interactionMethod:o}),r)};var On=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;if(i.dragOffset){i.translateX=null;i.translateY=null;i.translateX=i.dragOrigin.x+i.dragOffset.x;i.translateY=i.dragOrigin.y+i.dragOffset.y;i.scaleX=1.025;i.scaleY=1.025}else{i.translateX=e;i.translateY=n;if(Date.now()>i.spawnDate){if(i.opacity===0){Rn(i,e,n,a,r)}i.scaleX=1;i.scaleY=1;i.opacity=1}}};var Rn=function t(i,e,n,a,r){if(i.interactionMethod===Tt.NONE){i.translateX=null;i.translateX=e;i.translateY=null;i.translateY=n}else if(i.interactionMethod===Tt.DROP){i.translateX=null;i.translateX=e-a*20;i.translateY=null;i.translateY=n-r*10;i.scaleX=.8;i.scaleY=.8}else if(i.interactionMethod===Tt.BROWSE){i.translateY=null;i.translateY=n-30}else if(i.interactionMethod===Tt.API){i.translateX=null;i.translateX=e-30;i.translateY=null}};var Cn=function t(i){var e=i.root,n=i.action;var a=n.id;var r=e.childViews.find((function(t){return t.id===a}));if(!r){return}r.scaleX=.9;r.scaleY=.9;r.opacity=0;r.markedForRemoval=true};var Ln=function t(i){return i.rect.element.height+i.rect.element.marginBottom*.5+i.rect.element.marginTop*.5};var zn=function t(i){return i.rect.element.width+i.rect.element.marginLeft*.5+i.rect.element.marginRight*.5};var Gn=function t(i){var e=i.root,n=i.action;var a=n.id,r=n.dragState;var o=e.query("GET_ITEM",{id:a});var s=e.childViews.find((function(t){return t.id===a}));var l=e.childViews.length;var u=r.getItemIndex(o);if(!s)return;var c={x:s.dragOrigin.x+s.dragOffset.x+s.dragCenter.x,y:s.dragOrigin.y+s.dragOffset.y+s.dragCenter.y};var f=Ln(s);var d=zn(s);var h=Math.floor(e.rect.outer.width/d);if(h>l)h=l;var p=Math.floor(l/h+1);Mn.setHeight=f*p;Mn.setWidth=d*h;var v={y:Math.floor(c.y/f),x:Math.floor(c.x/d),getGridIndex:function t(){if(c.y>Mn.getHeight||c.y<0||c.x>Mn.getWidth||c.x<0)return u;return this.y*h+this.x},getColIndex:function t(){var i=e.query("GET_ACTIVE_ITEMS");var n=e.childViews.filter((function(t){return t.rect.element.height}));var a=i.map((function(t){return n.find((function(i){return i.id===t.id}))}));var r=a.findIndex((function(t){return t===s}));var o=Ln(s);var l=a.length;var u=l;var f=0;var d=0;var h=0;for(var p=0;p<l;p++){f=Ln(a[p]);h=d;d=h+f;if(c.y<d){if(r>p){if(c.y<h+o){u=p;break}continue}u=p;break}}return u}};var g=h>1?v.getGridIndex():v.getColIndex();e.dispatch("MOVE_ITEM",{query:s,index:g});var _=r.getIndex();if(_===undefined||_!==g){r.setIndex(g);if(_===undefined)return;e.dispatch("DID_REORDER_ITEMS",{items:e.query("GET_ACTIVE_ITEMS"),origin:u,target:g})}};var Fn=U({DID_ADD_ITEM:Pn,DID_REMOVE_ITEM:Cn,DID_DRAG_ITEM:Gn});var Nn=function t(i){var e=i.root,n=i.props,a=i.actions,r=i.shouldOptimize;Fn({root:e,props:n,actions:a});var o=n.dragCoordinates;var s=e.rect.element.width;var l=e.childViews.filter((function(t){return t.rect.element.height}));var u=e.query("GET_ACTIVE_ITEMS").map((function(t){return l.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));var c=o?Sn(e,u,o):null;var f=e.ref.addIndex||null;e.ref.addIndex=null;var d=0;var h=0;var p=0;if(u.length===0)return;var v=u[0].rect.element;var g=v.marginTop+v.marginBottom;var _=v.marginLeft+v.marginRight;var m=v.width+_;var b=v.height+g;var w=An(s,m);if(w===1){var x=0;var y=0;u.forEach((function(t,i){if(c){var e=i-c;if(e===-2){y=-g*.25}else if(e===-1){y=-g*.75}else if(e===0){y=g*.75}else if(e===1){y=g*.25}else{y=0}}if(r){t.translateX=null;t.translateY=null}if(!t.markedForRemoval){On(t,0,x+y)}var n=t.rect.element.height+g;var a=n*(t.markedForRemoval?t.opacity:1);x+=a}))}else{var k=0;var E=0;u.forEach((function(t,i){if(i===c){d=1}if(i===f){p+=1}if(t.markedForRemoval&&t.opacity<.5){h-=1}var e=i+p+d+h;var n=e%w;var a=Math.floor(e/w);var o=n*m;var s=a*b;var l=Math.sign(o-k);var u=Math.sign(s-E);k=o;E=s;if(t.markedForRemoval)return;if(r){t.translateX=null;t.translateY=null}On(t,o,s,l,u)}))}};var Bn=function t(i,e){return e.filter((function(t){if(t.data&&t.data.id){return i.id===t.data.id}return true}))};var jn=j({create:Dn,write:Nn,tag:"ul",name:"list",didWriteView:function t(i){var e=i.root;e.childViews.filter((function(t){return t.markedForRemoval&&t.opacity===0&&t.resting})).forEach((function(t){t._destroy();e.removeChildView(t)}))},filterFrameActionsForChild:Bn,mixins:{apis:["dragCoordinates"]}});var Hn=function t(i){var e=i.root,n=i.props;e.ref.list=e.appendChildView(e.createChildView(jn));n.dragCoordinates=null;n.overflowing=false};var Un=function t(i){var e=i.root,n=i.props,a=i.action;if(!e.query("GET_ITEM_INSERT_LOCATION_FREEDOM"))return;n.dragCoordinates={left:a.position.scopeLeft-e.ref.list.rect.element.left,top:a.position.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)}};var Vn=function t(i){var e=i.props;e.dragCoordinates=null};var qn=U({DID_DRAG:Un,DID_END_DRAG:Vn});var Wn=function t(i){var e=i.root,n=i.props,a=i.actions;qn({root:e,props:n,actions:a});e.ref.list.dragCoordinates=n.dragCoordinates;if(n.overflowing&&!n.overflow){n.overflowing=false;e.element.dataset.state="";e.height=null}if(n.overflow){var r=Math.round(n.overflow);if(r!==e.height){n.overflowing=true;e.element.dataset.state="overflow";e.height=r}}};var Yn=j({create:Hn,write:Wn,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}});var Zn=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";if(n){o(i,e,a)}else{i.removeAttribute(e)}};var Xn=function t(i){if(!i||i.value===""){return}try{i.value=""}catch(t){}if(i.value){var e=be("form");var n=i.parentNode;var a=i.nextSibling;e.appendChild(i);e.reset();if(a){n.insertBefore(i,a)}else{n.appendChild(i)}}};var Qn=function t(i){var e=i.root,n=i.props;e.element.id="filepond--browser-"+n.id;o(e.element,"name",e.query("GET_NAME"));o(e.element,"aria-controls","filepond--assistant-"+n.id);o(e.element,"aria-labelledby","filepond--drop-label-"+n.id);$n({root:e,action:{value:e.query("GET_ACCEPTED_FILE_TYPES")}});Jn({root:e,action:{value:e.query("GET_ALLOW_MULTIPLE")}});Kn({root:e,action:{value:e.query("GET_ALLOW_DIRECTORIES_ONLY")}});ta({root:e});ia({root:e,action:{value:e.query("GET_REQUIRED")}});ea({root:e,action:{value:e.query("GET_CAPTURE_METHOD")}});e.ref.handleChange=function(t){if(!e.element.value){return}var i=Array.from(e.element.files).map((function(t){t._relativePath=t.webkitRelativePath;return t}));setTimeout((function(){n.onload(i);Xn(e.element)}),250)};e.element.addEventListener("change",e.ref.handleChange)};var $n=function t(i){var e=i.root,n=i.action;if(!e.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE"))return;Zn(e.element,"accept",!!n.value,n.value?n.value.join(","):"")};var Jn=function t(i){var e=i.root,n=i.action;Zn(e.element,"multiple",n.value)};var Kn=function t(i){var e=i.root,n=i.action;Zn(e.element,"webkitdirectory",n.value)};var ta=function t(i){var e=i.root;var n=e.query("GET_DISABLED");var a=e.query("GET_ALLOW_BROWSE");var r=n||!a;Zn(e.element,"disabled",r)};var ia=function t(i){var e=i.root,n=i.action;if(!n.value){Zn(e.element,"required",false)}else if(e.query("GET_TOTAL_ITEMS")===0){Zn(e.element,"required",true)}};var ea=function t(i){var e=i.root,n=i.action;Zn(e.element,"capture",!!n.value,n.value===true?"":n.value)};var na=function t(i){var e=i.root;var n=e.element;if(e.query("GET_TOTAL_ITEMS")>0){Zn(n,"required",false);Zn(n,"name",false);var a=e.query("GET_ACTIVE_ITEMS");var r=false;for(var o=0;o<a.length;o++){if(a[o].status===jt.LOAD_ERROR){r=true}}e.element.setCustomValidity(r?e.query("GET_LABEL_INVALID_FIELD"):"")}else{Zn(n,"name",true,e.query("GET_NAME"));var s=e.query("GET_CHECK_VALIDITY");if(s){n.setCustomValidity("")}if(e.query("GET_REQUIRED")){Zn(n,"required",true)}}};var aa=function t(i){var e=i.root;var n=e.query("GET_CHECK_VALIDITY");if(!n)return;e.element.setCustomValidity(e.query("GET_LABEL_INVALID_FIELD"))};var ra=j({tag:"input",name:"browser",ignoreRect:true,ignoreRectUpdate:true,attributes:{type:"file"},create:Qn,destroy:function t(i){var e=i.root;e.element.removeEventListener("change",e.ref.handleChange)},write:U({DID_LOAD_ITEM:na,DID_REMOVE_ITEM:na,DID_THROW_ITEM_INVALID:aa,DID_SET_DISABLED:ta,DID_SET_ALLOW_BROWSE:ta,DID_SET_ALLOW_DIRECTORIES_ONLY:Kn,DID_SET_ALLOW_MULTIPLE:Jn,DID_SET_ACCEPTED_FILE_TYPES:$n,DID_SET_CAPTURE_METHOD:ea,DID_SET_REQUIRED:ia})});var oa={ENTER:13,SPACE:32};var sa=function t(i){var e=i.root,n=i.props;var a=be("label");o(a,"for","filepond--browser-"+n.id);o(a,"id","filepond--drop-label-"+n.id);e.ref.handleKeyDown=function(t){var i=t.keyCode===oa.ENTER||t.keyCode===oa.SPACE;if(!i)return;t.preventDefault();e.ref.label.click()};e.ref.handleClick=function(t){var i=t.target===a||a.contains(t.target);if(i)return;e.ref.label.click()};a.addEventListener("keydown",e.ref.handleKeyDown);e.element.addEventListener("click",e.ref.handleClick);la(a,n.caption);e.appendChild(a);e.ref.label=a};var la=function t(i,e){i.innerHTML=e;var n=i.querySelector(".filepond--label-action");if(n){o(n,"tabindex","0")}return e};var ua=j({name:"drop-label",ignoreRect:true,create:sa,destroy:function t(i){var e=i.root;e.ref.label.addEventListener("keydown",e.ref.handleKeyDown);e.element.removeEventListener("click",e.ref.handleClick)},write:U({DID_SET_LABEL_IDLE:function t(i){var e=i.root,n=i.action;la(e.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}});var ca=j({name:"drip-blob",ignoreRect:true,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}});var fa=function t(i){var e=i.root;var n=e.rect.element.width*.5;var a=e.rect.element.height*.5;e.ref.blob=e.appendChildView(e.createChildView(ca,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:a}))};var da=function t(i){var e=i.root,n=i.action;if(!e.ref.blob){fa({root:e});return}e.ref.blob.translateX=n.position.scopeLeft;e.ref.blob.translateY=n.position.scopeTop;e.ref.blob.scaleX=1;e.ref.blob.scaleY=1;e.ref.blob.opacity=1};var ha=function t(i){var e=i.root;if(!e.ref.blob){return}e.ref.blob.opacity=0};var pa=function t(i){var e=i.root;if(!e.ref.blob){return}e.ref.blob.scaleX=2.5;e.ref.blob.scaleY=2.5;e.ref.blob.opacity=0};var va=function t(i){var e=i.root,n=i.props,a=i.actions;ga({root:e,props:n,actions:a});var r=e.ref.blob;if(a.length===0&&r&&r.opacity===0){e.removeChildView(r);e.ref.blob=null}};var ga=U({DID_DRAG:da,DID_DROP:pa,DID_END_DRAG:ha});var _a=j({ignoreRect:true,ignoreRectUpdate:true,name:"drip",write:va});var ma=function t(i,e){try{var n=new DataTransfer;e.forEach((function(t){if(t instanceof File){n.items.add(t)}else{n.items.add(new File([t],t.name,{type:t.type}))}}));i.files=n.files}catch(t){return false}return true};var ba=function t(i){var e=i.root;e.ref.fields={};var n=document.createElement("legend");n.textContent="Files";e.element.appendChild(n)};var wa=function t(i,e){return i.ref.fields[e]};var xa=function t(i){i.query("GET_ACTIVE_ITEMS").forEach((function(t){if(!i.ref.fields[t.id])return;i.element.appendChild(i.ref.fields[t.id])}))};var ya=function t(i){var e=i.root;return xa(e)};var ka=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.origin===Ht.LOCAL;var o=!r&&e.query("SHOULD_UPDATE_FILE_INPUT");var s=be("input");s.type=o?"file":"hidden";s.name=e.query("GET_NAME");e.ref.fields[n.id]=s;xa(e)};var Ea=function t(i){var e=i.root,n=i.action;var a=wa(e,n.id);if(!a)return;if(n.serverFileReference!==null)a.value=n.serverFileReference;if(!e.query("SHOULD_UPDATE_FILE_INPUT"))return;var r=e.query("GET_ITEM",n.id);ma(a,[r.file])};var Ia=function t(i){var e=i.root,n=i.action;if(!e.query("SHOULD_UPDATE_FILE_INPUT"))return;setTimeout((function(){var t=wa(e,n.id);if(!t)return;ma(t,[n.file])}),0)};var Ta=function t(i){var e=i.root;e.element.disabled=e.query("GET_DISABLED")};var Aa=function t(i){var e=i.root,n=i.action;var a=wa(e,n.id);if(!a)return;if(a.parentNode)a.parentNode.removeChild(a);delete e.ref.fields[n.id]};var Sa=function t(i){var e=i.root,n=i.action;var a=wa(e,n.id);if(!a)return;if(n.value===null){a.removeAttribute("value")}else{if(a.type!="file"){a.value=n.value}}xa(e)};var Ma=U({DID_SET_DISABLED:Ta,DID_ADD_ITEM:ka,DID_LOAD_ITEM:Ea,DID_REMOVE_ITEM:Aa,DID_DEFINE_VALUE:Sa,DID_PREPARE_OUTPUT:Ia,DID_REORDER_ITEMS:ya,DID_SORT_ITEMS:ya});var Da=j({tag:"fieldset",name:"data",create:ba,write:Ma,ignoreRect:true});var Pa=function t(i){return"getRootNode"in i?i.getRootNode():document};var Oa=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"];var Ra=["css","csv","html","txt"];var Ca={zip:"zip|compressed",epub:"application/epub+zip"};var La=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";i=i.toLowerCase();if(Oa.includes(i)){return"image/"+(i==="jpg"?"jpeg":i==="svg"?"svg+xml":i)}if(Ra.includes(i)){return"text/"+i}return Ca[i]||""};var za=function t(i){return new Promise((function(t,e){var n=Wa(i);if(n.length&&!Ga(i)){return t(n)}Fa(i).then(t)}))};var Ga=function t(i){if(i.files)return i.files.length>0;return false};var Fa=function t(i){return new Promise((function(t,e){var n=(i.items?Array.from(i.items):[]).filter((function(t){return Na(t)})).map((function(t){return Ba(t)}));if(!n.length){t(i.files?Array.from(i.files):[]);return}Promise.all(n).then((function(i){var e=[];i.forEach((function(t){e.push.apply(e,t)}));t(e.filter((function(t){return t})).map((function(t){if(!t._relativePath)t._relativePath=t.webkitRelativePath;return t})))})).catch(console.error)}))};var Na=function t(i){if(Va(i)){var e=qa(i);if(e){return e.isFile||e.isDirectory}}return i.kind==="file"};var Ba=function t(i){return new Promise((function(t,e){if(Ua(i)){ja(qa(i)).then(t).catch(e);return}t([i.getAsFile()])}))};var ja=function t(i){return new Promise((function(t,e){var n=[];var a=0;var r=0;var o=function i(){if(r===0&&a===0){t(n)}};var s=function t(i){a++;var s=i.createReader();var l=function i(){s.readEntries((function(e){if(e.length===0){a--;o();return}e.forEach((function(i){if(i.isDirectory){t(i)}else{r++;i.file((function(t){var e=Ha(t);if(i.fullPath)e._relativePath=i.fullPath;n.push(e);r--;o()}))}}));i()}),e)};l()};s(i)}))};var Ha=function t(i){if(i.type.length)return i;var e=i.lastModifiedDate;var n=i.name;var a=La(xi(i.name));if(!a.length)return i;i=i.slice(0,i.size,a);i.name=n;i.lastModifiedDate=e;return i};var Ua=function t(i){return Va(i)&&(qa(i)||{}).isDirectory};var Va=function t(i){return"webkitGetAsEntry"in i};var qa=function t(i){return i.webkitGetAsEntry()};var Wa=function t(i){var e=[];try{e=Za(i);if(e.length){return e}e=Ya(i)}catch(t){}return e};var Ya=function t(i){var e=i.getData("url");if(typeof e==="string"&&e.length){return[e]}return[]};var Za=function t(i){var e=i.getData("text/html");if(typeof e==="string"&&e.length){var n=e.match(/src\s*=\s*"(.+?)"/);if(n){return[n[1]]}}return[]};var Xa=[];var Qa=function t(i){return{pageLeft:i.pageX,pageTop:i.pageY,scopeLeft:i.offsetX||i.layerX,scopeTop:i.offsetY||i.layerY}};var $a=function t(i,e,n){var a=Ja(e);var r={element:i,filterElement:n,state:null,ondrop:function t(){},onenter:function t(){},ondrag:function t(){},onexit:function t(){},onload:function t(){},allowdrop:function t(){}};r.destroy=a.addListener(r);return r};var Ja=function t(i){var e=Xa.find((function(t){return t.element===i}));if(e){return e}var n=Ka(i);Xa.push(n);return n};var Ka=function t(i){var e=[];var n={dragenter:ar,dragover:rr,dragleave:sr,drop:or};var r={};a(n,(function(t,n){r[t]=n(i,e);i.addEventListener(t,r[t],false)}));var o={element:i,addListener:function t(s){e.push(s);return function(){e.splice(e.indexOf(s),1);if(e.length===0){Xa.splice(Xa.indexOf(o),1);a(n,(function(t){i.removeEventListener(t,r[t],false)}))}}}};return o};var tr=function t(i,e){if(!("elementFromPoint"in i)){i=document}return i.elementFromPoint(e.x,e.y)};var ir=function t(i,e){var n=Pa(e);var a=tr(n,{x:i.pageX-window.pageXOffset,y:i.pageY-window.pageYOffset});return a===e||e.contains(a)};var er=null;var nr=function t(i,e){try{i.dropEffect=e}catch(t){}};var ar=function t(i,e){return function(t){t.preventDefault();er=t.target;e.forEach((function(i){var e=i.element,n=i.onenter;if(ir(t,e)){i.state="enter";n(Qa(t))}}))}};var rr=function t(i,e){return function(t){t.preventDefault();var i=t.dataTransfer;za(i).then((function(n){var a=false;e.some((function(e){var r=e.filterElement,o=e.element,s=e.onenter,l=e.onexit,u=e.ondrag,c=e.allowdrop;nr(i,"copy");var f=c(n);if(!f){nr(i,"none");return}if(ir(t,o)){a=true;if(e.state===null){e.state="enter";s(Qa(t));return}e.state="over";if(r&&!f){nr(i,"none");return}u(Qa(t))}else{if(r&&!a){nr(i,"none")}if(e.state){e.state=null;l(Qa(t))}}}))}))}};var or=function t(i,e){return function(t){t.preventDefault();var i=t.dataTransfer;za(i).then((function(i){e.forEach((function(e){var n=e.filterElement,a=e.element,r=e.ondrop,o=e.onexit,s=e.allowdrop;e.state=null;if(n&&!ir(t,a))return;if(!s(i))return o(Qa(t));r(Qa(t),i)}))}))}};var sr=function t(i,e){return function(t){if(er!==t.target){return}e.forEach((function(i){var e=i.onexit;i.state=null;e(Qa(t))}))}};var lr=function t(i,e,n){i.classList.add("filepond--hopper");var a=n.catchesDropsOnPage,r=n.requiresDropOnElement,o=n.filterItems,s=o===void 0?function(t){return t}:o;var l=$a(i,a?document.documentElement:i,r);var u="";var c="";l.allowdrop=function(t){return e(s(t))};l.ondrop=function(t,i){var n=s(i);if(!e(n)){f.ondragend(t);return}c="drag-drop";f.onload(n,t)};l.ondrag=function(t){f.ondrag(t)};l.onenter=function(t){c="drag-over";f.ondragstart(t)};l.onexit=function(t){c="drag-exit";f.ondragend(t)};var f={updateHopperState:function t(){if(u!==c){i.dataset.hopperState=c;u=c}},onload:function t(){},ondragstart:function t(){},ondrag:function t(){},ondragend:function t(){},destroy:function t(){l.destroy()}};return f};var ur=false;var cr=[];var fr=function t(i){var e=document.activeElement;var n=e&&(/textarea|input/i.test(e.nodeName)||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")==="");if(n){var a=false;var r=e;while(r!==document.body){if(r.classList.contains("filepond--root")){a=true;break}r=r.parentNode}if(!a)return}za(i.clipboardData).then((function(t){if(!t.length){return}cr.forEach((function(i){return i(t)}))}))};var dr=function t(i){if(cr.includes(i)){return}cr.push(i);if(ur){return}ur=true;document.addEventListener("paste",fr)};var hr=function t(i){Ct(cr,cr.indexOf(i));if(cr.length===0){document.removeEventListener("paste",fr);ur=false}};var pr=function t(){var i=function t(i){e.onload(i)};var e={destroy:function t(){hr(i)},onload:function t(){}};dr(i);return e};var vr=function t(i){var e=i.root,n=i.props;e.element.id="filepond--assistant-"+n.id;o(e.element,"role","alert");o(e.element,"aria-live","polite");o(e.element,"aria-relevant","additions")};var gr=null;var _r=null;var mr=[];var br=function t(i,e){i.element.textContent=e};var wr=function t(i){i.element.textContent=""};var xr=function t(i,e,n){var a=i.query("GET_TOTAL_ITEMS");br(i,n+" "+e+", "+a+" "+(a===1?i.query("GET_LABEL_FILE_COUNT_SINGULAR"):i.query("GET_LABEL_FILE_COUNT_PLURAL")));clearTimeout(_r);_r=setTimeout((function(){wr(i)}),1500)};var yr=function t(i){return i.element.parentNode.contains(document.activeElement)};var kr=function t(i){var e=i.root,n=i.action;if(!yr(e)){return}e.element.textContent="";var a=e.query("GET_ITEM",n.id);mr.push(a.filename);clearTimeout(gr);gr=setTimeout((function(){xr(e,mr.join(", "),e.query("GET_LABEL_FILE_ADDED"));mr.length=0}),750)};var Er=function t(i){var e=i.root,n=i.action;if(!yr(e)){return}var a=n.item;xr(e,a.filename,e.query("GET_LABEL_FILE_REMOVED"))};var Ir=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.filename;var o=e.query("GET_LABEL_FILE_PROCESSING_COMPLETE");br(e,r+" "+o)};var Tr=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.filename;var o=e.query("GET_LABEL_FILE_PROCESSING_ABORTED");br(e,r+" "+o)};var Ar=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.filename;br(e,n.status.main+" "+r+" "+n.status.sub)};var Sr=j({create:vr,ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:kr,DID_REMOVE_ITEM:Er,DID_COMPLETE_ITEM_PROCESSING:Ir,DID_ABORT_ITEM_PROCESSING:Tr,DID_REVERT_ITEM_PROCESSING:Tr,DID_THROW_ITEM_REMOVE_ERROR:Ar,DID_THROW_ITEM_LOAD_ERROR:Ar,DID_THROW_ITEM_INVALID:Ar,DID_THROW_ITEM_PROCESSING_ERROR:Ar}),tag:"span",name:"assistant"});var Mr=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return i.replace(new RegExp(e+".","g"),(function(t){return t.charAt(1).toUpperCase()}))};var Dr=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:16;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var a=Date.now();var r=null;return function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++){o[s]=arguments[s]}clearTimeout(r);var l=Date.now()-a;var u=function t(){a=Date.now();i.apply(void 0,o)};if(l<e){if(!n){r=setTimeout(u,e-l)}}else{u()}}};var Pr=1e6;var Or=function t(i){return i.preventDefault()};var Rr=function t(i){var e=i.root,n=i.props;var a=e.query("GET_ID");if(a){e.element.id=a}var r=e.query("GET_CLASS_NAME");if(r){r.split(" ").filter((function(t){return t.length})).forEach((function(t){e.element.classList.add(t)}))}e.ref.label=e.appendChildView(e.createChildView(ua,Object.assign({},n,{translateY:null,caption:e.query("GET_LABEL_IDLE")})));e.ref.list=e.appendChildView(e.createChildView(Yn,{translateY:null}));e.ref.panel=e.appendChildView(e.createChildView(mn,{name:"panel-root"}));e.ref.assistant=e.appendChildView(e.createChildView(Sr,Object.assign({},n)));e.ref.data=e.appendChildView(e.createChildView(Da,Object.assign({},n)));e.ref.measure=be("div");e.ref.measure.style.height="100%";e.element.appendChild(e.ref.measure);e.ref.bounds=null;e.query("GET_STYLES").filter((function(t){return!Y(t.value)})).map((function(t){var i=t.name,n=t.value;e.element.dataset[i]=n}));e.ref.widthPrevious=null;e.ref.widthUpdated=Dr((function(){e.ref.updateHistory=[];e.dispatch("DID_RESIZE_ROOT")}),250);e.ref.previousAspectRatio=null;e.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches;var s="PointerEvent"in window;if(e.query("GET_ALLOW_REORDER")&&s&&!o){e.element.addEventListener("touchmove",Or,{passive:false});e.element.addEventListener("gesturestart",Or)}var l=e.query("GET_CREDITS");var u=l.length===2;if(u){var c=document.createElement("a");c.className="filepond--credits";c.href=l[0];c.tabIndex=-1;c.target="_blank";c.rel="noopener noreferrer nofollow";c.textContent=l[1];e.element.appendChild(c);e.ref.credits=c}};var Cr=function t(i){var e=i.root,n=i.props,a=i.actions;Ur({root:e,props:n,actions:a});a.filter((function(t){return/^DID_SET_STYLE_/.test(t.type)})).filter((function(t){return!Y(t.data.value)})).map((function(t){var i=t.type,n=t.data;var a=Mr(i.substring(8).toLowerCase(),"_");e.element.dataset[a]=n.value;e.invalidateLayout()}));if(e.rect.element.hidden)return;if(e.rect.element.width!==e.ref.widthPrevious){e.ref.widthPrevious=e.rect.element.width;e.ref.widthUpdated()}var r=e.ref.bounds;if(!r){r=e.ref.bounds=Gr(e);e.element.removeChild(e.ref.measure);e.ref.measure=null}var o=e.ref,s=o.hopper,l=o.label,u=o.list,c=o.panel;if(s){s.updateHopperState()}var f=e.query("GET_PANEL_ASPECT_RATIO");var d=e.query("GET_ALLOW_MULTIPLE");var h=e.query("GET_TOTAL_ITEMS");var p=d?e.query("GET_MAX_FILES")||Pr:1;var v=h===p;var g=a.find((function(t){return t.type==="DID_ADD_ITEM"}));if(v&&g){var _=g.data.interactionMethod;l.opacity=0;if(d){l.translateY=-40}else{if(_===Tt.API){l.translateX=40}else if(_===Tt.BROWSE){l.translateY=40}else{l.translateY=30}}}else if(!v){l.opacity=1;l.translateX=0;l.translateY=0}var m=Lr(e);var b=zr(e);var w=l.rect.element.height;var x=!d||v?0:w;var y=v?u.rect.element.marginTop:0;var k=h===0?0:u.rect.element.marginBottom;var E=x+y+b.visual+k;var I=x+y+b.bounds+k;u.translateY=Math.max(0,x-u.rect.element.marginTop)-m.top;if(f){var T=e.rect.element.width;var A=T*f;if(f!==e.ref.previousAspectRatio){e.ref.previousAspectRatio=f;e.ref.updateHistory=[]}var S=e.ref.updateHistory;S.push(T);var M=2;if(S.length>M*2){var D=S.length;var P=D-10;var O=0;for(var R=D;R>=P;R--){if(S[R]===S[R-2]){O++}if(O>=M){return}}}c.scalable=false;c.height=A;var C=A-x-(k-m.bottom)-(v?y:0);if(b.visual>C){u.overflow=C}else{u.overflow=null}e.height=A}else if(r.fixedHeight){c.scalable=false;var L=r.fixedHeight-x-(k-m.bottom)-(v?y:0);if(b.visual>L){u.overflow=L}else{u.overflow=null}}else if(r.cappedHeight){var z=E>=r.cappedHeight;var G=Math.min(r.cappedHeight,E);c.scalable=true;c.height=z?G:G-m.top-m.bottom;var F=G-x-(k-m.bottom)-(v?y:0);if(E>r.cappedHeight&&b.visual>F){u.overflow=F}else{u.overflow=null}e.height=Math.min(r.cappedHeight,I-m.top-m.bottom)}else{var N=h>0?m.top+m.bottom:0;c.scalable=true;c.height=Math.max(w,E-N);e.height=Math.max(w,I-N)}if(e.ref.credits&&c.heightCurrent)e.ref.credits.style.transform="translateY("+c.heightCurrent+"px)"};var Lr=function t(i){var e=i.ref.list.childViews[0].childViews[0];return e?{top:e.rect.element.marginTop,bottom:e.rect.element.marginBottom}:{top:0,bottom:0}};var zr=function t(i){var e=0;var n=0;var a=i.ref.list;var r=a.childViews[0];var o=r.childViews.filter((function(t){return t.rect.element.height}));var s=i.query("GET_ACTIVE_ITEMS").map((function(t){return o.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));if(s.length===0)return{visual:e,bounds:n};var l=r.rect.element.width;var u=Sn(r,s,a.dragCoordinates);var c=s[0].rect.element;var f=c.marginTop+c.marginBottom;var d=c.marginLeft+c.marginRight;var h=c.width+d;var p=c.height+f;var v=typeof u!=="undefined"&&u>=0?1:0;var g=s.find((function(t){return t.markedForRemoval&&t.opacity<.45}))?-1:0;var _=s.length+v+g;var m=An(l,h);if(m===1){s.forEach((function(t){var i=t.rect.element.height+f;n+=i;e+=i*t.opacity}))}else{n=Math.ceil(_/m)*p;e=n}return{visual:e,bounds:n}};var Gr=function t(i){var e=i.ref.measureHeight||null;var n=parseInt(i.style.maxHeight,10)||null;var a=e===0?null:e;return{cappedHeight:n,fixedHeight:a}};var Fr=function t(i,e){var n=i.query("GET_ALLOW_REPLACE");var a=i.query("GET_ALLOW_MULTIPLE");var r=i.query("GET_TOTAL_ITEMS");var o=i.query("GET_MAX_FILES");var s=e.length;if(!a&&s>1){i.dispatch("DID_THROW_MAX_FILES",{source:e,error:ji("warning",0,"Max files")});return true}o=a?o:1;if(!a&&n){return false}var l=nt(o);if(l&&r+s>o){i.dispatch("DID_THROW_MAX_FILES",{source:e,error:ji("warning",0,"Max files")});return true}return false};var Nr=function t(i,e,n){var a=i.childViews[0];return Sn(a,e,{left:n.scopeLeft-a.rect.element.left,top:n.scopeTop-(i.rect.outer.top+i.rect.element.marginTop+i.rect.element.scrollTop)})};var Br=function t(i){var e=i.query("GET_ALLOW_DROP");var n=i.query("GET_DISABLED");var a=e&&!n;if(a&&!i.ref.hopper){var r=lr(i.element,(function(t){var e=i.query("GET_BEFORE_DROP_FILE")||function(){return true};var n=i.query("GET_DROP_VALIDATION");return n?t.every((function(t){return Xt("ALLOW_HOPPER_ITEM",t,{query:i.query}).every((function(t){return t===true}))&&e(t)})):true}),{filterItems:function t(e){var n=i.query("GET_IGNORED_FILES");return e.filter((function(t){if(ee(t)){return!n.includes(t.name.toLowerCase())}return true}))},catchesDropsOnPage:i.query("GET_DROP_ON_PAGE"),requiresDropOnElement:i.query("GET_DROP_ON_ELEMENT")});r.onload=function(t,e){var n=i.ref.list.childViews[0];var a=n.childViews.filter((function(t){return t.rect.element.height}));var r=i.query("GET_ACTIVE_ITEMS").map((function(t){return a.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));Zt("ADD_ITEMS",t,{dispatch:i.dispatch}).then((function(t){if(Fr(i,t))return false;i.dispatch("ADD_ITEMS",{items:t,index:Nr(i.ref.list,r,e),interactionMethod:Tt.DROP})}));i.dispatch("DID_DROP",{position:e});i.dispatch("DID_END_DRAG",{position:e})};r.ondragstart=function(t){i.dispatch("DID_START_DRAG",{position:t})};r.ondrag=Dr((function(t){i.dispatch("DID_DRAG",{position:t})}));r.ondragend=function(t){i.dispatch("DID_END_DRAG",{position:t})};i.ref.hopper=r;i.ref.drip=i.appendChildView(i.createChildView(_a))}else if(!a&&i.ref.hopper){i.ref.hopper.destroy();i.ref.hopper=null;i.removeChildView(i.ref.drip)}};var jr=function t(i,e){var n=i.query("GET_ALLOW_BROWSE");var a=i.query("GET_DISABLED");var r=n&&!a;if(r&&!i.ref.browser){i.ref.browser=i.appendChildView(i.createChildView(ra,Object.assign({},e,{onload:function t(e){Zt("ADD_ITEMS",e,{dispatch:i.dispatch}).then((function(t){if(Fr(i,t))return false;i.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:Tt.BROWSE})}))}})),0)}else if(!r&&i.ref.browser){i.removeChildView(i.ref.browser);i.ref.browser=null}};var Hr=function t(i){var e=i.query("GET_ALLOW_PASTE");var n=i.query("GET_DISABLED");var a=e&&!n;if(a&&!i.ref.paster){i.ref.paster=pr();i.ref.paster.onload=function(t){Zt("ADD_ITEMS",t,{dispatch:i.dispatch}).then((function(t){if(Fr(i,t))return false;i.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:Tt.PASTE})}))}}else if(!a&&i.ref.paster){i.ref.paster.destroy();i.ref.paster=null}};var Ur=U({DID_SET_ALLOW_BROWSE:function t(i){var e=i.root,n=i.props;jr(e,n)},DID_SET_ALLOW_DROP:function t(i){var e=i.root;Br(e)},DID_SET_ALLOW_PASTE:function t(i){var e=i.root;Hr(e)},DID_SET_DISABLED:function t(i){var e=i.root,n=i.props;Br(e);Hr(e);jr(e,n);var a=e.query("GET_DISABLED");if(a){e.element.dataset.disabled="disabled"}else{e.element.removeAttribute("data-disabled")}}});var Vr=j({name:"root",read:function t(i){var e=i.root;if(e.ref.measure){e.ref.measureHeight=e.ref.measure.offsetHeight}},create:Rr,write:Cr,destroy:function t(i){var e=i.root;if(e.ref.paster){e.ref.paster.destroy()}if(e.ref.hopper){e.ref.hopper.destroy()}e.element.removeEventListener("touchmove",Or);e.element.removeEventListener("gesturestart",Or)},mixins:{styles:["height"]}});var qr=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=null;var a=Jt();var o=e(xt(a),[pi,It(a)],[ge,Et(a)]);o.dispatch("SET_OPTIONS",{options:i});var s=function t(){if(document.hidden)return;o.dispatch("KICK")};document.addEventListener("visibilitychange",s);var l=null;var u=false;var c=false;var f=null;var d=null;var h=function t(){if(!u){u=true}clearTimeout(l);l=setTimeout((function(){u=false;f=null;d=null;if(c){c=false;o.dispatch("DID_STOP_RESIZE")}}),500)};window.addEventListener("resize",h);var p=Vr(o,{id:At()});var v=false;var g=false;var _={_read:function t(){if(u){d=window.innerWidth;if(!f){f=d}if(!c&&d!==f){o.dispatch("DID_START_RESIZE");c=true}}if(g&&v){v=p.element.offsetParent===null}if(v)return;p._read();g=p.rect.element.hidden},_write:function t(i){var e=o.processActionQueue().filter((function(t){return!/^SET_/.test(t.type)}));if(v&&!e.length)return;y(e);v=p._write(i,e,c);Bt(o.query("GET_ITEMS"));if(v){o.processDispatchQueue()}}};var m=function t(i){return function(t){var e={type:i};if(!t){return e}if(t.hasOwnProperty("error")){e.error=t.error?Object.assign({},t.error):null}if(t.status){e.status=Object.assign({},t.status)}if(t.file){e.output=t.file}if(t.source){e.file=t.source}else if(t.item||t.id){var n=t.item?t.item:o.query("GET_ITEM",t.id);e.file=n?Nt(n):null}if(t.items){e.items=t.items.map(Nt)}if(/progress/.test(i)){e.progress=t.progress}if(t.hasOwnProperty("origin")&&t.hasOwnProperty("target")){e.origin=t.origin;e.target=t.target}return e}};var b={DID_DESTROY:m("destroy"),DID_INIT:m("init"),DID_THROW_MAX_FILES:m("warning"),DID_INIT_ITEM:m("initfile"),DID_START_ITEM_LOAD:m("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:m("addfileprogress"),DID_LOAD_ITEM:m("addfile"),DID_THROW_ITEM_INVALID:[m("error"),m("addfile")],DID_THROW_ITEM_LOAD_ERROR:[m("error"),m("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[m("error"),m("removefile")],DID_PREPARE_OUTPUT:m("preparefile"),DID_START_ITEM_PROCESSING:m("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:m("processfileprogress"),DID_ABORT_ITEM_PROCESSING:m("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:m("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:m("processfiles"),DID_REVERT_ITEM_PROCESSING:m("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[m("error"),m("processfile")],DID_REMOVE_ITEM:m("removefile"),DID_UPDATE_ITEMS:m("updatefiles"),DID_ACTIVATE_ITEM:m("activatefile"),DID_REORDER_ITEMS:m("reorderfiles")};var w=function t(i){var e=Object.assign({pond:L},i);delete e.type;p.element.dispatchEvent(new CustomEvent("FilePond:"+i.type,{detail:e,bubbles:true,cancelable:true,composed:true}));var n=[];if(i.hasOwnProperty("error")){n.push(i.error)}if(i.hasOwnProperty("file")){n.push(i.file)}var a=["type","error","file"];Object.keys(i).filter((function(t){return!a.includes(t)})).forEach((function(t){return n.push(i[t])}));L.fire.apply(L,[i.type].concat(n));var r=o.query("GET_ON"+i.type.toUpperCase());if(r){r.apply(void 0,n)}};var y=function t(i){if(!i.length)return;i.filter((function(t){return b[t.type]})).forEach((function(t){var i=b[t.type];(Array.isArray(i)?i:[i]).forEach((function(i){if(t.type==="DID_INIT_ITEM"){w(i(t.data))}else{setTimeout((function(){w(i(t.data))}),0)}}))}))};var k=function t(i){return o.dispatch("SET_OPTIONS",{options:i})};var E=function t(i){return o.query("GET_ACTIVE_ITEM",i)};var I=function t(i){return new Promise((function(t,e){o.dispatch("REQUEST_ITEM_PREPARE",{query:i,success:function i(e){t(e)},failure:function t(i){e(i)}})}))};var T=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise((function(t,n){M([{source:i,options:e}],{index:e.index}).then((function(i){return t(i&&i[0])})).catch(n)}))};var A=function t(i){return i.file&&i.id};var S=function t(i,e){if(typeof i==="object"&&!A(i)&&!e){e=i;i=undefined}o.dispatch("REMOVE_ITEM",Object.assign({},e,{query:i}));return o.query("GET_ACTIVE_ITEM",i)===null};var M=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}return new Promise((function(t,i){var n=[];var a={};if(W(e[0])){n.push.apply(n,e[0]);Object.assign(a,e[1]||{})}else{var r=e[e.length-1];if(typeof r==="object"&&!(r instanceof Blob)){Object.assign(a,e.pop())}n.push.apply(n,e)}o.dispatch("ADD_ITEMS",{items:n,index:a.index,interactionMethod:Tt.API,success:t,failure:i})}))};var D=function t(){return o.query("GET_ACTIVE_ITEMS")};var P=function t(i){return new Promise((function(t,e){o.dispatch("REQUEST_ITEM_PROCESSING",{query:i,success:function i(e){t(e)},failure:function t(i){e(i)}})}))};var O=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}var a=Array.isArray(e[0])?e[0]:e;var r=a.length?a:D();return Promise.all(r.map(I))};var R=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}var a=Array.isArray(e[0])?e[0]:e;if(!a.length){var r=D().filter((function(t){return!(t.status===jt.IDLE&&t.origin===Ht.LOCAL)&&t.status!==jt.PROCESSING&&t.status!==jt.PROCESSING_COMPLETE&&t.status!==jt.PROCESSING_REVERT_ERROR}));return Promise.all(r.map(P))}return Promise.all(a.map(P))};var C=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}var a=Array.isArray(e[0])?e[0]:e;var r;if(typeof a[a.length-1]==="object"){r=a.pop()}else if(Array.isArray(e[0])){r=e[1]}var o=D();if(!a.length)return Promise.all(o.map((function(t){return S(t,r)})));var s=a.map((function(t){return x(t)?o[t]?o[t].id:null:t})).filter((function(t){return t}));return s.map((function(t){return S(t,r)}))};var L=Object.assign({},zt(),{},_,{},kt(o,a),{setOptions:k,addFile:T,addFiles:M,getFile:E,processFile:P,prepareFile:I,removeFile:S,moveFile:function t(i,e){return o.dispatch("MOVE_ITEM",{query:i,index:e})},getFiles:D,processFiles:R,removeFiles:C,prepareFiles:O,sort:function t(i){return o.dispatch("SORT",{compare:i})},browse:function t(){var i=p.element.querySelector("input[type=file]");if(i){i.click()}},destroy:function t(){L.fire("destroy",p.element);o.dispatch("ABORT_ALL");p._destroy();window.removeEventListener("resize",h);document.removeEventListener("visibilitychange",s);o.dispatch("DID_DESTROY")},insertBefore:function t(i){return V(p.element,i)},insertAfter:function t(i){return q(p.element,i)},appendTo:function t(i){return i.appendChild(p.element)},replaceElement:function t(i){V(p.element,i);i.parentNode.removeChild(i);n=i},restoreElement:function t(){if(!n){return}q(n,p.element);p.element.parentNode.removeChild(p.element);n=null},isAttachedTo:function t(i){return p.element===i||n===i},element:{get:function t(){return p.element}},status:{get:function t(){return o.query("GET_STATUS")}}});o.dispatch("DID_INIT");return r(L)};var Wr=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e={};a(Jt(),(function(t,i){e[t]=i[0]}));var n=qr(Object.assign({},e,{},i));return n};var Yr=function t(i){return i.charAt(0).toLowerCase()+i.slice(1)};var Zr=function t(i){return Mr(i.replace(/^data-/,""))};var Xr=function t(i,e){a(e,(function(e,n){a(i,(function(t,a){var r=new RegExp(e);var o=r.test(t);if(!o){return}delete i[t];if(n===false){return}if(K(n)){i[n]=a;return}var s=n.group;if(dt(n)&&!i[s]){i[s]={}}i[s][Yr(t.replace(r,""))]=a}));if(n.mapping){t(i[n.group],n.mapping)}}))};var Qr=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=[];a(i.attributes,(function(t){n.push(i.attributes[t])}));var r=n.filter((function(t){return t.name})).reduce((function(t,e){var n=o(i,e.name);t[Zr(e.name)]=n===e.name?true:n;return t}),{});Xr(r,e);return r};var $r=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":false,"^files$":false};Xt("SET_ATTRIBUTE_TO_OPTION_MAP",n);var a=Object.assign({},e);var r=Qr(i.nodeName==="FIELDSET"?i.querySelector("input[type=file]"):i,n);Object.keys(r).forEach((function(t){if(dt(r[t])){if(!dt(a[t])){a[t]={}}Object.assign(a[t],r[t])}else{a[t]=r[t]}}));a.files=(e.files||[]).concat(Array.from(i.querySelectorAll("input:not([type=file])")).map((function(t){return{source:t.value,options:{type:t.dataset.type}}})));var o=Wr(a);if(i.files){Array.from(i.files).forEach((function(t){o.addFile(t)}))}o.replaceElement(i);return o};var Jr=function t(){return i(arguments.length<=0?undefined:arguments[0])?$r.apply(void 0,arguments):Wr.apply(void 0,arguments)};var Kr=["fire","_read","_write"];var to=function t(i){var e={};Gt(i,e,Kr);return e};var io=function t(i,e){return i.replace(/(?:{([a-zA-Z]+)})/g,(function(t,i){return e[i]}))};var eo=function t(i){var e=new Blob(["(",i.toString(),")()"],{type:"application/javascript"});var n=URL.createObjectURL(e);var a=new Worker(n);return{transfer:function t(i,e){},post:function t(i,e,n){var r=At();a.onmessage=function(t){if(t.data.id===r){e(t.data.message)}};a.postMessage({id:r,message:i},n)},terminate:function t(){a.terminate();URL.revokeObjectURL(n)}}};var no=function t(i){return new Promise((function(t,e){var n=new Image;n.onload=function(){t(n)};n.onerror=function(t){e(t)};n.src=i}))};var ao=function t(i,e){var n=i.slice(0,i.size,i.type);n.lastModifiedDate=i.lastModifiedDate;n.name=e;return n};var ro=function t(i){return ao(i,i.name)};var oo=[];var so=function t(i){if(oo.includes(i)){return}oo.push(i);var e=i({addFilter:Qt,utils:{Type:Wt,forin:a,isString:K,isFile:ee,toNaturalFileSize:De,replaceInString:io,getExtensionFromFilename:xi,getFilenameWithoutExtension:te,guesstimateMimeType:La,getFileFromBlob:Ii,getFilenameFromURL:wi,createRoute:U,createWorker:eo,createView:j,createItemAPI:Nt,loadImage:no,copyFile:ro,renameFile:ao,createBlob:Ai,applyFilterChain:Zt,text:we,getNumericAspectRatioFromString:ei},views:{fileActionButton:Me}});$t(e.options)};var lo=function t(){return Object.prototype.toString.call(window.operamini)==="[object OperaMini]"};var uo=function t(){return"Promise"in window};var co=function t(){return"slice"in Blob.prototype};var fo=function t(){return"URL"in window&&"createObjectURL"in window.URL};var ho=function t(){return"visibilityState"in document};var po=function t(){return"performance"in window};var vo=function t(){return"supports"in(window.CSS||{})};var go=function t(){return/MSIE|Trident/.test(window.navigator.userAgent)};var _o=function(){var t=v()&&!lo()&&ho()&&uo()&&co()&&fo()&&po()&&(vo()||go());return function(){return t}}();var mo={apps:[]};var bo="filepond";var wo=function t(){};t.Status={};t.FileStatus={};t.FileOrigin={};t.OptionTypes={};t.create=wo;t.destroy=wo;t.parse=wo;t.find=wo;t.registerPlugin=wo;t.getOptions=wo;t.setOptions=wo;if(_o()){H((function(){mo.apps.forEach((function(t){return t._read()}))}),(function(t){mo.apps.forEach((function(i){return i._write(t)}))}));var xo=function i(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:_o,create:t.create,destroy:t.destroy,parse:t.parse,find:t.find,registerPlugin:t.registerPlugin,setOptions:t.setOptions}}));document.removeEventListener("DOMContentLoaded",i)};if(document.readyState!=="loading"){setTimeout((function(){return xo()}),0)}else{document.addEventListener("DOMContentLoaded",xo)}var yo=function i(){return a(Jt(),(function(i,e){t.OptionTypes[i]=e[1]}))};t.Status=Object.assign({},ai);t.FileOrigin=Object.assign({},Ht);t.FileStatus=Object.assign({},jt);t.OptionTypes={};yo();t.create=function i(){var e=Jr.apply(void 0,arguments);e.on("destroy",t.destroy);mo.apps.push(e);return to(e)};t.destroy=function t(i){var e=mo.apps.findIndex((function(t){return t.isAttachedTo(i)}));if(e>=0){var n=mo.apps.splice(e,1)[0];n.restoreElement();return true}return false};t.parse=function i(e){var n=Array.from(e.querySelectorAll("."+bo));var a=n.filter((function(t){return!mo.apps.find((function(i){return i.isAttachedTo(t)}))}));return a.map((function(i){return t.create(i)}))};t.find=function t(i){var e=mo.apps.find((function(t){return t.isAttachedTo(i)}));if(!e){return null}return to(e)};t.registerPlugin=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}e.forEach(so);yo()};t.getOptions=function t(){var i={};a(Jt(),(function(t,e){i[t]=e[0]}));return i};t.setOptions=function i(e){if(dt(e)){mo.apps.forEach((function(t){t.setOptions(e)}));Kt(e)}return t.getOptions()}}t.supported=_o;Object.defineProperty(t,"__esModule",{value:true})}))})(filepond$1,filepond$1.exports);return filepond$1.exports}var filepondExports=requireFilepond();var filepondPluginFileValidateSize$1={exports:{}};
|
|
16
|
+
*/var filepond=filepond$1.exports;var hasRequiredFilepond;function requireFilepond(){if(hasRequiredFilepond)return filepond$1.exports;hasRequiredFilepond=1;(function(t,i){(function(t,e){e(i)})(filepond,(function(t){var i=function t(i){return i instanceof HTMLElement};var e=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var a=Object.assign({},i);var r=[];var o=[];var s=function t(){return Object.assign({},a)};var l=function t(){var i=[].concat(r);r.length=0;return i};var u=function t(){var i=[].concat(o);o.length=0;i.forEach((function(t){var i=t.type,e=t.data;c(i,e)}))};var c=function t(i,e,n){if(n&&!document.hidden){o.push({type:i,data:e});return}if(p[i]){p[i](e)}r.push({type:i,data:e})};var f=function t(i){var e;for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++){a[r-1]=arguments[r]}return h[i]?(e=h)[i].apply(e,a):null};var d={getState:s,processActionQueue:l,processDispatchQueue:u,dispatch:c,query:f};var h={};e.forEach((function(t){h=Object.assign({},t(a),{},h)}));var p={};n.forEach((function(t){p=Object.assign({},t(c,f,a),{},p)}));return d};var n=function t(i,e,n){if(typeof n==="function"){i[e]=n;return}Object.defineProperty(i,e,Object.assign({},n))};var a=function t(i,e){for(var n in i){if(!i.hasOwnProperty(n)){continue}e(n,i[n])}};var r=function t(i){var e={};a(i,(function(t){n(e,t,i[t])}));return e};var o=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(n===null){return i.getAttribute(e)||i.hasAttribute(e)}i.setAttribute(e,n)};var s="http://www.w3.org/2000/svg";var l=["svg","path"];var u=function t(i){return l.includes(i)};var c=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(typeof e==="object"){n=e;e=null}var r=u(i)?document.createElementNS(s,i):document.createElement(i);if(e){if(u(i)){o(r,"class",e)}else{r.className=e}}a(n,(function(t,i){o(r,t,i)}));return r};var f=function t(i){return function(t,e){if(typeof e!=="undefined"&&i.children[e]){i.insertBefore(t,i.children[e])}else{i.appendChild(t)}}};var d=function t(i,e){return function(t,i){if(typeof i!=="undefined"){e.splice(i,0,t)}else{e.push(t)}return t}};var h=function t(i,e){return function(t){e.splice(e.indexOf(t),1);if(t.element.parentNode){i.removeChild(t.element)}return t}};var p=function(){return typeof window!=="undefined"&&typeof window.document!=="undefined"}();var v=function t(){return p};var g=v()?c("svg"):{};var _="children"in g?function(t){return t.children.length}:function(t){return t.childNodes.length};var m=function t(i,e,n,a){var r=n[0]||i.left;var o=n[1]||i.top;var s=r+i.width;var l=o+i.height*(a[1]||1);var u={element:Object.assign({},i),inner:{left:i.left,top:i.top,right:i.right,bottom:i.bottom},outer:{left:r,top:o,right:s,bottom:l}};e.filter((function(t){return!t.isRectIgnored()})).map((function(t){return t.rect})).forEach((function(t){b(u.inner,Object.assign({},t.inner));b(u.outer,Object.assign({},t.outer))}));w(u.inner);u.outer.bottom+=u.element.marginBottom;u.outer.right+=u.element.marginRight;w(u.outer);return u};var b=function t(i,e){e.top+=i.top;e.right+=i.left;e.bottom+=i.top;e.left+=i.left;if(e.bottom>i.bottom){i.bottom=e.bottom}if(e.right>i.right){i.right=e.right}};var w=function t(i){i.width=i.right-i.left;i.height=i.bottom-i.top};var x=function t(i){return typeof i==="number"};var y=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:.001;return Math.abs(i-e)<a&&Math.abs(n)<a};var k=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=i.stiffness,n=e===void 0?.5:e,a=i.damping,o=a===void 0?.75:a,s=i.mass,l=s===void 0?10:s;var u=null;var c=null;var f=0;var d=false;var h=function t(i,e){if(d)return;if(!(x(u)&&x(c))){d=true;f=0;return}var a=-(c-u)*n;f+=a/l;c+=f;f*=o;if(y(c,u,f)||e){c=u;f=0;d=true;v.onupdate(c);v.oncomplete(c)}else{v.onupdate(c)}};var p=function t(i){if(x(i)&&!x(c)){c=i}if(u===null){u=i;c=i}u=i;if(c===u||typeof u==="undefined"){d=true;f=0;v.onupdate(c);v.oncomplete(c);return}d=false};var v=r({interpolate:h,target:{set:p,get:function t(){return u}},resting:{get:function t(){return d}},onupdate:function t(i){},oncomplete:function t(i){}});return v};var E=function t(i){return i<.5?2*i*i:-1+(4-2*i)*i};var I=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=i.duration,n=e===void 0?500:e,a=i.easing,o=a===void 0?E:a,s=i.delay,l=s===void 0?0:s;var u=null;var c;var f;var d=true;var h=false;var p=null;var v=function t(i,e){if(d||p===null)return;if(u===null){u=i}if(i-u<l)return;c=i-u-l;if(c>=n||e){c=1;f=h?0:1;g.onupdate(f*p);g.oncomplete(f*p);d=true}else{f=c/n;g.onupdate((c>=0?o(h?1-f:f):0)*p)}};var g=r({interpolate:v,target:{get:function t(){return h?0:p},set:function t(i){if(p===null){p=i;g.onupdate(i);g.oncomplete(i);return}if(i<p){p=1;h=true}else{h=false;p=i}d=false;u=null}},resting:{get:function t(){return d}},onupdate:function t(i){},oncomplete:function t(i){}});return g};var T={spring:k,tween:I};var A=function t(i,e,n){var a=i[e]&&typeof i[e][n]==="object"?i[e][n]:i[e]||i;var r=typeof a==="string"?a:a.type;var o=typeof a==="object"?Object.assign({},a):{};return T[r]?T[r](o):null};var S=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;e=Array.isArray(e)?e:[e];e.forEach((function(t){i.forEach((function(i){var e=i;var r=function t(){return n[i]};var o=function t(e){return n[i]=e};if(typeof i==="object"){e=i.key;r=i.getter||r;o=i.setter||o}if(t[e]&&!a){return}t[e]={get:r,set:o}}))}))};var M=function t(i){var e=i.mixinConfig,n=i.viewProps,r=i.viewInternalAPI,o=i.viewExternalAPI;var s=Object.assign({},n);var t=[];a(e,(function(i,e){var a=A(e);if(!a){return}a.onupdate=function(t){n[i]=t};a.target=s[i];var l={key:i,setter:function t(i){if(a.target===i){return}a.target=i},getter:function t(){return n[i]}};S([l],[r,o],n,true);t.push(a)}));return{write:function i(e){var n=document.hidden;var a=true;t.forEach((function(t){if(!t.resting)a=false;t.interpolate(e,n)}));return a},destroy:function t(){}}};var D=function t(i){return function(t,e){i.addEventListener(t,e)}};var P=function t(i){return function(t,e){i.removeEventListener(t,e)}};var O=function t(i){var e=i.viewExternalAPI,n=i.view;var a=[];var r=D(n.element);var o=P(n.element);e.on=function(t,i){a.push({type:t,fn:i});r(t,i)};e.off=function(t,i){a.splice(a.findIndex((function(e){return e.type===t&&e.fn===i})),1);o(t,i)};return{write:function t(){return true},destroy:function t(){a.forEach((function(t){o(t.type,t.fn)}))}}};var R=function t(i){var e=i.mixinConfig,n=i.viewProps,a=i.viewExternalAPI;S(e,a,n)};var C=function t(i){return i!=null};var L={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0};var z=function t(i){var e=i.mixinConfig,n=i.viewProps,a=i.viewInternalAPI,r=i.viewExternalAPI,o=i.view;var s=Object.assign({},n);var l={};S(e,[a,r],n);var u=function t(){return[n["translateX"]||0,n["translateY"]||0]};var c=function t(){return[n["scaleX"]||0,n["scaleY"]||0]};var f=function t(){return o.rect?m(o.rect,o.childViews,u(),c()):null};a.rect={get:f};r.rect={get:f};e.forEach((function(t){n[t]=typeof s[t]==="undefined"?L[t]:s[t]}));return{write:function t(){if(!G(l,n)){return}F(o.element,n);Object.assign(l,Object.assign({},n));return true},destroy:function t(){}}};var G=function t(i,e){if(Object.keys(i).length!==Object.keys(e).length){return true}for(var n in e){if(e[n]!==i[n]){return true}}return false};var F=function t(i,e){var n=e.opacity,a=e.perspective,r=e.translateX,o=e.translateY,s=e.scaleX,l=e.scaleY,u=e.rotateX,c=e.rotateY,f=e.rotateZ,d=e.originX,h=e.originY,p=e.width,v=e.height;var g="";var _="";if(C(d)||C(h)){_+="transform-origin: "+(d||0)+"px "+(h||0)+"px;"}if(C(a)){g+="perspective("+a+"px) "}if(C(r)||C(o)){g+="translate3d("+(r||0)+"px, "+(o||0)+"px, 0) "}if(C(s)||C(l)){g+="scale3d("+(C(s)?s:1)+", "+(C(l)?l:1)+", 1) "}if(C(f)){g+="rotateZ("+f+"rad) "}if(C(u)){g+="rotateX("+u+"rad) "}if(C(c)){g+="rotateY("+c+"rad) "}if(g.length){_+="transform:"+g+";"}if(C(n)){_+="opacity:"+n+";";if(n===0){_+="visibility:hidden;"}if(n<1){_+="pointer-events:none;"}}if(C(v)){_+="height:"+v+"px;"}if(C(p)){_+="width:"+p+"px;"}var m=i.elementCurrentStyle||"";if(_.length!==m.length||_!==m){i.style.cssText=_;i.elementCurrentStyle=_}};var N={styles:z,listeners:O,animations:M,apis:R};var B=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!e.layoutCalculated){i.paddingTop=parseInt(n.paddingTop,10)||0;i.marginTop=parseInt(n.marginTop,10)||0;i.marginRight=parseInt(n.marginRight,10)||0;i.marginBottom=parseInt(n.marginBottom,10)||0;i.marginLeft=parseInt(n.marginLeft,10)||0;e.layoutCalculated=true}i.left=e.offsetLeft||0;i.top=e.offsetTop||0;i.width=e.offsetWidth||0;i.height=e.offsetHeight||0;i.right=i.left+i.width;i.bottom=i.top+i.height;i.scrollTop=e.scrollTop;i.hidden=e.offsetParent===null;return i};var j=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=i.tag,n=e===void 0?"div":e,a=i.name,o=a===void 0?null:a,s=i.attributes,l=s===void 0?{}:s,u=i.read,p=u===void 0?function(){}:u,v=i.write,g=v===void 0?function(){}:v,b=i.create,w=b===void 0?function(){}:b,x=i.destroy,y=x===void 0?function(){}:x,k=i.filterFrameActionsForChild,E=k===void 0?function(t,i){return i}:k,I=i.didCreateView,T=I===void 0?function(){}:I,A=i.didWriteView,S=A===void 0?function(){}:A,M=i.ignoreRect,D=M===void 0?false:M,P=i.ignoreRectUpdate,O=P===void 0?false:P,R=i.mixins,C=R===void 0?[]:R;return function(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var e=c(n,"filepond--"+o,l);var a=window.getComputedStyle(e,null);var s=B();var u=null;var v=false;var b=[];var x=[];var k={};var I={};var A=[g];var M=[p];var P=[y];var R=function t(){return e};var L=function t(){return b.concat()};var z=function t(){return k};var G=function t(i){return function(t,e){return t(i,e)}};var F=function t(){if(u){return u}u=m(s,b,[0,0],[1,1]);return u};var j=function t(){return a};var H=function t(){u=null;b.forEach((function(t){return t._read()}));var n=!(O&&s.width&&s.height);if(n){B(s,e,a)}var r={root:X,props:i,rect:s};M.forEach((function(t){return t(r)}))};var U=function t(e,n,a){var r=n.length===0;A.forEach((function(t){var o=t({props:i,root:X,actions:n,timestamp:e,shouldOptimize:a});if(o===false){r=false}}));x.forEach((function(t){var i=t.write(e);if(i===false){r=false}}));b.filter((function(t){return!!t.element.parentNode})).forEach((function(t){var i=t._write(e,E(t,n),a);if(!i){r=false}}));b.forEach((function(t,i){if(t.element.parentNode){return}X.appendChild(t.element,i);t._read();t._write(e,E(t,n),a);r=false}));v=r;S({props:i,root:X,actions:n,timestamp:e});return r};var V=function t(){x.forEach((function(t){return t.destroy()}));P.forEach((function(t){t({root:X,props:i})}));b.forEach((function(t){return t._destroy()}))};var q={element:{get:R},style:{get:j},childViews:{get:L}};var W=Object.assign({},q,{rect:{get:F},ref:{get:z},is:function t(i){return o===i},appendChild:f(e),createChildView:G(t),linkView:function t(i){b.push(i);return i},unlinkView:function t(i){b.splice(b.indexOf(i),1)},appendChildView:d(e,b),removeChildView:h(e,b),registerWriter:function t(i){return A.push(i)},registerReader:function t(i){return M.push(i)},registerDestroyer:function t(i){return P.push(i)},invalidateLayout:function t(){return e.layoutCalculated=false},dispatch:t.dispatch,query:t.query});var Y={element:{get:R},childViews:{get:L},rect:{get:F},resting:{get:function t(){return v}},isRectIgnored:function t(){return D},_read:H,_write:U,_destroy:V};var Z=Object.assign({},q,{rect:{get:function t(){return s}}});Object.keys(C).sort((function(t,i){if(t==="styles"){return 1}else if(i==="styles"){return-1}return 0})).forEach((function(t){var e=N[t]({mixinConfig:C[t],viewProps:i,viewState:I,viewInternalAPI:W,viewExternalAPI:Y,view:r(Z)});if(e){x.push(e)}}));var X=r(W);w({root:X,props:i});var Q=_(e);b.forEach((function(t,i){X.appendChild(t.element,Q+i)}));T(X);return r(Y)}};var H=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:60;var a="__framePainter";if(window[a]){window[a].readers.push(i);window[a].writers.push(e);return}window[a]={readers:[i],writers:[e]};var r=window[a];var o=1e3/n;var s=null;var l=null;var u=null;var c=null;var f=function t(){if(document.hidden){u=function t(){return window.setTimeout((function(){return d(performance.now())}),o)};c=function t(){return window.clearTimeout(l)}}else{u=function t(){return window.requestAnimationFrame(d)};c=function t(){return window.cancelAnimationFrame(l)}}};document.addEventListener("visibilitychange",(function(){if(c)c();f();d(performance.now())}));var d=function t(i){l=u(t);if(!s){s=i}var e=i-s;if(e<=o){return}s=i-e%o;r.readers.forEach((function(t){return t()}));r.writers.forEach((function(t){return t(i)}))};f();d(performance.now());return{pause:function t(){c(l)}}};var U=function t(i,e){return function(t){var n=t.root,a=t.props,r=t.actions,o=r===void 0?[]:r,s=t.timestamp,l=t.shouldOptimize;o.filter((function(t){return i[t.type]})).forEach((function(t){return i[t.type]({root:n,props:a,action:t.data,timestamp:s,shouldOptimize:l})}));if(e){e({root:n,props:a,actions:o,timestamp:s,shouldOptimize:l})}}};var V=function t(i,e){return e.parentNode.insertBefore(i,e)};var q=function t(i,e){return e.parentNode.insertBefore(i,e.nextSibling)};var W=function t(i){return Array.isArray(i)};var Y=function t(i){return i==null};var Z=function t(i){return i.trim()};var X=function t(i){return""+i};var Q=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:",";if(Y(i)){return[]}if(W(i)){return i}return X(i).split(e).map(Z).filter((function(t){return t.length}))};var $=function t(i){return typeof i==="boolean"};var K=function t(i){return $(i)?i:i==="true"};var J=function t(i){return typeof i==="string"};var tt=function t(i){return x(i)?i:J(i)?X(i).replace(/[a-z]+/gi,""):0};var it=function t(i){return parseInt(tt(i),10)};var et=function t(i){return parseFloat(tt(i))};var nt=function t(i){return x(i)&&isFinite(i)&&Math.floor(i)===i};var at=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;if(nt(i)){return i}var n=X(i).trim();if(/MB$/i.test(n)){n=n.replace(/MB$i/,"").trim();return it(n)*e*e}if(/KB/i.test(n)){n=n.replace(/KB$i/,"").trim();return it(n)*e}return it(n)};var rt=function t(i){return typeof i==="function"};var ot=function t(i){var e=self;var n=i.split(".");var a=null;while(a=n.shift()){e=e[a];if(!e){return null}}return e};var st={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"};var lt=function t(i){var e={};e.url=J(i)?i:i.url||"";e.timeout=i.timeout?parseInt(i.timeout,10):0;e.headers=i.headers?i.headers:{};a(st,(function(t){e[t]=ut(t,i[t],st[t],e.timeout,e.headers)}));e.process=i.process||J(i)||i.url?e.process:null;e.remove=i.remove||null;delete e.headers;return e};var ut=function t(i,e,n,a,r){if(e===null){return null}if(typeof e==="function"){return e}var o={url:n==="GET"||n==="PATCH"?"?"+i+"=":"",method:n,headers:r,withCredentials:false,timeout:a,onload:null,ondata:null,onerror:null};if(J(e)){o.url=e;return o}Object.assign(o,e);if(J(o.headers)){var s=o.headers.split(/:(.+)/);o.headers={header:s[0],value:s[1]}}o.withCredentials=K(o.withCredentials);return o};var ct=function t(i){return lt(i)};var ft=function t(i){return i===null};var dt=function t(i){return typeof i==="object"&&i!==null};var ht=function t(i){return dt(i)&&J(i.url)&&dt(i.process)&&dt(i.revert)&&dt(i.restore)&&dt(i.fetch)};var pt=function t(i){if(W(i)){return"array"}if(ft(i)){return"null"}if(nt(i)){return"int"}if(/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(i)){return"bytes"}if(ht(i)){return"api"}return typeof i};var vt=function t(i){return i.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",')};var gt={array:Q,boolean:K,int:function t(i){return pt(i)==="bytes"?at(i):it(i)},number:et,float:et,bytes:at,string:function t(i){return rt(i)?i:X(i)},function:function t(i){return ot(i)},serverapi:ct,object:function t(i){try{return JSON.parse(vt(i))}catch(t){return null}}};var _t=function t(i,e){return gt[e](i)};var mt=function t(i,e,n){if(i===e){return i}var a=pt(i);if(a!==n){var r=_t(i,n);a=pt(r);if(r===null){throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"'}else{i=r}}return i};var bt=function t(i,e){var n=i;return{enumerable:true,get:function t(){return n},set:function t(a){n=mt(a,i,e)}}};var wt=function t(i){var e={};a(i,(function(t){var n=i[t];e[t]=bt(n[0],n[1])}));return r(e)};var xt=function t(i){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:wt(i)}};var yt=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return i.split(/(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join(e)};var kt=function t(i,e){var n={};a(e,(function(t){n[t]={get:function e(){return i.getState().options[t]},set:function e(n){i.dispatch("SET_"+yt(t,"_").toUpperCase(),{value:n})}}}));return n};var Et=function t(i){return function(t,e,n){var r={};a(i,(function(i){var e=yt(i,"_").toUpperCase();r["SET_"+e]=function(a){try{n.options[i]=a.value}catch(t){}t("DID_SET_"+e,{value:n.options[i]})}}));return r}};var It=function t(i){return function(t){var e={};a(i,(function(i){e["GET_"+yt(i,"_").toUpperCase()]=function(e){return t.options[i]}}));return e}};var Tt={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5};var At=function t(){return Math.random().toString(36).substring(2,11)};function St(t,i){if(t==null)return{};var e={};var n=Object.keys(t);var a,r;for(r=0;r<n.length;r++){a=n[r];if(i.indexOf(a)>=0)continue;e[a]=t[a]}return e}function Mt(t,i){if(t==null)return{};var e=St(t,i);var n,a;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(a=0;a<r.length;a++){n=r[a];if(i.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,n))continue;e[n]=t[n]}}return e}function Dt(t){return Pt(t)||Ot(t)||Rt()}function Pt(t){if(Array.isArray(t)){for(var i=0,e=new Array(t.length);i<t.length;i++)e[i]=t[i];return e}}function Ot(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function Rt(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Ct=function t(i,e){return i.splice(e,1)};var Lt=function t(i,e){if(e){i()}else if(document.hidden){Promise.resolve(1).then(i)}else{setTimeout(i,0)}};var zt=function t(){var i=[];var e=function t(e,n){Ct(i,i.findIndex((function(t){return t.event===e&&(t.cb===n||!n)})))};var n=function t(e,n,a){i.filter((function(t){return t.event===e})).map((function(t){return t.cb})).forEach((function(t){return Lt((function(){return t.apply(void 0,Dt(n))}),a)}))};return{fireSync:function t(i){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++){a[r-1]=arguments[r]}n(i,a,true)},fire:function t(i){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++){a[r-1]=arguments[r]}n(i,a,false)},on:function t(e,n){i.push({event:e,cb:n})},onOnce:function t(n,a){i.push({event:n,cb:function t(){e(n,a);a.apply(void 0,arguments)}})},off:e}};var Gt=function t(i,e,n){Object.getOwnPropertyNames(i).filter((function(t){return!n.includes(t)})).forEach((function(t){return Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))};var Ft=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"];var Nt=function t(i){var e={};Gt(i,e,Ft);return e};var Bt=function t(i){i.forEach((function(t,e){if(t.released){Ct(i,e)}}))};var jt={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8};var Ht={INPUT:1,LIMBO:2,LOCAL:3};var Ut=function t(i){return/[^0-9]+/.exec(i)};var Vt=function t(){return Ut(1.1.toLocaleString())[0]};var qt=function t(){var i=Vt();var e=1e3.toLocaleString();var n=1e3.toString();if(e!==n){return Ut(e)[0]}return i==="."?",":"."};var Wt={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"};var Yt=[];var Zt=function t(i,e,n){return new Promise((function(t,a){var r=Yt.filter((function(t){return t.key===i})).map((function(t){return t.cb}));if(r.length===0){t(e);return}var o=r.shift();r.reduce((function(t,i){return t.then((function(t){return i(t,n)}))}),o(e,n)).then((function(i){return t(i)})).catch((function(t){return a(t)}))}))};var Xt=function t(i,e,n){return Yt.filter((function(t){return t.key===i})).map((function(t){return t.cb(e,n)}))};var Qt=function t(i,e){return Yt.push({key:i,cb:e})};var $t=function t(i){return Object.assign(ti,i)};var Kt=function t(){return Object.assign({},ti)};var Jt=function t(i){a(i,(function(t,i){if(!ti[t]){return}ti[t][0]=mt(i,ti[t][0],ti[t][1])}))};var ti={id:[null,Wt.STRING],name:["filepond",Wt.STRING],disabled:[false,Wt.BOOLEAN],className:[null,Wt.STRING],required:[false,Wt.BOOLEAN],captureMethod:[null,Wt.STRING],allowSyncAcceptAttribute:[true,Wt.BOOLEAN],allowDrop:[true,Wt.BOOLEAN],allowBrowse:[true,Wt.BOOLEAN],allowPaste:[true,Wt.BOOLEAN],allowMultiple:[false,Wt.BOOLEAN],allowReplace:[true,Wt.BOOLEAN],allowRevert:[true,Wt.BOOLEAN],allowRemove:[true,Wt.BOOLEAN],allowProcess:[true,Wt.BOOLEAN],allowReorder:[false,Wt.BOOLEAN],allowDirectoriesOnly:[false,Wt.BOOLEAN],storeAsFile:[false,Wt.BOOLEAN],forceRevert:[false,Wt.BOOLEAN],maxFiles:[null,Wt.INT],checkValidity:[false,Wt.BOOLEAN],itemInsertLocationFreedom:[true,Wt.BOOLEAN],itemInsertLocation:["before",Wt.STRING],itemInsertInterval:[75,Wt.INT],dropOnPage:[false,Wt.BOOLEAN],dropOnElement:[true,Wt.BOOLEAN],dropValidation:[false,Wt.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],Wt.ARRAY],instantUpload:[true,Wt.BOOLEAN],maxParallelUploads:[2,Wt.INT],allowMinimumUploadDuration:[true,Wt.BOOLEAN],chunkUploads:[false,Wt.BOOLEAN],chunkForce:[false,Wt.BOOLEAN],chunkSize:[5e6,Wt.INT],chunkRetryDelays:[[500,1e3,3e3],Wt.ARRAY],server:[null,Wt.SERVER_API],fileSizeBase:[1e3,Wt.INT],labelFileSizeBytes:["bytes",Wt.STRING],labelFileSizeKilobytes:["KB",Wt.STRING],labelFileSizeMegabytes:["MB",Wt.STRING],labelFileSizeGigabytes:["GB",Wt.STRING],labelDecimalSeparator:[Vt(),Wt.STRING],labelThousandsSeparator:[qt(),Wt.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',Wt.STRING],labelInvalidField:["Field contains invalid files",Wt.STRING],labelFileWaitingForSize:["Waiting for size",Wt.STRING],labelFileSizeNotAvailable:["Size not available",Wt.STRING],labelFileCountSingular:["file in list",Wt.STRING],labelFileCountPlural:["files in list",Wt.STRING],labelFileLoading:["Loading",Wt.STRING],labelFileAdded:["Added",Wt.STRING],labelFileLoadError:["Error during load",Wt.STRING],labelFileRemoved:["Removed",Wt.STRING],labelFileRemoveError:["Error during remove",Wt.STRING],labelFileProcessing:["Uploading",Wt.STRING],labelFileProcessingComplete:["Upload complete",Wt.STRING],labelFileProcessingAborted:["Upload cancelled",Wt.STRING],labelFileProcessingError:["Error during upload",Wt.STRING],labelFileProcessingRevertError:["Error during revert",Wt.STRING],labelTapToCancel:["tap to cancel",Wt.STRING],labelTapToRetry:["tap to retry",Wt.STRING],labelTapToUndo:["tap to undo",Wt.STRING],labelButtonRemoveItem:["Remove",Wt.STRING],labelButtonAbortItemLoad:["Abort",Wt.STRING],labelButtonRetryItemLoad:["Retry",Wt.STRING],labelButtonAbortItemProcessing:["Cancel",Wt.STRING],labelButtonUndoItemProcessing:["Undo",Wt.STRING],labelButtonRetryItemProcessing:["Retry",Wt.STRING],labelButtonProcessItem:["Upload",Wt.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',Wt.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',Wt.STRING],oninit:[null,Wt.FUNCTION],onwarning:[null,Wt.FUNCTION],onerror:[null,Wt.FUNCTION],onactivatefile:[null,Wt.FUNCTION],oninitfile:[null,Wt.FUNCTION],onaddfilestart:[null,Wt.FUNCTION],onaddfileprogress:[null,Wt.FUNCTION],onaddfile:[null,Wt.FUNCTION],onprocessfilestart:[null,Wt.FUNCTION],onprocessfileprogress:[null,Wt.FUNCTION],onprocessfileabort:[null,Wt.FUNCTION],onprocessfilerevert:[null,Wt.FUNCTION],onprocessfile:[null,Wt.FUNCTION],onprocessfiles:[null,Wt.FUNCTION],onremovefile:[null,Wt.FUNCTION],onpreparefile:[null,Wt.FUNCTION],onupdatefiles:[null,Wt.FUNCTION],onreorderfiles:[null,Wt.FUNCTION],beforeDropFile:[null,Wt.FUNCTION],beforeAddFile:[null,Wt.FUNCTION],beforeRemoveFile:[null,Wt.FUNCTION],beforePrepareFile:[null,Wt.FUNCTION],stylePanelLayout:[null,Wt.STRING],stylePanelAspectRatio:[null,Wt.STRING],styleItemPanelAspectRatio:[null,Wt.STRING],styleButtonRemoveItemPosition:["left",Wt.STRING],styleButtonProcessItemPosition:["right",Wt.STRING],styleLoadIndicatorPosition:["right",Wt.STRING],styleProgressIndicatorPosition:["right",Wt.STRING],styleButtonRemoveItemAlign:[false,Wt.BOOLEAN],files:[[],Wt.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],Wt.ARRAY]};var ii=function t(i,e){if(Y(e)){return i[0]||null}if(nt(e)){return i[e]||null}if(typeof e==="object"){e=e.id}return i.find((function(t){return t.id===e}))||null};var ei=function t(i){if(Y(i)){return i}if(/:/.test(i)){var e=i.split(":");return e[1]/e[0]}return parseFloat(i)};var ni=function t(i){return i.filter((function(t){return!t.archived}))};var ai={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4};var ri=null;var oi=function t(){if(ri===null){try{var i=new DataTransfer;i.items.add(new File(["hello world"],"This_Works.txt"));var e=document.createElement("input");e.setAttribute("type","file");e.files=i.files;ri=e.files.length===1}catch(t){ri=false}}return ri};var si=[jt.LOAD_ERROR,jt.PROCESSING_ERROR,jt.PROCESSING_REVERT_ERROR];var li=[jt.LOADING,jt.PROCESSING,jt.PROCESSING_QUEUED,jt.INIT];var ui=[jt.PROCESSING_COMPLETE];var ci=function t(i){return si.includes(i.status)};var fi=function t(i){return li.includes(i.status)};var di=function t(i){return ui.includes(i.status)};var hi=function t(i){return dt(i.options.server)&&(dt(i.options.server.process)||rt(i.options.server.process))};var pi=function t(i){return{GET_STATUS:function t(){var e=ni(i.items);var n=ai.EMPTY,a=ai.ERROR,r=ai.BUSY,o=ai.IDLE,s=ai.READY;if(e.length===0)return n;if(e.some(ci))return a;if(e.some(fi))return r;if(e.some(di))return s;return o},GET_ITEM:function t(e){return ii(i.items,e)},GET_ACTIVE_ITEM:function t(e){return ii(ni(i.items),e)},GET_ACTIVE_ITEMS:function t(){return ni(i.items)},GET_ITEMS:function t(){return i.items},GET_ITEM_NAME:function t(e){var n=ii(i.items,e);return n?n.filename:null},GET_ITEM_SIZE:function t(e){var n=ii(i.items,e);return n?n.fileSize:null},GET_STYLES:function t(){return Object.keys(i.options).filter((function(t){return/^style/.test(t)})).map((function(t){return{name:t,value:i.options[t]}}))},GET_PANEL_ASPECT_RATIO:function t(){var e=/circle/.test(i.options.stylePanelLayout);var n=e?1:ei(i.options.stylePanelAspectRatio);return n},GET_ITEM_PANEL_ASPECT_RATIO:function t(){return i.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function t(e){return ni(i.items).filter((function(t){return t.status===e}))},GET_TOTAL_ITEMS:function t(){return ni(i.items).length},SHOULD_UPDATE_FILE_INPUT:function t(){return i.options.storeAsFile&&oi()&&!hi(i)},IS_ASYNC:function t(){return hi(i)},GET_FILE_SIZE_LABELS:function t(i){return{labelBytes:i("GET_LABEL_FILE_SIZE_BYTES")||undefined,labelKilobytes:i("GET_LABEL_FILE_SIZE_KILOBYTES")||undefined,labelMegabytes:i("GET_LABEL_FILE_SIZE_MEGABYTES")||undefined,labelGigabytes:i("GET_LABEL_FILE_SIZE_GIGABYTES")||undefined}}}};var vi=function t(i){var e=ni(i.items).length;if(!i.options.allowMultiple){return e===0}var n=i.options.maxFiles;if(n===null){return true}if(e<n){return true}return false};var gi=function t(i,e,n){return Math.max(Math.min(n,i),e)};var _i=function t(i,e,n){return i.splice(e,0,n)};var mi=function t(i,e,n){if(Y(e)){return null}if(typeof n==="undefined"){i.push(e);return e}n=gi(n,0,i.length);_i(i,n,e);return e};var bi=function t(i){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(i)};var wi=function t(i){return(""+i).split("/").pop().split("?").shift()};var xi=function t(i){return i.split(".").pop()};var yi=function t(i){if(typeof i!=="string"){return""}var e=i.split("/").pop();if(/svg/.test(e)){return"svg"}if(/zip|compressed/.test(e)){return"zip"}if(/plain/.test(e)){return"txt"}if(/msword/.test(e)){return"doc"}if(/[a-z]+/.test(e)){if(e==="jpeg"){return"jpg"}return e}return""};var ki=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return(e+i).slice(-e.length)};var Ei=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:new Date;return i.getFullYear()+"-"+ki(i.getMonth()+1,"00")+"-"+ki(i.getDate(),"00")+"_"+ki(i.getHours(),"00")+"-"+ki(i.getMinutes(),"00")+"-"+ki(i.getSeconds(),"00")};var Ii=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var r=typeof n==="string"?i.slice(0,i.size,n):i.slice(0,i.size,i.type);r.lastModifiedDate=new Date;if(i._relativePath)r._relativePath=i._relativePath;if(!J(e)){e=Ei()}if(e&&a===null&&xi(e)){r.name=e}else{a=a||yi(r.type);r.name=e+(a?"."+a:"")}return r};var Ti=function t(){return window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder};var Ai=function t(i,e){var n=Ti();if(n){var a=new n;a.append(i);return a.getBlob(e)}return new Blob([i],{type:e})};var Si=function t(i,e){var n=new ArrayBuffer(i.length);var a=new Uint8Array(n);for(var r=0;r<i.length;r++){a[r]=i.charCodeAt(r)}return Ai(n,e)};var Mi=function t(i){return(/^data:(.+);/.exec(i)||[])[1]||null};var Di=function t(i){var e=i.split(",")[1];return e.replace(/\s/g,"")};var Pi=function t(i){return atob(Di(i))};var Oi=function t(i){var e=Mi(i);var n=Pi(i);return Si(n,e)};var Ri=function t(i,e,n){return Ii(Oi(i),e,null,n)};var Ci=function t(i){if(!/^content-disposition:/i.test(i))return null;var e=i.split(/filename=|filename\*=.+''/).splice(1).map((function(t){return t.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(t){return t.length}));return e.length?decodeURI(e[e.length-1]):null};var Li=function t(i){if(/content-length:/i.test(i)){var e=i.match(/[0-9]+/)[0];return e?parseInt(e,10):null}return null};var zi=function t(i){if(/x-content-transfer-id:/i.test(i)){var e=(i.split(":")[1]||"").trim();return e||null}return null};var Gi=function t(i){var e={source:null,name:null,size:null};var n=i.split("\n");var a=true;var r=false;var o=undefined;try{for(var s=n[Symbol.iterator](),l;!(a=(l=s.next()).done);a=true){var u=l.value;var c=Ci(u);if(c){e.name=c;continue}var f=Li(u);if(f){e.size=f;continue}var d=zi(u);if(d){e.source=d;continue}}}catch(t){r=true;o=t}finally{try{if(!a&&s.return!=null){s.return()}}finally{if(r){throw o}}}return e};var Fi=function t(i){var e={source:null,complete:false,progress:0,size:null,timestamp:null,duration:0,request:null};var n=function t(){return e.progress};var a=function t(){if(e.request&&e.request.abort){e.request.abort()}};var r=function t(){var i=e.source;s.fire("init",i);if(i instanceof File){s.fire("load",i)}else if(i instanceof Blob){s.fire("load",Ii(i,i.name))}else if(bi(i)){s.fire("load",Ri(i))}else{o(i)}};var o=function t(n){if(!i){s.fire("error",{type:"error",body:"Can't load URL",code:400});return}e.timestamp=Date.now();e.request=i(n,(function(t){e.duration=Date.now()-e.timestamp;e.complete=true;if(t instanceof Blob){t=Ii(t,t.name||wi(n))}s.fire("load",t instanceof Blob?t:t?t.body:null)}),(function(t){s.fire("error",typeof t==="string"?{type:"error",code:0,body:t}:t)}),(function(t,i,n){if(n){e.size=n}e.duration=Date.now()-e.timestamp;if(!t){e.progress=null;return}e.progress=i/n;s.fire("progress",e.progress)}),(function(){s.fire("abort")}),(function(t){var i=Gi(typeof t==="string"?t:t.headers);s.fire("meta",{size:e.size||i.size,filename:i.name,source:i.source})}))};var s=Object.assign({},zt(),{setSource:function t(i){return e.source=i},getProgress:n,abort:a,load:r});return s};var Ni=function t(i){return/GET|HEAD/.test(i)};var Bi=function t(i,e,n){var a={onheaders:function t(){},onprogress:function t(){},onload:function t(){},ontimeout:function t(){},onerror:function t(){},onabort:function t(){},abort:function t(){r=true;s.abort()}};var r=false;var o=false;n=Object.assign({method:"POST",headers:{},withCredentials:false},n);e=encodeURI(e);if(Ni(n.method)&&i){e=""+e+encodeURIComponent(typeof i==="string"?i:JSON.stringify(i))}var s=new XMLHttpRequest;var l=Ni(n.method)?s:s.upload;l.onprogress=function(t){if(r){return}a.onprogress(t.lengthComputable,t.loaded,t.total)};s.onreadystatechange=function(){if(s.readyState<2){return}if(s.readyState===4&&s.status===0){return}if(o){return}o=true;a.onheaders(s)};s.onload=function(){if(s.status>=200&&s.status<300){a.onload(s)}else{a.onerror(s)}};s.onerror=function(){return a.onerror(s)};s.onabort=function(){r=true;a.onabort()};s.ontimeout=function(){return a.ontimeout(s)};s.open(n.method,e,true);if(nt(n.timeout)){s.timeout=n.timeout}Object.keys(n.headers).forEach((function(t){var i=unescape(encodeURIComponent(n.headers[t]));s.setRequestHeader(t,i)}));if(n.responseType){s.responseType=n.responseType}if(n.withCredentials){s.withCredentials=true}s.send(i);return a};var ji=function t(i,e,n,a){return{type:i,code:e,body:n,headers:a}};var Hi=function t(i){return function(t){i(ji("error",0,"Timeout",t.getAllResponseHeaders()))}};var Ui=function t(i){return/\?/.test(i)};var Vi=function t(){var i="";for(var e=arguments.length,n=new Array(e),a=0;a<e;a++){n[a]=arguments[a]}n.forEach((function(t){i+=Ui(i)&&Ui(t)?t.replace(/\?/,"&"):t}));return i};var qi=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var e=arguments.length>1?arguments[1]:undefined;if(typeof e==="function"){return e}if(!e||!J(e.url)){return null}var n=e.onload||function(t){return t};var a=e.onerror||function(t){return null};return function(t,r,o,s,l,u){var c=Bi(t,Vi(i,e.url),Object.assign({},e,{responseType:"blob"}));c.onload=function(i){var a=i.getAllResponseHeaders();var o=Gi(a).name||wi(t);r(ji("load",i.status,e.method==="HEAD"?null:Ii(n(i.response),o),a))};c.onerror=function(t){o(ji("error",t.status,a(t.response)||t.statusText,t.getAllResponseHeaders()))};c.onheaders=function(t){u(ji("headers",t.status,null,t.getAllResponseHeaders()))};c.ontimeout=Hi(o);c.onprogress=s;c.onabort=l;return c}};var Wi={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4};var Yi=function t(i,e,n,a,r,o,s,l,u,c,f){var d=[];var h=f.chunkTransferId,p=f.chunkServer,v=f.chunkSize,g=f.chunkRetryDelays;var _={serverId:h,aborted:false};var m=e.ondata||function(t){return t};var b=e.onload||function(t,i){return i==="HEAD"?t.getResponseHeader("Upload-Offset"):t.response};var w=e.onerror||function(t){return null};var x=function t(o){var l=new FormData;if(dt(r))l.append(n,JSON.stringify(r));var u=typeof e.headers==="function"?e.headers(a,r):Object.assign({},e.headers,{"Upload-Length":a.size});var c=Object.assign({},e,{headers:u});var f=Bi(m(l),Vi(i,e.url),c);f.onload=function(t){return o(b(t,c.method))};f.onerror=function(t){return s(ji("error",t.status,w(t.response)||t.statusText,t.getAllResponseHeaders()))};f.ontimeout=Hi(s)};var y=function t(n){var a=Vi(i,p.url,_.serverId);var r=typeof e.headers==="function"?e.headers(_.serverId):Object.assign({},e.headers);var o={headers:r,method:"HEAD"};var l=Bi(null,a,o);l.onload=function(t){return n(b(t,o.method))};l.onerror=function(t){return s(ji("error",t.status,w(t.response)||t.statusText,t.getAllResponseHeaders()))};l.ontimeout=Hi(s)};var k=Math.floor(a.size/v);for(var E=0;E<=k;E++){var I=E*v;var T=a.slice(I,I+v,"application/offset+octet-stream");d[E]={index:E,size:T.size,offset:I,data:T,file:a,progress:0,retries:Dt(g),status:Wi.QUEUED,error:null,request:null,timeout:null}}var A=function t(){return o(_.serverId)};var S=function t(i){return i.status===Wi.QUEUED||i.status===Wi.ERROR};var M=function t(e){if(_.aborted)return;e=e||d.find(S);if(!e){if(d.every((function(t){return t.status===Wi.COMPLETE}))){A()}return}e.status=Wi.PROCESSING;e.progress=null;var n=p.ondata||function(t){return t};var r=p.onerror||function(t){return null};var o=p.onload||function(){};var l=Vi(i,p.url,_.serverId);var c=typeof p.headers==="function"?p.headers(e):Object.assign({},p.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":e.offset,"Upload-Length":a.size,"Upload-Name":a.name});var f=e.request=Bi(n(e.data),l,Object.assign({},p,{headers:c}));f.onload=function(t){o(t,e.index,d.length);e.status=Wi.COMPLETE;e.request=null;O()};f.onprogress=function(t,i,n){e.progress=t?i:null;P()};f.onerror=function(t){e.status=Wi.ERROR;e.request=null;e.error=r(t.response)||t.statusText;if(!D(e)){s(ji("error",t.status,r(t.response)||t.statusText,t.getAllResponseHeaders()))}};f.ontimeout=function(t){e.status=Wi.ERROR;e.request=null;if(!D(e)){Hi(s)(t)}};f.onabort=function(){e.status=Wi.QUEUED;e.request=null;u()}};var D=function t(i){if(i.retries.length===0)return false;i.status=Wi.WAITING;clearTimeout(i.timeout);i.timeout=setTimeout((function(){M(i)}),i.retries.shift());return true};var P=function t(){var i=d.reduce((function(t,i){if(t===null||i.progress===null)return null;return t+i.progress}),0);if(i===null)return l(false,0,0);var e=d.reduce((function(t,i){return t+i.size}),0);l(true,i,e)};var O=function t(){var i=d.filter((function(t){return t.status===Wi.PROCESSING})).length;if(i>=1)return;M()};var R=function t(){d.forEach((function(t){clearTimeout(t.timeout);if(t.request){t.request.abort()}}))};if(!_.serverId){x((function(t){if(_.aborted)return;c(t);_.serverId=t;O()}))}else{y((function(t){if(_.aborted)return;d.filter((function(i){return i.offset<t})).forEach((function(t){t.status=Wi.COMPLETE;t.progress=t.size}));O()}))}return{abort:function t(){_.aborted=true;R()}}};var Zi=function t(i,e,n,a){return function(t,r,o,s,l,u,c){if(!t)return;var f=a.chunkUploads;var d=f&&t.size>a.chunkSize;var h=f&&(d||a.chunkForce);if(t instanceof Blob&&h)return Yi(i,e,n,t,r,o,s,l,u,c,a);var p=e.ondata||function(t){return t};var v=e.onload||function(t){return t};var g=e.onerror||function(t){return null};var _=typeof e.headers==="function"?e.headers(t,r)||{}:Object.assign({},e.headers);var m=Object.assign({},e,{headers:_});var b=new FormData;if(dt(r)){b.append(n,JSON.stringify(r))}(t instanceof Blob?[{name:null,file:t}]:t).forEach((function(t){b.append(n,t.file,t.name===null?t.file.name:""+t.name+t.file.name)}));var w=Bi(p(b),Vi(i,e.url),m);w.onload=function(t){o(ji("load",t.status,v(t.response),t.getAllResponseHeaders()))};w.onerror=function(t){s(ji("error",t.status,g(t.response)||t.statusText,t.getAllResponseHeaders()))};w.ontimeout=Hi(s);w.onprogress=l;w.onabort=u;return w}};var Xi=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var e=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var a=arguments.length>3?arguments[3]:undefined;if(typeof e==="function")return function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}return e.apply(void 0,[n].concat(i,[a]))};if(!e||!J(e.url))return null;return Zi(i,e,n,a)};var Qi=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var e=arguments.length>1?arguments[1]:undefined;if(typeof e==="function"){return e}if(!e||!J(e.url)){return function(t,i){return i()}}var n=e.onload||function(t){return t};var a=e.onerror||function(t){return null};return function(t,r,o){var s=Bi(t,i+e.url,e);s.onload=function(t){r(ji("load",t.status,n(t.response),t.getAllResponseHeaders()))};s.onerror=function(t){o(ji("error",t.status,a(t.response)||t.statusText,t.getAllResponseHeaders()))};s.ontimeout=Hi(o);return s}};var $i=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return i+Math.random()*(e-i)};var Ki=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e3;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:25;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:250;var r=null;var o=Date.now();var s=function t(){var s=Date.now()-o;var l=$i(n,a);if(s+l>e){l=s+l-e}var u=s/e;if(u>=1||document.hidden){i(1);return}i(u);r=setTimeout(t,l)};if(e>0)s();return{clear:function t(){clearTimeout(r)}}};var Ji=function t(i,e){var n={complete:false,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null};var a=e.allowMinimumUploadDuration;var r=function t(e,r){var o=function t(){if(n.duration===0||n.progress===null)return;c.fire("progress",c.getProgress())};var s=function t(){n.complete=true;c.fire("load-perceived",n.response.body)};c.fire("start");n.timestamp=Date.now();n.perceivedPerformanceUpdater=Ki((function(t){n.perceivedProgress=t;n.perceivedDuration=Date.now()-n.timestamp;o();if(n.response&&n.perceivedProgress===1&&!n.complete){s()}}),a?$i(750,1500):0);n.request=i(e,r,(function(t){n.response=dt(t)?t:{type:"load",code:200,body:""+t,headers:{}};n.duration=Date.now()-n.timestamp;n.progress=1;c.fire("load",n.response.body);if(!a||a&&n.perceivedProgress===1){s()}}),(function(t){n.perceivedPerformanceUpdater.clear();c.fire("error",dt(t)?t:{type:"error",code:0,body:""+t})}),(function(t,i,e){n.duration=Date.now()-n.timestamp;n.progress=t?i/e:null;o()}),(function(){n.perceivedPerformanceUpdater.clear();c.fire("abort",n.response?n.response.body:null)}),(function(t){c.fire("transfer",t)}))};var o=function t(){if(!n.request)return;n.perceivedPerformanceUpdater.clear();if(n.request.abort)n.request.abort();n.complete=true};var s=function t(){o();n.complete=false;n.perceivedProgress=0;n.progress=0;n.timestamp=null;n.perceivedDuration=0;n.duration=0;n.request=null;n.response=null};var l=a?function(){return n.progress?Math.min(n.progress,n.perceivedProgress):null}:function(){return n.progress||null};var u=a?function(){return Math.min(n.duration,n.perceivedDuration)}:function(){return n.duration};var c=Object.assign({},zt(),{process:r,abort:o,getProgress:l,getDuration:u,reset:s});return c};var te=function t(i){return i.substring(0,i.lastIndexOf("."))||i};var ie=function t(i){var e=[i.name,i.size,i.type];if(i instanceof Blob||bi(i)){e[0]=i.name||Ei()}else if(bi(i)){e[1]=i.length;e[2]=Mi(i)}else if(J(i)){e[0]=wi(i);e[1]=0;e[2]="application/octet-stream"}return{name:e[0],size:e[1],type:e[2]}};var ee=function t(i){return!!(i instanceof File||i instanceof Blob&&i.name)};var ne=function t(i){if(!dt(i))return i;var e=W(i)?[]:{};for(var n in i){if(!i.hasOwnProperty(n))continue;var a=i[n];e[n]=a&&dt(a)?t(a):a}return e};var ae=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var a=At();var o={archived:false,frozen:false,released:false,source:null,file:n,serverFileReference:e,transferId:null,processingAborted:false,status:e?jt.PROCESSING_COMPLETE:jt.INIT,activeLoader:null,activeProcessor:null};var s=null;var l={};var u=function t(i){return o.status=i};var c=function t(i){if(o.released||o.frozen)return;for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a<e;a++){n[a-1]=arguments[a]}E.fire.apply(E,[i].concat(n))};var f=function t(){return xi(o.file.name)};var d=function t(){return o.file.type};var h=function t(){return o.file.size};var p=function t(){return o.file};var v=function t(e,n,a){o.source=e;E.fireSync("init");if(o.file){E.fireSync("load-skip");return}o.file=ie(e);n.on("init",(function(){c("load-init")}));n.on("meta",(function(t){o.file.size=t.size;o.file.filename=t.filename;if(t.source){i=Ht.LIMBO;o.serverFileReference=t.source;o.status=jt.PROCESSING_COMPLETE}c("load-meta")}));n.on("progress",(function(t){u(jt.LOADING);c("load-progress",t)}));n.on("error",(function(t){u(jt.LOAD_ERROR);c("load-request-error",t)}));n.on("abort",(function(){u(jt.INIT);c("load-abort")}));n.on("load",(function(t){o.activeLoader=null;var e=function t(e){o.file=ee(e)?e:o.file;if(i===Ht.LIMBO&&o.serverFileReference){u(jt.PROCESSING_COMPLETE)}else{u(jt.IDLE)}c("load")};var n=function i(e){o.file=t;c("load-meta");u(jt.LOAD_ERROR);c("load-file-error",e)};if(o.serverFileReference){e(t);return}a(t,e,n)}));n.setSource(e);o.activeLoader=n;n.load()};var g=function t(){if(!o.activeLoader){return}o.activeLoader.load()};var _=function t(){if(o.activeLoader){o.activeLoader.abort();return}u(jt.INIT);c("load-abort")};var m=function t(i,e){if(o.processingAborted){o.processingAborted=false;return}u(jt.PROCESSING);s=null;if(!(o.file instanceof Blob)){E.on("load",(function(){t(i,e)}));return}i.on("load",(function(t){o.transferId=null;o.serverFileReference=t}));i.on("transfer",(function(t){o.transferId=t}));i.on("load-perceived",(function(t){o.activeProcessor=null;o.transferId=null;o.serverFileReference=t;u(jt.PROCESSING_COMPLETE);c("process-complete",t)}));i.on("start",(function(){c("process-start")}));i.on("error",(function(t){o.activeProcessor=null;u(jt.PROCESSING_ERROR);c("process-error",t)}));i.on("abort",(function(t){o.activeProcessor=null;o.serverFileReference=t;u(jt.IDLE);c("process-abort");if(s){s()}}));i.on("progress",(function(t){c("process-progress",t)}));var n=function t(e){if(o.archived)return;i.process(e,Object.assign({},l))};var a=console.error;e(o.file,n,a);o.activeProcessor=i};var b=function t(){o.processingAborted=false;u(jt.PROCESSING_QUEUED)};var w=function t(){return new Promise((function(t){if(!o.activeProcessor){o.processingAborted=true;u(jt.IDLE);c("process-abort");t();return}s=function i(){t()};o.activeProcessor.abort()}))};var x=function t(i,e){return new Promise((function(t,n){var a=o.serverFileReference!==null?o.serverFileReference:o.transferId;if(a===null){t();return}i(a,(function(){o.serverFileReference=null;o.transferId=null;t()}),(function(i){if(!e){t();return}u(jt.PROCESSING_REVERT_ERROR);c("process-revert-error");n(i)}));u(jt.IDLE);c("process-revert")}))};var y=function t(i,e,n){var a=i.split(".");var r=a[0];var o=a.pop();var s=l;a.forEach((function(t){return s=s[t]}));if(JSON.stringify(s[o])===JSON.stringify(e))return;s[o]=e;c("metadata-update",{key:r,value:l[r],silent:n})};var k=function t(i){return ne(i?l[i]:l)};var E=Object.assign({id:{get:function t(){return a}},origin:{get:function t(){return i},set:function t(e){return i=e}},serverId:{get:function t(){return o.serverFileReference}},transferId:{get:function t(){return o.transferId}},status:{get:function t(){return o.status}},filename:{get:function t(){return o.file.name}},filenameWithoutExtension:{get:function t(){return te(o.file.name)}},fileExtension:{get:f},fileType:{get:d},fileSize:{get:h},file:{get:p},relativePath:{get:function t(){return o.file._relativePath}},source:{get:function t(){return o.source}},getMetadata:k,setMetadata:function t(i,e,n){if(dt(i)){var a=i;Object.keys(a).forEach((function(t){y(t,a[t],e)}));return i}y(i,e,n);return e},extend:function t(i,e){return I[i]=e},abortLoad:_,retryLoad:g,requestProcessing:b,abortProcessing:w,load:v,process:m,revert:x},zt(),{freeze:function t(){return o.frozen=true},release:function t(){return o.released=true},released:{get:function t(){return o.released}},archive:function t(){return o.archived=true},archived:{get:function t(){return o.archived}},setFile:function t(i){return o.file=i}});var I=r(E);return I};var re=function t(i,e){if(Y(e)){return 0}if(!J(e)){return-1}return i.findIndex((function(t){return t.id===e}))};var oe=function t(i,e){var n=re(i,e);if(n<0){return}return i[n]||null};var se=function t(i,e,n,a,r,o){var s=Bi(null,i,{method:"GET",responseType:"blob"});s.onload=function(t){var n=t.getAllResponseHeaders();var a=Gi(n).name||wi(i);e(ji("load",t.status,Ii(t.response,a),n))};s.onerror=function(t){n(ji("error",t.status,t.statusText,t.getAllResponseHeaders()))};s.onheaders=function(t){o(ji("headers",t.status,null,t.getAllResponseHeaders()))};s.ontimeout=Hi(n);s.onprogress=a;s.onabort=r;return s};var le=function t(i){if(i.indexOf("//")===0){i=location.protocol+i}return i.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]};var ue=function t(i){return(i.indexOf(":")>-1||i.indexOf("//")>-1)&&le(location.href)!==le(i)};var ce=function t(i){return function(){return rt(i)?i.apply(void 0,arguments):i}};var fe=function t(i){return!ee(i.file)};var de=function t(i,e){clearTimeout(e.listUpdateTimeout);e.listUpdateTimeout=setTimeout((function(){i("DID_UPDATE_ITEMS",{items:ni(e.items)})}),0)};var he=function t(i){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a<e;a++){n[a-1]=arguments[a]}return new Promise((function(t){if(!i){return t(true)}var e=i.apply(void 0,n);if(e==null){return t(true)}if(typeof e==="boolean"){return t(e)}if(typeof e.then==="function"){e.then(t)}}))};var pe=function t(i,e){i.items.sort((function(t,i){return e(Nt(t),Nt(i))}))};var ve=function t(i,e){return function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=t.query,a=t.success,r=a===void 0?function(){}:a,o=t.failure,s=o===void 0?function(){}:o,l=Mt(t,["query","success","failure"]);var u=ii(i.items,n);if(!u){s({error:ji("error",0,"Item not found"),file:null});return}e(u,r,s,l||{})}};var ge=function t(i,e,n){return{ABORT_ALL:function t(){ni(n.items).forEach((function(t){t.freeze();t.abortLoad();t.abortProcessing()}))},DID_SET_FILES:function t(e){var a=e.value,r=a===void 0?[]:a;var o=r.map((function(t){return{source:t.source?t.source:t,options:t.options}}));var s=ni(n.items);s.forEach((function(t){if(!o.find((function(i){return i.source===t.source||i.source===t.file}))){i("REMOVE_ITEM",{query:t,remove:false})}}));s=ni(n.items);o.forEach((function(t,e){if(s.find((function(i){return i.source===t.source||i.file===t.source})))return;i("ADD_ITEM",Object.assign({},t,{interactionMethod:Tt.NONE,index:e}))}))},DID_UPDATE_ITEM_METADATA:function t(a){var r=a.id,o=a.action,s=a.change;if(s.silent)return;clearTimeout(n.itemUpdateTimeout);n.itemUpdateTimeout=setTimeout((function(){var t=oe(n.items,r);if(!e("IS_ASYNC")){Zt("SHOULD_PREPARE_OUTPUT",false,{item:t,query:e,action:o,change:s}).then((function(n){var a=e("GET_BEFORE_PREPARE_FILE");if(a)n=a(t,n);if(!n)return;i("REQUEST_PREPARE_OUTPUT",{query:r,item:t,success:function t(e){i("DID_PREPARE_OUTPUT",{id:r,file:e})}},true)}));return}if(t.origin===Ht.LOCAL){i("DID_LOAD_ITEM",{id:t.id,error:null,serverFileReference:t.source})}var a=function t(){setTimeout((function(){i("REQUEST_ITEM_PROCESSING",{query:r})}),32)};var l=function i(r){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(r?a:function(){}).catch((function(){}))};var u=function i(e){t.abortProcessing().then(e?a:function(){})};if(t.status===jt.PROCESSING_COMPLETE){return l(n.options.instantUpload)}if(t.status===jt.PROCESSING){return u(n.options.instantUpload)}if(n.options.instantUpload){a()}}),0)},MOVE_ITEM:function t(i){var e=i.query,a=i.index;var r=ii(n.items,e);if(!r)return;var o=n.items.indexOf(r);a=gi(a,0,n.items.length-1);if(o===a)return;n.items.splice(a,0,n.items.splice(o,1)[0])},SORT:function t(a){var r=a.compare;pe(n,r);i("DID_SORT_ITEMS",{items:e("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function t(n){var a=n.items,r=n.index,o=n.interactionMethod,s=n.success,l=s===void 0?function(){}:s,u=n.failure,c=u===void 0?function(){}:u;var f=r;if(r===-1||typeof r==="undefined"){var d=e("GET_ITEM_INSERT_LOCATION");var h=e("GET_TOTAL_ITEMS");f=d==="before"?0:h}var p=e("GET_IGNORED_FILES");var v=function t(i){return ee(i)?!p.includes(i.name.toLowerCase()):!Y(i)};var g=a.filter(v);var _=g.map((function(t){return new Promise((function(e,n){i("ADD_ITEM",{interactionMethod:o,source:t.source||t,success:e,failure:n,index:f++,options:t.options||{}})}))}));Promise.all(_).then(l).catch(c)},ADD_ITEM:function t(a){var r=a.source,o=a.index,s=o===void 0?-1:o,l=a.interactionMethod,u=a.success,c=u===void 0?function(){}:u,f=a.failure,d=f===void 0?function(){}:f,h=a.options,p=h===void 0?{}:h;if(Y(r)){d({error:ji("error",0,"No source"),file:null});return}if(ee(r)&&n.options.ignoredFiles.includes(r.name.toLowerCase())){return}if(!vi(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var v=ji("warning",0,"Max files");i("DID_THROW_MAX_FILES",{source:r,error:v});d({error:v,file:null});return}var g=ni(n.items)[0];if(g.status===jt.PROCESSING_COMPLETE||g.status===jt.PROCESSING_REVERT_ERROR){var _=e("GET_FORCE_REVERT");g.revert(Qi(n.options.server.url,n.options.server.revert),_).then((function(){if(!_)return;i("ADD_ITEM",{source:r,index:s,interactionMethod:l,success:c,failure:d,options:p})})).catch((function(){}));if(_)return}i("REMOVE_ITEM",{query:g.id})}var m=p.type==="local"?Ht.LOCAL:p.type==="limbo"?Ht.LIMBO:Ht.INPUT;var b=ae(m,m===Ht.INPUT?null:r,p.file);Object.keys(p.metadata||{}).forEach((function(t){b.setMetadata(t,p.metadata[t])}));Xt("DID_CREATE_ITEM",b,{query:e,dispatch:i});var w=e("GET_ITEM_INSERT_LOCATION");if(!n.options.itemInsertLocationFreedom){s=w==="before"?-1:n.items.length}mi(n.items,b,s);if(rt(w)&&r){pe(n,w)}var x=b.id;b.on("init",(function(){i("DID_INIT_ITEM",{id:x})}));b.on("load-init",(function(){i("DID_START_ITEM_LOAD",{id:x})}));b.on("load-meta",(function(){i("DID_UPDATE_ITEM_META",{id:x})}));b.on("load-progress",(function(t){i("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:x,progress:t})}));b.on("load-request-error",(function(t){var e=ce(n.options.labelFileLoadError)(t);if(t.code>=400&&t.code<500){i("DID_THROW_ITEM_INVALID",{id:x,error:t,status:{main:e,sub:t.code+" ("+t.body+")"}});d({error:t,file:Nt(b)});return}i("DID_THROW_ITEM_LOAD_ERROR",{id:x,error:t,status:{main:e,sub:n.options.labelTapToRetry}})}));b.on("load-file-error",(function(t){i("DID_THROW_ITEM_INVALID",{id:x,error:t.status,status:t.status});d({error:t.status,file:Nt(b)})}));b.on("load-abort",(function(){i("REMOVE_ITEM",{query:x})}));b.on("load-skip",(function(){b.on("metadata-update",(function(t){if(!ee(b.file))return;i("DID_UPDATE_ITEM_METADATA",{id:x,change:t})}));i("COMPLETE_LOAD_ITEM",{query:x,item:b,data:{source:r,success:c}})}));b.on("load",(function(){var t=function t(a){if(!a){i("REMOVE_ITEM",{query:x});return}b.on("metadata-update",(function(t){i("DID_UPDATE_ITEM_METADATA",{id:x,change:t})}));Zt("SHOULD_PREPARE_OUTPUT",false,{item:b,query:e}).then((function(t){var a=e("GET_BEFORE_PREPARE_FILE");if(a)t=a(b,t);var o=function t(){i("COMPLETE_LOAD_ITEM",{query:x,item:b,data:{source:r,success:c}});de(i,n)};if(t){i("REQUEST_PREPARE_OUTPUT",{query:x,item:b,success:function t(e){i("DID_PREPARE_OUTPUT",{id:x,file:e});o()}},true);return}o()}))};Zt("DID_LOAD_ITEM",b,{query:e,dispatch:i}).then((function(){he(e("GET_BEFORE_ADD_FILE"),Nt(b)).then(t)})).catch((function(e){if(!e||!e.error||!e.status)return t(false);i("DID_THROW_ITEM_INVALID",{id:x,error:e.error,status:e.status})}))}));b.on("process-start",(function(){i("DID_START_ITEM_PROCESSING",{id:x})}));b.on("process-progress",(function(t){i("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:x,progress:t})}));b.on("process-error",(function(t){i("DID_THROW_ITEM_PROCESSING_ERROR",{id:x,error:t,status:{main:ce(n.options.labelFileProcessingError)(t),sub:n.options.labelTapToRetry}})}));b.on("process-revert-error",(function(t){i("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:x,error:t,status:{main:ce(n.options.labelFileProcessingRevertError)(t),sub:n.options.labelTapToRetry}})}));b.on("process-complete",(function(t){i("DID_COMPLETE_ITEM_PROCESSING",{id:x,error:null,serverFileReference:t});i("DID_DEFINE_VALUE",{id:x,value:t})}));b.on("process-abort",(function(){i("DID_ABORT_ITEM_PROCESSING",{id:x})}));b.on("process-revert",(function(){i("DID_REVERT_ITEM_PROCESSING",{id:x});i("DID_DEFINE_VALUE",{id:x,value:null})}));i("DID_ADD_ITEM",{id:x,index:s,interactionMethod:l});de(i,n);var y=n.options.server||{},k=y.url,E=y.load,I=y.restore,T=y.fetch;b.load(r,Fi(m===Ht.INPUT?J(r)&&ue(r)?T?qi(k,T):se:se:m===Ht.LIMBO?qi(k,I):qi(k,E)),(function(t,i,n){Zt("LOAD_FILE",t,{query:e}).then(i).catch(n)}))},REQUEST_PREPARE_OUTPUT:function t(i){var n=i.item,a=i.success,r=i.failure,o=r===void 0?function(){}:r;var s={error:ji("error",0,"Item not found"),file:null};if(n.archived)return o(s);Zt("PREPARE_OUTPUT",n.file,{query:e,item:n}).then((function(t){Zt("COMPLETE_PREPARE_OUTPUT",t,{query:e,item:n}).then((function(t){if(n.archived)return o(s);a(t)}))}))},COMPLETE_LOAD_ITEM:function t(a){var r=a.item,o=a.data;var s=o.success,l=o.source;var u=e("GET_ITEM_INSERT_LOCATION");if(rt(u)&&l){pe(n,u)}i("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.origin===Ht.INPUT?null:l});s(Nt(r));if(r.origin===Ht.LOCAL){i("DID_LOAD_LOCAL_ITEM",{id:r.id});return}if(r.origin===Ht.LIMBO){i("DID_COMPLETE_ITEM_PROCESSING",{id:r.id,error:null,serverFileReference:l});i("DID_DEFINE_VALUE",{id:r.id,value:r.serverId||l});return}if(e("IS_ASYNC")&&n.options.instantUpload){i("REQUEST_ITEM_PROCESSING",{query:r.id})}},RETRY_ITEM_LOAD:ve(n,(function(t){t.retryLoad()})),REQUEST_ITEM_PREPARE:ve(n,(function(t,e,n){i("REQUEST_PREPARE_OUTPUT",{query:t.id,item:t,success:function n(a){i("DID_PREPARE_OUTPUT",{id:t.id,file:a});e({file:t,output:a})},failure:n},true)})),REQUEST_ITEM_PROCESSING:ve(n,(function(t,a,r){var o=t.status===jt.IDLE||t.status===jt.PROCESSING_ERROR;if(!o){var s=function e(){return i("REQUEST_ITEM_PROCESSING",{query:t,success:a,failure:r})};var l=function t(){return document.hidden?s():setTimeout(s,32)};if(t.status===jt.PROCESSING_COMPLETE||t.status===jt.PROCESSING_REVERT_ERROR){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(l).catch((function(){}))}else if(t.status===jt.PROCESSING){t.abortProcessing().then(l)}return}if(t.status===jt.PROCESSING_QUEUED)return;t.requestProcessing();i("DID_REQUEST_ITEM_PROCESSING",{id:t.id});i("PROCESS_ITEM",{query:t,success:a,failure:r},true)})),PROCESS_ITEM:ve(n,(function(t,a,r){var o=e("GET_MAX_PARALLEL_UPLOADS");var s=e("GET_ITEMS_BY_STATUS",jt.PROCESSING).length;if(s===o){n.processingQueue.push({id:t.id,success:a,failure:r});return}if(t.status===jt.PROCESSING)return;var l=function t(){var e=n.processingQueue.shift();if(!e)return;var a=e.id,r=e.success,o=e.failure;var s=ii(n.items,a);if(!s||s.archived){t();return}i("PROCESS_ITEM",{query:a,success:r,failure:o},true)};t.onOnce("process-complete",(function(){a(Nt(t));l();var r=n.options.server;var o=n.options.instantUpload;if(o&&t.origin===Ht.LOCAL&&rt(r.remove)){var s=function t(){};t.origin=Ht.LIMBO;n.options.server.remove(t.source,s,s)}var u=e("GET_ITEMS_BY_STATUS",jt.PROCESSING_COMPLETE).length===n.items.length;if(u){i("DID_COMPLETE_ITEM_PROCESSING_ALL")}}));t.onOnce("process-error",(function(i){r({error:i,file:Nt(t)});l()}));var u=n.options;t.process(Ji(Xi(u.server.url,u.server.process,u.name,{chunkTransferId:t.transferId,chunkServer:u.server.patch,chunkUploads:u.chunkUploads,chunkForce:u.chunkForce,chunkSize:u.chunkSize,chunkRetryDelays:u.chunkRetryDelays}),{allowMinimumUploadDuration:e("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(n,a,r){Zt("PREPARE_OUTPUT",n,{query:e,item:t}).then((function(e){i("DID_PREPARE_OUTPUT",{id:t.id,file:e});a(e)})).catch(r)}))})),RETRY_ITEM_PROCESSING:ve(n,(function(t){i("REQUEST_ITEM_PROCESSING",{query:t})})),REQUEST_REMOVE_ITEM:ve(n,(function(t){he(e("GET_BEFORE_REMOVE_FILE"),Nt(t)).then((function(e){if(!e){return}i("REMOVE_ITEM",{query:t})}))})),RELEASE_ITEM:ve(n,(function(t){t.release()})),REMOVE_ITEM:ve(n,(function(t,a,r,o){var s=function e(){var r=t.id;oe(n.items,r).archive();i("DID_REMOVE_ITEM",{error:null,id:r,item:t});de(i,n);a(Nt(t))};var l=n.options.server;if(t.origin===Ht.LOCAL&&l&&rt(l.remove)&&o.remove!==false){i("DID_START_ITEM_REMOVE",{id:t.id});l.remove(t.source,(function(){return s()}),(function(e){i("DID_THROW_ITEM_REMOVE_ERROR",{id:t.id,error:ji("error",0,e,null),status:{main:ce(n.options.labelFileRemoveError)(e),sub:n.options.labelTapToRetry}})}))}else{if(o.revert&&t.origin!==Ht.LOCAL&&t.serverId!==null||n.options.chunkUploads&&t.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT"))}s()}})),ABORT_ITEM_LOAD:ve(n,(function(t){t.abortLoad()})),ABORT_ITEM_PROCESSING:ve(n,(function(t){if(t.serverId){i("REVERT_ITEM_PROCESSING",{id:t.id});return}t.abortProcessing().then((function(){var e=n.options.instantUpload;if(e){i("REMOVE_ITEM",{query:t.id})}}))})),REQUEST_REVERT_ITEM_PROCESSING:ve(n,(function(t){if(!n.options.instantUpload){i("REVERT_ITEM_PROCESSING",{query:t});return}var a=function e(n){if(!n)return;i("REVERT_ITEM_PROCESSING",{query:t})};var r=e("GET_BEFORE_REMOVE_FILE");if(!r){return a(true)}var o=r(Nt(t));if(o==null){return a(true)}if(typeof o==="boolean"){return a(o)}if(typeof o.then==="function"){o.then(a)}})),REVERT_ITEM_PROCESSING:ve(n,(function(t){t.revert(Qi(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then((function(){var e=n.options.instantUpload||fe(t);if(e){i("REMOVE_ITEM",{query:t.id})}})).catch((function(){}))})),SET_OPTIONS:function t(e){var n=e.options;var a=Object.keys(n);var r=_e.filter((function(t){return a.includes(t)}));var o=[].concat(Dt(r),Dt(Object.keys(n).filter((function(t){return!r.includes(t)}))));o.forEach((function(t){i("SET_"+yt(t,"_").toUpperCase(),{value:n[t]})}))}}};var _e=["server"];var me=function t(i){return i};var be=function t(i){return document.createElement(i)};var we=function t(i,e){var n=i.childNodes[0];if(!n){n=document.createTextNode(e);i.appendChild(n)}else if(e!==n.nodeValue){n.nodeValue=e}};var xe=function t(i,e,n,a){var r=(a%360-90)*Math.PI/180;return{x:i+n*Math.cos(r),y:e+n*Math.sin(r)}};var ye=function t(i,e,n,a,r,o){var s=xe(i,e,n,r);var l=xe(i,e,n,a);return["M",s.x,s.y,"A",n,n,0,o,0,l.x,l.y].join(" ")};var ke=function t(i,e,n,a,r){var o=1;if(r>a&&r-a<=.5){o=0}if(a>r&&a-r>=.5){o=0}return ye(i,e,n,Math.min(.9999,a)*360,Math.min(.9999,r)*360,o)};var Ee=function t(i){var e=i.root,n=i.props;n.spin=false;n.progress=0;n.opacity=0;var a=c("svg");e.ref.path=c("path",{"stroke-width":2,"stroke-linecap":"round"});a.appendChild(e.ref.path);e.ref.svg=a;e.appendChild(a)};var Ie=function t(i){var e=i.root,n=i.props;if(n.opacity===0){return}if(n.align){e.element.dataset.align=n.align}var a=parseInt(o(e.ref.path,"stroke-width"),10);var r=e.rect.element.width*.5;var s=0;var l=0;if(n.spin){s=0;l=.5}else{s=0;l=n.progress}var u=ke(r,r,r-a,s,l);o(e.ref.path,"d",u);o(e.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)};var Te=j({tag:"div",name:"progress-indicator",ignoreRectUpdate:true,ignoreRect:true,create:Ee,write:Ie,mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}});var Ae=function t(i){var e=i.root,n=i.props;e.element.innerHTML=(n.icon||"")+("<span>"+n.label+"</span>");n.isDisabled=false};var Se=function t(i){var e=i.root,n=i.props;var a=n.isDisabled;var r=e.query("GET_DISABLED")||n.opacity===0;if(r&&!a){n.isDisabled=true;o(e.element,"disabled","disabled")}else if(!r&&a){n.isDisabled=false;e.element.removeAttribute("disabled")}};var Me=j({tag:"button",attributes:{type:"button"},ignoreRect:true,ignoreRectUpdate:true,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:true},create:Ae,write:Se});var De=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:".";var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e3;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var r=a.labelBytes,o=r===void 0?"bytes":r,s=a.labelKilobytes,l=s===void 0?"KB":s,u=a.labelMegabytes,c=u===void 0?"MB":u,f=a.labelGigabytes,d=f===void 0?"GB":f;i=Math.round(Math.abs(i));var h=n;var p=n*n;var v=n*n*n;if(i<h){return i+" "+o}if(i<p){return Math.floor(i/h)+" "+l}if(i<v){return Pe(i/p,1,e)+" "+c}return Pe(i/v,2,e)+" "+d};var Pe=function t(i,e,n){return i.toFixed(e).split(".").filter((function(t){return t!=="0"})).join(n)};var Oe=function t(i){var e=i.root,n=i.props;var a=be("span");a.className="filepond--file-info-main";o(a,"aria-hidden","true");e.appendChild(a);e.ref.fileName=a;var r=be("span");r.className="filepond--file-info-sub";e.appendChild(r);e.ref.fileSize=r;we(r,e.query("GET_LABEL_FILE_WAITING_FOR_SIZE"));we(a,me(e.query("GET_ITEM_NAME",n.id)))};var Re=function t(i){var e=i.root,n=i.props;we(e.ref.fileSize,De(e.query("GET_ITEM_SIZE",n.id),".",e.query("GET_FILE_SIZE_BASE"),e.query("GET_FILE_SIZE_LABELS",e.query)));we(e.ref.fileName,me(e.query("GET_ITEM_NAME",n.id)))};var Ce=function t(i){var e=i.root,n=i.props;if(nt(e.query("GET_ITEM_SIZE",n.id))){Re({root:e,props:n});return}we(e.ref.fileSize,e.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))};var Le=j({name:"file-info",ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:Re,DID_UPDATE_ITEM_META:Re,DID_THROW_ITEM_LOAD_ERROR:Ce,DID_THROW_ITEM_INVALID:Ce}),didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},create:Oe,mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}});var ze=function t(i){return Math.round(i*100)};var Ge=function t(i){var e=i.root;var n=be("span");n.className="filepond--file-status-main";e.appendChild(n);e.ref.main=n;var a=be("span");a.className="filepond--file-status-sub";e.appendChild(a);e.ref.sub=a;Fe({root:e,action:{progress:null}})};var Fe=function t(i){var e=i.root,n=i.action;var a=n.progress===null?e.query("GET_LABEL_FILE_LOADING"):e.query("GET_LABEL_FILE_LOADING")+" "+ze(n.progress)+"%";we(e.ref.main,a);we(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))};var Ne=function t(i){var e=i.root,n=i.action;var a=n.progress===null?e.query("GET_LABEL_FILE_PROCESSING"):e.query("GET_LABEL_FILE_PROCESSING")+" "+ze(n.progress)+"%";we(e.ref.main,a);we(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))};var Be=function t(i){var e=i.root;we(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING"));we(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))};var je=function t(i){var e=i.root;we(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_ABORTED"));we(e.ref.sub,e.query("GET_LABEL_TAP_TO_RETRY"))};var He=function t(i){var e=i.root;we(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_COMPLETE"));we(e.ref.sub,e.query("GET_LABEL_TAP_TO_UNDO"))};var Ue=function t(i){var e=i.root;we(e.ref.main,"");we(e.ref.sub,"")};var Ve=function t(i){var e=i.root,n=i.action;we(e.ref.main,n.status.main);we(e.ref.sub,n.status.sub)};var qe=j({name:"file-status",ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:Ue,DID_REVERT_ITEM_PROCESSING:Ue,DID_REQUEST_ITEM_PROCESSING:Be,DID_ABORT_ITEM_PROCESSING:je,DID_COMPLETE_ITEM_PROCESSING:He,DID_UPDATE_ITEM_PROCESS_PROGRESS:Ne,DID_UPDATE_ITEM_LOAD_PROGRESS:Fe,DID_THROW_ITEM_LOAD_ERROR:Ve,DID_THROW_ITEM_INVALID:Ve,DID_THROW_ITEM_PROCESSING_ERROR:Ve,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Ve,DID_THROW_ITEM_REMOVE_ERROR:Ve}),didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},create:Ge,mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}});var We={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}};var Ye=[];a(We,(function(t){Ye.push(t)}));var Ze=function t(i){if(tn(i)==="right")return 0;var e=i.ref.buttonRemoveItem.rect.element;return e.hidden?null:e.width+e.left};var Xe=function t(i){var e=i.ref.buttonAbortItemLoad.rect.element;return e.width};var Qe=function t(i){return Math.floor(i.ref.buttonRemoveItem.rect.element.height/4)};var $e=function t(i){return Math.floor(i.ref.buttonRemoveItem.rect.element.left/2)};var Ke=function t(i){return i.query("GET_STYLE_LOAD_INDICATOR_POSITION")};var Je=function t(i){return i.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")};var tn=function t(i){return i.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")};var en={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:Ke},processProgressIndicator:{opacity:0,align:Je},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}};var nn={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Ze},status:{translateX:Ze}};var an={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}};var rn={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{translateX:Ze,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:tn},info:{translateX:Ze},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:tn},buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{opacity:1,translateX:Ze}},DID_LOAD_ITEM:nn,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:Ze},status:{translateX:Ze}},DID_START_ITEM_PROCESSING:an,DID_REQUEST_ITEM_PROCESSING:an,DID_UPDATE_ITEM_PROCESS_PROGRESS:an,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:Ze}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Ze},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:nn};var on=j({create:function t(i){var e=i.root;e.element.innerHTML=e.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:true,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}});var sn=function t(i){var e=i.root,n=i.props;var r=Object.keys(We).reduce((function(t,i){t[i]=Object.assign({},We[i]);return t}),{});var o=n.id;var s=e.query("GET_ALLOW_REVERT");var l=e.query("GET_ALLOW_REMOVE");var u=e.query("GET_ALLOW_PROCESS");var c=e.query("GET_INSTANT_UPLOAD");var f=e.query("IS_ASYNC");var d=e.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");var h;if(f){if(u&&!s){h=function t(i){return!/RevertItemProcessing/.test(i)}}else if(!u&&s){h=function t(i){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(i)}}else if(!u&&!s){h=function t(i){return!/Process/.test(i)}}}else{h=function t(i){return!/Process/.test(i)}}var p=h?Ye.filter(h):Ye.concat();if(c&&s){r["RevertItemProcessing"].label="GET_LABEL_BUTTON_REMOVE_ITEM";r["RevertItemProcessing"].icon="GET_ICON_REMOVE"}if(f&&!s){var v=rn["DID_COMPLETE_ITEM_PROCESSING"];v.info.translateX=$e;v.info.translateY=Qe;v.status.translateY=Qe;v.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(f&&!u){["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(t){rn[t].status.translateY=Qe}));rn["DID_THROW_ITEM_PROCESSING_ERROR"].status.translateX=Xe}if(d&&s){r["RevertItemProcessing"].align="BUTTON_REMOVE_ITEM_POSITION";var g=rn["DID_COMPLETE_ITEM_PROCESSING"];g.info.translateX=Ze;g.status.translateY=Qe;g.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(!l){r["RemoveItem"].disabled=true}a(r,(function(t,i){var n=e.createChildView(Me,{label:e.query(i.label),icon:e.query(i.icon),opacity:0});if(p.includes(t)){e.appendChildView(n)}if(i.disabled){n.element.setAttribute("disabled","disabled");n.element.setAttribute("hidden","hidden")}n.element.dataset.align=e.query("GET_STYLE_"+i.align);n.element.classList.add(i.className);n.on("click",(function(t){t.stopPropagation();if(i.disabled)return;e.dispatch(i.action,{query:o})}));e.ref["button"+t]=n}));e.ref.processingCompleteIndicator=e.appendChildView(e.createChildView(on));e.ref.processingCompleteIndicator.element.dataset.align=e.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION");e.ref.info=e.appendChildView(e.createChildView(Le,{id:o}));e.ref.status=e.appendChildView(e.createChildView(qe,{id:o}));var _=e.appendChildView(e.createChildView(Te,{opacity:0,align:e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));_.element.classList.add("filepond--load-indicator");e.ref.loadProgressIndicator=_;var m=e.appendChildView(e.createChildView(Te,{opacity:0,align:e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));m.element.classList.add("filepond--process-indicator");e.ref.processProgressIndicator=m;e.ref.activeStyles=[]};var ln=function t(i){var e=i.root,n=i.actions,r=i.props;un({root:e,actions:n,props:r});var o=n.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return rn[t.type]}));if(o){e.ref.activeStyles=[];var s=rn[o.type];a(en,(function(t,i){var n=e.ref[t];a(i,(function(i,a){var r=s[t]&&typeof s[t][i]!=="undefined"?s[t][i]:a;e.ref.activeStyles.push({control:n,key:i,value:r})}))}))}e.ref.activeStyles.forEach((function(t){var i=t.control,n=t.key,a=t.value;i[n]=typeof a==="function"?a(e):a}))};var un=U({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function t(i){var e=i.root,n=i.action;e.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function t(i){var e=i.root,n=i.action;e.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function t(i){var e=i.root,n=i.action;e.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function t(i){var e=i.root;e.ref.processProgressIndicator.spin=true;e.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function t(i){var e=i.root;e.ref.loadProgressIndicator.spin=true;e.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function t(i){var e=i.root;e.ref.processProgressIndicator.spin=true;e.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function t(i){var e=i.root,n=i.action;e.ref.loadProgressIndicator.spin=false;e.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function t(i){var e=i.root,n=i.action;e.ref.processProgressIndicator.spin=false;e.ref.processProgressIndicator.progress=n.progress}});var cn=j({create:sn,write:ln,didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},name:"file"});var fn=function t(i){var e=i.root,n=i.props;e.ref.fileName=be("legend");e.appendChild(e.ref.fileName);e.ref.file=e.appendChildView(e.createChildView(cn,{id:n.id}));e.ref.data=false};var dn=function t(i){var e=i.root,n=i.props;we(e.ref.fileName,me(e.query("GET_ITEM_NAME",n.id)))};var hn=j({create:fn,ignoreRect:true,write:U({DID_LOAD_ITEM:dn}),didCreateView:function t(i){Xt("CREATE_VIEW",Object.assign({},i,{view:i}))},tag:"fieldset",name:"file-wrapper"});var pn={type:"spring",damping:.6,mass:7};var vn=function t(i){var e=i.root,n=i.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:pn},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:pn},styles:["translateY"]}}].forEach((function(t){gn(e,t,n.name)}));e.element.classList.add("filepond--"+n.name);e.ref.scalable=null};var gn=function t(i,e,n){var a=j({name:"panel-"+e.name+" filepond--"+n,mixins:e.mixins,ignoreRectUpdate:true});var r=i.createChildView(a,e.props);i.ref[e.name]=i.appendChildView(r)};var _n=function t(i){var e=i.root,n=i.props;if(e.ref.scalable===null||n.scalable!==e.ref.scalable){e.ref.scalable=$(n.scalable)?n.scalable:true;e.element.dataset.scalable=e.ref.scalable}if(!n.height)return;var a=e.ref.top.rect.element;var r=e.ref.bottom.rect.element;var o=Math.max(a.height+r.height,n.height);e.ref.center.translateY=a.height;e.ref.center.scaleY=(o-a.height-r.height)/100;e.ref.bottom.translateY=o-r.height};var mn=j({name:"panel",read:function t(i){var e=i.root,n=i.props;return n.heightCurrent=e.ref.bottom.translateY},write:_n,create:vn,ignoreRect:true,mixins:{apis:["height","heightCurrent","scalable"]}});var bn=function t(i){var e=i.map((function(t){return t.id}));var n=undefined;return{setIndex:function t(i){n=i},getIndex:function t(){return n},getItemIndex:function t(i){return e.indexOf(i.id)}}};var wn={type:"spring",stiffness:.75,damping:.45,mass:10};var xn="spring";var yn={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"};var kn=function t(i){var e=i.root,n=i.props;e.ref.handleClick=function(t){return e.dispatch("DID_ACTIVATE_ITEM",{id:n.id})};e.element.id="filepond--item-"+n.id;e.element.addEventListener("click",e.ref.handleClick);e.ref.container=e.appendChildView(e.createChildView(hn,{id:n.id}));e.ref.panel=e.appendChildView(e.createChildView(mn,{name:"item-panel"}));e.ref.panel.height=null;n.markedForRemoval=false;if(!e.query("GET_ALLOW_REORDER"))return;e.element.dataset.dragState="idle";var a=function t(i){if(!i.isPrimary)return;var a=false;var r={x:i.pageX,y:i.pageY};n.dragOrigin={x:e.translateX,y:e.translateY};n.dragCenter={x:i.offsetX,y:i.offsetY};var o=bn(e.query("GET_ACTIVE_ITEMS"));e.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:o});var s=function t(i){if(!i.isPrimary)return;i.stopPropagation();i.preventDefault();n.dragOffset={x:i.pageX-r.x,y:i.pageY-r.y};var s=n.dragOffset.x*n.dragOffset.x+n.dragOffset.y*n.dragOffset.y;if(s>16&&!a){a=true;e.element.removeEventListener("click",e.ref.handleClick)}e.dispatch("DID_DRAG_ITEM",{id:n.id,dragState:o})};var l=function t(i){if(!i.isPrimary)return;n.dragOffset={x:i.pageX-r.x,y:i.pageY-r.y};c()};var u=function t(){c()};var c=function t(){document.removeEventListener("pointercancel",u);document.removeEventListener("pointermove",s);document.removeEventListener("pointerup",l);e.dispatch("DID_DROP_ITEM",{id:n.id,dragState:o});if(a){setTimeout((function(){return e.element.addEventListener("click",e.ref.handleClick)}),0)}};document.addEventListener("pointercancel",u);document.addEventListener("pointermove",s);document.addEventListener("pointerup",l)};e.element.addEventListener("pointerdown",a)};var En=U({DID_UPDATE_PANEL_HEIGHT:function t(i){var e=i.root,n=i.action;e.height=n.height}});var In=U({DID_GRAB_ITEM:function t(i){var e=i.root,n=i.props;n.dragOrigin={x:e.translateX,y:e.translateY}},DID_DRAG_ITEM:function t(i){var e=i.root;e.element.dataset.dragState="drag"},DID_DROP_ITEM:function t(i){var e=i.root,n=i.props;n.dragOffset=null;n.dragOrigin=null;e.element.dataset.dragState="drop"}},(function(t){var i=t.root,e=t.actions,n=t.props,a=t.shouldOptimize;if(i.element.dataset.dragState==="drop"){if(i.scaleX<=1){i.element.dataset.dragState="idle"}}var r=e.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return yn[t.type]}));if(r&&r.type!==n.currentState){n.currentState=r.type;i.element.dataset.filepondItemState=yn[n.currentState]||""}var o=i.query("GET_ITEM_PANEL_ASPECT_RATIO")||i.query("GET_PANEL_ASPECT_RATIO");if(!o){En({root:i,actions:e,props:n});if(!i.height&&i.ref.container.rect.element.height>0){i.height=i.ref.container.rect.element.height}}else if(!a){i.height=i.rect.element.width*o}if(a){i.ref.panel.height=null}i.ref.panel.height=i.height}));var Tn=j({create:kn,write:In,destroy:function t(i){var e=i.root,n=i.props;e.element.removeEventListener("click",e.ref.handleClick);e.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:xn,scaleY:xn,translateX:wn,translateY:wn,opacity:{type:"tween",duration:150}}}});var An=function(t,i){return Math.max(1,Math.floor((t+1)/i))};var Sn=function t(i,e,n){if(!n)return;var a=i.rect.element.width;var r=e.length;var o=null;if(r===0||n.top<e[0].rect.element.top)return-1;var s=e[0];var l=s.rect.element;var u=l.marginLeft+l.marginRight;var c=l.width+u;var f=An(a,c);if(f===1){for(var d=0;d<r;d++){var h=e[d];var p=h.rect.outer.top+h.rect.element.height*.5;if(n.top<p){return d}}return r}var v=l.marginTop+l.marginBottom;var g=l.height+v;for(var _=0;_<r;_++){var m=_%f;var b=Math.floor(_/f);var w=m*c;var x=b*g;var y=x-l.marginTop;var k=w+c;var E=x+g+l.marginBottom;if(n.top<E&&n.top>y){if(n.left<k){return _}else if(_!==r-1){o=_}else{o=null}}}if(o!==null){return o}return r};var Mn={height:0,width:0,get getHeight(){return this.height},set setHeight(t){if(this.height===0||t===0)this.height=t},get getWidth(){return this.width},set setWidth(t){if(this.width===0||t===0)this.width=t}};var Dn=function t(i){var e=i.root;o(e.element,"role","list");e.ref.lastItemSpanwDate=Date.now()};var Pn=function t(i){var e=i.root,n=i.action;var a=n.id,r=n.index,o=n.interactionMethod;e.ref.addIndex=r;var s=Date.now();var l=s;var u=1;if(o!==Tt.NONE){u=0;var c=e.query("GET_ITEM_INSERT_INTERVAL");var f=s-e.ref.lastItemSpanwDate;l=f<c?s+(c-f):s}e.ref.lastItemSpanwDate=l;e.appendChildView(e.createChildView(Tn,{spawnDate:l,id:a,opacity:u,interactionMethod:o}),r)};var On=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;if(i.dragOffset){i.translateX=null;i.translateY=null;i.translateX=i.dragOrigin.x+i.dragOffset.x;i.translateY=i.dragOrigin.y+i.dragOffset.y;i.scaleX=1.025;i.scaleY=1.025}else{i.translateX=e;i.translateY=n;if(Date.now()>i.spawnDate){if(i.opacity===0){Rn(i,e,n,a,r)}i.scaleX=1;i.scaleY=1;i.opacity=1}}};var Rn=function t(i,e,n,a,r){if(i.interactionMethod===Tt.NONE){i.translateX=null;i.translateX=e;i.translateY=null;i.translateY=n}else if(i.interactionMethod===Tt.DROP){i.translateX=null;i.translateX=e-a*20;i.translateY=null;i.translateY=n-r*10;i.scaleX=.8;i.scaleY=.8}else if(i.interactionMethod===Tt.BROWSE){i.translateY=null;i.translateY=n-30}else if(i.interactionMethod===Tt.API){i.translateX=null;i.translateX=e-30;i.translateY=null}};var Cn=function t(i){var e=i.root,n=i.action;var a=n.id;var r=e.childViews.find((function(t){return t.id===a}));if(!r){return}r.scaleX=.9;r.scaleY=.9;r.opacity=0;r.markedForRemoval=true};var Ln=function t(i){return i.rect.element.height+i.rect.element.marginBottom*.5+i.rect.element.marginTop*.5};var zn=function t(i){return i.rect.element.width+i.rect.element.marginLeft*.5+i.rect.element.marginRight*.5};var Gn=function t(i){var e=i.root,n=i.action;var a=n.id,r=n.dragState;var o=e.query("GET_ITEM",{id:a});var s=e.childViews.find((function(t){return t.id===a}));var l=e.childViews.length;var u=r.getItemIndex(o);if(!s)return;var c={x:s.dragOrigin.x+s.dragOffset.x+s.dragCenter.x,y:s.dragOrigin.y+s.dragOffset.y+s.dragCenter.y};var f=Ln(s);var d=zn(s);var h=Math.floor(e.rect.outer.width/d);if(h>l)h=l;var p=Math.floor(l/h+1);Mn.setHeight=f*p;Mn.setWidth=d*h;var v={y:Math.floor(c.y/f),x:Math.floor(c.x/d),getGridIndex:function t(){if(c.y>Mn.getHeight||c.y<0||c.x>Mn.getWidth||c.x<0)return u;return this.y*h+this.x},getColIndex:function t(){var i=e.query("GET_ACTIVE_ITEMS");var n=e.childViews.filter((function(t){return t.rect.element.height}));var a=i.map((function(t){return n.find((function(i){return i.id===t.id}))}));var r=a.findIndex((function(t){return t===s}));var o=Ln(s);var l=a.length;var u=l;var f=0;var d=0;var h=0;for(var p=0;p<l;p++){f=Ln(a[p]);h=d;d=h+f;if(c.y<d){if(r>p){if(c.y<h+o){u=p;break}continue}u=p;break}}return u}};var g=h>1?v.getGridIndex():v.getColIndex();e.dispatch("MOVE_ITEM",{query:s,index:g});var _=r.getIndex();if(_===undefined||_!==g){r.setIndex(g);if(_===undefined)return;e.dispatch("DID_REORDER_ITEMS",{items:e.query("GET_ACTIVE_ITEMS"),origin:u,target:g})}};var Fn=U({DID_ADD_ITEM:Pn,DID_REMOVE_ITEM:Cn,DID_DRAG_ITEM:Gn});var Nn=function t(i){var e=i.root,n=i.props,a=i.actions,r=i.shouldOptimize;Fn({root:e,props:n,actions:a});var o=n.dragCoordinates;var s=e.rect.element.width;var l=e.childViews.filter((function(t){return t.rect.element.height}));var u=e.query("GET_ACTIVE_ITEMS").map((function(t){return l.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));var c=o?Sn(e,u,o):null;var f=e.ref.addIndex||null;e.ref.addIndex=null;var d=0;var h=0;var p=0;if(u.length===0)return;var v=u[0].rect.element;var g=v.marginTop+v.marginBottom;var _=v.marginLeft+v.marginRight;var m=v.width+_;var b=v.height+g;var w=An(s,m);if(w===1){var x=0;var y=0;u.forEach((function(t,i){if(c){var e=i-c;if(e===-2){y=-g*.25}else if(e===-1){y=-g*.75}else if(e===0){y=g*.75}else if(e===1){y=g*.25}else{y=0}}if(r){t.translateX=null;t.translateY=null}if(!t.markedForRemoval){On(t,0,x+y)}var n=t.rect.element.height+g;var a=n*(t.markedForRemoval?t.opacity:1);x+=a}))}else{var k=0;var E=0;u.forEach((function(t,i){if(i===c){d=1}if(i===f){p+=1}if(t.markedForRemoval&&t.opacity<.5){h-=1}var e=i+p+d+h;var n=e%w;var a=Math.floor(e/w);var o=n*m;var s=a*b;var l=Math.sign(o-k);var u=Math.sign(s-E);k=o;E=s;if(t.markedForRemoval)return;if(r){t.translateX=null;t.translateY=null}On(t,o,s,l,u)}))}};var Bn=function t(i,e){return e.filter((function(t){if(t.data&&t.data.id){return i.id===t.data.id}return true}))};var jn=j({create:Dn,write:Nn,tag:"ul",name:"list",didWriteView:function t(i){var e=i.root;e.childViews.filter((function(t){return t.markedForRemoval&&t.opacity===0&&t.resting})).forEach((function(t){t._destroy();e.removeChildView(t)}))},filterFrameActionsForChild:Bn,mixins:{apis:["dragCoordinates"]}});var Hn=function t(i){var e=i.root,n=i.props;e.ref.list=e.appendChildView(e.createChildView(jn));n.dragCoordinates=null;n.overflowing=false};var Un=function t(i){var e=i.root,n=i.props,a=i.action;if(!e.query("GET_ITEM_INSERT_LOCATION_FREEDOM"))return;n.dragCoordinates={left:a.position.scopeLeft-e.ref.list.rect.element.left,top:a.position.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)}};var Vn=function t(i){var e=i.props;e.dragCoordinates=null};var qn=U({DID_DRAG:Un,DID_END_DRAG:Vn});var Wn=function t(i){var e=i.root,n=i.props,a=i.actions;qn({root:e,props:n,actions:a});e.ref.list.dragCoordinates=n.dragCoordinates;if(n.overflowing&&!n.overflow){n.overflowing=false;e.element.dataset.state="";e.height=null}if(n.overflow){var r=Math.round(n.overflow);if(r!==e.height){n.overflowing=true;e.element.dataset.state="overflow";e.height=r}}};var Yn=j({create:Hn,write:Wn,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}});var Zn=function t(i,e,n){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";if(n){o(i,e,a)}else{i.removeAttribute(e)}};var Xn=function t(i){if(!i||i.value===""){return}try{i.value=""}catch(t){}if(i.value){var e=be("form");var n=i.parentNode;var a=i.nextSibling;e.appendChild(i);e.reset();if(a){n.insertBefore(i,a)}else{n.appendChild(i)}}};var Qn=function t(i){var e=i.root,n=i.props;e.element.id="filepond--browser-"+n.id;o(e.element,"name",e.query("GET_NAME"));o(e.element,"aria-controls","filepond--assistant-"+n.id);o(e.element,"aria-labelledby","filepond--drop-label-"+n.id);$n({root:e,action:{value:e.query("GET_ACCEPTED_FILE_TYPES")}});Kn({root:e,action:{value:e.query("GET_ALLOW_MULTIPLE")}});Jn({root:e,action:{value:e.query("GET_ALLOW_DIRECTORIES_ONLY")}});ta({root:e});ia({root:e,action:{value:e.query("GET_REQUIRED")}});ea({root:e,action:{value:e.query("GET_CAPTURE_METHOD")}});e.ref.handleChange=function(t){if(!e.element.value){return}var i=Array.from(e.element.files).map((function(t){t._relativePath=t.webkitRelativePath;return t}));setTimeout((function(){n.onload(i);Xn(e.element)}),250)};e.element.addEventListener("change",e.ref.handleChange)};var $n=function t(i){var e=i.root,n=i.action;if(!e.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE"))return;Zn(e.element,"accept",!!n.value,n.value?n.value.join(","):"")};var Kn=function t(i){var e=i.root,n=i.action;Zn(e.element,"multiple",n.value)};var Jn=function t(i){var e=i.root,n=i.action;Zn(e.element,"webkitdirectory",n.value)};var ta=function t(i){var e=i.root;var n=e.query("GET_DISABLED");var a=e.query("GET_ALLOW_BROWSE");var r=n||!a;Zn(e.element,"disabled",r)};var ia=function t(i){var e=i.root,n=i.action;if(!n.value){Zn(e.element,"required",false)}else if(e.query("GET_TOTAL_ITEMS")===0){Zn(e.element,"required",true)}};var ea=function t(i){var e=i.root,n=i.action;Zn(e.element,"capture",!!n.value,n.value===true?"":n.value)};var na=function t(i){var e=i.root;var n=e.element;if(e.query("GET_TOTAL_ITEMS")>0){Zn(n,"required",false);Zn(n,"name",false);var a=e.query("GET_ACTIVE_ITEMS");var r=false;for(var o=0;o<a.length;o++){if(a[o].status===jt.LOAD_ERROR){r=true}}e.element.setCustomValidity(r?e.query("GET_LABEL_INVALID_FIELD"):"")}else{Zn(n,"name",true,e.query("GET_NAME"));var s=e.query("GET_CHECK_VALIDITY");if(s){n.setCustomValidity("")}if(e.query("GET_REQUIRED")){Zn(n,"required",true)}}};var aa=function t(i){var e=i.root;var n=e.query("GET_CHECK_VALIDITY");if(!n)return;e.element.setCustomValidity(e.query("GET_LABEL_INVALID_FIELD"))};var ra=j({tag:"input",name:"browser",ignoreRect:true,ignoreRectUpdate:true,attributes:{type:"file"},create:Qn,destroy:function t(i){var e=i.root;e.element.removeEventListener("change",e.ref.handleChange)},write:U({DID_LOAD_ITEM:na,DID_REMOVE_ITEM:na,DID_THROW_ITEM_INVALID:aa,DID_SET_DISABLED:ta,DID_SET_ALLOW_BROWSE:ta,DID_SET_ALLOW_DIRECTORIES_ONLY:Jn,DID_SET_ALLOW_MULTIPLE:Kn,DID_SET_ACCEPTED_FILE_TYPES:$n,DID_SET_CAPTURE_METHOD:ea,DID_SET_REQUIRED:ia})});var oa={ENTER:13,SPACE:32};var sa=function t(i){var e=i.root,n=i.props;var a=be("label");o(a,"for","filepond--browser-"+n.id);o(a,"id","filepond--drop-label-"+n.id);e.ref.handleKeyDown=function(t){var i=t.keyCode===oa.ENTER||t.keyCode===oa.SPACE;if(!i)return;t.preventDefault();e.ref.label.click()};e.ref.handleClick=function(t){var i=t.target===a||a.contains(t.target);if(i)return;e.ref.label.click()};a.addEventListener("keydown",e.ref.handleKeyDown);e.element.addEventListener("click",e.ref.handleClick);la(a,n.caption);e.appendChild(a);e.ref.label=a};var la=function t(i,e){i.innerHTML=e;var n=i.querySelector(".filepond--label-action");if(n){o(n,"tabindex","0")}return e};var ua=j({name:"drop-label",ignoreRect:true,create:sa,destroy:function t(i){var e=i.root;e.ref.label.addEventListener("keydown",e.ref.handleKeyDown);e.element.removeEventListener("click",e.ref.handleClick)},write:U({DID_SET_LABEL_IDLE:function t(i){var e=i.root,n=i.action;la(e.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}});var ca=j({name:"drip-blob",ignoreRect:true,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}});var fa=function t(i){var e=i.root;var n=e.rect.element.width*.5;var a=e.rect.element.height*.5;e.ref.blob=e.appendChildView(e.createChildView(ca,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:a}))};var da=function t(i){var e=i.root,n=i.action;if(!e.ref.blob){fa({root:e});return}e.ref.blob.translateX=n.position.scopeLeft;e.ref.blob.translateY=n.position.scopeTop;e.ref.blob.scaleX=1;e.ref.blob.scaleY=1;e.ref.blob.opacity=1};var ha=function t(i){var e=i.root;if(!e.ref.blob){return}e.ref.blob.opacity=0};var pa=function t(i){var e=i.root;if(!e.ref.blob){return}e.ref.blob.scaleX=2.5;e.ref.blob.scaleY=2.5;e.ref.blob.opacity=0};var va=function t(i){var e=i.root,n=i.props,a=i.actions;ga({root:e,props:n,actions:a});var r=e.ref.blob;if(a.length===0&&r&&r.opacity===0){e.removeChildView(r);e.ref.blob=null}};var ga=U({DID_DRAG:da,DID_DROP:pa,DID_END_DRAG:ha});var _a=j({ignoreRect:true,ignoreRectUpdate:true,name:"drip",write:va});var ma=function t(i,e){try{var n=new DataTransfer;e.forEach((function(t){if(t instanceof File){n.items.add(t)}else{n.items.add(new File([t],t.name,{type:t.type}))}}));i.files=n.files}catch(t){return false}return true};var ba=function t(i){var e=i.root;e.ref.fields={};var n=document.createElement("legend");n.textContent="Files";e.element.appendChild(n)};var wa=function t(i,e){return i.ref.fields[e]};var xa=function t(i){i.query("GET_ACTIVE_ITEMS").forEach((function(t){if(!i.ref.fields[t.id])return;i.element.appendChild(i.ref.fields[t.id])}))};var ya=function t(i){var e=i.root;return xa(e)};var ka=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.origin===Ht.LOCAL;var o=!r&&e.query("SHOULD_UPDATE_FILE_INPUT");var s=be("input");s.type=o?"file":"hidden";s.name=e.query("GET_NAME");e.ref.fields[n.id]=s;xa(e)};var Ea=function t(i){var e=i.root,n=i.action;var a=wa(e,n.id);if(!a)return;if(n.serverFileReference!==null)a.value=n.serverFileReference;if(!e.query("SHOULD_UPDATE_FILE_INPUT"))return;var r=e.query("GET_ITEM",n.id);ma(a,[r.file])};var Ia=function t(i){var e=i.root,n=i.action;if(!e.query("SHOULD_UPDATE_FILE_INPUT"))return;setTimeout((function(){var t=wa(e,n.id);if(!t)return;ma(t,[n.file])}),0)};var Ta=function t(i){var e=i.root;e.element.disabled=e.query("GET_DISABLED")};var Aa=function t(i){var e=i.root,n=i.action;var a=wa(e,n.id);if(!a)return;if(a.parentNode)a.parentNode.removeChild(a);delete e.ref.fields[n.id]};var Sa=function t(i){var e=i.root,n=i.action;var a=wa(e,n.id);if(!a)return;if(n.value===null){a.removeAttribute("value")}else{if(a.type!="file"){a.value=n.value}}xa(e)};var Ma=U({DID_SET_DISABLED:Ta,DID_ADD_ITEM:ka,DID_LOAD_ITEM:Ea,DID_REMOVE_ITEM:Aa,DID_DEFINE_VALUE:Sa,DID_PREPARE_OUTPUT:Ia,DID_REORDER_ITEMS:ya,DID_SORT_ITEMS:ya});var Da=j({tag:"fieldset",name:"data",create:ba,write:Ma,ignoreRect:true});var Pa=function t(i){return"getRootNode"in i?i.getRootNode():document};var Oa=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"];var Ra=["css","csv","html","txt"];var Ca={zip:"zip|compressed",epub:"application/epub+zip"};var La=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";i=i.toLowerCase();if(Oa.includes(i)){return"image/"+(i==="jpg"?"jpeg":i==="svg"?"svg+xml":i)}if(Ra.includes(i)){return"text/"+i}return Ca[i]||""};var za=function t(i){return new Promise((function(t,e){var n=Wa(i);if(n.length&&!Ga(i)){return t(n)}Fa(i).then(t)}))};var Ga=function t(i){if(i.files)return i.files.length>0;return false};var Fa=function t(i){return new Promise((function(t,e){var n=(i.items?Array.from(i.items):[]).filter((function(t){return Na(t)})).map((function(t){return Ba(t)}));if(!n.length){t(i.files?Array.from(i.files):[]);return}Promise.all(n).then((function(i){var e=[];i.forEach((function(t){e.push.apply(e,t)}));t(e.filter((function(t){return t})).map((function(t){if(!t._relativePath)t._relativePath=t.webkitRelativePath;return t})))})).catch(console.error)}))};var Na=function t(i){if(Va(i)){var e=qa(i);if(e){return e.isFile||e.isDirectory}}return i.kind==="file"};var Ba=function t(i){return new Promise((function(t,e){if(Ua(i)){ja(qa(i)).then(t).catch(e);return}t([i.getAsFile()])}))};var ja=function t(i){return new Promise((function(t,e){var n=[];var a=0;var r=0;var o=function i(){if(r===0&&a===0){t(n)}};var s=function t(i){a++;var s=i.createReader();var l=function i(){s.readEntries((function(e){if(e.length===0){a--;o();return}e.forEach((function(i){if(i.isDirectory){t(i)}else{r++;i.file((function(t){var e=Ha(t);if(i.fullPath)e._relativePath=i.fullPath;n.push(e);r--;o()}))}}));i()}),e)};l()};s(i)}))};var Ha=function t(i){if(i.type.length)return i;var e=i.lastModifiedDate;var n=i.name;var a=La(xi(i.name));if(!a.length)return i;i=i.slice(0,i.size,a);i.name=n;i.lastModifiedDate=e;return i};var Ua=function t(i){return Va(i)&&(qa(i)||{}).isDirectory};var Va=function t(i){return"webkitGetAsEntry"in i};var qa=function t(i){return i.webkitGetAsEntry()};var Wa=function t(i){var e=[];try{e=Za(i);if(e.length){return e}e=Ya(i)}catch(t){}return e};var Ya=function t(i){var e=i.getData("url");if(typeof e==="string"&&e.length){return[e]}return[]};var Za=function t(i){var e=i.getData("text/html");if(typeof e==="string"&&e.length){var n=e.match(/src\s*=\s*"(.+?)"/);if(n){return[n[1]]}}return[]};var Xa=[];var Qa=function t(i){return{pageLeft:i.pageX,pageTop:i.pageY,scopeLeft:i.offsetX||i.layerX,scopeTop:i.offsetY||i.layerY}};var $a=function t(i,e,n){var a=Ka(e);var r={element:i,filterElement:n,state:null,ondrop:function t(){},onenter:function t(){},ondrag:function t(){},onexit:function t(){},onload:function t(){},allowdrop:function t(){}};r.destroy=a.addListener(r);return r};var Ka=function t(i){var e=Xa.find((function(t){return t.element===i}));if(e){return e}var n=Ja(i);Xa.push(n);return n};var Ja=function t(i){var e=[];var n={dragenter:ar,dragover:rr,dragleave:sr,drop:or};var r={};a(n,(function(t,n){r[t]=n(i,e);i.addEventListener(t,r[t],false)}));var o={element:i,addListener:function t(s){e.push(s);return function(){e.splice(e.indexOf(s),1);if(e.length===0){Xa.splice(Xa.indexOf(o),1);a(n,(function(t){i.removeEventListener(t,r[t],false)}))}}}};return o};var tr=function t(i,e){if(!("elementFromPoint"in i)){i=document}return i.elementFromPoint(e.x,e.y)};var ir=function t(i,e){var n=Pa(e);var a=tr(n,{x:i.pageX-window.pageXOffset,y:i.pageY-window.pageYOffset});return a===e||e.contains(a)};var er=null;var nr=function t(i,e){try{i.dropEffect=e}catch(t){}};var ar=function t(i,e){return function(t){t.preventDefault();er=t.target;e.forEach((function(i){var e=i.element,n=i.onenter;if(ir(t,e)){i.state="enter";n(Qa(t))}}))}};var rr=function t(i,e){return function(t){t.preventDefault();var i=t.dataTransfer;za(i).then((function(n){var a=false;e.some((function(e){var r=e.filterElement,o=e.element,s=e.onenter,l=e.onexit,u=e.ondrag,c=e.allowdrop;nr(i,"copy");var f=c(n);if(!f){nr(i,"none");return}if(ir(t,o)){a=true;if(e.state===null){e.state="enter";s(Qa(t));return}e.state="over";if(r&&!f){nr(i,"none");return}u(Qa(t))}else{if(r&&!a){nr(i,"none")}if(e.state){e.state=null;l(Qa(t))}}}))}))}};var or=function t(i,e){return function(t){t.preventDefault();var i=t.dataTransfer;za(i).then((function(i){e.forEach((function(e){var n=e.filterElement,a=e.element,r=e.ondrop,o=e.onexit,s=e.allowdrop;e.state=null;if(n&&!ir(t,a))return;if(!s(i))return o(Qa(t));r(Qa(t),i)}))}))}};var sr=function t(i,e){return function(t){if(er!==t.target){return}e.forEach((function(i){var e=i.onexit;i.state=null;e(Qa(t))}))}};var lr=function t(i,e,n){i.classList.add("filepond--hopper");var a=n.catchesDropsOnPage,r=n.requiresDropOnElement,o=n.filterItems,s=o===void 0?function(t){return t}:o;var l=$a(i,a?document.documentElement:i,r);var u="";var c="";l.allowdrop=function(t){return e(s(t))};l.ondrop=function(t,i){var n=s(i);if(!e(n)){f.ondragend(t);return}c="drag-drop";f.onload(n,t)};l.ondrag=function(t){f.ondrag(t)};l.onenter=function(t){c="drag-over";f.ondragstart(t)};l.onexit=function(t){c="drag-exit";f.ondragend(t)};var f={updateHopperState:function t(){if(u!==c){i.dataset.hopperState=c;u=c}},onload:function t(){},ondragstart:function t(){},ondrag:function t(){},ondragend:function t(){},destroy:function t(){l.destroy()}};return f};var ur=false;var cr=[];var fr=function t(i){var e=document.activeElement;var n=e&&(/textarea|input/i.test(e.nodeName)||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")==="");if(n){var a=false;var r=e;while(r!==document.body){if(r.classList.contains("filepond--root")){a=true;break}r=r.parentNode}if(!a)return}za(i.clipboardData).then((function(t){if(!t.length){return}cr.forEach((function(i){return i(t)}))}))};var dr=function t(i){if(cr.includes(i)){return}cr.push(i);if(ur){return}ur=true;document.addEventListener("paste",fr)};var hr=function t(i){Ct(cr,cr.indexOf(i));if(cr.length===0){document.removeEventListener("paste",fr);ur=false}};var pr=function t(){var i=function t(i){e.onload(i)};var e={destroy:function t(){hr(i)},onload:function t(){}};dr(i);return e};var vr=function t(i){var e=i.root,n=i.props;e.element.id="filepond--assistant-"+n.id;o(e.element,"role","alert");o(e.element,"aria-live","polite");o(e.element,"aria-relevant","additions")};var gr=null;var _r=null;var mr=[];var br=function t(i,e){i.element.textContent=e};var wr=function t(i){i.element.textContent=""};var xr=function t(i,e,n){var a=i.query("GET_TOTAL_ITEMS");br(i,n+" "+e+", "+a+" "+(a===1?i.query("GET_LABEL_FILE_COUNT_SINGULAR"):i.query("GET_LABEL_FILE_COUNT_PLURAL")));clearTimeout(_r);_r=setTimeout((function(){wr(i)}),1500)};var yr=function t(i){return i.element.parentNode.contains(document.activeElement)};var kr=function t(i){var e=i.root,n=i.action;if(!yr(e)){return}e.element.textContent="";var a=e.query("GET_ITEM",n.id);mr.push(a.filename);clearTimeout(gr);gr=setTimeout((function(){xr(e,mr.join(", "),e.query("GET_LABEL_FILE_ADDED"));mr.length=0}),750)};var Er=function t(i){var e=i.root,n=i.action;if(!yr(e)){return}var a=n.item;xr(e,a.filename,e.query("GET_LABEL_FILE_REMOVED"))};var Ir=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.filename;var o=e.query("GET_LABEL_FILE_PROCESSING_COMPLETE");br(e,r+" "+o)};var Tr=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.filename;var o=e.query("GET_LABEL_FILE_PROCESSING_ABORTED");br(e,r+" "+o)};var Ar=function t(i){var e=i.root,n=i.action;var a=e.query("GET_ITEM",n.id);var r=a.filename;br(e,n.status.main+" "+r+" "+n.status.sub)};var Sr=j({create:vr,ignoreRect:true,ignoreRectUpdate:true,write:U({DID_LOAD_ITEM:kr,DID_REMOVE_ITEM:Er,DID_COMPLETE_ITEM_PROCESSING:Ir,DID_ABORT_ITEM_PROCESSING:Tr,DID_REVERT_ITEM_PROCESSING:Tr,DID_THROW_ITEM_REMOVE_ERROR:Ar,DID_THROW_ITEM_LOAD_ERROR:Ar,DID_THROW_ITEM_INVALID:Ar,DID_THROW_ITEM_PROCESSING_ERROR:Ar}),tag:"span",name:"assistant"});var Mr=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"-";return i.replace(new RegExp(e+".","g"),(function(t){return t.charAt(1).toUpperCase()}))};var Dr=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:16;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var a=Date.now();var r=null;return function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++){o[s]=arguments[s]}clearTimeout(r);var l=Date.now()-a;var u=function t(){a=Date.now();i.apply(void 0,o)};if(l<e){if(!n){r=setTimeout(u,e-l)}}else{u()}}};var Pr=1e6;var Or=function t(i){return i.preventDefault()};var Rr=function t(i){var e=i.root,n=i.props;var a=e.query("GET_ID");if(a){e.element.id=a}var r=e.query("GET_CLASS_NAME");if(r){r.split(" ").filter((function(t){return t.length})).forEach((function(t){e.element.classList.add(t)}))}e.ref.label=e.appendChildView(e.createChildView(ua,Object.assign({},n,{translateY:null,caption:e.query("GET_LABEL_IDLE")})));e.ref.list=e.appendChildView(e.createChildView(Yn,{translateY:null}));e.ref.panel=e.appendChildView(e.createChildView(mn,{name:"panel-root"}));e.ref.assistant=e.appendChildView(e.createChildView(Sr,Object.assign({},n)));e.ref.data=e.appendChildView(e.createChildView(Da,Object.assign({},n)));e.ref.measure=be("div");e.ref.measure.style.height="100%";e.element.appendChild(e.ref.measure);e.ref.bounds=null;e.query("GET_STYLES").filter((function(t){return!Y(t.value)})).map((function(t){var i=t.name,n=t.value;e.element.dataset[i]=n}));e.ref.widthPrevious=null;e.ref.widthUpdated=Dr((function(){e.ref.updateHistory=[];e.dispatch("DID_RESIZE_ROOT")}),250);e.ref.previousAspectRatio=null;e.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches;var s="PointerEvent"in window;if(e.query("GET_ALLOW_REORDER")&&s&&!o){e.element.addEventListener("touchmove",Or,{passive:false});e.element.addEventListener("gesturestart",Or)}var l=e.query("GET_CREDITS");var u=l.length===2;if(u){var c=document.createElement("a");c.className="filepond--credits";c.href=l[0];c.tabIndex=-1;c.target="_blank";c.rel="noopener noreferrer nofollow";c.textContent=l[1];e.element.appendChild(c);e.ref.credits=c}};var Cr=function t(i){var e=i.root,n=i.props,a=i.actions;Ur({root:e,props:n,actions:a});a.filter((function(t){return/^DID_SET_STYLE_/.test(t.type)})).filter((function(t){return!Y(t.data.value)})).map((function(t){var i=t.type,n=t.data;var a=Mr(i.substring(8).toLowerCase(),"_");e.element.dataset[a]=n.value;e.invalidateLayout()}));if(e.rect.element.hidden)return;if(e.rect.element.width!==e.ref.widthPrevious){e.ref.widthPrevious=e.rect.element.width;e.ref.widthUpdated()}var r=e.ref.bounds;if(!r){r=e.ref.bounds=Gr(e);e.element.removeChild(e.ref.measure);e.ref.measure=null}var o=e.ref,s=o.hopper,l=o.label,u=o.list,c=o.panel;if(s){s.updateHopperState()}var f=e.query("GET_PANEL_ASPECT_RATIO");var d=e.query("GET_ALLOW_MULTIPLE");var h=e.query("GET_TOTAL_ITEMS");var p=d?e.query("GET_MAX_FILES")||Pr:1;var v=h===p;var g=a.find((function(t){return t.type==="DID_ADD_ITEM"}));if(v&&g){var _=g.data.interactionMethod;l.opacity=0;if(d){l.translateY=-40}else{if(_===Tt.API){l.translateX=40}else if(_===Tt.BROWSE){l.translateY=40}else{l.translateY=30}}}else if(!v){l.opacity=1;l.translateX=0;l.translateY=0}var m=Lr(e);var b=zr(e);var w=l.rect.element.height;var x=!d||v?0:w;var y=v?u.rect.element.marginTop:0;var k=h===0?0:u.rect.element.marginBottom;var E=x+y+b.visual+k;var I=x+y+b.bounds+k;u.translateY=Math.max(0,x-u.rect.element.marginTop)-m.top;if(f){var T=e.rect.element.width;var A=T*f;if(f!==e.ref.previousAspectRatio){e.ref.previousAspectRatio=f;e.ref.updateHistory=[]}var S=e.ref.updateHistory;S.push(T);var M=2;if(S.length>M*2){var D=S.length;var P=D-10;var O=0;for(var R=D;R>=P;R--){if(S[R]===S[R-2]){O++}if(O>=M){return}}}c.scalable=false;c.height=A;var C=A-x-(k-m.bottom)-(v?y:0);if(b.visual>C){u.overflow=C}else{u.overflow=null}e.height=A}else if(r.fixedHeight){c.scalable=false;var L=r.fixedHeight-x-(k-m.bottom)-(v?y:0);if(b.visual>L){u.overflow=L}else{u.overflow=null}}else if(r.cappedHeight){var z=E>=r.cappedHeight;var G=Math.min(r.cappedHeight,E);c.scalable=true;c.height=z?G:G-m.top-m.bottom;var F=G-x-(k-m.bottom)-(v?y:0);if(E>r.cappedHeight&&b.visual>F){u.overflow=F}else{u.overflow=null}e.height=Math.min(r.cappedHeight,I-m.top-m.bottom)}else{var N=h>0?m.top+m.bottom:0;c.scalable=true;c.height=Math.max(w,E-N);e.height=Math.max(w,I-N)}if(e.ref.credits&&c.heightCurrent)e.ref.credits.style.transform="translateY("+c.heightCurrent+"px)"};var Lr=function t(i){var e=i.ref.list.childViews[0].childViews[0];return e?{top:e.rect.element.marginTop,bottom:e.rect.element.marginBottom}:{top:0,bottom:0}};var zr=function t(i){var e=0;var n=0;var a=i.ref.list;var r=a.childViews[0];var o=r.childViews.filter((function(t){return t.rect.element.height}));var s=i.query("GET_ACTIVE_ITEMS").map((function(t){return o.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));if(s.length===0)return{visual:e,bounds:n};var l=r.rect.element.width;var u=Sn(r,s,a.dragCoordinates);var c=s[0].rect.element;var f=c.marginTop+c.marginBottom;var d=c.marginLeft+c.marginRight;var h=c.width+d;var p=c.height+f;var v=typeof u!=="undefined"&&u>=0?1:0;var g=s.find((function(t){return t.markedForRemoval&&t.opacity<.45}))?-1:0;var _=s.length+v+g;var m=An(l,h);if(m===1){s.forEach((function(t){var i=t.rect.element.height+f;n+=i;e+=i*t.opacity}))}else{n=Math.ceil(_/m)*p;e=n}return{visual:e,bounds:n}};var Gr=function t(i){var e=i.ref.measureHeight||null;var n=parseInt(i.style.maxHeight,10)||null;var a=e===0?null:e;return{cappedHeight:n,fixedHeight:a}};var Fr=function t(i,e){var n=i.query("GET_ALLOW_REPLACE");var a=i.query("GET_ALLOW_MULTIPLE");var r=i.query("GET_TOTAL_ITEMS");var o=i.query("GET_MAX_FILES");var s=e.length;if(!a&&s>1){i.dispatch("DID_THROW_MAX_FILES",{source:e,error:ji("warning",0,"Max files")});return true}o=a?o:1;if(!a&&n){return false}var l=nt(o);if(l&&r+s>o){i.dispatch("DID_THROW_MAX_FILES",{source:e,error:ji("warning",0,"Max files")});return true}return false};var Nr=function t(i,e,n){var a=i.childViews[0];return Sn(a,e,{left:n.scopeLeft-a.rect.element.left,top:n.scopeTop-(i.rect.outer.top+i.rect.element.marginTop+i.rect.element.scrollTop)})};var Br=function t(i){var e=i.query("GET_ALLOW_DROP");var n=i.query("GET_DISABLED");var a=e&&!n;if(a&&!i.ref.hopper){var r=lr(i.element,(function(t){var e=i.query("GET_BEFORE_DROP_FILE")||function(){return true};var n=i.query("GET_DROP_VALIDATION");return n?t.every((function(t){return Xt("ALLOW_HOPPER_ITEM",t,{query:i.query}).every((function(t){return t===true}))&&e(t)})):true}),{filterItems:function t(e){var n=i.query("GET_IGNORED_FILES");return e.filter((function(t){if(ee(t)){return!n.includes(t.name.toLowerCase())}return true}))},catchesDropsOnPage:i.query("GET_DROP_ON_PAGE"),requiresDropOnElement:i.query("GET_DROP_ON_ELEMENT")});r.onload=function(t,e){var n=i.ref.list.childViews[0];var a=n.childViews.filter((function(t){return t.rect.element.height}));var r=i.query("GET_ACTIVE_ITEMS").map((function(t){return a.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));Zt("ADD_ITEMS",t,{dispatch:i.dispatch}).then((function(t){if(Fr(i,t))return false;i.dispatch("ADD_ITEMS",{items:t,index:Nr(i.ref.list,r,e),interactionMethod:Tt.DROP})}));i.dispatch("DID_DROP",{position:e});i.dispatch("DID_END_DRAG",{position:e})};r.ondragstart=function(t){i.dispatch("DID_START_DRAG",{position:t})};r.ondrag=Dr((function(t){i.dispatch("DID_DRAG",{position:t})}));r.ondragend=function(t){i.dispatch("DID_END_DRAG",{position:t})};i.ref.hopper=r;i.ref.drip=i.appendChildView(i.createChildView(_a))}else if(!a&&i.ref.hopper){i.ref.hopper.destroy();i.ref.hopper=null;i.removeChildView(i.ref.drip)}};var jr=function t(i,e){var n=i.query("GET_ALLOW_BROWSE");var a=i.query("GET_DISABLED");var r=n&&!a;if(r&&!i.ref.browser){i.ref.browser=i.appendChildView(i.createChildView(ra,Object.assign({},e,{onload:function t(e){Zt("ADD_ITEMS",e,{dispatch:i.dispatch}).then((function(t){if(Fr(i,t))return false;i.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:Tt.BROWSE})}))}})),0)}else if(!r&&i.ref.browser){i.removeChildView(i.ref.browser);i.ref.browser=null}};var Hr=function t(i){var e=i.query("GET_ALLOW_PASTE");var n=i.query("GET_DISABLED");var a=e&&!n;if(a&&!i.ref.paster){i.ref.paster=pr();i.ref.paster.onload=function(t){Zt("ADD_ITEMS",t,{dispatch:i.dispatch}).then((function(t){if(Fr(i,t))return false;i.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:Tt.PASTE})}))}}else if(!a&&i.ref.paster){i.ref.paster.destroy();i.ref.paster=null}};var Ur=U({DID_SET_ALLOW_BROWSE:function t(i){var e=i.root,n=i.props;jr(e,n)},DID_SET_ALLOW_DROP:function t(i){var e=i.root;Br(e)},DID_SET_ALLOW_PASTE:function t(i){var e=i.root;Hr(e)},DID_SET_DISABLED:function t(i){var e=i.root,n=i.props;Br(e);Hr(e);jr(e,n);var a=e.query("GET_DISABLED");if(a){e.element.dataset.disabled="disabled"}else{e.element.removeAttribute("data-disabled")}}});var Vr=j({name:"root",read:function t(i){var e=i.root;if(e.ref.measure){e.ref.measureHeight=e.ref.measure.offsetHeight}},create:Rr,write:Cr,destroy:function t(i){var e=i.root;if(e.ref.paster){e.ref.paster.destroy()}if(e.ref.hopper){e.ref.hopper.destroy()}e.element.removeEventListener("touchmove",Or);e.element.removeEventListener("gesturestart",Or)},mixins:{styles:["height"]}});var qr=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=null;var a=Kt();var o=e(xt(a),[pi,It(a)],[ge,Et(a)]);o.dispatch("SET_OPTIONS",{options:i});var s=function t(){if(document.hidden)return;o.dispatch("KICK")};document.addEventListener("visibilitychange",s);var l=null;var u=false;var c=false;var f=null;var d=null;var h=function t(){if(!u){u=true}clearTimeout(l);l=setTimeout((function(){u=false;f=null;d=null;if(c){c=false;o.dispatch("DID_STOP_RESIZE")}}),500)};window.addEventListener("resize",h);var p=Vr(o,{id:At()});var v=false;var g=false;var _={_read:function t(){if(u){d=window.innerWidth;if(!f){f=d}if(!c&&d!==f){o.dispatch("DID_START_RESIZE");c=true}}if(g&&v){v=p.element.offsetParent===null}if(v)return;p._read();g=p.rect.element.hidden},_write:function t(i){var e=o.processActionQueue().filter((function(t){return!/^SET_/.test(t.type)}));if(v&&!e.length)return;y(e);v=p._write(i,e,c);Bt(o.query("GET_ITEMS"));if(v){o.processDispatchQueue()}}};var m=function t(i){return function(t){var e={type:i};if(!t){return e}if(t.hasOwnProperty("error")){e.error=t.error?Object.assign({},t.error):null}if(t.status){e.status=Object.assign({},t.status)}if(t.file){e.output=t.file}if(t.source){e.file=t.source}else if(t.item||t.id){var n=t.item?t.item:o.query("GET_ITEM",t.id);e.file=n?Nt(n):null}if(t.items){e.items=t.items.map(Nt)}if(/progress/.test(i)){e.progress=t.progress}if(t.hasOwnProperty("origin")&&t.hasOwnProperty("target")){e.origin=t.origin;e.target=t.target}return e}};var b={DID_DESTROY:m("destroy"),DID_INIT:m("init"),DID_THROW_MAX_FILES:m("warning"),DID_INIT_ITEM:m("initfile"),DID_START_ITEM_LOAD:m("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:m("addfileprogress"),DID_LOAD_ITEM:m("addfile"),DID_THROW_ITEM_INVALID:[m("error"),m("addfile")],DID_THROW_ITEM_LOAD_ERROR:[m("error"),m("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[m("error"),m("removefile")],DID_PREPARE_OUTPUT:m("preparefile"),DID_START_ITEM_PROCESSING:m("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:m("processfileprogress"),DID_ABORT_ITEM_PROCESSING:m("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:m("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:m("processfiles"),DID_REVERT_ITEM_PROCESSING:m("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[m("error"),m("processfile")],DID_REMOVE_ITEM:m("removefile"),DID_UPDATE_ITEMS:m("updatefiles"),DID_ACTIVATE_ITEM:m("activatefile"),DID_REORDER_ITEMS:m("reorderfiles")};var w=function t(i){var e=Object.assign({pond:L},i);delete e.type;p.element.dispatchEvent(new CustomEvent("FilePond:"+i.type,{detail:e,bubbles:true,cancelable:true,composed:true}));var n=[];if(i.hasOwnProperty("error")){n.push(i.error)}if(i.hasOwnProperty("file")){n.push(i.file)}var a=["type","error","file"];Object.keys(i).filter((function(t){return!a.includes(t)})).forEach((function(t){return n.push(i[t])}));L.fire.apply(L,[i.type].concat(n));var r=o.query("GET_ON"+i.type.toUpperCase());if(r){r.apply(void 0,n)}};var y=function t(i){if(!i.length)return;i.filter((function(t){return b[t.type]})).forEach((function(t){var i=b[t.type];(Array.isArray(i)?i:[i]).forEach((function(i){if(t.type==="DID_INIT_ITEM"){w(i(t.data))}else{setTimeout((function(){w(i(t.data))}),0)}}))}))};var k=function t(i){return o.dispatch("SET_OPTIONS",{options:i})};var E=function t(i){return o.query("GET_ACTIVE_ITEM",i)};var I=function t(i){return new Promise((function(t,e){o.dispatch("REQUEST_ITEM_PREPARE",{query:i,success:function i(e){t(e)},failure:function t(i){e(i)}})}))};var T=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise((function(t,n){M([{source:i,options:e}],{index:e.index}).then((function(i){return t(i&&i[0])})).catch(n)}))};var A=function t(i){return i.file&&i.id};var S=function t(i,e){if(typeof i==="object"&&!A(i)&&!e){e=i;i=undefined}o.dispatch("REMOVE_ITEM",Object.assign({},e,{query:i}));return o.query("GET_ACTIVE_ITEM",i)===null};var M=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}return new Promise((function(t,i){var n=[];var a={};if(W(e[0])){n.push.apply(n,e[0]);Object.assign(a,e[1]||{})}else{var r=e[e.length-1];if(typeof r==="object"&&!(r instanceof Blob)){Object.assign(a,e.pop())}n.push.apply(n,e)}o.dispatch("ADD_ITEMS",{items:n,index:a.index,interactionMethod:Tt.API,success:t,failure:i})}))};var D=function t(){return o.query("GET_ACTIVE_ITEMS")};var P=function t(i){return new Promise((function(t,e){o.dispatch("REQUEST_ITEM_PROCESSING",{query:i,success:function i(e){t(e)},failure:function t(i){e(i)}})}))};var O=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}var a=Array.isArray(e[0])?e[0]:e;var r=a.length?a:D();return Promise.all(r.map(I))};var R=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}var a=Array.isArray(e[0])?e[0]:e;if(!a.length){var r=D().filter((function(t){return!(t.status===jt.IDLE&&t.origin===Ht.LOCAL)&&t.status!==jt.PROCESSING&&t.status!==jt.PROCESSING_COMPLETE&&t.status!==jt.PROCESSING_REVERT_ERROR}));return Promise.all(r.map(P))}return Promise.all(a.map(P))};var C=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}var a=Array.isArray(e[0])?e[0]:e;var r;if(typeof a[a.length-1]==="object"){r=a.pop()}else if(Array.isArray(e[0])){r=e[1]}var o=D();if(!a.length)return Promise.all(o.map((function(t){return S(t,r)})));var s=a.map((function(t){return x(t)?o[t]?o[t].id:null:t})).filter((function(t){return t}));return s.map((function(t){return S(t,r)}))};var L=Object.assign({},zt(),{},_,{},kt(o,a),{setOptions:k,addFile:T,addFiles:M,getFile:E,processFile:P,prepareFile:I,removeFile:S,moveFile:function t(i,e){return o.dispatch("MOVE_ITEM",{query:i,index:e})},getFiles:D,processFiles:R,removeFiles:C,prepareFiles:O,sort:function t(i){return o.dispatch("SORT",{compare:i})},browse:function t(){var i=p.element.querySelector("input[type=file]");if(i){i.click()}},destroy:function t(){L.fire("destroy",p.element);o.dispatch("ABORT_ALL");p._destroy();window.removeEventListener("resize",h);document.removeEventListener("visibilitychange",s);o.dispatch("DID_DESTROY")},insertBefore:function t(i){return V(p.element,i)},insertAfter:function t(i){return q(p.element,i)},appendTo:function t(i){return i.appendChild(p.element)},replaceElement:function t(i){V(p.element,i);i.parentNode.removeChild(i);n=i},restoreElement:function t(){if(!n){return}q(n,p.element);p.element.parentNode.removeChild(p.element);n=null},isAttachedTo:function t(i){return p.element===i||n===i},element:{get:function t(){return p.element}},status:{get:function t(){return o.query("GET_STATUS")}}});o.dispatch("DID_INIT");return r(L)};var Wr=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e={};a(Kt(),(function(t,i){e[t]=i[0]}));var n=qr(Object.assign({},e,{},i));return n};var Yr=function t(i){return i.charAt(0).toLowerCase()+i.slice(1)};var Zr=function t(i){return Mr(i.replace(/^data-/,""))};var Xr=function t(i,e){a(e,(function(e,n){a(i,(function(t,a){var r=new RegExp(e);var o=r.test(t);if(!o){return}delete i[t];if(n===false){return}if(J(n)){i[n]=a;return}var s=n.group;if(dt(n)&&!i[s]){i[s]={}}i[s][Yr(t.replace(r,""))]=a}));if(n.mapping){t(i[n.group],n.mapping)}}))};var Qr=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=[];a(i.attributes,(function(t){n.push(i.attributes[t])}));var r=n.filter((function(t){return t.name})).reduce((function(t,e){var n=o(i,e.name);t[Zr(e.name)]=n===e.name?true:n;return t}),{});Xr(r,e);return r};var $r=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":false,"^files$":false};Xt("SET_ATTRIBUTE_TO_OPTION_MAP",n);var a=Object.assign({},e);var r=Qr(i.nodeName==="FIELDSET"?i.querySelector("input[type=file]"):i,n);Object.keys(r).forEach((function(t){if(dt(r[t])){if(!dt(a[t])){a[t]={}}Object.assign(a[t],r[t])}else{a[t]=r[t]}}));a.files=(e.files||[]).concat(Array.from(i.querySelectorAll("input:not([type=file])")).map((function(t){return{source:t.value,options:{type:t.dataset.type}}})));var o=Wr(a);if(i.files){Array.from(i.files).forEach((function(t){o.addFile(t)}))}o.replaceElement(i);return o};var Kr=function t(){return i(arguments.length<=0?undefined:arguments[0])?$r.apply(void 0,arguments):Wr.apply(void 0,arguments)};var Jr=["fire","_read","_write"];var to=function t(i){var e={};Gt(i,e,Jr);return e};var io=function t(i,e){return i.replace(/(?:{([a-zA-Z]+)})/g,(function(t,i){return e[i]}))};var eo=function t(i){var e=new Blob(["(",i.toString(),")()"],{type:"application/javascript"});var n=URL.createObjectURL(e);var a=new Worker(n);return{transfer:function t(i,e){},post:function t(i,e,n){var r=At();a.onmessage=function(t){if(t.data.id===r){e(t.data.message)}};a.postMessage({id:r,message:i},n)},terminate:function t(){a.terminate();URL.revokeObjectURL(n)}}};var no=function t(i){return new Promise((function(t,e){var n=new Image;n.onload=function(){t(n)};n.onerror=function(t){e(t)};n.src=i}))};var ao=function t(i,e){var n=i.slice(0,i.size,i.type);n.lastModifiedDate=i.lastModifiedDate;n.name=e;return n};var ro=function t(i){return ao(i,i.name)};var oo=[];var so=function t(i){if(oo.includes(i)){return}oo.push(i);var e=i({addFilter:Qt,utils:{Type:Wt,forin:a,isString:J,isFile:ee,toNaturalFileSize:De,replaceInString:io,getExtensionFromFilename:xi,getFilenameWithoutExtension:te,guesstimateMimeType:La,getFileFromBlob:Ii,getFilenameFromURL:wi,createRoute:U,createWorker:eo,createView:j,createItemAPI:Nt,loadImage:no,copyFile:ro,renameFile:ao,createBlob:Ai,applyFilterChain:Zt,text:we,getNumericAspectRatioFromString:ei},views:{fileActionButton:Me}});$t(e.options)};var lo=function t(){return Object.prototype.toString.call(window.operamini)==="[object OperaMini]"};var uo=function t(){return"Promise"in window};var co=function t(){return"slice"in Blob.prototype};var fo=function t(){return"URL"in window&&"createObjectURL"in window.URL};var ho=function t(){return"visibilityState"in document};var po=function t(){return"performance"in window};var vo=function t(){return"supports"in(window.CSS||{})};var go=function t(){return/MSIE|Trident/.test(window.navigator.userAgent)};var _o=function(){var t=v()&&!lo()&&ho()&&uo()&&co()&&fo()&&po()&&(vo()||go());return function(){return t}}();var mo={apps:[]};var bo="filepond";var wo=function t(){};t.Status={};t.FileStatus={};t.FileOrigin={};t.OptionTypes={};t.create=wo;t.destroy=wo;t.parse=wo;t.find=wo;t.registerPlugin=wo;t.getOptions=wo;t.setOptions=wo;if(_o()){H((function(){mo.apps.forEach((function(t){return t._read()}))}),(function(t){mo.apps.forEach((function(i){return i._write(t)}))}));var xo=function i(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:_o,create:t.create,destroy:t.destroy,parse:t.parse,find:t.find,registerPlugin:t.registerPlugin,setOptions:t.setOptions}}));document.removeEventListener("DOMContentLoaded",i)};if(document.readyState!=="loading"){setTimeout((function(){return xo()}),0)}else{document.addEventListener("DOMContentLoaded",xo)}var yo=function i(){return a(Kt(),(function(i,e){t.OptionTypes[i]=e[1]}))};t.Status=Object.assign({},ai);t.FileOrigin=Object.assign({},Ht);t.FileStatus=Object.assign({},jt);t.OptionTypes={};yo();t.create=function i(){var e=Kr.apply(void 0,arguments);e.on("destroy",t.destroy);mo.apps.push(e);return to(e)};t.destroy=function t(i){var e=mo.apps.findIndex((function(t){return t.isAttachedTo(i)}));if(e>=0){var n=mo.apps.splice(e,1)[0];n.restoreElement();return true}return false};t.parse=function i(e){var n=Array.from(e.querySelectorAll("."+bo));var a=n.filter((function(t){return!mo.apps.find((function(i){return i.isAttachedTo(t)}))}));return a.map((function(i){return t.create(i)}))};t.find=function t(i){var e=mo.apps.find((function(t){return t.isAttachedTo(i)}));if(!e){return null}return to(e)};t.registerPlugin=function t(){for(var i=arguments.length,e=new Array(i),n=0;n<i;n++){e[n]=arguments[n]}e.forEach(so);yo()};t.getOptions=function t(){var i={};a(Kt(),(function(t,e){i[t]=e[0]}));return i};t.setOptions=function i(e){if(dt(e)){mo.apps.forEach((function(t){t.setOptions(e)}));Jt(e)}return t.getOptions()}}t.supported=_o;Object.defineProperty(t,"__esModule",{value:true})}))})(filepond$1,filepond$1.exports);return filepond$1.exports}var filepondExports=requireFilepond();var filepondPluginFileValidateSize$1={exports:{}};
|
|
17
17
|
/*!
|
|
18
18
|
* FilePondPluginFileValidateSize 2.2.8
|
|
19
19
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
@@ -28,7 +28,7 @@ var __awaiter=this&&this.__awaiter||function(t,i,e,n){function a(t){return t ins
|
|
|
28
28
|
* FilePondPluginImagePreview 4.6.12
|
|
29
29
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
30
30
|
* Please visit https://pqina.nl/filepond/ for details.
|
|
31
|
-
*/var filepondPluginImagePreview=filepondPluginImagePreview$1.exports;var hasRequiredFilepondPluginImagePreview;function requireFilepondPluginImagePreview(){if(hasRequiredFilepondPluginImagePreview)return filepondPluginImagePreview$1.exports;hasRequiredFilepondPluginImagePreview=1;(function(t,i){(function(i,e){t.exports=e()})(filepondPluginImagePreview,(function(){var t=function t(i){return/^image/.test(i.type)};function i(t,i){return e(t)||n(t,i)||a()}function e(t){if(Array.isArray(t))return t}function n(t,i){var e=[];var n=true;var a=false;var r=undefined;try{for(var o=t[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){e.push(s.value);if(e.length===i)break}}catch(t){a=true;r=t}finally{try{if(!n&&o["return"]!=null)o["return"]()}finally{if(a)throw r}}return e}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var r=function t(i,e){return u(i.x*e,i.y*e)};var o=function t(i,e){return u(i.x+e.x,i.y+e.y)};var s=function t(i){var e=Math.sqrt(i.x*i.x+i.y*i.y);if(e===0){return{x:0,y:0}}return u(i.x/e,i.y/e)};var l=function t(i,e,n){var a=Math.cos(e);var r=Math.sin(e);var o=u(i.x-n.x,i.y-n.y);return u(n.x+a*o.x-r*o.y,n.y+r*o.x+a*o.y)};var u=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return{x:i,y:e}};var c=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=arguments.length>3?arguments[3]:undefined;if(typeof i==="string"){return parseFloat(i)*n}if(typeof i==="number"){return i*(a?e[a]:Math.min(e.width,e.height))}return};var f=function t(i,e,n){var a=i.borderStyle||i.lineStyle||"solid";var r=i.backgroundColor||i.fontColor||"transparent";var o=i.borderColor||i.lineColor||"transparent";var s=c(i.borderWidth||i.lineWidth,e,n);var l=i.lineCap||"round";var u=i.lineJoin||"round";var f=typeof a==="string"?"":a.map((function(t){return c(t,e,n)})).join(",");var d=i.opacity||1;return{"stroke-linecap":l,"stroke-linejoin":u,"stroke-width":s||0,"stroke-dasharray":f,stroke:o,fill:r,opacity:d}};var d=function t(i){return i!=null};var h=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=c(i.x,e,n,"width")||c(i.left,e,n,"width");var r=c(i.y,e,n,"height")||c(i.top,e,n,"height");var o=c(i.width,e,n,"width");var s=c(i.height,e,n,"height");var l=c(i.right,e,n,"width");var u=c(i.bottom,e,n,"height");if(!d(r)){if(d(s)&&d(u)){r=e.height-s-u}else{r=u}}if(!d(a)){if(d(o)&&d(l)){a=e.width-o-l}else{a=l}}if(!d(o)){if(d(a)&&d(l)){o=e.width-a-l}else{o=0}}if(!d(s)){if(d(r)&&d(u)){s=e.height-r-u}else{s=0}}return{x:a||0,y:r||0,width:o||0,height:s||0}};var p=function t(i){return i.map((function(t,i){return"".concat(i===0?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" ")};var v=function t(i,e){return Object.keys(e).forEach((function(t){return i.setAttribute(t,e[t])}))};var g="http://www.w3.org/2000/svg";var _=function t(i,e){var n=document.createElementNS(g,i);if(e){v(n,e)}return n};var m=function t(i){return v(i,Object.assign({},i.rect,i.styles))};var b=function t(i){var e=i.rect.x+i.rect.width*.5;var n=i.rect.y+i.rect.height*.5;var a=i.rect.width*.5;var r=i.rect.height*.5;return v(i,Object.assign({cx:e,cy:n,rx:a,ry:r},i.styles))};var w={contain:"xMidYMid meet",cover:"xMidYMid slice"};var x=function t(i,e){v(i,Object.assign({},i.rect,i.styles,{preserveAspectRatio:w[e.fit]||"none"}))};var y={left:"start",center:"middle",right:"end"};var k=function t(i,e,n,a){var r=c(e.fontSize,n,a);var o=e.fontFamily||"sans-serif";var s=e.fontWeight||"normal";var l=y[e.textAlign]||"start";v(i,Object.assign({},i.rect,i.styles,{"stroke-width":0,"font-weight":s,"font-size":r,"font-family":o,"text-anchor":l}));if(i.text!==e.text){i.text=e.text;i.textContent=e.text.length?e.text:" "}};var E=function t(i,e,n,a){v(i,Object.assign({},i.rect,i.styles,{fill:"none"}));var u=i.childNodes[0];var f=i.childNodes[1];var d=i.childNodes[2];var h=i.rect;var p={x:i.rect.x+i.rect.width,y:i.rect.y+i.rect.height};v(u,{x1:h.x,y1:h.y,x2:p.x,y2:p.y});if(!e.lineDecoration)return;f.style.display="none";d.style.display="none";var g=s({x:p.x-h.x,y:p.y-h.y});var _=c(.05,n,a);if(e.lineDecoration.indexOf("arrow-begin")!==-1){var m=r(g,_);var b=o(h,m);var w=l(h,2,b);var x=l(h,-2,b);v(f,{style:"display:block;",d:"M".concat(w.x,",").concat(w.y," L").concat(h.x,",").concat(h.y," L").concat(x.x,",").concat(x.y)})}if(e.lineDecoration.indexOf("arrow-end")!==-1){var y=r(g,-_);var k=o(p,y);var E=l(p,2,k);var I=l(p,-2,k);v(d,{style:"display:block;",d:"M".concat(E.x,",").concat(E.y," L").concat(p.x,",").concat(p.y," L").concat(I.x,",").concat(I.y)})}};var I=function t(i,e,n,a){v(i,Object.assign({},i.styles,{fill:"none",d:p(e.points.map((function(t){return{x:c(t.x,n,a,"width"),y:c(t.y,n,a,"height")}})))}))};var T=function t(i){return function(t){return _(i,{id:t.id})}};var A=function t(i){var e=_("image",{id:i.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});e.onload=function(){e.setAttribute("opacity",i.opacity||1)};e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i.src);return e};var S=function t(i){var e=_("g",{id:i.id,"stroke-linecap":"round","stroke-linejoin":"round"});var n=_("line");e.appendChild(n);var a=_("path");e.appendChild(a);var r=_("path");e.appendChild(r);return e};var M={image:A,rect:T("rect"),ellipse:T("ellipse"),text:T("text"),path:T("path"),line:S};var D={rect:m,ellipse:b,image:x,text:k,path:I,line:E};var P=function t(i,e){return M[i](e)};var O=function t(i,e,n,a,r){if(e!=="path"){i.rect=h(n,a,r)}i.styles=f(n,a,r);D[e](i,n,a,r)};var R=["x","y","left","top","right","bottom","width","height"];var C=function t(i){return typeof i==="string"&&/%/.test(i)?parseFloat(i)/100:i};var L=function t(e){var n=i(e,2),a=n[0],r=n[1];var o=r.points?{}:R.reduce((function(t,i){t[i]=C(r[i]);return t}),{});return[a,Object.assign({zIndex:0},r,o)]};var z=function t(i,e){if(i[1].zIndex>e[1].zIndex){return 1}if(i[1].zIndex<e[1].zIndex){return-1}return 0};var G=function t(e){return e.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:true,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function t(e){var n=e.root,a=e.props;if(!a.dirty)return;var r=a.crop,o=a.resize,s=a.markup;var l=a.width;var u=a.height;var c=r.width;var f=r.height;if(o){var d=o.size;var h=d&&d.width;var p=d&&d.height;var v=o.mode;var g=o.upscale;if(h&&!p)p=h;if(p&&!h)h=p;var _=c<h&&f<p;if(!_||_&&g){var m=h/c;var b=p/f;if(v==="force"){c=h;f=p}else{var w;if(v==="cover"){w=Math.max(m,b)}else if(v==="contain"){w=Math.min(m,b)}c=c*w;f=f*w}}}var x={width:l,height:u};n.element.setAttribute("width",x.width);n.element.setAttribute("height",x.height);var y=Math.min(l/c,u/f);n.element.innerHTML="";var k=n.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");s.filter(k).map(L).sort(z).forEach((function(t){var e=i(t,2),a=e[0],r=e[1];var o=P(a,r);O(o,a,r,x,y);n.element.appendChild(o)}))}})};var F=function t(i,e){return{x:i,y:e}};var N=function t(i,e){return i.x*e.x+i.y*e.y};var B=function t(i,e){return F(i.x-e.x,i.y-e.y)};var j=function t(i,e){return N(B(i,e),B(i,e))};var H=function t(i,e){return Math.sqrt(j(i,e))};var U=function t(i,e){var n=i;var a=1.5707963267948966;var r=e;var o=1.5707963267948966-e;var s=Math.sin(a);var l=Math.sin(r);var u=Math.sin(o);var c=Math.cos(o);var f=n/s;var d=f*l;var h=f*u;return F(c*d,c*h)};var V=function t(i,e){var n=i.width;var a=i.height;var r=U(n,e);var o=U(a,e);var s=F(i.x+Math.abs(r.x),i.y-Math.abs(r.y));var l=F(i.x+i.width+Math.abs(o.y),i.y+Math.abs(o.x));var u=F(i.x-Math.abs(o.y),i.y+i.height-Math.abs(o.x));return{width:H(s,l),height:H(s,u)}};var q=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=i.height/i.width;var r=1;var o=e;var s=1;var l=a;if(l>o){l=o;s=l/a}var u=Math.max(r/s,o/l);var c=i.width/(n*u*s);var f=c*e;return{width:c,height:f}};var W=function t(i,e,n,a){var r=a.x>.5?1-a.x:a.x;var o=a.y>.5?1-a.y:a.y;var s=r*2*i.width;var l=o*2*i.height;var u=V(e,n);return Math.max(u.width/s,u.height/l)};var Y=function t(i,e){var n=i.width;var a=n*e;if(a>i.height){a=i.height;n=a/e}var r=(i.width-n)*.5;var o=(i.height-a)*.5;return{x:r,y:o,width:n,height:a}};var Z=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=e.zoom,a=e.rotation,r=e.center,o=e.aspectRatio;if(!o)o=i.height/i.width;var s=q(i,o,n);var l={width:s.width,height:s.height};var u=typeof e.scaleToFit==="undefined"||e.scaleToFit;var c=W(i,Y(l,o),a,u?r:{x:.5,y:.5});var f=n*c;return{widthFloat:s.width/f,heightFloat:s.height/f,width:Math.round(s.width/f),height:Math.round(s.height/f)}};var X={type:"spring",stiffness:.5,damping:.45,mass:10};var Q=function t(i){return i.utils.createView({name:"image-bitmap",ignoreRect:true,mixins:{styles:["scaleX","scaleY"]},create:function t(i){var e=i.root,n=i.props;e.appendChild(n.image)}})};var $=function t(i){return i.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:true,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:X,originY:X,scaleX:X,scaleY:X,translateX:X,translateY:X,rotateZ:X}},create:function t(e){var n=e.root,a=e.props;a.width=a.image.width;a.height=a.image.height;n.ref.bitmap=n.appendChildView(n.createChildView(Q(i),{image:a.image}))},write:function t(i){var e=i.root,n=i.props;var a=n.crop.flip;var r=e.ref.bitmap;r.scaleX=a.horizontal?-1:1;r.scaleY=a.vertical?-1:1}})};var J=function t(i){return i.utils.createView({name:"image-clip",tag:"div",ignoreRect:true,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function t(i){var e=i.root,n=i.props;if(!n.background)return;e.element.style.backgroundColor=n.background},create:function t(e){var n=e.root,a=e.props;n.ref.image=n.appendChildView(n.createChildView($(i),Object.assign({},a)));n.ref.createMarkup=function(){if(n.ref.markup)return;n.ref.markup=n.appendChildView(n.createChildView(G(i),Object.assign({},a)))};n.ref.destroyMarkup=function(){if(!n.ref.markup)return;n.removeChildView(n.ref.markup);n.ref.markup=null};var r=n.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");if(r===null)return;if(r==="grid"){n.element.dataset.transparencyIndicator=r}else{n.element.dataset.transparencyIndicator="color"}},write:function t(i){var e=i.root,n=i.props,a=i.shouldOptimize;var r=n.crop,o=n.markup,s=n.resize,l=n.dirty,u=n.width,c=n.height;e.ref.image.crop=r;var f={width:u,height:c,center:{x:u*.5,y:c*.5}};var d={width:e.ref.image.width,height:e.ref.image.height};var h={x:r.center.x*d.width,y:r.center.y*d.height};var p={x:f.center.x-d.width*r.center.x,y:f.center.y-d.height*r.center.y};var v=Math.PI*2+r.rotation%(Math.PI*2);var g=r.aspectRatio||d.height/d.width;var _=typeof r.scaleToFit==="undefined"||r.scaleToFit;var m=W(d,Y(f,g),v,_?r.center:{x:.5,y:.5});var b=r.zoom*m;if(o&&o.length){e.ref.createMarkup();e.ref.markup.width=u;e.ref.markup.height=c;e.ref.markup.resize=s;e.ref.markup.dirty=l;e.ref.markup.markup=o;e.ref.markup.crop=Z(d,r)}else if(e.ref.markup){e.ref.destroyMarkup()}var w=e.ref.image;if(a){w.originX=null;w.originY=null;w.translateX=null;w.translateY=null;w.rotateZ=null;w.scaleX=null;w.scaleY=null;return}w.originX=h.x;w.originY=h.y;w.translateX=p.x;w.translateY=p.y;w.rotateZ=v;w.scaleX=b;w.scaleY=b}})};var K=function t(i){return i.utils.createView({name:"image-preview",tag:"div",ignoreRect:true,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:X,scaleY:X,translateY:X,opacity:{type:"tween",duration:400}}},create:function t(e){var n=e.root,a=e.props;n.ref.clip=n.appendChildView(n.createChildView(J(i),{id:a.id,image:a.image,crop:a.crop,markup:a.markup,resize:a.resize,dirty:a.dirty,background:a.background}))},write:function t(i){var e=i.root,n=i.props,a=i.shouldOptimize;var r=e.ref.clip;var o=n.image,s=n.crop,l=n.markup,u=n.resize,c=n.dirty;r.crop=s;r.markup=l;r.resize=u;r.dirty=c;r.opacity=a?0:1;if(a||e.rect.element.hidden)return;var f=o.height/o.width;var d=s.aspectRatio||f;var h=e.rect.inner.width;var p=e.rect.inner.height;var v=e.query("GET_IMAGE_PREVIEW_HEIGHT");var g=e.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var _=e.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var m=e.query("GET_PANEL_ASPECT_RATIO");var b=e.query("GET_ALLOW_MULTIPLE");if(m&&!b){v=h*m;d=m}var w=v!==null?v:Math.max(g,Math.min(h*d,_));var x=w/d;if(x>h){x=h;w=x*d}if(w>p){w=p;x=p/d}r.width=x;r.height=w}})};var tt='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';var it=0;var et=function t(i){return i.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:true,create:function t(i){var e=i.root,n=i.props;var a=tt;if(document.querySelector("base")){var r=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+r+"#")}it++;e.element.classList.add("filepond--image-preview-overlay-".concat(n.status));e.element.innerHTML=a.replace(/__UID__/g,it)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}})};var nt=function t(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(i){self.postMessage({id:t.data.id,message:i},[i])}))}};var at=function t(){self.onmessage=function(t){var i=t.data.message.imageData;var e=t.data.message.colorMatrix;var n=i.data;var a=n.length;var r=e[0];var o=e[1];var s=e[2];var l=e[3];var u=e[4];var c=e[5];var f=e[6];var d=e[7];var h=e[8];var p=e[9];var v=e[10];var g=e[11];var _=e[12];var m=e[13];var b=e[14];var w=e[15];var x=e[16];var y=e[17];var k=e[18];var E=e[19];var I=0,T=0,A=0,S=0,M=0;for(;I<a;I+=4){T=n[I]/255;A=n[I+1]/255;S=n[I+2]/255;M=n[I+3]/255;n[I]=Math.max(0,Math.min((T*r+A*o+S*s+M*l+u)*255,255));n[I+1]=Math.max(0,Math.min((T*c+A*f+S*d+M*h+p)*255,255));n[I+2]=Math.max(0,Math.min((T*v+A*g+S*_+M*m+b)*255,255));n[I+3]=Math.max(0,Math.min((T*w+A*x+S*y+M*k+E)*255,255))}self.postMessage({id:t.data.id,message:i},[i.data.buffer])}};var rt=function t(i,e){var n=new Image;n.onload=function(){var t=n.naturalWidth;var i=n.naturalHeight;n=null;e(t,i)};n.src=i};var ot={1:function t(){return[1,0,0,1,0,0]},2:function t(i){return[-1,0,0,1,i,0]},3:function t(i,e){return[-1,0,0,-1,i,e]},4:function t(i,e){return[1,0,0,-1,0,e]},5:function t(){return[0,1,1,0,0,0]},6:function t(i,e){return[0,1,-1,0,e,0]},7:function t(i,e){return[0,-1,-1,0,e,i]},8:function t(i){return[0,-1,1,0,0,i]}};var st=function t(i,e,n,a){if(a===-1){return}i.transform.apply(i,ot[a](e,n))};var lt=function t(i,e,n,a){e=Math.round(e);n=Math.round(n);var r=document.createElement("canvas");r.width=e;r.height=n;var o=r.getContext("2d");if(a>=5&&a<=8){var s=[n,e];e=s[0];n=s[1]}st(o,e,n,a);o.drawImage(i,0,0,e,n);return r};var ut=function t(i){return/^image/.test(i.type)&&!/svg/.test(i.type)};var ct=10;var ft=10;var dt=function t(i){var e=Math.min(ct/i.width,ft/i.height);var n=document.createElement("canvas");var a=n.getContext("2d");var r=n.width=Math.ceil(i.width*e);var o=n.height=Math.ceil(i.height*e);a.drawImage(i,0,0,r,o);var s=null;try{s=a.getImageData(0,0,r,o).data}catch(t){return null}var l=s.length;var u=0;var c=0;var f=0;var d=0;for(;d<l;d+=4){u+=s[d]*s[d];c+=s[d+1]*s[d+1];f+=s[d+2]*s[d+2]}u=ht(u,l);c=ht(c,l);f=ht(f,l);return{r:u,g:c,b:f}};var ht=function t(i,e){return Math.floor(Math.sqrt(i/(e/4)))};var pt=function t(i,e){e=e||document.createElement("canvas");e.width=i.width;e.height=i.height;var n=e.getContext("2d");n.drawImage(i,0,0);return e};var vt=function t(i){var e;try{e=new ImageData(i.width,i.height)}catch(t){var n=document.createElement("canvas");var a=n.getContext("2d");e=a.createImageData(i.width,i.height)}e.data.set(new Uint8ClampedArray(i.data));return e};var gt=function t(i){return new Promise((function(t,e){var n=new Image;n.crossOrigin="Anonymous";n.onload=function(){t(n)};n.onerror=function(t){e(t)};n.src=i}))};var _t=function t(i){var e=et(i);var n=K(i);var a=i.utils.createWorker;var r=function t(i,e,n){return new Promise((function(t){if(!i.ref.imageData){i.ref.imageData=n.getContext("2d").getImageData(0,0,n.width,n.height)}var r=vt(i.ref.imageData);if(!e||e.length!==20){n.getContext("2d").putImageData(r,0,0);return t()}var o=a(at);o.post({imageData:r,colorMatrix:e},(function(i){n.getContext("2d").putImageData(i,0,0);o.terminate();t()}),[r.data.buffer])}))};var o=function t(i,e){i.removeChildView(e);e.image.width=1;e.image.height=1;e._destroy()};var s=function t(i){var e=i.root;var n=e.ref.images.shift();n.opacity=0;n.translateY=-15;e.ref.imageViewBin.push(n);return n};var l=function t(i){var e=i.root,a=i.props,r=i.image;var o=a.id;var s=e.query("GET_ITEM",{id:o});if(!s)return;var l=s.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:false,vertical:false},zoom:1,rotation:0,aspectRatio:null};var u=e.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");var c;var f;var d=false;if(e.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){c=s.getMetadata("markup")||[];f=s.getMetadata("resize");d=true}var h=e.appendChildView(e.createChildView(n,{id:o,image:r,crop:l,resize:f,markup:c,dirty:d,background:u,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),e.childViews.length);e.ref.images.push(h);h.opacity=1;h.scaleX=1;h.scaleY=1;h.translateY=0;setTimeout((function(){e.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)};var u=function t(i){var e=i.root,n=i.props;var a=e.query("GET_ITEM",{id:n.id});if(!a)return;var r=e.ref.images[e.ref.images.length-1];r.crop=a.getMetadata("crop");r.background=e.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");if(e.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){r.dirty=true;r.resize=a.getMetadata("resize");r.markup=a.getMetadata("markup")}};var c=function t(i){var e=i.root,n=i.props,a=i.action;if(!/crop|filter|markup|resize/.test(a.change.key))return;if(!e.ref.images.length)return;var o=e.query("GET_ITEM",{id:n.id});if(!o)return;if(/filter/.test(a.change.key)){var c=e.ref.images[e.ref.images.length-1];r(e,a.change.value,c.image);return}if(/crop|markup|resize/.test(a.change.key)){var f=o.getMetadata("crop");var d=e.ref.images[e.ref.images.length-1];if(f&&f.aspectRatio&&d.crop&&d.crop.aspectRatio&&Math.abs(f.aspectRatio-d.crop.aspectRatio)>1e-5){var h=s({root:e});l({root:e,props:n,image:pt(h.image)})}else{u({root:e,props:n})}}};var f=function t(i){var e=window.navigator.userAgent;var n=e.match(/Firefox\/([0-9]+)\./);var a=n?parseInt(n[1]):null;if(a!==null&&a<=58)return false;return"createImageBitmap"in window&&ut(i)};var d=function t(i){var e=i.root,n=i.props;var a=n.id;var r=e.query("GET_ITEM",a);if(!r)return;var o=URL.createObjectURL(r.file);rt(o,(function(t,i){e.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:t,height:i})}))};var h=function t(i){var e=i.root,n=i.props;var o=n.id;var s=e.query("GET_ITEM",o);if(!s)return;var u=URL.createObjectURL(s.file);var c=function t(){gt(u).then(d)};var d=function t(i){URL.revokeObjectURL(u);var a=s.getMetadata("exif")||{};var o=a.orientation||-1;var c=i.width,f=i.height;if(!c||!f)return;if(o>=5&&o<=8){var d=[f,c];c=d[0];f=d[1]}var h=Math.max(1,window.devicePixelRatio*.75);var p=e.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR");var v=p*h;var g=f/c;var _=e.rect.element.width;var m=e.rect.element.height;var b=_;var w=b*g;if(g>1){b=Math.min(c,_*v);w=b*g}else{w=Math.min(f,m*v);b=w/g}var x=lt(i,b,w,o);var y=function t(){var a=e.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?dt(data):null;s.setMetadata("color",a,true);if("close"in i){i.close()}e.ref.overlayShadow.opacity=1;l({root:e,props:n,image:x})};var k=s.getMetadata("filter");if(k){r(e,k,x).then(y)}else{y()}};if(f(s.file)){var h=a(nt);h.post({file:s.file},(function(t){h.terminate();if(!t){c();return}d(t)}))}else{c()}};var p=function t(i){var e=i.root;var n=e.ref.images[e.ref.images.length-1];n.translateY=0;n.scaleX=1;n.scaleY=1;n.opacity=1};var v=function t(i){var e=i.root;e.ref.overlayShadow.opacity=1;e.ref.overlayError.opacity=0;e.ref.overlaySuccess.opacity=0};var g=function t(i){var e=i.root;e.ref.overlayShadow.opacity=.25;e.ref.overlayError.opacity=1};var _=function t(i){var e=i.root;e.ref.overlayShadow.opacity=.25;e.ref.overlaySuccess.opacity=1};var m=function t(i){var n=i.root;n.ref.images=[];n.ref.imageData=null;n.ref.imageViewBin=[];n.ref.overlayShadow=n.appendChildView(n.createChildView(e,{opacity:0,status:"idle"}));n.ref.overlaySuccess=n.appendChildView(n.createChildView(e,{opacity:0,status:"success"}));n.ref.overlayError=n.appendChildView(n.createChildView(e,{opacity:0,status:"failure"}))};return i.utils.createView({name:"image-preview-wrapper",create:m,styles:["height"],apis:["height"],destroy:function t(i){var e=i.root;e.ref.images.forEach((function(t){t.image.width=1;t.image.height=1}))},didWriteView:function t(i){var e=i.root;e.ref.images.forEach((function(t){t.dirty=false}))},write:i.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:p,DID_IMAGE_PREVIEW_CONTAINER_CREATE:d,DID_FINISH_CALCULATE_PREVIEWSIZE:h,DID_UPDATE_ITEM_METADATA:c,DID_THROW_ITEM_LOAD_ERROR:g,DID_THROW_ITEM_PROCESSING_ERROR:g,DID_THROW_ITEM_INVALID:g,DID_COMPLETE_ITEM_PROCESSING:_,DID_START_ITEM_PROCESSING:v,DID_REVERT_ITEM_PROCESSING:v},(function(t){var i=t.root;var e=i.ref.imageViewBin.filter((function(t){return t.opacity===0}));i.ref.imageViewBin=i.ref.imageViewBin.filter((function(t){return t.opacity>0}));e.forEach((function(t){return o(i,t)}));e.length=0}))})};var mt=function i(e){var n=e.addFilter,a=e.utils;var r=a.Type,o=a.createRoute,s=a.isFile;var l=_t(e);n("CREATE_VIEW",(function(i){var e=i.is,n=i.view,a=i.query;if(!e("file")||!a("GET_ALLOW_IMAGE_PREVIEW"))return;var r=function i(e){var r=e.root,o=e.props;var u=o.id;var c=a("GET_ITEM",u);if(!c||!s(c.file)||c.archived)return;var f=c.file;if(!t(f))return;if(!a("GET_IMAGE_PREVIEW_FILTER_ITEM")(c))return;var d="createImageBitmap"in(window||{});var h=a("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!d&&h&&f.size>h)return;r.ref.imagePreview=n.appendChildView(n.createChildView(l,{id:u}));var p=r.query("GET_IMAGE_PREVIEW_HEIGHT");if(p){r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:c.id,height:p})}var v=!d&&f.size>a("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:u},v)};var u=function t(i,e){if(!i.ref.imagePreview)return;var n=e.id;var a=i.query("GET_ITEM",{id:n});if(!a)return;var r=i.query("GET_PANEL_ASPECT_RATIO");var o=i.query("GET_ITEM_PANEL_ASPECT_RATIO");var s=i.query("GET_IMAGE_PREVIEW_HEIGHT");if(r||o||s)return;var l=i.ref,u=l.imageWidth,c=l.imageHeight;if(!u||!c)return;var f=i.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var d=i.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var h=a.getMetadata("exif")||{};var p=h.orientation||-1;if(p>=5&&p<=8){var v=[c,u];u=v[0];c=v[1]}if(!ut(a.file)||i.query("GET_IMAGE_PREVIEW_UPSCALE")){var g=2048/u;u*=g;c*=g}var _=c/u;var m=(a.getMetadata("crop")||{}).aspectRatio||_;var b=Math.max(f,Math.min(c,d));var w=i.rect.element.width;var x=Math.min(w*m,b);i.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:a.id,height:x})};var c=function t(i){var e=i.root;e.ref.shouldRescale=true};var f=function t(i){var e=i.root,n=i.action;if(n.change.key!=="crop")return;e.ref.shouldRescale=true};var d=function t(i){var e=i.root,n=i.action;e.ref.imageWidth=n.width;e.ref.imageHeight=n.height;e.ref.shouldRescale=true;e.ref.shouldDrawPreview=true;e.dispatch("KICK")};n.registerWriter(o({DID_RESIZE_ROOT:c,DID_STOP_RESIZE:c,DID_LOAD_ITEM:r,DID_IMAGE_PREVIEW_CALCULATE_SIZE:d,DID_UPDATE_ITEM_METADATA:f},(function(t){var i=t.root,e=t.props;if(!i.ref.imagePreview)return;if(i.rect.element.hidden)return;if(i.ref.shouldRescale){u(i,e);i.ref.shouldRescale=false}if(i.ref.shouldDrawPreview){requestAnimationFrame((function(){requestAnimationFrame((function(){i.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:e.id})}))}));i.ref.shouldDrawPreview=false}})))}));return{options:{allowImagePreview:[true,r.BOOLEAN],imagePreviewFilterItem:[function(){return true},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[false,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[false,r.BOOLEAN],imagePreviewMarkupShow:[true,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return true},r.FUNCTION]}}};var bt=typeof window!=="undefined"&&typeof window.document!=="undefined";if(bt){document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:mt}))}return mt}))})(filepondPluginImagePreview$1);return filepondPluginImagePreview$1.exports}var filepondPluginImagePreviewExports=requireFilepondPluginImagePreview();var FilePondPluginImagePreview=getDefaultExportFromCjs(filepondPluginImagePreviewExports);var filepondPluginImageEdit$1={exports:{}};
|
|
31
|
+
*/var filepondPluginImagePreview=filepondPluginImagePreview$1.exports;var hasRequiredFilepondPluginImagePreview;function requireFilepondPluginImagePreview(){if(hasRequiredFilepondPluginImagePreview)return filepondPluginImagePreview$1.exports;hasRequiredFilepondPluginImagePreview=1;(function(t,i){(function(i,e){t.exports=e()})(filepondPluginImagePreview,(function(){var t=function t(i){return/^image/.test(i.type)};function i(t,i){return e(t)||n(t,i)||a()}function e(t){if(Array.isArray(t))return t}function n(t,i){var e=[];var n=true;var a=false;var r=undefined;try{for(var o=t[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){e.push(s.value);if(e.length===i)break}}catch(t){a=true;r=t}finally{try{if(!n&&o["return"]!=null)o["return"]()}finally{if(a)throw r}}return e}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var r=function t(i,e){return u(i.x*e,i.y*e)};var o=function t(i,e){return u(i.x+e.x,i.y+e.y)};var s=function t(i){var e=Math.sqrt(i.x*i.x+i.y*i.y);if(e===0){return{x:0,y:0}}return u(i.x/e,i.y/e)};var l=function t(i,e,n){var a=Math.cos(e);var r=Math.sin(e);var o=u(i.x-n.x,i.y-n.y);return u(n.x+a*o.x-r*o.y,n.y+r*o.x+a*o.y)};var u=function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return{x:i,y:e}};var c=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=arguments.length>3?arguments[3]:undefined;if(typeof i==="string"){return parseFloat(i)*n}if(typeof i==="number"){return i*(a?e[a]:Math.min(e.width,e.height))}return};var f=function t(i,e,n){var a=i.borderStyle||i.lineStyle||"solid";var r=i.backgroundColor||i.fontColor||"transparent";var o=i.borderColor||i.lineColor||"transparent";var s=c(i.borderWidth||i.lineWidth,e,n);var l=i.lineCap||"round";var u=i.lineJoin||"round";var f=typeof a==="string"?"":a.map((function(t){return c(t,e,n)})).join(",");var d=i.opacity||1;return{"stroke-linecap":l,"stroke-linejoin":u,"stroke-width":s||0,"stroke-dasharray":f,stroke:o,fill:r,opacity:d}};var d=function t(i){return i!=null};var h=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=c(i.x,e,n,"width")||c(i.left,e,n,"width");var r=c(i.y,e,n,"height")||c(i.top,e,n,"height");var o=c(i.width,e,n,"width");var s=c(i.height,e,n,"height");var l=c(i.right,e,n,"width");var u=c(i.bottom,e,n,"height");if(!d(r)){if(d(s)&&d(u)){r=e.height-s-u}else{r=u}}if(!d(a)){if(d(o)&&d(l)){a=e.width-o-l}else{a=l}}if(!d(o)){if(d(a)&&d(l)){o=e.width-a-l}else{o=0}}if(!d(s)){if(d(r)&&d(u)){s=e.height-r-u}else{s=0}}return{x:a||0,y:r||0,width:o||0,height:s||0}};var p=function t(i){return i.map((function(t,i){return"".concat(i===0?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" ")};var v=function t(i,e){return Object.keys(e).forEach((function(t){return i.setAttribute(t,e[t])}))};var g="http://www.w3.org/2000/svg";var _=function t(i,e){var n=document.createElementNS(g,i);if(e){v(n,e)}return n};var m=function t(i){return v(i,Object.assign({},i.rect,i.styles))};var b=function t(i){var e=i.rect.x+i.rect.width*.5;var n=i.rect.y+i.rect.height*.5;var a=i.rect.width*.5;var r=i.rect.height*.5;return v(i,Object.assign({cx:e,cy:n,rx:a,ry:r},i.styles))};var w={contain:"xMidYMid meet",cover:"xMidYMid slice"};var x=function t(i,e){v(i,Object.assign({},i.rect,i.styles,{preserveAspectRatio:w[e.fit]||"none"}))};var y={left:"start",center:"middle",right:"end"};var k=function t(i,e,n,a){var r=c(e.fontSize,n,a);var o=e.fontFamily||"sans-serif";var s=e.fontWeight||"normal";var l=y[e.textAlign]||"start";v(i,Object.assign({},i.rect,i.styles,{"stroke-width":0,"font-weight":s,"font-size":r,"font-family":o,"text-anchor":l}));if(i.text!==e.text){i.text=e.text;i.textContent=e.text.length?e.text:" "}};var E=function t(i,e,n,a){v(i,Object.assign({},i.rect,i.styles,{fill:"none"}));var u=i.childNodes[0];var f=i.childNodes[1];var d=i.childNodes[2];var h=i.rect;var p={x:i.rect.x+i.rect.width,y:i.rect.y+i.rect.height};v(u,{x1:h.x,y1:h.y,x2:p.x,y2:p.y});if(!e.lineDecoration)return;f.style.display="none";d.style.display="none";var g=s({x:p.x-h.x,y:p.y-h.y});var _=c(.05,n,a);if(e.lineDecoration.indexOf("arrow-begin")!==-1){var m=r(g,_);var b=o(h,m);var w=l(h,2,b);var x=l(h,-2,b);v(f,{style:"display:block;",d:"M".concat(w.x,",").concat(w.y," L").concat(h.x,",").concat(h.y," L").concat(x.x,",").concat(x.y)})}if(e.lineDecoration.indexOf("arrow-end")!==-1){var y=r(g,-_);var k=o(p,y);var E=l(p,2,k);var I=l(p,-2,k);v(d,{style:"display:block;",d:"M".concat(E.x,",").concat(E.y," L").concat(p.x,",").concat(p.y," L").concat(I.x,",").concat(I.y)})}};var I=function t(i,e,n,a){v(i,Object.assign({},i.styles,{fill:"none",d:p(e.points.map((function(t){return{x:c(t.x,n,a,"width"),y:c(t.y,n,a,"height")}})))}))};var T=function t(i){return function(t){return _(i,{id:t.id})}};var A=function t(i){var e=_("image",{id:i.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});e.onload=function(){e.setAttribute("opacity",i.opacity||1)};e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i.src);return e};var S=function t(i){var e=_("g",{id:i.id,"stroke-linecap":"round","stroke-linejoin":"round"});var n=_("line");e.appendChild(n);var a=_("path");e.appendChild(a);var r=_("path");e.appendChild(r);return e};var M={image:A,rect:T("rect"),ellipse:T("ellipse"),text:T("text"),path:T("path"),line:S};var D={rect:m,ellipse:b,image:x,text:k,path:I,line:E};var P=function t(i,e){return M[i](e)};var O=function t(i,e,n,a,r){if(e!=="path"){i.rect=h(n,a,r)}i.styles=f(n,a,r);D[e](i,n,a,r)};var R=["x","y","left","top","right","bottom","width","height"];var C=function t(i){return typeof i==="string"&&/%/.test(i)?parseFloat(i)/100:i};var L=function t(e){var n=i(e,2),a=n[0],r=n[1];var o=r.points?{}:R.reduce((function(t,i){t[i]=C(r[i]);return t}),{});return[a,Object.assign({zIndex:0},r,o)]};var z=function t(i,e){if(i[1].zIndex>e[1].zIndex){return 1}if(i[1].zIndex<e[1].zIndex){return-1}return 0};var G=function t(e){return e.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:true,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function t(e){var n=e.root,a=e.props;if(!a.dirty)return;var r=a.crop,o=a.resize,s=a.markup;var l=a.width;var u=a.height;var c=r.width;var f=r.height;if(o){var d=o.size;var h=d&&d.width;var p=d&&d.height;var v=o.mode;var g=o.upscale;if(h&&!p)p=h;if(p&&!h)h=p;var _=c<h&&f<p;if(!_||_&&g){var m=h/c;var b=p/f;if(v==="force"){c=h;f=p}else{var w;if(v==="cover"){w=Math.max(m,b)}else if(v==="contain"){w=Math.min(m,b)}c=c*w;f=f*w}}}var x={width:l,height:u};n.element.setAttribute("width",x.width);n.element.setAttribute("height",x.height);var y=Math.min(l/c,u/f);n.element.innerHTML="";var k=n.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");s.filter(k).map(L).sort(z).forEach((function(t){var e=i(t,2),a=e[0],r=e[1];var o=P(a,r);O(o,a,r,x,y);n.element.appendChild(o)}))}})};var F=function t(i,e){return{x:i,y:e}};var N=function t(i,e){return i.x*e.x+i.y*e.y};var B=function t(i,e){return F(i.x-e.x,i.y-e.y)};var j=function t(i,e){return N(B(i,e),B(i,e))};var H=function t(i,e){return Math.sqrt(j(i,e))};var U=function t(i,e){var n=i;var a=1.5707963267948966;var r=e;var o=1.5707963267948966-e;var s=Math.sin(a);var l=Math.sin(r);var u=Math.sin(o);var c=Math.cos(o);var f=n/s;var d=f*l;var h=f*u;return F(c*d,c*h)};var V=function t(i,e){var n=i.width;var a=i.height;var r=U(n,e);var o=U(a,e);var s=F(i.x+Math.abs(r.x),i.y-Math.abs(r.y));var l=F(i.x+i.width+Math.abs(o.y),i.y+Math.abs(o.x));var u=F(i.x-Math.abs(o.y),i.y+i.height-Math.abs(o.x));return{width:H(s,l),height:H(s,u)}};var q=function t(i,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var a=i.height/i.width;var r=1;var o=e;var s=1;var l=a;if(l>o){l=o;s=l/a}var u=Math.max(r/s,o/l);var c=i.width/(n*u*s);var f=c*e;return{width:c,height:f}};var W=function t(i,e,n,a){var r=a.x>.5?1-a.x:a.x;var o=a.y>.5?1-a.y:a.y;var s=r*2*i.width;var l=o*2*i.height;var u=V(e,n);return Math.max(u.width/s,u.height/l)};var Y=function t(i,e){var n=i.width;var a=n*e;if(a>i.height){a=i.height;n=a/e}var r=(i.width-n)*.5;var o=(i.height-a)*.5;return{x:r,y:o,width:n,height:a}};var Z=function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=e.zoom,a=e.rotation,r=e.center,o=e.aspectRatio;if(!o)o=i.height/i.width;var s=q(i,o,n);var l={width:s.width,height:s.height};var u=typeof e.scaleToFit==="undefined"||e.scaleToFit;var c=W(i,Y(l,o),a,u?r:{x:.5,y:.5});var f=n*c;return{widthFloat:s.width/f,heightFloat:s.height/f,width:Math.round(s.width/f),height:Math.round(s.height/f)}};var X={type:"spring",stiffness:.5,damping:.45,mass:10};var Q=function t(i){return i.utils.createView({name:"image-bitmap",ignoreRect:true,mixins:{styles:["scaleX","scaleY"]},create:function t(i){var e=i.root,n=i.props;e.appendChild(n.image)}})};var $=function t(i){return i.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:true,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:X,originY:X,scaleX:X,scaleY:X,translateX:X,translateY:X,rotateZ:X}},create:function t(e){var n=e.root,a=e.props;a.width=a.image.width;a.height=a.image.height;n.ref.bitmap=n.appendChildView(n.createChildView(Q(i),{image:a.image}))},write:function t(i){var e=i.root,n=i.props;var a=n.crop.flip;var r=e.ref.bitmap;r.scaleX=a.horizontal?-1:1;r.scaleY=a.vertical?-1:1}})};var K=function t(i){return i.utils.createView({name:"image-clip",tag:"div",ignoreRect:true,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function t(i){var e=i.root,n=i.props;if(!n.background)return;e.element.style.backgroundColor=n.background},create:function t(e){var n=e.root,a=e.props;n.ref.image=n.appendChildView(n.createChildView($(i),Object.assign({},a)));n.ref.createMarkup=function(){if(n.ref.markup)return;n.ref.markup=n.appendChildView(n.createChildView(G(i),Object.assign({},a)))};n.ref.destroyMarkup=function(){if(!n.ref.markup)return;n.removeChildView(n.ref.markup);n.ref.markup=null};var r=n.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");if(r===null)return;if(r==="grid"){n.element.dataset.transparencyIndicator=r}else{n.element.dataset.transparencyIndicator="color"}},write:function t(i){var e=i.root,n=i.props,a=i.shouldOptimize;var r=n.crop,o=n.markup,s=n.resize,l=n.dirty,u=n.width,c=n.height;e.ref.image.crop=r;var f={width:u,height:c,center:{x:u*.5,y:c*.5}};var d={width:e.ref.image.width,height:e.ref.image.height};var h={x:r.center.x*d.width,y:r.center.y*d.height};var p={x:f.center.x-d.width*r.center.x,y:f.center.y-d.height*r.center.y};var v=Math.PI*2+r.rotation%(Math.PI*2);var g=r.aspectRatio||d.height/d.width;var _=typeof r.scaleToFit==="undefined"||r.scaleToFit;var m=W(d,Y(f,g),v,_?r.center:{x:.5,y:.5});var b=r.zoom*m;if(o&&o.length){e.ref.createMarkup();e.ref.markup.width=u;e.ref.markup.height=c;e.ref.markup.resize=s;e.ref.markup.dirty=l;e.ref.markup.markup=o;e.ref.markup.crop=Z(d,r)}else if(e.ref.markup){e.ref.destroyMarkup()}var w=e.ref.image;if(a){w.originX=null;w.originY=null;w.translateX=null;w.translateY=null;w.rotateZ=null;w.scaleX=null;w.scaleY=null;return}w.originX=h.x;w.originY=h.y;w.translateX=p.x;w.translateY=p.y;w.rotateZ=v;w.scaleX=b;w.scaleY=b}})};var J=function t(i){return i.utils.createView({name:"image-preview",tag:"div",ignoreRect:true,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:X,scaleY:X,translateY:X,opacity:{type:"tween",duration:400}}},create:function t(e){var n=e.root,a=e.props;n.ref.clip=n.appendChildView(n.createChildView(K(i),{id:a.id,image:a.image,crop:a.crop,markup:a.markup,resize:a.resize,dirty:a.dirty,background:a.background}))},write:function t(i){var e=i.root,n=i.props,a=i.shouldOptimize;var r=e.ref.clip;var o=n.image,s=n.crop,l=n.markup,u=n.resize,c=n.dirty;r.crop=s;r.markup=l;r.resize=u;r.dirty=c;r.opacity=a?0:1;if(a||e.rect.element.hidden)return;var f=o.height/o.width;var d=s.aspectRatio||f;var h=e.rect.inner.width;var p=e.rect.inner.height;var v=e.query("GET_IMAGE_PREVIEW_HEIGHT");var g=e.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var _=e.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var m=e.query("GET_PANEL_ASPECT_RATIO");var b=e.query("GET_ALLOW_MULTIPLE");if(m&&!b){v=h*m;d=m}var w=v!==null?v:Math.max(g,Math.min(h*d,_));var x=w/d;if(x>h){x=h;w=x*d}if(w>p){w=p;x=p/d}r.width=x;r.height=w}})};var tt='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';var it=0;var et=function t(i){return i.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:true,create:function t(i){var e=i.root,n=i.props;var a=tt;if(document.querySelector("base")){var r=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+r+"#")}it++;e.element.classList.add("filepond--image-preview-overlay-".concat(n.status));e.element.innerHTML=a.replace(/__UID__/g,it)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}})};var nt=function t(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(i){self.postMessage({id:t.data.id,message:i},[i])}))}};var at=function t(){self.onmessage=function(t){var i=t.data.message.imageData;var e=t.data.message.colorMatrix;var n=i.data;var a=n.length;var r=e[0];var o=e[1];var s=e[2];var l=e[3];var u=e[4];var c=e[5];var f=e[6];var d=e[7];var h=e[8];var p=e[9];var v=e[10];var g=e[11];var _=e[12];var m=e[13];var b=e[14];var w=e[15];var x=e[16];var y=e[17];var k=e[18];var E=e[19];var I=0,T=0,A=0,S=0,M=0;for(;I<a;I+=4){T=n[I]/255;A=n[I+1]/255;S=n[I+2]/255;M=n[I+3]/255;n[I]=Math.max(0,Math.min((T*r+A*o+S*s+M*l+u)*255,255));n[I+1]=Math.max(0,Math.min((T*c+A*f+S*d+M*h+p)*255,255));n[I+2]=Math.max(0,Math.min((T*v+A*g+S*_+M*m+b)*255,255));n[I+3]=Math.max(0,Math.min((T*w+A*x+S*y+M*k+E)*255,255))}self.postMessage({id:t.data.id,message:i},[i.data.buffer])}};var rt=function t(i,e){var n=new Image;n.onload=function(){var t=n.naturalWidth;var i=n.naturalHeight;n=null;e(t,i)};n.src=i};var ot={1:function t(){return[1,0,0,1,0,0]},2:function t(i){return[-1,0,0,1,i,0]},3:function t(i,e){return[-1,0,0,-1,i,e]},4:function t(i,e){return[1,0,0,-1,0,e]},5:function t(){return[0,1,1,0,0,0]},6:function t(i,e){return[0,1,-1,0,e,0]},7:function t(i,e){return[0,-1,-1,0,e,i]},8:function t(i){return[0,-1,1,0,0,i]}};var st=function t(i,e,n,a){if(a===-1){return}i.transform.apply(i,ot[a](e,n))};var lt=function t(i,e,n,a){e=Math.round(e);n=Math.round(n);var r=document.createElement("canvas");r.width=e;r.height=n;var o=r.getContext("2d");if(a>=5&&a<=8){var s=[n,e];e=s[0];n=s[1]}st(o,e,n,a);o.drawImage(i,0,0,e,n);return r};var ut=function t(i){return/^image/.test(i.type)&&!/svg/.test(i.type)};var ct=10;var ft=10;var dt=function t(i){var e=Math.min(ct/i.width,ft/i.height);var n=document.createElement("canvas");var a=n.getContext("2d");var r=n.width=Math.ceil(i.width*e);var o=n.height=Math.ceil(i.height*e);a.drawImage(i,0,0,r,o);var s=null;try{s=a.getImageData(0,0,r,o).data}catch(t){return null}var l=s.length;var u=0;var c=0;var f=0;var d=0;for(;d<l;d+=4){u+=s[d]*s[d];c+=s[d+1]*s[d+1];f+=s[d+2]*s[d+2]}u=ht(u,l);c=ht(c,l);f=ht(f,l);return{r:u,g:c,b:f}};var ht=function t(i,e){return Math.floor(Math.sqrt(i/(e/4)))};var pt=function t(i,e){e=e||document.createElement("canvas");e.width=i.width;e.height=i.height;var n=e.getContext("2d");n.drawImage(i,0,0);return e};var vt=function t(i){var e;try{e=new ImageData(i.width,i.height)}catch(t){var n=document.createElement("canvas");var a=n.getContext("2d");e=a.createImageData(i.width,i.height)}e.data.set(new Uint8ClampedArray(i.data));return e};var gt=function t(i){return new Promise((function(t,e){var n=new Image;n.crossOrigin="Anonymous";n.onload=function(){t(n)};n.onerror=function(t){e(t)};n.src=i}))};var _t=function t(i){var e=et(i);var n=J(i);var a=i.utils.createWorker;var r=function t(i,e,n){return new Promise((function(t){if(!i.ref.imageData){i.ref.imageData=n.getContext("2d").getImageData(0,0,n.width,n.height)}var r=vt(i.ref.imageData);if(!e||e.length!==20){n.getContext("2d").putImageData(r,0,0);return t()}var o=a(at);o.post({imageData:r,colorMatrix:e},(function(i){n.getContext("2d").putImageData(i,0,0);o.terminate();t()}),[r.data.buffer])}))};var o=function t(i,e){i.removeChildView(e);e.image.width=1;e.image.height=1;e._destroy()};var s=function t(i){var e=i.root;var n=e.ref.images.shift();n.opacity=0;n.translateY=-15;e.ref.imageViewBin.push(n);return n};var l=function t(i){var e=i.root,a=i.props,r=i.image;var o=a.id;var s=e.query("GET_ITEM",{id:o});if(!s)return;var l=s.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:false,vertical:false},zoom:1,rotation:0,aspectRatio:null};var u=e.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");var c;var f;var d=false;if(e.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){c=s.getMetadata("markup")||[];f=s.getMetadata("resize");d=true}var h=e.appendChildView(e.createChildView(n,{id:o,image:r,crop:l,resize:f,markup:c,dirty:d,background:u,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),e.childViews.length);e.ref.images.push(h);h.opacity=1;h.scaleX=1;h.scaleY=1;h.translateY=0;setTimeout((function(){e.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)};var u=function t(i){var e=i.root,n=i.props;var a=e.query("GET_ITEM",{id:n.id});if(!a)return;var r=e.ref.images[e.ref.images.length-1];r.crop=a.getMetadata("crop");r.background=e.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");if(e.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")){r.dirty=true;r.resize=a.getMetadata("resize");r.markup=a.getMetadata("markup")}};var c=function t(i){var e=i.root,n=i.props,a=i.action;if(!/crop|filter|markup|resize/.test(a.change.key))return;if(!e.ref.images.length)return;var o=e.query("GET_ITEM",{id:n.id});if(!o)return;if(/filter/.test(a.change.key)){var c=e.ref.images[e.ref.images.length-1];r(e,a.change.value,c.image);return}if(/crop|markup|resize/.test(a.change.key)){var f=o.getMetadata("crop");var d=e.ref.images[e.ref.images.length-1];if(f&&f.aspectRatio&&d.crop&&d.crop.aspectRatio&&Math.abs(f.aspectRatio-d.crop.aspectRatio)>1e-5){var h=s({root:e});l({root:e,props:n,image:pt(h.image)})}else{u({root:e,props:n})}}};var f=function t(i){var e=window.navigator.userAgent;var n=e.match(/Firefox\/([0-9]+)\./);var a=n?parseInt(n[1]):null;if(a!==null&&a<=58)return false;return"createImageBitmap"in window&&ut(i)};var d=function t(i){var e=i.root,n=i.props;var a=n.id;var r=e.query("GET_ITEM",a);if(!r)return;var o=URL.createObjectURL(r.file);rt(o,(function(t,i){e.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:t,height:i})}))};var h=function t(i){var e=i.root,n=i.props;var o=n.id;var s=e.query("GET_ITEM",o);if(!s)return;var u=URL.createObjectURL(s.file);var c=function t(){gt(u).then(d)};var d=function t(i){URL.revokeObjectURL(u);var a=s.getMetadata("exif")||{};var o=a.orientation||-1;var c=i.width,f=i.height;if(!c||!f)return;if(o>=5&&o<=8){var d=[f,c];c=d[0];f=d[1]}var h=Math.max(1,window.devicePixelRatio*.75);var p=e.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR");var v=p*h;var g=f/c;var _=e.rect.element.width;var m=e.rect.element.height;var b=_;var w=b*g;if(g>1){b=Math.min(c,_*v);w=b*g}else{w=Math.min(f,m*v);b=w/g}var x=lt(i,b,w,o);var y=function t(){var a=e.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?dt(data):null;s.setMetadata("color",a,true);if("close"in i){i.close()}e.ref.overlayShadow.opacity=1;l({root:e,props:n,image:x})};var k=s.getMetadata("filter");if(k){r(e,k,x).then(y)}else{y()}};if(f(s.file)){var h=a(nt);h.post({file:s.file},(function(t){h.terminate();if(!t){c();return}d(t)}))}else{c()}};var p=function t(i){var e=i.root;var n=e.ref.images[e.ref.images.length-1];n.translateY=0;n.scaleX=1;n.scaleY=1;n.opacity=1};var v=function t(i){var e=i.root;e.ref.overlayShadow.opacity=1;e.ref.overlayError.opacity=0;e.ref.overlaySuccess.opacity=0};var g=function t(i){var e=i.root;e.ref.overlayShadow.opacity=.25;e.ref.overlayError.opacity=1};var _=function t(i){var e=i.root;e.ref.overlayShadow.opacity=.25;e.ref.overlaySuccess.opacity=1};var m=function t(i){var n=i.root;n.ref.images=[];n.ref.imageData=null;n.ref.imageViewBin=[];n.ref.overlayShadow=n.appendChildView(n.createChildView(e,{opacity:0,status:"idle"}));n.ref.overlaySuccess=n.appendChildView(n.createChildView(e,{opacity:0,status:"success"}));n.ref.overlayError=n.appendChildView(n.createChildView(e,{opacity:0,status:"failure"}))};return i.utils.createView({name:"image-preview-wrapper",create:m,styles:["height"],apis:["height"],destroy:function t(i){var e=i.root;e.ref.images.forEach((function(t){t.image.width=1;t.image.height=1}))},didWriteView:function t(i){var e=i.root;e.ref.images.forEach((function(t){t.dirty=false}))},write:i.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:p,DID_IMAGE_PREVIEW_CONTAINER_CREATE:d,DID_FINISH_CALCULATE_PREVIEWSIZE:h,DID_UPDATE_ITEM_METADATA:c,DID_THROW_ITEM_LOAD_ERROR:g,DID_THROW_ITEM_PROCESSING_ERROR:g,DID_THROW_ITEM_INVALID:g,DID_COMPLETE_ITEM_PROCESSING:_,DID_START_ITEM_PROCESSING:v,DID_REVERT_ITEM_PROCESSING:v},(function(t){var i=t.root;var e=i.ref.imageViewBin.filter((function(t){return t.opacity===0}));i.ref.imageViewBin=i.ref.imageViewBin.filter((function(t){return t.opacity>0}));e.forEach((function(t){return o(i,t)}));e.length=0}))})};var mt=function i(e){var n=e.addFilter,a=e.utils;var r=a.Type,o=a.createRoute,s=a.isFile;var l=_t(e);n("CREATE_VIEW",(function(i){var e=i.is,n=i.view,a=i.query;if(!e("file")||!a("GET_ALLOW_IMAGE_PREVIEW"))return;var r=function i(e){var r=e.root,o=e.props;var u=o.id;var c=a("GET_ITEM",u);if(!c||!s(c.file)||c.archived)return;var f=c.file;if(!t(f))return;if(!a("GET_IMAGE_PREVIEW_FILTER_ITEM")(c))return;var d="createImageBitmap"in(window||{});var h=a("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!d&&h&&f.size>h)return;r.ref.imagePreview=n.appendChildView(n.createChildView(l,{id:u}));var p=r.query("GET_IMAGE_PREVIEW_HEIGHT");if(p){r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:c.id,height:p})}var v=!d&&f.size>a("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");r.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:u},v)};var u=function t(i,e){if(!i.ref.imagePreview)return;var n=e.id;var a=i.query("GET_ITEM",{id:n});if(!a)return;var r=i.query("GET_PANEL_ASPECT_RATIO");var o=i.query("GET_ITEM_PANEL_ASPECT_RATIO");var s=i.query("GET_IMAGE_PREVIEW_HEIGHT");if(r||o||s)return;var l=i.ref,u=l.imageWidth,c=l.imageHeight;if(!u||!c)return;var f=i.query("GET_IMAGE_PREVIEW_MIN_HEIGHT");var d=i.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");var h=a.getMetadata("exif")||{};var p=h.orientation||-1;if(p>=5&&p<=8){var v=[c,u];u=v[0];c=v[1]}if(!ut(a.file)||i.query("GET_IMAGE_PREVIEW_UPSCALE")){var g=2048/u;u*=g;c*=g}var _=c/u;var m=(a.getMetadata("crop")||{}).aspectRatio||_;var b=Math.max(f,Math.min(c,d));var w=i.rect.element.width;var x=Math.min(w*m,b);i.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:a.id,height:x})};var c=function t(i){var e=i.root;e.ref.shouldRescale=true};var f=function t(i){var e=i.root,n=i.action;if(n.change.key!=="crop")return;e.ref.shouldRescale=true};var d=function t(i){var e=i.root,n=i.action;e.ref.imageWidth=n.width;e.ref.imageHeight=n.height;e.ref.shouldRescale=true;e.ref.shouldDrawPreview=true;e.dispatch("KICK")};n.registerWriter(o({DID_RESIZE_ROOT:c,DID_STOP_RESIZE:c,DID_LOAD_ITEM:r,DID_IMAGE_PREVIEW_CALCULATE_SIZE:d,DID_UPDATE_ITEM_METADATA:f},(function(t){var i=t.root,e=t.props;if(!i.ref.imagePreview)return;if(i.rect.element.hidden)return;if(i.ref.shouldRescale){u(i,e);i.ref.shouldRescale=false}if(i.ref.shouldDrawPreview){requestAnimationFrame((function(){requestAnimationFrame((function(){i.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:e.id})}))}));i.ref.shouldDrawPreview=false}})))}));return{options:{allowImagePreview:[true,r.BOOLEAN],imagePreviewFilterItem:[function(){return true},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[false,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[false,r.BOOLEAN],imagePreviewMarkupShow:[true,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return true},r.FUNCTION]}}};var bt=typeof window!=="undefined"&&typeof window.document!=="undefined";if(bt){document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:mt}))}return mt}))})(filepondPluginImagePreview$1);return filepondPluginImagePreview$1.exports}var filepondPluginImagePreviewExports=requireFilepondPluginImagePreview();var FilePondPluginImagePreview=getDefaultExportFromCjs(filepondPluginImagePreviewExports);var filepondPluginImageEdit$1={exports:{}};
|
|
32
32
|
/*!
|
|
33
33
|
* FilePondPluginImageEdit 1.6.3
|
|
34
34
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|