- ) : (
-
- )}
-
+ {/* Mounted only after the first open; stays mounted thereafter so the close animation plays. The library unmounts contents while closed, resetting the widget. */}
+ {hasOpened && (
+ setOpen(false)}
+ modalStyle={{
+ maxWidth: CHECKOUT_WIDTH_PX,
+ padding: 0, // padding reads as a white border around the checkout
+ borderRadius: "0.375rem", // rounded-md, matching the site cards
+ overflow: "hidden",
+ background: THEME_SETTINGS.background,
+ }}
+ >
+ {scriptFailed && !scriptLoaded ? (
+