diff --git a/Backend/package.json b/Backend/package.json index 2bee074b..235ca87f 100644 --- a/Backend/package.json +++ b/Backend/package.json @@ -4,7 +4,8 @@ "description": "cep project", "main": "index.js", "scripts": { - "dev": "node ./src/index.js" + "dev": "node ./src/index.js", + "seed:demo": "node ./src/scripts/seedDemoData.js" }, "author": "khushee", "type": "module", diff --git a/Backend/src/app.js b/Backend/src/app.js index d90b3216..84e5afc3 100644 --- a/Backend/src/app.js +++ b/Backend/src/app.js @@ -4,12 +4,24 @@ import cors from 'cors' import userRouter from './routes/user.route.js' import ngoRouter from './routes/ngo.route.js' import eventRouter from './routes/event.route.js' +import { env } from './config/env.js' -const app=express() +const app=express( +) +app.use( + cors({ + origin: (origin, callback) => { + if (!origin || env.corsOrigins.includes(origin)) { + return callback(null, true) + } + return callback(new Error("Not allowed by CORS")) + }, + credentials: true, + }) +) app.use(express.json()) app.use(cookieParser()) -app.use(cors()) app.use("/api/users",userRouter) app.use("/api/ngos",ngoRouter) diff --git a/Backend/src/config/env.js b/Backend/src/config/env.js new file mode 100644 index 00000000..76e55421 --- /dev/null +++ b/Backend/src/config/env.js @@ -0,0 +1,43 @@ +const isProduction = process.env.NODE_ENV === "production" + +const requiredInAllEnvs = ["JWT_SECRET", "MONGODB_URL"] +const requiredInProduction = ["CLIENT_URL"] + +const missingRequired = [ + ...requiredInAllEnvs.filter((key) => !process.env[key]), + ...(isProduction ? requiredInProduction.filter((key) => !process.env[key]) : []), +] + +if (missingRequired.length > 0) { + throw new Error(`Missing required environment variables: ${missingRequired.join(", ")}`) +} + +const cloudinaryMissing = ["CLOUDINARY_CLOUD_NAME", "CLOUDINARY_API_KEY", "CLOUDINARY_API_SECRET"] + .filter((key) => !process.env[key]) + +if (cloudinaryMissing.length > 0) { + console.warn( + `[env] Cloudinary environment variables missing: ${cloudinaryMissing.join(", ")}. Image upload endpoints will fail until these are set.` + ) +} + +const parsedOrigins = (process.env.CORS_ORIGIN || process.env.CLIENT_URL || "http://localhost:5173,http://localhost:5174,https://res.cloudinary.com") + .split(",") + .map((origin) => origin.trim()) + .filter(Boolean) + +const cookieSameSite = process.env.COOKIE_SAME_SITE || (isProduction ? "none" : "lax") + +export const env = { + isProduction, + port: Number(process.env.PORT) || 5000, + jwtSecret: process.env.JWT_SECRET, + corsOrigins: parsedOrigins, + cookie: { + httpOnly: true, + secure: isProduction, + sameSite: cookieSameSite, + path: "/", + maxAge: 7 * 24 * 60 * 60 * 1000, + }, +} diff --git a/Backend/src/controllers/event.controller.js b/Backend/src/controllers/event.controller.js index 33cb4c06..f34dfd25 100644 --- a/Backend/src/controllers/event.controller.js +++ b/Backend/src/controllers/event.controller.js @@ -1,11 +1,92 @@ import { uploadOnCloudinary } from "../lib/cloudinary.js" import Event from "../models/event.model.js" -import User from "../models/user.model.js" import NGO from "../models/ngo.model.js" -export const addEvent = async (req, res) => { - const {title, description, location, date, timings, maxVolunteers, skillsRequired} = req.body +const defaultRequirements = [ + "Be on time", + "Carry valid ID", + "Follow event coordinator instructions", + ]; + const defaultBenefits = [ + "Certificate of participation", + "Community impact", + "Networking opportunity", + ]; + const normalizeArrayField = (value, fallback = []) => { + if (Array.isArray(value)) return value.filter(Boolean); + if (typeof value === "string" && value.trim()) { + return value + .split(",") + .map((v) => v.trim()) + .filter(Boolean); + } + return fallback; + }; + const mapVolunteer = (v) => ({ + id: v?._id, + name: v?.fullname || "Volunteer", + avatar: v?.profilePic || "", + email: v?.email || "", + skillsPossessed: v?.skillsPossessed || [], + }); + const mapEventForFrontend = (event) => { + const volunteers = Array.isArray(event?.volunteers) + ? event.volunteers.map(mapVolunteer) + : []; + return { + _id: event._id, + title: event.title, + description: event.description, + longDescription: event.longDescription || event.description, + date: event.date, + time: event.timings, + timings: event.timings, + category: event.category || "General", + organization: { + name: event.ngoId?.name || "NGO", + logo: event.ngoId?.logo || "", + rating: 4.8, // placeholder until you add rating in NGO schema + eventsCount: Array.isArray(event.ngoId?.eventsPosted) ? event.ngoId.eventsPosted.length : 0, + joinedDate: event.ngoId?.createdAt + ? String(new Date(event.ngoId.createdAt).getFullYear()) + : "", + }, + ngoId: event.ngoId, // keep raw too (for flexibility) + skillsRequired: event.skillsRequired || [], + volunteers, + maxVolunteers: event.maxVolunteers, + currentVolunteers: volunteers.length, + location: { + address: event.location || "", + coordinates: event.coordinates || { lat: 0, lng: 0 }, + }, + requirements: event.requirements?.length ? event.requirements : defaultRequirements, + benefits: event.benefits?.length ? event.benefits : defaultBenefits, + images: [event.image || ""], + image: event.image || "", + }; + }; + +const eventPopulate = [ + { path: "ngoId", select: "name email logo location website briefDescription eventsPosted createdAt" }, + { path: "volunteers", select: "fullname email profilePic skillsPossessed" }, +] + +export const addEvent = async (req, res) => { + const { + title, + description, + longDescription, + category, + location, + date, + timings, + maxVolunteers, + skillsRequired, + requirements, + benefits, + } = req.body; try{ if(req.role != "ngo"){ return res.status(403).json({message: "Only NGOs can add events"}) @@ -25,21 +106,157 @@ export const addEvent = async (req, res) => { const event = await Event.create({ title, description, + longDescription: longDescription || description, + category: category || "General", location, date, timings, image: image?.secure_url || "", imageId: image?.public_id || "", ngoId: req.user._id, - skillsRequired: skillsRequired || [], - maxVolunteers - }) + skillsRequired: normalizeArrayField(skillsRequired, []), + requirements: normalizeArrayField(requirements, defaultRequirements), + benefits: normalizeArrayField(benefits, defaultBenefits), + maxVolunteers: Number(maxVolunteers), + + }); + await NGO.findByIdAndUpdate(req.user._id, { $addToSet: { eventsPosted: event._id } }) + const populated = await Event.findById(event._id).populate(eventPopulate); + return res.status(201).json(mapEventForFrontend(populated)); + } catch (error) { + console.log(`Error in adding event : ${error}`); + return res.status(500).json({ message: error?.message || "Internal error in adding event" }); + } + }; + +export const getAllEvents=async(_, res)=>{ + try{ + const events= await Event.find({}) + .populate(eventPopulate) + .sort({createdAt:-1}) - return res.status(201).json(event) + return res.status(200).json(events.map(mapEventForFrontend)) } catch(error){ - console.log(`Error in adding event : ${error}`) - return res.status(500).json({message: "Internal error in adding event"}) + console.log(`Error in getting all events : ${error}`) + return res.status(500).json({ message: "Internal error in fetching events" }) } } +export const getEventById=async(req,res)=>{ + const{id}=req.params +try{ + const event=await Event.findById(id) + .populate(eventPopulate) + if (!event) { + return res.status(404).json({ message: "Event not found" }) + } + return res.status(200).json(mapEventForFrontend(event)) +} +catch(error){ + console.log(`Error in getting event by id : ${error}`) + return res.status(500).json({ message: "Internal error in fetching event" }) +} +} +export const getMyEvents=async(req,res)=>{ + try{ + if(req.role!=="ngo"){ + return res.status(403).json({message: "Only NGOs can view their events"}) + } + + const events = await Event.find({ ngoId: req.user._id }) + .populate(eventPopulate) + .sort({ createdAt: -1 }) + return res.status(200).json(events.map(mapEventForFrontend)) + } catch (error) { + console.log(`Error in getting NGO events : ${error}`) + return res.status(500).json({ message: "Internal error in fetching NGO events" }) + } +} + +export const updateEvent = async (req, res) => { + const { id } = req.params + const { + title, + description, + longDescription, + category, + location, + date, + timings, + maxVolunteers, + skillsRequired, + requirements, + benefits, + } = req.body + + try { + if (req.role !== "ngo") { + return res.status(403).json({ message: "Only NGOs can update events" }) + } + + const event = await Event.findById(id) + if (!event) { + return res.status(404).json({ message: "Event not found" }) + } + if (event.ngoId.toString() !== req.user._id.toString()) { + return res.status(403).json({ message: "Not authorized" }) + } + + let imageData = null + const imageLocalPath = req.files?.image?.[0]?.path + if (imageLocalPath) { + imageData = await uploadOnCloudinary(imageLocalPath) + if (!imageData?.secure_url) { + return res.status(500).json({ message: "Failed to upload event image" }) + } + } + + if (title !== undefined) event.title = title + if (description !== undefined) event.description = description + if (longDescription !== undefined) event.longDescription = longDescription + if (category !== undefined) event.category = category + if (location !== undefined) event.location = location + if (date !== undefined) event.date = date + if (timings !== undefined) event.timings = timings + if (maxVolunteers !== undefined) event.maxVolunteers = Number(maxVolunteers) + if (skillsRequired !== undefined) event.skillsRequired = normalizeArrayField(skillsRequired, []) + if (requirements !== undefined) event.requirements = normalizeArrayField(requirements, defaultRequirements) + if (benefits !== undefined) event.benefits = normalizeArrayField(benefits, defaultBenefits) + if (imageData?.secure_url) { + event.image = imageData.secure_url + event.imageId = imageData.public_id || "" + } + + await event.save() + const updatedEvent = await Event.findById(id).populate(eventPopulate) + return res.status(200).json(mapEventForFrontend(updatedEvent)) + } catch (error) { + console.log(`Error in updating event : ${error}`) + return res.status(500).json({ message: error?.message || "Internal error in updating event" }) + } +} + +export const deleteEvent = async (req, res) => { + const { id } = req.params + try { + if (req.role !== "ngo") { + return res.status(403).json({ message: "Only NGOs can delete events" }) + } + + const event = await Event.findById(id) + if (!event) { + return res.status(404).json({ message: "Event not found" }) + } + if (event.ngoId.toString() !== req.user._id.toString()) { + return res.status(403).json({ message: "Not authorized" }) + } + + await Event.findByIdAndDelete(id) + await NGO.findByIdAndUpdate(event.ngoId, { $pull: { eventsPosted: event._id } }) + return res.status(200).json({ message: "Event deleted successfully" }) + } catch (error) { + console.log(`Error in deleting event : ${error}`) + return res.status(500).json({ message: "Internal error in deleting event" }) + } +} diff --git a/Backend/src/controllers/ngo.controller.js b/Backend/src/controllers/ngo.controller.js index 048b7e6b..849e57d3 100644 --- a/Backend/src/controllers/ngo.controller.js +++ b/Backend/src/controllers/ngo.controller.js @@ -50,15 +50,16 @@ export const registerNGO = async(req, res) => { generateToken(ngo._id, "ngo", res) return res.status(201).json({ - _id: ngo._is, + _id: ngo._id, name: ngo.name, email: ngo.email, - contactNumber: ngo.contactNumber + contactNumber: ngo.contactNumber, + logo: ngo.logo }) } catch(error){ console.log(`Error in registering NGO : ${error}`) - return res.status(500).json({message: "Internal error in registering NGO"}) + return res.status(500).json({message: error?.message || "Internal error in registering NGO"}) } } @@ -87,12 +88,13 @@ export const loginNGO = async(req, res) => { _id: ngo._id, name: ngo.name, email: ngo.email, - contactNumber: ngo.contactNumber + contactNumber: ngo.contactNumber, + logo: ngo.logo }) } catch(error){ console.log(`Error in logging in : ${error}`) - return res.status(500).json({message: "Internal error in logging in"}) + return res.status(500).json({message: error?.message || "Internal error in logging in"}) } } @@ -105,4 +107,39 @@ export const logoutNGO = async (_, res) => { console.log(`Error in logging out : ${error}`) return res.status(500).json({message: "Internal error in logging out"}) } +} + +export const updateNgoLogo = async (req, res) => { + try { + if (req.role !== "ngo") { + return res.status(403).json({ message: "Only NGOs can update logo" }) + } + + const logoLocalPath = req.files?.logo?.[0]?.path + if (!logoLocalPath) { + return res.status(400).json({ message: "Logo file is required" }) + } + + const logo = await uploadOnCloudinary(logoLocalPath) + if (!logo?.secure_url) { + return res.status(500).json({ message: "Failed to upload logo" }) + } + + const ngo = await NGO.findByIdAndUpdate( + req.user._id, + { logo: logo.secure_url, logoId: logo.public_id || "" }, + { new: true } + ).select("-password") + + return res.status(200).json({ + _id: ngo._id, + name: ngo.name, + email: ngo.email, + contactNumber: ngo.contactNumber, + logo: ngo.logo + }) + } catch (error) { + console.log(`Error in updating NGO logo : ${error}`) + return res.status(500).json({ message: error?.message || "Internal error in updating NGO logo" }) + } } \ No newline at end of file diff --git a/Backend/src/controllers/resgistration.controller.js b/Backend/src/controllers/resgistration.controller.js index ff07653a..83edbb41 100644 --- a/Backend/src/controllers/resgistration.controller.js +++ b/Backend/src/controllers/resgistration.controller.js @@ -1,4 +1,6 @@ -import Registration from "../models/registration.model" +import Registration from "../models/registration.model.js" +import Event from "../models/event.model.js" +import User from "../models/user.model.js" export const volunteerForEvent = async (req, res) => { try{ @@ -15,26 +17,19 @@ export const volunteerForEvent = async (req, res) => { return res.status(404).json({message: "Event not found"}) } - if(event.volunteers.includes(userId)){ - return res.status(400).json({message: "Already registered for current event"}) + const existing = await Registration.findOne({ userId, eventId }) + if (existing) { + return res.status(400).json({ message: `Already applied (${existing.status}).` }) } - if(event.volunteers.length == event.maxVolunteers){ - return res.status(400).json({message: "No more volunteers needed for this event"}) - } - - const user = await User.findById(userId) - user.eventsRegistered.push(event._id) - await user.save() - - event.volunteers.push(userId) - await event.save() - - await User.findByIdAndUpdate(userId, { - $addToSet: { eventsRegistered: eventId } + const registration = await Registration.create({ + userId, + eventId, + status: "pending", + message: req.body?.message || "", }) - - return res.status(200).json(user) + + return res.status(201).json(registration) } catch(error){ console.log(`Error in registering for event : ${error}`) @@ -51,7 +46,6 @@ export const viewRegistrations = async (req, res) => { const eventId = req.params.id const event = await Event.findById(eventId) - .populate("volunteers", "fullname email") if (!event) { return res.status(400).json({ message: "Cannot find event" }) @@ -61,12 +55,25 @@ export const viewRegistrations = async (req, res) => { return res.status(403).json({ message: "Not authorized" }) } - const volunteers = event.volunteers.map(user => ({ - name: user.fullname, - email: user.email - })) + const registrations = await Registration.find({ eventId }) + .populate("userId", "fullname email profilePic skillsPossessed") + .sort({ createdAt: -1 }) - return res.status(200).json({ volunteers }) + return res.status(200).json({ + registrations: registrations.map((r) => ({ + _id: r._id, + status: r.status, + message: r.message || "", + appliedAt: r.appliedAt, + user: r.userId ? { + _id: r.userId._id, + fullname: r.userId.fullname, + email: r.userId.email, + profilePic: r.userId.profilePic, + skillsPossessed: r.userId.skillsPossessed || [], + } : null, + })), + }) } catch (error) { console.log(`Error in viewing registrations : ${error}`) @@ -74,6 +81,49 @@ export const viewRegistrations = async (req, res) => { } } +export const getNgoApplications = async (req, res) => { + try { + if (req.role !== "ngo") { + return res.status(403).json({ message: "Only NGOs can view registrations" }) + } + + const events = await Event.find({ ngoId: req.user._id }).select("_id title date location image maxVolunteers") + const eventIds = events.map((e) => e._id) + + const registrations = await Registration.find({ eventId: { $in: eventIds } }) + .populate("userId", "fullname email profilePic skillsPossessed") + .populate("eventId", "title date location image maxVolunteers") + .sort({ createdAt: -1 }) + + return res.status(200).json({ + registrations: registrations.map((r) => ({ + _id: r._id, + status: r.status, + message: r.message || "", + appliedAt: r.appliedAt, + user: r.userId ? { + _id: r.userId._id, + fullname: r.userId.fullname, + email: r.userId.email, + profilePic: r.userId.profilePic, + skillsPossessed: r.userId.skillsPossessed || [], + } : null, + event: r.eventId ? { + _id: r.eventId._id, + title: r.eventId.title, + date: r.eventId.date, + location: r.eventId.location, + image: r.eventId.image, + maxVolunteers: r.eventId.maxVolunteers, + } : null, + })), + }) + } catch (error) { + console.log(`Error in getting NGO applications : ${error}`) + return res.status(500).json({ message: "Internal error in fetching registrations" }) + } +} + export const acceptRegistration = async(req, res) => { try{ if (req.role !== "ngo") { @@ -81,9 +131,9 @@ export const acceptRegistration = async(req, res) => { } const eventId = req.params.id + const registrationId = req.params.registrationId const event = await Event.findById(eventId) - .populate("volunteers", "fullname email") if (!event) { return res.status(400).json({ message: "Cannot find event" }) @@ -92,10 +142,167 @@ export const acceptRegistration = async(req, res) => { if (event.ngoId.toString() !== req.user._id.toString()) { return res.status(403).json({ message: "Not authorized" }) } - + + const registration = await Registration.findOne({ _id: registrationId, eventId }) + if (!registration) { + return res.status(404).json({ message: "Registration not found" }) + } + if (registration.status === "approved") { + return res.status(200).json({ message: "Already approved" }) + } + if (event.maxVolunteers && event.volunteers.length >= event.maxVolunteers) { + return res.status(400).json({ message: "No more volunteers needed for this event" }) + } + + registration.status = "approved" + await registration.save() + + await Event.findByIdAndUpdate(eventId, { $addToSet: { volunteers: registration.userId } }) + await User.findByIdAndUpdate(registration.userId, { $addToSet: { eventsRegistered: eventId } }) + + return res.status(200).json({ message: "Approved" }) } catch(error){ console.log(`Error in accepting registration : ${error}`) return res.status(500).json({message: "Internal error in accepting registration"}) } +} + +export const rejectRegistration = async(req, res) => { + try{ + if (req.role !== "ngo") { + return res.status(403).json({ message: "Only NGOs can view registrations" }) + } + + const eventId = req.params.id + const registrationId = req.params.registrationId + + const event = await Event.findById(eventId) + if (!event) { + return res.status(400).json({ message: "Cannot find event" }) + } + + if (event.ngoId.toString() !== req.user._id.toString()) { + return res.status(403).json({ message: "Not authorized" }) + } + + const registration = await Registration.findOne({ _id: registrationId, eventId }) + if (!registration) { + return res.status(404).json({ message: "Registration not found" }) + } + + registration.status = "rejected" + await registration.save() + + return res.status(200).json({ message: "Rejected" }) + } + catch(error){ + console.log(`Error in rejecting registration : ${error}`) + return res.status(500).json({message: "Internal error in rejecting registration"}) + } +} + +const mapEventLite = (event) => ({ + _id: event?._id, + title: event?.title || "Event", + date: event?.date, + location: event?.location || "", + image: event?.image || "", + maxVolunteers: Number(event?.maxVolunteers || 0), + ngo: { + _id: event?.ngoId?._id, + name: event?.ngoId?.name || "NGO", + logo: event?.ngoId?.logo || "", + }, +}) + +export const getVolunteerApplications = async (req, res) => { + try { + if (req.role !== "user") { + return res.status(403).json({ message: "Only volunteers can view their applications" }) + } + + const registrations = await Registration.find({ userId: req.user._id }) + .populate({ + path: "eventId", + select: "title date location image maxVolunteers ngoId", + populate: { path: "ngoId", select: "name logo" }, + }) + .sort({ createdAt: -1 }) + + const now = new Date() + const data = registrations + .filter((r) => r.eventId) + .map((r) => { + const eventDate = r.eventId?.date ? new Date(r.eventId.date) : null + const isPast = Boolean(eventDate && eventDate < now) + return { + _id: r._id, + status: r.status, + appliedAt: r.appliedAt, + message: r.message || "", + isPast, + event: mapEventLite(r.eventId), + } + }) + + return res.status(200).json({ registrations: data }) + } catch (error) { + console.log(`Error in getting volunteer applications : ${error}`) + return res.status(500).json({ message: "Internal error in fetching volunteer applications" }) + } +} + +export const toggleSaveEvent = async (req, res) => { + try { + if (req.role !== "user") { + return res.status(403).json({ message: "Only volunteers can save events" }) + } + + const eventId = req.params.id + const event = await Event.findById(eventId) + if (!event) { + return res.status(404).json({ message: "Event not found" }) + } + + const user = await User.findById(req.user._id).select("savedEvents") + const alreadySaved = user.savedEvents.some((savedId) => savedId.toString() === eventId) + + await User.findByIdAndUpdate( + req.user._id, + alreadySaved + ? { $pull: { savedEvents: eventId } } + : { $addToSet: { savedEvents: eventId } } + ) + + return res.status(200).json({ + saved: !alreadySaved, + message: alreadySaved ? "Event removed from saved list" : "Event saved", + }) + } catch (error) { + console.log(`Error in saving event : ${error}`) + return res.status(500).json({ message: "Internal error in saving event" }) + } +} + +export const getVolunteerSavedEvents = async (req, res) => { + try { + if (req.role !== "user") { + return res.status(403).json({ message: "Only volunteers can view saved events" }) + } + + const user = await User.findById(req.user._id) + .populate({ + path: "savedEvents", + select: "title date location image maxVolunteers ngoId", + populate: { path: "ngoId", select: "name logo" }, + }) + .select("savedEvents") + + const savedEvents = (user?.savedEvents || []).map(mapEventLite) + return res.status(200).json({ savedEvents }) + } catch (error) { + console.log(`Error in getting saved events : ${error}`) + return res.status(500).json({ message: "Internal error in fetching saved events" }) + } } \ No newline at end of file diff --git a/Backend/src/controllers/user.controller.js b/Backend/src/controllers/user.controller.js index 3016af10..2d1a8b9e 100644 --- a/Backend/src/controllers/user.controller.js +++ b/Backend/src/controllers/user.controller.js @@ -2,6 +2,8 @@ import bcrypt from "bcryptjs" import User from "../models/user.model.js" import {generateToken} from "../lib/utils.js" import { uploadOnCloudinary } from "../lib/cloudinary.js" +import Event from "../models/event.model.js" +import Registration from "../models/registration.model.js" export const registerUser = async (req, res) => { const {fullname, email, password, phoneNumber, skillsPossessed} = req.body @@ -20,16 +22,13 @@ export const registerUser = async (req, res) => { return res.status(400).json({message: "Password must be at least 6 characters"}) } - if(phoneNumber.length != 10){ + const normalizedPhone = String(phoneNumber).replace(/\D/g, "") + if(normalizedPhone.length != 10){ return res.status(400).json({message: "Phone number should be of 10 digits"}) } - const profilePicLocalPath = req.files.profilePic[0].path - const profilePic = await uploadOnCloudinary(profilePicLocalPath) - - if(!profilePic){ - return res.status(400).json({message: "Profile pic is required"}) - } + const profilePicLocalPath = req.files?.profilePic?.[0]?.path + const profilePic = profilePicLocalPath ? await uploadOnCloudinary(profilePicLocalPath) : null const salt = await bcrypt.genSalt(10) const hashedPassword = await bcrypt.hash(password, salt) @@ -38,10 +37,10 @@ export const registerUser = async (req, res) => { fullname, email, password: hashedPassword, - phoneNumber, + phoneNumber: normalizedPhone, address : req.body.address || "", - profilePic: profilePic.secure_url, - profilePicId: profilePic.public_id, + profilePic: profilePic?.secure_url || "", + profilePicId: profilePic?.public_id || "", skillsPossessed: skillsPossessed }) @@ -51,12 +50,13 @@ export const registerUser = async (req, res) => { _id: user._id, fullname: user.fullname, email: user.email, - phoneNumber: user.phoneNumber + phoneNumber: user.phoneNumber, + profilePic: user.profilePic }) } catch(error){ console.log(`Error in registering user : ${error}`) - return res.status(500).json({message: "Internal error in registering user"}) + return res.status(500).json({message: error?.message || "Internal error in registering user"}) } } @@ -83,12 +83,13 @@ export const loginUser = async (req, res) => { _id: user._id, fullname: user.fullname, email: user.email, - phoneNumber: user.phoneNumber + phoneNumber: user.phoneNumber, + profilePic: user.profilePic }) } catch(error){ console.log(`Errror in logging in : ${error}`) - return res.status(500).json({message: "Iternal error in logging in"}) + return res.status(500).json({message: error?.message || "Iternal error in logging in"}) } } @@ -101,4 +102,186 @@ export const logoutUser = async (_, res) => { console.log(`Error in logging out : ${error}`) return res.status(500).json("Internal error in logging out") } +} + +export const updateUserProfilePic = async (req, res) => { + try { + if (req.role !== "user") { + return res.status(403).json({ message: "Only volunteers can update profile image" }) + } + + const profilePicLocalPath = req.files?.profilePic?.[0]?.path + if (!profilePicLocalPath) { + return res.status(400).json({ message: "Profile image file is required" }) + } + + const profilePic = await uploadOnCloudinary(profilePicLocalPath) + if (!profilePic?.secure_url) { + return res.status(500).json({ message: "Failed to upload profile image" }) + } + + const user = await User.findByIdAndUpdate( + req.user._id, + { profilePic: profilePic.secure_url, profilePicId: profilePic.public_id || "" }, + { new: true } + ).select("-password") + + return res.status(200).json({ + _id: user._id, + fullname: user.fullname, + email: user.email, + phoneNumber: user.phoneNumber, + profilePic: user.profilePic + }) + } catch (error) { + console.log(`Error in updating user profile image : ${error}`) + return res.status(500).json({ message: error?.message || "Internal error in updating profile image" }) + } +} + +export const saveEvent = async (req, res) => { + const { eventId } = req.body + console.log('Save event request - eventId:', eventId) + console.log('Save event request - user role:', req.role) + console.log('Save event request - user ID:', req.user?._id) + + try { + if (req.role !== "user") { + console.log('Access denied: User role is not "user"') + return res.status(403).json({ message: "Only volunteers can save events" }) + } + + if (!eventId) { + console.log('Bad request: Event ID is missing') + return res.status(400).json({ message: "Event ID is required" }) + } + + console.log('Looking for event with ID:', eventId) + const event = await Event.findById(eventId) + if (!event) { + console.log('Event not found:', eventId) + return res.status(404).json({ message: "Event not found" }) + } + + console.log('Looking for user with ID:', req.user._id) + const user = await User.findById(req.user._id) + if (!user) { + console.log('User not found:', req.user._id) + return res.status(404).json({ message: "User not found" }) + } + + const isAlreadySaved = user.savedEvents.includes(eventId) + console.log('Is event already saved:', isAlreadySaved) + if (isAlreadySaved) { + return res.status(400).json({ message: "Event already saved" }) + } + + user.savedEvents.push(eventId) + console.log('Saving user with new saved events array') + await user.save() + + console.log('Event saved successfully') + return res.status(200).json({ message: "Event saved successfully" }) + } catch (error) { + console.log(`Error in saving event : ${error}`) + console.log('Error stack:', error.stack) + return res.status(500).json({ message: error?.message || "Internal error in saving event" }) + } +} + +export const getSavedEvents = async (req, res) => { + try { + if (req.role !== "user") { + return res.status(403).json({ message: "Only volunteers can view saved events" }) + } + + const user = await User.findById(req.user._id).populate({ + path: 'savedEvents', + populate: [ + { path: 'ngoId', select: 'name logo' } + ] + }) + + if (!user) { + return res.status(404).json({ message: "User not found" }) + } + + return res.status(200).json({ events: user.savedEvents }) + } catch (error) { + console.log(`Error in getting saved events : ${error}`) + return res.status(500).json({ message: error?.message || "Internal error in fetching saved events" }) + } +} + +export const unsaveEvent = async (req, res) => { + const { eventId } = req.body + try { + if (req.role !== "user") { + return res.status(403).json({ message: "Only volunteers can unsave events" }) + } + + if (!eventId) { + return res.status(400).json({ message: "Event ID is required" }) + } + + const user = await User.findById(req.user._id) + if (!user) { + return res.status(404).json({ message: "User not found" }) + } + + user.savedEvents = user.savedEvents.filter(id => id.toString() !== eventId) + await user.save() + + return res.status(200).json({ message: "Event unsaved successfully" }) + } catch (error) { + console.log(`Error in unsaving event : ${error}`) + return res.status(500).json({ message: error?.message || "Internal error in unsaving event" }) + } +} + +export const getRegisteredEvents = async (req, res) => { + try { + console.log('Getting registered events for user:', req.user._id); + console.log('User role:', req.role); + + if (req.role !== "user") { + console.log('Access denied: User role is not "user"'); + return res.status(403).json({ message: "Only volunteers can view registered events" }) + } + + + // Get all registrations for this user (both pending and approved) + const registrations = await Registration.find({ userId: req.user._id }) + .populate({ + path: 'eventId', + populate: [ + { path: 'ngoId', select: 'name logo' } + ] + }) + .sort({ createdAt: -1 }) + + console.log('Found registrations:', registrations.length); + console.log('Registrations:', JSON.stringify(registrations, null, 2)); + + if (!registrations || registrations.length === 0) { + console.log('No registrations found for user'); + return res.status(200).json({ events: [] }) + } + + // Format events with registration status + const events = registrations.map(registration => ({ + ...registration.eventId.toObject(), + registrationStatus: registration.status, + registrationId: registration._id, + appliedAt: registration.appliedAt, + message: registration.message || "" + })) + + console.log('Formatted events:', events.length); + return res.status(200).json({ events }) + } catch (error) { + console.log(`Error in getting registered events : ${error}`) + console.log('Error stack:', error.stack); + return res.status(500).json({ message: error?.message || "Internal error in fetching registered events" }) + } } \ No newline at end of file diff --git a/Backend/src/index.js b/Backend/src/index.js index 80aa7ddd..ba3a9f69 100644 --- a/Backend/src/index.js +++ b/Backend/src/index.js @@ -2,11 +2,12 @@ import dotenv from 'dotenv' dotenv.config({ path: "./.env" }) import app from './app.js' import {connectDB} from './lib/db.js' +import { env } from './config/env.js' connectDB() .then(()=>{ - app.listen(process.env.PORT,()=>{ - console.log(`Server is running on port ${process.env.PORT}`) + app.listen(env.port,()=>{ + console.log(`Server is running on port ${env.port}`) }) }) .catch((err)=>{ diff --git a/Backend/src/lib/api.js b/Backend/src/lib/api.js new file mode 100644 index 00000000..8f05f7ab --- /dev/null +++ b/Backend/src/lib/api.js @@ -0,0 +1,8 @@ +import axios from "axios" + +export const api=axios.create({ + baseURL: import.meta.env.VITE_API_BASE_URL || "http://localhost:5000/api", + withCredentials: true + //withCredentials is used to send the cookies to the server + +}) \ No newline at end of file diff --git a/Backend/src/lib/cloudinary.js b/Backend/src/lib/cloudinary.js index aa1d009b..d8352e12 100644 --- a/Backend/src/lib/cloudinary.js +++ b/Backend/src/lib/cloudinary.js @@ -3,22 +3,32 @@ dotenv.config() import {v2 as cloudinary} from 'cloudinary' import fs from 'fs' +const CLOUDINARY_CLOUD_NAME = process.env.CLOUDINARY_CLOUD_NAME +const CLOUDINARY_API_KEY = process.env.CLOUDINARY_API_KEY +const CLOUDINARY_API_SECRET = process.env.CLOUDINARY_API_SECRET + cloudinary.config({ - cloud_name: process.env.CLOUDINARY_CLOUD_NAME, - api_key: process.env.CLOUDINARY_API_KEY, - api_secret: process.env.CLOUDINARY_API_SECRET + cloud_name: CLOUDINARY_CLOUD_NAME, + api_key: CLOUDINARY_API_KEY, + api_secret: CLOUDINARY_API_SECRET }) const uploadOnCloudinary = async(localFilePath) => { + if(!localFilePath) return null try{ - if(!localFilePath) return null - + if (!CLOUDINARY_CLOUD_NAME || !CLOUDINARY_API_KEY || !CLOUDINARY_API_SECRET) { + throw new Error("Cloudinary is not configured. Please set CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY, and CLOUDINARY_API_SECRET in Backend/.env") + } const response = await cloudinary.uploader.upload(localFilePath,{resource_type:"auto"}) return response } catch(error){ - fs.unlinkSync(localFilePath) - return null + throw new Error(error?.message || "Cloudinary upload failed") + } + finally{ + if (localFilePath && fs.existsSync(localFilePath)) { + fs.unlinkSync(localFilePath) + } } } diff --git a/Backend/src/lib/db.js b/Backend/src/lib/db.js index 2bb853cc..739cd868 100644 --- a/Backend/src/lib/db.js +++ b/Backend/src/lib/db.js @@ -2,10 +2,14 @@ import mongoose from 'mongoose' export const connectDB = async() => { try{ + if (!process.env.MONGODB_URL) { + throw new Error("MONGODB_URL is missing in Backend/.env") + } const conn = await mongoose.connect(process.env.MONGODB_URL) console.log(`MongoDB connected: ${conn.connection.host}`) } catch(error){ console.log(`MongoDB connection error: ${error}`) + throw error } } \ No newline at end of file diff --git a/Backend/src/middlewares/auth.middleware.js b/Backend/src/middlewares/auth.middleware.js index 49028f87..6f3bf168 100644 --- a/Backend/src/middlewares/auth.middleware.js +++ b/Backend/src/middlewares/auth.middleware.js @@ -39,6 +39,10 @@ export const protectRoute = async (req,res,next) => { } catch(error){ console.log(`Error in protect route middleware: ${error.message}`) + if (error?.name === "JsonWebTokenError" || error?.name === "TokenExpiredError") { + res.cookie("jwt", "", { maxAge: 0 }) + return res.status(401).json({ message: "Unauthorized : Invalid token" }) + } return res.status(500).json({message: "Internal server error"}) } } \ No newline at end of file diff --git a/Backend/src/middlewares/multer.middleware.js b/Backend/src/middlewares/multer.middleware.js index a262961d..c4d527da 100644 --- a/Backend/src/middlewares/multer.middleware.js +++ b/Backend/src/middlewares/multer.middleware.js @@ -1,11 +1,18 @@ import multer from 'multer' +import fs from 'fs' +import path from 'path' const storage = multer.diskStorage({ destination: function(req, file, cb) { - cb(null, "public/temp") + const uploadDir = path.resolve("public/temp") + if (!fs.existsSync(uploadDir)) { + fs.mkdirSync(uploadDir, { recursive: true }) + } + cb(null, uploadDir) }, filename: function(req, file, cb) { - cb(null, file.originalname) + const uniqueName = `${Date.now()}-${file.originalname}` + cb(null, uniqueName) } }) diff --git a/Backend/src/models/event.model.js b/Backend/src/models/event.model.js index ab786131..f05bf596 100644 --- a/Backend/src/models/event.model.js +++ b/Backend/src/models/event.model.js @@ -10,10 +10,23 @@ const eventSchema = new mongoose.Schema( type:String, required:true }, + longDescription:{ + type:String, + required:true + }, + category: { + type: String, + default: "General", + }, location: { + type: String, required: true }, + coordinates:{ + lat:{type:Number,default:0}, + lng:{type:Number,default:0}, + }, date:{ type:Date, required:true @@ -23,10 +36,12 @@ const eventSchema = new mongoose.Schema( required: true }, image: { - type: String + type: String, + default:"" }, imageId: { - type: String + type: String, + default:"" }, ngoId:{ type:mongoose.Schema.Types.ObjectId, @@ -40,6 +55,11 @@ const eventSchema = new mongoose.Schema( } ], + requirements:[{type:String}], + + benefits:[{type:String}], + + maxVolunteers: { type: Number, required: true @@ -54,7 +74,6 @@ const eventSchema = new mongoose.Schema( }, {timestamps: true}); eventSchema.index({location:1}); -eventSchema.index({category:1}); eventSchema.index({ skillsRequired: 1 }); const Event = mongoose.model("Event",eventSchema) diff --git a/Backend/src/models/registration.model.js b/Backend/src/models/registration.model.js index 8c8c6c21..7e513f52 100644 --- a/Backend/src/models/registration.model.js +++ b/Backend/src/models/registration.model.js @@ -22,7 +22,7 @@ const registrationSchema = new mongoose.Schema({ message: { type: String, - required: true + default: "" }, appliedAt: { diff --git a/Backend/src/models/user.model.js b/Backend/src/models/user.model.js index a3b399be..6b7153ad 100644 --- a/Backend/src/models/user.model.js +++ b/Backend/src/models/user.model.js @@ -25,11 +25,11 @@ const userSchema = new mongoose.Schema( }, profilePic: { type: String, - required: true + default: "" }, profilePicId: { type: String, - required: true + default: "" }, skillsPossessed: [ { @@ -43,6 +43,12 @@ const userSchema = new mongoose.Schema( type: Schema.Types.ObjectId, ref: "Event" } + ], + savedEvents: [ + { + type: Schema.Types.ObjectId, + ref: "Event" + } ], }, {timestamps: true} ) diff --git a/Backend/src/routes/event.route.js b/Backend/src/routes/event.route.js index cdc873d3..a41e0f1f 100644 --- a/Backend/src/routes/event.route.js +++ b/Backend/src/routes/event.route.js @@ -1,12 +1,35 @@ import express from 'express' import { protectRoute } from '../middlewares/auth.middleware.js' -import { addEvent } from '../controllers/event.controller.js' -import { volunteerForEvent, viewRegistrations } from '../controllers/resgistration.controller.js' +import { + acceptRegistration, + getNgoApplications, + getVolunteerApplications, + getVolunteerSavedEvents, + rejectRegistration, + toggleSaveEvent, + volunteerForEvent, + viewRegistrations, +} from '../controllers/resgistration.controller.js' import { upload } from '../middlewares/multer.middleware.js' +import { getAllEvents, getEventById, getMyEvents, addEvent, updateEvent, deleteEvent } from '../controllers/event.controller.js' const router = express.Router() +router.get("/",getAllEvents) + +router.get("/ngo/my-events",protectRoute,getMyEvents) +router.get("/ngo/applications", protectRoute, getNgoApplications) +router.get("/volunteer/applications", protectRoute, getVolunteerApplications) +router.get("/volunteer/saved-events", protectRoute, getVolunteerSavedEvents) +router.get("/:id",getEventById) + + router.post("/add-event",protectRoute,upload.fields([{name: "image", maxCount: 1}]),addEvent) +router.patch("/:id", protectRoute, upload.fields([{name: "image", maxCount: 1}]), updateEvent) +router.delete("/:id", protectRoute, deleteEvent) router.post("/:id/volunteer",protectRoute,volunteerForEvent) +router.post("/:id/save-toggle",protectRoute,toggleSaveEvent) router.post("/:id/view-registrations",protectRoute,viewRegistrations) +router.post("/:id/registrations/:registrationId/approve", protectRoute, acceptRegistration) +router.post("/:id/registrations/:registrationId/reject", protectRoute, rejectRegistration) export default router \ No newline at end of file diff --git a/Backend/src/routes/ngo.route.js b/Backend/src/routes/ngo.route.js index bf9e9e55..c94f5b10 100644 --- a/Backend/src/routes/ngo.route.js +++ b/Backend/src/routes/ngo.route.js @@ -1,11 +1,13 @@ import express from 'express' import { upload } from '../middlewares/multer.middleware.js' -import {registerNGO, loginNGO, logoutNGO } from '../controllers/ngo.controller.js' +import { protectRoute } from '../middlewares/auth.middleware.js' +import {registerNGO, loginNGO, logoutNGO, updateNgoLogo } from '../controllers/ngo.controller.js' const router = express.Router() router.post("/register-ngo",upload.fields([{name: "logo", maxCount: 1}]),registerNGO) router.post("/login-ngo",loginNGO) router.post("/logout-ngo",logoutNGO) +router.patch("/logo", protectRoute, upload.fields([{name: "logo", maxCount: 1}]), updateNgoLogo) export default router; \ No newline at end of file diff --git a/Backend/src/routes/user.route.js b/Backend/src/routes/user.route.js index 85a56eef..8853769c 100644 --- a/Backend/src/routes/user.route.js +++ b/Backend/src/routes/user.route.js @@ -1,11 +1,17 @@ import express from 'express' import {upload} from "../middlewares/multer.middleware.js" -import { registerUser, loginUser, logoutUser } from '../controllers/user.controller.js'; +import { protectRoute } from '../middlewares/auth.middleware.js'; +import { registerUser, loginUser, logoutUser, updateUserProfilePic, saveEvent, getSavedEvents, unsaveEvent, getRegisteredEvents } from '../controllers/user.controller.js'; const router = express.Router() router.post("/register-user",upload.fields([{name: "profilePic", maxCount: 1}]),registerUser) router.post("/login-user",loginUser) router.post("/logout-user",logoutUser) +router.patch("/profile-picture", protectRoute, upload.fields([{name: "profilePic", maxCount: 1}]), updateUserProfilePic) +router.post("/save-event", protectRoute, saveEvent) +router.get("/saved-events", protectRoute, getSavedEvents) +router.post("/unsave-event", protectRoute, unsaveEvent) +router.get("/registered-events", protectRoute, getRegisteredEvents) export default router; \ No newline at end of file diff --git a/Backend/src/scripts/seedDemoData.js b/Backend/src/scripts/seedDemoData.js new file mode 100644 index 00000000..430d0bf2 --- /dev/null +++ b/Backend/src/scripts/seedDemoData.js @@ -0,0 +1,222 @@ +import dotenv from "dotenv" +import bcrypt from "bcryptjs" +import mongoose from "mongoose" +import { connectDB } from "../lib/db.js" +import NGO from "../models/ngo.model.js" +import Event from "../models/event.model.js" +import User from "../models/user.model.js" + +dotenv.config({ path: "./.env" }) + +const ngoSeed = [ + { + name: "Green Earth Collective", + email: "greenearth@example.com", + password: "demo123", + contactNumber: "9876543210", + location: "Pune, Maharashtra", + website: "https://greenearth.example.com", + briefDescription: "Community drives for clean neighborhoods, river care, and urban sustainability.", + logo: "https://images.unsplash.com/photo-1517486808906-6ca8b3f04846?auto=format&fit=crop&w=500&q=80", + }, + { + name: "Teach Forward Foundation", + email: "teachforward@example.com", + password: "demo123", + contactNumber: "9123456780", + location: "Mumbai, Maharashtra", + website: "https://teachforward.example.com", + briefDescription: "Weekend teaching workshops, reading clubs, and youth mentorship programs.", + logo: "https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=500&q=80", + }, + { + name: "Health Reach Trust", + email: "healthreach@example.com", + password: "demo123", + contactNumber: "9988776655", + location: "Nashik, Maharashtra", + website: "https://healthreach.example.com", + briefDescription: "Accessible health camps, awareness sessions, and support for underserved communities.", + logo: "https://images.unsplash.com/photo-1576091160399-112ba8d25d1f?auto=format&fit=crop&w=500&q=80", + }, +] + +const volunteerSeed = [ + { + fullname: "Aarav Mehta", + email: "aarav@example.com", + password: "demo123", + phoneNumber: "9000011111", + address: "Kothrud, Pune", + skillsPossessed: ["Event Management", "Public Speaking"], + }, + { + fullname: "Siya Patel", + email: "siya@example.com", + password: "demo123", + phoneNumber: "9000022222", + address: "Andheri, Mumbai", + skillsPossessed: ["Teaching", "Writing"], + }, +] + +const eventSeed = [ + { + ngoEmail: "greenearth@example.com", + title: "River Cleanup Morning Drive", + description: "Help clean the riverfront and sort collected waste for recycling.", + longDescription: "Join our guided cleanup drive to restore the local riverfront, improve public spaces, and inspire eco-conscious action in the neighborhood.", + category: "Environment", + location: "Mula River Walk, Pune", + dateOffsetDays: 4, + timings: "7:30 AM - 11:30 AM", + image: "https://images.unsplash.com/photo-1618477461853-cf6ed80faba5?auto=format&fit=crop&w=1200&q=80", + skillsRequired: ["Teamwork", "Physical Fitness"], + requirements: ["Wear comfortable clothes", "Carry a water bottle"], + benefits: ["Cleanup certificate", "Community service hours"], + maxVolunteers: 35, + }, + { + ngoEmail: "greenearth@example.com", + title: "Tree Plantation Weekend", + description: "Plant native saplings and help maintain a new green patch in the city.", + longDescription: "Volunteers will assist with soil preparation, planting, watering, and documenting the plantation effort for future maintenance drives.", + category: "Community", + location: "Baner Hill, Pune", + dateOffsetDays: 10, + timings: "8:00 AM - 12:00 PM", + image: "https://images.unsplash.com/photo-1466611653911-95081537e5b7?auto=format&fit=crop&w=1200&q=80", + skillsRequired: ["Teamwork"], + requirements: ["Sun protection recommended"], + benefits: ["Hands-on environmental action", "Networking with local volunteers"], + maxVolunteers: 25, + }, + { + ngoEmail: "teachforward@example.com", + title: "Math Support Workshop", + description: "Support school students with maths basics and activity-led learning.", + longDescription: "This classroom support session pairs volunteers with small student groups to improve confidence, curiosity, and problem-solving skills.", + category: "Education", + location: "Dharavi Learning Center, Mumbai", + dateOffsetDays: 6, + timings: "2:00 PM - 5:00 PM", + image: "https://images.unsplash.com/photo-1577896851231-70ef18881754?auto=format&fit=crop&w=1200&q=80", + skillsRequired: ["Teaching", "Patience"], + requirements: ["Comfortable working with children"], + benefits: ["Teaching experience", "Volunteer recognition"], + maxVolunteers: 18, + }, + { + ngoEmail: "teachforward@example.com", + title: "Reading Club Mentor Session", + description: "Guide children through storytelling, reading practice, and discussions.", + longDescription: "Mentors will facilitate reading circles, pronunciation practice, and confidence-building activities for young learners.", + category: "Education", + location: "Chembur Community Hall, Mumbai", + dateOffsetDays: 13, + timings: "11:00 AM - 1:30 PM", + image: "https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1200&q=80", + skillsRequired: ["Writing", "Public Speaking"], + requirements: ["Basic English reading fluency"], + benefits: ["Mentoring experience", "Community impact certificate"], + maxVolunteers: 20, + }, + { + ngoEmail: "healthreach@example.com", + title: "Community Health Awareness Camp", + description: "Assist with registrations, guidance desks, and awareness activities.", + longDescription: "Support our outreach team as we welcome patients, organize queues, and help visitors navigate awareness sessions and basic screenings.", + category: "Health", + location: "CIDCO Ground, Nashik", + dateOffsetDays: 8, + timings: "9:00 AM - 2:00 PM", + image: "https://images.unsplash.com/photo-1631815588090-d4bfec5b1ccb?auto=format&fit=crop&w=1200&q=80", + skillsRequired: ["First Aid", "Event Management"], + requirements: ["Able to stand for longer durations"], + benefits: ["Health outreach exposure", "Volunteer badge"], + maxVolunteers: 30, + }, +] + +const addDays = (days) => { + const date = new Date() + date.setDate(date.getDate() + days) + return date +} + +const seed = async () => { + try { + await connectDB() + + const ngoMap = new Map() + for (const ngoData of ngoSeed) { + const existing = await NGO.findOne({ email: ngoData.email }) + const hashedPassword = existing?.password || (await bcrypt.hash(ngoData.password, 10)) + const ngo = await NGO.findOneAndUpdate( + { email: ngoData.email }, + { + ...ngoData, + password: hashedPassword, + logoId: "", + }, + { upsert: true, new: true, setDefaultsOnInsert: true } + ) + ngoMap.set(ngoData.email, ngo) + } + + for (const userData of volunteerSeed) { + const existing = await User.findOne({ email: userData.email }) + const hashedPassword = existing?.password || (await bcrypt.hash(userData.password, 10)) + await User.findOneAndUpdate( + { email: userData.email }, + { + ...userData, + password: hashedPassword, + profilePic: "", + profilePicId: "", + }, + { upsert: true, new: true, setDefaultsOnInsert: true } + ) + } + + for (const eventData of eventSeed) { + const ngo = ngoMap.get(eventData.ngoEmail) + if (!ngo) continue + + const event = await Event.findOneAndUpdate( + { title: eventData.title, ngoId: ngo._id }, + { + title: eventData.title, + description: eventData.description, + longDescription: eventData.longDescription, + category: eventData.category, + location: eventData.location, + date: addDays(eventData.dateOffsetDays), + timings: eventData.timings, + image: eventData.image, + imageId: "", + ngoId: ngo._id, + skillsRequired: eventData.skillsRequired, + requirements: eventData.requirements, + benefits: eventData.benefits, + maxVolunteers: eventData.maxVolunteers, + volunteers: [], + }, + { upsert: true, new: true, setDefaultsOnInsert: true } + ) + + await NGO.findByIdAndUpdate(ngo._id, { $addToSet: { eventsPosted: event._id } }) + } + + console.log("Demo NGOs, volunteers, and events seeded successfully.") + console.log("Demo NGO login: greenearth@example.com / demo123") + console.log("Demo volunteer login: aarav@example.com / demo123") + } catch (error) { + console.error("Failed to seed demo data:", error) + process.exitCode = 1 + } finally { + await mongoose.connection.close() + } +} + +seed() diff --git a/Frontend/node_modules/.vite/deps/_metadata.json b/Frontend/node_modules/.vite/deps/_metadata.json index a68a61a1..6bc13c9f 100644 --- a/Frontend/node_modules/.vite/deps/_metadata.json +++ b/Frontend/node_modules/.vite/deps/_metadata.json @@ -1,87 +1,93 @@ { - "hash": "1a455fde", - "configHash": "5eb9fb95", + "hash": "162fdbb7", + "configHash": "292f6e7f", "lockfileHash": "663710ba", - "browserHash": "7930d85d", + "browserHash": "80bc0bf5", "optimized": { + "axios": { + "src": "../../axios/index.js", + "file": "axios.js", + "fileHash": "5d5815e9", + "needsInterop": false + }, "date-fns": { "src": "../../date-fns/esm/index.js", "file": "date-fns.js", - "fileHash": "cbca0292", + "fileHash": "ee8c0492", "needsInterop": false }, "framer-motion": { "src": "../../framer-motion/dist/es/index.mjs", "file": "framer-motion.js", - "fileHash": "7acf3c64", + "fileHash": "a656bd55", "needsInterop": false }, "react-dom": { "src": "../../react-dom/index.js", "file": "react-dom.js", - "fileHash": "406705fe", + "fileHash": "b94aaf02", "needsInterop": true }, "react-dom/client": { "src": "../../react-dom/client.js", "file": "react-dom_client.js", - "fileHash": "e31aade8", + "fileHash": "007113d1", "needsInterop": true }, "react-hot-toast": { "src": "../../react-hot-toast/dist/index.mjs", "file": "react-hot-toast.js", - "fileHash": "4f03dede", + "fileHash": "d6d5ba9d", "needsInterop": false }, "react-icons/fa": { "src": "../../react-icons/fa/index.esm.js", "file": "react-icons_fa.js", - "fileHash": "8a4d76a9", + "fileHash": "f94783c1", "needsInterop": false }, "react-icons/hi": { "src": "../../react-icons/hi/index.esm.js", "file": "react-icons_hi.js", - "fileHash": "cb793313", + "fileHash": "e41ebdf3", "needsInterop": false }, "react-router-dom": { "src": "../../react-router-dom/dist/index.js", "file": "react-router-dom.js", - "fileHash": "80659c20", + "fileHash": "30b57423", "needsInterop": false }, "react": { "src": "../../react/index.js", "file": "react.js", - "fileHash": "f7b1a6c7", + "fileHash": "824da348", "needsInterop": true }, "react/jsx-dev-runtime": { "src": "../../react/jsx-dev-runtime.js", "file": "react_jsx-dev-runtime.js", - "fileHash": "de1bd844", + "fileHash": "cd6ed6bf", "needsInterop": true }, "react/jsx-runtime": { "src": "../../react/jsx-runtime.js", "file": "react_jsx-runtime.js", - "fileHash": "c7487e11", + "fileHash": "38e6e23a", "needsInterop": true } }, "chunks": { - "iconBase-BCeeRc1F": { - "file": "iconBase-BCeeRc1F.js", + "chunk-D6g4UhsZ": { + "file": "chunk-D6g4UhsZ.js", "isDynamicEntry": false }, - "react-Dayigfg7": { - "file": "react-Dayigfg7.js", + "iconBase-CA47SOzY": { + "file": "iconBase-CA47SOzY.js", "isDynamicEntry": false }, - "react-dom-BTcKy37o": { - "file": "react-dom-BTcKy37o.js", + "react-dom-BxEVyh8D": { + "file": "react-dom-BxEVyh8D.js", "isDynamicEntry": false } } diff --git a/Frontend/node_modules/.vite/deps/framer-motion.js b/Frontend/node_modules/.vite/deps/framer-motion.js index 135e9f47..406a32c8 100644 --- a/Frontend/node_modules/.vite/deps/framer-motion.js +++ b/Frontend/node_modules/.vite/deps/framer-motion.js @@ -1,4 +1,5 @@ -import { a as __toCommonJS, i as __exportAll, o as __toESM, r as __esmMin, t as require_react } from "./react-Dayigfg7.js"; +import { a as __toESM, i as __toCommonJS, n as __esmMin, r as __exportAll } from "./chunk-D6g4UhsZ.js"; +import { t as require_react } from "./react.js"; //#region node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs var import_react = /* @__PURE__ */ __toESM(require_react(), 1); /** diff --git a/Frontend/node_modules/.vite/deps/framer-motion.js.map b/Frontend/node_modules/.vite/deps/framer-motion.js.map index 1993971b..d750a468 100644 --- a/Frontend/node_modules/.vite/deps/framer-motion.js.map +++ b/Frontend/node_modules/.vite/deps/framer-motion.js.map @@ -1 +1 @@ -{"version":3,"file":"framer-motion.js","names":["useLayoutEffect","useEffect","calcOrigin","scrapeMotionValuesFromProps","maxElapsed","getVelocity","getAnimatableNone","getMixer","defaultOffset","defaultOffset","maxDuration","getValueTransition","getValueTransition","getValueTransition","id","xKeys","yKeys","id","getValueTransition","getComputedStyle","scrapeMotionValuesFromProps","defaultOffset","useEffect","defaultOffset"],"sources":["../../framer-motion/dist/es/context/MotionConfigContext.mjs","../../framer-motion/dist/es/context/MotionContext/index.mjs","../../framer-motion/dist/es/context/PresenceContext.mjs","../../framer-motion/dist/es/utils/is-browser.mjs","../../framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../framer-motion/dist/es/context/LazyContext.mjs","../../framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs","../../framer-motion/dist/es/animation/optimized-appear/data-id.mjs","../../framer-motion/dist/es/motion/utils/use-visual-element.mjs","../../framer-motion/dist/es/utils/is-ref-object.mjs","../../framer-motion/dist/es/motion/utils/use-motion-ref.mjs","../../framer-motion/dist/es/render/utils/is-variant-label.mjs","../../framer-motion/dist/es/animation/utils/is-animation-controls.mjs","../../framer-motion/dist/es/render/utils/variant-props.mjs","../../framer-motion/dist/es/render/utils/is-controlling-variants.mjs","../../framer-motion/dist/es/context/MotionContext/utils.mjs","../../framer-motion/dist/es/context/MotionContext/create.mjs","../../framer-motion/dist/es/motion/features/definitions.mjs","../../framer-motion/dist/es/motion/features/load-features.mjs","../../framer-motion/dist/es/context/LayoutGroupContext.mjs","../../framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","../../framer-motion/dist/es/motion/utils/symbol.mjs","../../framer-motion/dist/es/motion/index.mjs","../../framer-motion/dist/es/render/dom/motion-proxy.mjs","../../framer-motion/dist/es/render/svg/lowercase-elements.mjs","../../framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","../../framer-motion/dist/es/projection/styles/scale-correction.mjs","../../framer-motion/dist/es/render/html/utils/transform.mjs","../../framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs","../../framer-motion/dist/es/value/utils/is-motion-value.mjs","../../framer-motion/dist/es/render/html/utils/build-transform.mjs","../../framer-motion/dist/es/render/dom/utils/is-css-variable.mjs","../../framer-motion/dist/es/render/dom/value-types/get-as-type.mjs","../../framer-motion/dist/es/utils/clamp.mjs","../../framer-motion/dist/es/value/types/numbers/index.mjs","../../framer-motion/dist/es/value/types/utils.mjs","../../framer-motion/dist/es/value/types/numbers/units.mjs","../../framer-motion/dist/es/render/dom/value-types/type-int.mjs","../../framer-motion/dist/es/render/dom/value-types/number.mjs","../../framer-motion/dist/es/render/html/utils/build-styles.mjs","../../framer-motion/dist/es/render/html/utils/create-render-state.mjs","../../framer-motion/dist/es/render/html/use-props.mjs","../../framer-motion/dist/es/motion/utils/valid-prop.mjs","../../@emotion/memoize/dist/memoize.browser.esm.js","../../@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","../../framer-motion/dist/es/render/dom/utils/filter-props.mjs","../../framer-motion/dist/es/render/svg/utils/transform-origin.mjs","../../framer-motion/dist/es/render/svg/utils/path.mjs","../../framer-motion/dist/es/render/svg/utils/build-attrs.mjs","../../framer-motion/dist/es/render/svg/utils/create-render-state.mjs","../../framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs","../../framer-motion/dist/es/render/svg/use-props.mjs","../../framer-motion/dist/es/render/dom/use-render.mjs","../../framer-motion/dist/es/render/html/utils/render.mjs","../../framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs","../../framer-motion/dist/es/render/svg/utils/render.mjs","../../framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs","../../framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs","../../framer-motion/dist/es/render/utils/resolve-variants.mjs","../../framer-motion/dist/es/utils/use-constant.mjs","../../framer-motion/dist/es/animation/utils/is-keyframes-target.mjs","../../framer-motion/dist/es/utils/resolve-value.mjs","../../framer-motion/dist/es/value/utils/resolve-motion-value.mjs","../../framer-motion/dist/es/motion/utils/use-visual-state.mjs","../../framer-motion/dist/es/utils/noop.mjs","../../framer-motion/dist/es/frameloop/render-step.mjs","../../framer-motion/dist/es/frameloop/batcher.mjs","../../framer-motion/dist/es/frameloop/frame.mjs","../../framer-motion/dist/es/render/svg/config-motion.mjs","../../framer-motion/dist/es/render/html/config-motion.mjs","../../framer-motion/dist/es/render/dom/utils/create-config.mjs","../../framer-motion/dist/es/events/add-dom-event.mjs","../../framer-motion/dist/es/events/utils/is-primary-pointer.mjs","../../framer-motion/dist/es/events/event-info.mjs","../../framer-motion/dist/es/events/add-pointer-event.mjs","../../framer-motion/dist/es/utils/pipe.mjs","../../framer-motion/dist/es/gestures/drag/utils/lock.mjs","../../framer-motion/dist/es/motion/features/Feature.mjs","../../framer-motion/dist/es/gestures/hover.mjs","../../framer-motion/dist/es/gestures/focus.mjs","../../framer-motion/dist/es/gestures/utils/is-node-or-child.mjs","../../framer-motion/dist/es/gestures/press.mjs","../../framer-motion/dist/es/motion/features/viewport/observers.mjs","../../framer-motion/dist/es/motion/features/viewport/index.mjs","../../framer-motion/dist/es/motion/features/gestures.mjs","../../framer-motion/dist/es/utils/shallow-compare.mjs","../../framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs","../../framer-motion/dist/es/utils/errors.mjs","../../framer-motion/dist/es/utils/time-conversion.mjs","../../framer-motion/dist/es/utils/use-instant-transition-state.mjs","../../framer-motion/dist/es/easing/utils/is-bezier-definition.mjs","../../framer-motion/dist/es/animation/animators/waapi/easing.mjs","../../framer-motion/dist/es/animation/animators/waapi/index.mjs","../../framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs","../../framer-motion/dist/es/easing/cubic-bezier.mjs","../../framer-motion/dist/es/easing/ease.mjs","../../framer-motion/dist/es/easing/utils/is-easing-array.mjs","../../framer-motion/dist/es/easing/modifiers/mirror.mjs","../../framer-motion/dist/es/easing/modifiers/reverse.mjs","../../framer-motion/dist/es/easing/circ.mjs","../../framer-motion/dist/es/easing/back.mjs","../../framer-motion/dist/es/easing/anticipate.mjs","../../framer-motion/dist/es/easing/utils/map.mjs","../../framer-motion/dist/es/value/types/color/utils.mjs","../../framer-motion/dist/es/value/types/color/rgba.mjs","../../framer-motion/dist/es/value/types/color/hex.mjs","../../framer-motion/dist/es/value/types/color/hsla.mjs","../../framer-motion/dist/es/value/types/color/index.mjs","../../framer-motion/dist/es/utils/mix.mjs","../../framer-motion/dist/es/utils/hsla-to-rgba.mjs","../../framer-motion/dist/es/utils/mix-color.mjs","../../framer-motion/dist/es/value/types/complex/index.mjs","../../framer-motion/dist/es/utils/mix-complex.mjs","../../framer-motion/dist/es/utils/progress.mjs","../../framer-motion/dist/es/utils/interpolate.mjs","../../framer-motion/dist/es/utils/offsets/fill.mjs","../../framer-motion/dist/es/utils/offsets/default.mjs","../../framer-motion/dist/es/utils/offsets/time.mjs","../../framer-motion/dist/es/animation/generators/keyframes.mjs","../../framer-motion/dist/es/utils/velocity-per-second.mjs","../../framer-motion/dist/es/animation/generators/utils/velocity.mjs","../../framer-motion/dist/es/animation/generators/spring/find.mjs","../../framer-motion/dist/es/animation/generators/spring/index.mjs","../../framer-motion/dist/es/animation/generators/inertia.mjs","../../framer-motion/dist/es/animation/animators/js/driver-frameloop.mjs","../../framer-motion/dist/es/animation/generators/utils/calc-duration.mjs","../../framer-motion/dist/es/animation/animators/js/index.mjs","../../framer-motion/dist/es/utils/memo.mjs","../../framer-motion/dist/es/animation/animators/waapi/create-accelerated-animation.mjs","../../framer-motion/dist/es/animation/animators/instant.mjs","../../framer-motion/dist/es/animation/utils/default-transitions.mjs","../../framer-motion/dist/es/animation/utils/is-animatable.mjs","../../framer-motion/dist/es/value/types/complex/filter.mjs","../../framer-motion/dist/es/render/dom/value-types/defaults.mjs","../../framer-motion/dist/es/render/dom/value-types/animatable-none.mjs","../../framer-motion/dist/es/utils/is-zero-value-string.mjs","../../framer-motion/dist/es/animation/utils/is-none.mjs","../../framer-motion/dist/es/animation/utils/keyframes.mjs","../../framer-motion/dist/es/animation/utils/transitions.mjs","../../framer-motion/dist/es/utils/GlobalConfig.mjs","../../framer-motion/dist/es/animation/interfaces/motion-value.mjs","../../framer-motion/dist/es/value/use-will-change/is.mjs","../../framer-motion/dist/es/utils/is-numerical-string.mjs","../../framer-motion/dist/es/utils/array.mjs","../../framer-motion/dist/es/utils/subscription-manager.mjs","../../framer-motion/dist/es/utils/warn-once.mjs","../../framer-motion/dist/es/value/index.mjs","../../framer-motion/dist/es/render/dom/value-types/test.mjs","../../framer-motion/dist/es/render/dom/value-types/type-auto.mjs","../../framer-motion/dist/es/render/dom/value-types/dimensions.mjs","../../framer-motion/dist/es/render/dom/value-types/find.mjs","../../framer-motion/dist/es/render/utils/setters.mjs","../../framer-motion/dist/es/animation/interfaces/visual-element-target.mjs","../../framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs","../../framer-motion/dist/es/animation/interfaces/visual-element.mjs","../../framer-motion/dist/es/render/utils/animation-state.mjs","../../framer-motion/dist/es/motion/features/animation/index.mjs","../../framer-motion/dist/es/motion/features/animation/exit.mjs","../../framer-motion/dist/es/motion/features/animations.mjs","../../framer-motion/dist/es/utils/distance.mjs","../../framer-motion/dist/es/gestures/pan/PanSession.mjs","../../framer-motion/dist/es/projection/geometry/delta-calc.mjs","../../framer-motion/dist/es/gestures/drag/utils/constraints.mjs","../../framer-motion/dist/es/projection/geometry/models.mjs","../../framer-motion/dist/es/projection/utils/each-axis.mjs","../../framer-motion/dist/es/projection/geometry/conversion.mjs","../../framer-motion/dist/es/projection/utils/has-transform.mjs","../../framer-motion/dist/es/projection/geometry/delta-apply.mjs","../../framer-motion/dist/es/projection/utils/measure.mjs","../../framer-motion/dist/es/utils/get-context-window.mjs","../../framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","../../framer-motion/dist/es/gestures/drag/index.mjs","../../framer-motion/dist/es/gestures/pan/index.mjs","../../framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../framer-motion/dist/es/projection/node/state.mjs","../../framer-motion/dist/es/projection/styles/scale-border-radius.mjs","../../framer-motion/dist/es/projection/styles/scale-box-shadow.mjs","../../framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","../../framer-motion/dist/es/projection/animation/mix-values.mjs","../../framer-motion/dist/es/projection/geometry/copy.mjs","../../framer-motion/dist/es/projection/geometry/delta-remove.mjs","../../framer-motion/dist/es/projection/geometry/utils.mjs","../../framer-motion/dist/es/projection/shared/stack.mjs","../../framer-motion/dist/es/projection/styles/transform.mjs","../../framer-motion/dist/es/render/utils/compare-by-depth.mjs","../../framer-motion/dist/es/render/utils/flat-tree.mjs","../../framer-motion/dist/es/utils/delay.mjs","../../framer-motion/dist/es/debug/record.mjs","../../framer-motion/dist/es/render/dom/utils/is-svg-element.mjs","../../framer-motion/dist/es/animation/interfaces/single-value.mjs","../../framer-motion/dist/es/projection/node/create-projection-node.mjs","../../framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs","../../framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs","../../framer-motion/dist/es/motion/features/drag.mjs","../../framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs","../../framer-motion/dist/es/render/dom/utils/unit-conversion.mjs","../../framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs","../../framer-motion/dist/es/utils/reduced-motion/state.mjs","../../framer-motion/dist/es/utils/reduced-motion/index.mjs","../../framer-motion/dist/es/render/utils/motion-values.mjs","../../framer-motion/dist/es/render/store.mjs","../../framer-motion/dist/es/render/VisualElement.mjs","../../framer-motion/dist/es/render/dom/DOMVisualElement.mjs","../../framer-motion/dist/es/render/html/HTMLVisualElement.mjs","../../framer-motion/dist/es/render/svg/SVGVisualElement.mjs","../../framer-motion/dist/es/render/dom/create-visual-element.mjs","../../framer-motion/dist/es/motion/features/layout.mjs","../../framer-motion/dist/es/render/dom/motion.mjs","../../framer-motion/dist/es/render/dom/motion-minimal.mjs","../../framer-motion/dist/es/utils/use-is-mounted.mjs","../../framer-motion/dist/es/utils/use-force-update.mjs","../../framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../framer-motion/dist/es/utils/use-unmount-effect.mjs","../../framer-motion/dist/es/components/AnimatePresence/index.mjs","../../framer-motion/dist/es/components/MotionConfig/index.mjs","../../framer-motion/dist/es/components/LazyMotion/index.mjs","../../framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs","../../framer-motion/dist/es/projection/node/group.mjs","../../framer-motion/dist/es/components/LayoutGroup/index.mjs","../../framer-motion/dist/es/context/ReorderContext.mjs","../../framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs","../../framer-motion/dist/es/components/Reorder/Group.mjs","../../framer-motion/dist/es/value/use-motion-value.mjs","../../framer-motion/dist/es/utils/transform.mjs","../../framer-motion/dist/es/value/use-combine-values.mjs","../../framer-motion/dist/es/value/use-computed.mjs","../../framer-motion/dist/es/value/use-transform.mjs","../../framer-motion/dist/es/components/Reorder/Item.mjs","../../framer-motion/dist/es/components/Reorder/index.mjs","../../framer-motion/dist/es/render/dom/features-animation.mjs","../../framer-motion/dist/es/render/dom/features-max.mjs","../../framer-motion/dist/es/value/use-motion-template.mjs","../../framer-motion/dist/es/value/use-spring.mjs","../../framer-motion/dist/es/utils/use-motion-value-event.mjs","../../framer-motion/dist/es/value/use-velocity.mjs","../../framer-motion/dist/es/render/dom/utils/resolve-element.mjs","../../framer-motion/dist/es/render/dom/resize/handle-element.mjs","../../framer-motion/dist/es/render/dom/resize/handle-window.mjs","../../framer-motion/dist/es/render/dom/resize/index.mjs","../../framer-motion/dist/es/render/dom/scroll/info.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/index.mjs","../../framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs","../../framer-motion/dist/es/render/dom/scroll/track.mjs","../../framer-motion/dist/es/value/use-scroll.mjs","../../framer-motion/dist/es/value/scroll/use-element-scroll.mjs","../../framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs","../../framer-motion/dist/es/utils/use-animation-frame.mjs","../../framer-motion/dist/es/value/use-time.mjs","../../framer-motion/dist/es/value/use-will-change/index.mjs","../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs","../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs","../../framer-motion/dist/es/animation/hooks/animation-controls.mjs","../../framer-motion/dist/es/render/dom/scroll/observe.mjs","../../framer-motion/dist/es/render/dom/scroll/supports.mjs","../../framer-motion/dist/es/animation/GroupPlaybackControls.mjs","../../framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs","../../framer-motion/dist/es/animation/utils/create-visual-element.mjs","../../framer-motion/dist/es/easing/utils/create-generator-easing.mjs","../../framer-motion/dist/es/animation/sequence/utils/calc-time.mjs","../../framer-motion/dist/es/utils/wrap.mjs","../../framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs","../../framer-motion/dist/es/animation/sequence/utils/edit.mjs","../../framer-motion/dist/es/animation/sequence/utils/sort.mjs","../../framer-motion/dist/es/animation/sequence/create.mjs","../../framer-motion/dist/es/animation/animate.mjs","../../framer-motion/dist/es/animation/hooks/use-animate.mjs","../../framer-motion/dist/es/animation/hooks/use-animation.mjs","../../framer-motion/dist/es/utils/use-cycle.mjs","../../framer-motion/dist/es/render/dom/viewport/index.mjs","../../framer-motion/dist/es/utils/use-in-view.mjs","../../framer-motion/dist/es/gestures/drag/use-drag-controls.mjs","../../framer-motion/dist/es/events/use-dom-event.mjs","../../framer-motion/dist/es/motion/utils/is-motion-component.mjs","../../framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs","../../framer-motion/dist/es/projection/use-instant-layout-transition.mjs","../../framer-motion/dist/es/utils/use-instant-transition.mjs","../../framer-motion/dist/es/projection/use-reset-projection.mjs","../../framer-motion/dist/es/animation/optimized-appear/store-id.mjs","../../framer-motion/dist/es/animation/optimized-appear/store.mjs","../../framer-motion/dist/es/animation/optimized-appear/handoff.mjs","../../framer-motion/dist/es/animation/optimized-appear/start.mjs","../../framer-motion/dist/es/animation/hooks/use-animated-state.mjs","../../framer-motion/dist/es/value/use-inverted-scale.mjs","../../framer-motion/dist/es/components/AnimateSharedLayout.mjs","../../framer-motion/dist/es/render/dom/scroll/index.mjs","../../framer-motion/dist/es/animation/utils/stagger.mjs","../../framer-motion/dist/es/frameloop/index-legacy.mjs"],"sourcesContent":["import { createContext } from 'react';\r\n\r\n/**\r\n * @public\r\n */\r\nconst MotionConfigContext = createContext({\r\n transformPagePoint: (p) => p,\r\n isStatic: false,\r\n reducedMotion: \"never\",\r\n});\r\n\r\nexport { MotionConfigContext };\r\n","import { createContext } from 'react';\r\n\r\nconst MotionContext = createContext({});\r\n\r\nexport { MotionContext };\r\n","import { createContext } from 'react';\r\n\r\n/**\r\n * @public\r\n */\r\nconst PresenceContext = createContext(null);\r\n\r\nexport { PresenceContext };\r\n","const isBrowser = typeof document !== \"undefined\";\r\n\r\nexport { isBrowser };\r\n","import { useLayoutEffect, useEffect } from 'react';\r\nimport { isBrowser } from './is-browser.mjs';\r\n\r\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\r\n\r\nexport { useIsomorphicLayoutEffect };\r\n","import { createContext } from 'react';\r\n\r\nconst LazyContext = createContext({ strict: false });\r\n\r\nexport { LazyContext };\r\n","/**\r\n * Convert camelCase to dash-case properties.\r\n */\r\nconst camelToDash = (str) => str.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\r\n\r\nexport { camelToDash };\r\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\r\n\r\nconst optimizedAppearDataId = \"framerAppearId\";\r\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\r\n\r\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\r\n","import { useContext, useRef, useInsertionEffect, useEffect } from 'react';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\r\nimport { LazyContext } from '../../context/LazyContext.mjs';\r\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\r\nimport { optimizedAppearDataAttribute } from '../../animation/optimized-appear/data-id.mjs';\r\n\r\nfunction useVisualElement(Component, visualState, props, createVisualElement) {\r\n const { visualElement: parent } = useContext(MotionContext);\r\n const lazyContext = useContext(LazyContext);\r\n const presenceContext = useContext(PresenceContext);\r\n const reducedMotionConfig = useContext(MotionConfigContext).reducedMotion;\r\n const visualElementRef = useRef();\r\n /**\r\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\r\n */\r\n createVisualElement = createVisualElement || lazyContext.renderer;\r\n if (!visualElementRef.current && createVisualElement) {\r\n visualElementRef.current = createVisualElement(Component, {\r\n visualState,\r\n parent,\r\n props,\r\n presenceContext,\r\n blockInitialAnimation: presenceContext\r\n ? presenceContext.initial === false\r\n : false,\r\n reducedMotionConfig,\r\n });\r\n }\r\n const visualElement = visualElementRef.current;\r\n useInsertionEffect(() => {\r\n visualElement && visualElement.update(props, presenceContext);\r\n });\r\n /**\r\n * Cache this value as we want to know whether HandoffAppearAnimations\r\n * was present on initial render - it will be deleted after this.\r\n */\r\n const wantsHandoff = useRef(Boolean(props[optimizedAppearDataAttribute] && !window.HandoffComplete));\r\n useIsomorphicLayoutEffect(() => {\r\n if (!visualElement)\r\n return;\r\n visualElement.render();\r\n /**\r\n * Ideally this function would always run in a useEffect.\r\n *\r\n * However, if we have optimised appear animations to handoff from,\r\n * it needs to happen synchronously to ensure there's no flash of\r\n * incorrect styles in the event of a hydration error.\r\n *\r\n * So if we detect a situtation where optimised appear animations\r\n * are running, we use useLayoutEffect to trigger animations.\r\n */\r\n if (wantsHandoff.current && visualElement.animationState) {\r\n visualElement.animationState.animateChanges();\r\n }\r\n });\r\n useEffect(() => {\r\n if (!visualElement)\r\n return;\r\n visualElement.updateFeatures();\r\n if (!wantsHandoff.current && visualElement.animationState) {\r\n visualElement.animationState.animateChanges();\r\n }\r\n if (wantsHandoff.current) {\r\n wantsHandoff.current = false;\r\n // This ensures all future calls to animateChanges() will run in useEffect\r\n window.HandoffComplete = true;\r\n }\r\n });\r\n return visualElement;\r\n}\r\n\r\nexport { useVisualElement };\r\n","function isRefObject(ref) {\r\n return (ref &&\r\n typeof ref === \"object\" &&\r\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\r\n}\r\n\r\nexport { isRefObject };\r\n","import { useCallback } from 'react';\r\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\r\n\r\n/**\r\n * Creates a ref function that, when called, hydrates the provided\r\n * external ref and VisualElement.\r\n */\r\nfunction useMotionRef(visualState, visualElement, externalRef) {\r\n return useCallback((instance) => {\r\n instance && visualState.mount && visualState.mount(instance);\r\n if (visualElement) {\r\n instance\r\n ? visualElement.mount(instance)\r\n : visualElement.unmount();\r\n }\r\n if (externalRef) {\r\n if (typeof externalRef === \"function\") {\r\n externalRef(instance);\r\n }\r\n else if (isRefObject(externalRef)) {\r\n externalRef.current = instance;\r\n }\r\n }\r\n }, \r\n /**\r\n * Only pass a new ref callback to React if we've received a visual element\r\n * factory. Otherwise we'll be mounting/remounting every time externalRef\r\n * or other dependencies change.\r\n */\r\n [visualElement]);\r\n}\r\n\r\nexport { useMotionRef };\r\n","/**\r\n * Decides if the supplied variable is variant label\r\n */\r\nfunction isVariantLabel(v) {\r\n return typeof v === \"string\" || Array.isArray(v);\r\n}\r\n\r\nexport { isVariantLabel };\r\n","function isAnimationControls(v) {\r\n return (v !== null &&\r\n typeof v === \"object\" &&\r\n typeof v.start === \"function\");\r\n}\r\n\r\nexport { isAnimationControls };\r\n","const variantPriorityOrder = [\r\n \"animate\",\r\n \"whileInView\",\r\n \"whileFocus\",\r\n \"whileHover\",\r\n \"whileTap\",\r\n \"whileDrag\",\r\n \"exit\",\r\n];\r\nconst variantProps = [\"initial\", ...variantPriorityOrder];\r\n\r\nexport { variantPriorityOrder, variantProps };\r\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\r\nimport { isVariantLabel } from './is-variant-label.mjs';\r\nimport { variantProps } from './variant-props.mjs';\r\n\r\nfunction isControllingVariants(props) {\r\n return (isAnimationControls(props.animate) ||\r\n variantProps.some((name) => isVariantLabel(props[name])));\r\n}\r\nfunction isVariantNode(props) {\r\n return Boolean(isControllingVariants(props) || props.variants);\r\n}\r\n\r\nexport { isControllingVariants, isVariantNode };\r\n","import { isVariantLabel } from '../../render/utils/is-variant-label.mjs';\r\nimport { isControllingVariants } from '../../render/utils/is-controlling-variants.mjs';\r\n\r\nfunction getCurrentTreeVariants(props, context) {\r\n if (isControllingVariants(props)) {\r\n const { initial, animate } = props;\r\n return {\r\n initial: initial === false || isVariantLabel(initial)\r\n ? initial\r\n : undefined,\r\n animate: isVariantLabel(animate) ? animate : undefined,\r\n };\r\n }\r\n return props.inherit !== false ? context : {};\r\n}\r\n\r\nexport { getCurrentTreeVariants };\r\n","import { useContext, useMemo } from 'react';\r\nimport { MotionContext } from './index.mjs';\r\nimport { getCurrentTreeVariants } from './utils.mjs';\r\n\r\nfunction useCreateMotionContext(props) {\r\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\r\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\r\n}\r\nfunction variantLabelsAsDependency(prop) {\r\n return Array.isArray(prop) ? prop.join(\" \") : prop;\r\n}\r\n\r\nexport { useCreateMotionContext };\r\n","const featureProps = {\r\n animation: [\r\n \"animate\",\r\n \"variants\",\r\n \"whileHover\",\r\n \"whileTap\",\r\n \"exit\",\r\n \"whileInView\",\r\n \"whileFocus\",\r\n \"whileDrag\",\r\n ],\r\n exit: [\"exit\"],\r\n drag: [\"drag\", \"dragControls\"],\r\n focus: [\"whileFocus\"],\r\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\r\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\r\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\r\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\r\n layout: [\"layout\", \"layoutId\"],\r\n};\r\nconst featureDefinitions = {};\r\nfor (const key in featureProps) {\r\n featureDefinitions[key] = {\r\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\r\n };\r\n}\r\n\r\nexport { featureDefinitions };\r\n","import { featureDefinitions } from './definitions.mjs';\r\n\r\nfunction loadFeatures(features) {\r\n for (const key in features) {\r\n featureDefinitions[key] = {\r\n ...featureDefinitions[key],\r\n ...features[key],\r\n };\r\n }\r\n}\r\n\r\nexport { loadFeatures };\r\n","import { createContext } from 'react';\r\n\r\nconst LayoutGroupContext = createContext({});\r\n\r\nexport { LayoutGroupContext };\r\n","import { createContext } from 'react';\r\n\r\n/**\r\n * Internal, exported only for usage in Framer\r\n */\r\nconst SwitchLayoutGroupContext = createContext({});\r\n\r\nexport { SwitchLayoutGroupContext };\r\n","const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\r\n\r\nexport { motionComponentSymbol };\r\n","import * as React from 'react';\r\nimport { forwardRef, useContext } from 'react';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { MotionContext } from '../context/MotionContext/index.mjs';\r\nimport { useVisualElement } from './utils/use-visual-element.mjs';\r\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\r\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\r\nimport { loadFeatures } from './features/load-features.mjs';\r\nimport { isBrowser } from '../utils/is-browser.mjs';\r\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\r\nimport { LazyContext } from '../context/LazyContext.mjs';\r\nimport { SwitchLayoutGroupContext } from '../context/SwitchLayoutGroupContext.mjs';\r\nimport { motionComponentSymbol } from './utils/symbol.mjs';\r\n\r\n/**\r\n * Create a `motion` component.\r\n *\r\n * This function accepts a Component argument, which can be either a string (ie \"div\"\r\n * for `motion.div`), or an actual React component.\r\n *\r\n * Alongside this is a config option which provides a way of rendering the provided\r\n * component \"offline\", or outside the React render cycle.\r\n */\r\nfunction createMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {\r\n preloadedFeatures && loadFeatures(preloadedFeatures);\r\n function MotionComponent(props, externalRef) {\r\n /**\r\n * If we need to measure the element we load this functionality in a\r\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\r\n */\r\n let MeasureLayout;\r\n const configAndProps = {\r\n ...useContext(MotionConfigContext),\r\n ...props,\r\n layoutId: useLayoutId(props),\r\n };\r\n const { isStatic } = configAndProps;\r\n const context = useCreateMotionContext(props);\r\n const visualState = useVisualState(props, isStatic);\r\n if (!isStatic && isBrowser) {\r\n /**\r\n * Create a VisualElement for this component. A VisualElement provides a common\r\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\r\n * providing a way of rendering to these APIs outside of the React render loop\r\n * for more performant animations and interactions\r\n */\r\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement);\r\n /**\r\n * Load Motion gesture and animation features. These are rendered as renderless\r\n * components so each feature can optionally make use of React lifecycle methods.\r\n */\r\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\r\n const isStrict = useContext(LazyContext).strict;\r\n if (context.visualElement) {\r\n MeasureLayout = context.visualElement.loadFeatures(\r\n // Note: Pass the full new combined props to correctly re-render dynamic feature components.\r\n configAndProps, isStrict, preloadedFeatures, initialLayoutGroupConfig);\r\n }\r\n }\r\n /**\r\n * The mount order and hierarchy is specific to ensure our element ref\r\n * is hydrated by the time features fire their effects.\r\n */\r\n return (React.createElement(MotionContext.Provider, { value: context },\r\n MeasureLayout && context.visualElement ? (React.createElement(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null,\r\n useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)));\r\n }\r\n const ForwardRefComponent = forwardRef(MotionComponent);\r\n ForwardRefComponent[motionComponentSymbol] = Component;\r\n return ForwardRefComponent;\r\n}\r\nfunction useLayoutId({ layoutId }) {\r\n const layoutGroupId = useContext(LayoutGroupContext).id;\r\n return layoutGroupId && layoutId !== undefined\r\n ? layoutGroupId + \"-\" + layoutId\r\n : layoutId;\r\n}\r\n\r\nexport { createMotionComponent };\r\n","import { createMotionComponent } from '../../motion/index.mjs';\r\n\r\n/**\r\n * Convert any React component into a `motion` component. The provided component\r\n * **must** use `React.forwardRef` to the underlying DOM component you want to animate.\r\n *\r\n * ```jsx\r\n * const Component = React.forwardRef((props, ref) => {\r\n * return
\r\n * })\r\n *\r\n * const MotionComponent = motion(Component)\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction createMotionProxy(createConfig) {\r\n function custom(Component, customMotionComponentConfig = {}) {\r\n return createMotionComponent(createConfig(Component, customMotionComponentConfig));\r\n }\r\n if (typeof Proxy === \"undefined\") {\r\n return custom;\r\n }\r\n /**\r\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\r\n * Rather than generating them anew every render.\r\n */\r\n const componentCache = new Map();\r\n return new Proxy(custom, {\r\n /**\r\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\r\n * The prop name is passed through as `key` and we can use that to generate a `motion`\r\n * DOM component with that name.\r\n */\r\n get: (_target, key) => {\r\n /**\r\n * If this element doesn't exist in the component cache, create it and cache.\r\n */\r\n if (!componentCache.has(key)) {\r\n componentCache.set(key, custom(key));\r\n }\r\n return componentCache.get(key);\r\n },\r\n });\r\n}\r\n\r\nexport { createMotionProxy };\r\n","/**\r\n * We keep these listed seperately as we use the lowercase tag names as part\r\n * of the runtime bundle to detect SVG components\r\n */\r\nconst lowercaseSVGElements = [\r\n \"animate\",\r\n \"circle\",\r\n \"defs\",\r\n \"desc\",\r\n \"ellipse\",\r\n \"g\",\r\n \"image\",\r\n \"line\",\r\n \"filter\",\r\n \"marker\",\r\n \"mask\",\r\n \"metadata\",\r\n \"path\",\r\n \"pattern\",\r\n \"polygon\",\r\n \"polyline\",\r\n \"rect\",\r\n \"stop\",\r\n \"switch\",\r\n \"symbol\",\r\n \"svg\",\r\n \"text\",\r\n \"tspan\",\r\n \"use\",\r\n \"view\",\r\n];\r\n\r\nexport { lowercaseSVGElements };\r\n","import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs';\r\n\r\nfunction isSVGComponent(Component) {\r\n if (\r\n /**\r\n * If it's not a string, it's a custom React component. Currently we only support\r\n * HTML custom React components.\r\n */\r\n typeof Component !== \"string\" ||\r\n /**\r\n * If it contains a dash, the element is a custom HTML webcomponent.\r\n */\r\n Component.includes(\"-\")) {\r\n return false;\r\n }\r\n else if (\r\n /**\r\n * If it's in our list of lowercase SVG tags, it's an SVG component\r\n */\r\n lowercaseSVGElements.indexOf(Component) > -1 ||\r\n /**\r\n * If it contains a capital letter, it's an SVG component\r\n */\r\n /[A-Z]/.test(Component)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport { isSVGComponent };\r\n","const scaleCorrectors = {};\r\nfunction addScaleCorrector(correctors) {\r\n Object.assign(scaleCorrectors, correctors);\r\n}\r\n\r\nexport { addScaleCorrector, scaleCorrectors };\r\n","/**\r\n * Generate a list of every possible transform key.\r\n */\r\nconst transformPropOrder = [\r\n \"transformPerspective\",\r\n \"x\",\r\n \"y\",\r\n \"z\",\r\n \"translateX\",\r\n \"translateY\",\r\n \"translateZ\",\r\n \"scale\",\r\n \"scaleX\",\r\n \"scaleY\",\r\n \"rotate\",\r\n \"rotateX\",\r\n \"rotateY\",\r\n \"rotateZ\",\r\n \"skew\",\r\n \"skewX\",\r\n \"skewY\",\r\n];\r\n/**\r\n * A quick lookup for transform props.\r\n */\r\nconst transformProps = new Set(transformPropOrder);\r\n\r\nexport { transformPropOrder, transformProps };\r\n","import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\r\nimport { transformProps } from '../../render/html/utils/transform.mjs';\r\n\r\nfunction isForcedMotionValue(key, { layout, layoutId }) {\r\n return (transformProps.has(key) ||\r\n key.startsWith(\"origin\") ||\r\n ((layout || layoutId !== undefined) &&\r\n (!!scaleCorrectors[key] || key === \"opacity\")));\r\n}\r\n\r\nexport { isForcedMotionValue };\r\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\r\n\r\nexport { isMotionValue };\r\n","import { transformPropOrder } from './transform.mjs';\r\n\r\nconst translateAlias = {\r\n x: \"translateX\",\r\n y: \"translateY\",\r\n z: \"translateZ\",\r\n transformPerspective: \"perspective\",\r\n};\r\nconst numTransforms = transformPropOrder.length;\r\n/**\r\n * Build a CSS transform style from individual x/y/scale etc properties.\r\n *\r\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\r\n * providing a transformTemplate function.\r\n */\r\nfunction buildTransform(transform, { enableHardwareAcceleration = true, allowTransformNone = true, }, transformIsDefault, transformTemplate) {\r\n // The transform string we're going to build into.\r\n let transformString = \"\";\r\n /**\r\n * Loop over all possible transforms in order, adding the ones that\r\n * are present to the transform string.\r\n */\r\n for (let i = 0; i < numTransforms; i++) {\r\n const key = transformPropOrder[i];\r\n if (transform[key] !== undefined) {\r\n const transformName = translateAlias[key] || key;\r\n transformString += `${transformName}(${transform[key]}) `;\r\n }\r\n }\r\n if (enableHardwareAcceleration && !transform.z) {\r\n transformString += \"translateZ(0)\";\r\n }\r\n transformString = transformString.trim();\r\n // If we have a custom `transform` template, pass our transform values and\r\n // generated transformString to that before returning\r\n if (transformTemplate) {\r\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\r\n }\r\n else if (allowTransformNone && transformIsDefault) {\r\n transformString = \"none\";\r\n }\r\n return transformString;\r\n}\r\n\r\nexport { buildTransform };\r\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\r\nconst isCSSVariableName = checkStringStartsWith(\"--\");\r\nconst isCSSVariableToken = checkStringStartsWith(\"var(--\");\r\nconst cssVariableRegex = /var\\s*\\(\\s*--[\\w-]+(\\s*,\\s*(?:(?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)+)?\\s*\\)/g;\r\n\r\nexport { cssVariableRegex, isCSSVariableName, isCSSVariableToken };\r\n","/**\r\n * Provided a value and a ValueType, returns the value as that value type.\r\n */\r\nconst getValueAsType = (value, type) => {\r\n return type && typeof value === \"number\"\r\n ? type.transform(value)\r\n : value;\r\n};\r\n\r\nexport { getValueAsType };\r\n","const clamp = (min, max, v) => Math.min(Math.max(v, min), max);\r\n\r\nexport { clamp };\r\n","import { clamp } from '../../../utils/clamp.mjs';\r\n\r\nconst number = {\r\n test: (v) => typeof v === \"number\",\r\n parse: parseFloat,\r\n transform: (v) => v,\r\n};\r\nconst alpha = {\r\n ...number,\r\n transform: (v) => clamp(0, 1, v),\r\n};\r\nconst scale = {\r\n ...number,\r\n default: 1,\r\n};\r\n\r\nexport { alpha, number, scale };\r\n","/**\r\n * TODO: When we move from string as a source of truth to data models\r\n * everything in this folder should probably be referred to as models vs types\r\n */\r\n// If this number is a decimal, make it just five decimal places\r\n// to avoid exponents\r\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\r\nconst floatRegex = /(-)?([\\d]*\\.?[\\d])+/g;\r\nconst colorRegex = /(#[0-9a-f]{3,8}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2}(-?[\\d\\.]+%?)\\s*[\\,\\/]?\\s*[\\d\\.]*%?\\))/gi;\r\nconst singleColorRegex = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2}(-?[\\d\\.]+%?)\\s*[\\,\\/]?\\s*[\\d\\.]*%?\\))$/i;\r\nfunction isString(v) {\r\n return typeof v === \"string\";\r\n}\r\n\r\nexport { colorRegex, floatRegex, isString, sanitize, singleColorRegex };\r\n","import { isString } from '../utils.mjs';\r\n\r\nconst createUnitType = (unit) => ({\r\n test: (v) => isString(v) && v.endsWith(unit) && v.split(\" \").length === 1,\r\n parse: parseFloat,\r\n transform: (v) => `${v}${unit}`,\r\n});\r\nconst degrees = createUnitType(\"deg\");\r\nconst percent = createUnitType(\"%\");\r\nconst px = createUnitType(\"px\");\r\nconst vh = createUnitType(\"vh\");\r\nconst vw = createUnitType(\"vw\");\r\nconst progressPercentage = {\r\n ...percent,\r\n parse: (v) => percent.parse(v) / 100,\r\n transform: (v) => percent.transform(v * 100),\r\n};\r\n\r\nexport { degrees, percent, progressPercentage, px, vh, vw };\r\n","import { number } from '../../../value/types/numbers/index.mjs';\r\n\r\nconst int = {\r\n ...number,\r\n transform: Math.round,\r\n};\r\n\r\nexport { int };\r\n","import { scale, alpha } from '../../../value/types/numbers/index.mjs';\r\nimport { px, degrees, progressPercentage } from '../../../value/types/numbers/units.mjs';\r\nimport { int } from './type-int.mjs';\r\n\r\nconst numberValueTypes = {\r\n // Border props\r\n borderWidth: px,\r\n borderTopWidth: px,\r\n borderRightWidth: px,\r\n borderBottomWidth: px,\r\n borderLeftWidth: px,\r\n borderRadius: px,\r\n radius: px,\r\n borderTopLeftRadius: px,\r\n borderTopRightRadius: px,\r\n borderBottomRightRadius: px,\r\n borderBottomLeftRadius: px,\r\n // Positioning props\r\n width: px,\r\n maxWidth: px,\r\n height: px,\r\n maxHeight: px,\r\n size: px,\r\n top: px,\r\n right: px,\r\n bottom: px,\r\n left: px,\r\n // Spacing props\r\n padding: px,\r\n paddingTop: px,\r\n paddingRight: px,\r\n paddingBottom: px,\r\n paddingLeft: px,\r\n margin: px,\r\n marginTop: px,\r\n marginRight: px,\r\n marginBottom: px,\r\n marginLeft: px,\r\n // Transform props\r\n rotate: degrees,\r\n rotateX: degrees,\r\n rotateY: degrees,\r\n rotateZ: degrees,\r\n scale,\r\n scaleX: scale,\r\n scaleY: scale,\r\n scaleZ: scale,\r\n skew: degrees,\r\n skewX: degrees,\r\n skewY: degrees,\r\n distance: px,\r\n translateX: px,\r\n translateY: px,\r\n translateZ: px,\r\n x: px,\r\n y: px,\r\n z: px,\r\n perspective: px,\r\n transformPerspective: px,\r\n opacity: alpha,\r\n originX: progressPercentage,\r\n originY: progressPercentage,\r\n originZ: px,\r\n // Misc\r\n zIndex: int,\r\n // SVG\r\n fillOpacity: alpha,\r\n strokeOpacity: alpha,\r\n numOctaves: int,\r\n};\r\n\r\nexport { numberValueTypes };\r\n","import { buildTransform } from './build-transform.mjs';\r\nimport { isCSSVariableName } from '../../dom/utils/is-css-variable.mjs';\r\nimport { transformProps } from './transform.mjs';\r\nimport { getValueAsType } from '../../dom/value-types/get-as-type.mjs';\r\nimport { numberValueTypes } from '../../dom/value-types/number.mjs';\r\n\r\nfunction buildHTMLStyles(state, latestValues, options, transformTemplate) {\r\n const { style, vars, transform, transformOrigin } = state;\r\n // Track whether we encounter any transform or transformOrigin values.\r\n let hasTransform = false;\r\n let hasTransformOrigin = false;\r\n // Does the calculated transform essentially equal \"none\"?\r\n let transformIsNone = true;\r\n /**\r\n * Loop over all our latest animated values and decide whether to handle them\r\n * as a style or CSS variable.\r\n *\r\n * Transforms and transform origins are kept seperately for further processing.\r\n */\r\n for (const key in latestValues) {\r\n const value = latestValues[key];\r\n /**\r\n * If this is a CSS variable we don't do any further processing.\r\n */\r\n if (isCSSVariableName(key)) {\r\n vars[key] = value;\r\n continue;\r\n }\r\n // Convert the value to its default value type, ie 0 -> \"0px\"\r\n const valueType = numberValueTypes[key];\r\n const valueAsType = getValueAsType(value, valueType);\r\n if (transformProps.has(key)) {\r\n // If this is a transform, flag to enable further transform processing\r\n hasTransform = true;\r\n transform[key] = valueAsType;\r\n // If we already know we have a non-default transform, early return\r\n if (!transformIsNone)\r\n continue;\r\n // Otherwise check to see if this is a default transform\r\n if (value !== (valueType.default || 0))\r\n transformIsNone = false;\r\n }\r\n else if (key.startsWith(\"origin\")) {\r\n // If this is a transform origin, flag and enable further transform-origin processing\r\n hasTransformOrigin = true;\r\n transformOrigin[key] = valueAsType;\r\n }\r\n else {\r\n style[key] = valueAsType;\r\n }\r\n }\r\n if (!latestValues.transform) {\r\n if (hasTransform || transformTemplate) {\r\n style.transform = buildTransform(state.transform, options, transformIsNone, transformTemplate);\r\n }\r\n else if (style.transform) {\r\n /**\r\n * If we have previously created a transform but currently don't have any,\r\n * reset transform style to none.\r\n */\r\n style.transform = \"none\";\r\n }\r\n }\r\n /**\r\n * Build a transformOrigin style. Uses the same defaults as the browser for\r\n * undefined origins.\r\n */\r\n if (hasTransformOrigin) {\r\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\r\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\r\n }\r\n}\r\n\r\nexport { buildHTMLStyles };\r\n","const createHtmlRenderState = () => ({\r\n style: {},\r\n transform: {},\r\n transformOrigin: {},\r\n vars: {},\r\n});\r\n\r\nexport { createHtmlRenderState };\r\n","import { useMemo } from 'react';\r\nimport { isForcedMotionValue } from '../../motion/utils/is-forced-motion-value.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\r\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\r\n\r\nfunction copyRawValuesOnly(target, source, props) {\r\n for (const key in source) {\r\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n}\r\nfunction useInitialMotionValues({ transformTemplate }, visualState, isStatic) {\r\n return useMemo(() => {\r\n const state = createHtmlRenderState();\r\n buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);\r\n return Object.assign({}, state.vars, state.style);\r\n }, [visualState]);\r\n}\r\nfunction useStyle(props, visualState, isStatic) {\r\n const styleProp = props.style || {};\r\n const style = {};\r\n /**\r\n * Copy non-Motion Values straight into style\r\n */\r\n copyRawValuesOnly(style, styleProp, props);\r\n Object.assign(style, useInitialMotionValues(props, visualState, isStatic));\r\n return props.transformValues ? props.transformValues(style) : style;\r\n}\r\nfunction useHTMLProps(props, visualState, isStatic) {\r\n // The `any` isn't ideal but it is the type of createElement props argument\r\n const htmlProps = {};\r\n const style = useStyle(props, visualState, isStatic);\r\n if (props.drag && props.dragListener !== false) {\r\n // Disable the ghost element when a user drags\r\n htmlProps.draggable = false;\r\n // Disable text selection\r\n style.userSelect =\r\n style.WebkitUserSelect =\r\n style.WebkitTouchCallout =\r\n \"none\";\r\n // Disable scrolling on the draggable direction\r\n style.touchAction =\r\n props.drag === true\r\n ? \"none\"\r\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\r\n }\r\n if (props.tabIndex === undefined &&\r\n (props.onTap || props.onTapStart || props.whileTap)) {\r\n htmlProps.tabIndex = 0;\r\n }\r\n htmlProps.style = style;\r\n return htmlProps;\r\n}\r\n\r\nexport { copyRawValuesOnly, useHTMLProps };\r\n","/**\r\n * A list of all valid MotionProps.\r\n *\r\n * @privateRemarks\r\n * This doesn't throw if a `MotionProp` name is missing - it should.\r\n */\r\nconst validMotionProps = new Set([\r\n \"animate\",\r\n \"exit\",\r\n \"variants\",\r\n \"initial\",\r\n \"style\",\r\n \"values\",\r\n \"variants\",\r\n \"transition\",\r\n \"transformTemplate\",\r\n \"transformValues\",\r\n \"custom\",\r\n \"inherit\",\r\n \"onBeforeLayoutMeasure\",\r\n \"onAnimationStart\",\r\n \"onAnimationComplete\",\r\n \"onUpdate\",\r\n \"onDragStart\",\r\n \"onDrag\",\r\n \"onDragEnd\",\r\n \"onMeasureDragConstraints\",\r\n \"onDirectionLock\",\r\n \"onDragTransitionEnd\",\r\n \"_dragX\",\r\n \"_dragY\",\r\n \"onHoverStart\",\r\n \"onHoverEnd\",\r\n \"onViewportEnter\",\r\n \"onViewportLeave\",\r\n \"globalTapTarget\",\r\n \"ignoreStrict\",\r\n \"viewport\",\r\n]);\r\n/**\r\n * Check whether a prop name is a valid `MotionProp` key.\r\n *\r\n * @param key - Name of the property to check\r\n * @returns `true` is key is a valid `MotionProp`.\r\n *\r\n * @public\r\n */\r\nfunction isValidMotionProp(key) {\r\n return (key.startsWith(\"while\") ||\r\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\r\n key.startsWith(\"layout\") ||\r\n key.startsWith(\"onTap\") ||\r\n key.startsWith(\"onPan\") ||\r\n key.startsWith(\"onLayout\") ||\r\n validMotionProps.has(key));\r\n}\r\n\r\nexport { isValidMotionProp };\r\n","function memoize(fn) {\r\n var cache = {};\r\n return function (arg) {\r\n if (cache[arg] === undefined) cache[arg] = fn(arg);\r\n return cache[arg];\r\n };\r\n}\r\n\r\nexport default memoize;\r\n","import memoize from '@emotion/memoize';\r\n\r\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\r\n\r\nvar index = memoize(function (prop) {\r\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\r\n /* o */\r\n && prop.charCodeAt(1) === 110\r\n /* n */\r\n && prop.charCodeAt(2) < 91;\r\n}\r\n/* Z+1 */\r\n);\r\n\r\nexport default index;\r\n","import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\r\n\r\nlet shouldForward = (key) => !isValidMotionProp(key);\r\nfunction loadExternalIsValidProp(isValidProp) {\r\n if (!isValidProp)\r\n return;\r\n // Explicitly filter our events\r\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\r\n}\r\n/**\r\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\r\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\r\n * of these should be passed to the underlying DOM node.\r\n *\r\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\r\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\r\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\r\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\r\n *\r\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\r\n * actually required.\r\n */\r\ntry {\r\n /**\r\n * We attempt to import this package but require won't be defined in esm environments, in that case\r\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\r\n * in favour of explicit injection.\r\n */\r\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\r\n}\r\ncatch (_a) {\r\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\r\n}\r\nfunction filterProps(props, isDom, forwardMotionProps) {\r\n const filteredProps = {};\r\n for (const key in props) {\r\n /**\r\n * values is considered a valid prop by Emotion, so if it's present\r\n * this will be rendered out to the DOM unless explicitly filtered.\r\n *\r\n * We check the type as it could be used with the `feColorMatrix`\r\n * element, which we support.\r\n */\r\n if (key === \"values\" && typeof props.values === \"object\")\r\n continue;\r\n if (shouldForward(key) ||\r\n (forwardMotionProps === true && isValidMotionProp(key)) ||\r\n (!isDom && !isValidMotionProp(key)) ||\r\n // If trying to use native HTML drag events, forward drag listeners\r\n (props[\"draggable\"] && key.startsWith(\"onDrag\"))) {\r\n filteredProps[key] = props[key];\r\n }\r\n }\r\n return filteredProps;\r\n}\r\n\r\nexport { filterProps, loadExternalIsValidProp };\r\n","import { px } from '../../../value/types/numbers/units.mjs';\r\n\r\nfunction calcOrigin(origin, offset, size) {\r\n return typeof origin === \"string\"\r\n ? origin\r\n : px.transform(offset + size * origin);\r\n}\r\n/**\r\n * The SVG transform origin defaults are different to CSS and is less intuitive,\r\n * so we use the measured dimensions of the SVG to reconcile these.\r\n */\r\nfunction calcSVGTransformOrigin(dimensions, originX, originY) {\r\n const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);\r\n const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);\r\n return `${pxOriginX} ${pxOriginY}`;\r\n}\r\n\r\nexport { calcSVGTransformOrigin };\r\n","import { px } from '../../../value/types/numbers/units.mjs';\r\n\r\nconst dashKeys = {\r\n offset: \"stroke-dashoffset\",\r\n array: \"stroke-dasharray\",\r\n};\r\nconst camelKeys = {\r\n offset: \"strokeDashoffset\",\r\n array: \"strokeDasharray\",\r\n};\r\n/**\r\n * Build SVG path properties. Uses the path's measured length to convert\r\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\r\n * and stroke-dasharray attributes.\r\n *\r\n * This function is mutative to reduce per-frame GC.\r\n */\r\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\r\n // Normalise path length by setting SVG attribute pathLength to 1\r\n attrs.pathLength = 1;\r\n // We use dash case when setting attributes directly to the DOM node and camel case\r\n // when defining props on a React component.\r\n const keys = useDashCase ? dashKeys : camelKeys;\r\n // Build the dash offset\r\n attrs[keys.offset] = px.transform(-offset);\r\n // Build the dash array\r\n const pathLength = px.transform(length);\r\n const pathSpacing = px.transform(spacing);\r\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\r\n}\r\n\r\nexport { buildSVGPath };\r\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\r\nimport { calcSVGTransformOrigin } from './transform-origin.mjs';\r\nimport { buildSVGPath } from './path.mjs';\r\n\r\n/**\r\n * Build SVG visual attrbutes, like cx and style.transform\r\n */\r\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0, \r\n// This is object creation, which we try to avoid per-frame.\r\n...latest }, options, isSVGTag, transformTemplate) {\r\n buildHTMLStyles(state, latest, options, transformTemplate);\r\n /**\r\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\r\n * as normal HTML tags.\r\n */\r\n if (isSVGTag) {\r\n if (state.style.viewBox) {\r\n state.attrs.viewBox = state.style.viewBox;\r\n }\r\n return;\r\n }\r\n state.attrs = state.style;\r\n state.style = {};\r\n const { attrs, style, dimensions } = state;\r\n /**\r\n * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs\r\n * and copy it into style.\r\n */\r\n if (attrs.transform) {\r\n if (dimensions)\r\n style.transform = attrs.transform;\r\n delete attrs.transform;\r\n }\r\n // Parse transformOrigin\r\n if (dimensions &&\r\n (originX !== undefined || originY !== undefined || style.transform)) {\r\n style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);\r\n }\r\n // Render attrX/attrY/attrScale as attributes\r\n if (attrX !== undefined)\r\n attrs.x = attrX;\r\n if (attrY !== undefined)\r\n attrs.y = attrY;\r\n if (attrScale !== undefined)\r\n attrs.scale = attrScale;\r\n // Build SVG path if one has been defined\r\n if (pathLength !== undefined) {\r\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\r\n }\r\n}\r\n\r\nexport { buildSVGAttrs };\r\n","import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs';\r\n\r\nconst createSvgRenderState = () => ({\r\n ...createHtmlRenderState(),\r\n attrs: {},\r\n});\r\n\r\nexport { createSvgRenderState };\r\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\r\n\r\nexport { isSVGTag };\r\n","import { useMemo } from 'react';\r\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\r\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\r\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\r\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\r\n\r\nfunction useSVGProps(props, visualState, _isStatic, Component) {\r\n const visualProps = useMemo(() => {\r\n const state = createSvgRenderState();\r\n buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, isSVGTag(Component), props.transformTemplate);\r\n return {\r\n ...state.attrs,\r\n style: { ...state.style },\r\n };\r\n }, [visualState]);\r\n if (props.style) {\r\n const rawStyles = {};\r\n copyRawValuesOnly(rawStyles, props.style, props);\r\n visualProps.style = { ...rawStyles, ...visualProps.style };\r\n }\r\n return visualProps;\r\n}\r\n\r\nexport { useSVGProps };\r\n","import { useMemo, createElement } from 'react';\r\nimport { useHTMLProps } from '../html/use-props.mjs';\r\nimport { filterProps } from './utils/filter-props.mjs';\r\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\r\nimport { useSVGProps } from '../svg/use-props.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction createUseRender(forwardMotionProps = false) {\r\n const useRender = (Component, props, ref, { latestValues }, isStatic) => {\r\n const useVisualProps = isSVGComponent(Component)\r\n ? useSVGProps\r\n : useHTMLProps;\r\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\r\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\r\n const elementProps = {\r\n ...filteredProps,\r\n ...visualProps,\r\n ref,\r\n };\r\n /**\r\n * If component has been handed a motion value as its child,\r\n * memoise its initial value and render that. Subsequent updates\r\n * will be handled by the onChange handler\r\n */\r\n const { children } = props;\r\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\r\n return createElement(Component, {\r\n ...elementProps,\r\n children: renderedChildren,\r\n });\r\n };\r\n return useRender;\r\n}\r\n\r\nexport { createUseRender };\r\n","function renderHTML(element, { style, vars }, styleProp, projection) {\r\n Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));\r\n // Loop over any CSS variables and assign those.\r\n for (const key in vars) {\r\n element.style.setProperty(key, vars[key]);\r\n }\r\n}\r\n\r\nexport { renderHTML };\r\n","/**\r\n * A set of attribute names that are always read/written as camel case.\r\n */\r\nconst camelCaseAttributes = new Set([\r\n \"baseFrequency\",\r\n \"diffuseConstant\",\r\n \"kernelMatrix\",\r\n \"kernelUnitLength\",\r\n \"keySplines\",\r\n \"keyTimes\",\r\n \"limitingConeAngle\",\r\n \"markerHeight\",\r\n \"markerWidth\",\r\n \"numOctaves\",\r\n \"targetX\",\r\n \"targetY\",\r\n \"surfaceScale\",\r\n \"specularConstant\",\r\n \"specularExponent\",\r\n \"stdDeviation\",\r\n \"tableValues\",\r\n \"viewBox\",\r\n \"gradientTransform\",\r\n \"pathLength\",\r\n \"startOffset\",\r\n \"textLength\",\r\n \"lengthAdjust\",\r\n]);\r\n\r\nexport { camelCaseAttributes };\r\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\r\nimport { renderHTML } from '../../html/utils/render.mjs';\r\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\r\n\r\nfunction renderSVG(element, renderState, _styleProp, projection) {\r\n renderHTML(element, renderState, undefined, projection);\r\n for (const key in renderState.attrs) {\r\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\r\n }\r\n}\r\n\r\nexport { renderSVG };\r\n","import { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';\r\nimport { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\r\n\r\nfunction scrapeMotionValuesFromProps(props, prevProps) {\r\n const { style } = props;\r\n const newValues = {};\r\n for (const key in style) {\r\n if (isMotionValue(style[key]) ||\r\n (prevProps.style && isMotionValue(prevProps.style[key])) ||\r\n isForcedMotionValue(key, props)) {\r\n newValues[key] = style[key];\r\n }\r\n }\r\n return newValues;\r\n}\r\n\r\nexport { scrapeMotionValuesFromProps };\r\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\r\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\r\nimport { transformPropOrder } from '../../html/utils/transform.mjs';\r\n\r\nfunction scrapeMotionValuesFromProps(props, prevProps) {\r\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps);\r\n for (const key in props) {\r\n if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) {\r\n const targetKey = transformPropOrder.indexOf(key) !== -1\r\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\r\n : key;\r\n newValues[targetKey] = props[key];\r\n }\r\n }\r\n return newValues;\r\n}\r\n\r\nexport { scrapeMotionValuesFromProps };\r\n","function resolveVariantFromProps(props, definition, custom, currentValues = {}, currentVelocity = {}) {\r\n /**\r\n * If the variant definition is a function, resolve.\r\n */\r\n if (typeof definition === \"function\") {\r\n definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);\r\n }\r\n /**\r\n * If the variant definition is a variant label, or\r\n * the function returned a variant label, resolve.\r\n */\r\n if (typeof definition === \"string\") {\r\n definition = props.variants && props.variants[definition];\r\n }\r\n /**\r\n * At this point we've resolved both functions and variant labels,\r\n * but the resolved variant label might itself have been a function.\r\n * If so, resolve. This can only have returned a valid target object.\r\n */\r\n if (typeof definition === \"function\") {\r\n definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);\r\n }\r\n return definition;\r\n}\r\n\r\nexport { resolveVariantFromProps };\r\n","import { useRef } from 'react';\r\n\r\n/**\r\n * Creates a constant value over the lifecycle of a component.\r\n *\r\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\r\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\r\n * you can ensure that initialisers don't execute twice or more.\r\n */\r\nfunction useConstant(init) {\r\n const ref = useRef(null);\r\n if (ref.current === null) {\r\n ref.current = init();\r\n }\r\n return ref.current;\r\n}\r\n\r\nexport { useConstant };\r\n","const isKeyframesTarget = (v) => {\r\n return Array.isArray(v);\r\n};\r\n\r\nexport { isKeyframesTarget };\r\n","import { isKeyframesTarget } from '../animation/utils/is-keyframes-target.mjs';\r\n\r\nconst isCustomValue = (v) => {\r\n return Boolean(v && typeof v === \"object\" && v.mix && v.toValue);\r\n};\r\nconst resolveFinalValueInKeyframes = (v) => {\r\n // TODO maybe throw if v.length - 1 is placeholder token?\r\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\r\n};\r\n\r\nexport { isCustomValue, resolveFinalValueInKeyframes };\r\n","import { isCustomValue } from '../../utils/resolve-value.mjs';\r\nimport { isMotionValue } from './is-motion-value.mjs';\r\n\r\n/**\r\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\r\n *\r\n * TODO: Remove and move to library\r\n */\r\nfunction resolveMotionValue(value) {\r\n const unwrappedValue = isMotionValue(value) ? value.get() : value;\r\n return isCustomValue(unwrappedValue)\r\n ? unwrappedValue.toValue()\r\n : unwrappedValue;\r\n}\r\n\r\nexport { resolveMotionValue };\r\n","import { useContext } from 'react';\r\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\nimport { resolveVariantFromProps } from '../../render/utils/resolve-variants.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\r\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\r\nimport { isControllingVariants, isVariantNode } from '../../render/utils/is-controlling-variants.mjs';\r\n\r\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, onMount, }, props, context, presenceContext) {\r\n const state = {\r\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\r\n renderState: createRenderState(),\r\n };\r\n if (onMount) {\r\n state.mount = (instance) => onMount(props, instance, state);\r\n }\r\n return state;\r\n}\r\nconst makeUseVisualState = (config) => (props, isStatic) => {\r\n const context = useContext(MotionContext);\r\n const presenceContext = useContext(PresenceContext);\r\n const make = () => makeState(config, props, context, presenceContext);\r\n return isStatic ? make() : useConstant(make);\r\n};\r\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\r\n const values = {};\r\n const motionValues = scrapeMotionValues(props, {});\r\n for (const key in motionValues) {\r\n values[key] = resolveMotionValue(motionValues[key]);\r\n }\r\n let { initial, animate } = props;\r\n const isControllingVariants$1 = isControllingVariants(props);\r\n const isVariantNode$1 = isVariantNode(props);\r\n if (context &&\r\n isVariantNode$1 &&\r\n !isControllingVariants$1 &&\r\n props.inherit !== false) {\r\n if (initial === undefined)\r\n initial = context.initial;\r\n if (animate === undefined)\r\n animate = context.animate;\r\n }\r\n let isInitialAnimationBlocked = presenceContext\r\n ? presenceContext.initial === false\r\n : false;\r\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\r\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\r\n if (variantToSet &&\r\n typeof variantToSet !== \"boolean\" &&\r\n !isAnimationControls(variantToSet)) {\r\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\r\n list.forEach((definition) => {\r\n const resolved = resolveVariantFromProps(props, definition);\r\n if (!resolved)\r\n return;\r\n const { transitionEnd, transition, ...target } = resolved;\r\n for (const key in target) {\r\n let valueTarget = target[key];\r\n if (Array.isArray(valueTarget)) {\r\n /**\r\n * Take final keyframe if the initial animation is blocked because\r\n * we want to initialise at the end of that blocked animation.\r\n */\r\n const index = isInitialAnimationBlocked\r\n ? valueTarget.length - 1\r\n : 0;\r\n valueTarget = valueTarget[index];\r\n }\r\n if (valueTarget !== null) {\r\n values[key] = valueTarget;\r\n }\r\n }\r\n for (const key in transitionEnd)\r\n values[key] = transitionEnd[key];\r\n });\r\n }\r\n return values;\r\n}\r\n\r\nexport { makeUseVisualState };\r\n","const noop = (any) => any;\r\n\r\nexport { noop };\r\n","class Queue {\r\n constructor() {\r\n this.order = [];\r\n this.scheduled = new Set();\r\n }\r\n add(process) {\r\n if (!this.scheduled.has(process)) {\r\n this.scheduled.add(process);\r\n this.order.push(process);\r\n return true;\r\n }\r\n }\r\n remove(process) {\r\n const index = this.order.indexOf(process);\r\n if (index !== -1) {\r\n this.order.splice(index, 1);\r\n this.scheduled.delete(process);\r\n }\r\n }\r\n clear() {\r\n this.order.length = 0;\r\n this.scheduled.clear();\r\n }\r\n}\r\nfunction createRenderStep(runNextFrame) {\r\n /**\r\n * We create and reuse two queues, one to queue jobs for the current frame\r\n * and one for the next. We reuse to avoid triggering GC after x frames.\r\n */\r\n let thisFrame = new Queue();\r\n let nextFrame = new Queue();\r\n let numToRun = 0;\r\n /**\r\n * Track whether we're currently processing jobs in this step. This way\r\n * we can decide whether to schedule new jobs for this frame or next.\r\n */\r\n let isProcessing = false;\r\n let flushNextFrame = false;\r\n /**\r\n * A set of processes which were marked keepAlive when scheduled.\r\n */\r\n const toKeepAlive = new WeakSet();\r\n const step = {\r\n /**\r\n * Schedule a process to run on the next frame.\r\n */\r\n schedule: (callback, keepAlive = false, immediate = false) => {\r\n const addToCurrentFrame = immediate && isProcessing;\r\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\r\n if (keepAlive)\r\n toKeepAlive.add(callback);\r\n if (queue.add(callback) && addToCurrentFrame && isProcessing) {\r\n // If we're adding it to the currently running queue, update its measured size\r\n numToRun = thisFrame.order.length;\r\n }\r\n return callback;\r\n },\r\n /**\r\n * Cancel the provided callback from running on the next frame.\r\n */\r\n cancel: (callback) => {\r\n nextFrame.remove(callback);\r\n toKeepAlive.delete(callback);\r\n },\r\n /**\r\n * Execute all schedule callbacks.\r\n */\r\n process: (frameData) => {\r\n /**\r\n * If we're already processing we've probably been triggered by a flushSync\r\n * inside an existing process. Instead of executing, mark flushNextFrame\r\n * as true and ensure we flush the following frame at the end of this one.\r\n */\r\n if (isProcessing) {\r\n flushNextFrame = true;\r\n return;\r\n }\r\n isProcessing = true;\r\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\r\n // Clear the next frame queue\r\n nextFrame.clear();\r\n // Execute this frame\r\n numToRun = thisFrame.order.length;\r\n if (numToRun) {\r\n for (let i = 0; i < numToRun; i++) {\r\n const callback = thisFrame.order[i];\r\n callback(frameData);\r\n if (toKeepAlive.has(callback)) {\r\n step.schedule(callback);\r\n runNextFrame();\r\n }\r\n }\r\n }\r\n isProcessing = false;\r\n if (flushNextFrame) {\r\n flushNextFrame = false;\r\n step.process(frameData);\r\n }\r\n },\r\n };\r\n return step;\r\n}\r\n\r\nexport { createRenderStep };\r\n","import { createRenderStep } from './render-step.mjs';\r\n\r\nconst stepsOrder = [\r\n \"prepare\",\r\n \"read\",\r\n \"update\",\r\n \"preRender\",\r\n \"render\",\r\n \"postRender\",\r\n];\r\nconst maxElapsed = 40;\r\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\r\n let runNextFrame = false;\r\n let useDefaultElapsed = true;\r\n const state = {\r\n delta: 0,\r\n timestamp: 0,\r\n isProcessing: false,\r\n };\r\n const steps = stepsOrder.reduce((acc, key) => {\r\n acc[key] = createRenderStep(() => (runNextFrame = true));\r\n return acc;\r\n }, {});\r\n const processStep = (stepId) => steps[stepId].process(state);\r\n const processBatch = () => {\r\n const timestamp = performance.now();\r\n runNextFrame = false;\r\n state.delta = useDefaultElapsed\r\n ? 1000 / 60\r\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\r\n state.timestamp = timestamp;\r\n state.isProcessing = true;\r\n stepsOrder.forEach(processStep);\r\n state.isProcessing = false;\r\n if (runNextFrame && allowKeepAlive) {\r\n useDefaultElapsed = false;\r\n scheduleNextBatch(processBatch);\r\n }\r\n };\r\n const wake = () => {\r\n runNextFrame = true;\r\n useDefaultElapsed = true;\r\n if (!state.isProcessing) {\r\n scheduleNextBatch(processBatch);\r\n }\r\n };\r\n const schedule = stepsOrder.reduce((acc, key) => {\r\n const step = steps[key];\r\n acc[key] = (process, keepAlive = false, immediate = false) => {\r\n if (!runNextFrame)\r\n wake();\r\n return step.schedule(process, keepAlive, immediate);\r\n };\r\n return acc;\r\n }, {});\r\n const cancel = (process) => stepsOrder.forEach((key) => steps[key].cancel(process));\r\n return { schedule, cancel, state, steps };\r\n}\r\n\r\nexport { createRenderBatcher, stepsOrder };\r\n","import { noop } from '../utils/noop.mjs';\r\nimport { createRenderBatcher } from './batcher.mjs';\r\n\r\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps, } = createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\r\n\r\nexport { cancelFrame, frame, frameData, steps };\r\n","import { renderSVG } from './utils/render.mjs';\r\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\r\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\r\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\r\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\nconst svgMotionConfig = {\r\n useVisualState: makeUseVisualState({\r\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\r\n createRenderState: createSvgRenderState,\r\n onMount: (props, instance, { renderState, latestValues }) => {\r\n frame.read(() => {\r\n try {\r\n renderState.dimensions =\r\n typeof instance.getBBox ===\r\n \"function\"\r\n ? instance.getBBox()\r\n : instance.getBoundingClientRect();\r\n }\r\n catch (e) {\r\n // Most likely trying to measure an unrendered element under Firefox\r\n renderState.dimensions = {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0,\r\n };\r\n }\r\n });\r\n frame.render(() => {\r\n buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, isSVGTag(instance.tagName), props.transformTemplate);\r\n renderSVG(instance, renderState);\r\n });\r\n },\r\n }),\r\n};\r\n\r\nexport { svgMotionConfig };\r\n","import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\r\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\r\n\r\nconst htmlMotionConfig = {\r\n useVisualState: makeUseVisualState({\r\n scrapeMotionValuesFromProps,\r\n createRenderState: createHtmlRenderState,\r\n }),\r\n};\r\n\r\nexport { htmlMotionConfig };\r\n","import { isSVGComponent } from './is-svg-component.mjs';\r\nimport { createUseRender } from '../use-render.mjs';\r\nimport { svgMotionConfig } from '../../svg/config-motion.mjs';\r\nimport { htmlMotionConfig } from '../../html/config-motion.mjs';\r\n\r\nfunction createDomMotionConfig(Component, { forwardMotionProps = false }, preloadedFeatures, createVisualElement) {\r\n const baseConfig = isSVGComponent(Component)\r\n ? svgMotionConfig\r\n : htmlMotionConfig;\r\n return {\r\n ...baseConfig,\r\n preloadedFeatures,\r\n useRender: createUseRender(forwardMotionProps),\r\n createVisualElement,\r\n Component,\r\n };\r\n}\r\n\r\nexport { createDomMotionConfig };\r\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\r\n target.addEventListener(eventName, handler, options);\r\n return () => target.removeEventListener(eventName, handler);\r\n}\r\n\r\nexport { addDomEvent };\r\n","const isPrimaryPointer = (event) => {\r\n if (event.pointerType === \"mouse\") {\r\n return typeof event.button !== \"number\" || event.button <= 0;\r\n }\r\n else {\r\n /**\r\n * isPrimary is true for all mice buttons, whereas every touch point\r\n * is regarded as its own input. So subsequent concurrent touch points\r\n * will be false.\r\n *\r\n * Specifically match against false here as incomplete versions of\r\n * PointerEvents in very old browser might have it set as undefined.\r\n */\r\n return event.isPrimary !== false;\r\n }\r\n};\r\n\r\nexport { isPrimaryPointer };\r\n","import { isPrimaryPointer } from './utils/is-primary-pointer.mjs';\r\n\r\nfunction extractEventInfo(event, pointType = \"page\") {\r\n return {\r\n point: {\r\n x: event[pointType + \"X\"],\r\n y: event[pointType + \"Y\"],\r\n },\r\n };\r\n}\r\nconst addPointerInfo = (handler) => {\r\n return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\r\n};\r\n\r\nexport { addPointerInfo, extractEventInfo };\r\n","import { addDomEvent } from './add-dom-event.mjs';\r\nimport { addPointerInfo } from './event-info.mjs';\r\n\r\nfunction addPointerEvent(target, eventName, handler, options) {\r\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\r\n}\r\n\r\nexport { addPointerEvent };\r\n","/**\r\n * Pipe\r\n * Compose other transformers to run linearily\r\n * pipe(min(20), max(40))\r\n * @param {...functions} transformers\r\n * @return {function}\r\n */\r\nconst combineFunctions = (a, b) => (v) => b(a(v));\r\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\r\n\r\nexport { pipe };\r\n","function createLock(name) {\r\n let lock = null;\r\n return () => {\r\n const openLock = () => {\r\n lock = null;\r\n };\r\n if (lock === null) {\r\n lock = name;\r\n return openLock;\r\n }\r\n return false;\r\n };\r\n}\r\nconst globalHorizontalLock = createLock(\"dragHorizontal\");\r\nconst globalVerticalLock = createLock(\"dragVertical\");\r\nfunction getGlobalLock(drag) {\r\n let lock = false;\r\n if (drag === \"y\") {\r\n lock = globalVerticalLock();\r\n }\r\n else if (drag === \"x\") {\r\n lock = globalHorizontalLock();\r\n }\r\n else {\r\n const openHorizontal = globalHorizontalLock();\r\n const openVertical = globalVerticalLock();\r\n if (openHorizontal && openVertical) {\r\n lock = () => {\r\n openHorizontal();\r\n openVertical();\r\n };\r\n }\r\n else {\r\n // Release the locks because we don't use them\r\n if (openHorizontal)\r\n openHorizontal();\r\n if (openVertical)\r\n openVertical();\r\n }\r\n }\r\n return lock;\r\n}\r\nfunction isDragActive() {\r\n // Check the gesture lock - if we get it, it means no drag gesture is active\r\n // and we can safely fire the tap gesture.\r\n const openGestureLock = getGlobalLock(true);\r\n if (!openGestureLock)\r\n return true;\r\n openGestureLock();\r\n return false;\r\n}\r\n\r\nexport { createLock, getGlobalLock, isDragActive };\r\n","class Feature {\r\n constructor(node) {\r\n this.isMounted = false;\r\n this.node = node;\r\n }\r\n update() { }\r\n}\r\n\r\nexport { Feature };\r\n","import { addPointerEvent } from '../events/add-pointer-event.mjs';\r\nimport { pipe } from '../utils/pipe.mjs';\r\nimport { isDragActive } from './drag/utils/lock.mjs';\r\nimport { Feature } from '../motion/features/Feature.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction addHoverEvent(node, isActive) {\r\n const eventName = \"pointer\" + (isActive ? \"enter\" : \"leave\");\r\n const callbackName = \"onHover\" + (isActive ? \"Start\" : \"End\");\r\n const handleEvent = (event, info) => {\r\n if (event.pointerType === \"touch\" || isDragActive())\r\n return;\r\n const props = node.getProps();\r\n if (node.animationState && props.whileHover) {\r\n node.animationState.setActive(\"whileHover\", isActive);\r\n }\r\n if (props[callbackName]) {\r\n frame.update(() => props[callbackName](event, info));\r\n }\r\n };\r\n return addPointerEvent(node.current, eventName, handleEvent, {\r\n passive: !node.getProps()[callbackName],\r\n });\r\n}\r\nclass HoverGesture extends Feature {\r\n mount() {\r\n this.unmount = pipe(addHoverEvent(this.node, true), addHoverEvent(this.node, false));\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { HoverGesture };\r\n","import { addDomEvent } from '../events/add-dom-event.mjs';\r\nimport { Feature } from '../motion/features/Feature.mjs';\r\nimport { pipe } from '../utils/pipe.mjs';\r\n\r\nclass FocusGesture extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.isActive = false;\r\n }\r\n onFocus() {\r\n let isFocusVisible = false;\r\n /**\r\n * If this element doesn't match focus-visible then don't\r\n * apply whileHover. But, if matches throws that focus-visible\r\n * is not a valid selector then in that browser outline styles will be applied\r\n * to the element by default and we want to match that behaviour with whileFocus.\r\n */\r\n try {\r\n isFocusVisible = this.node.current.matches(\":focus-visible\");\r\n }\r\n catch (e) {\r\n isFocusVisible = true;\r\n }\r\n if (!isFocusVisible || !this.node.animationState)\r\n return;\r\n this.node.animationState.setActive(\"whileFocus\", true);\r\n this.isActive = true;\r\n }\r\n onBlur() {\r\n if (!this.isActive || !this.node.animationState)\r\n return;\r\n this.node.animationState.setActive(\"whileFocus\", false);\r\n this.isActive = false;\r\n }\r\n mount() {\r\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { FocusGesture };\r\n","/**\r\n * Recursively traverse up the tree to check whether the provided child node\r\n * is the parent or a descendant of it.\r\n *\r\n * @param parent - Element to find\r\n * @param child - Element to test against parent\r\n */\r\nconst isNodeOrChild = (parent, child) => {\r\n if (!child) {\r\n return false;\r\n }\r\n else if (parent === child) {\r\n return true;\r\n }\r\n else {\r\n return isNodeOrChild(parent, child.parentElement);\r\n }\r\n};\r\n\r\nexport { isNodeOrChild };\r\n","import { extractEventInfo } from '../events/event-info.mjs';\r\nimport { addDomEvent } from '../events/add-dom-event.mjs';\r\nimport { addPointerEvent } from '../events/add-pointer-event.mjs';\r\nimport { Feature } from '../motion/features/Feature.mjs';\r\nimport { pipe } from '../utils/pipe.mjs';\r\nimport { isDragActive } from './drag/utils/lock.mjs';\r\nimport { isNodeOrChild } from './utils/is-node-or-child.mjs';\r\nimport { noop } from '../utils/noop.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction fireSyntheticPointerEvent(name, handler) {\r\n if (!handler)\r\n return;\r\n const syntheticPointerEvent = new PointerEvent(\"pointer\" + name);\r\n handler(syntheticPointerEvent, extractEventInfo(syntheticPointerEvent));\r\n}\r\nclass PressGesture extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.removeStartListeners = noop;\r\n this.removeEndListeners = noop;\r\n this.removeAccessibleListeners = noop;\r\n this.startPointerPress = (startEvent, startInfo) => {\r\n if (this.isPressing)\r\n return;\r\n this.removeEndListeners();\r\n const props = this.node.getProps();\r\n const endPointerPress = (endEvent, endInfo) => {\r\n if (!this.checkPressEnd())\r\n return;\r\n const { onTap, onTapCancel, globalTapTarget } = this.node.getProps();\r\n frame.update(() => {\r\n /**\r\n * We only count this as a tap gesture if the event.target is the same\r\n * as, or a child of, this component's element\r\n */\r\n !globalTapTarget &&\r\n !isNodeOrChild(this.node.current, endEvent.target)\r\n ? onTapCancel && onTapCancel(endEvent, endInfo)\r\n : onTap && onTap(endEvent, endInfo);\r\n });\r\n };\r\n const removePointerUpListener = addPointerEvent(window, \"pointerup\", endPointerPress, { passive: !(props.onTap || props[\"onPointerUp\"]) });\r\n const removePointerCancelListener = addPointerEvent(window, \"pointercancel\", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo), { passive: !(props.onTapCancel || props[\"onPointerCancel\"]) });\r\n this.removeEndListeners = pipe(removePointerUpListener, removePointerCancelListener);\r\n this.startPress(startEvent, startInfo);\r\n };\r\n this.startAccessiblePress = () => {\r\n const handleKeydown = (keydownEvent) => {\r\n if (keydownEvent.key !== \"Enter\" || this.isPressing)\r\n return;\r\n const handleKeyup = (keyupEvent) => {\r\n if (keyupEvent.key !== \"Enter\" || !this.checkPressEnd())\r\n return;\r\n fireSyntheticPointerEvent(\"up\", (event, info) => {\r\n const { onTap } = this.node.getProps();\r\n if (onTap) {\r\n frame.update(() => onTap(event, info));\r\n }\r\n });\r\n };\r\n this.removeEndListeners();\r\n this.removeEndListeners = addDomEvent(this.node.current, \"keyup\", handleKeyup);\r\n fireSyntheticPointerEvent(\"down\", (event, info) => {\r\n this.startPress(event, info);\r\n });\r\n };\r\n const removeKeydownListener = addDomEvent(this.node.current, \"keydown\", handleKeydown);\r\n const handleBlur = () => {\r\n if (!this.isPressing)\r\n return;\r\n fireSyntheticPointerEvent(\"cancel\", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo));\r\n };\r\n const removeBlurListener = addDomEvent(this.node.current, \"blur\", handleBlur);\r\n this.removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener);\r\n };\r\n }\r\n startPress(event, info) {\r\n this.isPressing = true;\r\n const { onTapStart, whileTap } = this.node.getProps();\r\n /**\r\n * Ensure we trigger animations before firing event callback\r\n */\r\n if (whileTap && this.node.animationState) {\r\n this.node.animationState.setActive(\"whileTap\", true);\r\n }\r\n if (onTapStart) {\r\n frame.update(() => onTapStart(event, info));\r\n }\r\n }\r\n checkPressEnd() {\r\n this.removeEndListeners();\r\n this.isPressing = false;\r\n const props = this.node.getProps();\r\n if (props.whileTap && this.node.animationState) {\r\n this.node.animationState.setActive(\"whileTap\", false);\r\n }\r\n return !isDragActive();\r\n }\r\n cancelPress(event, info) {\r\n if (!this.checkPressEnd())\r\n return;\r\n const { onTapCancel } = this.node.getProps();\r\n if (onTapCancel) {\r\n frame.update(() => onTapCancel(event, info));\r\n }\r\n }\r\n mount() {\r\n const props = this.node.getProps();\r\n const removePointerListener = addPointerEvent(props.globalTapTarget ? window : this.node.current, \"pointerdown\", this.startPointerPress, { passive: !(props.onTapStart || props[\"onPointerStart\"]) });\r\n const removeFocusListener = addDomEvent(this.node.current, \"focus\", this.startAccessiblePress);\r\n this.removeStartListeners = pipe(removePointerListener, removeFocusListener);\r\n }\r\n unmount() {\r\n this.removeStartListeners();\r\n this.removeEndListeners();\r\n this.removeAccessibleListeners();\r\n }\r\n}\r\n\r\nexport { PressGesture };\r\n","/**\r\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\r\n * element, so even though these handlers might all be triggered by different\r\n * observers, we can keep them in the same map.\r\n */\r\nconst observerCallbacks = new WeakMap();\r\n/**\r\n * Multiple observers can be created for multiple element/document roots. Each with\r\n * different settings. So here we store dictionaries of observers to each root,\r\n * using serialised settings (threshold/margin) as lookup keys.\r\n */\r\nconst observers = new WeakMap();\r\nconst fireObserverCallback = (entry) => {\r\n const callback = observerCallbacks.get(entry.target);\r\n callback && callback(entry);\r\n};\r\nconst fireAllObserverCallbacks = (entries) => {\r\n entries.forEach(fireObserverCallback);\r\n};\r\nfunction initIntersectionObserver({ root, ...options }) {\r\n const lookupRoot = root || document;\r\n /**\r\n * If we don't have an observer lookup map for this root, create one.\r\n */\r\n if (!observers.has(lookupRoot)) {\r\n observers.set(lookupRoot, {});\r\n }\r\n const rootObservers = observers.get(lookupRoot);\r\n const key = JSON.stringify(options);\r\n /**\r\n * If we don't have an observer for this combination of root and settings,\r\n * create one.\r\n */\r\n if (!rootObservers[key]) {\r\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\r\n }\r\n return rootObservers[key];\r\n}\r\nfunction observeIntersection(element, options, callback) {\r\n const rootInteresectionObserver = initIntersectionObserver(options);\r\n observerCallbacks.set(element, callback);\r\n rootInteresectionObserver.observe(element);\r\n return () => {\r\n observerCallbacks.delete(element);\r\n rootInteresectionObserver.unobserve(element);\r\n };\r\n}\r\n\r\nexport { observeIntersection };\r\n","import { Feature } from '../Feature.mjs';\r\nimport { observeIntersection } from './observers.mjs';\r\n\r\nconst thresholdNames = {\r\n some: 0,\r\n all: 1,\r\n};\r\nclass InViewFeature extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.hasEnteredView = false;\r\n this.isInView = false;\r\n }\r\n startObserver() {\r\n this.unmount();\r\n const { viewport = {} } = this.node.getProps();\r\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\r\n const options = {\r\n root: root ? root.current : undefined,\r\n rootMargin,\r\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\r\n };\r\n const onIntersectionUpdate = (entry) => {\r\n const { isIntersecting } = entry;\r\n /**\r\n * If there's been no change in the viewport state, early return.\r\n */\r\n if (this.isInView === isIntersecting)\r\n return;\r\n this.isInView = isIntersecting;\r\n /**\r\n * Handle hasEnteredView. If this is only meant to run once, and\r\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\r\n */\r\n if (once && !isIntersecting && this.hasEnteredView) {\r\n return;\r\n }\r\n else if (isIntersecting) {\r\n this.hasEnteredView = true;\r\n }\r\n if (this.node.animationState) {\r\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\r\n }\r\n /**\r\n * Use the latest committed props rather than the ones in scope\r\n * when this observer is created\r\n */\r\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\r\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\r\n callback && callback(entry);\r\n };\r\n return observeIntersection(this.node.current, options, onIntersectionUpdate);\r\n }\r\n mount() {\r\n this.startObserver();\r\n }\r\n update() {\r\n if (typeof IntersectionObserver === \"undefined\")\r\n return;\r\n const { props, prevProps } = this.node;\r\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\r\n if (hasOptionsChanged) {\r\n this.startObserver();\r\n }\r\n }\r\n unmount() { }\r\n}\r\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\r\n return (name) => viewport[name] !== prevViewport[name];\r\n}\r\n\r\nexport { InViewFeature };\r\n","import { HoverGesture } from '../../gestures/hover.mjs';\r\nimport { FocusGesture } from '../../gestures/focus.mjs';\r\nimport { PressGesture } from '../../gestures/press.mjs';\r\nimport { InViewFeature } from './viewport/index.mjs';\r\n\r\nconst gestureAnimations = {\r\n inView: {\r\n Feature: InViewFeature,\r\n },\r\n tap: {\r\n Feature: PressGesture,\r\n },\r\n focus: {\r\n Feature: FocusGesture,\r\n },\r\n hover: {\r\n Feature: HoverGesture,\r\n },\r\n};\r\n\r\nexport { gestureAnimations };\r\n","function shallowCompare(next, prev) {\r\n if (!Array.isArray(prev))\r\n return false;\r\n const prevLength = prev.length;\r\n if (prevLength !== next.length)\r\n return false;\r\n for (let i = 0; i < prevLength; i++) {\r\n if (prev[i] !== next[i])\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\nexport { shallowCompare };\r\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\r\n\r\n/**\r\n * Creates an object containing the latest state of every MotionValue on a VisualElement\r\n */\r\nfunction getCurrent(visualElement) {\r\n const current = {};\r\n visualElement.values.forEach((value, key) => (current[key] = value.get()));\r\n return current;\r\n}\r\n/**\r\n * Creates an object containing the latest velocity of every MotionValue on a VisualElement\r\n */\r\nfunction getVelocity(visualElement) {\r\n const velocity = {};\r\n visualElement.values.forEach((value, key) => (velocity[key] = value.getVelocity()));\r\n return velocity;\r\n}\r\nfunction resolveVariant(visualElement, definition, custom) {\r\n const props = visualElement.getProps();\r\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement));\r\n}\r\n\r\nexport { resolveVariant };\r\n","import { noop } from './noop.mjs';\r\n\r\nlet warning = noop;\r\nlet invariant = noop;\r\nif (process.env.NODE_ENV !== \"production\") {\r\n warning = (check, message) => {\r\n if (!check && typeof console !== \"undefined\") {\r\n console.warn(message);\r\n }\r\n };\r\n invariant = (check, message) => {\r\n if (!check) {\r\n throw new Error(message);\r\n }\r\n };\r\n}\r\n\r\nexport { invariant, warning };\r\n","/**\r\n * Converts seconds to milliseconds\r\n *\r\n * @param seconds - Time in seconds.\r\n * @return milliseconds - Converted time in milliseconds.\r\n */\r\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\r\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\r\n\r\nexport { millisecondsToSeconds, secondsToMilliseconds };\r\n","const instantAnimationState = {\r\n current: false,\r\n};\r\n\r\nexport { instantAnimationState };\r\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\r\n\r\nexport { isBezierDefinition };\r\n","import { isBezierDefinition } from '../../../easing/utils/is-bezier-definition.mjs';\r\n\r\nfunction isWaapiSupportedEasing(easing) {\r\n return Boolean(!easing ||\r\n (typeof easing === \"string\" && supportedWaapiEasing[easing]) ||\r\n isBezierDefinition(easing) ||\r\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));\r\n}\r\nconst cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\r\nconst supportedWaapiEasing = {\r\n linear: \"linear\",\r\n ease: \"ease\",\r\n easeIn: \"ease-in\",\r\n easeOut: \"ease-out\",\r\n easeInOut: \"ease-in-out\",\r\n circIn: cubicBezierAsString([0, 0.65, 0.55, 1]),\r\n circOut: cubicBezierAsString([0.55, 0, 1, 0.45]),\r\n backIn: cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\r\n backOut: cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\r\n};\r\nfunction mapEasingToNativeEasing(easing) {\r\n if (!easing)\r\n return undefined;\r\n return isBezierDefinition(easing)\r\n ? cubicBezierAsString(easing)\r\n : Array.isArray(easing)\r\n ? easing.map(mapEasingToNativeEasing)\r\n : supportedWaapiEasing[easing];\r\n}\r\n\r\nexport { cubicBezierAsString, isWaapiSupportedEasing, mapEasingToNativeEasing, supportedWaapiEasing };\r\n","import { mapEasingToNativeEasing } from './easing.mjs';\r\n\r\nfunction animateStyle(element, valueName, keyframes, { delay = 0, duration, repeat = 0, repeatType = \"loop\", ease, times, } = {}) {\r\n const keyframeOptions = { [valueName]: keyframes };\r\n if (times)\r\n keyframeOptions.offset = times;\r\n const easing = mapEasingToNativeEasing(ease);\r\n /**\r\n * If this is an easing array, apply to keyframes, not animation as a whole\r\n */\r\n if (Array.isArray(easing))\r\n keyframeOptions.easing = easing;\r\n return element.animate(keyframeOptions, {\r\n delay,\r\n duration,\r\n easing: !Array.isArray(easing) ? easing : \"linear\",\r\n fill: \"both\",\r\n iterations: repeat + 1,\r\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\r\n });\r\n}\r\n\r\nexport { animateStyle };\r\n","function getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }) {\r\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\r\n ? 0\r\n : keyframes.length - 1;\r\n return keyframes[index];\r\n}\r\n\r\nexport { getFinalKeyframe };\r\n","import { noop } from '../utils/noop.mjs';\r\n\r\n/*\r\n Bezier function generator\r\n This has been modified from Gaëtan Renaudeau's BezierEasing\r\n https://github.com/gre/bezier-easing/blob/master/src/index.js\r\n https://github.com/gre/bezier-easing/blob/master/LICENSE\r\n \r\n I've removed the newtonRaphsonIterate algo because in benchmarking it\r\n wasn't noticiably faster than binarySubdivision, indeed removing it\r\n usually improved times, depending on the curve.\r\n I also removed the lookup table, as for the added bundle size and loop we're\r\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\r\n to 12 to compensate and this still tended to be faster for no perceivable\r\n loss in accuracy.\r\n Usage\r\n const easeOut = cubicBezier(.17,.67,.83,.67);\r\n const x = easeOut(0.5); // returns 0.627...\r\n*/\r\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\r\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\r\n t;\r\nconst subdivisionPrecision = 0.0000001;\r\nconst subdivisionMaxIterations = 12;\r\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\r\n let currentX;\r\n let currentT;\r\n let i = 0;\r\n do {\r\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\r\n currentX = calcBezier(currentT, mX1, mX2) - x;\r\n if (currentX > 0.0) {\r\n upperBound = currentT;\r\n }\r\n else {\r\n lowerBound = currentT;\r\n }\r\n } while (Math.abs(currentX) > subdivisionPrecision &&\r\n ++i < subdivisionMaxIterations);\r\n return currentT;\r\n}\r\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\r\n // If this is a linear gradient, return linear easing\r\n if (mX1 === mY1 && mX2 === mY2)\r\n return noop;\r\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\r\n // If animation is at start/end, return t without easing\r\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\r\n}\r\n\r\nexport { cubicBezier };\r\n","import { cubicBezier } from './cubic-bezier.mjs';\r\n\r\nconst easeIn = cubicBezier(0.42, 0, 1, 1);\r\nconst easeOut = cubicBezier(0, 0, 0.58, 1);\r\nconst easeInOut = cubicBezier(0.42, 0, 0.58, 1);\r\n\r\nexport { easeIn, easeInOut, easeOut };\r\n","const isEasingArray = (ease) => {\r\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\r\n};\r\n\r\nexport { isEasingArray };\r\n","// Accepts an easing function and returns a new one that outputs mirrored values for\r\n// the second half of the animation. Turns easeIn into easeInOut.\r\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\r\n\r\nexport { mirrorEasing };\r\n","// Accepts an easing function and returns a new one that outputs reversed values.\r\n// Turns easeIn into easeOut.\r\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\r\n\r\nexport { reverseEasing };\r\n","import { mirrorEasing } from './modifiers/mirror.mjs';\r\nimport { reverseEasing } from './modifiers/reverse.mjs';\r\n\r\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\r\nconst circOut = reverseEasing(circIn);\r\nconst circInOut = mirrorEasing(circIn);\r\n\r\nexport { circIn, circInOut, circOut };\r\n","import { cubicBezier } from './cubic-bezier.mjs';\r\nimport { mirrorEasing } from './modifiers/mirror.mjs';\r\nimport { reverseEasing } from './modifiers/reverse.mjs';\r\n\r\nconst backOut = cubicBezier(0.33, 1.53, 0.69, 0.99);\r\nconst backIn = reverseEasing(backOut);\r\nconst backInOut = mirrorEasing(backIn);\r\n\r\nexport { backIn, backInOut, backOut };\r\n","import { backIn } from './back.mjs';\r\n\r\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\r\n\r\nexport { anticipate };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport { cubicBezier } from '../cubic-bezier.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\r\nimport { circIn, circInOut, circOut } from '../circ.mjs';\r\nimport { backIn, backInOut, backOut } from '../back.mjs';\r\nimport { anticipate } from '../anticipate.mjs';\r\n\r\nconst easingLookup = {\r\n linear: noop,\r\n easeIn,\r\n easeInOut,\r\n easeOut,\r\n circIn,\r\n circInOut,\r\n circOut,\r\n backIn,\r\n backInOut,\r\n backOut,\r\n anticipate,\r\n};\r\nconst easingDefinitionToFunction = (definition) => {\r\n if (Array.isArray(definition)) {\r\n // If cubic bezier definition, create bezier curve\r\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);\r\n const [x1, y1, x2, y2] = definition;\r\n return cubicBezier(x1, y1, x2, y2);\r\n }\r\n else if (typeof definition === \"string\") {\r\n // Else lookup from table\r\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`);\r\n return easingLookup[definition];\r\n }\r\n return definition;\r\n};\r\n\r\nexport { easingDefinitionToFunction };\r\n","import { isString, singleColorRegex, floatRegex } from '../utils.mjs';\r\n\r\n/**\r\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\r\n * but false if a number or multiple colors\r\n */\r\nconst isColorString = (type, testProp) => (v) => {\r\n return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) ||\r\n (testProp && Object.prototype.hasOwnProperty.call(v, testProp)));\r\n};\r\nconst splitColor = (aName, bName, cName) => (v) => {\r\n if (!isString(v))\r\n return v;\r\n const [a, b, c, alpha] = v.match(floatRegex);\r\n return {\r\n [aName]: parseFloat(a),\r\n [bName]: parseFloat(b),\r\n [cName]: parseFloat(c),\r\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\r\n };\r\n};\r\n\r\nexport { isColorString, splitColor };\r\n","import { clamp } from '../../../utils/clamp.mjs';\r\nimport { number, alpha } from '../numbers/index.mjs';\r\nimport { sanitize } from '../utils.mjs';\r\nimport { isColorString, splitColor } from './utils.mjs';\r\n\r\nconst clampRgbUnit = (v) => clamp(0, 255, v);\r\nconst rgbUnit = {\r\n ...number,\r\n transform: (v) => Math.round(clampRgbUnit(v)),\r\n};\r\nconst rgba = {\r\n test: isColorString(\"rgb\", \"red\"),\r\n parse: splitColor(\"red\", \"green\", \"blue\"),\r\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\r\n rgbUnit.transform(red) +\r\n \", \" +\r\n rgbUnit.transform(green) +\r\n \", \" +\r\n rgbUnit.transform(blue) +\r\n \", \" +\r\n sanitize(alpha.transform(alpha$1)) +\r\n \")\",\r\n};\r\n\r\nexport { rgbUnit, rgba };\r\n","import { rgba } from './rgba.mjs';\r\nimport { isColorString } from './utils.mjs';\r\n\r\nfunction parseHex(v) {\r\n let r = \"\";\r\n let g = \"\";\r\n let b = \"\";\r\n let a = \"\";\r\n // If we have 6 characters, ie #FF0000\r\n if (v.length > 5) {\r\n r = v.substring(1, 3);\r\n g = v.substring(3, 5);\r\n b = v.substring(5, 7);\r\n a = v.substring(7, 9);\r\n // Or we have 3 characters, ie #F00\r\n }\r\n else {\r\n r = v.substring(1, 2);\r\n g = v.substring(2, 3);\r\n b = v.substring(3, 4);\r\n a = v.substring(4, 5);\r\n r += r;\r\n g += g;\r\n b += b;\r\n a += a;\r\n }\r\n return {\r\n red: parseInt(r, 16),\r\n green: parseInt(g, 16),\r\n blue: parseInt(b, 16),\r\n alpha: a ? parseInt(a, 16) / 255 : 1,\r\n };\r\n}\r\nconst hex = {\r\n test: isColorString(\"#\"),\r\n parse: parseHex,\r\n transform: rgba.transform,\r\n};\r\n\r\nexport { hex };\r\n","import { alpha } from '../numbers/index.mjs';\r\nimport { percent } from '../numbers/units.mjs';\r\nimport { sanitize } from '../utils.mjs';\r\nimport { isColorString, splitColor } from './utils.mjs';\r\n\r\nconst hsla = {\r\n test: isColorString(\"hsl\", \"hue\"),\r\n parse: splitColor(\"hue\", \"saturation\", \"lightness\"),\r\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\r\n return (\"hsla(\" +\r\n Math.round(hue) +\r\n \", \" +\r\n percent.transform(sanitize(saturation)) +\r\n \", \" +\r\n percent.transform(sanitize(lightness)) +\r\n \", \" +\r\n sanitize(alpha.transform(alpha$1)) +\r\n \")\");\r\n },\r\n};\r\n\r\nexport { hsla };\r\n","import { isString } from '../utils.mjs';\r\nimport { hex } from './hex.mjs';\r\nimport { hsla } from './hsla.mjs';\r\nimport { rgba } from './rgba.mjs';\r\n\r\nconst color = {\r\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\r\n parse: (v) => {\r\n if (rgba.test(v)) {\r\n return rgba.parse(v);\r\n }\r\n else if (hsla.test(v)) {\r\n return hsla.parse(v);\r\n }\r\n else {\r\n return hex.parse(v);\r\n }\r\n },\r\n transform: (v) => {\r\n return isString(v)\r\n ? v\r\n : v.hasOwnProperty(\"red\")\r\n ? rgba.transform(v)\r\n : hsla.transform(v);\r\n },\r\n};\r\n\r\nexport { color };\r\n","/*\r\n Value in range from progress\r\n\r\n Given a lower limit and an upper limit, we return the value within\r\n that range as expressed by progress (usually a number from 0 to 1)\r\n\r\n So progress = 0.5 would change\r\n\r\n from -------- to\r\n\r\n to\r\n\r\n from ---- to\r\n\r\n E.g. from = 10, to = 20, progress = 0.5 => 15\r\n\r\n @param [number]: Lower limit of range\r\n @param [number]: Upper limit of range\r\n @param [number]: The progress between lower and upper limits expressed 0-1\r\n @return [number]: Value as calculated from progress within range (not limited within range)\r\n*/\r\nconst mix = (from, to, progress) => -progress * from + progress * to + from;\r\n\r\nexport { mix };\r\n","// Adapted from https://gist.github.com/mjackson/5311256\r\nfunction hueToRgb(p, q, t) {\r\n if (t < 0)\r\n t += 1;\r\n if (t > 1)\r\n t -= 1;\r\n if (t < 1 / 6)\r\n return p + (q - p) * 6 * t;\r\n if (t < 1 / 2)\r\n return q;\r\n if (t < 2 / 3)\r\n return p + (q - p) * (2 / 3 - t) * 6;\r\n return p;\r\n}\r\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\r\n hue /= 360;\r\n saturation /= 100;\r\n lightness /= 100;\r\n let red = 0;\r\n let green = 0;\r\n let blue = 0;\r\n if (!saturation) {\r\n red = green = blue = lightness;\r\n }\r\n else {\r\n const q = lightness < 0.5\r\n ? lightness * (1 + saturation)\r\n : lightness + saturation - lightness * saturation;\r\n const p = 2 * lightness - q;\r\n red = hueToRgb(p, q, hue + 1 / 3);\r\n green = hueToRgb(p, q, hue);\r\n blue = hueToRgb(p, q, hue - 1 / 3);\r\n }\r\n return {\r\n red: Math.round(red * 255),\r\n green: Math.round(green * 255),\r\n blue: Math.round(blue * 255),\r\n alpha,\r\n };\r\n}\r\n\r\nexport { hslaToRgba };\r\n","import { mix } from './mix.mjs';\r\nimport { invariant } from './errors.mjs';\r\nimport { hslaToRgba } from './hsla-to-rgba.mjs';\r\nimport { hex } from '../value/types/color/hex.mjs';\r\nimport { rgba } from '../value/types/color/rgba.mjs';\r\nimport { hsla } from '../value/types/color/hsla.mjs';\r\n\r\n// Linear color space blending\r\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\r\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\r\nconst mixLinearColor = (from, to, v) => {\r\n const fromExpo = from * from;\r\n return Math.sqrt(Math.max(0, v * (to * to - fromExpo) + fromExpo));\r\n};\r\nconst colorTypes = [hex, rgba, hsla];\r\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\r\nfunction asRGBA(color) {\r\n const type = getColorType(color);\r\n invariant(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`);\r\n let model = type.parse(color);\r\n if (type === hsla) {\r\n // TODO Remove this cast - needed since Framer Motion's stricter typing\r\n model = hslaToRgba(model);\r\n }\r\n return model;\r\n}\r\nconst mixColor = (from, to) => {\r\n const fromRGBA = asRGBA(from);\r\n const toRGBA = asRGBA(to);\r\n const blended = { ...fromRGBA };\r\n return (v) => {\r\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\r\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\r\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\r\n blended.alpha = mix(fromRGBA.alpha, toRGBA.alpha, v);\r\n return rgba.transform(blended);\r\n };\r\n};\r\n\r\nexport { mixColor, mixLinearColor };\r\n","import { cssVariableRegex } from '../../../render/dom/utils/is-css-variable.mjs';\r\nimport { noop } from '../../../utils/noop.mjs';\r\nimport { color } from '../color/index.mjs';\r\nimport { number } from '../numbers/index.mjs';\r\nimport { colorRegex, floatRegex, isString, sanitize } from '../utils.mjs';\r\n\r\nfunction test(v) {\r\n var _a, _b;\r\n return (isNaN(v) &&\r\n isString(v) &&\r\n (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +\r\n (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) >\r\n 0);\r\n}\r\nconst cssVarTokeniser = {\r\n regex: cssVariableRegex,\r\n countKey: \"Vars\",\r\n token: \"${v}\",\r\n parse: noop,\r\n};\r\nconst colorTokeniser = {\r\n regex: colorRegex,\r\n countKey: \"Colors\",\r\n token: \"${c}\",\r\n parse: color.parse,\r\n};\r\nconst numberTokeniser = {\r\n regex: floatRegex,\r\n countKey: \"Numbers\",\r\n token: \"${n}\",\r\n parse: number.parse,\r\n};\r\nfunction tokenise(info, { regex, countKey, token, parse }) {\r\n const matches = info.tokenised.match(regex);\r\n if (!matches)\r\n return;\r\n info[\"num\" + countKey] = matches.length;\r\n info.tokenised = info.tokenised.replace(regex, token);\r\n info.values.push(...matches.map(parse));\r\n}\r\nfunction analyseComplexValue(value) {\r\n const originalValue = value.toString();\r\n const info = {\r\n value: originalValue,\r\n tokenised: originalValue,\r\n values: [],\r\n numVars: 0,\r\n numColors: 0,\r\n numNumbers: 0,\r\n };\r\n if (info.value.includes(\"var(--\"))\r\n tokenise(info, cssVarTokeniser);\r\n tokenise(info, colorTokeniser);\r\n tokenise(info, numberTokeniser);\r\n return info;\r\n}\r\nfunction parseComplexValue(v) {\r\n return analyseComplexValue(v).values;\r\n}\r\nfunction createTransformer(source) {\r\n const { values, numColors, numVars, tokenised } = analyseComplexValue(source);\r\n const numValues = values.length;\r\n return (v) => {\r\n let output = tokenised;\r\n for (let i = 0; i < numValues; i++) {\r\n if (i < numVars) {\r\n output = output.replace(cssVarTokeniser.token, v[i]);\r\n }\r\n else if (i < numVars + numColors) {\r\n output = output.replace(colorTokeniser.token, color.transform(v[i]));\r\n }\r\n else {\r\n output = output.replace(numberTokeniser.token, sanitize(v[i]));\r\n }\r\n }\r\n return output;\r\n };\r\n}\r\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : v;\r\nfunction getAnimatableNone(v) {\r\n const parsed = parseComplexValue(v);\r\n const transformer = createTransformer(v);\r\n return transformer(parsed.map(convertNumbersToZero));\r\n}\r\nconst complex = {\r\n test,\r\n parse: parseComplexValue,\r\n createTransformer,\r\n getAnimatableNone,\r\n};\r\n\r\nexport { analyseComplexValue, complex };\r\n","import { mix } from './mix.mjs';\r\nimport { mixColor } from './mix-color.mjs';\r\nimport { pipe } from './pipe.mjs';\r\nimport { warning } from './errors.mjs';\r\nimport { color } from '../value/types/color/index.mjs';\r\nimport { complex, analyseComplexValue } from '../value/types/complex/index.mjs';\r\n\r\nconst mixImmediate = (origin, target) => (p) => `${p > 0 ? target : origin}`;\r\nfunction getMixer(origin, target) {\r\n if (typeof origin === \"number\") {\r\n return (v) => mix(origin, target, v);\r\n }\r\n else if (color.test(origin)) {\r\n return mixColor(origin, target);\r\n }\r\n else {\r\n return origin.startsWith(\"var(\")\r\n ? mixImmediate(origin, target)\r\n : mixComplex(origin, target);\r\n }\r\n}\r\nconst mixArray = (from, to) => {\r\n const output = [...from];\r\n const numValues = output.length;\r\n const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i]));\r\n return (v) => {\r\n for (let i = 0; i < numValues; i++) {\r\n output[i] = blendValue[i](v);\r\n }\r\n return output;\r\n };\r\n};\r\nconst mixObject = (origin, target) => {\r\n const output = { ...origin, ...target };\r\n const blendValue = {};\r\n for (const key in output) {\r\n if (origin[key] !== undefined && target[key] !== undefined) {\r\n blendValue[key] = getMixer(origin[key], target[key]);\r\n }\r\n }\r\n return (v) => {\r\n for (const key in blendValue) {\r\n output[key] = blendValue[key](v);\r\n }\r\n return output;\r\n };\r\n};\r\nconst mixComplex = (origin, target) => {\r\n const template = complex.createTransformer(target);\r\n const originStats = analyseComplexValue(origin);\r\n const targetStats = analyseComplexValue(target);\r\n const canInterpolate = originStats.numVars === targetStats.numVars &&\r\n originStats.numColors === targetStats.numColors &&\r\n originStats.numNumbers >= targetStats.numNumbers;\r\n if (canInterpolate) {\r\n return pipe(mixArray(originStats.values, targetStats.values), template);\r\n }\r\n else {\r\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);\r\n return mixImmediate(origin, target);\r\n }\r\n};\r\n\r\nexport { mixArray, mixComplex, mixObject };\r\n","/*\r\n Progress within given range\r\n\r\n Given a lower limit and an upper limit, we return the progress\r\n (expressed as a number 0-1) represented by the given value, and\r\n limit that progress to within 0-1.\r\n\r\n @param [number]: Lower limit\r\n @param [number]: Upper limit\r\n @param [number]: Value to find progress within given range\r\n @return [number]: Progress of value within range as expressed 0-1\r\n*/\r\nconst progress = (from, to, value) => {\r\n const toFromDifference = to - from;\r\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\r\n};\r\n\r\nexport { progress };\r\n","import { invariant } from './errors.mjs';\r\nimport { color } from '../value/types/color/index.mjs';\r\nimport { clamp } from './clamp.mjs';\r\nimport { mix } from './mix.mjs';\r\nimport { mixColor } from './mix-color.mjs';\r\nimport { mixComplex, mixArray, mixObject } from './mix-complex.mjs';\r\nimport { pipe } from './pipe.mjs';\r\nimport { progress } from './progress.mjs';\r\nimport { noop } from './noop.mjs';\r\n\r\nconst mixNumber = (from, to) => (p) => mix(from, to, p);\r\nfunction detectMixerFactory(v) {\r\n if (typeof v === \"number\") {\r\n return mixNumber;\r\n }\r\n else if (typeof v === \"string\") {\r\n return color.test(v) ? mixColor : mixComplex;\r\n }\r\n else if (Array.isArray(v)) {\r\n return mixArray;\r\n }\r\n else if (typeof v === \"object\") {\r\n return mixObject;\r\n }\r\n return mixNumber;\r\n}\r\nfunction createMixers(output, ease, customMixer) {\r\n const mixers = [];\r\n const mixerFactory = customMixer || detectMixerFactory(output[0]);\r\n const numMixers = output.length - 1;\r\n for (let i = 0; i < numMixers; i++) {\r\n let mixer = mixerFactory(output[i], output[i + 1]);\r\n if (ease) {\r\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\r\n mixer = pipe(easingFunction, mixer);\r\n }\r\n mixers.push(mixer);\r\n }\r\n return mixers;\r\n}\r\n/**\r\n * Create a function that maps from a numerical input array to a generic output array.\r\n *\r\n * Accepts:\r\n * - Numbers\r\n * - Colors (hex, hsl, hsla, rgb, rgba)\r\n * - Complex (combinations of one or more numbers or strings)\r\n *\r\n * ```jsx\r\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\r\n *\r\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\r\n * ```\r\n *\r\n * TODO Revist this approach once we've moved to data models for values,\r\n * probably not needed to pregenerate mixer functions.\r\n *\r\n * @public\r\n */\r\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\r\n const inputLength = input.length;\r\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\");\r\n /**\r\n * If we're only provided a single input, we can just make a function\r\n * that returns the output.\r\n */\r\n if (inputLength === 1)\r\n return () => output[0];\r\n // If input runs highest -> lowest, reverse both arrays\r\n if (input[0] > input[inputLength - 1]) {\r\n input = [...input].reverse();\r\n output = [...output].reverse();\r\n }\r\n const mixers = createMixers(output, ease, mixer);\r\n const numMixers = mixers.length;\r\n const interpolator = (v) => {\r\n let i = 0;\r\n if (numMixers > 1) {\r\n for (; i < input.length - 2; i++) {\r\n if (v < input[i + 1])\r\n break;\r\n }\r\n }\r\n const progressInRange = progress(input[i], input[i + 1], v);\r\n return mixers[i](progressInRange);\r\n };\r\n return isClamp\r\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\r\n : interpolator;\r\n}\r\n\r\nexport { interpolate };\r\n","import { mix } from '../mix.mjs';\r\nimport { progress } from '../progress.mjs';\r\n\r\nfunction fillOffset(offset, remaining) {\r\n const min = offset[offset.length - 1];\r\n for (let i = 1; i <= remaining; i++) {\r\n const offsetProgress = progress(0, remaining, i);\r\n offset.push(mix(min, 1, offsetProgress));\r\n }\r\n}\r\n\r\nexport { fillOffset };\r\n","import { fillOffset } from './fill.mjs';\r\n\r\nfunction defaultOffset(arr) {\r\n const offset = [0];\r\n fillOffset(offset, arr.length - 1);\r\n return offset;\r\n}\r\n\r\nexport { defaultOffset };\r\n","function convertOffsetToTimes(offset, duration) {\r\n return offset.map((o) => o * duration);\r\n}\r\n\r\nexport { convertOffsetToTimes };\r\n","import { easeInOut } from '../../easing/ease.mjs';\r\nimport { isEasingArray } from '../../easing/utils/is-easing-array.mjs';\r\nimport { easingDefinitionToFunction } from '../../easing/utils/map.mjs';\r\nimport { interpolate } from '../../utils/interpolate.mjs';\r\nimport { defaultOffset } from '../../utils/offsets/default.mjs';\r\nimport { convertOffsetToTimes } from '../../utils/offsets/time.mjs';\r\n\r\nfunction defaultEasing(values, easing) {\r\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\r\n}\r\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\r\n /**\r\n * Easing functions can be externally defined as strings. Here we convert them\r\n * into actual functions.\r\n */\r\n const easingFunctions = isEasingArray(ease)\r\n ? ease.map(easingDefinitionToFunction)\r\n : easingDefinitionToFunction(ease);\r\n /**\r\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\r\n * to reduce GC during animation.\r\n */\r\n const state = {\r\n done: false,\r\n value: keyframeValues[0],\r\n };\r\n /**\r\n * Create a times array based on the provided 0-1 offsets\r\n */\r\n const absoluteTimes = convertOffsetToTimes(\r\n // Only use the provided offsets if they're the correct length\r\n // TODO Maybe we should warn here if there's a length mismatch\r\n times && times.length === keyframeValues.length\r\n ? times\r\n : defaultOffset(keyframeValues), duration);\r\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\r\n ease: Array.isArray(easingFunctions)\r\n ? easingFunctions\r\n : defaultEasing(keyframeValues, easingFunctions),\r\n });\r\n return {\r\n calculatedDuration: duration,\r\n next: (t) => {\r\n state.value = mapTimeToKeyframe(t);\r\n state.done = t >= duration;\r\n return state;\r\n },\r\n };\r\n}\r\n\r\nexport { defaultEasing, keyframes };\r\n","/*\r\n Convert velocity into velocity per second\r\n\r\n @param [number]: Unit per frame\r\n @param [number]: Frame duration in ms\r\n*/\r\nfunction velocityPerSecond(velocity, frameDuration) {\r\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\r\n}\r\n\r\nexport { velocityPerSecond };\r\n","import { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';\r\n\r\nconst velocitySampleDuration = 5; // ms\r\nfunction calcGeneratorVelocity(resolveValue, t, current) {\r\n const prevT = Math.max(t - velocitySampleDuration, 0);\r\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\r\n}\r\n\r\nexport { calcGeneratorVelocity };\r\n","import { warning } from '../../../utils/errors.mjs';\r\nimport { clamp } from '../../../utils/clamp.mjs';\r\nimport { secondsToMilliseconds, millisecondsToSeconds } from '../../../utils/time-conversion.mjs';\r\n\r\nconst safeMin = 0.001;\r\nconst minDuration = 0.01;\r\nconst maxDuration = 10.0;\r\nconst minDamping = 0.05;\r\nconst maxDamping = 1;\r\nfunction findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) {\r\n let envelope;\r\n let derivative;\r\n warning(duration <= secondsToMilliseconds(maxDuration), \"Spring duration must be 10 seconds or less\");\r\n let dampingRatio = 1 - bounce;\r\n /**\r\n * Restrict dampingRatio and duration to within acceptable ranges.\r\n */\r\n dampingRatio = clamp(minDamping, maxDamping, dampingRatio);\r\n duration = clamp(minDuration, maxDuration, millisecondsToSeconds(duration));\r\n if (dampingRatio < 1) {\r\n /**\r\n * Underdamped spring\r\n */\r\n envelope = (undampedFreq) => {\r\n const exponentialDecay = undampedFreq * dampingRatio;\r\n const delta = exponentialDecay * duration;\r\n const a = exponentialDecay - velocity;\r\n const b = calcAngularFreq(undampedFreq, dampingRatio);\r\n const c = Math.exp(-delta);\r\n return safeMin - (a / b) * c;\r\n };\r\n derivative = (undampedFreq) => {\r\n const exponentialDecay = undampedFreq * dampingRatio;\r\n const delta = exponentialDecay * duration;\r\n const d = delta * velocity + velocity;\r\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\r\n const f = Math.exp(-delta);\r\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\r\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\r\n return (factor * ((d - e) * f)) / g;\r\n };\r\n }\r\n else {\r\n /**\r\n * Critically-damped spring\r\n */\r\n envelope = (undampedFreq) => {\r\n const a = Math.exp(-undampedFreq * duration);\r\n const b = (undampedFreq - velocity) * duration + 1;\r\n return -safeMin + a * b;\r\n };\r\n derivative = (undampedFreq) => {\r\n const a = Math.exp(-undampedFreq * duration);\r\n const b = (velocity - undampedFreq) * (duration * duration);\r\n return a * b;\r\n };\r\n }\r\n const initialGuess = 5 / duration;\r\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\r\n duration = secondsToMilliseconds(duration);\r\n if (isNaN(undampedFreq)) {\r\n return {\r\n stiffness: 100,\r\n damping: 10,\r\n duration,\r\n };\r\n }\r\n else {\r\n const stiffness = Math.pow(undampedFreq, 2) * mass;\r\n return {\r\n stiffness,\r\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\r\n duration,\r\n };\r\n }\r\n}\r\nconst rootIterations = 12;\r\nfunction approximateRoot(envelope, derivative, initialGuess) {\r\n let result = initialGuess;\r\n for (let i = 1; i < rootIterations; i++) {\r\n result = result - envelope(result) / derivative(result);\r\n }\r\n return result;\r\n}\r\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\r\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\r\n}\r\n\r\nexport { calcAngularFreq, findSpring, maxDamping, maxDuration, minDamping, minDuration };\r\n","import { millisecondsToSeconds } from '../../../utils/time-conversion.mjs';\r\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\r\nimport { findSpring, calcAngularFreq } from './find.mjs';\r\n\r\nconst durationKeys = [\"duration\", \"bounce\"];\r\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\r\nfunction isSpringType(options, keys) {\r\n return keys.some((key) => options[key] !== undefined);\r\n}\r\nfunction getSpringOptions(options) {\r\n let springOptions = {\r\n velocity: 0.0,\r\n stiffness: 100,\r\n damping: 10,\r\n mass: 1.0,\r\n isResolvedFromDuration: false,\r\n ...options,\r\n };\r\n // stiffness/damping/mass overrides duration/bounce\r\n if (!isSpringType(options, physicsKeys) &&\r\n isSpringType(options, durationKeys)) {\r\n const derived = findSpring(options);\r\n springOptions = {\r\n ...springOptions,\r\n ...derived,\r\n mass: 1.0,\r\n };\r\n springOptions.isResolvedFromDuration = true;\r\n }\r\n return springOptions;\r\n}\r\nfunction spring({ keyframes, restDelta, restSpeed, ...options }) {\r\n const origin = keyframes[0];\r\n const target = keyframes[keyframes.length - 1];\r\n /**\r\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\r\n * to reduce GC during animation.\r\n */\r\n const state = { done: false, value: origin };\r\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\r\n ...options,\r\n velocity: -millisecondsToSeconds(options.velocity || 0),\r\n });\r\n const initialVelocity = velocity || 0.0;\r\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\r\n const initialDelta = target - origin;\r\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\r\n /**\r\n * If we're working on a granular scale, use smaller defaults for determining\r\n * when the spring is finished.\r\n *\r\n * These defaults have been selected emprically based on what strikes a good\r\n * ratio between feeling good and finishing as soon as changes are imperceptible.\r\n */\r\n const isGranularScale = Math.abs(initialDelta) < 5;\r\n restSpeed || (restSpeed = isGranularScale ? 0.01 : 2);\r\n restDelta || (restDelta = isGranularScale ? 0.005 : 0.5);\r\n let resolveSpring;\r\n if (dampingRatio < 1) {\r\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\r\n // Underdamped spring\r\n resolveSpring = (t) => {\r\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\r\n return (target -\r\n envelope *\r\n (((initialVelocity +\r\n dampingRatio * undampedAngularFreq * initialDelta) /\r\n angularFreq) *\r\n Math.sin(angularFreq * t) +\r\n initialDelta * Math.cos(angularFreq * t)));\r\n };\r\n }\r\n else if (dampingRatio === 1) {\r\n // Critically damped spring\r\n resolveSpring = (t) => target -\r\n Math.exp(-undampedAngularFreq * t) *\r\n (initialDelta +\r\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\r\n }\r\n else {\r\n // Overdamped spring\r\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\r\n resolveSpring = (t) => {\r\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\r\n // When performing sinh or cosh values can hit Infinity so we cap them here\r\n const freqForT = Math.min(dampedAngularFreq * t, 300);\r\n return (target -\r\n (envelope *\r\n ((initialVelocity +\r\n dampingRatio * undampedAngularFreq * initialDelta) *\r\n Math.sinh(freqForT) +\r\n dampedAngularFreq *\r\n initialDelta *\r\n Math.cosh(freqForT))) /\r\n dampedAngularFreq);\r\n };\r\n }\r\n return {\r\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\r\n next: (t) => {\r\n const current = resolveSpring(t);\r\n if (!isResolvedFromDuration) {\r\n let currentVelocity = initialVelocity;\r\n if (t !== 0) {\r\n /**\r\n * We only need to calculate velocity for under-damped springs\r\n * as over- and critically-damped springs can't overshoot, so\r\n * checking only for displacement is enough.\r\n */\r\n if (dampingRatio < 1) {\r\n currentVelocity = calcGeneratorVelocity(resolveSpring, t, current);\r\n }\r\n else {\r\n currentVelocity = 0;\r\n }\r\n }\r\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\r\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\r\n state.done =\r\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\r\n }\r\n else {\r\n state.done = t >= duration;\r\n }\r\n state.value = state.done ? target : current;\r\n return state;\r\n },\r\n };\r\n}\r\n\r\nexport { spring };\r\n","import { spring } from './spring/index.mjs';\r\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\r\n\r\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\r\n const origin = keyframes[0];\r\n const state = {\r\n done: false,\r\n value: origin,\r\n };\r\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\r\n const nearestBoundary = (v) => {\r\n if (min === undefined)\r\n return max;\r\n if (max === undefined)\r\n return min;\r\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\r\n };\r\n let amplitude = power * velocity;\r\n const ideal = origin + amplitude;\r\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\r\n /**\r\n * If the target has changed we need to re-calculate the amplitude, otherwise\r\n * the animation will start from the wrong position.\r\n */\r\n if (target !== ideal)\r\n amplitude = target - origin;\r\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\r\n const calcLatest = (t) => target + calcDelta(t);\r\n const applyFriction = (t) => {\r\n const delta = calcDelta(t);\r\n const latest = calcLatest(t);\r\n state.done = Math.abs(delta) <= restDelta;\r\n state.value = state.done ? target : latest;\r\n };\r\n /**\r\n * Ideally this would resolve for t in a stateless way, we could\r\n * do that by always precalculating the animation but as we know\r\n * this will be done anyway we can assume that spring will\r\n * be discovered during that.\r\n */\r\n let timeReachedBoundary;\r\n let spring$1;\r\n const checkCatchBoundary = (t) => {\r\n if (!isOutOfBounds(state.value))\r\n return;\r\n timeReachedBoundary = t;\r\n spring$1 = spring({\r\n keyframes: [state.value, nearestBoundary(state.value)],\r\n velocity: calcGeneratorVelocity(calcLatest, t, state.value),\r\n damping: bounceDamping,\r\n stiffness: bounceStiffness,\r\n restDelta,\r\n restSpeed,\r\n });\r\n };\r\n checkCatchBoundary(0);\r\n return {\r\n calculatedDuration: null,\r\n next: (t) => {\r\n /**\r\n * We need to resolve the friction to figure out if we need a\r\n * spring but we don't want to do this twice per frame. So here\r\n * we flag if we updated for this frame and later if we did\r\n * we can skip doing it again.\r\n */\r\n let hasUpdatedFrame = false;\r\n if (!spring$1 && timeReachedBoundary === undefined) {\r\n hasUpdatedFrame = true;\r\n applyFriction(t);\r\n checkCatchBoundary(t);\r\n }\r\n /**\r\n * If we have a spring and the provided t is beyond the moment the friction\r\n * animation crossed the min/max boundary, use the spring.\r\n */\r\n if (timeReachedBoundary !== undefined && t > timeReachedBoundary) {\r\n return spring$1.next(t - timeReachedBoundary);\r\n }\r\n else {\r\n !hasUpdatedFrame && applyFriction(t);\r\n return state;\r\n }\r\n },\r\n };\r\n}\r\n\r\nexport { inertia };\r\n","import { frame, cancelFrame, frameData } from '../../../frameloop/frame.mjs';\r\n\r\nconst frameloopDriver = (update) => {\r\n const passTimestamp = ({ timestamp }) => update(timestamp);\r\n return {\r\n start: () => frame.update(passTimestamp, true),\r\n stop: () => cancelFrame(passTimestamp),\r\n /**\r\n * If we're processing this frame we can use the\r\n * framelocked timestamp to keep things in sync.\r\n */\r\n now: () => frameData.isProcessing ? frameData.timestamp : performance.now(),\r\n };\r\n};\r\n\r\nexport { frameloopDriver };\r\n","/**\r\n * Implement a practical max duration for keyframe generation\r\n * to prevent infinite loops\r\n */\r\nconst maxGeneratorDuration = 20000;\r\nfunction calcGeneratorDuration(generator) {\r\n let duration = 0;\r\n const timeStep = 50;\r\n let state = generator.next(duration);\r\n while (!state.done && duration < maxGeneratorDuration) {\r\n duration += timeStep;\r\n state = generator.next(duration);\r\n }\r\n return duration >= maxGeneratorDuration ? Infinity : duration;\r\n}\r\n\r\nexport { calcGeneratorDuration, maxGeneratorDuration };\r\n","import { keyframes } from '../../generators/keyframes.mjs';\r\nimport { spring } from '../../generators/spring/index.mjs';\r\nimport { inertia } from '../../generators/inertia.mjs';\r\nimport { frameloopDriver } from './driver-frameloop.mjs';\r\nimport { interpolate } from '../../../utils/interpolate.mjs';\r\nimport { clamp } from '../../../utils/clamp.mjs';\r\nimport { millisecondsToSeconds, secondsToMilliseconds } from '../../../utils/time-conversion.mjs';\r\nimport { calcGeneratorDuration } from '../../generators/utils/calc-duration.mjs';\r\nimport { invariant } from '../../../utils/errors.mjs';\r\n\r\nconst types = {\r\n decay: inertia,\r\n inertia,\r\n tween: keyframes,\r\n keyframes: keyframes,\r\n spring,\r\n};\r\n/**\r\n * Animate a single value on the main thread.\r\n *\r\n * This function is written, where functionality overlaps,\r\n * to be largely spec-compliant with WAAPI to allow fungibility\r\n * between the two.\r\n */\r\nfunction animateValue({ autoplay = true, delay = 0, driver = frameloopDriver, keyframes: keyframes$1, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", onPlay, onStop, onComplete, onUpdate, ...options }) {\r\n let speed = 1;\r\n let hasStopped = false;\r\n let resolveFinishedPromise;\r\n let currentFinishedPromise;\r\n /**\r\n * Resolve the current Promise every time we enter the\r\n * finished state. This is WAAPI-compatible behaviour.\r\n */\r\n const updateFinishedPromise = () => {\r\n currentFinishedPromise = new Promise((resolve) => {\r\n resolveFinishedPromise = resolve;\r\n });\r\n };\r\n // Create the first finished promise\r\n updateFinishedPromise();\r\n let animationDriver;\r\n const generatorFactory = types[type] || keyframes;\r\n /**\r\n * If this isn't the keyframes generator and we've been provided\r\n * strings as keyframes, we need to interpolate these.\r\n */\r\n let mapNumbersToKeyframes;\r\n if (generatorFactory !== keyframes &&\r\n typeof keyframes$1[0] !== \"number\") {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);\r\n }\r\n mapNumbersToKeyframes = interpolate([0, 100], keyframes$1, {\r\n clamp: false,\r\n });\r\n keyframes$1 = [0, 100];\r\n }\r\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\r\n let mirroredGenerator;\r\n if (repeatType === \"mirror\") {\r\n mirroredGenerator = generatorFactory({\r\n ...options,\r\n keyframes: [...keyframes$1].reverse(),\r\n velocity: -(options.velocity || 0),\r\n });\r\n }\r\n let playState = \"idle\";\r\n let holdTime = null;\r\n let startTime = null;\r\n let cancelTime = null;\r\n /**\r\n * If duration is undefined and we have repeat options,\r\n * we need to calculate a duration from the generator.\r\n *\r\n * We set it to the generator itself to cache the duration.\r\n * Any timeline resolver will need to have already precalculated\r\n * the duration by this step.\r\n */\r\n if (generator.calculatedDuration === null && repeat) {\r\n generator.calculatedDuration = calcGeneratorDuration(generator);\r\n }\r\n const { calculatedDuration } = generator;\r\n let resolvedDuration = Infinity;\r\n let totalDuration = Infinity;\r\n if (calculatedDuration !== null) {\r\n resolvedDuration = calculatedDuration + repeatDelay;\r\n totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;\r\n }\r\n let currentTime = 0;\r\n const tick = (timestamp) => {\r\n if (startTime === null)\r\n return;\r\n /**\r\n * requestAnimationFrame timestamps can come through as lower than\r\n * the startTime as set by performance.now(). Here we prevent this,\r\n * though in the future it could be possible to make setting startTime\r\n * a pending operation that gets resolved here.\r\n */\r\n if (speed > 0)\r\n startTime = Math.min(startTime, timestamp);\r\n if (speed < 0)\r\n startTime = Math.min(timestamp - totalDuration / speed, startTime);\r\n if (holdTime !== null) {\r\n currentTime = holdTime;\r\n }\r\n else {\r\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\r\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\r\n // example.\r\n currentTime = Math.round(timestamp - startTime) * speed;\r\n }\r\n // Rebase on delay\r\n const timeWithoutDelay = currentTime - delay * (speed >= 0 ? 1 : -1);\r\n const isInDelayPhase = speed >= 0 ? timeWithoutDelay < 0 : timeWithoutDelay > totalDuration;\r\n currentTime = Math.max(timeWithoutDelay, 0);\r\n /**\r\n * If this animation has finished, set the current time\r\n * to the total duration.\r\n */\r\n if (playState === \"finished\" && holdTime === null) {\r\n currentTime = totalDuration;\r\n }\r\n let elapsed = currentTime;\r\n let frameGenerator = generator;\r\n if (repeat) {\r\n /**\r\n * Get the current progress (0-1) of the animation. If t is >\r\n * than duration we'll get values like 2.5 (midway through the\r\n * third iteration)\r\n */\r\n const progress = Math.min(currentTime, totalDuration) / resolvedDuration;\r\n /**\r\n * Get the current iteration (0 indexed). For instance the floor of\r\n * 2.5 is 2.\r\n */\r\n let currentIteration = Math.floor(progress);\r\n /**\r\n * Get the current progress of the iteration by taking the remainder\r\n * so 2.5 is 0.5 through iteration 2\r\n */\r\n let iterationProgress = progress % 1.0;\r\n /**\r\n * If iteration progress is 1 we count that as the end\r\n * of the previous iteration.\r\n */\r\n if (!iterationProgress && progress >= 1) {\r\n iterationProgress = 1;\r\n }\r\n iterationProgress === 1 && currentIteration--;\r\n currentIteration = Math.min(currentIteration, repeat + 1);\r\n /**\r\n * Reverse progress if we're not running in \"normal\" direction\r\n */\r\n const isOddIteration = Boolean(currentIteration % 2);\r\n if (isOddIteration) {\r\n if (repeatType === \"reverse\") {\r\n iterationProgress = 1 - iterationProgress;\r\n if (repeatDelay) {\r\n iterationProgress -= repeatDelay / resolvedDuration;\r\n }\r\n }\r\n else if (repeatType === \"mirror\") {\r\n frameGenerator = mirroredGenerator;\r\n }\r\n }\r\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\r\n }\r\n /**\r\n * If we're in negative time, set state as the initial keyframe.\r\n * This prevents delay: x, duration: 0 animations from finishing\r\n * instantly.\r\n */\r\n const state = isInDelayPhase\r\n ? { done: false, value: keyframes$1[0] }\r\n : frameGenerator.next(elapsed);\r\n if (mapNumbersToKeyframes) {\r\n state.value = mapNumbersToKeyframes(state.value);\r\n }\r\n let { done } = state;\r\n if (!isInDelayPhase && calculatedDuration !== null) {\r\n done = speed >= 0 ? currentTime >= totalDuration : currentTime <= 0;\r\n }\r\n const isAnimationFinished = holdTime === null &&\r\n (playState === \"finished\" || (playState === \"running\" && done));\r\n if (onUpdate) {\r\n onUpdate(state.value);\r\n }\r\n if (isAnimationFinished) {\r\n finish();\r\n }\r\n return state;\r\n };\r\n const stopAnimationDriver = () => {\r\n animationDriver && animationDriver.stop();\r\n animationDriver = undefined;\r\n };\r\n const cancel = () => {\r\n playState = \"idle\";\r\n stopAnimationDriver();\r\n resolveFinishedPromise();\r\n updateFinishedPromise();\r\n startTime = cancelTime = null;\r\n };\r\n const finish = () => {\r\n playState = \"finished\";\r\n onComplete && onComplete();\r\n stopAnimationDriver();\r\n resolveFinishedPromise();\r\n };\r\n const play = () => {\r\n if (hasStopped)\r\n return;\r\n if (!animationDriver)\r\n animationDriver = driver(tick);\r\n const now = animationDriver.now();\r\n onPlay && onPlay();\r\n if (holdTime !== null) {\r\n startTime = now - holdTime;\r\n }\r\n else if (!startTime || playState === \"finished\") {\r\n startTime = now;\r\n }\r\n if (playState === \"finished\") {\r\n updateFinishedPromise();\r\n }\r\n cancelTime = startTime;\r\n holdTime = null;\r\n /**\r\n * Set playState to running only after we've used it in\r\n * the previous logic.\r\n */\r\n playState = \"running\";\r\n animationDriver.start();\r\n };\r\n if (autoplay) {\r\n play();\r\n }\r\n const controls = {\r\n then(resolve, reject) {\r\n return currentFinishedPromise.then(resolve, reject);\r\n },\r\n get time() {\r\n return millisecondsToSeconds(currentTime);\r\n },\r\n set time(newTime) {\r\n newTime = secondsToMilliseconds(newTime);\r\n currentTime = newTime;\r\n if (holdTime !== null || !animationDriver || speed === 0) {\r\n holdTime = newTime;\r\n }\r\n else {\r\n startTime = animationDriver.now() - newTime / speed;\r\n }\r\n },\r\n get duration() {\r\n const duration = generator.calculatedDuration === null\r\n ? calcGeneratorDuration(generator)\r\n : generator.calculatedDuration;\r\n return millisecondsToSeconds(duration);\r\n },\r\n get speed() {\r\n return speed;\r\n },\r\n set speed(newSpeed) {\r\n if (newSpeed === speed || !animationDriver)\r\n return;\r\n speed = newSpeed;\r\n controls.time = millisecondsToSeconds(currentTime);\r\n },\r\n get state() {\r\n return playState;\r\n },\r\n play,\r\n pause: () => {\r\n playState = \"paused\";\r\n holdTime = currentTime;\r\n },\r\n stop: () => {\r\n hasStopped = true;\r\n if (playState === \"idle\")\r\n return;\r\n playState = \"idle\";\r\n onStop && onStop();\r\n cancel();\r\n },\r\n cancel: () => {\r\n if (cancelTime !== null)\r\n tick(cancelTime);\r\n cancel();\r\n },\r\n complete: () => {\r\n playState = \"finished\";\r\n },\r\n sample: (elapsed) => {\r\n startTime = 0;\r\n return tick(elapsed);\r\n },\r\n };\r\n return controls;\r\n}\r\n\r\nexport { animateValue };\r\n","function memo(callback) {\r\n let result;\r\n return () => {\r\n if (result === undefined)\r\n result = callback();\r\n return result;\r\n };\r\n}\r\n\r\nexport { memo };\r\n","import { animateStyle } from './index.mjs';\r\nimport { isWaapiSupportedEasing } from './easing.mjs';\r\nimport { getFinalKeyframe } from './utils/get-final-keyframe.mjs';\r\nimport { animateValue } from '../js/index.mjs';\r\nimport { millisecondsToSeconds, secondsToMilliseconds } from '../../../utils/time-conversion.mjs';\r\nimport { memo } from '../../../utils/memo.mjs';\r\nimport { noop } from '../../../utils/noop.mjs';\r\nimport { frame, cancelFrame } from '../../../frameloop/frame.mjs';\r\n\r\nconst supportsWaapi = memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\r\n/**\r\n * A list of values that can be hardware-accelerated.\r\n */\r\nconst acceleratedValues = new Set([\r\n \"opacity\",\r\n \"clipPath\",\r\n \"filter\",\r\n \"transform\",\r\n \"backgroundColor\",\r\n]);\r\n/**\r\n * 10ms is chosen here as it strikes a balance between smooth\r\n * results (more than one keyframe per frame at 60fps) and\r\n * keyframe quantity.\r\n */\r\nconst sampleDelta = 10; //ms\r\n/**\r\n * Implement a practical max duration for keyframe generation\r\n * to prevent infinite loops\r\n */\r\nconst maxDuration = 20000;\r\nconst requiresPregeneratedKeyframes = (valueName, options) => options.type === \"spring\" ||\r\n valueName === \"backgroundColor\" ||\r\n !isWaapiSupportedEasing(options.ease);\r\nfunction createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {\r\n const canAccelerateAnimation = supportsWaapi() &&\r\n acceleratedValues.has(valueName) &&\r\n !options.repeatDelay &&\r\n options.repeatType !== \"mirror\" &&\r\n options.damping !== 0 &&\r\n options.type !== \"inertia\";\r\n if (!canAccelerateAnimation)\r\n return false;\r\n /**\r\n * TODO: Unify with js/index\r\n */\r\n let hasStopped = false;\r\n let resolveFinishedPromise;\r\n let currentFinishedPromise;\r\n /**\r\n * Cancelling an animation will write to the DOM. For safety we want to defer\r\n * this until the next `update` frame lifecycle. This flag tracks whether we\r\n * have a pending cancel, if so we shouldn't allow animations to finish.\r\n */\r\n let pendingCancel = false;\r\n /**\r\n * Resolve the current Promise every time we enter the\r\n * finished state. This is WAAPI-compatible behaviour.\r\n */\r\n const updateFinishedPromise = () => {\r\n currentFinishedPromise = new Promise((resolve) => {\r\n resolveFinishedPromise = resolve;\r\n });\r\n };\r\n // Create the first finished promise\r\n updateFinishedPromise();\r\n let { keyframes, duration = 300, ease, times } = options;\r\n /**\r\n * If this animation needs pre-generated keyframes then generate.\r\n */\r\n if (requiresPregeneratedKeyframes(valueName, options)) {\r\n const sampleAnimation = animateValue({\r\n ...options,\r\n repeat: 0,\r\n delay: 0,\r\n });\r\n let state = { done: false, value: keyframes[0] };\r\n const pregeneratedKeyframes = [];\r\n /**\r\n * Bail after 20 seconds of pre-generated keyframes as it's likely\r\n * we're heading for an infinite loop.\r\n */\r\n let t = 0;\r\n while (!state.done && t < maxDuration) {\r\n state = sampleAnimation.sample(t);\r\n pregeneratedKeyframes.push(state.value);\r\n t += sampleDelta;\r\n }\r\n times = undefined;\r\n keyframes = pregeneratedKeyframes;\r\n duration = t - sampleDelta;\r\n ease = \"linear\";\r\n }\r\n const animation = animateStyle(value.owner.current, valueName, keyframes, {\r\n ...options,\r\n duration,\r\n /**\r\n * This function is currently not called if ease is provided\r\n * as a function so the cast is safe.\r\n *\r\n * However it would be possible for a future refinement to port\r\n * in easing pregeneration from Motion One for browsers that\r\n * support the upcoming `linear()` easing function.\r\n */\r\n ease: ease,\r\n times,\r\n });\r\n const cancelAnimation = () => {\r\n pendingCancel = false;\r\n animation.cancel();\r\n };\r\n const safeCancel = () => {\r\n pendingCancel = true;\r\n frame.update(cancelAnimation);\r\n resolveFinishedPromise();\r\n updateFinishedPromise();\r\n };\r\n /**\r\n * Prefer the `onfinish` prop as it's more widely supported than\r\n * the `finished` promise.\r\n *\r\n * Here, we synchronously set the provided MotionValue to the end\r\n * keyframe. If we didn't, when the WAAPI animation is finished it would\r\n * be removed from the element which would then revert to its old styles.\r\n */\r\n animation.onfinish = () => {\r\n if (pendingCancel)\r\n return;\r\n value.set(getFinalKeyframe(keyframes, options));\r\n onComplete && onComplete();\r\n safeCancel();\r\n };\r\n /**\r\n * Animation interrupt callback.\r\n */\r\n const controls = {\r\n then(resolve, reject) {\r\n return currentFinishedPromise.then(resolve, reject);\r\n },\r\n attachTimeline(timeline) {\r\n animation.timeline = timeline;\r\n animation.onfinish = null;\r\n return noop;\r\n },\r\n get time() {\r\n return millisecondsToSeconds(animation.currentTime || 0);\r\n },\r\n set time(newTime) {\r\n animation.currentTime = secondsToMilliseconds(newTime);\r\n },\r\n get speed() {\r\n return animation.playbackRate;\r\n },\r\n set speed(newSpeed) {\r\n animation.playbackRate = newSpeed;\r\n },\r\n get duration() {\r\n return millisecondsToSeconds(duration);\r\n },\r\n play: () => {\r\n if (hasStopped)\r\n return;\r\n animation.play();\r\n /**\r\n * Cancel any pending cancel tasks\r\n */\r\n cancelFrame(cancelAnimation);\r\n },\r\n pause: () => animation.pause(),\r\n stop: () => {\r\n hasStopped = true;\r\n if (animation.playState === \"idle\")\r\n return;\r\n /**\r\n * WAAPI doesn't natively have any interruption capabilities.\r\n *\r\n * Rather than read commited styles back out of the DOM, we can\r\n * create a renderless JS animation and sample it twice to calculate\r\n * its current value, \"previous\" value, and therefore allow\r\n * Motion to calculate velocity for any subsequent animation.\r\n */\r\n const { currentTime } = animation;\r\n if (currentTime) {\r\n const sampleAnimation = animateValue({\r\n ...options,\r\n autoplay: false,\r\n });\r\n value.setWithVelocity(sampleAnimation.sample(currentTime - sampleDelta).value, sampleAnimation.sample(currentTime).value, sampleDelta);\r\n }\r\n safeCancel();\r\n },\r\n complete: () => {\r\n if (pendingCancel)\r\n return;\r\n animation.finish();\r\n },\r\n cancel: safeCancel,\r\n };\r\n return controls;\r\n}\r\n\r\nexport { createAcceleratedAnimation };\r\n","import { animateValue } from './js/index.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\n\r\nfunction createInstantAnimation({ keyframes, delay, onUpdate, onComplete, }) {\r\n const setValue = () => {\r\n onUpdate && onUpdate(keyframes[keyframes.length - 1]);\r\n onComplete && onComplete();\r\n /**\r\n * TODO: As this API grows it could make sense to always return\r\n * animateValue. This will be a bigger project as animateValue\r\n * is frame-locked whereas this function resolves instantly.\r\n * This is a behavioural change and also has ramifications regarding\r\n * assumptions within tests.\r\n */\r\n return {\r\n time: 0,\r\n speed: 1,\r\n duration: 0,\r\n play: (noop),\r\n pause: (noop),\r\n stop: (noop),\r\n then: (resolve) => {\r\n resolve();\r\n return Promise.resolve();\r\n },\r\n cancel: (noop),\r\n complete: (noop),\r\n };\r\n };\r\n return delay\r\n ? animateValue({\r\n keyframes: [0, 1],\r\n duration: 0,\r\n delay,\r\n onComplete: setValue,\r\n })\r\n : setValue();\r\n}\r\n\r\nexport { createInstantAnimation };\r\n","import { transformProps } from '../../render/html/utils/transform.mjs';\r\n\r\nconst underDampedSpring = {\r\n type: \"spring\",\r\n stiffness: 500,\r\n damping: 25,\r\n restSpeed: 10,\r\n};\r\nconst criticallyDampedSpring = (target) => ({\r\n type: \"spring\",\r\n stiffness: 550,\r\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\r\n restSpeed: 10,\r\n});\r\nconst keyframesTransition = {\r\n type: \"keyframes\",\r\n duration: 0.8,\r\n};\r\n/**\r\n * Default easing curve is a slightly shallower version of\r\n * the default browser easing curve.\r\n */\r\nconst ease = {\r\n type: \"keyframes\",\r\n ease: [0.25, 0.1, 0.35, 1],\r\n duration: 0.3,\r\n};\r\nconst getDefaultTransition = (valueKey, { keyframes }) => {\r\n if (keyframes.length > 2) {\r\n return keyframesTransition;\r\n }\r\n else if (transformProps.has(valueKey)) {\r\n return valueKey.startsWith(\"scale\")\r\n ? criticallyDampedSpring(keyframes[1])\r\n : underDampedSpring;\r\n }\r\n return ease;\r\n};\r\n\r\nexport { getDefaultTransition };\r\n","import { complex } from '../../value/types/complex/index.mjs';\r\n\r\n/**\r\n * Check if a value is animatable. Examples:\r\n *\r\n * ✅: 100, \"100px\", \"#fff\"\r\n * ❌: \"block\", \"url(2.jpg)\"\r\n * @param value\r\n *\r\n * @internal\r\n */\r\nconst isAnimatable = (key, value) => {\r\n // If the list of keys tat might be non-animatable grows, replace with Set\r\n if (key === \"zIndex\")\r\n return false;\r\n // If it's a number or a keyframes array, we can animate it. We might at some point\r\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\r\n // but for now lets leave it like this for performance reasons\r\n if (typeof value === \"number\" || Array.isArray(value))\r\n return true;\r\n if (typeof value === \"string\" && // It's animatable if we have a string\r\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\r\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\nexport { isAnimatable };\r\n","import { complex } from './index.mjs';\r\nimport { floatRegex } from '../utils.mjs';\r\n\r\n/**\r\n * Properties that should default to 1 or 100%\r\n */\r\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\r\nfunction applyDefaultFilter(v) {\r\n const [name, value] = v.slice(0, -1).split(\"(\");\r\n if (name === \"drop-shadow\")\r\n return v;\r\n const [number] = value.match(floatRegex) || [];\r\n if (!number)\r\n return v;\r\n const unit = value.replace(number, \"\");\r\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\r\n if (number !== value)\r\n defaultValue *= 100;\r\n return name + \"(\" + defaultValue + unit + \")\";\r\n}\r\nconst functionRegex = /([a-z-]*)\\(.*?\\)/g;\r\nconst filter = {\r\n ...complex,\r\n getAnimatableNone: (v) => {\r\n const functions = v.match(functionRegex);\r\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\r\n },\r\n};\r\n\r\nexport { filter };\r\n","import { color } from '../../../value/types/color/index.mjs';\r\nimport { filter } from '../../../value/types/complex/filter.mjs';\r\nimport { numberValueTypes } from './number.mjs';\r\n\r\n/**\r\n * A map of default value types for common values\r\n */\r\nconst defaultValueTypes = {\r\n ...numberValueTypes,\r\n // Color props\r\n color,\r\n backgroundColor: color,\r\n outlineColor: color,\r\n fill: color,\r\n stroke: color,\r\n // Border props\r\n borderColor: color,\r\n borderTopColor: color,\r\n borderRightColor: color,\r\n borderBottomColor: color,\r\n borderLeftColor: color,\r\n filter,\r\n WebkitFilter: filter,\r\n};\r\n/**\r\n * Gets the default ValueType for the provided value key\r\n */\r\nconst getDefaultValueType = (key) => defaultValueTypes[key];\r\n\r\nexport { defaultValueTypes, getDefaultValueType };\r\n","import { complex } from '../../../value/types/complex/index.mjs';\r\nimport { filter } from '../../../value/types/complex/filter.mjs';\r\nimport { getDefaultValueType } from './defaults.mjs';\r\n\r\nfunction getAnimatableNone(key, value) {\r\n let defaultValueType = getDefaultValueType(key);\r\n if (defaultValueType !== filter)\r\n defaultValueType = complex;\r\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\r\n return defaultValueType.getAnimatableNone\r\n ? defaultValueType.getAnimatableNone(value)\r\n : undefined;\r\n}\r\n\r\nexport { getAnimatableNone };\r\n","/**\r\n * Check if the value is a zero value string like \"0px\" or \"0%\"\r\n */\r\nconst isZeroValueString = (v) => /^0[^.\\s]+$/.test(v);\r\n\r\nexport { isZeroValueString };\r\n","import { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\r\n\r\nfunction isNone(value) {\r\n if (typeof value === \"number\") {\r\n return value === 0;\r\n }\r\n else if (value !== null) {\r\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\r\n }\r\n}\r\n\r\nexport { isNone };\r\n","import { getAnimatableNone } from '../../render/dom/value-types/animatable-none.mjs';\r\nimport { isAnimatable } from './is-animatable.mjs';\r\nimport { isNone } from './is-none.mjs';\r\n\r\nfunction getKeyframes(value, valueName, target, transition) {\r\n const isTargetAnimatable = isAnimatable(valueName, target);\r\n let keyframes;\r\n if (Array.isArray(target)) {\r\n keyframes = [...target];\r\n }\r\n else {\r\n keyframes = [null, target];\r\n }\r\n const defaultOrigin = transition.from !== undefined ? transition.from : value.get();\r\n let animatableTemplateValue = undefined;\r\n const noneKeyframeIndexes = [];\r\n for (let i = 0; i < keyframes.length; i++) {\r\n /**\r\n * Fill null/wildcard keyframes\r\n */\r\n if (keyframes[i] === null) {\r\n keyframes[i] = i === 0 ? defaultOrigin : keyframes[i - 1];\r\n }\r\n if (isNone(keyframes[i])) {\r\n noneKeyframeIndexes.push(i);\r\n }\r\n // TODO: Clean this conditional, it works for now\r\n if (typeof keyframes[i] === \"string\" &&\r\n keyframes[i] !== \"none\" &&\r\n keyframes[i] !== \"0\") {\r\n animatableTemplateValue = keyframes[i];\r\n }\r\n }\r\n if (isTargetAnimatable &&\r\n noneKeyframeIndexes.length &&\r\n animatableTemplateValue) {\r\n for (let i = 0; i < noneKeyframeIndexes.length; i++) {\r\n const index = noneKeyframeIndexes[i];\r\n keyframes[index] = getAnimatableNone(valueName, animatableTemplateValue);\r\n }\r\n }\r\n return keyframes;\r\n}\r\n\r\nexport { getKeyframes };\r\n","/**\r\n * Decide whether a transition is defined on a given Transition.\r\n * This filters out orchestration options and returns true\r\n * if any options are left.\r\n */\r\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\r\n return !!Object.keys(transition).length;\r\n}\r\nfunction getValueTransition(transition, key) {\r\n return transition[key] || transition[\"default\"] || transition;\r\n}\r\n\r\nexport { getValueTransition, isTransitionDefined };\r\n","const MotionGlobalConfig = {\r\n skipAnimations: false,\r\n};\r\n\r\nexport { MotionGlobalConfig };\r\n","import { warning } from '../../utils/errors.mjs';\r\nimport { secondsToMilliseconds } from '../../utils/time-conversion.mjs';\r\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\r\nimport { createAcceleratedAnimation } from '../animators/waapi/create-accelerated-animation.mjs';\r\nimport { createInstantAnimation } from '../animators/instant.mjs';\r\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\r\nimport { isAnimatable } from '../utils/is-animatable.mjs';\r\nimport { getKeyframes } from '../utils/keyframes.mjs';\r\nimport { getValueTransition, isTransitionDefined } from '../utils/transitions.mjs';\r\nimport { animateValue } from '../animators/js/index.mjs';\r\nimport { MotionGlobalConfig } from '../../utils/GlobalConfig.mjs';\r\n\r\nconst animateMotionValue = (valueName, value, target, transition = {}) => {\r\n return (onComplete) => {\r\n const valueTransition = getValueTransition(transition, valueName) || {};\r\n /**\r\n * Most transition values are currently completely overwritten by value-specific\r\n * transitions. In the future it'd be nicer to blend these transitions. But for now\r\n * delay actually does inherit from the root transition if not value-specific.\r\n */\r\n const delay = valueTransition.delay || transition.delay || 0;\r\n /**\r\n * Elapsed isn't a public transition option but can be passed through from\r\n * optimized appear effects in milliseconds.\r\n */\r\n let { elapsed = 0 } = transition;\r\n elapsed = elapsed - secondsToMilliseconds(delay);\r\n const keyframes = getKeyframes(value, valueName, target, valueTransition);\r\n /**\r\n * Check if we're able to animate between the start and end keyframes,\r\n * and throw a warning if we're attempting to animate between one that's\r\n * animatable and another that isn't.\r\n */\r\n const originKeyframe = keyframes[0];\r\n const targetKeyframe = keyframes[keyframes.length - 1];\r\n const isOriginAnimatable = isAnimatable(valueName, originKeyframe);\r\n const isTargetAnimatable = isAnimatable(valueName, targetKeyframe);\r\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${valueName} from \"${originKeyframe}\" to \"${targetKeyframe}\". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \\`style\\` property.`);\r\n let options = {\r\n keyframes,\r\n velocity: value.getVelocity(),\r\n ease: \"easeOut\",\r\n ...valueTransition,\r\n delay: -elapsed,\r\n onUpdate: (v) => {\r\n value.set(v);\r\n valueTransition.onUpdate && valueTransition.onUpdate(v);\r\n },\r\n onComplete: () => {\r\n onComplete();\r\n valueTransition.onComplete && valueTransition.onComplete();\r\n },\r\n };\r\n /**\r\n * If there's no transition defined for this value, we can generate\r\n * unqiue transition settings for this value.\r\n */\r\n if (!isTransitionDefined(valueTransition)) {\r\n options = {\r\n ...options,\r\n ...getDefaultTransition(valueName, options),\r\n };\r\n }\r\n /**\r\n * Both WAAPI and our internal animation functions use durations\r\n * as defined by milliseconds, while our external API defines them\r\n * as seconds.\r\n */\r\n if (options.duration) {\r\n options.duration = secondsToMilliseconds(options.duration);\r\n }\r\n if (options.repeatDelay) {\r\n options.repeatDelay = secondsToMilliseconds(options.repeatDelay);\r\n }\r\n if (!isOriginAnimatable ||\r\n !isTargetAnimatable ||\r\n instantAnimationState.current ||\r\n valueTransition.type === false ||\r\n MotionGlobalConfig.skipAnimations) {\r\n /**\r\n * If we can't animate this value, or the global instant animation flag is set,\r\n * or this is simply defined as an instant transition, return an instant transition.\r\n */\r\n return createInstantAnimation(instantAnimationState.current\r\n ? { ...options, delay: 0 }\r\n : options);\r\n }\r\n /**\r\n * Animate via WAAPI if possible.\r\n */\r\n if (\r\n /**\r\n * If this is a handoff animation, the optimised animation will be running via\r\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\r\n * optimised animation.\r\n */\r\n !transition.isHandoff &&\r\n value.owner &&\r\n value.owner.current instanceof HTMLElement &&\r\n /**\r\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\r\n * no way to read the value from WAAPI every frame.\r\n */\r\n !value.owner.getProps().onUpdate) {\r\n const acceleratedAnimation = createAcceleratedAnimation(value, valueName, options);\r\n if (acceleratedAnimation)\r\n return acceleratedAnimation;\r\n }\r\n /**\r\n * If we didn't create an accelerated animation, create a JS animation\r\n */\r\n return animateValue(options);\r\n };\r\n};\r\n\r\nexport { animateMotionValue };\r\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\r\n\r\nfunction isWillChangeMotionValue(value) {\r\n return Boolean(isMotionValue(value) && value.add);\r\n}\r\n\r\nexport { isWillChangeMotionValue };\r\n","/**\r\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\r\n */\r\nconst isNumericalString = (v) => /^\\-?\\d*\\.?\\d+$/.test(v);\r\n\r\nexport { isNumericalString };\r\n","function addUniqueItem(arr, item) {\r\n if (arr.indexOf(item) === -1)\r\n arr.push(item);\r\n}\r\nfunction removeItem(arr, item) {\r\n const index = arr.indexOf(item);\r\n if (index > -1)\r\n arr.splice(index, 1);\r\n}\r\n// Adapted from array-move\r\nfunction moveItem([...arr], fromIndex, toIndex) {\r\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\r\n if (startIndex >= 0 && startIndex < arr.length) {\r\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\r\n const [item] = arr.splice(fromIndex, 1);\r\n arr.splice(endIndex, 0, item);\r\n }\r\n return arr;\r\n}\r\n\r\nexport { addUniqueItem, moveItem, removeItem };\r\n","import { addUniqueItem, removeItem } from './array.mjs';\r\n\r\nclass SubscriptionManager {\r\n constructor() {\r\n this.subscriptions = [];\r\n }\r\n add(handler) {\r\n addUniqueItem(this.subscriptions, handler);\r\n return () => removeItem(this.subscriptions, handler);\r\n }\r\n notify(a, b, c) {\r\n const numSubscriptions = this.subscriptions.length;\r\n if (!numSubscriptions)\r\n return;\r\n if (numSubscriptions === 1) {\r\n /**\r\n * If there's only a single handler we can just call it without invoking a loop.\r\n */\r\n this.subscriptions[0](a, b, c);\r\n }\r\n else {\r\n for (let i = 0; i < numSubscriptions; i++) {\r\n /**\r\n * Check whether the handler exists before firing as it's possible\r\n * the subscriptions were modified during this loop running.\r\n */\r\n const handler = this.subscriptions[i];\r\n handler && handler(a, b, c);\r\n }\r\n }\r\n }\r\n getSize() {\r\n return this.subscriptions.length;\r\n }\r\n clear() {\r\n this.subscriptions.length = 0;\r\n }\r\n}\r\n\r\nexport { SubscriptionManager };\r\n","const warned = new Set();\r\nfunction warnOnce(condition, message, element) {\r\n if (condition || warned.has(message))\r\n return;\r\n console.warn(message);\r\n if (element)\r\n console.warn(element);\r\n warned.add(message);\r\n}\r\n\r\nexport { warnOnce };\r\n","import { SubscriptionManager } from '../utils/subscription-manager.mjs';\r\nimport { velocityPerSecond } from '../utils/velocity-per-second.mjs';\r\nimport { warnOnce } from '../utils/warn-once.mjs';\r\nimport { frame, frameData } from '../frameloop/frame.mjs';\r\n\r\nconst isFloat = (value) => {\r\n return !isNaN(parseFloat(value));\r\n};\r\nconst collectMotionValues = {\r\n current: undefined,\r\n};\r\n/**\r\n * `MotionValue` is used to track the state and velocity of motion values.\r\n *\r\n * @public\r\n */\r\nclass MotionValue {\r\n /**\r\n * @param init - The initiating value\r\n * @param config - Optional configuration options\r\n *\r\n * - `transformer`: A function to transform incoming values with.\r\n *\r\n * @internal\r\n */\r\n constructor(init, options = {}) {\r\n /**\r\n * This will be replaced by the build step with the latest version number.\r\n * When MotionValues are provided to motion components, warn if versions are mixed.\r\n */\r\n this.version = \"10.18.0\";\r\n /**\r\n * Duration, in milliseconds, since last updating frame.\r\n *\r\n * @internal\r\n */\r\n this.timeDelta = 0;\r\n /**\r\n * Timestamp of the last time this `MotionValue` was updated.\r\n *\r\n * @internal\r\n */\r\n this.lastUpdated = 0;\r\n /**\r\n * Tracks whether this value can output a velocity. Currently this is only true\r\n * if the value is numerical, but we might be able to widen the scope here and support\r\n * other value types.\r\n *\r\n * @internal\r\n */\r\n this.canTrackVelocity = false;\r\n /**\r\n * An object containing a SubscriptionManager for each active event.\r\n */\r\n this.events = {};\r\n this.updateAndNotify = (v, render = true) => {\r\n this.prev = this.current;\r\n this.current = v;\r\n // Update timestamp\r\n const { delta, timestamp } = frameData;\r\n if (this.lastUpdated !== timestamp) {\r\n this.timeDelta = delta;\r\n this.lastUpdated = timestamp;\r\n frame.postRender(this.scheduleVelocityCheck);\r\n }\r\n // Update update subscribers\r\n if (this.prev !== this.current && this.events.change) {\r\n this.events.change.notify(this.current);\r\n }\r\n // Update velocity subscribers\r\n if (this.events.velocityChange) {\r\n this.events.velocityChange.notify(this.getVelocity());\r\n }\r\n // Update render subscribers\r\n if (render && this.events.renderRequest) {\r\n this.events.renderRequest.notify(this.current);\r\n }\r\n };\r\n /**\r\n * Schedule a velocity check for the next frame.\r\n *\r\n * This is an instanced and bound function to prevent generating a new\r\n * function once per frame.\r\n *\r\n * @internal\r\n */\r\n this.scheduleVelocityCheck = () => frame.postRender(this.velocityCheck);\r\n /**\r\n * Updates `prev` with `current` if the value hasn't been updated this frame.\r\n * This ensures velocity calculations return `0`.\r\n *\r\n * This is an instanced and bound function to prevent generating a new\r\n * function once per frame.\r\n *\r\n * @internal\r\n */\r\n this.velocityCheck = ({ timestamp }) => {\r\n if (timestamp !== this.lastUpdated) {\r\n this.prev = this.current;\r\n if (this.events.velocityChange) {\r\n this.events.velocityChange.notify(this.getVelocity());\r\n }\r\n }\r\n };\r\n this.hasAnimated = false;\r\n this.prev = this.current = init;\r\n this.canTrackVelocity = isFloat(this.current);\r\n this.owner = options.owner;\r\n }\r\n /**\r\n * Adds a function that will be notified when the `MotionValue` is updated.\r\n *\r\n * It returns a function that, when called, will cancel the subscription.\r\n *\r\n * When calling `onChange` inside a React component, it should be wrapped with the\r\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\r\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\r\n *\r\n * ```jsx\r\n * export const MyComponent = () => {\r\n * const x = useMotionValue(0)\r\n * const y = useMotionValue(0)\r\n * const opacity = useMotionValue(1)\r\n *\r\n * useEffect(() => {\r\n * function updateOpacity() {\r\n * const maxXY = Math.max(x.get(), y.get())\r\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\r\n * opacity.set(newOpacity)\r\n * }\r\n *\r\n * const unsubscribeX = x.on(\"change\", updateOpacity)\r\n * const unsubscribeY = y.on(\"change\", updateOpacity)\r\n *\r\n * return () => {\r\n * unsubscribeX()\r\n * unsubscribeY()\r\n * }\r\n * }, [])\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @param subscriber - A function that receives the latest value.\r\n * @returns A function that, when called, will cancel this subscription.\r\n *\r\n * @deprecated\r\n */\r\n onChange(subscription) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\r\n }\r\n return this.on(\"change\", subscription);\r\n }\r\n on(eventName, callback) {\r\n if (!this.events[eventName]) {\r\n this.events[eventName] = new SubscriptionManager();\r\n }\r\n const unsubscribe = this.events[eventName].add(callback);\r\n if (eventName === \"change\") {\r\n return () => {\r\n unsubscribe();\r\n /**\r\n * If we have no more change listeners by the start\r\n * of the next frame, stop active animations.\r\n */\r\n frame.read(() => {\r\n if (!this.events.change.getSize()) {\r\n this.stop();\r\n }\r\n });\r\n };\r\n }\r\n return unsubscribe;\r\n }\r\n clearListeners() {\r\n for (const eventManagers in this.events) {\r\n this.events[eventManagers].clear();\r\n }\r\n }\r\n /**\r\n * Attaches a passive effect to the `MotionValue`.\r\n *\r\n * @internal\r\n */\r\n attach(passiveEffect, stopPassiveEffect) {\r\n this.passiveEffect = passiveEffect;\r\n this.stopPassiveEffect = stopPassiveEffect;\r\n }\r\n /**\r\n * Sets the state of the `MotionValue`.\r\n *\r\n * @remarks\r\n *\r\n * ```jsx\r\n * const x = useMotionValue(0)\r\n * x.set(10)\r\n * ```\r\n *\r\n * @param latest - Latest value to set.\r\n * @param render - Whether to notify render subscribers. Defaults to `true`\r\n *\r\n * @public\r\n */\r\n set(v, render = true) {\r\n if (!render || !this.passiveEffect) {\r\n this.updateAndNotify(v, render);\r\n }\r\n else {\r\n this.passiveEffect(v, this.updateAndNotify);\r\n }\r\n }\r\n setWithVelocity(prev, current, delta) {\r\n this.set(current);\r\n this.prev = prev;\r\n this.timeDelta = delta;\r\n }\r\n /**\r\n * Set the state of the `MotionValue`, stopping any active animations,\r\n * effects, and resets velocity to `0`.\r\n */\r\n jump(v) {\r\n this.updateAndNotify(v);\r\n this.prev = v;\r\n this.stop();\r\n if (this.stopPassiveEffect)\r\n this.stopPassiveEffect();\r\n }\r\n /**\r\n * Returns the latest state of `MotionValue`\r\n *\r\n * @returns - The latest state of `MotionValue`\r\n *\r\n * @public\r\n */\r\n get() {\r\n if (collectMotionValues.current) {\r\n collectMotionValues.current.push(this);\r\n }\r\n return this.current;\r\n }\r\n /**\r\n * @public\r\n */\r\n getPrevious() {\r\n return this.prev;\r\n }\r\n /**\r\n * Returns the latest velocity of `MotionValue`\r\n *\r\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\r\n *\r\n * @public\r\n */\r\n getVelocity() {\r\n // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful\r\n return this.canTrackVelocity\r\n ? // These casts could be avoided if parseFloat would be typed better\r\n velocityPerSecond(parseFloat(this.current) -\r\n parseFloat(this.prev), this.timeDelta)\r\n : 0;\r\n }\r\n /**\r\n * Registers a new animation to control this `MotionValue`. Only one\r\n * animation can drive a `MotionValue` at one time.\r\n *\r\n * ```jsx\r\n * value.start()\r\n * ```\r\n *\r\n * @param animation - A function that starts the provided animation\r\n *\r\n * @internal\r\n */\r\n start(startAnimation) {\r\n this.stop();\r\n return new Promise((resolve) => {\r\n this.hasAnimated = true;\r\n this.animation = startAnimation(resolve);\r\n if (this.events.animationStart) {\r\n this.events.animationStart.notify();\r\n }\r\n }).then(() => {\r\n if (this.events.animationComplete) {\r\n this.events.animationComplete.notify();\r\n }\r\n this.clearAnimation();\r\n });\r\n }\r\n /**\r\n * Stop the currently active animation.\r\n *\r\n * @public\r\n */\r\n stop() {\r\n if (this.animation) {\r\n this.animation.stop();\r\n if (this.events.animationCancel) {\r\n this.events.animationCancel.notify();\r\n }\r\n }\r\n this.clearAnimation();\r\n }\r\n /**\r\n * Returns `true` if this value is currently animating.\r\n *\r\n * @public\r\n */\r\n isAnimating() {\r\n return !!this.animation;\r\n }\r\n clearAnimation() {\r\n delete this.animation;\r\n }\r\n /**\r\n * Destroy and clean up subscribers to this `MotionValue`.\r\n *\r\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\r\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\r\n * created a `MotionValue` via the `motionValue` function.\r\n *\r\n * @public\r\n */\r\n destroy() {\r\n this.clearListeners();\r\n this.stop();\r\n if (this.stopPassiveEffect) {\r\n this.stopPassiveEffect();\r\n }\r\n }\r\n}\r\nfunction motionValue(init, options) {\r\n return new MotionValue(init, options);\r\n}\r\n\r\nexport { MotionValue, collectMotionValues, motionValue };\r\n","/**\r\n * Tests a provided value against a ValueType\r\n */\r\nconst testValueType = (v) => (type) => type.test(v);\r\n\r\nexport { testValueType };\r\n","/**\r\n * ValueType for \"auto\"\r\n */\r\nconst auto = {\r\n test: (v) => v === \"auto\",\r\n parse: (v) => v,\r\n};\r\n\r\nexport { auto };\r\n","import { number } from '../../../value/types/numbers/index.mjs';\r\nimport { px, percent, degrees, vw, vh } from '../../../value/types/numbers/units.mjs';\r\nimport { testValueType } from './test.mjs';\r\nimport { auto } from './type-auto.mjs';\r\n\r\n/**\r\n * A list of value types commonly used for dimensions\r\n */\r\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\r\n/**\r\n * Tests a dimensional value against the list of dimension ValueTypes\r\n */\r\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\r\n\r\nexport { dimensionValueTypes, findDimensionValueType };\r\n","import { color } from '../../../value/types/color/index.mjs';\r\nimport { complex } from '../../../value/types/complex/index.mjs';\r\nimport { dimensionValueTypes } from './dimensions.mjs';\r\nimport { testValueType } from './test.mjs';\r\n\r\n/**\r\n * A list of all ValueTypes\r\n */\r\nconst valueTypes = [...dimensionValueTypes, color, complex];\r\n/**\r\n * Tests a value against the list of ValueTypes\r\n */\r\nconst findValueType = (v) => valueTypes.find(testValueType(v));\r\n\r\nexport { findValueType };\r\n","import { isNumericalString } from '../../utils/is-numerical-string.mjs';\r\nimport { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\r\nimport { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';\r\nimport { motionValue } from '../../value/index.mjs';\r\nimport { complex } from '../../value/types/complex/index.mjs';\r\nimport { getAnimatableNone } from '../dom/value-types/animatable-none.mjs';\r\nimport { findValueType } from '../dom/value-types/find.mjs';\r\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\r\n\r\n/**\r\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\r\n * it doesn't exist.\r\n */\r\nfunction setMotionValue(visualElement, key, value) {\r\n if (visualElement.hasValue(key)) {\r\n visualElement.getValue(key).set(value);\r\n }\r\n else {\r\n visualElement.addValue(key, motionValue(value));\r\n }\r\n}\r\nfunction setTarget(visualElement, definition) {\r\n const resolved = resolveVariant(visualElement, definition);\r\n let { transitionEnd = {}, transition = {}, ...target } = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {};\r\n target = { ...target, ...transitionEnd };\r\n for (const key in target) {\r\n const value = resolveFinalValueInKeyframes(target[key]);\r\n setMotionValue(visualElement, key, value);\r\n }\r\n}\r\nfunction setVariants(visualElement, variantLabels) {\r\n const reversedLabels = [...variantLabels].reverse();\r\n reversedLabels.forEach((key) => {\r\n const variant = visualElement.getVariant(key);\r\n variant && setTarget(visualElement, variant);\r\n if (visualElement.variantChildren) {\r\n visualElement.variantChildren.forEach((child) => {\r\n setVariants(child, variantLabels);\r\n });\r\n }\r\n });\r\n}\r\nfunction setValues(visualElement, definition) {\r\n if (Array.isArray(definition)) {\r\n return setVariants(visualElement, definition);\r\n }\r\n else if (typeof definition === \"string\") {\r\n return setVariants(visualElement, [definition]);\r\n }\r\n else {\r\n setTarget(visualElement, definition);\r\n }\r\n}\r\nfunction checkTargetForNewValues(visualElement, target, origin) {\r\n var _a, _b;\r\n const newValueKeys = Object.keys(target).filter((key) => !visualElement.hasValue(key));\r\n const numNewValues = newValueKeys.length;\r\n if (!numNewValues)\r\n return;\r\n for (let i = 0; i < numNewValues; i++) {\r\n const key = newValueKeys[i];\r\n const targetValue = target[key];\r\n let value = null;\r\n /**\r\n * If the target is a series of keyframes, we can use the first value\r\n * in the array. If this first value is null, we'll still need to read from the DOM.\r\n */\r\n if (Array.isArray(targetValue)) {\r\n value = targetValue[0];\r\n }\r\n /**\r\n * If the target isn't keyframes, or the first keyframe was null, we need to\r\n * first check if an origin value was explicitly defined in the transition as \"from\",\r\n * if not read the value from the DOM. As an absolute fallback, take the defined target value.\r\n */\r\n if (value === null) {\r\n value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key];\r\n }\r\n /**\r\n * If value is still undefined or null, ignore it. Preferably this would throw,\r\n * but this was causing issues in Framer.\r\n */\r\n if (value === undefined || value === null)\r\n continue;\r\n if (typeof value === \"string\" &&\r\n (isNumericalString(value) || isZeroValueString(value))) {\r\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\r\n value = parseFloat(value);\r\n }\r\n else if (!findValueType(value) && complex.test(targetValue)) {\r\n value = getAnimatableNone(key, targetValue);\r\n }\r\n visualElement.addValue(key, motionValue(value, { owner: visualElement }));\r\n if (origin[key] === undefined) {\r\n origin[key] = value;\r\n }\r\n if (value !== null)\r\n visualElement.setBaseTarget(key, value);\r\n }\r\n}\r\nfunction getOriginFromTransition(key, transition) {\r\n if (!transition)\r\n return;\r\n const valueTransition = transition[key] || transition[\"default\"] || transition;\r\n return valueTransition.from;\r\n}\r\nfunction getOrigin(target, transition, visualElement) {\r\n const origin = {};\r\n for (const key in target) {\r\n const transitionOrigin = getOriginFromTransition(key, transition);\r\n if (transitionOrigin !== undefined) {\r\n origin[key] = transitionOrigin;\r\n }\r\n else {\r\n const value = visualElement.getValue(key);\r\n if (value) {\r\n origin[key] = value.get();\r\n }\r\n }\r\n }\r\n return origin;\r\n}\r\n\r\nexport { checkTargetForNewValues, getOrigin, getOriginFromTransition, setTarget, setValues };\r\n","import { transformProps } from '../../render/html/utils/transform.mjs';\r\nimport { optimizedAppearDataAttribute } from '../optimized-appear/data-id.mjs';\r\nimport { animateMotionValue } from './motion-value.mjs';\r\nimport { isWillChangeMotionValue } from '../../value/use-will-change/is.mjs';\r\nimport { setTarget } from '../../render/utils/setters.mjs';\r\nimport { getValueTransition } from '../utils/transitions.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\n/**\r\n * Decide whether we should block this animation. Previously, we achieved this\r\n * just by checking whether the key was listed in protectedKeys, but this\r\n * posed problems if an animation was triggered by afterChildren and protectedKeys\r\n * had been set to true in the meantime.\r\n */\r\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\r\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\r\n needsAnimating[key] = false;\r\n return shouldBlock;\r\n}\r\nfunction hasKeyframesChanged(value, target) {\r\n const current = value.get();\r\n if (Array.isArray(target)) {\r\n for (let i = 0; i < target.length; i++) {\r\n if (target[i] !== current)\r\n return true;\r\n }\r\n }\r\n else {\r\n return current !== target;\r\n }\r\n}\r\nfunction animateTarget(visualElement, definition, { delay = 0, transitionOverride, type } = {}) {\r\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = visualElement.makeTargetAnimatable(definition);\r\n const willChange = visualElement.getValue(\"willChange\");\r\n if (transitionOverride)\r\n transition = transitionOverride;\r\n const animations = [];\r\n const animationTypeState = type &&\r\n visualElement.animationState &&\r\n visualElement.animationState.getState()[type];\r\n for (const key in target) {\r\n const value = visualElement.getValue(key);\r\n const valueTarget = target[key];\r\n if (!value ||\r\n valueTarget === undefined ||\r\n (animationTypeState &&\r\n shouldBlockAnimation(animationTypeState, key))) {\r\n continue;\r\n }\r\n const valueTransition = {\r\n delay,\r\n elapsed: 0,\r\n ...getValueTransition(transition || {}, key),\r\n };\r\n /**\r\n * If this is the first time a value is being animated, check\r\n * to see if we're handling off from an existing animation.\r\n */\r\n if (window.HandoffAppearAnimations) {\r\n const appearId = visualElement.getProps()[optimizedAppearDataAttribute];\r\n if (appearId) {\r\n const elapsed = window.HandoffAppearAnimations(appearId, key, value, frame);\r\n if (elapsed !== null) {\r\n valueTransition.elapsed = elapsed;\r\n valueTransition.isHandoff = true;\r\n }\r\n }\r\n }\r\n let canSkip = !valueTransition.isHandoff &&\r\n !hasKeyframesChanged(value, valueTarget);\r\n if (valueTransition.type === \"spring\" &&\r\n (value.getVelocity() || valueTransition.velocity)) {\r\n canSkip = false;\r\n }\r\n /**\r\n * Temporarily disable skipping animations if there's an animation in\r\n * progress. Better would be to track the current target of a value\r\n * and compare that against valueTarget.\r\n */\r\n if (value.animation) {\r\n canSkip = false;\r\n }\r\n if (canSkip)\r\n continue;\r\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key)\r\n ? { type: false }\r\n : valueTransition));\r\n const animation = value.animation;\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.add(key);\r\n animation.then(() => willChange.remove(key));\r\n }\r\n animations.push(animation);\r\n }\r\n if (transitionEnd) {\r\n Promise.all(animations).then(() => {\r\n transitionEnd && setTarget(visualElement, transitionEnd);\r\n });\r\n }\r\n return animations;\r\n}\r\n\r\nexport { animateTarget };\r\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\r\nimport { animateTarget } from './visual-element-target.mjs';\r\n\r\nfunction animateVariant(visualElement, variant, options = {}) {\r\n const resolved = resolveVariant(visualElement, variant, options.custom);\r\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\r\n if (options.transitionOverride) {\r\n transition = options.transitionOverride;\r\n }\r\n /**\r\n * If we have a variant, create a callback that runs it as an animation.\r\n * Otherwise, we resolve a Promise immediately for a composable no-op.\r\n */\r\n const getAnimation = resolved\r\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\r\n : () => Promise.resolve();\r\n /**\r\n * If we have children, create a callback that runs all their animations.\r\n * Otherwise, we resolve a Promise immediately for a composable no-op.\r\n */\r\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\r\n ? (forwardDelay = 0) => {\r\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\r\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\r\n }\r\n : () => Promise.resolve();\r\n /**\r\n * If the transition explicitly defines a \"when\" option, we need to resolve either\r\n * this animation or all children animations before playing the other.\r\n */\r\n const { when } = transition;\r\n if (when) {\r\n const [first, last] = when === \"beforeChildren\"\r\n ? [getAnimation, getChildAnimations]\r\n : [getChildAnimations, getAnimation];\r\n return first().then(() => last());\r\n }\r\n else {\r\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\r\n }\r\n}\r\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\r\n const animations = [];\r\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\r\n const generateStaggerDuration = staggerDirection === 1\r\n ? (i = 0) => i * staggerChildren\r\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\r\n Array.from(visualElement.variantChildren)\r\n .sort(sortByTreeOrder)\r\n .forEach((child, i) => {\r\n child.notify(\"AnimationStart\", variant);\r\n animations.push(animateVariant(child, variant, {\r\n ...options,\r\n delay: delayChildren + generateStaggerDuration(i),\r\n }).then(() => child.notify(\"AnimationComplete\", variant)));\r\n });\r\n return Promise.all(animations);\r\n}\r\nfunction sortByTreeOrder(a, b) {\r\n return a.sortNodePosition(b);\r\n}\r\n\r\nexport { animateVariant, sortByTreeOrder };\r\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\r\nimport { animateTarget } from './visual-element-target.mjs';\r\nimport { animateVariant } from './visual-element-variant.mjs';\r\n\r\nfunction animateVisualElement(visualElement, definition, options = {}) {\r\n visualElement.notify(\"AnimationStart\", definition);\r\n let animation;\r\n if (Array.isArray(definition)) {\r\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\r\n animation = Promise.all(animations);\r\n }\r\n else if (typeof definition === \"string\") {\r\n animation = animateVariant(visualElement, definition, options);\r\n }\r\n else {\r\n const resolvedDefinition = typeof definition === \"function\"\r\n ? resolveVariant(visualElement, definition, options.custom)\r\n : definition;\r\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\r\n }\r\n return animation.then(() => visualElement.notify(\"AnimationComplete\", definition));\r\n}\r\n\r\nexport { animateVisualElement };\r\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\r\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\r\nimport { shallowCompare } from '../../utils/shallow-compare.mjs';\r\nimport { isVariantLabel } from './is-variant-label.mjs';\r\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\r\nimport { variantPriorityOrder } from './variant-props.mjs';\r\nimport { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\r\n\r\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\r\nconst numAnimationTypes = variantPriorityOrder.length;\r\nfunction animateList(visualElement) {\r\n return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\r\n}\r\nfunction createAnimationState(visualElement) {\r\n let animate = animateList(visualElement);\r\n const state = createState();\r\n let isInitialRender = true;\r\n /**\r\n * This function will be used to reduce the animation definitions for\r\n * each active animation type into an object of resolved values for it.\r\n */\r\n const buildResolvedTypeValues = (acc, definition) => {\r\n const resolved = resolveVariant(visualElement, definition);\r\n if (resolved) {\r\n const { transition, transitionEnd, ...target } = resolved;\r\n acc = { ...acc, ...target, ...transitionEnd };\r\n }\r\n return acc;\r\n };\r\n /**\r\n * This just allows us to inject mocked animation functions\r\n * @internal\r\n */\r\n function setAnimateFunction(makeAnimator) {\r\n animate = makeAnimator(visualElement);\r\n }\r\n /**\r\n * When we receive new props, we need to:\r\n * 1. Create a list of protected keys for each type. This is a directory of\r\n * value keys that are currently being \"handled\" by types of a higher priority\r\n * so that whenever an animation is played of a given type, these values are\r\n * protected from being animated.\r\n * 2. Determine if an animation type needs animating.\r\n * 3. Determine if any values have been removed from a type and figure out\r\n * what to animate those to.\r\n */\r\n function animateChanges(options, changedActiveType) {\r\n const props = visualElement.getProps();\r\n const context = visualElement.getVariantContext(true) || {};\r\n /**\r\n * A list of animations that we'll build into as we iterate through the animation\r\n * types. This will get executed at the end of the function.\r\n */\r\n const animations = [];\r\n /**\r\n * Keep track of which values have been removed. Then, as we hit lower priority\r\n * animation types, we can check if they contain removed values and animate to that.\r\n */\r\n const removedKeys = new Set();\r\n /**\r\n * A dictionary of all encountered keys. This is an object to let us build into and\r\n * copy it without iteration. Each time we hit an animation type we set its protected\r\n * keys - the keys its not allowed to animate - to the latest version of this object.\r\n */\r\n let encounteredKeys = {};\r\n /**\r\n * If a variant has been removed at a given index, and this component is controlling\r\n * variant animations, we want to ensure lower-priority variants are forced to animate.\r\n */\r\n let removedVariantIndex = Infinity;\r\n /**\r\n * Iterate through all animation types in reverse priority order. For each, we want to\r\n * detect which values it's handling and whether or not they've changed (and therefore\r\n * need to be animated). If any values have been removed, we want to detect those in\r\n * lower priority props and flag for animation.\r\n */\r\n for (let i = 0; i < numAnimationTypes; i++) {\r\n const type = reversePriorityOrder[i];\r\n const typeState = state[type];\r\n const prop = props[type] !== undefined ? props[type] : context[type];\r\n const propIsVariant = isVariantLabel(prop);\r\n /**\r\n * If this type has *just* changed isActive status, set activeDelta\r\n * to that status. Otherwise set to null.\r\n */\r\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\r\n if (activeDelta === false)\r\n removedVariantIndex = i;\r\n /**\r\n * If this prop is an inherited variant, rather than been set directly on the\r\n * component itself, we want to make sure we allow the parent to trigger animations.\r\n *\r\n * TODO: Can probably change this to a !isControllingVariants check\r\n */\r\n let isInherited = prop === context[type] && prop !== props[type] && propIsVariant;\r\n /**\r\n *\r\n */\r\n if (isInherited &&\r\n isInitialRender &&\r\n visualElement.manuallyAnimateOnMount) {\r\n isInherited = false;\r\n }\r\n /**\r\n * Set all encountered keys so far as the protected keys for this type. This will\r\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\r\n */\r\n typeState.protectedKeys = { ...encounteredKeys };\r\n // Check if we can skip analysing this prop early\r\n if (\r\n // If it isn't active and hasn't *just* been set as inactive\r\n (!typeState.isActive && activeDelta === null) ||\r\n // If we didn't and don't have any defined prop for this animation type\r\n (!prop && !typeState.prevProp) ||\r\n // Or if the prop doesn't define an animation\r\n isAnimationControls(prop) ||\r\n typeof prop === \"boolean\") {\r\n continue;\r\n }\r\n /**\r\n * As we go look through the values defined on this type, if we detect\r\n * a changed value or a value that was removed in a higher priority, we set\r\n * this to true and add this prop to the animation list.\r\n */\r\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\r\n let shouldAnimateType = variantDidChange ||\r\n // If we're making this variant active, we want to always make it active\r\n (type === changedActiveType &&\r\n typeState.isActive &&\r\n !isInherited &&\r\n propIsVariant) ||\r\n // If we removed a higher-priority variant (i is in reverse order)\r\n (i > removedVariantIndex && propIsVariant);\r\n let handledRemovedValues = false;\r\n /**\r\n * As animations can be set as variant lists, variants or target objects, we\r\n * coerce everything to an array if it isn't one already\r\n */\r\n const definitionList = Array.isArray(prop) ? prop : [prop];\r\n /**\r\n * Build an object of all the resolved values. We'll use this in the subsequent\r\n * animateChanges calls to determine whether a value has changed.\r\n */\r\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});\r\n if (activeDelta === false)\r\n resolvedValues = {};\r\n /**\r\n * Now we need to loop through all the keys in the prev prop and this prop,\r\n * and decide:\r\n * 1. If the value has changed, and needs animating\r\n * 2. If it has been removed, and needs adding to the removedKeys set\r\n * 3. If it has been removed in a higher priority type and needs animating\r\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\r\n * needs adding to the type's protectedKeys list.\r\n */\r\n const { prevResolvedValues = {} } = typeState;\r\n const allKeys = {\r\n ...prevResolvedValues,\r\n ...resolvedValues,\r\n };\r\n const markToAnimate = (key) => {\r\n shouldAnimateType = true;\r\n if (removedKeys.has(key)) {\r\n handledRemovedValues = true;\r\n removedKeys.delete(key);\r\n }\r\n typeState.needsAnimating[key] = true;\r\n };\r\n for (const key in allKeys) {\r\n const next = resolvedValues[key];\r\n const prev = prevResolvedValues[key];\r\n // If we've already handled this we can just skip ahead\r\n if (encounteredKeys.hasOwnProperty(key))\r\n continue;\r\n /**\r\n * If the value has changed, we probably want to animate it.\r\n */\r\n let valueHasChanged = false;\r\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\r\n valueHasChanged = !shallowCompare(next, prev);\r\n }\r\n else {\r\n valueHasChanged = next !== prev;\r\n }\r\n if (valueHasChanged) {\r\n if (next !== undefined) {\r\n // If next is defined and doesn't equal prev, it needs animating\r\n markToAnimate(key);\r\n }\r\n else {\r\n // If it's undefined, it's been removed.\r\n removedKeys.add(key);\r\n }\r\n }\r\n else if (next !== undefined && removedKeys.has(key)) {\r\n /**\r\n * If next hasn't changed and it isn't undefined, we want to check if it's\r\n * been removed by a higher priority\r\n */\r\n markToAnimate(key);\r\n }\r\n else {\r\n /**\r\n * If it hasn't changed, we add it to the list of protected values\r\n * to ensure it doesn't get animated.\r\n */\r\n typeState.protectedKeys[key] = true;\r\n }\r\n }\r\n /**\r\n * Update the typeState so next time animateChanges is called we can compare the\r\n * latest prop and resolvedValues to these.\r\n */\r\n typeState.prevProp = prop;\r\n typeState.prevResolvedValues = resolvedValues;\r\n /**\r\n *\r\n */\r\n if (typeState.isActive) {\r\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\r\n }\r\n if (isInitialRender && visualElement.blockInitialAnimation) {\r\n shouldAnimateType = false;\r\n }\r\n /**\r\n * If this is an inherited prop we want to hard-block animations\r\n */\r\n if (shouldAnimateType && (!isInherited || handledRemovedValues)) {\r\n animations.push(...definitionList.map((animation) => ({\r\n animation: animation,\r\n options: { type, ...options },\r\n })));\r\n }\r\n }\r\n /**\r\n * If there are some removed value that haven't been dealt with,\r\n * we need to create a new animation that falls back either to the value\r\n * defined in the style prop, or the last read value.\r\n */\r\n if (removedKeys.size) {\r\n const fallbackAnimation = {};\r\n removedKeys.forEach((key) => {\r\n const fallbackTarget = visualElement.getBaseTarget(key);\r\n if (fallbackTarget !== undefined) {\r\n fallbackAnimation[key] = fallbackTarget;\r\n }\r\n });\r\n animations.push({ animation: fallbackAnimation });\r\n }\r\n let shouldAnimate = Boolean(animations.length);\r\n if (isInitialRender &&\r\n (props.initial === false || props.initial === props.animate) &&\r\n !visualElement.manuallyAnimateOnMount) {\r\n shouldAnimate = false;\r\n }\r\n isInitialRender = false;\r\n return shouldAnimate ? animate(animations) : Promise.resolve();\r\n }\r\n /**\r\n * Change whether a certain animation type is active.\r\n */\r\n function setActive(type, isActive, options) {\r\n var _a;\r\n // If the active state hasn't changed, we can safely do nothing here\r\n if (state[type].isActive === isActive)\r\n return Promise.resolve();\r\n // Propagate active change to children\r\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });\r\n state[type].isActive = isActive;\r\n const animations = animateChanges(options, type);\r\n for (const key in state) {\r\n state[key].protectedKeys = {};\r\n }\r\n return animations;\r\n }\r\n return {\r\n animateChanges,\r\n setActive,\r\n setAnimateFunction,\r\n getState: () => state,\r\n };\r\n}\r\nfunction checkVariantsDidChange(prev, next) {\r\n if (typeof next === \"string\") {\r\n return next !== prev;\r\n }\r\n else if (Array.isArray(next)) {\r\n return !shallowCompare(next, prev);\r\n }\r\n return false;\r\n}\r\nfunction createTypeState(isActive = false) {\r\n return {\r\n isActive,\r\n protectedKeys: {},\r\n needsAnimating: {},\r\n prevResolvedValues: {},\r\n };\r\n}\r\nfunction createState() {\r\n return {\r\n animate: createTypeState(true),\r\n whileInView: createTypeState(),\r\n whileHover: createTypeState(),\r\n whileTap: createTypeState(),\r\n whileDrag: createTypeState(),\r\n whileFocus: createTypeState(),\r\n exit: createTypeState(),\r\n };\r\n}\r\n\r\nexport { checkVariantsDidChange, createAnimationState };\r\n","import { isAnimationControls } from '../../../animation/utils/is-animation-controls.mjs';\r\nimport { createAnimationState } from '../../../render/utils/animation-state.mjs';\r\nimport { Feature } from '../Feature.mjs';\r\n\r\nclass AnimationFeature extends Feature {\r\n /**\r\n * We dynamically generate the AnimationState manager as it contains a reference\r\n * to the underlying animation library. We only want to load that if we load this,\r\n * so people can optionally code split it out using the `m` component.\r\n */\r\n constructor(node) {\r\n super(node);\r\n node.animationState || (node.animationState = createAnimationState(node));\r\n }\r\n updateAnimationControlsSubscription() {\r\n const { animate } = this.node.getProps();\r\n this.unmount();\r\n if (isAnimationControls(animate)) {\r\n this.unmount = animate.subscribe(this.node);\r\n }\r\n }\r\n /**\r\n * Subscribe any provided AnimationControls to the component's VisualElement\r\n */\r\n mount() {\r\n this.updateAnimationControlsSubscription();\r\n }\r\n update() {\r\n const { animate } = this.node.getProps();\r\n const { animate: prevAnimate } = this.node.prevProps || {};\r\n if (animate !== prevAnimate) {\r\n this.updateAnimationControlsSubscription();\r\n }\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { AnimationFeature };\r\n","import { Feature } from '../Feature.mjs';\r\n\r\nlet id = 0;\r\nclass ExitAnimationFeature extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.id = id++;\r\n }\r\n update() {\r\n if (!this.node.presenceContext)\r\n return;\r\n const { isPresent, onExitComplete, custom } = this.node.presenceContext;\r\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\r\n if (!this.node.animationState || isPresent === prevIsPresent) {\r\n return;\r\n }\r\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent, { custom: custom !== null && custom !== void 0 ? custom : this.node.getProps().custom });\r\n if (onExitComplete && !isPresent) {\r\n exitAnimation.then(() => onExitComplete(this.id));\r\n }\r\n }\r\n mount() {\r\n const { register } = this.node.presenceContext || {};\r\n if (register) {\r\n this.unmount = register(this.id);\r\n }\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { ExitAnimationFeature };\r\n","import { AnimationFeature } from './animation/index.mjs';\r\nimport { ExitAnimationFeature } from './animation/exit.mjs';\r\n\r\nconst animations = {\r\n animation: {\r\n Feature: AnimationFeature,\r\n },\r\n exit: {\r\n Feature: ExitAnimationFeature,\r\n },\r\n};\r\n\r\nexport { animations };\r\n","const distance = (a, b) => Math.abs(a - b);\r\nfunction distance2D(a, b) {\r\n // Multi-dimensional\r\n const xDelta = distance(a.x, b.x);\r\n const yDelta = distance(a.y, b.y);\r\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\r\n}\r\n\r\nexport { distance, distance2D };\r\n","import { extractEventInfo } from '../../events/event-info.mjs';\r\nimport { secondsToMilliseconds, millisecondsToSeconds } from '../../utils/time-conversion.mjs';\r\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\r\nimport { pipe } from '../../utils/pipe.mjs';\r\nimport { distance2D } from '../../utils/distance.mjs';\r\nimport { isPrimaryPointer } from '../../events/utils/is-primary-pointer.mjs';\r\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\r\n\r\n/**\r\n * @internal\r\n */\r\nclass PanSession {\r\n constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) {\r\n /**\r\n * @internal\r\n */\r\n this.startEvent = null;\r\n /**\r\n * @internal\r\n */\r\n this.lastMoveEvent = null;\r\n /**\r\n * @internal\r\n */\r\n this.lastMoveEventInfo = null;\r\n /**\r\n * @internal\r\n */\r\n this.handlers = {};\r\n /**\r\n * @internal\r\n */\r\n this.contextWindow = window;\r\n this.updatePoint = () => {\r\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\r\n return;\r\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\r\n const isPanStarted = this.startEvent !== null;\r\n // Only start panning if the offset is larger than 3 pixels. If we make it\r\n // any larger than this we'll want to reset the pointer history\r\n // on the first update to avoid visual snapping to the cursoe.\r\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;\r\n if (!isPanStarted && !isDistancePastThreshold)\r\n return;\r\n const { point } = info;\r\n const { timestamp } = frameData;\r\n this.history.push({ ...point, timestamp });\r\n const { onStart, onMove } = this.handlers;\r\n if (!isPanStarted) {\r\n onStart && onStart(this.lastMoveEvent, info);\r\n this.startEvent = this.lastMoveEvent;\r\n }\r\n onMove && onMove(this.lastMoveEvent, info);\r\n };\r\n this.handlePointerMove = (event, info) => {\r\n this.lastMoveEvent = event;\r\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\r\n // Throttle mouse move event to once per frame\r\n frame.update(this.updatePoint, true);\r\n };\r\n this.handlePointerUp = (event, info) => {\r\n this.end();\r\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\r\n if (this.dragSnapToOrigin)\r\n resumeAnimation && resumeAnimation();\r\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\r\n return;\r\n const panInfo = getPanInfo(event.type === \"pointercancel\"\r\n ? this.lastMoveEventInfo\r\n : transformPoint(info, this.transformPagePoint), this.history);\r\n if (this.startEvent && onEnd) {\r\n onEnd(event, panInfo);\r\n }\r\n onSessionEnd && onSessionEnd(event, panInfo);\r\n };\r\n // If we have more than one touch, don't start detecting this gesture\r\n if (!isPrimaryPointer(event))\r\n return;\r\n this.dragSnapToOrigin = dragSnapToOrigin;\r\n this.handlers = handlers;\r\n this.transformPagePoint = transformPagePoint;\r\n this.contextWindow = contextWindow || window;\r\n const info = extractEventInfo(event);\r\n const initialInfo = transformPoint(info, this.transformPagePoint);\r\n const { point } = initialInfo;\r\n const { timestamp } = frameData;\r\n this.history = [{ ...point, timestamp }];\r\n const { onSessionStart } = handlers;\r\n onSessionStart &&\r\n onSessionStart(event, getPanInfo(initialInfo, this.history));\r\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\r\n }\r\n updateHandlers(handlers) {\r\n this.handlers = handlers;\r\n }\r\n end() {\r\n this.removeListeners && this.removeListeners();\r\n cancelFrame(this.updatePoint);\r\n }\r\n}\r\nfunction transformPoint(info, transformPagePoint) {\r\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\r\n}\r\nfunction subtractPoint(a, b) {\r\n return { x: a.x - b.x, y: a.y - b.y };\r\n}\r\nfunction getPanInfo({ point }, history) {\r\n return {\r\n point,\r\n delta: subtractPoint(point, lastDevicePoint(history)),\r\n offset: subtractPoint(point, startDevicePoint(history)),\r\n velocity: getVelocity(history, 0.1),\r\n };\r\n}\r\nfunction startDevicePoint(history) {\r\n return history[0];\r\n}\r\nfunction lastDevicePoint(history) {\r\n return history[history.length - 1];\r\n}\r\nfunction getVelocity(history, timeDelta) {\r\n if (history.length < 2) {\r\n return { x: 0, y: 0 };\r\n }\r\n let i = history.length - 1;\r\n let timestampedPoint = null;\r\n const lastPoint = lastDevicePoint(history);\r\n while (i >= 0) {\r\n timestampedPoint = history[i];\r\n if (lastPoint.timestamp - timestampedPoint.timestamp >\r\n secondsToMilliseconds(timeDelta)) {\r\n break;\r\n }\r\n i--;\r\n }\r\n if (!timestampedPoint) {\r\n return { x: 0, y: 0 };\r\n }\r\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\r\n if (time === 0) {\r\n return { x: 0, y: 0 };\r\n }\r\n const currentVelocity = {\r\n x: (lastPoint.x - timestampedPoint.x) / time,\r\n y: (lastPoint.y - timestampedPoint.y) / time,\r\n };\r\n if (currentVelocity.x === Infinity) {\r\n currentVelocity.x = 0;\r\n }\r\n if (currentVelocity.y === Infinity) {\r\n currentVelocity.y = 0;\r\n }\r\n return currentVelocity;\r\n}\r\n\r\nexport { PanSession };\r\n","import { mix } from '../../utils/mix.mjs';\r\n\r\nfunction calcLength(axis) {\r\n return axis.max - axis.min;\r\n}\r\nfunction isNear(value, target = 0, maxDistance = 0.01) {\r\n return Math.abs(value - target) <= maxDistance;\r\n}\r\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\r\n delta.origin = origin;\r\n delta.originPoint = mix(source.min, source.max, delta.origin);\r\n delta.scale = calcLength(target) / calcLength(source);\r\n if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale))\r\n delta.scale = 1;\r\n delta.translate =\r\n mix(target.min, target.max, delta.origin) - delta.originPoint;\r\n if (isNear(delta.translate) || isNaN(delta.translate))\r\n delta.translate = 0;\r\n}\r\nfunction calcBoxDelta(delta, source, target, origin) {\r\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\r\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\r\n}\r\nfunction calcRelativeAxis(target, relative, parent) {\r\n target.min = parent.min + relative.min;\r\n target.max = target.min + calcLength(relative);\r\n}\r\nfunction calcRelativeBox(target, relative, parent) {\r\n calcRelativeAxis(target.x, relative.x, parent.x);\r\n calcRelativeAxis(target.y, relative.y, parent.y);\r\n}\r\nfunction calcRelativeAxisPosition(target, layout, parent) {\r\n target.min = layout.min - parent.min;\r\n target.max = target.min + calcLength(layout);\r\n}\r\nfunction calcRelativePosition(target, layout, parent) {\r\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\r\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\r\n}\r\n\r\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\r\n","import { progress } from '../../../utils/progress.mjs';\r\nimport { calcLength } from '../../../projection/geometry/delta-calc.mjs';\r\nimport { clamp } from '../../../utils/clamp.mjs';\r\nimport { mix } from '../../../utils/mix.mjs';\r\n\r\n/**\r\n * Apply constraints to a point. These constraints are both physical along an\r\n * axis, and an elastic factor that determines how much to constrain the point\r\n * by if it does lie outside the defined parameters.\r\n */\r\nfunction applyConstraints(point, { min, max }, elastic) {\r\n if (min !== undefined && point < min) {\r\n // If we have a min point defined, and this is outside of that, constrain\r\n point = elastic ? mix(min, point, elastic.min) : Math.max(point, min);\r\n }\r\n else if (max !== undefined && point > max) {\r\n // If we have a max point defined, and this is outside of that, constrain\r\n point = elastic ? mix(max, point, elastic.max) : Math.min(point, max);\r\n }\r\n return point;\r\n}\r\n/**\r\n * Calculate constraints in terms of the viewport when defined relatively to the\r\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\r\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\r\n */\r\nfunction calcRelativeAxisConstraints(axis, min, max) {\r\n return {\r\n min: min !== undefined ? axis.min + min : undefined,\r\n max: max !== undefined\r\n ? axis.max + max - (axis.max - axis.min)\r\n : undefined,\r\n };\r\n}\r\n/**\r\n * Calculate constraints in terms of the viewport when\r\n * defined relatively to the measured bounding box.\r\n */\r\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\r\n return {\r\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\r\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\r\n };\r\n}\r\n/**\r\n * Calculate viewport constraints when defined as another viewport-relative axis\r\n */\r\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\r\n let min = constraintsAxis.min - layoutAxis.min;\r\n let max = constraintsAxis.max - layoutAxis.max;\r\n // If the constraints axis is actually smaller than the layout axis then we can\r\n // flip the constraints\r\n if (constraintsAxis.max - constraintsAxis.min <\r\n layoutAxis.max - layoutAxis.min) {\r\n [min, max] = [max, min];\r\n }\r\n return { min, max };\r\n}\r\n/**\r\n * Calculate viewport constraints when defined as another viewport-relative box\r\n */\r\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\r\n return {\r\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\r\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\r\n };\r\n}\r\n/**\r\n * Calculate a transform origin relative to the source axis, between 0-1, that results\r\n * in an asthetically pleasing scale/transform needed to project from source to target.\r\n */\r\nfunction calcOrigin(source, target) {\r\n let origin = 0.5;\r\n const sourceLength = calcLength(source);\r\n const targetLength = calcLength(target);\r\n if (targetLength > sourceLength) {\r\n origin = progress(target.min, target.max - sourceLength, source.min);\r\n }\r\n else if (sourceLength > targetLength) {\r\n origin = progress(source.min, source.max - targetLength, target.min);\r\n }\r\n return clamp(0, 1, origin);\r\n}\r\n/**\r\n * Rebase the calculated viewport constraints relative to the layout.min point.\r\n */\r\nfunction rebaseAxisConstraints(layout, constraints) {\r\n const relativeConstraints = {};\r\n if (constraints.min !== undefined) {\r\n relativeConstraints.min = constraints.min - layout.min;\r\n }\r\n if (constraints.max !== undefined) {\r\n relativeConstraints.max = constraints.max - layout.min;\r\n }\r\n return relativeConstraints;\r\n}\r\nconst defaultElastic = 0.35;\r\n/**\r\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\r\n */\r\nfunction resolveDragElastic(dragElastic = defaultElastic) {\r\n if (dragElastic === false) {\r\n dragElastic = 0;\r\n }\r\n else if (dragElastic === true) {\r\n dragElastic = defaultElastic;\r\n }\r\n return {\r\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\r\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\r\n };\r\n}\r\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\r\n return {\r\n min: resolvePointElastic(dragElastic, minLabel),\r\n max: resolvePointElastic(dragElastic, maxLabel),\r\n };\r\n}\r\nfunction resolvePointElastic(dragElastic, label) {\r\n return typeof dragElastic === \"number\"\r\n ? dragElastic\r\n : dragElastic[label] || 0;\r\n}\r\n\r\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\r\n","const createAxisDelta = () => ({\r\n translate: 0,\r\n scale: 1,\r\n origin: 0,\r\n originPoint: 0,\r\n});\r\nconst createDelta = () => ({\r\n x: createAxisDelta(),\r\n y: createAxisDelta(),\r\n});\r\nconst createAxis = () => ({ min: 0, max: 0 });\r\nconst createBox = () => ({\r\n x: createAxis(),\r\n y: createAxis(),\r\n});\r\n\r\nexport { createAxis, createAxisDelta, createBox, createDelta };\r\n","function eachAxis(callback) {\r\n return [callback(\"x\"), callback(\"y\")];\r\n}\r\n\r\nexport { eachAxis };\r\n","/**\r\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\r\n * it's easier to consider each axis individually. This function returns a bounding box\r\n * as a map of single-axis min/max values.\r\n */\r\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\r\n return {\r\n x: { min: left, max: right },\r\n y: { min: top, max: bottom },\r\n };\r\n}\r\nfunction convertBoxToBoundingBox({ x, y }) {\r\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\r\n}\r\n/**\r\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\r\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\r\n * when measuring DOM elements and DOM event points.\r\n */\r\nfunction transformBoxPoints(point, transformPoint) {\r\n if (!transformPoint)\r\n return point;\r\n const topLeft = transformPoint({ x: point.left, y: point.top });\r\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\r\n return {\r\n top: topLeft.y,\r\n left: topLeft.x,\r\n bottom: bottomRight.y,\r\n right: bottomRight.x,\r\n };\r\n}\r\n\r\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\r\n","function isIdentityScale(scale) {\r\n return scale === undefined || scale === 1;\r\n}\r\nfunction hasScale({ scale, scaleX, scaleY }) {\r\n return (!isIdentityScale(scale) ||\r\n !isIdentityScale(scaleX) ||\r\n !isIdentityScale(scaleY));\r\n}\r\nfunction hasTransform(values) {\r\n return (hasScale(values) ||\r\n has2DTranslate(values) ||\r\n values.z ||\r\n values.rotate ||\r\n values.rotateX ||\r\n values.rotateY);\r\n}\r\nfunction has2DTranslate(values) {\r\n return is2DTranslate(values.x) || is2DTranslate(values.y);\r\n}\r\nfunction is2DTranslate(value) {\r\n return value && value !== \"0%\";\r\n}\r\n\r\nexport { has2DTranslate, hasScale, hasTransform };\r\n","import { mix } from '../../utils/mix.mjs';\r\nimport { hasTransform } from '../utils/has-transform.mjs';\r\n\r\n/**\r\n * Scales a point based on a factor and an originPoint\r\n */\r\nfunction scalePoint(point, scale, originPoint) {\r\n const distanceFromOrigin = point - originPoint;\r\n const scaled = scale * distanceFromOrigin;\r\n return originPoint + scaled;\r\n}\r\n/**\r\n * Applies a translate/scale delta to a point\r\n */\r\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\r\n if (boxScale !== undefined) {\r\n point = scalePoint(point, boxScale, originPoint);\r\n }\r\n return scalePoint(point, scale, originPoint) + translate;\r\n}\r\n/**\r\n * Applies a translate/scale delta to an axis\r\n */\r\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\r\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\r\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\r\n}\r\n/**\r\n * Applies a translate/scale delta to a box\r\n */\r\nfunction applyBoxDelta(box, { x, y }) {\r\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\r\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\r\n}\r\n/**\r\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\r\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\r\n *\r\n * This is the final nested loop within updateLayoutDelta for future refactoring\r\n */\r\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\r\n const treeLength = treePath.length;\r\n if (!treeLength)\r\n return;\r\n // Reset the treeScale\r\n treeScale.x = treeScale.y = 1;\r\n let node;\r\n let delta;\r\n for (let i = 0; i < treeLength; i++) {\r\n node = treePath[i];\r\n delta = node.projectionDelta;\r\n /**\r\n * TODO: Prefer to remove this, but currently we have motion components with\r\n * display: contents in Framer.\r\n */\r\n const instance = node.instance;\r\n if (instance &&\r\n instance.style &&\r\n instance.style.display === \"contents\") {\r\n continue;\r\n }\r\n if (isSharedTransition &&\r\n node.options.layoutScroll &&\r\n node.scroll &&\r\n node !== node.root) {\r\n transformBox(box, {\r\n x: -node.scroll.offset.x,\r\n y: -node.scroll.offset.y,\r\n });\r\n }\r\n if (delta) {\r\n // Incoporate each ancestor's scale into a culmulative treeScale for this component\r\n treeScale.x *= delta.x.scale;\r\n treeScale.y *= delta.y.scale;\r\n // Apply each ancestor's calculated delta into this component's recorded layout box\r\n applyBoxDelta(box, delta);\r\n }\r\n if (isSharedTransition && hasTransform(node.latestValues)) {\r\n transformBox(box, node.latestValues);\r\n }\r\n }\r\n /**\r\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\r\n * This will help reduce useless scales getting rendered.\r\n */\r\n treeScale.x = snapToDefault(treeScale.x);\r\n treeScale.y = snapToDefault(treeScale.y);\r\n}\r\nfunction snapToDefault(scale) {\r\n if (Number.isInteger(scale))\r\n return scale;\r\n return scale > 1.0000000000001 || scale < 0.999999999999 ? scale : 1;\r\n}\r\nfunction translateAxis(axis, distance) {\r\n axis.min = axis.min + distance;\r\n axis.max = axis.max + distance;\r\n}\r\n/**\r\n * Apply a transform to an axis from the latest resolved motion values.\r\n * This function basically acts as a bridge between a flat motion value map\r\n * and applyAxisDelta\r\n */\r\nfunction transformAxis(axis, transforms, [key, scaleKey, originKey]) {\r\n const axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5;\r\n const originPoint = mix(axis.min, axis.max, axisOrigin);\r\n // Apply the axis delta to the final axis\r\n applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale);\r\n}\r\n/**\r\n * The names of the motion values we want to apply as translation, scale and origin.\r\n */\r\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\r\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\r\n/**\r\n * Apply a transform to a box from the latest resolved motion values.\r\n */\r\nfunction transformBox(box, transform) {\r\n transformAxis(box.x, transform, xKeys);\r\n transformAxis(box.y, transform, yKeys);\r\n}\r\n\r\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\r\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\r\nimport { translateAxis } from '../geometry/delta-apply.mjs';\r\n\r\nfunction measureViewportBox(instance, transformPoint) {\r\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\r\n}\r\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\r\n const viewportBox = measureViewportBox(element, transformPagePoint);\r\n const { scroll } = rootProjectionNode;\r\n if (scroll) {\r\n translateAxis(viewportBox.x, scroll.offset.x);\r\n translateAxis(viewportBox.y, scroll.offset.y);\r\n }\r\n return viewportBox;\r\n}\r\n\r\nexport { measurePageBox, measureViewportBox };\r\n","// Fixes https://github.com/framer/motion/issues/2270\r\nconst getContextWindow = ({ current }) => {\r\n return current ? current.ownerDocument.defaultView : null;\r\n};\r\n\r\nexport { getContextWindow };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport { PanSession } from '../pan/PanSession.mjs';\r\nimport { getGlobalLock } from './utils/lock.mjs';\r\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\r\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\r\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, calcOrigin } from './utils/constraints.mjs';\r\nimport { createBox } from '../../projection/geometry/models.mjs';\r\nimport { eachAxis } from '../../projection/utils/each-axis.mjs';\r\nimport { measurePageBox } from '../../projection/utils/measure.mjs';\r\nimport { extractEventInfo } from '../../events/event-info.mjs';\r\nimport { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';\r\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\r\nimport { calcLength } from '../../projection/geometry/delta-calc.mjs';\r\nimport { mix } from '../../utils/mix.mjs';\r\nimport { percent } from '../../value/types/numbers/units.mjs';\r\nimport { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';\r\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\nconst elementDragControls = new WeakMap();\r\n/**\r\n *\r\n */\r\n// let latestPointerEvent: PointerEvent\r\nclass VisualElementDragControls {\r\n constructor(visualElement) {\r\n // This is a reference to the global drag gesture lock, ensuring only one component\r\n // can \"capture\" the drag of one or both axes.\r\n // TODO: Look into moving this into pansession?\r\n this.openGlobalLock = null;\r\n this.isDragging = false;\r\n this.currentDirection = null;\r\n this.originPoint = { x: 0, y: 0 };\r\n /**\r\n * The permitted boundaries of travel, in pixels.\r\n */\r\n this.constraints = false;\r\n this.hasMutatedConstraints = false;\r\n /**\r\n * The per-axis resolved elastic values.\r\n */\r\n this.elastic = createBox();\r\n this.visualElement = visualElement;\r\n }\r\n start(originEvent, { snapToCursor = false } = {}) {\r\n /**\r\n * Don't start dragging if this component is exiting\r\n */\r\n const { presenceContext } = this.visualElement;\r\n if (presenceContext && presenceContext.isPresent === false)\r\n return;\r\n const onSessionStart = (event) => {\r\n const { dragSnapToOrigin } = this.getProps();\r\n // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch\r\n // the component.\r\n dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();\r\n if (snapToCursor) {\r\n this.snapToCursor(extractEventInfo(event, \"page\").point);\r\n }\r\n };\r\n const onStart = (event, info) => {\r\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\r\n const { drag, dragPropagation, onDragStart } = this.getProps();\r\n if (drag && !dragPropagation) {\r\n if (this.openGlobalLock)\r\n this.openGlobalLock();\r\n this.openGlobalLock = getGlobalLock(drag);\r\n // If we don 't have the lock, don't start dragging\r\n if (!this.openGlobalLock)\r\n return;\r\n }\r\n this.isDragging = true;\r\n this.currentDirection = null;\r\n this.resolveConstraints();\r\n if (this.visualElement.projection) {\r\n this.visualElement.projection.isAnimationBlocked = true;\r\n this.visualElement.projection.target = undefined;\r\n }\r\n /**\r\n * Record gesture origin\r\n */\r\n eachAxis((axis) => {\r\n let current = this.getAxisMotionValue(axis).get() || 0;\r\n /**\r\n * If the MotionValue is a percentage value convert to px\r\n */\r\n if (percent.test(current)) {\r\n const { projection } = this.visualElement;\r\n if (projection && projection.layout) {\r\n const measuredAxis = projection.layout.layoutBox[axis];\r\n if (measuredAxis) {\r\n const length = calcLength(measuredAxis);\r\n current = length * (parseFloat(current) / 100);\r\n }\r\n }\r\n }\r\n this.originPoint[axis] = current;\r\n });\r\n // Fire onDragStart event\r\n if (onDragStart) {\r\n frame.update(() => onDragStart(event, info), false, true);\r\n }\r\n const { animationState } = this.visualElement;\r\n animationState && animationState.setActive(\"whileDrag\", true);\r\n };\r\n const onMove = (event, info) => {\r\n // latestPointerEvent = event\r\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\r\n // If we didn't successfully receive the gesture lock, early return.\r\n if (!dragPropagation && !this.openGlobalLock)\r\n return;\r\n const { offset } = info;\r\n // Attempt to detect drag direction if directionLock is true\r\n if (dragDirectionLock && this.currentDirection === null) {\r\n this.currentDirection = getCurrentDirection(offset);\r\n // If we've successfully set a direction, notify listener\r\n if (this.currentDirection !== null) {\r\n onDirectionLock && onDirectionLock(this.currentDirection);\r\n }\r\n return;\r\n }\r\n // Update each point with the latest position\r\n this.updateAxis(\"x\", info.point, offset);\r\n this.updateAxis(\"y\", info.point, offset);\r\n /**\r\n * Ideally we would leave the renderer to fire naturally at the end of\r\n * this frame but if the element is about to change layout as the result\r\n * of a re-render we want to ensure the browser can read the latest\r\n * bounding box to ensure the pointer and element don't fall out of sync.\r\n */\r\n this.visualElement.render();\r\n /**\r\n * This must fire after the render call as it might trigger a state\r\n * change which itself might trigger a layout update.\r\n */\r\n onDrag && onDrag(event, info);\r\n };\r\n const onSessionEnd = (event, info) => this.stop(event, info);\r\n const resumeAnimation = () => eachAxis((axis) => {\r\n var _a;\r\n return this.getAnimationState(axis) === \"paused\" &&\r\n ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());\r\n });\r\n const { dragSnapToOrigin } = this.getProps();\r\n this.panSession = new PanSession(originEvent, {\r\n onSessionStart,\r\n onStart,\r\n onMove,\r\n onSessionEnd,\r\n resumeAnimation,\r\n }, {\r\n transformPagePoint: this.visualElement.getTransformPagePoint(),\r\n dragSnapToOrigin,\r\n contextWindow: getContextWindow(this.visualElement),\r\n });\r\n }\r\n stop(event, info) {\r\n const isDragging = this.isDragging;\r\n this.cancel();\r\n if (!isDragging)\r\n return;\r\n const { velocity } = info;\r\n this.startAnimation(velocity);\r\n const { onDragEnd } = this.getProps();\r\n if (onDragEnd) {\r\n frame.update(() => onDragEnd(event, info));\r\n }\r\n }\r\n cancel() {\r\n this.isDragging = false;\r\n const { projection, animationState } = this.visualElement;\r\n if (projection) {\r\n projection.isAnimationBlocked = false;\r\n }\r\n this.panSession && this.panSession.end();\r\n this.panSession = undefined;\r\n const { dragPropagation } = this.getProps();\r\n if (!dragPropagation && this.openGlobalLock) {\r\n this.openGlobalLock();\r\n this.openGlobalLock = null;\r\n }\r\n animationState && animationState.setActive(\"whileDrag\", false);\r\n }\r\n updateAxis(axis, _point, offset) {\r\n const { drag } = this.getProps();\r\n // If we're not dragging this axis, do an early return.\r\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\r\n return;\r\n const axisValue = this.getAxisMotionValue(axis);\r\n let next = this.originPoint[axis] + offset[axis];\r\n // Apply constraints\r\n if (this.constraints && this.constraints[axis]) {\r\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\r\n }\r\n axisValue.set(next);\r\n }\r\n resolveConstraints() {\r\n var _a;\r\n const { dragConstraints, dragElastic } = this.getProps();\r\n const layout = this.visualElement.projection &&\r\n !this.visualElement.projection.layout\r\n ? this.visualElement.projection.measure(false)\r\n : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;\r\n const prevConstraints = this.constraints;\r\n if (dragConstraints && isRefObject(dragConstraints)) {\r\n if (!this.constraints) {\r\n this.constraints = this.resolveRefConstraints();\r\n }\r\n }\r\n else {\r\n if (dragConstraints && layout) {\r\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\r\n }\r\n else {\r\n this.constraints = false;\r\n }\r\n }\r\n this.elastic = resolveDragElastic(dragElastic);\r\n /**\r\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\r\n * from viewport-relative to component-relative.\r\n */\r\n if (prevConstraints !== this.constraints &&\r\n layout &&\r\n this.constraints &&\r\n !this.hasMutatedConstraints) {\r\n eachAxis((axis) => {\r\n if (this.getAxisMotionValue(axis)) {\r\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\r\n }\r\n });\r\n }\r\n }\r\n resolveRefConstraints() {\r\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\r\n if (!constraints || !isRefObject(constraints))\r\n return false;\r\n const constraintsElement = constraints.current;\r\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\");\r\n const { projection } = this.visualElement;\r\n // TODO\r\n if (!projection || !projection.layout)\r\n return false;\r\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\r\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\r\n /**\r\n * If there's an onMeasureDragConstraints listener we call it and\r\n * if different constraints are returned, set constraints to that\r\n */\r\n if (onMeasureDragConstraints) {\r\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\r\n this.hasMutatedConstraints = !!userConstraints;\r\n if (userConstraints) {\r\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\r\n }\r\n }\r\n return measuredConstraints;\r\n }\r\n startAnimation(velocity) {\r\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\r\n const constraints = this.constraints || {};\r\n const momentumAnimations = eachAxis((axis) => {\r\n if (!shouldDrag(axis, drag, this.currentDirection)) {\r\n return;\r\n }\r\n let transition = (constraints && constraints[axis]) || {};\r\n if (dragSnapToOrigin)\r\n transition = { min: 0, max: 0 };\r\n /**\r\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\r\n * of spring animations so we should look into adding a disable spring option to `inertia`.\r\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\r\n * using the value of `dragElastic`.\r\n */\r\n const bounceStiffness = dragElastic ? 200 : 1000000;\r\n const bounceDamping = dragElastic ? 40 : 10000000;\r\n const inertia = {\r\n type: \"inertia\",\r\n velocity: dragMomentum ? velocity[axis] : 0,\r\n bounceStiffness,\r\n bounceDamping,\r\n timeConstant: 750,\r\n restDelta: 1,\r\n restSpeed: 10,\r\n ...dragTransition,\r\n ...transition,\r\n };\r\n // If we're not animating on an externally-provided `MotionValue` we can use the\r\n // component's animation controls which will handle interactions with whileHover (etc),\r\n // otherwise we just have to animate the `MotionValue` itself.\r\n return this.startAxisValueAnimation(axis, inertia);\r\n });\r\n // Run all animations and then resolve the new drag constraints.\r\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\r\n }\r\n startAxisValueAnimation(axis, transition) {\r\n const axisValue = this.getAxisMotionValue(axis);\r\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition));\r\n }\r\n stopAnimation() {\r\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\r\n }\r\n pauseAnimation() {\r\n eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });\r\n }\r\n getAnimationState(axis) {\r\n var _a;\r\n return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;\r\n }\r\n /**\r\n * Drag works differently depending on which props are provided.\r\n *\r\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\r\n * - Otherwise, we apply the delta to the x/y motion values.\r\n */\r\n getAxisMotionValue(axis) {\r\n const dragKey = \"_drag\" + axis.toUpperCase();\r\n const props = this.visualElement.getProps();\r\n const externalMotionValue = props[dragKey];\r\n return externalMotionValue\r\n ? externalMotionValue\r\n : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : undefined) || 0);\r\n }\r\n snapToCursor(point) {\r\n eachAxis((axis) => {\r\n const { drag } = this.getProps();\r\n // If we're not dragging this axis, do an early return.\r\n if (!shouldDrag(axis, drag, this.currentDirection))\r\n return;\r\n const { projection } = this.visualElement;\r\n const axisValue = this.getAxisMotionValue(axis);\r\n if (projection && projection.layout) {\r\n const { min, max } = projection.layout.layoutBox[axis];\r\n axisValue.set(point[axis] - mix(min, max, 0.5));\r\n }\r\n });\r\n }\r\n /**\r\n * When the viewport resizes we want to check if the measured constraints\r\n * have changed and, if so, reposition the element within those new constraints\r\n * relative to where it was before the resize.\r\n */\r\n scalePositionWithinConstraints() {\r\n if (!this.visualElement.current)\r\n return;\r\n const { drag, dragConstraints } = this.getProps();\r\n const { projection } = this.visualElement;\r\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\r\n return;\r\n /**\r\n * Stop current animations as there can be visual glitching if we try to do\r\n * this mid-animation\r\n */\r\n this.stopAnimation();\r\n /**\r\n * Record the relative position of the dragged element relative to the\r\n * constraints box and save as a progress value.\r\n */\r\n const boxProgress = { x: 0, y: 0 };\r\n eachAxis((axis) => {\r\n const axisValue = this.getAxisMotionValue(axis);\r\n if (axisValue) {\r\n const latest = axisValue.get();\r\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\r\n }\r\n });\r\n /**\r\n * Update the layout of this element and resolve the latest drag constraints\r\n */\r\n const { transformTemplate } = this.visualElement.getProps();\r\n this.visualElement.current.style.transform = transformTemplate\r\n ? transformTemplate({}, \"\")\r\n : \"none\";\r\n projection.root && projection.root.updateScroll();\r\n projection.updateLayout();\r\n this.resolveConstraints();\r\n /**\r\n * For each axis, calculate the current progress of the layout axis\r\n * within the new constraints.\r\n */\r\n eachAxis((axis) => {\r\n if (!shouldDrag(axis, drag, null))\r\n return;\r\n /**\r\n * Calculate a new transform based on the previous box progress\r\n */\r\n const axisValue = this.getAxisMotionValue(axis);\r\n const { min, max } = this.constraints[axis];\r\n axisValue.set(mix(min, max, boxProgress[axis]));\r\n });\r\n }\r\n addListeners() {\r\n if (!this.visualElement.current)\r\n return;\r\n elementDragControls.set(this.visualElement, this);\r\n const element = this.visualElement.current;\r\n /**\r\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\r\n */\r\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\r\n const { drag, dragListener = true } = this.getProps();\r\n drag && dragListener && this.start(event);\r\n });\r\n const measureDragConstraints = () => {\r\n const { dragConstraints } = this.getProps();\r\n if (isRefObject(dragConstraints)) {\r\n this.constraints = this.resolveRefConstraints();\r\n }\r\n };\r\n const { projection } = this.visualElement;\r\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\r\n if (projection && !projection.layout) {\r\n projection.root && projection.root.updateScroll();\r\n projection.updateLayout();\r\n }\r\n measureDragConstraints();\r\n /**\r\n * Attach a window resize listener to scale the draggable target within its defined\r\n * constraints as the window resizes.\r\n */\r\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\r\n /**\r\n * If the element's layout changes, calculate the delta and apply that to\r\n * the drag gesture's origin point.\r\n */\r\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\r\n if (this.isDragging && hasLayoutChanged) {\r\n eachAxis((axis) => {\r\n const motionValue = this.getAxisMotionValue(axis);\r\n if (!motionValue)\r\n return;\r\n this.originPoint[axis] += delta[axis].translate;\r\n motionValue.set(motionValue.get() + delta[axis].translate);\r\n });\r\n this.visualElement.render();\r\n }\r\n }));\r\n return () => {\r\n stopResizeListener();\r\n stopPointerListener();\r\n stopMeasureLayoutListener();\r\n stopLayoutUpdateListener && stopLayoutUpdateListener();\r\n };\r\n }\r\n getProps() {\r\n const props = this.visualElement.getProps();\r\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\r\n return {\r\n ...props,\r\n drag,\r\n dragDirectionLock,\r\n dragPropagation,\r\n dragConstraints,\r\n dragElastic,\r\n dragMomentum,\r\n };\r\n }\r\n}\r\nfunction shouldDrag(direction, drag, currentDirection) {\r\n return ((drag === true || drag === direction) &&\r\n (currentDirection === null || currentDirection === direction));\r\n}\r\n/**\r\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\r\n * than the provided threshold, return `null`.\r\n *\r\n * @param offset - The x/y offset from origin.\r\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\r\n */\r\nfunction getCurrentDirection(offset, lockThreshold = 10) {\r\n let direction = null;\r\n if (Math.abs(offset.y) > lockThreshold) {\r\n direction = \"y\";\r\n }\r\n else if (Math.abs(offset.x) > lockThreshold) {\r\n direction = \"x\";\r\n }\r\n return direction;\r\n}\r\n\r\nexport { VisualElementDragControls, elementDragControls };\r\n","import { Feature } from '../../motion/features/Feature.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { VisualElementDragControls } from './VisualElementDragControls.mjs';\r\n\r\nclass DragGesture extends Feature {\r\n constructor(node) {\r\n super(node);\r\n this.removeGroupControls = noop;\r\n this.removeListeners = noop;\r\n this.controls = new VisualElementDragControls(node);\r\n }\r\n mount() {\r\n // If we've been provided a DragControls for manual control over the drag gesture,\r\n // subscribe this component to it on mount.\r\n const { dragControls } = this.node.getProps();\r\n if (dragControls) {\r\n this.removeGroupControls = dragControls.subscribe(this.controls);\r\n }\r\n this.removeListeners = this.controls.addListeners() || noop;\r\n }\r\n unmount() {\r\n this.removeGroupControls();\r\n this.removeListeners();\r\n }\r\n}\r\n\r\nexport { DragGesture };\r\n","import { PanSession } from './PanSession.mjs';\r\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\r\nimport { Feature } from '../../motion/features/Feature.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\nconst asyncHandler = (handler) => (event, info) => {\r\n if (handler) {\r\n frame.update(() => handler(event, info));\r\n }\r\n};\r\nclass PanGesture extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.removePointerDownListener = noop;\r\n }\r\n onPointerDown(pointerDownEvent) {\r\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\r\n transformPagePoint: this.node.getTransformPagePoint(),\r\n contextWindow: getContextWindow(this.node),\r\n });\r\n }\r\n createPanHandlers() {\r\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\r\n return {\r\n onSessionStart: asyncHandler(onPanSessionStart),\r\n onStart: asyncHandler(onPanStart),\r\n onMove: onPan,\r\n onEnd: (event, info) => {\r\n delete this.session;\r\n if (onPanEnd) {\r\n frame.update(() => onPanEnd(event, info));\r\n }\r\n },\r\n };\r\n }\r\n mount() {\r\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\r\n }\r\n update() {\r\n this.session && this.session.updateHandlers(this.createPanHandlers());\r\n }\r\n unmount() {\r\n this.removePointerDownListener();\r\n this.session && this.session.end();\r\n }\r\n}\r\n\r\nexport { PanGesture };\r\n","import { useContext, useId, useEffect } from 'react';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\n\r\n/**\r\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\r\n * to access information about whether it's still present in the React tree.\r\n *\r\n * ```jsx\r\n * import { usePresence } from \"framer-motion\"\r\n *\r\n * export const Component = () => {\r\n * const [isPresent, safeToRemove] = usePresence()\r\n *\r\n * useEffect(() => {\r\n * !isPresent && setTimeout(safeToRemove, 1000)\r\n * }, [isPresent])\r\n *\r\n * return
\r\n * }\r\n * ```\r\n *\r\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\r\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\r\n *\r\n * @public\r\n */\r\nfunction usePresence() {\r\n const context = useContext(PresenceContext);\r\n if (context === null)\r\n return [true, null];\r\n const { isPresent, onExitComplete, register } = context;\r\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\r\n // either be null or non-null for the lifespan of the component.\r\n const id = useId();\r\n useEffect(() => register(id), []);\r\n const safeToRemove = () => onExitComplete && onExitComplete(id);\r\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\r\n}\r\n/**\r\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\r\n * There is no `safeToRemove` function.\r\n *\r\n * ```jsx\r\n * import { useIsPresent } from \"framer-motion\"\r\n *\r\n * export const Component = () => {\r\n * const isPresent = useIsPresent()\r\n *\r\n * useEffect(() => {\r\n * !isPresent && console.log(\"I've been removed!\")\r\n * }, [isPresent])\r\n *\r\n * return
\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useIsPresent() {\r\n return isPresent(useContext(PresenceContext));\r\n}\r\nfunction isPresent(context) {\r\n return context === null ? true : context.isPresent;\r\n}\r\n\r\nexport { isPresent, useIsPresent, usePresence };\r\n","/**\r\n * This should only ever be modified on the client otherwise it'll\r\n * persist through server requests. If we need instanced states we\r\n * could lazy-init via root.\r\n */\r\nconst globalProjectionState = {\r\n /**\r\n * Global flag as to whether the tree has animated since the last time\r\n * we resized the window\r\n */\r\n hasAnimatedSinceResize: true,\r\n /**\r\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\r\n * update will be given a `data-projection-id` attribute.\r\n */\r\n hasEverUpdated: false,\r\n};\r\n\r\nexport { globalProjectionState };\r\n","import { px } from '../../value/types/numbers/units.mjs';\r\n\r\nfunction pixelsToPercent(pixels, axis) {\r\n if (axis.max === axis.min)\r\n return 0;\r\n return (pixels / (axis.max - axis.min)) * 100;\r\n}\r\n/**\r\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\r\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\r\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\r\n * borderRadius in both states. If we animate between the two in pixels that will trigger\r\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\r\n */\r\nconst correctBorderRadius = {\r\n correct: (latest, node) => {\r\n if (!node.target)\r\n return latest;\r\n /**\r\n * If latest is a string, if it's a percentage we can return immediately as it's\r\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\r\n */\r\n if (typeof latest === \"string\") {\r\n if (px.test(latest)) {\r\n latest = parseFloat(latest);\r\n }\r\n else {\r\n return latest;\r\n }\r\n }\r\n /**\r\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\r\n * pixel value as a percentage of each axis\r\n */\r\n const x = pixelsToPercent(latest, node.target.x);\r\n const y = pixelsToPercent(latest, node.target.y);\r\n return `${x}% ${y}%`;\r\n },\r\n};\r\n\r\nexport { correctBorderRadius, pixelsToPercent };\r\n","import { mix } from '../../utils/mix.mjs';\r\nimport { complex } from '../../value/types/complex/index.mjs';\r\n\r\nconst correctBoxShadow = {\r\n correct: (latest, { treeScale, projectionDelta }) => {\r\n const original = latest;\r\n const shadow = complex.parse(latest);\r\n // TODO: Doesn't support multiple shadows\r\n if (shadow.length > 5)\r\n return original;\r\n const template = complex.createTransformer(latest);\r\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\r\n // Calculate the overall context scale\r\n const xScale = projectionDelta.x.scale * treeScale.x;\r\n const yScale = projectionDelta.y.scale * treeScale.y;\r\n shadow[0 + offset] /= xScale;\r\n shadow[1 + offset] /= yScale;\r\n /**\r\n * Ideally we'd correct x and y scales individually, but because blur and\r\n * spread apply to both we have to take a scale average and apply that instead.\r\n * We could potentially improve the outcome of this by incorporating the ratio between\r\n * the two scales.\r\n */\r\n const averageScale = mix(xScale, yScale, 0.5);\r\n // Blur\r\n if (typeof shadow[2 + offset] === \"number\")\r\n shadow[2 + offset] /= averageScale;\r\n // Spread\r\n if (typeof shadow[3 + offset] === \"number\")\r\n shadow[3 + offset] /= averageScale;\r\n return template(shadow);\r\n },\r\n};\r\n\r\nexport { correctBoxShadow };\r\n","import React__default, { useContext } from 'react';\r\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';\r\nimport { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';\r\nimport { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';\r\nimport { globalProjectionState } from '../../../projection/node/state.mjs';\r\nimport { correctBorderRadius } from '../../../projection/styles/scale-border-radius.mjs';\r\nimport { correctBoxShadow } from '../../../projection/styles/scale-box-shadow.mjs';\r\nimport { addScaleCorrector } from '../../../projection/styles/scale-correction.mjs';\r\nimport { frame } from '../../../frameloop/frame.mjs';\r\n\r\nclass MeasureLayoutWithContext extends React__default.Component {\r\n /**\r\n * This only mounts projection nodes for components that\r\n * need measuring, we might want to do it for all components\r\n * in order to incorporate transforms\r\n */\r\n componentDidMount() {\r\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\r\n const { projection } = visualElement;\r\n addScaleCorrector(defaultScaleCorrectors);\r\n if (projection) {\r\n if (layoutGroup.group)\r\n layoutGroup.group.add(projection);\r\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\r\n switchLayoutGroup.register(projection);\r\n }\r\n projection.root.didUpdate();\r\n projection.addEventListener(\"animationComplete\", () => {\r\n this.safeToRemove();\r\n });\r\n projection.setOptions({\r\n ...projection.options,\r\n onExitComplete: () => this.safeToRemove(),\r\n });\r\n }\r\n globalProjectionState.hasEverUpdated = true;\r\n }\r\n getSnapshotBeforeUpdate(prevProps) {\r\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\r\n const projection = visualElement.projection;\r\n if (!projection)\r\n return null;\r\n /**\r\n * TODO: We use this data in relegate to determine whether to\r\n * promote a previous element. There's no guarantee its presence data\r\n * will have updated by this point - if a bug like this arises it will\r\n * have to be that we markForRelegation and then find a new lead some other way,\r\n * perhaps in didUpdate\r\n */\r\n projection.isPresent = isPresent;\r\n if (drag ||\r\n prevProps.layoutDependency !== layoutDependency ||\r\n layoutDependency === undefined) {\r\n projection.willUpdate();\r\n }\r\n else {\r\n this.safeToRemove();\r\n }\r\n if (prevProps.isPresent !== isPresent) {\r\n if (isPresent) {\r\n projection.promote();\r\n }\r\n else if (!projection.relegate()) {\r\n /**\r\n * If there's another stack member taking over from this one,\r\n * it's in charge of the exit animation and therefore should\r\n * be in charge of the safe to remove. Otherwise we call it here.\r\n */\r\n frame.postRender(() => {\r\n const stack = projection.getStack();\r\n if (!stack || !stack.members.length) {\r\n this.safeToRemove();\r\n }\r\n });\r\n }\r\n }\r\n return null;\r\n }\r\n componentDidUpdate() {\r\n const { projection } = this.props.visualElement;\r\n if (projection) {\r\n projection.root.didUpdate();\r\n queueMicrotask(() => {\r\n if (!projection.currentAnimation && projection.isLead()) {\r\n this.safeToRemove();\r\n }\r\n });\r\n }\r\n }\r\n componentWillUnmount() {\r\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\r\n const { projection } = visualElement;\r\n if (projection) {\r\n projection.scheduleCheckAfterUnmount();\r\n if (layoutGroup && layoutGroup.group)\r\n layoutGroup.group.remove(projection);\r\n if (promoteContext && promoteContext.deregister)\r\n promoteContext.deregister(projection);\r\n }\r\n }\r\n safeToRemove() {\r\n const { safeToRemove } = this.props;\r\n safeToRemove && safeToRemove();\r\n }\r\n render() {\r\n return null;\r\n }\r\n}\r\nfunction MeasureLayout(props) {\r\n const [isPresent, safeToRemove] = usePresence();\r\n const layoutGroup = useContext(LayoutGroupContext);\r\n return (React__default.createElement(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\r\n}\r\nconst defaultScaleCorrectors = {\r\n borderRadius: {\r\n ...correctBorderRadius,\r\n applyTo: [\r\n \"borderTopLeftRadius\",\r\n \"borderTopRightRadius\",\r\n \"borderBottomLeftRadius\",\r\n \"borderBottomRightRadius\",\r\n ],\r\n },\r\n borderTopLeftRadius: correctBorderRadius,\r\n borderTopRightRadius: correctBorderRadius,\r\n borderBottomLeftRadius: correctBorderRadius,\r\n borderBottomRightRadius: correctBorderRadius,\r\n boxShadow: correctBoxShadow,\r\n};\r\n\r\nexport { MeasureLayout };\r\n","import { circOut } from '../../easing/circ.mjs';\r\nimport { progress } from '../../utils/progress.mjs';\r\nimport { mix } from '../../utils/mix.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { percent, px } from '../../value/types/numbers/units.mjs';\r\n\r\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\r\nconst numBorders = borders.length;\r\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\r\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\r\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\r\n if (shouldCrossfadeOpacity) {\r\n target.opacity = mix(0, \r\n // TODO Reinstate this if only child\r\n lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));\r\n target.opacityExit = mix(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));\r\n }\r\n else if (isOnlyMember) {\r\n target.opacity = mix(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);\r\n }\r\n /**\r\n * Mix border radius\r\n */\r\n for (let i = 0; i < numBorders; i++) {\r\n const borderLabel = `border${borders[i]}Radius`;\r\n let followRadius = getRadius(follow, borderLabel);\r\n let leadRadius = getRadius(lead, borderLabel);\r\n if (followRadius === undefined && leadRadius === undefined)\r\n continue;\r\n followRadius || (followRadius = 0);\r\n leadRadius || (leadRadius = 0);\r\n const canMix = followRadius === 0 ||\r\n leadRadius === 0 ||\r\n isPx(followRadius) === isPx(leadRadius);\r\n if (canMix) {\r\n target[borderLabel] = Math.max(mix(asNumber(followRadius), asNumber(leadRadius), progress), 0);\r\n if (percent.test(leadRadius) || percent.test(followRadius)) {\r\n target[borderLabel] += \"%\";\r\n }\r\n }\r\n else {\r\n target[borderLabel] = leadRadius;\r\n }\r\n }\r\n /**\r\n * Mix rotation\r\n */\r\n if (follow.rotate || lead.rotate) {\r\n target.rotate = mix(follow.rotate || 0, lead.rotate || 0, progress);\r\n }\r\n}\r\nfunction getRadius(values, radiusName) {\r\n return values[radiusName] !== undefined\r\n ? values[radiusName]\r\n : values.borderRadius;\r\n}\r\n// /**\r\n// * We only want to mix the background color if there's a follow element\r\n// * that we're not crossfading opacity between. For instance with switch\r\n// * AnimateSharedLayout animations, this helps the illusion of a continuous\r\n// * element being animated but also cuts down on the number of paints triggered\r\n// * for elements where opacity is doing that work for us.\r\n// */\r\n// if (\r\n// !hasFollowElement &&\r\n// latestLeadValues.backgroundColor &&\r\n// latestFollowValues.backgroundColor\r\n// ) {\r\n// /**\r\n// * This isn't ideal performance-wise as mixColor is creating a new function every frame.\r\n// * We could probably create a mixer that runs at the start of the animation but\r\n// * the idea behind the crossfader is that it runs dynamically between two potentially\r\n// * changing targets (ie opacity or borderRadius may be animating independently via variants)\r\n// */\r\n// leadState.backgroundColor = followState.backgroundColor = mixColor(\r\n// latestFollowValues.backgroundColor as string,\r\n// latestLeadValues.backgroundColor as string\r\n// )(p)\r\n// }\r\nconst easeCrossfadeIn = compress(0, 0.5, circOut);\r\nconst easeCrossfadeOut = compress(0.5, 0.95, noop);\r\nfunction compress(min, max, easing) {\r\n return (p) => {\r\n // Could replace ifs with clamp\r\n if (p < min)\r\n return 0;\r\n if (p > max)\r\n return 1;\r\n return easing(progress(min, max, p));\r\n };\r\n}\r\n\r\nexport { mixValues };\r\n","/**\r\n * Reset an axis to the provided origin box.\r\n *\r\n * This is a mutative operation.\r\n */\r\nfunction copyAxisInto(axis, originAxis) {\r\n axis.min = originAxis.min;\r\n axis.max = originAxis.max;\r\n}\r\n/**\r\n * Reset a box to the provided origin box.\r\n *\r\n * This is a mutative operation.\r\n */\r\nfunction copyBoxInto(box, originBox) {\r\n copyAxisInto(box.x, originBox.x);\r\n copyAxisInto(box.y, originBox.y);\r\n}\r\n\r\nexport { copyAxisInto, copyBoxInto };\r\n","import { mix } from '../../utils/mix.mjs';\r\nimport { percent } from '../../value/types/numbers/units.mjs';\r\nimport { scalePoint } from './delta-apply.mjs';\r\n\r\n/**\r\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\r\n */\r\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\r\n point -= translate;\r\n point = scalePoint(point, 1 / scale, originPoint);\r\n if (boxScale !== undefined) {\r\n point = scalePoint(point, 1 / boxScale, originPoint);\r\n }\r\n return point;\r\n}\r\n/**\r\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\r\n */\r\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\r\n if (percent.test(translate)) {\r\n translate = parseFloat(translate);\r\n const relativeProgress = mix(sourceAxis.min, sourceAxis.max, translate / 100);\r\n translate = relativeProgress - sourceAxis.min;\r\n }\r\n if (typeof translate !== \"number\")\r\n return;\r\n let originPoint = mix(originAxis.min, originAxis.max, origin);\r\n if (axis === originAxis)\r\n originPoint -= translate;\r\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\r\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\r\n}\r\n/**\r\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\r\n * and acts as a bridge between motion values and removeAxisDelta\r\n */\r\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\r\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\r\n}\r\n/**\r\n * The names of the motion values we want to apply as translation, scale and origin.\r\n */\r\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\r\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\r\n/**\r\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\r\n * and acts as a bridge between motion values and removeAxisDelta\r\n */\r\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\r\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\r\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\r\n}\r\n\r\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\r\n","import { calcLength } from './delta-calc.mjs';\r\n\r\nfunction isAxisDeltaZero(delta) {\r\n return delta.translate === 0 && delta.scale === 1;\r\n}\r\nfunction isDeltaZero(delta) {\r\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\r\n}\r\nfunction boxEquals(a, b) {\r\n return (a.x.min === b.x.min &&\r\n a.x.max === b.x.max &&\r\n a.y.min === b.y.min &&\r\n a.y.max === b.y.max);\r\n}\r\nfunction boxEqualsRounded(a, b) {\r\n return (Math.round(a.x.min) === Math.round(b.x.min) &&\r\n Math.round(a.x.max) === Math.round(b.x.max) &&\r\n Math.round(a.y.min) === Math.round(b.y.min) &&\r\n Math.round(a.y.max) === Math.round(b.y.max));\r\n}\r\nfunction aspectRatio(box) {\r\n return calcLength(box.x) / calcLength(box.y);\r\n}\r\n\r\nexport { aspectRatio, boxEquals, boxEqualsRounded, isDeltaZero };\r\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\r\n\r\nclass NodeStack {\r\n constructor() {\r\n this.members = [];\r\n }\r\n add(node) {\r\n addUniqueItem(this.members, node);\r\n node.scheduleRender();\r\n }\r\n remove(node) {\r\n removeItem(this.members, node);\r\n if (node === this.prevLead) {\r\n this.prevLead = undefined;\r\n }\r\n if (node === this.lead) {\r\n const prevLead = this.members[this.members.length - 1];\r\n if (prevLead) {\r\n this.promote(prevLead);\r\n }\r\n }\r\n }\r\n relegate(node) {\r\n const indexOfNode = this.members.findIndex((member) => node === member);\r\n if (indexOfNode === 0)\r\n return false;\r\n /**\r\n * Find the next projection node that is present\r\n */\r\n let prevLead;\r\n for (let i = indexOfNode; i >= 0; i--) {\r\n const member = this.members[i];\r\n if (member.isPresent !== false) {\r\n prevLead = member;\r\n break;\r\n }\r\n }\r\n if (prevLead) {\r\n this.promote(prevLead);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n promote(node, preserveFollowOpacity) {\r\n const prevLead = this.lead;\r\n if (node === prevLead)\r\n return;\r\n this.prevLead = prevLead;\r\n this.lead = node;\r\n node.show();\r\n if (prevLead) {\r\n prevLead.instance && prevLead.scheduleRender();\r\n node.scheduleRender();\r\n node.resumeFrom = prevLead;\r\n if (preserveFollowOpacity) {\r\n node.resumeFrom.preserveOpacity = true;\r\n }\r\n if (prevLead.snapshot) {\r\n node.snapshot = prevLead.snapshot;\r\n node.snapshot.latestValues =\r\n prevLead.animationValues || prevLead.latestValues;\r\n }\r\n if (node.root && node.root.isUpdating) {\r\n node.isLayoutDirty = true;\r\n }\r\n const { crossfade } = node.options;\r\n if (crossfade === false) {\r\n prevLead.hide();\r\n }\r\n /**\r\n * TODO:\r\n * - Test border radius when previous node was deleted\r\n * - boxShadow mixing\r\n * - Shared between element A in scrolled container and element B (scroll stays the same or changes)\r\n * - Shared between element A in transformed container and element B (transform stays the same or changes)\r\n * - Shared between element A in scrolled page and element B (scroll stays the same or changes)\r\n * ---\r\n * - Crossfade opacity of root nodes\r\n * - layoutId changes after animation\r\n * - layoutId changes mid animation\r\n */\r\n }\r\n }\r\n exitAnimationComplete() {\r\n this.members.forEach((node) => {\r\n const { options, resumingFrom } = node;\r\n options.onExitComplete && options.onExitComplete();\r\n if (resumingFrom) {\r\n resumingFrom.options.onExitComplete &&\r\n resumingFrom.options.onExitComplete();\r\n }\r\n });\r\n }\r\n scheduleRender() {\r\n this.members.forEach((node) => {\r\n node.instance && node.scheduleRender(false);\r\n });\r\n }\r\n /**\r\n * Clear any leads that have been removed this render to prevent them from being\r\n * used in future animations and to prevent memory leaks\r\n */\r\n removeLeadSnapshot() {\r\n if (this.lead && this.lead.snapshot) {\r\n this.lead.snapshot = undefined;\r\n }\r\n }\r\n}\r\n\r\nexport { NodeStack };\r\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\r\n let transform = \"\";\r\n /**\r\n * The translations we use to calculate are always relative to the viewport coordinate space.\r\n * But when we apply scales, we also scale the coordinate space of an element and its children.\r\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\r\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\r\n */\r\n const xTranslate = delta.x.translate / treeScale.x;\r\n const yTranslate = delta.y.translate / treeScale.y;\r\n if (xTranslate || yTranslate) {\r\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, 0) `;\r\n }\r\n /**\r\n * Apply scale correction for the tree transform.\r\n * This will apply scale to the screen-orientated axes.\r\n */\r\n if (treeScale.x !== 1 || treeScale.y !== 1) {\r\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\r\n }\r\n if (latestTransform) {\r\n const { rotate, rotateX, rotateY } = latestTransform;\r\n if (rotate)\r\n transform += `rotate(${rotate}deg) `;\r\n if (rotateX)\r\n transform += `rotateX(${rotateX}deg) `;\r\n if (rotateY)\r\n transform += `rotateY(${rotateY}deg) `;\r\n }\r\n /**\r\n * Apply scale to match the size of the element to the size we want it.\r\n * This will apply scale to the element-orientated axes.\r\n */\r\n const elementScaleX = delta.x.scale * treeScale.x;\r\n const elementScaleY = delta.y.scale * treeScale.y;\r\n if (elementScaleX !== 1 || elementScaleY !== 1) {\r\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\r\n }\r\n return transform || \"none\";\r\n}\r\n\r\nexport { buildProjectionTransform };\r\n","const compareByDepth = (a, b) => a.depth - b.depth;\r\n\r\nexport { compareByDepth };\r\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\r\nimport { compareByDepth } from './compare-by-depth.mjs';\r\n\r\nclass FlatTree {\r\n constructor() {\r\n this.children = [];\r\n this.isDirty = false;\r\n }\r\n add(child) {\r\n addUniqueItem(this.children, child);\r\n this.isDirty = true;\r\n }\r\n remove(child) {\r\n removeItem(this.children, child);\r\n this.isDirty = true;\r\n }\r\n forEach(callback) {\r\n this.isDirty && this.children.sort(compareByDepth);\r\n this.isDirty = false;\r\n this.children.forEach(callback);\r\n }\r\n}\r\n\r\nexport { FlatTree };\r\n","import { frame, cancelFrame } from '../frameloop/frame.mjs';\r\n\r\n/**\r\n * Timeout defined in ms\r\n */\r\nfunction delay(callback, timeout) {\r\n const start = performance.now();\r\n const checkElapsed = ({ timestamp }) => {\r\n const elapsed = timestamp - start;\r\n if (elapsed >= timeout) {\r\n cancelFrame(checkElapsed);\r\n callback(elapsed - timeout);\r\n }\r\n };\r\n frame.read(checkElapsed, true);\r\n return () => cancelFrame(checkElapsed);\r\n}\r\n\r\nexport { delay };\r\n","function record(data) {\r\n if (window.MotionDebug) {\r\n window.MotionDebug.record(data);\r\n }\r\n}\r\n\r\nexport { record };\r\n","function isSVGElement(element) {\r\n return element instanceof SVGElement && element.tagName !== \"svg\";\r\n}\r\n\r\nexport { isSVGElement };\r\n","import { animateMotionValue } from './motion-value.mjs';\r\nimport { motionValue } from '../../value/index.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction animateSingleValue(value, keyframes, options) {\r\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\r\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\r\n return motionValue$1.animation;\r\n}\r\n\r\nexport { animateSingleValue };\r\n","import { SubscriptionManager } from '../../utils/subscription-manager.mjs';\r\nimport { mixValues } from '../animation/mix-values.mjs';\r\nimport { copyBoxInto } from '../geometry/copy.mjs';\r\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\r\nimport { calcRelativePosition, calcRelativeBox, calcBoxDelta, calcLength, isNear } from '../geometry/delta-calc.mjs';\r\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\r\nimport { createBox, createDelta } from '../geometry/models.mjs';\r\nimport { getValueTransition } from '../../animation/utils/transitions.mjs';\r\nimport { boxEqualsRounded, isDeltaZero, aspectRatio, boxEquals } from '../geometry/utils.mjs';\r\nimport { NodeStack } from '../shared/stack.mjs';\r\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\r\nimport { buildProjectionTransform } from '../styles/transform.mjs';\r\nimport { eachAxis } from '../utils/each-axis.mjs';\r\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\r\nimport { FlatTree } from '../../render/utils/flat-tree.mjs';\r\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\r\nimport { globalProjectionState } from './state.mjs';\r\nimport { delay } from '../../utils/delay.mjs';\r\nimport { mix } from '../../utils/mix.mjs';\r\nimport { record } from '../../debug/record.mjs';\r\nimport { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\r\nimport { animateSingleValue } from '../../animation/interfaces/single-value.mjs';\r\nimport { clamp } from '../../utils/clamp.mjs';\r\nimport { cancelFrame, frameData, steps, frame } from '../../frameloop/frame.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\n\r\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\r\nconst hiddenVisibility = { visibility: \"hidden\" };\r\n/**\r\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\r\n * which has a noticeable difference in spring animations\r\n */\r\nconst animationTarget = 1000;\r\nlet id = 0;\r\n/**\r\n * Use a mutable data object for debug data so as to not create a new\r\n * object every frame.\r\n */\r\nconst projectionFrameData = {\r\n type: \"projectionFrame\",\r\n totalNodes: 0,\r\n resolvedTargetDeltas: 0,\r\n recalculatedProjection: 0,\r\n};\r\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\r\n return class ProjectionNode {\r\n constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {\r\n /**\r\n * A unique ID generated for every projection node.\r\n */\r\n this.id = id++;\r\n /**\r\n * An id that represents a unique session instigated by startUpdate.\r\n */\r\n this.animationId = 0;\r\n /**\r\n * A Set containing all this component's children. This is used to iterate\r\n * through the children.\r\n *\r\n * TODO: This could be faster to iterate as a flat array stored on the root node.\r\n */\r\n this.children = new Set();\r\n /**\r\n * Options for the node. We use this to configure what kind of layout animations\r\n * we should perform (if any).\r\n */\r\n this.options = {};\r\n /**\r\n * We use this to detect when its safe to shut down part of a projection tree.\r\n * We have to keep projecting children for scale correction and relative projection\r\n * until all their parents stop performing layout animations.\r\n */\r\n this.isTreeAnimating = false;\r\n this.isAnimationBlocked = false;\r\n /**\r\n * Flag to true if we think this layout has been changed. We can't always know this,\r\n * currently we set it to true every time a component renders, or if it has a layoutDependency\r\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\r\n * and if one node is dirtied, they all are.\r\n */\r\n this.isLayoutDirty = false;\r\n /**\r\n * Flag to true if we think the projection calculations for this node needs\r\n * recalculating as a result of an updated transform or layout animation.\r\n */\r\n this.isProjectionDirty = false;\r\n /**\r\n * Flag to true if the layout *or* transform has changed. This then gets propagated\r\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\r\n */\r\n this.isSharedProjectionDirty = false;\r\n /**\r\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\r\n * respected by shared nodes.\r\n */\r\n this.isTransformDirty = false;\r\n /**\r\n * Block layout updates for instant layout transitions throughout the tree.\r\n */\r\n this.updateManuallyBlocked = false;\r\n this.updateBlockedByResize = false;\r\n /**\r\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\r\n * call.\r\n */\r\n this.isUpdating = false;\r\n /**\r\n * If this is an SVG element we currently disable projection transforms\r\n */\r\n this.isSVG = false;\r\n /**\r\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\r\n * its projection styles.\r\n */\r\n this.needsReset = false;\r\n /**\r\n * Flags whether this node should have its transform reset prior to measuring.\r\n */\r\n this.shouldResetTransform = false;\r\n /**\r\n * An object representing the calculated contextual/accumulated/tree scale.\r\n * This will be used to scale calculcated projection transforms, as these are\r\n * calculated in screen-space but need to be scaled for elements to layoutly\r\n * make it to their calculated destinations.\r\n *\r\n * TODO: Lazy-init\r\n */\r\n this.treeScale = { x: 1, y: 1 };\r\n /**\r\n *\r\n */\r\n this.eventHandlers = new Map();\r\n this.hasTreeAnimated = false;\r\n // Note: Currently only running on root node\r\n this.updateScheduled = false;\r\n this.projectionUpdateScheduled = false;\r\n this.checkUpdateFailed = () => {\r\n if (this.isUpdating) {\r\n this.isUpdating = false;\r\n this.clearAllSnapshots();\r\n }\r\n };\r\n /**\r\n * This is a multi-step process as shared nodes might be of different depths. Nodes\r\n * are sorted by depth order, so we need to resolve the entire tree before moving to\r\n * the next step.\r\n */\r\n this.updateProjection = () => {\r\n this.projectionUpdateScheduled = false;\r\n /**\r\n * Reset debug counts. Manually resetting rather than creating a new\r\n * object each frame.\r\n */\r\n projectionFrameData.totalNodes =\r\n projectionFrameData.resolvedTargetDeltas =\r\n projectionFrameData.recalculatedProjection =\r\n 0;\r\n this.nodes.forEach(propagateDirtyNodes);\r\n this.nodes.forEach(resolveTargetDelta);\r\n this.nodes.forEach(calcProjection);\r\n this.nodes.forEach(cleanDirtyNodes);\r\n record(projectionFrameData);\r\n };\r\n this.hasProjected = false;\r\n this.isVisible = true;\r\n this.animationProgress = 0;\r\n /**\r\n * Shared layout\r\n */\r\n // TODO Only running on root node\r\n this.sharedNodes = new Map();\r\n this.latestValues = latestValues;\r\n this.root = parent ? parent.root || parent : this;\r\n this.path = parent ? [...parent.path, parent] : [];\r\n this.parent = parent;\r\n this.depth = parent ? parent.depth + 1 : 0;\r\n for (let i = 0; i < this.path.length; i++) {\r\n this.path[i].shouldResetTransform = true;\r\n }\r\n if (this.root === this)\r\n this.nodes = new FlatTree();\r\n }\r\n addEventListener(name, handler) {\r\n if (!this.eventHandlers.has(name)) {\r\n this.eventHandlers.set(name, new SubscriptionManager());\r\n }\r\n return this.eventHandlers.get(name).add(handler);\r\n }\r\n notifyListeners(name, ...args) {\r\n const subscriptionManager = this.eventHandlers.get(name);\r\n subscriptionManager && subscriptionManager.notify(...args);\r\n }\r\n hasListeners(name) {\r\n return this.eventHandlers.has(name);\r\n }\r\n /**\r\n * Lifecycles\r\n */\r\n mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {\r\n if (this.instance)\r\n return;\r\n this.isSVG = isSVGElement(instance);\r\n this.instance = instance;\r\n const { layoutId, layout, visualElement } = this.options;\r\n if (visualElement && !visualElement.current) {\r\n visualElement.mount(instance);\r\n }\r\n this.root.nodes.add(this);\r\n this.parent && this.parent.children.add(this);\r\n if (isLayoutDirty && (layout || layoutId)) {\r\n this.isLayoutDirty = true;\r\n }\r\n if (attachResizeListener) {\r\n let cancelDelay;\r\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\r\n attachResizeListener(instance, () => {\r\n this.root.updateBlockedByResize = true;\r\n cancelDelay && cancelDelay();\r\n cancelDelay = delay(resizeUnblockUpdate, 250);\r\n if (globalProjectionState.hasAnimatedSinceResize) {\r\n globalProjectionState.hasAnimatedSinceResize = false;\r\n this.nodes.forEach(finishAnimation);\r\n }\r\n });\r\n }\r\n if (layoutId) {\r\n this.root.registerSharedNode(layoutId, this);\r\n }\r\n // Only register the handler if it requires layout animation\r\n if (this.options.animate !== false &&\r\n visualElement &&\r\n (layoutId || layout)) {\r\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {\r\n if (this.isTreeAnimationBlocked()) {\r\n this.target = undefined;\r\n this.relativeTarget = undefined;\r\n return;\r\n }\r\n // TODO: Check here if an animation exists\r\n const layoutTransition = this.options.transition ||\r\n visualElement.getDefaultTransition() ||\r\n defaultLayoutTransition;\r\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\r\n /**\r\n * The target layout of the element might stay the same,\r\n * but its position relative to its parent has changed.\r\n */\r\n const targetChanged = !this.targetLayout ||\r\n !boxEqualsRounded(this.targetLayout, newLayout) ||\r\n hasRelativeTargetChanged;\r\n /**\r\n * If the layout hasn't seemed to have changed, it might be that the\r\n * element is visually in the same place in the document but its position\r\n * relative to its parent has indeed changed. So here we check for that.\r\n */\r\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;\r\n if (this.options.layoutRoot ||\r\n (this.resumeFrom && this.resumeFrom.instance) ||\r\n hasOnlyRelativeTargetChanged ||\r\n (hasLayoutChanged &&\r\n (targetChanged || !this.currentAnimation))) {\r\n if (this.resumeFrom) {\r\n this.resumingFrom = this.resumeFrom;\r\n this.resumingFrom.resumingFrom = undefined;\r\n }\r\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\r\n const animationOptions = {\r\n ...getValueTransition(layoutTransition, \"layout\"),\r\n onPlay: onLayoutAnimationStart,\r\n onComplete: onLayoutAnimationComplete,\r\n };\r\n if (visualElement.shouldReduceMotion ||\r\n this.options.layoutRoot) {\r\n animationOptions.delay = 0;\r\n animationOptions.type = false;\r\n }\r\n this.startAnimation(animationOptions);\r\n }\r\n else {\r\n /**\r\n * If the layout hasn't changed and we have an animation that hasn't started yet,\r\n * finish it immediately. Otherwise it will be animating from a location\r\n * that was probably never commited to screen and look like a jumpy box.\r\n */\r\n if (!hasLayoutChanged) {\r\n finishAnimation(this);\r\n }\r\n if (this.isLead() && this.options.onExitComplete) {\r\n this.options.onExitComplete();\r\n }\r\n }\r\n this.targetLayout = newLayout;\r\n });\r\n }\r\n }\r\n unmount() {\r\n this.options.layoutId && this.willUpdate();\r\n this.root.nodes.remove(this);\r\n const stack = this.getStack();\r\n stack && stack.remove(this);\r\n this.parent && this.parent.children.delete(this);\r\n this.instance = undefined;\r\n cancelFrame(this.updateProjection);\r\n }\r\n // only on the root\r\n blockUpdate() {\r\n this.updateManuallyBlocked = true;\r\n }\r\n unblockUpdate() {\r\n this.updateManuallyBlocked = false;\r\n }\r\n isUpdateBlocked() {\r\n return this.updateManuallyBlocked || this.updateBlockedByResize;\r\n }\r\n isTreeAnimationBlocked() {\r\n return (this.isAnimationBlocked ||\r\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\r\n false);\r\n }\r\n // Note: currently only running on root node\r\n startUpdate() {\r\n if (this.isUpdateBlocked())\r\n return;\r\n this.isUpdating = true;\r\n this.nodes && this.nodes.forEach(resetRotation);\r\n this.animationId++;\r\n }\r\n getTransformTemplate() {\r\n const { visualElement } = this.options;\r\n return visualElement && visualElement.getProps().transformTemplate;\r\n }\r\n willUpdate(shouldNotifyListeners = true) {\r\n this.root.hasTreeAnimated = true;\r\n if (this.root.isUpdateBlocked()) {\r\n this.options.onExitComplete && this.options.onExitComplete();\r\n return;\r\n }\r\n !this.root.isUpdating && this.root.startUpdate();\r\n if (this.isLayoutDirty)\r\n return;\r\n this.isLayoutDirty = true;\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n node.shouldResetTransform = true;\r\n node.updateScroll(\"snapshot\");\r\n if (node.options.layoutRoot) {\r\n node.willUpdate(false);\r\n }\r\n }\r\n const { layoutId, layout } = this.options;\r\n if (layoutId === undefined && !layout)\r\n return;\r\n const transformTemplate = this.getTransformTemplate();\r\n this.prevTransformTemplateValue = transformTemplate\r\n ? transformTemplate(this.latestValues, \"\")\r\n : undefined;\r\n this.updateSnapshot();\r\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\r\n }\r\n update() {\r\n this.updateScheduled = false;\r\n const updateWasBlocked = this.isUpdateBlocked();\r\n // When doing an instant transition, we skip the layout update,\r\n // but should still clean up the measurements so that the next\r\n // snapshot could be taken correctly.\r\n if (updateWasBlocked) {\r\n this.unblockUpdate();\r\n this.clearAllSnapshots();\r\n this.nodes.forEach(clearMeasurements);\r\n return;\r\n }\r\n if (!this.isUpdating) {\r\n this.nodes.forEach(clearIsLayoutDirty);\r\n }\r\n this.isUpdating = false;\r\n /**\r\n * Write\r\n */\r\n this.nodes.forEach(resetTransformStyle);\r\n /**\r\n * Read ==================\r\n */\r\n // Update layout measurements of updated children\r\n this.nodes.forEach(updateLayout);\r\n /**\r\n * Write\r\n */\r\n // Notify listeners that the layout is updated\r\n this.nodes.forEach(notifyLayoutUpdate);\r\n this.clearAllSnapshots();\r\n /**\r\n * Manually flush any pending updates. Ideally\r\n * we could leave this to the following requestAnimationFrame but this seems\r\n * to leave a flash of incorrectly styled content.\r\n */\r\n const now = performance.now();\r\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\r\n frameData.timestamp = now;\r\n frameData.isProcessing = true;\r\n steps.update.process(frameData);\r\n steps.preRender.process(frameData);\r\n steps.render.process(frameData);\r\n frameData.isProcessing = false;\r\n }\r\n didUpdate() {\r\n if (!this.updateScheduled) {\r\n this.updateScheduled = true;\r\n queueMicrotask(() => this.update());\r\n }\r\n }\r\n clearAllSnapshots() {\r\n this.nodes.forEach(clearSnapshot);\r\n this.sharedNodes.forEach(removeLeadSnapshots);\r\n }\r\n scheduleUpdateProjection() {\r\n if (!this.projectionUpdateScheduled) {\r\n this.projectionUpdateScheduled = true;\r\n frame.preRender(this.updateProjection, false, true);\r\n }\r\n }\r\n scheduleCheckAfterUnmount() {\r\n /**\r\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\r\n * we manually call didUpdate to give a chance to the siblings to animate.\r\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\r\n */\r\n frame.postRender(() => {\r\n if (this.isLayoutDirty) {\r\n this.root.didUpdate();\r\n }\r\n else {\r\n this.root.checkUpdateFailed();\r\n }\r\n });\r\n }\r\n /**\r\n * Update measurements\r\n */\r\n updateSnapshot() {\r\n if (this.snapshot || !this.instance)\r\n return;\r\n this.snapshot = this.measure();\r\n }\r\n updateLayout() {\r\n if (!this.instance)\r\n return;\r\n // TODO: Incorporate into a forwarded scroll offset\r\n this.updateScroll();\r\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\r\n !this.isLayoutDirty) {\r\n return;\r\n }\r\n /**\r\n * When a node is mounted, it simply resumes from the prevLead's\r\n * snapshot instead of taking a new one, but the ancestors scroll\r\n * might have updated while the prevLead is unmounted. We need to\r\n * update the scroll again to make sure the layout we measure is\r\n * up to date.\r\n */\r\n if (this.resumeFrom && !this.resumeFrom.instance) {\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n node.updateScroll();\r\n }\r\n }\r\n const prevLayout = this.layout;\r\n this.layout = this.measure(false);\r\n this.layoutCorrected = createBox();\r\n this.isLayoutDirty = false;\r\n this.projectionDelta = undefined;\r\n this.notifyListeners(\"measure\", this.layout.layoutBox);\r\n const { visualElement } = this.options;\r\n visualElement &&\r\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\r\n }\r\n updateScroll(phase = \"measure\") {\r\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\r\n if (this.scroll &&\r\n this.scroll.animationId === this.root.animationId &&\r\n this.scroll.phase === phase) {\r\n needsMeasurement = false;\r\n }\r\n if (needsMeasurement) {\r\n this.scroll = {\r\n animationId: this.root.animationId,\r\n phase,\r\n isRoot: checkIsScrollRoot(this.instance),\r\n offset: measureScroll(this.instance),\r\n };\r\n }\r\n }\r\n resetTransform() {\r\n if (!resetTransform)\r\n return;\r\n const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;\r\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\r\n const transformTemplate = this.getTransformTemplate();\r\n const transformTemplateValue = transformTemplate\r\n ? transformTemplate(this.latestValues, \"\")\r\n : undefined;\r\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\r\n if (isResetRequested &&\r\n (hasProjection ||\r\n hasTransform(this.latestValues) ||\r\n transformTemplateHasChanged)) {\r\n resetTransform(this.instance, transformTemplateValue);\r\n this.shouldResetTransform = false;\r\n this.scheduleRender();\r\n }\r\n }\r\n measure(removeTransform = true) {\r\n const pageBox = this.measurePageBox();\r\n let layoutBox = this.removeElementScroll(pageBox);\r\n /**\r\n * Measurements taken during the pre-render stage\r\n * still have transforms applied so we remove them\r\n * via calculation.\r\n */\r\n if (removeTransform) {\r\n layoutBox = this.removeTransform(layoutBox);\r\n }\r\n roundBox(layoutBox);\r\n return {\r\n animationId: this.root.animationId,\r\n measuredBox: pageBox,\r\n layoutBox,\r\n latestValues: {},\r\n source: this.id,\r\n };\r\n }\r\n measurePageBox() {\r\n const { visualElement } = this.options;\r\n if (!visualElement)\r\n return createBox();\r\n const box = visualElement.measureViewportBox();\r\n // Remove viewport scroll to give page-relative coordinates\r\n const { scroll } = this.root;\r\n if (scroll) {\r\n translateAxis(box.x, scroll.offset.x);\r\n translateAxis(box.y, scroll.offset.y);\r\n }\r\n return box;\r\n }\r\n removeElementScroll(box) {\r\n const boxWithoutScroll = createBox();\r\n copyBoxInto(boxWithoutScroll, box);\r\n /**\r\n * Performance TODO: Keep a cumulative scroll offset down the tree\r\n * rather than loop back up the path.\r\n */\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n const { scroll, options } = node;\r\n if (node !== this.root && scroll && options.layoutScroll) {\r\n /**\r\n * If this is a new scroll root, we want to remove all previous scrolls\r\n * from the viewport box.\r\n */\r\n if (scroll.isRoot) {\r\n copyBoxInto(boxWithoutScroll, box);\r\n const { scroll: rootScroll } = this.root;\r\n /**\r\n * Undo the application of page scroll that was originally added\r\n * to the measured bounding box.\r\n */\r\n if (rootScroll) {\r\n translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);\r\n translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);\r\n }\r\n }\r\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\r\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\r\n }\r\n }\r\n return boxWithoutScroll;\r\n }\r\n applyTransform(box, transformOnly = false) {\r\n const withTransforms = createBox();\r\n copyBoxInto(withTransforms, box);\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n if (!transformOnly &&\r\n node.options.layoutScroll &&\r\n node.scroll &&\r\n node !== node.root) {\r\n transformBox(withTransforms, {\r\n x: -node.scroll.offset.x,\r\n y: -node.scroll.offset.y,\r\n });\r\n }\r\n if (!hasTransform(node.latestValues))\r\n continue;\r\n transformBox(withTransforms, node.latestValues);\r\n }\r\n if (hasTransform(this.latestValues)) {\r\n transformBox(withTransforms, this.latestValues);\r\n }\r\n return withTransforms;\r\n }\r\n removeTransform(box) {\r\n const boxWithoutTransform = createBox();\r\n copyBoxInto(boxWithoutTransform, box);\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n if (!node.instance)\r\n continue;\r\n if (!hasTransform(node.latestValues))\r\n continue;\r\n hasScale(node.latestValues) && node.updateSnapshot();\r\n const sourceBox = createBox();\r\n const nodeBox = node.measurePageBox();\r\n copyBoxInto(sourceBox, nodeBox);\r\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\r\n }\r\n if (hasTransform(this.latestValues)) {\r\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\r\n }\r\n return boxWithoutTransform;\r\n }\r\n setTargetDelta(delta) {\r\n this.targetDelta = delta;\r\n this.root.scheduleUpdateProjection();\r\n this.isProjectionDirty = true;\r\n }\r\n setOptions(options) {\r\n this.options = {\r\n ...this.options,\r\n ...options,\r\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\r\n };\r\n }\r\n clearMeasurements() {\r\n this.scroll = undefined;\r\n this.layout = undefined;\r\n this.snapshot = undefined;\r\n this.prevTransformTemplateValue = undefined;\r\n this.targetDelta = undefined;\r\n this.target = undefined;\r\n this.isLayoutDirty = false;\r\n }\r\n forceRelativeParentToResolveTarget() {\r\n if (!this.relativeParent)\r\n return;\r\n /**\r\n * If the parent target isn't up-to-date, force it to update.\r\n * This is an unfortunate de-optimisation as it means any updating relative\r\n * projection will cause all the relative parents to recalculate back\r\n * up the tree.\r\n */\r\n if (this.relativeParent.resolvedRelativeTargetAt !==\r\n frameData.timestamp) {\r\n this.relativeParent.resolveTargetDelta(true);\r\n }\r\n }\r\n resolveTargetDelta(forceRecalculation = false) {\r\n var _a;\r\n /**\r\n * Once the dirty status of nodes has been spread through the tree, we also\r\n * need to check if we have a shared node of a different depth that has itself\r\n * been dirtied.\r\n */\r\n const lead = this.getLead();\r\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\r\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\r\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\r\n const isShared = Boolean(this.resumingFrom) || this !== lead;\r\n /**\r\n * We don't use transform for this step of processing so we don't\r\n * need to check whether any nodes have changed transform.\r\n */\r\n const canSkip = !(forceRecalculation ||\r\n (isShared && this.isSharedProjectionDirty) ||\r\n this.isProjectionDirty ||\r\n ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||\r\n this.attemptToResolveRelativeTarget);\r\n if (canSkip)\r\n return;\r\n const { layout, layoutId } = this.options;\r\n /**\r\n * If we have no layout, we can't perform projection, so early return\r\n */\r\n if (!this.layout || !(layout || layoutId))\r\n return;\r\n this.resolvedRelativeTargetAt = frameData.timestamp;\r\n /**\r\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\r\n * a relativeParent. This will allow a component to perform scale correction\r\n * even if no animation has started.\r\n */\r\n // TODO If this is unsuccessful this currently happens every frame\r\n if (!this.targetDelta && !this.relativeTarget) {\r\n // TODO: This is a semi-repetition of further down this function, make DRY\r\n const relativeParent = this.getClosestProjectingParent();\r\n if (relativeParent &&\r\n relativeParent.layout &&\r\n this.animationProgress !== 1) {\r\n this.relativeParent = relativeParent;\r\n this.forceRelativeParentToResolveTarget();\r\n this.relativeTarget = createBox();\r\n this.relativeTargetOrigin = createBox();\r\n calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);\r\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\r\n }\r\n else {\r\n this.relativeParent = this.relativeTarget = undefined;\r\n }\r\n }\r\n /**\r\n * If we have no relative target or no target delta our target isn't valid\r\n * for this frame.\r\n */\r\n if (!this.relativeTarget && !this.targetDelta)\r\n return;\r\n /**\r\n * Lazy-init target data structure\r\n */\r\n if (!this.target) {\r\n this.target = createBox();\r\n this.targetWithTransforms = createBox();\r\n }\r\n /**\r\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\r\n */\r\n if (this.relativeTarget &&\r\n this.relativeTargetOrigin &&\r\n this.relativeParent &&\r\n this.relativeParent.target) {\r\n this.forceRelativeParentToResolveTarget();\r\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\r\n /**\r\n * If we've only got a targetDelta, resolve it into a target\r\n */\r\n }\r\n else if (this.targetDelta) {\r\n if (Boolean(this.resumingFrom)) {\r\n // TODO: This is creating a new object every frame\r\n this.target = this.applyTransform(this.layout.layoutBox);\r\n }\r\n else {\r\n copyBoxInto(this.target, this.layout.layoutBox);\r\n }\r\n applyBoxDelta(this.target, this.targetDelta);\r\n }\r\n else {\r\n /**\r\n * If no target, use own layout as target\r\n */\r\n copyBoxInto(this.target, this.layout.layoutBox);\r\n }\r\n /**\r\n * If we've been told to attempt to resolve a relative target, do so.\r\n */\r\n if (this.attemptToResolveRelativeTarget) {\r\n this.attemptToResolveRelativeTarget = false;\r\n const relativeParent = this.getClosestProjectingParent();\r\n if (relativeParent &&\r\n Boolean(relativeParent.resumingFrom) ===\r\n Boolean(this.resumingFrom) &&\r\n !relativeParent.options.layoutScroll &&\r\n relativeParent.target &&\r\n this.animationProgress !== 1) {\r\n this.relativeParent = relativeParent;\r\n this.forceRelativeParentToResolveTarget();\r\n this.relativeTarget = createBox();\r\n this.relativeTargetOrigin = createBox();\r\n calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);\r\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\r\n }\r\n else {\r\n this.relativeParent = this.relativeTarget = undefined;\r\n }\r\n }\r\n /**\r\n * Increase debug counter for resolved target deltas\r\n */\r\n projectionFrameData.resolvedTargetDeltas++;\r\n }\r\n getClosestProjectingParent() {\r\n if (!this.parent ||\r\n hasScale(this.parent.latestValues) ||\r\n has2DTranslate(this.parent.latestValues)) {\r\n return undefined;\r\n }\r\n if (this.parent.isProjecting()) {\r\n return this.parent;\r\n }\r\n else {\r\n return this.parent.getClosestProjectingParent();\r\n }\r\n }\r\n isProjecting() {\r\n return Boolean((this.relativeTarget ||\r\n this.targetDelta ||\r\n this.options.layoutRoot) &&\r\n this.layout);\r\n }\r\n calcProjection() {\r\n var _a;\r\n const lead = this.getLead();\r\n const isShared = Boolean(this.resumingFrom) || this !== lead;\r\n let canSkip = true;\r\n /**\r\n * If this is a normal layout animation and neither this node nor its nearest projecting\r\n * is dirty then we can't skip.\r\n */\r\n if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {\r\n canSkip = false;\r\n }\r\n /**\r\n * If this is a shared layout animation and this node's shared projection is dirty then\r\n * we can't skip.\r\n */\r\n if (isShared &&\r\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\r\n canSkip = false;\r\n }\r\n /**\r\n * If we have resolved the target this frame we must recalculate the\r\n * projection to ensure it visually represents the internal calculations.\r\n */\r\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\r\n canSkip = false;\r\n }\r\n if (canSkip)\r\n return;\r\n const { layout, layoutId } = this.options;\r\n /**\r\n * If this section of the tree isn't animating we can\r\n * delete our target sources for the following frame.\r\n */\r\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\r\n this.currentAnimation ||\r\n this.pendingAnimation);\r\n if (!this.isTreeAnimating) {\r\n this.targetDelta = this.relativeTarget = undefined;\r\n }\r\n if (!this.layout || !(layout || layoutId))\r\n return;\r\n /**\r\n * Reset the corrected box with the latest values from box, as we're then going\r\n * to perform mutative operations on it.\r\n */\r\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\r\n /**\r\n * Record previous tree scales before updating.\r\n */\r\n const prevTreeScaleX = this.treeScale.x;\r\n const prevTreeScaleY = this.treeScale.y;\r\n /**\r\n * Apply all the parent deltas to this box to produce the corrected box. This\r\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\r\n */\r\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\r\n /**\r\n * If this layer needs to perform scale correction but doesn't have a target,\r\n * use the layout as the target.\r\n */\r\n if (lead.layout &&\r\n !lead.target &&\r\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\r\n lead.target = lead.layout.layoutBox;\r\n }\r\n const { target } = lead;\r\n if (!target) {\r\n /**\r\n * If we don't have a target to project into, but we were previously\r\n * projecting, we want to remove the stored transform and schedule\r\n * a render to ensure the elements reflect the removed transform.\r\n */\r\n if (this.projectionTransform) {\r\n this.projectionDelta = createDelta();\r\n this.projectionTransform = \"none\";\r\n this.scheduleRender();\r\n }\r\n return;\r\n }\r\n if (!this.projectionDelta) {\r\n this.projectionDelta = createDelta();\r\n this.projectionDeltaWithTransform = createDelta();\r\n }\r\n const prevProjectionTransform = this.projectionTransform;\r\n /**\r\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\r\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\r\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\r\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\r\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\r\n * to allow people to choose whether these styles are corrected based on just the\r\n * layout reprojection or the final bounding box.\r\n */\r\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\r\n this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale);\r\n if (this.projectionTransform !== prevProjectionTransform ||\r\n this.treeScale.x !== prevTreeScaleX ||\r\n this.treeScale.y !== prevTreeScaleY) {\r\n this.hasProjected = true;\r\n this.scheduleRender();\r\n this.notifyListeners(\"projectionUpdate\", target);\r\n }\r\n /**\r\n * Increase debug counter for recalculated projections\r\n */\r\n projectionFrameData.recalculatedProjection++;\r\n }\r\n hide() {\r\n this.isVisible = false;\r\n // TODO: Schedule render\r\n }\r\n show() {\r\n this.isVisible = true;\r\n // TODO: Schedule render\r\n }\r\n scheduleRender(notifyAll = true) {\r\n this.options.scheduleRender && this.options.scheduleRender();\r\n if (notifyAll) {\r\n const stack = this.getStack();\r\n stack && stack.scheduleRender();\r\n }\r\n if (this.resumingFrom && !this.resumingFrom.instance) {\r\n this.resumingFrom = undefined;\r\n }\r\n }\r\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\r\n const snapshot = this.snapshot;\r\n const snapshotLatestValues = snapshot\r\n ? snapshot.latestValues\r\n : {};\r\n const mixedValues = { ...this.latestValues };\r\n const targetDelta = createDelta();\r\n if (!this.relativeParent ||\r\n !this.relativeParent.options.layoutRoot) {\r\n this.relativeTarget = this.relativeTargetOrigin = undefined;\r\n }\r\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\r\n const relativeLayout = createBox();\r\n const snapshotSource = snapshot ? snapshot.source : undefined;\r\n const layoutSource = this.layout ? this.layout.source : undefined;\r\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\r\n const stack = this.getStack();\r\n const isOnlyMember = !stack || stack.members.length <= 1;\r\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\r\n !isOnlyMember &&\r\n this.options.crossfade === true &&\r\n !this.path.some(hasOpacityCrossfade));\r\n this.animationProgress = 0;\r\n let prevRelativeTarget;\r\n this.mixTargetDelta = (latest) => {\r\n const progress = latest / 1000;\r\n mixAxisDelta(targetDelta.x, delta.x, progress);\r\n mixAxisDelta(targetDelta.y, delta.y, progress);\r\n this.setTargetDelta(targetDelta);\r\n if (this.relativeTarget &&\r\n this.relativeTargetOrigin &&\r\n this.layout &&\r\n this.relativeParent &&\r\n this.relativeParent.layout) {\r\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\r\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\r\n /**\r\n * If this is an unchanged relative target we can consider the\r\n * projection not dirty.\r\n */\r\n if (prevRelativeTarget &&\r\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\r\n this.isProjectionDirty = false;\r\n }\r\n if (!prevRelativeTarget)\r\n prevRelativeTarget = createBox();\r\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\r\n }\r\n if (isSharedLayoutAnimation) {\r\n this.animationValues = mixedValues;\r\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\r\n }\r\n this.root.scheduleUpdateProjection();\r\n this.scheduleRender();\r\n this.animationProgress = progress;\r\n };\r\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\r\n }\r\n startAnimation(options) {\r\n this.notifyListeners(\"animationStart\");\r\n this.currentAnimation && this.currentAnimation.stop();\r\n if (this.resumingFrom && this.resumingFrom.currentAnimation) {\r\n this.resumingFrom.currentAnimation.stop();\r\n }\r\n if (this.pendingAnimation) {\r\n cancelFrame(this.pendingAnimation);\r\n this.pendingAnimation = undefined;\r\n }\r\n /**\r\n * Start the animation in the next frame to have a frame with progress 0,\r\n * where the target is the same as when the animation started, so we can\r\n * calculate the relative positions correctly for instant transitions.\r\n */\r\n this.pendingAnimation = frame.update(() => {\r\n globalProjectionState.hasAnimatedSinceResize = true;\r\n this.currentAnimation = animateSingleValue(0, animationTarget, {\r\n ...options,\r\n onUpdate: (latest) => {\r\n this.mixTargetDelta(latest);\r\n options.onUpdate && options.onUpdate(latest);\r\n },\r\n onComplete: () => {\r\n options.onComplete && options.onComplete();\r\n this.completeAnimation();\r\n },\r\n });\r\n if (this.resumingFrom) {\r\n this.resumingFrom.currentAnimation = this.currentAnimation;\r\n }\r\n this.pendingAnimation = undefined;\r\n });\r\n }\r\n completeAnimation() {\r\n if (this.resumingFrom) {\r\n this.resumingFrom.currentAnimation = undefined;\r\n this.resumingFrom.preserveOpacity = undefined;\r\n }\r\n const stack = this.getStack();\r\n stack && stack.exitAnimationComplete();\r\n this.resumingFrom =\r\n this.currentAnimation =\r\n this.animationValues =\r\n undefined;\r\n this.notifyListeners(\"animationComplete\");\r\n }\r\n finishAnimation() {\r\n if (this.currentAnimation) {\r\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\r\n this.currentAnimation.stop();\r\n }\r\n this.completeAnimation();\r\n }\r\n applyTransformsToTarget() {\r\n const lead = this.getLead();\r\n let { targetWithTransforms, target, layout, latestValues } = lead;\r\n if (!targetWithTransforms || !target || !layout)\r\n return;\r\n /**\r\n * If we're only animating position, and this element isn't the lead element,\r\n * then instead of projecting into the lead box we instead want to calculate\r\n * a new target that aligns the two boxes but maintains the layout shape.\r\n */\r\n if (this !== lead &&\r\n this.layout &&\r\n layout &&\r\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\r\n target = this.target || createBox();\r\n const xLength = calcLength(this.layout.layoutBox.x);\r\n target.x.min = lead.target.x.min;\r\n target.x.max = target.x.min + xLength;\r\n const yLength = calcLength(this.layout.layoutBox.y);\r\n target.y.min = lead.target.y.min;\r\n target.y.max = target.y.min + yLength;\r\n }\r\n copyBoxInto(targetWithTransforms, target);\r\n /**\r\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\r\n * This is the final box that we will then project into by calculating a transform delta and\r\n * applying it to the corrected box.\r\n */\r\n transformBox(targetWithTransforms, latestValues);\r\n /**\r\n * Update the delta between the corrected box and the final target box, after\r\n * user-set transforms are applied to it. This will be used by the renderer to\r\n * create a transform style that will reproject the element from its layout layout\r\n * into the desired bounding box.\r\n */\r\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\r\n }\r\n registerSharedNode(layoutId, node) {\r\n if (!this.sharedNodes.has(layoutId)) {\r\n this.sharedNodes.set(layoutId, new NodeStack());\r\n }\r\n const stack = this.sharedNodes.get(layoutId);\r\n stack.add(node);\r\n const config = node.options.initialPromotionConfig;\r\n node.promote({\r\n transition: config ? config.transition : undefined,\r\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\r\n ? config.shouldPreserveFollowOpacity(node)\r\n : undefined,\r\n });\r\n }\r\n isLead() {\r\n const stack = this.getStack();\r\n return stack ? stack.lead === this : true;\r\n }\r\n getLead() {\r\n var _a;\r\n const { layoutId } = this.options;\r\n return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;\r\n }\r\n getPrevLead() {\r\n var _a;\r\n const { layoutId } = this.options;\r\n return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;\r\n }\r\n getStack() {\r\n const { layoutId } = this.options;\r\n if (layoutId)\r\n return this.root.sharedNodes.get(layoutId);\r\n }\r\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\r\n const stack = this.getStack();\r\n if (stack)\r\n stack.promote(this, preserveFollowOpacity);\r\n if (needsReset) {\r\n this.projectionDelta = undefined;\r\n this.needsReset = true;\r\n }\r\n if (transition)\r\n this.setOptions({ transition });\r\n }\r\n relegate() {\r\n const stack = this.getStack();\r\n if (stack) {\r\n return stack.relegate(this);\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n resetRotation() {\r\n const { visualElement } = this.options;\r\n if (!visualElement)\r\n return;\r\n // If there's no detected rotation values, we can early return without a forced render.\r\n let hasRotate = false;\r\n /**\r\n * An unrolled check for rotation values. Most elements don't have any rotation and\r\n * skipping the nested loop and new object creation is 50% faster.\r\n */\r\n const { latestValues } = visualElement;\r\n if (latestValues.rotate ||\r\n latestValues.rotateX ||\r\n latestValues.rotateY ||\r\n latestValues.rotateZ) {\r\n hasRotate = true;\r\n }\r\n // If there's no rotation values, we don't need to do any more.\r\n if (!hasRotate)\r\n return;\r\n const resetValues = {};\r\n // Check the rotate value of all axes and reset to 0\r\n for (let i = 0; i < transformAxes.length; i++) {\r\n const key = \"rotate\" + transformAxes[i];\r\n // Record the rotation and then temporarily set it to 0\r\n if (latestValues[key]) {\r\n resetValues[key] = latestValues[key];\r\n visualElement.setStaticValue(key, 0);\r\n }\r\n }\r\n // Force a render of this element to apply the transform with all rotations\r\n // set to 0.\r\n visualElement.render();\r\n // Put back all the values we reset\r\n for (const key in resetValues) {\r\n visualElement.setStaticValue(key, resetValues[key]);\r\n }\r\n // Schedule a render for the next frame. This ensures we won't visually\r\n // see the element with the reset rotate value applied.\r\n visualElement.scheduleRender();\r\n }\r\n getProjectionStyles(styleProp) {\r\n var _a, _b;\r\n if (!this.instance || this.isSVG)\r\n return undefined;\r\n if (!this.isVisible) {\r\n return hiddenVisibility;\r\n }\r\n const styles = {\r\n visibility: \"\",\r\n };\r\n const transformTemplate = this.getTransformTemplate();\r\n if (this.needsReset) {\r\n this.needsReset = false;\r\n styles.opacity = \"\";\r\n styles.pointerEvents =\r\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\r\n styles.transform = transformTemplate\r\n ? transformTemplate(this.latestValues, \"\")\r\n : \"none\";\r\n return styles;\r\n }\r\n const lead = this.getLead();\r\n if (!this.projectionDelta || !this.layout || !lead.target) {\r\n const emptyStyles = {};\r\n if (this.options.layoutId) {\r\n emptyStyles.opacity =\r\n this.latestValues.opacity !== undefined\r\n ? this.latestValues.opacity\r\n : 1;\r\n emptyStyles.pointerEvents =\r\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\r\n }\r\n if (this.hasProjected && !hasTransform(this.latestValues)) {\r\n emptyStyles.transform = transformTemplate\r\n ? transformTemplate({}, \"\")\r\n : \"none\";\r\n this.hasProjected = false;\r\n }\r\n return emptyStyles;\r\n }\r\n const valuesToRender = lead.animationValues || lead.latestValues;\r\n this.applyTransformsToTarget();\r\n styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\r\n if (transformTemplate) {\r\n styles.transform = transformTemplate(valuesToRender, styles.transform);\r\n }\r\n const { x, y } = this.projectionDelta;\r\n styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\r\n if (lead.animationValues) {\r\n /**\r\n * If the lead component is animating, assign this either the entering/leaving\r\n * opacity\r\n */\r\n styles.opacity =\r\n lead === this\r\n ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1\r\n : this.preserveOpacity\r\n ? this.latestValues.opacity\r\n : valuesToRender.opacityExit;\r\n }\r\n else {\r\n /**\r\n * Or we're not animating at all, set the lead component to its layout\r\n * opacity and other components to hidden.\r\n */\r\n styles.opacity =\r\n lead === this\r\n ? valuesToRender.opacity !== undefined\r\n ? valuesToRender.opacity\r\n : \"\"\r\n : valuesToRender.opacityExit !== undefined\r\n ? valuesToRender.opacityExit\r\n : 0;\r\n }\r\n /**\r\n * Apply scale correction\r\n */\r\n for (const key in scaleCorrectors) {\r\n if (valuesToRender[key] === undefined)\r\n continue;\r\n const { correct, applyTo } = scaleCorrectors[key];\r\n /**\r\n * Only apply scale correction to the value if we have an\r\n * active projection transform. Otherwise these values become\r\n * vulnerable to distortion if the element changes size without\r\n * a corresponding layout animation.\r\n */\r\n const corrected = styles.transform === \"none\"\r\n ? valuesToRender[key]\r\n : correct(valuesToRender[key], lead);\r\n if (applyTo) {\r\n const num = applyTo.length;\r\n for (let i = 0; i < num; i++) {\r\n styles[applyTo[i]] = corrected;\r\n }\r\n }\r\n else {\r\n styles[key] = corrected;\r\n }\r\n }\r\n /**\r\n * Disable pointer events on follow components. This is to ensure\r\n * that if a follow component covers a lead component it doesn't block\r\n * pointer events on the lead.\r\n */\r\n if (this.options.layoutId) {\r\n styles.pointerEvents =\r\n lead === this\r\n ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\"\r\n : \"none\";\r\n }\r\n return styles;\r\n }\r\n clearSnapshot() {\r\n this.resumeFrom = this.snapshot = undefined;\r\n }\r\n // Only run on root\r\n resetTree() {\r\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\r\n this.root.nodes.forEach(clearMeasurements);\r\n this.root.sharedNodes.clear();\r\n }\r\n };\r\n}\r\nfunction updateLayout(node) {\r\n node.updateLayout();\r\n}\r\nfunction notifyLayoutUpdate(node) {\r\n var _a;\r\n const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;\r\n if (node.isLead() &&\r\n node.layout &&\r\n snapshot &&\r\n node.hasListeners(\"didUpdate\")) {\r\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\r\n const { animationType } = node.options;\r\n const isShared = snapshot.source !== node.layout.source;\r\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\r\n // animations for instance if layout=\"size\" and an element has only changed position\r\n if (animationType === \"size\") {\r\n eachAxis((axis) => {\r\n const axisSnapshot = isShared\r\n ? snapshot.measuredBox[axis]\r\n : snapshot.layoutBox[axis];\r\n const length = calcLength(axisSnapshot);\r\n axisSnapshot.min = layout[axis].min;\r\n axisSnapshot.max = axisSnapshot.min + length;\r\n });\r\n }\r\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\r\n eachAxis((axis) => {\r\n const axisSnapshot = isShared\r\n ? snapshot.measuredBox[axis]\r\n : snapshot.layoutBox[axis];\r\n const length = calcLength(layout[axis]);\r\n axisSnapshot.max = axisSnapshot.min + length;\r\n /**\r\n * Ensure relative target gets resized and rerendererd\r\n */\r\n if (node.relativeTarget && !node.currentAnimation) {\r\n node.isProjectionDirty = true;\r\n node.relativeTarget[axis].max =\r\n node.relativeTarget[axis].min + length;\r\n }\r\n });\r\n }\r\n const layoutDelta = createDelta();\r\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\r\n const visualDelta = createDelta();\r\n if (isShared) {\r\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\r\n }\r\n else {\r\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\r\n }\r\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\r\n let hasRelativeTargetChanged = false;\r\n if (!node.resumeFrom) {\r\n const relativeParent = node.getClosestProjectingParent();\r\n /**\r\n * If the relativeParent is itself resuming from a different element then\r\n * the relative snapshot is not relavent\r\n */\r\n if (relativeParent && !relativeParent.resumeFrom) {\r\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\r\n if (parentSnapshot && parentLayout) {\r\n const relativeSnapshot = createBox();\r\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\r\n const relativeLayout = createBox();\r\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\r\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\r\n hasRelativeTargetChanged = true;\r\n }\r\n if (relativeParent.options.layoutRoot) {\r\n node.relativeTarget = relativeLayout;\r\n node.relativeTargetOrigin = relativeSnapshot;\r\n node.relativeParent = relativeParent;\r\n }\r\n }\r\n }\r\n }\r\n node.notifyListeners(\"didUpdate\", {\r\n layout,\r\n snapshot,\r\n delta: visualDelta,\r\n layoutDelta,\r\n hasLayoutChanged,\r\n hasRelativeTargetChanged,\r\n });\r\n }\r\n else if (node.isLead()) {\r\n const { onExitComplete } = node.options;\r\n onExitComplete && onExitComplete();\r\n }\r\n /**\r\n * Clearing transition\r\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\r\n * and why we need it at all\r\n */\r\n node.options.transition = undefined;\r\n}\r\nfunction propagateDirtyNodes(node) {\r\n /**\r\n * Increase debug counter for nodes encountered this frame\r\n */\r\n projectionFrameData.totalNodes++;\r\n if (!node.parent)\r\n return;\r\n /**\r\n * If this node isn't projecting, propagate isProjectionDirty. It will have\r\n * no performance impact but it will allow the next child that *is* projecting\r\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\r\n * correcting.\r\n */\r\n if (!node.isProjecting()) {\r\n node.isProjectionDirty = node.parent.isProjectionDirty;\r\n }\r\n /**\r\n * Propagate isSharedProjectionDirty and isTransformDirty\r\n * throughout the whole tree. A future revision can take another look at\r\n * this but for safety we still recalcualte shared nodes.\r\n */\r\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\r\n node.parent.isProjectionDirty ||\r\n node.parent.isSharedProjectionDirty));\r\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\r\n}\r\nfunction cleanDirtyNodes(node) {\r\n node.isProjectionDirty =\r\n node.isSharedProjectionDirty =\r\n node.isTransformDirty =\r\n false;\r\n}\r\nfunction clearSnapshot(node) {\r\n node.clearSnapshot();\r\n}\r\nfunction clearMeasurements(node) {\r\n node.clearMeasurements();\r\n}\r\nfunction clearIsLayoutDirty(node) {\r\n node.isLayoutDirty = false;\r\n}\r\nfunction resetTransformStyle(node) {\r\n const { visualElement } = node.options;\r\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\r\n visualElement.notify(\"BeforeLayoutMeasure\");\r\n }\r\n node.resetTransform();\r\n}\r\nfunction finishAnimation(node) {\r\n node.finishAnimation();\r\n node.targetDelta = node.relativeTarget = node.target = undefined;\r\n node.isProjectionDirty = true;\r\n}\r\nfunction resolveTargetDelta(node) {\r\n node.resolveTargetDelta();\r\n}\r\nfunction calcProjection(node) {\r\n node.calcProjection();\r\n}\r\nfunction resetRotation(node) {\r\n node.resetRotation();\r\n}\r\nfunction removeLeadSnapshots(stack) {\r\n stack.removeLeadSnapshot();\r\n}\r\nfunction mixAxisDelta(output, delta, p) {\r\n output.translate = mix(delta.translate, 0, p);\r\n output.scale = mix(delta.scale, 1, p);\r\n output.origin = delta.origin;\r\n output.originPoint = delta.originPoint;\r\n}\r\nfunction mixAxis(output, from, to, p) {\r\n output.min = mix(from.min, to.min, p);\r\n output.max = mix(from.max, to.max, p);\r\n}\r\nfunction mixBox(output, from, to, p) {\r\n mixAxis(output.x, from.x, to.x, p);\r\n mixAxis(output.y, from.y, to.y, p);\r\n}\r\nfunction hasOpacityCrossfade(node) {\r\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\r\n}\r\nconst defaultLayoutTransition = {\r\n duration: 0.45,\r\n ease: [0.4, 0, 0.1, 1],\r\n};\r\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\r\n navigator.userAgent.toLowerCase().includes(string);\r\n/**\r\n * Measured bounding boxes must be rounded in Safari and\r\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\r\n * can appear to jump.\r\n */\r\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\r\n ? Math.round\r\n : noop;\r\nfunction roundAxis(axis) {\r\n // Round to the nearest .5 pixels to support subpixel layouts\r\n axis.min = roundPoint(axis.min);\r\n axis.max = roundPoint(axis.max);\r\n}\r\nfunction roundBox(box) {\r\n roundAxis(box.x);\r\n roundAxis(box.y);\r\n}\r\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\r\n return (animationType === \"position\" ||\r\n (animationType === \"preserve-aspect\" &&\r\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\r\n}\r\n\r\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\r\n","import { createProjectionNode } from './create-projection-node.mjs';\r\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\r\n\r\nconst DocumentProjectionNode = createProjectionNode({\r\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\r\n measureScroll: () => ({\r\n x: document.documentElement.scrollLeft || document.body.scrollLeft,\r\n y: document.documentElement.scrollTop || document.body.scrollTop,\r\n }),\r\n checkIsScrollRoot: () => true,\r\n});\r\n\r\nexport { DocumentProjectionNode };\r\n","import { createProjectionNode } from './create-projection-node.mjs';\r\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\r\n\r\nconst rootProjectionNode = {\r\n current: undefined,\r\n};\r\nconst HTMLProjectionNode = createProjectionNode({\r\n measureScroll: (instance) => ({\r\n x: instance.scrollLeft,\r\n y: instance.scrollTop,\r\n }),\r\n defaultParent: () => {\r\n if (!rootProjectionNode.current) {\r\n const documentNode = new DocumentProjectionNode({});\r\n documentNode.mount(window);\r\n documentNode.setOptions({ layoutScroll: true });\r\n rootProjectionNode.current = documentNode;\r\n }\r\n return rootProjectionNode.current;\r\n },\r\n resetTransform: (instance, value) => {\r\n instance.style.transform = value !== undefined ? value : \"none\";\r\n },\r\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\r\n});\r\n\r\nexport { HTMLProjectionNode, rootProjectionNode };\r\n","import { DragGesture } from '../../gestures/drag/index.mjs';\r\nimport { PanGesture } from '../../gestures/pan/index.mjs';\r\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\r\nimport { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\r\n\r\nconst drag = {\r\n pan: {\r\n Feature: PanGesture,\r\n },\r\n drag: {\r\n Feature: DragGesture,\r\n ProjectionNode: HTMLProjectionNode,\r\n MeasureLayout,\r\n },\r\n};\r\n\r\nexport { drag };\r\n","import { invariant } from '../../../utils/errors.mjs';\r\nimport { isNumericalString } from '../../../utils/is-numerical-string.mjs';\r\nimport { isCSSVariableToken } from './is-css-variable.mjs';\r\n\r\n/**\r\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\r\n *\r\n * ```\r\n * `var(--foo, #fff)` => [`--foo`, '#fff']\r\n * ```\r\n *\r\n * @param current\r\n */\r\nconst splitCSSVariableRegex = /var\\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\\)/;\r\nfunction parseCSSVariable(current) {\r\n const match = splitCSSVariableRegex.exec(current);\r\n if (!match)\r\n return [,];\r\n const [, token, fallback] = match;\r\n return [token, fallback];\r\n}\r\nconst maxDepth = 4;\r\nfunction getVariableValue(current, element, depth = 1) {\r\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`);\r\n const [token, fallback] = parseCSSVariable(current);\r\n // No CSS variable detected\r\n if (!token)\r\n return;\r\n // Attempt to read this CSS variable off the element\r\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\r\n if (resolved) {\r\n const trimmed = resolved.trim();\r\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\r\n }\r\n else if (isCSSVariableToken(fallback)) {\r\n // The fallback might itself be a CSS variable, in which case we attempt to resolve it too.\r\n return getVariableValue(fallback, element, depth + 1);\r\n }\r\n else {\r\n return fallback;\r\n }\r\n}\r\n/**\r\n * Resolve CSS variables from\r\n *\r\n * @internal\r\n */\r\nfunction resolveCSSVariables(visualElement, { ...target }, transitionEnd) {\r\n const element = visualElement.current;\r\n if (!(element instanceof Element))\r\n return { target, transitionEnd };\r\n // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd`\r\n // only if they change but I think this reads clearer and this isn't a performance-critical path.\r\n if (transitionEnd) {\r\n transitionEnd = { ...transitionEnd };\r\n }\r\n // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved\r\n visualElement.values.forEach((value) => {\r\n const current = value.get();\r\n if (!isCSSVariableToken(current))\r\n return;\r\n const resolved = getVariableValue(current, element);\r\n if (resolved)\r\n value.set(resolved);\r\n });\r\n // Cycle through every target property and resolve CSS variables. Currently\r\n // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)`\r\n for (const key in target) {\r\n const current = target[key];\r\n if (!isCSSVariableToken(current))\r\n continue;\r\n const resolved = getVariableValue(current, element);\r\n if (!resolved)\r\n continue;\r\n // Clone target if it hasn't already been\r\n target[key] = resolved;\r\n if (!transitionEnd)\r\n transitionEnd = {};\r\n // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved\r\n // CSS variable. This will ensure that after the animation the component will reflect\r\n // changes in the value of the CSS variable.\r\n if (transitionEnd[key] === undefined) {\r\n transitionEnd[key] = current;\r\n }\r\n }\r\n return { target, transitionEnd };\r\n}\r\n\r\nexport { parseCSSVariable, resolveCSSVariables };\r\n","import { isKeyframesTarget } from '../../../animation/utils/is-keyframes-target.mjs';\r\nimport { invariant } from '../../../utils/errors.mjs';\r\nimport { transformPropOrder } from '../../html/utils/transform.mjs';\r\nimport { findDimensionValueType } from '../value-types/dimensions.mjs';\r\nimport { isBrowser } from '../../../utils/is-browser.mjs';\r\nimport { number } from '../../../value/types/numbers/index.mjs';\r\nimport { px } from '../../../value/types/numbers/units.mjs';\r\n\r\nconst positionalKeys = new Set([\r\n \"width\",\r\n \"height\",\r\n \"top\",\r\n \"left\",\r\n \"right\",\r\n \"bottom\",\r\n \"x\",\r\n \"y\",\r\n \"translateX\",\r\n \"translateY\",\r\n]);\r\nconst isPositionalKey = (key) => positionalKeys.has(key);\r\nconst hasPositionalKey = (target) => {\r\n return Object.keys(target).some(isPositionalKey);\r\n};\r\nconst isNumOrPxType = (v) => v === number || v === px;\r\nconst getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(\", \")[pos]);\r\nconst getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {\r\n if (transform === \"none\" || !transform)\r\n return 0;\r\n const matrix3d = transform.match(/^matrix3d\\((.+)\\)$/);\r\n if (matrix3d) {\r\n return getPosFromMatrix(matrix3d[1], pos3);\r\n }\r\n else {\r\n const matrix = transform.match(/^matrix\\((.+)\\)$/);\r\n if (matrix) {\r\n return getPosFromMatrix(matrix[1], pos2);\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n};\r\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\r\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\r\nfunction removeNonTranslationalTransform(visualElement) {\r\n const removedTransforms = [];\r\n nonTranslationalTransformKeys.forEach((key) => {\r\n const value = visualElement.getValue(key);\r\n if (value !== undefined) {\r\n removedTransforms.push([key, value.get()]);\r\n value.set(key.startsWith(\"scale\") ? 1 : 0);\r\n }\r\n });\r\n // Apply changes to element before measurement\r\n if (removedTransforms.length)\r\n visualElement.render();\r\n return removedTransforms;\r\n}\r\nconst positionalValues = {\r\n // Dimensions\r\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\r\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\r\n top: (_bbox, { top }) => parseFloat(top),\r\n left: (_bbox, { left }) => parseFloat(left),\r\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\r\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\r\n // Transform\r\n x: getTranslateFromMatrix(4, 13),\r\n y: getTranslateFromMatrix(5, 14),\r\n};\r\n// Alias translate longform names\r\npositionalValues.translateX = positionalValues.x;\r\npositionalValues.translateY = positionalValues.y;\r\nconst convertChangedValueTypes = (target, visualElement, changedKeys) => {\r\n const originBbox = visualElement.measureViewportBox();\r\n const element = visualElement.current;\r\n const elementComputedStyle = getComputedStyle(element);\r\n const { display } = elementComputedStyle;\r\n const origin = {};\r\n // If the element is currently set to display: \"none\", make it visible before\r\n // measuring the target bounding box\r\n if (display === \"none\") {\r\n visualElement.setStaticValue(\"display\", target.display || \"block\");\r\n }\r\n /**\r\n * Record origins before we render and update styles\r\n */\r\n changedKeys.forEach((key) => {\r\n origin[key] = positionalValues[key](originBbox, elementComputedStyle);\r\n });\r\n // Apply the latest values (as set in checkAndConvertChangedValueTypes)\r\n visualElement.render();\r\n const targetBbox = visualElement.measureViewportBox();\r\n changedKeys.forEach((key) => {\r\n // Restore styles to their **calculated computed style**, not their actual\r\n // originally set style. This allows us to animate between equivalent pixel units.\r\n const value = visualElement.getValue(key);\r\n value && value.jump(origin[key]);\r\n target[key] = positionalValues[key](targetBbox, elementComputedStyle);\r\n });\r\n return target;\r\n};\r\nconst checkAndConvertChangedValueTypes = (visualElement, target, origin = {}, transitionEnd = {}) => {\r\n target = { ...target };\r\n transitionEnd = { ...transitionEnd };\r\n const targetPositionalKeys = Object.keys(target).filter(isPositionalKey);\r\n // We want to remove any transform values that could affect the element's bounding box before\r\n // it's measured. We'll reapply these later.\r\n let removedTransformValues = [];\r\n let hasAttemptedToRemoveTransformValues = false;\r\n const changedValueTypeKeys = [];\r\n targetPositionalKeys.forEach((key) => {\r\n const value = visualElement.getValue(key);\r\n if (!visualElement.hasValue(key))\r\n return;\r\n let from = origin[key];\r\n let fromType = findDimensionValueType(from);\r\n const to = target[key];\r\n let toType;\r\n // TODO: The current implementation of this basically throws an error\r\n // if you try and do value conversion via keyframes. There's probably\r\n // a way of doing this but the performance implications would need greater scrutiny,\r\n // as it'd be doing multiple resize-remeasure operations.\r\n if (isKeyframesTarget(to)) {\r\n const numKeyframes = to.length;\r\n const fromIndex = to[0] === null ? 1 : 0;\r\n from = to[fromIndex];\r\n fromType = findDimensionValueType(from);\r\n for (let i = fromIndex; i < numKeyframes; i++) {\r\n /**\r\n * Don't allow wildcard keyframes to be used to detect\r\n * a difference in value types.\r\n */\r\n if (to[i] === null)\r\n break;\r\n if (!toType) {\r\n toType = findDimensionValueType(to[i]);\r\n invariant(toType === fromType ||\r\n (isNumOrPxType(fromType) && isNumOrPxType(toType)), \"Keyframes must be of the same dimension as the current value\");\r\n }\r\n else {\r\n invariant(findDimensionValueType(to[i]) === toType, \"All keyframes must be of the same type\");\r\n }\r\n }\r\n }\r\n else {\r\n toType = findDimensionValueType(to);\r\n }\r\n if (fromType !== toType) {\r\n // If they're both just number or px, convert them both to numbers rather than\r\n // relying on resize/remeasure to convert (which is wasteful in this situation)\r\n if (isNumOrPxType(fromType) && isNumOrPxType(toType)) {\r\n const current = value.get();\r\n if (typeof current === \"string\") {\r\n value.set(parseFloat(current));\r\n }\r\n if (typeof to === \"string\") {\r\n target[key] = parseFloat(to);\r\n }\r\n else if (Array.isArray(to) && toType === px) {\r\n target[key] = to.map(parseFloat);\r\n }\r\n }\r\n else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) &&\r\n (toType === null || toType === void 0 ? void 0 : toType.transform) &&\r\n (from === 0 || to === 0)) {\r\n // If one or the other value is 0, it's safe to coerce it to the\r\n // type of the other without measurement\r\n if (from === 0) {\r\n value.set(toType.transform(from));\r\n }\r\n else {\r\n target[key] = fromType.transform(to);\r\n }\r\n }\r\n else {\r\n // If we're going to do value conversion via DOM measurements, we first\r\n // need to remove non-positional transform values that could affect the bbox measurements.\r\n if (!hasAttemptedToRemoveTransformValues) {\r\n removedTransformValues =\r\n removeNonTranslationalTransform(visualElement);\r\n hasAttemptedToRemoveTransformValues = true;\r\n }\r\n changedValueTypeKeys.push(key);\r\n transitionEnd[key] =\r\n transitionEnd[key] !== undefined\r\n ? transitionEnd[key]\r\n : target[key];\r\n value.jump(to);\r\n }\r\n }\r\n });\r\n if (changedValueTypeKeys.length) {\r\n const scrollY = changedValueTypeKeys.indexOf(\"height\") >= 0\r\n ? window.pageYOffset\r\n : null;\r\n const convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);\r\n // If we removed transform values, reapply them before the next render\r\n if (removedTransformValues.length) {\r\n removedTransformValues.forEach(([key, value]) => {\r\n visualElement.getValue(key).set(value);\r\n });\r\n }\r\n // Reapply original values\r\n visualElement.render();\r\n // Restore scroll position\r\n if (isBrowser && scrollY !== null) {\r\n window.scrollTo({ top: scrollY });\r\n }\r\n return { target: convertedTarget, transitionEnd };\r\n }\r\n else {\r\n return { target, transitionEnd };\r\n }\r\n};\r\n/**\r\n * Convert value types for x/y/width/height/top/left/bottom/right\r\n *\r\n * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'`\r\n *\r\n * @internal\r\n */\r\nfunction unitConversion(visualElement, target, origin, transitionEnd) {\r\n return hasPositionalKey(target)\r\n ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd)\r\n : { target, transitionEnd };\r\n}\r\n\r\nexport { positionalValues, unitConversion };\r\n","import { resolveCSSVariables } from './css-variables-conversion.mjs';\r\nimport { unitConversion } from './unit-conversion.mjs';\r\n\r\n/**\r\n * Parse a DOM variant to make it animatable. This involves resolving CSS variables\r\n * and ensuring animations like \"20%\" => \"calc(50vw)\" are performed in pixels.\r\n */\r\nconst parseDomVariant = (visualElement, target, origin, transitionEnd) => {\r\n const resolved = resolveCSSVariables(visualElement, target, transitionEnd);\r\n target = resolved.target;\r\n transitionEnd = resolved.transitionEnd;\r\n return unitConversion(visualElement, target, origin, transitionEnd);\r\n};\r\n\r\nexport { parseDomVariant };\r\n","// Does this device prefer reduced motion? Returns `null` server-side.\r\nconst prefersReducedMotion = { current: null };\r\nconst hasReducedMotionListener = { current: false };\r\n\r\nexport { hasReducedMotionListener, prefersReducedMotion };\r\n","import { isBrowser } from '../is-browser.mjs';\r\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\r\n\r\nfunction initPrefersReducedMotion() {\r\n hasReducedMotionListener.current = true;\r\n if (!isBrowser)\r\n return;\r\n if (window.matchMedia) {\r\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\r\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\r\n motionMediaQuery.addListener(setReducedMotionPreferences);\r\n setReducedMotionPreferences();\r\n }\r\n else {\r\n prefersReducedMotion.current = false;\r\n }\r\n}\r\n\r\nexport { initPrefersReducedMotion };\r\n","import { isWillChangeMotionValue } from '../../value/use-will-change/is.mjs';\r\nimport { warnOnce } from '../../utils/warn-once.mjs';\r\nimport { motionValue } from '../../value/index.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction updateMotionValuesFromProps(element, next, prev) {\r\n const { willChange } = next;\r\n for (const key in next) {\r\n const nextValue = next[key];\r\n const prevValue = prev[key];\r\n if (isMotionValue(nextValue)) {\r\n /**\r\n * If this is a motion value found in props or style, we want to add it\r\n * to our visual element's motion value map.\r\n */\r\n element.addValue(key, nextValue);\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.add(key);\r\n }\r\n /**\r\n * Check the version of the incoming motion value with this version\r\n * and warn against mismatches.\r\n */\r\n if (process.env.NODE_ENV === \"development\") {\r\n warnOnce(nextValue.version === \"10.18.0\", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.18.0 may not work as expected.`);\r\n }\r\n }\r\n else if (isMotionValue(prevValue)) {\r\n /**\r\n * If we're swapping from a motion value to a static value,\r\n * create a new motion value from that\r\n */\r\n element.addValue(key, motionValue(nextValue, { owner: element }));\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.remove(key);\r\n }\r\n }\r\n else if (prevValue !== nextValue) {\r\n /**\r\n * If this is a flat value that has changed, update the motion value\r\n * or create one if it doesn't exist. We only want to do this if we're\r\n * not handling the value with our animation state.\r\n */\r\n if (element.hasValue(key)) {\r\n const existingValue = element.getValue(key);\r\n // TODO: Only update values that aren't being animated or even looked at\r\n !existingValue.hasAnimated && existingValue.set(nextValue);\r\n }\r\n else {\r\n const latestValue = element.getStaticValue(key);\r\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\r\n }\r\n }\r\n }\r\n // Handle removed values\r\n for (const key in prev) {\r\n if (next[key] === undefined)\r\n element.removeValue(key);\r\n }\r\n return next;\r\n}\r\n\r\nexport { updateMotionValuesFromProps };\r\n","const visualElementStore = new WeakMap();\r\n\r\nexport { visualElementStore };\r\n","import { warning, invariant } from '../utils/errors.mjs';\r\nimport { createBox } from '../projection/geometry/models.mjs';\r\nimport { isRefObject } from '../utils/is-ref-object.mjs';\r\nimport { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';\r\nimport { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';\r\nimport { SubscriptionManager } from '../utils/subscription-manager.mjs';\r\nimport { motionValue } from '../value/index.mjs';\r\nimport { isWillChangeMotionValue } from '../value/use-will-change/is.mjs';\r\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\r\nimport { transformProps } from './html/utils/transform.mjs';\r\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\r\nimport { isVariantLabel } from './utils/is-variant-label.mjs';\r\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\r\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\r\nimport { warnOnce } from '../utils/warn-once.mjs';\r\nimport { featureDefinitions } from '../motion/features/definitions.mjs';\r\nimport { variantProps } from './utils/variant-props.mjs';\r\nimport { visualElementStore } from './store.mjs';\r\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\r\n\r\nconst featureNames = Object.keys(featureDefinitions);\r\nconst numFeatures = featureNames.length;\r\nconst propEventHandlers = [\r\n \"AnimationStart\",\r\n \"AnimationComplete\",\r\n \"Update\",\r\n \"BeforeLayoutMeasure\",\r\n \"LayoutMeasure\",\r\n \"LayoutAnimationStart\",\r\n \"LayoutAnimationComplete\",\r\n];\r\nconst numVariantProps = variantProps.length;\r\n/**\r\n * A VisualElement is an imperative abstraction around UI elements such as\r\n * HTMLElement, SVGElement, Three.Object3D etc.\r\n */\r\nclass VisualElement {\r\n constructor({ parent, props, presenceContext, reducedMotionConfig, visualState, }, options = {}) {\r\n /**\r\n * A reference to the current underlying Instance, e.g. a HTMLElement\r\n * or Three.Mesh etc.\r\n */\r\n this.current = null;\r\n /**\r\n * A set containing references to this VisualElement's children.\r\n */\r\n this.children = new Set();\r\n /**\r\n * Determine what role this visual element should take in the variant tree.\r\n */\r\n this.isVariantNode = false;\r\n this.isControllingVariants = false;\r\n /**\r\n * Decides whether this VisualElement should animate in reduced motion\r\n * mode.\r\n *\r\n * TODO: This is currently set on every individual VisualElement but feels\r\n * like it could be set globally.\r\n */\r\n this.shouldReduceMotion = null;\r\n /**\r\n * A map of all motion values attached to this visual element. Motion\r\n * values are source of truth for any given animated value. A motion\r\n * value might be provided externally by the component via props.\r\n */\r\n this.values = new Map();\r\n /**\r\n * Cleanup functions for active features (hover/tap/exit etc)\r\n */\r\n this.features = {};\r\n /**\r\n * A map of every subscription that binds the provided or generated\r\n * motion values onChange listeners to this visual element.\r\n */\r\n this.valueSubscriptions = new Map();\r\n /**\r\n * A reference to the previously-provided motion values as returned\r\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\r\n * if any motion values need to be removed after props are updated.\r\n */\r\n this.prevMotionValues = {};\r\n /**\r\n * An object containing a SubscriptionManager for each active event.\r\n */\r\n this.events = {};\r\n /**\r\n * An object containing an unsubscribe function for each prop event subscription.\r\n * For example, every \"Update\" event can have multiple subscribers via\r\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\r\n */\r\n this.propEventSubscriptions = {};\r\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\r\n this.render = () => {\r\n if (!this.current)\r\n return;\r\n this.triggerBuild();\r\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\r\n };\r\n this.scheduleRender = () => frame.render(this.render, false, true);\r\n const { latestValues, renderState } = visualState;\r\n this.latestValues = latestValues;\r\n this.baseTarget = { ...latestValues };\r\n this.initialValues = props.initial ? { ...latestValues } : {};\r\n this.renderState = renderState;\r\n this.parent = parent;\r\n this.props = props;\r\n this.presenceContext = presenceContext;\r\n this.depth = parent ? parent.depth + 1 : 0;\r\n this.reducedMotionConfig = reducedMotionConfig;\r\n this.options = options;\r\n this.isControllingVariants = isControllingVariants(props);\r\n this.isVariantNode = isVariantNode(props);\r\n if (this.isVariantNode) {\r\n this.variantChildren = new Set();\r\n }\r\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\r\n /**\r\n * Any motion values that are provided to the element when created\r\n * aren't yet bound to the element, as this would technically be impure.\r\n * However, we iterate through the motion values and set them to the\r\n * initial values for this component.\r\n *\r\n * TODO: This is impure and we should look at changing this to run on mount.\r\n * Doing so will break some tests but this isn't neccessarily a breaking change,\r\n * more a reflection of the test.\r\n */\r\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {});\r\n for (const key in initialMotionValues) {\r\n const value = initialMotionValues[key];\r\n if (latestValues[key] !== undefined && isMotionValue(value)) {\r\n value.set(latestValues[key], false);\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.add(key);\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * This method takes React props and returns found MotionValues. For example, HTML\r\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\r\n *\r\n * This isn't an abstract method as it needs calling in the constructor, but it is\r\n * intended to be one.\r\n */\r\n scrapeMotionValuesFromProps(_props, _prevProps) {\r\n return {};\r\n }\r\n mount(instance) {\r\n this.current = instance;\r\n visualElementStore.set(instance, this);\r\n if (this.projection && !this.projection.instance) {\r\n this.projection.mount(instance);\r\n }\r\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\r\n this.removeFromVariantTree = this.parent.addVariantChild(this);\r\n }\r\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\r\n if (!hasReducedMotionListener.current) {\r\n initPrefersReducedMotion();\r\n }\r\n this.shouldReduceMotion =\r\n this.reducedMotionConfig === \"never\"\r\n ? false\r\n : this.reducedMotionConfig === \"always\"\r\n ? true\r\n : prefersReducedMotion.current;\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\");\r\n }\r\n if (this.parent)\r\n this.parent.children.add(this);\r\n this.update(this.props, this.presenceContext);\r\n }\r\n unmount() {\r\n visualElementStore.delete(this.current);\r\n this.projection && this.projection.unmount();\r\n cancelFrame(this.notifyUpdate);\r\n cancelFrame(this.render);\r\n this.valueSubscriptions.forEach((remove) => remove());\r\n this.removeFromVariantTree && this.removeFromVariantTree();\r\n this.parent && this.parent.children.delete(this);\r\n for (const key in this.events) {\r\n this.events[key].clear();\r\n }\r\n for (const key in this.features) {\r\n this.features[key].unmount();\r\n }\r\n this.current = null;\r\n }\r\n bindToMotionValue(key, value) {\r\n const valueIsTransform = transformProps.has(key);\r\n const removeOnChange = value.on(\"change\", (latestValue) => {\r\n this.latestValues[key] = latestValue;\r\n this.props.onUpdate &&\r\n frame.update(this.notifyUpdate, false, true);\r\n if (valueIsTransform && this.projection) {\r\n this.projection.isTransformDirty = true;\r\n }\r\n });\r\n const removeOnRenderRequest = value.on(\"renderRequest\", this.scheduleRender);\r\n this.valueSubscriptions.set(key, () => {\r\n removeOnChange();\r\n removeOnRenderRequest();\r\n });\r\n }\r\n sortNodePosition(other) {\r\n /**\r\n * If these nodes aren't even of the same type we can't compare their depth.\r\n */\r\n if (!this.current ||\r\n !this.sortInstanceNodePosition ||\r\n this.type !== other.type) {\r\n return 0;\r\n }\r\n return this.sortInstanceNodePosition(this.current, other.current);\r\n }\r\n loadFeatures({ children, ...renderedProps }, isStrict, preloadedFeatures, initialLayoutGroupConfig) {\r\n let ProjectionNodeConstructor;\r\n let MeasureLayout;\r\n /**\r\n * If we're in development mode, check to make sure we're not rendering a motion component\r\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\r\n */\r\n if (process.env.NODE_ENV !== \"production\" &&\r\n preloadedFeatures &&\r\n isStrict) {\r\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\r\n renderedProps.ignoreStrict\r\n ? warning(false, strictMessage)\r\n : invariant(false, strictMessage);\r\n }\r\n for (let i = 0; i < numFeatures; i++) {\r\n const name = featureNames[i];\r\n const { isEnabled, Feature: FeatureConstructor, ProjectionNode, MeasureLayout: MeasureLayoutComponent, } = featureDefinitions[name];\r\n if (ProjectionNode)\r\n ProjectionNodeConstructor = ProjectionNode;\r\n if (isEnabled(renderedProps)) {\r\n if (!this.features[name] && FeatureConstructor) {\r\n this.features[name] = new FeatureConstructor(this);\r\n }\r\n if (MeasureLayoutComponent) {\r\n MeasureLayout = MeasureLayoutComponent;\r\n }\r\n }\r\n }\r\n if ((this.type === \"html\" || this.type === \"svg\") &&\r\n !this.projection &&\r\n ProjectionNodeConstructor) {\r\n this.projection = new ProjectionNodeConstructor(this.latestValues, this.parent && this.parent.projection);\r\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = renderedProps;\r\n this.projection.setOptions({\r\n layoutId,\r\n layout,\r\n alwaysMeasureLayout: Boolean(drag) ||\r\n (dragConstraints && isRefObject(dragConstraints)),\r\n visualElement: this,\r\n scheduleRender: () => this.scheduleRender(),\r\n /**\r\n * TODO: Update options in an effect. This could be tricky as it'll be too late\r\n * to update by the time layout animations run.\r\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\r\n * ensuring it gets called if there's no potential layout animations.\r\n *\r\n */\r\n animationType: typeof layout === \"string\" ? layout : \"both\",\r\n initialPromotionConfig: initialLayoutGroupConfig,\r\n layoutScroll,\r\n layoutRoot,\r\n });\r\n }\r\n return MeasureLayout;\r\n }\r\n updateFeatures() {\r\n for (const key in this.features) {\r\n const feature = this.features[key];\r\n if (feature.isMounted) {\r\n feature.update();\r\n }\r\n else {\r\n feature.mount();\r\n feature.isMounted = true;\r\n }\r\n }\r\n }\r\n triggerBuild() {\r\n this.build(this.renderState, this.latestValues, this.options, this.props);\r\n }\r\n /**\r\n * Measure the current viewport box with or without transforms.\r\n * Only measures axis-aligned boxes, rotate and skew must be manually\r\n * removed with a re-render to work.\r\n */\r\n measureViewportBox() {\r\n return this.current\r\n ? this.measureInstanceViewportBox(this.current, this.props)\r\n : createBox();\r\n }\r\n getStaticValue(key) {\r\n return this.latestValues[key];\r\n }\r\n setStaticValue(key, value) {\r\n this.latestValues[key] = value;\r\n }\r\n /**\r\n * Make a target animatable by Popmotion. For instance, if we're\r\n * trying to animate width from 100px to 100vw we need to measure 100vw\r\n * in pixels to determine what we really need to animate to. This is also\r\n * pluggable to support Framer's custom value types like Color,\r\n * and CSS variables.\r\n */\r\n makeTargetAnimatable(target, canMutate = true) {\r\n return this.makeTargetAnimatableFromInstance(target, this.props, canMutate);\r\n }\r\n /**\r\n * Update the provided props. Ensure any newly-added motion values are\r\n * added to our map, old ones removed, and listeners updated.\r\n */\r\n update(props, presenceContext) {\r\n if (props.transformTemplate || this.props.transformTemplate) {\r\n this.scheduleRender();\r\n }\r\n this.prevProps = this.props;\r\n this.props = props;\r\n this.prevPresenceContext = this.presenceContext;\r\n this.presenceContext = presenceContext;\r\n /**\r\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\r\n */\r\n for (let i = 0; i < propEventHandlers.length; i++) {\r\n const key = propEventHandlers[i];\r\n if (this.propEventSubscriptions[key]) {\r\n this.propEventSubscriptions[key]();\r\n delete this.propEventSubscriptions[key];\r\n }\r\n const listener = props[\"on\" + key];\r\n if (listener) {\r\n this.propEventSubscriptions[key] = this.on(key, listener);\r\n }\r\n }\r\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps), this.prevMotionValues);\r\n if (this.handleChildMotionValue) {\r\n this.handleChildMotionValue();\r\n }\r\n }\r\n getProps() {\r\n return this.props;\r\n }\r\n /**\r\n * Returns the variant definition with a given name.\r\n */\r\n getVariant(name) {\r\n return this.props.variants ? this.props.variants[name] : undefined;\r\n }\r\n /**\r\n * Returns the defined default transition on this component.\r\n */\r\n getDefaultTransition() {\r\n return this.props.transition;\r\n }\r\n getTransformPagePoint() {\r\n return this.props.transformPagePoint;\r\n }\r\n getClosestVariantNode() {\r\n return this.isVariantNode\r\n ? this\r\n : this.parent\r\n ? this.parent.getClosestVariantNode()\r\n : undefined;\r\n }\r\n getVariantContext(startAtParent = false) {\r\n if (startAtParent) {\r\n return this.parent ? this.parent.getVariantContext() : undefined;\r\n }\r\n if (!this.isControllingVariants) {\r\n const context = this.parent\r\n ? this.parent.getVariantContext() || {}\r\n : {};\r\n if (this.props.initial !== undefined) {\r\n context.initial = this.props.initial;\r\n }\r\n return context;\r\n }\r\n const context = {};\r\n for (let i = 0; i < numVariantProps; i++) {\r\n const name = variantProps[i];\r\n const prop = this.props[name];\r\n if (isVariantLabel(prop) || prop === false) {\r\n context[name] = prop;\r\n }\r\n }\r\n return context;\r\n }\r\n /**\r\n * Add a child visual element to our set of children.\r\n */\r\n addVariantChild(child) {\r\n const closestVariantNode = this.getClosestVariantNode();\r\n if (closestVariantNode) {\r\n closestVariantNode.variantChildren &&\r\n closestVariantNode.variantChildren.add(child);\r\n return () => closestVariantNode.variantChildren.delete(child);\r\n }\r\n }\r\n /**\r\n * Add a motion value and bind it to this visual element.\r\n */\r\n addValue(key, value) {\r\n // Remove existing value if it exists\r\n if (value !== this.values.get(key)) {\r\n this.removeValue(key);\r\n this.bindToMotionValue(key, value);\r\n }\r\n this.values.set(key, value);\r\n this.latestValues[key] = value.get();\r\n }\r\n /**\r\n * Remove a motion value and unbind any active subscriptions.\r\n */\r\n removeValue(key) {\r\n this.values.delete(key);\r\n const unsubscribe = this.valueSubscriptions.get(key);\r\n if (unsubscribe) {\r\n unsubscribe();\r\n this.valueSubscriptions.delete(key);\r\n }\r\n delete this.latestValues[key];\r\n this.removeValueFromRenderState(key, this.renderState);\r\n }\r\n /**\r\n * Check whether we have a motion value for this key\r\n */\r\n hasValue(key) {\r\n return this.values.has(key);\r\n }\r\n getValue(key, defaultValue) {\r\n if (this.props.values && this.props.values[key]) {\r\n return this.props.values[key];\r\n }\r\n let value = this.values.get(key);\r\n if (value === undefined && defaultValue !== undefined) {\r\n value = motionValue(defaultValue, { owner: this });\r\n this.addValue(key, value);\r\n }\r\n return value;\r\n }\r\n /**\r\n * If we're trying to animate to a previously unencountered value,\r\n * we need to check for it in our state and as a last resort read it\r\n * directly from the instance (which might have performance implications).\r\n */\r\n readValue(key) {\r\n var _a;\r\n return this.latestValues[key] !== undefined || !this.current\r\n ? this.latestValues[key]\r\n : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options);\r\n }\r\n /**\r\n * Set the base target to later animate back to. This is currently\r\n * only hydrated on creation and when we first read a value.\r\n */\r\n setBaseTarget(key, value) {\r\n this.baseTarget[key] = value;\r\n }\r\n /**\r\n * Find the base target for a value thats been removed from all animation\r\n * props.\r\n */\r\n getBaseTarget(key) {\r\n var _a;\r\n const { initial } = this.props;\r\n const valueFromInitial = typeof initial === \"string\" || typeof initial === \"object\"\r\n ? (_a = resolveVariantFromProps(this.props, initial)) === null || _a === void 0 ? void 0 : _a[key]\r\n : undefined;\r\n /**\r\n * If this value still exists in the current initial variant, read that.\r\n */\r\n if (initial && valueFromInitial !== undefined) {\r\n return valueFromInitial;\r\n }\r\n /**\r\n * Alternatively, if this VisualElement config has defined a getBaseTarget\r\n * so we can read the value from an alternative source, try that.\r\n */\r\n const target = this.getBaseTargetFromProps(this.props, key);\r\n if (target !== undefined && !isMotionValue(target))\r\n return target;\r\n /**\r\n * If the value was initially defined on initial, but it doesn't any more,\r\n * return undefined. Otherwise return the value as initially read from the DOM.\r\n */\r\n return this.initialValues[key] !== undefined &&\r\n valueFromInitial === undefined\r\n ? undefined\r\n : this.baseTarget[key];\r\n }\r\n on(eventName, callback) {\r\n if (!this.events[eventName]) {\r\n this.events[eventName] = new SubscriptionManager();\r\n }\r\n return this.events[eventName].add(callback);\r\n }\r\n notify(eventName, ...args) {\r\n if (this.events[eventName]) {\r\n this.events[eventName].notify(...args);\r\n }\r\n }\r\n}\r\n\r\nexport { VisualElement };\r\n","import { getOrigin, checkTargetForNewValues } from '../utils/setters.mjs';\r\nimport { parseDomVariant } from './utils/parse-dom-variant.mjs';\r\nimport { VisualElement } from '../VisualElement.mjs';\r\n\r\nclass DOMVisualElement extends VisualElement {\r\n sortInstanceNodePosition(a, b) {\r\n /**\r\n * compareDocumentPosition returns a bitmask, by using the bitwise &\r\n * we're returning true if 2 in that bitmask is set to true. 2 is set\r\n * to true if b preceeds a.\r\n */\r\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\r\n }\r\n getBaseTargetFromProps(props, key) {\r\n return props.style ? props.style[key] : undefined;\r\n }\r\n removeValueFromRenderState(key, { vars, style }) {\r\n delete vars[key];\r\n delete style[key];\r\n }\r\n makeTargetAnimatableFromInstance({ transition, transitionEnd, ...target }, { transformValues }, isMounted) {\r\n let origin = getOrigin(target, transition || {}, this);\r\n /**\r\n * If Framer has provided a function to convert `Color` etc value types, convert them\r\n */\r\n if (transformValues) {\r\n if (transitionEnd)\r\n transitionEnd = transformValues(transitionEnd);\r\n if (target)\r\n target = transformValues(target);\r\n if (origin)\r\n origin = transformValues(origin);\r\n }\r\n if (isMounted) {\r\n checkTargetForNewValues(this, target, origin);\r\n const parsed = parseDomVariant(this, target, origin, transitionEnd);\r\n transitionEnd = parsed.transitionEnd;\r\n target = parsed.target;\r\n }\r\n return {\r\n transition,\r\n transitionEnd,\r\n ...target,\r\n };\r\n }\r\n}\r\n\r\nexport { DOMVisualElement };\r\n","import { buildHTMLStyles } from './utils/build-styles.mjs';\r\nimport { isCSSVariableName } from '../dom/utils/is-css-variable.mjs';\r\nimport { transformProps } from './utils/transform.mjs';\r\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { renderHTML } from './utils/render.mjs';\r\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\r\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\r\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction getComputedStyle(element) {\r\n return window.getComputedStyle(element);\r\n}\r\nclass HTMLVisualElement extends DOMVisualElement {\r\n constructor() {\r\n super(...arguments);\r\n this.type = \"html\";\r\n }\r\n readValueFromInstance(instance, key) {\r\n if (transformProps.has(key)) {\r\n const defaultType = getDefaultValueType(key);\r\n return defaultType ? defaultType.default || 0 : 0;\r\n }\r\n else {\r\n const computedStyle = getComputedStyle(instance);\r\n const value = (isCSSVariableName(key)\r\n ? computedStyle.getPropertyValue(key)\r\n : computedStyle[key]) || 0;\r\n return typeof value === \"string\" ? value.trim() : value;\r\n }\r\n }\r\n measureInstanceViewportBox(instance, { transformPagePoint }) {\r\n return measureViewportBox(instance, transformPagePoint);\r\n }\r\n build(renderState, latestValues, options, props) {\r\n buildHTMLStyles(renderState, latestValues, options, props.transformTemplate);\r\n }\r\n scrapeMotionValuesFromProps(props, prevProps) {\r\n return scrapeMotionValuesFromProps(props, prevProps);\r\n }\r\n handleChildMotionValue() {\r\n if (this.childSubscription) {\r\n this.childSubscription();\r\n delete this.childSubscription;\r\n }\r\n const { children } = this.props;\r\n if (isMotionValue(children)) {\r\n this.childSubscription = children.on(\"change\", (latest) => {\r\n if (this.current)\r\n this.current.textContent = `${latest}`;\r\n });\r\n }\r\n }\r\n renderInstance(instance, renderState, styleProp, projection) {\r\n renderHTML(instance, renderState, styleProp, projection);\r\n }\r\n}\r\n\r\nexport { HTMLVisualElement, getComputedStyle };\r\n","import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\r\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\r\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\r\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\r\nimport { transformProps } from '../html/utils/transform.mjs';\r\nimport { renderSVG } from './utils/render.mjs';\r\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\r\nimport { createBox } from '../../projection/geometry/models.mjs';\r\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\r\n\r\nclass SVGVisualElement extends DOMVisualElement {\r\n constructor() {\r\n super(...arguments);\r\n this.type = \"svg\";\r\n this.isSVGTag = false;\r\n }\r\n getBaseTargetFromProps(props, key) {\r\n return props[key];\r\n }\r\n readValueFromInstance(instance, key) {\r\n if (transformProps.has(key)) {\r\n const defaultType = getDefaultValueType(key);\r\n return defaultType ? defaultType.default || 0 : 0;\r\n }\r\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\r\n return instance.getAttribute(key);\r\n }\r\n measureInstanceViewportBox() {\r\n return createBox();\r\n }\r\n scrapeMotionValuesFromProps(props, prevProps) {\r\n return scrapeMotionValuesFromProps(props, prevProps);\r\n }\r\n build(renderState, latestValues, options, props) {\r\n buildSVGAttrs(renderState, latestValues, options, this.isSVGTag, props.transformTemplate);\r\n }\r\n renderInstance(instance, renderState, styleProp, projection) {\r\n renderSVG(instance, renderState, styleProp, projection);\r\n }\r\n mount(instance) {\r\n this.isSVGTag = isSVGTag(instance.tagName);\r\n super.mount(instance);\r\n }\r\n}\r\n\r\nexport { SVGVisualElement };\r\n","import { HTMLVisualElement } from '../html/HTMLVisualElement.mjs';\r\nimport { SVGVisualElement } from '../svg/SVGVisualElement.mjs';\r\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\r\n\r\nconst createDomVisualElement = (Component, options) => {\r\n return isSVGComponent(Component)\r\n ? new SVGVisualElement(options, { enableHardwareAcceleration: false })\r\n : new HTMLVisualElement(options, { enableHardwareAcceleration: true });\r\n};\r\n\r\nexport { createDomVisualElement };\r\n","import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\r\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\r\n\r\nconst layout = {\r\n layout: {\r\n ProjectionNode: HTMLProjectionNode,\r\n MeasureLayout,\r\n },\r\n};\r\n\r\nexport { layout };\r\n","import { createMotionComponent } from '../../motion/index.mjs';\r\nimport { createMotionProxy } from './motion-proxy.mjs';\r\nimport { createDomMotionConfig } from './utils/create-config.mjs';\r\nimport { gestureAnimations } from '../../motion/features/gestures.mjs';\r\nimport { animations } from '../../motion/features/animations.mjs';\r\nimport { drag } from '../../motion/features/drag.mjs';\r\nimport { createDomVisualElement } from './create-visual-element.mjs';\r\nimport { layout } from '../../motion/features/layout.mjs';\r\n\r\nconst preloadedFeatures = {\r\n ...animations,\r\n ...gestureAnimations,\r\n ...drag,\r\n ...layout,\r\n};\r\n/**\r\n * HTML & SVG components, optimised for use with gestures and animation. These can be used as\r\n * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported.\r\n *\r\n * @public\r\n */\r\nconst motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomMotionConfig(Component, config, preloadedFeatures, createDomVisualElement));\r\n/**\r\n * Create a DOM `motion` component with the provided string. This is primarily intended\r\n * as a full alternative to `motion` for consumers who have to support environments that don't\r\n * support `Proxy`.\r\n *\r\n * ```javascript\r\n * import { createDomMotionComponent } from \"framer-motion\"\r\n *\r\n * const motion = {\r\n * div: createDomMotionComponent('div')\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction createDomMotionComponent(key) {\r\n return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, preloadedFeatures, createDomVisualElement));\r\n}\r\n\r\nexport { createDomMotionComponent, motion };\r\n","import { createMotionProxy } from './motion-proxy.mjs';\r\nimport { createDomMotionConfig } from './utils/create-config.mjs';\r\n\r\n/**\r\n * @public\r\n */\r\nconst m = createMotionProxy(createDomMotionConfig);\r\n\r\nexport { m };\r\n","import { useRef } from 'react';\r\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs';\r\n\r\nfunction useIsMounted() {\r\n const isMounted = useRef(false);\r\n useIsomorphicLayoutEffect(() => {\r\n isMounted.current = true;\r\n return () => {\r\n isMounted.current = false;\r\n };\r\n }, []);\r\n return isMounted;\r\n}\r\n\r\nexport { useIsMounted };\r\n","import { useState, useCallback } from 'react';\r\nimport { useIsMounted } from './use-is-mounted.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction useForceUpdate() {\r\n const isMounted = useIsMounted();\r\n const [forcedRenderCount, setForcedRenderCount] = useState(0);\r\n const forceRender = useCallback(() => {\r\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1);\r\n }, [forcedRenderCount]);\r\n /**\r\n * Defer this to the end of the next animation frame in case there are multiple\r\n * synchronous calls.\r\n */\r\n const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]);\r\n return [deferredForceRender, forcedRenderCount];\r\n}\r\n\r\nexport { useForceUpdate };\r\n","import * as React from 'react';\r\nimport { useId, useRef, useInsertionEffect } from 'react';\r\n\r\n/**\r\n * Measurement functionality has to be within a separate component\r\n * to leverage snapshot lifecycle.\r\n */\r\nclass PopChildMeasure extends React.Component {\r\n getSnapshotBeforeUpdate(prevProps) {\r\n const element = this.props.childRef.current;\r\n if (element && prevProps.isPresent && !this.props.isPresent) {\r\n const size = this.props.sizeRef.current;\r\n size.height = element.offsetHeight || 0;\r\n size.width = element.offsetWidth || 0;\r\n size.top = element.offsetTop;\r\n size.left = element.offsetLeft;\r\n }\r\n return null;\r\n }\r\n /**\r\n * Required with getSnapshotBeforeUpdate to stop React complaining.\r\n */\r\n componentDidUpdate() { }\r\n render() {\r\n return this.props.children;\r\n }\r\n}\r\nfunction PopChild({ children, isPresent }) {\r\n const id = useId();\r\n const ref = useRef(null);\r\n const size = useRef({\r\n width: 0,\r\n height: 0,\r\n top: 0,\r\n left: 0,\r\n });\r\n /**\r\n * We create and inject a style block so we can apply this explicit\r\n * sizing in a non-destructive manner by just deleting the style block.\r\n *\r\n * We can't apply size via render as the measurement happens\r\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\r\n * styles directly on the DOM node, we might be overwriting\r\n * styles set via the style prop.\r\n */\r\n useInsertionEffect(() => {\r\n const { width, height, top, left } = size.current;\r\n if (isPresent || !ref.current || !width || !height)\r\n return;\r\n ref.current.dataset.motionPopId = id;\r\n const style = document.createElement(\"style\");\r\n document.head.appendChild(style);\r\n if (style.sheet) {\r\n style.sheet.insertRule(`\r\n [data-motion-pop-id=\"${id}\"] {\r\n position: absolute !important;\r\n width: ${width}px !important;\r\n height: ${height}px !important;\r\n top: ${top}px !important;\r\n left: ${left}px !important;\r\n }\r\n `);\r\n }\r\n return () => {\r\n document.head.removeChild(style);\r\n };\r\n }, [isPresent]);\r\n return (React.createElement(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size }, React.cloneElement(children, { ref })));\r\n}\r\n\r\nexport { PopChild };\r\n","import * as React from 'react';\r\nimport { useId, useMemo } from 'react';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { PopChild } from './PopChild.mjs';\r\n\r\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\r\n const presenceChildren = useConstant(newChildrenMap);\r\n const id = useId();\r\n const context = useMemo(() => ({\r\n id,\r\n initial,\r\n isPresent,\r\n custom,\r\n onExitComplete: (childId) => {\r\n presenceChildren.set(childId, true);\r\n for (const isComplete of presenceChildren.values()) {\r\n if (!isComplete)\r\n return; // can stop searching when any is incomplete\r\n }\r\n onExitComplete && onExitComplete();\r\n },\r\n register: (childId) => {\r\n presenceChildren.set(childId, false);\r\n return () => presenceChildren.delete(childId);\r\n },\r\n }), \r\n /**\r\n * If the presence of a child affects the layout of the components around it,\r\n * we want to make a new context value to ensure they get re-rendered\r\n * so they can detect that layout change.\r\n */\r\n presenceAffectsLayout ? undefined : [isPresent]);\r\n useMemo(() => {\r\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\r\n }, [isPresent]);\r\n /**\r\n * If there's no `motion` components to fire exit animations, we want to remove this\r\n * component immediately.\r\n */\r\n React.useEffect(() => {\r\n !isPresent &&\r\n !presenceChildren.size &&\r\n onExitComplete &&\r\n onExitComplete();\r\n }, [isPresent]);\r\n if (mode === \"popLayout\") {\r\n children = React.createElement(PopChild, { isPresent: isPresent }, children);\r\n }\r\n return (React.createElement(PresenceContext.Provider, { value: context }, children));\r\n};\r\nfunction newChildrenMap() {\r\n return new Map();\r\n}\r\n\r\nexport { PresenceChild };\r\n","import { useEffect } from 'react';\r\n\r\nfunction useUnmountEffect(callback) {\r\n return useEffect(() => () => callback(), []);\r\n}\r\n\r\nexport { useUnmountEffect };\r\n","import * as React from 'react';\r\nimport { useContext, useRef, cloneElement, Children, isValidElement } from 'react';\r\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\r\nimport { useIsMounted } from '../../utils/use-is-mounted.mjs';\r\nimport { PresenceChild } from './PresenceChild.mjs';\r\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\r\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\r\nimport { invariant } from '../../utils/errors.mjs';\r\n\r\nconst getChildKey = (child) => child.key || \"\";\r\nfunction updateChildLookup(children, allChildren) {\r\n children.forEach((child) => {\r\n const key = getChildKey(child);\r\n allChildren.set(key, child);\r\n });\r\n}\r\nfunction onlyElements(children) {\r\n const filtered = [];\r\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\r\n Children.forEach(children, (child) => {\r\n if (isValidElement(child))\r\n filtered.push(child);\r\n });\r\n return filtered;\r\n}\r\n/**\r\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\r\n *\r\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\r\n *\r\n * Any `motion` components that have an `exit` property defined will animate out when removed from\r\n * the tree.\r\n *\r\n * ```jsx\r\n * import { motion, AnimatePresence } from 'framer-motion'\r\n *\r\n * export const Items = ({ items }) => (\r\n * \r\n * {items.map(item => (\r\n * \r\n * ))}\r\n * \r\n * )\r\n * ```\r\n *\r\n * You can sequence exit animations throughout a tree using variants.\r\n *\r\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\r\n * once all `motion` components have finished animating out. Likewise, any components using\r\n * `usePresence` all need to call `safeToRemove`.\r\n *\r\n * @public\r\n */\r\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, exitBeforeEnter, presenceAffectsLayout = true, mode = \"sync\", }) => {\r\n invariant(!exitBeforeEnter, \"Replace exitBeforeEnter with mode='wait'\");\r\n // We want to force a re-render once all exiting animations have finished. We\r\n // either use a local forceRender function, or one from a parent context if it exists.\r\n const forceRender = useContext(LayoutGroupContext).forceRender || useForceUpdate()[0];\r\n const isMounted = useIsMounted();\r\n // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key\r\n const filteredChildren = onlyElements(children);\r\n let childrenToRender = filteredChildren;\r\n const exitingChildren = useRef(new Map()).current;\r\n // Keep a living record of the children we're actually rendering so we\r\n // can diff to figure out which are entering and exiting\r\n const presentChildren = useRef(childrenToRender);\r\n // A lookup table to quickly reference components by key\r\n const allChildren = useRef(new Map()).current;\r\n // If this is the initial component render, just deal with logic surrounding whether\r\n // we play onMount animations or not.\r\n const isInitialRender = useRef(true);\r\n useIsomorphicLayoutEffect(() => {\r\n isInitialRender.current = false;\r\n updateChildLookup(filteredChildren, allChildren);\r\n presentChildren.current = childrenToRender;\r\n });\r\n useUnmountEffect(() => {\r\n isInitialRender.current = true;\r\n allChildren.clear();\r\n exitingChildren.clear();\r\n });\r\n if (isInitialRender.current) {\r\n return (React.createElement(React.Fragment, null, childrenToRender.map((child) => (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child)))));\r\n }\r\n // If this is a subsequent render, deal with entering and exiting children\r\n childrenToRender = [...childrenToRender];\r\n // Diff the keys of the currently-present and target children to update our\r\n // exiting list.\r\n const presentKeys = presentChildren.current.map(getChildKey);\r\n const targetKeys = filteredChildren.map(getChildKey);\r\n // Diff the present children with our target children and mark those that are exiting\r\n const numPresent = presentKeys.length;\r\n for (let i = 0; i < numPresent; i++) {\r\n const key = presentKeys[i];\r\n if (targetKeys.indexOf(key) === -1 && !exitingChildren.has(key)) {\r\n exitingChildren.set(key, undefined);\r\n }\r\n }\r\n // If we currently have exiting children, and we're deferring rendering incoming children\r\n // until after all current children have exiting, empty the childrenToRender array\r\n if (mode === \"wait\" && exitingChildren.size) {\r\n childrenToRender = [];\r\n }\r\n // Loop through all currently exiting components and clone them to overwrite `animate`\r\n // with any `exit` prop they might have defined.\r\n exitingChildren.forEach((component, key) => {\r\n // If this component is actually entering again, early return\r\n if (targetKeys.indexOf(key) !== -1)\r\n return;\r\n const child = allChildren.get(key);\r\n if (!child)\r\n return;\r\n const insertionIndex = presentKeys.indexOf(key);\r\n let exitingComponent = component;\r\n if (!exitingComponent) {\r\n const onExit = () => {\r\n // clean up the exiting children map\r\n exitingChildren.delete(key);\r\n // compute the keys of children that were rendered once but are no longer present\r\n // this could happen in case of too many fast consequent renderings\r\n // @link https://github.com/framer/motion/issues/2023\r\n const leftOverKeys = Array.from(allChildren.keys()).filter((childKey) => !targetKeys.includes(childKey));\r\n // clean up the all children map\r\n leftOverKeys.forEach((leftOverKey) => allChildren.delete(leftOverKey));\r\n // make sure to render only the children that are actually visible\r\n presentChildren.current = filteredChildren.filter((presentChild) => {\r\n const presentChildKey = getChildKey(presentChild);\r\n return (\r\n // filter out the node exiting\r\n presentChildKey === key ||\r\n // filter out the leftover children\r\n leftOverKeys.includes(presentChildKey));\r\n });\r\n // Defer re-rendering until all exiting children have indeed left\r\n if (!exitingChildren.size) {\r\n if (isMounted.current === false)\r\n return;\r\n forceRender();\r\n onExitComplete && onExitComplete();\r\n }\r\n };\r\n exitingComponent = (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\r\n exitingChildren.set(key, exitingComponent);\r\n }\r\n childrenToRender.splice(insertionIndex, 0, exitingComponent);\r\n });\r\n // Add `MotionContext` even to children that don't need it to ensure we're rendering\r\n // the same tree between renders\r\n childrenToRender = childrenToRender.map((child) => {\r\n const key = child.key;\r\n return exitingChildren.has(key) ? (child) : (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\r\n });\r\n if (process.env.NODE_ENV !== \"production\" &&\r\n mode === \"wait\" &&\r\n childrenToRender.length > 1) {\r\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\r\n }\r\n return (React.createElement(React.Fragment, null, exitingChildren.size\r\n ? childrenToRender\r\n : childrenToRender.map((child) => cloneElement(child))));\r\n};\r\n\r\nexport { AnimatePresence };\r\n","import * as React from 'react';\r\nimport { useContext, useMemo } from 'react';\r\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\r\nimport { loadExternalIsValidProp } from '../../render/dom/utils/filter-props.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\n\r\n/**\r\n * `MotionConfig` is used to set configuration options for all children `motion` components.\r\n *\r\n * ```jsx\r\n * import { motion, MotionConfig } from \"framer-motion\"\r\n *\r\n * export function App() {\r\n * return (\r\n * \r\n * \r\n * \r\n * )\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction MotionConfig({ children, isValidProp, ...config }) {\r\n isValidProp && loadExternalIsValidProp(isValidProp);\r\n /**\r\n * Inherit props from any parent MotionConfig components\r\n */\r\n config = { ...useContext(MotionConfigContext), ...config };\r\n /**\r\n * Don't allow isStatic to change between renders as it affects how many hooks\r\n * motion components fire.\r\n */\r\n config.isStatic = useConstant(() => config.isStatic);\r\n /**\r\n * Creating a new config context object will re-render every `motion` component\r\n * every time it renders. So we only want to create a new one sparingly.\r\n */\r\n const context = useMemo(() => config, [JSON.stringify(config.transition), config.transformPagePoint, config.reducedMotion]);\r\n return (React.createElement(MotionConfigContext.Provider, { value: context }, children));\r\n}\r\n\r\nexport { MotionConfig };\r\n","import * as React from 'react';\r\nimport { useState, useRef, useEffect } from 'react';\r\nimport { LazyContext } from '../../context/LazyContext.mjs';\r\nimport { loadFeatures } from '../../motion/features/load-features.mjs';\r\n\r\n/**\r\n * Used in conjunction with the `m` component to reduce bundle size.\r\n *\r\n * `m` is a version of the `motion` component that only loads functionality\r\n * critical for the initial render.\r\n *\r\n * `LazyMotion` can then be used to either synchronously or asynchronously\r\n * load animation and gesture support.\r\n *\r\n * ```jsx\r\n * // Synchronous loading\r\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\r\n *\r\n * function App() {\r\n * return (\r\n * \r\n * \r\n * \r\n * )\r\n * }\r\n *\r\n * // Asynchronous loading\r\n * import { LazyMotion, m } from \"framer-motion\"\r\n *\r\n * function App() {\r\n * return (\r\n * import('./path/to/domAnimation')}>\r\n * \r\n * \r\n * )\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction LazyMotion({ children, features, strict = false }) {\r\n const [, setIsLoaded] = useState(!isLazyBundle(features));\r\n const loadedRenderer = useRef(undefined);\r\n /**\r\n * If this is a synchronous load, load features immediately\r\n */\r\n if (!isLazyBundle(features)) {\r\n const { renderer, ...loadedFeatures } = features;\r\n loadedRenderer.current = renderer;\r\n loadFeatures(loadedFeatures);\r\n }\r\n useEffect(() => {\r\n if (isLazyBundle(features)) {\r\n features().then(({ renderer, ...loadedFeatures }) => {\r\n loadFeatures(loadedFeatures);\r\n loadedRenderer.current = renderer;\r\n setIsLoaded(true);\r\n });\r\n }\r\n }, []);\r\n return (React.createElement(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict } }, children));\r\n}\r\nfunction isLazyBundle(features) {\r\n return typeof features === \"function\";\r\n}\r\n\r\nexport { LazyMotion };\r\n","import { createContext } from 'react';\r\n\r\n/**\r\n * Note: Still used by components generated by old versions of Framer\r\n *\r\n * @deprecated\r\n */\r\nconst DeprecatedLayoutGroupContext = createContext(null);\r\n\r\nexport { DeprecatedLayoutGroupContext };\r\n","const notify = (node) => !node.isLayoutDirty && node.willUpdate(false);\r\nfunction nodeGroup() {\r\n const nodes = new Set();\r\n const subscriptions = new WeakMap();\r\n const dirtyAll = () => nodes.forEach(notify);\r\n return {\r\n add: (node) => {\r\n nodes.add(node);\r\n subscriptions.set(node, node.addEventListener(\"willUpdate\", dirtyAll));\r\n },\r\n remove: (node) => {\r\n nodes.delete(node);\r\n const unsubscribe = subscriptions.get(node);\r\n if (unsubscribe) {\r\n unsubscribe();\r\n subscriptions.delete(node);\r\n }\r\n dirtyAll();\r\n },\r\n dirty: dirtyAll,\r\n };\r\n}\r\n\r\nexport { nodeGroup };\r\n","import * as React from 'react';\r\nimport { useContext, useRef, useMemo } from 'react';\r\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\r\nimport { DeprecatedLayoutGroupContext } from '../../context/DeprecatedLayoutGroupContext.mjs';\r\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\r\nimport { nodeGroup } from '../../projection/node/group.mjs';\r\n\r\nconst shouldInheritGroup = (inherit) => inherit === true;\r\nconst shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === \"id\";\r\nconst LayoutGroup = ({ children, id, inherit = true }) => {\r\n const layoutGroupContext = useContext(LayoutGroupContext);\r\n const deprecatedLayoutGroupContext = useContext(DeprecatedLayoutGroupContext);\r\n const [forceRender, key] = useForceUpdate();\r\n const context = useRef(null);\r\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext;\r\n if (context.current === null) {\r\n if (shouldInheritId(inherit) && upstreamId) {\r\n id = id ? upstreamId + \"-\" + id : upstreamId;\r\n }\r\n context.current = {\r\n id,\r\n group: shouldInheritGroup(inherit)\r\n ? layoutGroupContext.group || nodeGroup()\r\n : nodeGroup(),\r\n };\r\n }\r\n const memoizedContext = useMemo(() => ({ ...context.current, forceRender }), [key]);\r\n return (React.createElement(LayoutGroupContext.Provider, { value: memoizedContext }, children));\r\n};\r\n\r\nexport { LayoutGroup };\r\n","import { createContext } from 'react';\r\n\r\nconst ReorderContext = createContext(null);\r\n\r\nexport { ReorderContext };\r\n","import { moveItem } from '../../../utils/array.mjs';\r\nimport { mix } from '../../../utils/mix.mjs';\r\n\r\nfunction checkReorder(order, value, offset, velocity) {\r\n if (!velocity)\r\n return order;\r\n const index = order.findIndex((item) => item.value === value);\r\n if (index === -1)\r\n return order;\r\n const nextOffset = velocity > 0 ? 1 : -1;\r\n const nextItem = order[index + nextOffset];\r\n if (!nextItem)\r\n return order;\r\n const item = order[index];\r\n const nextLayout = nextItem.layout;\r\n const nextItemCenter = mix(nextLayout.min, nextLayout.max, 0.5);\r\n if ((nextOffset === 1 && item.layout.max + offset > nextItemCenter) ||\r\n (nextOffset === -1 && item.layout.min + offset < nextItemCenter)) {\r\n return moveItem(order, index, index + nextOffset);\r\n }\r\n return order;\r\n}\r\n\r\nexport { checkReorder };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport * as React from 'react';\r\nimport { forwardRef, useRef, useEffect } from 'react';\r\nimport { ReorderContext } from '../../context/ReorderContext.mjs';\r\nimport { motion } from '../../render/dom/motion.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { checkReorder } from './utils/check-reorder.mjs';\r\n\r\nfunction ReorderGroup({ children, as = \"ul\", axis = \"y\", onReorder, values, ...props }, externalRef) {\r\n const Component = useConstant(() => motion(as));\r\n const order = [];\r\n const isReordering = useRef(false);\r\n invariant(Boolean(values), \"Reorder.Group must be provided a values prop\");\r\n const context = {\r\n axis,\r\n registerItem: (value, layout) => {\r\n // If the entry was already added, update it rather than adding it again\r\n const idx = order.findIndex((entry) => value === entry.value);\r\n if (idx !== -1) {\r\n order[idx].layout = layout[axis];\r\n }\r\n else {\r\n order.push({ value: value, layout: layout[axis] });\r\n }\r\n order.sort(compareMin);\r\n },\r\n updateOrder: (item, offset, velocity) => {\r\n if (isReordering.current)\r\n return;\r\n const newOrder = checkReorder(order, item, offset, velocity);\r\n if (order !== newOrder) {\r\n isReordering.current = true;\r\n onReorder(newOrder\r\n .map(getValue)\r\n .filter((value) => values.indexOf(value) !== -1));\r\n }\r\n },\r\n };\r\n useEffect(() => {\r\n isReordering.current = false;\r\n });\r\n return (React.createElement(Component, { ...props, ref: externalRef, ignoreStrict: true },\r\n React.createElement(ReorderContext.Provider, { value: context }, children)));\r\n}\r\nconst Group = forwardRef(ReorderGroup);\r\nfunction getValue(item) {\r\n return item.value;\r\n}\r\nfunction compareMin(a, b) {\r\n return a.layout.min - b.layout.min;\r\n}\r\n\r\nexport { Group, ReorderGroup };\r\n","import { useContext, useState, useEffect } from 'react';\r\nimport { motionValue } from './index.mjs';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\n\r\n/**\r\n * Creates a `MotionValue` to track the state and velocity of a value.\r\n *\r\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\r\n *\r\n * ```jsx\r\n * export const MyComponent = () => {\r\n * const scale = useMotionValue(1)\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @param initial - The initial state.\r\n *\r\n * @public\r\n */\r\nfunction useMotionValue(initial) {\r\n const value = useConstant(() => motionValue(initial));\r\n /**\r\n * If this motion value is being used in static mode, like on\r\n * the Framer canvas, force components to rerender when the motion\r\n * value is updated.\r\n */\r\n const { isStatic } = useContext(MotionConfigContext);\r\n if (isStatic) {\r\n const [, setLatest] = useState(initial);\r\n useEffect(() => value.on(\"change\", setLatest), []);\r\n }\r\n return value;\r\n}\r\n\r\nexport { useMotionValue };\r\n","import { interpolate } from './interpolate.mjs';\r\n\r\nconst isCustomValueType = (v) => {\r\n return v && typeof v === \"object\" && v.mix;\r\n};\r\nconst getMixer = (v) => (isCustomValueType(v) ? v.mix : undefined);\r\nfunction transform(...args) {\r\n const useImmediate = !Array.isArray(args[0]);\r\n const argOffset = useImmediate ? 0 : -1;\r\n const inputValue = args[0 + argOffset];\r\n const inputRange = args[1 + argOffset];\r\n const outputRange = args[2 + argOffset];\r\n const options = args[3 + argOffset];\r\n const interpolator = interpolate(inputRange, outputRange, {\r\n mixer: getMixer(outputRange[0]),\r\n ...options,\r\n });\r\n return useImmediate ? interpolator(inputValue) : interpolator;\r\n}\r\n\r\nexport { transform };\r\n","import { useMotionValue } from './use-motion-value.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\r\nimport { cancelFrame, frame } from '../frameloop/frame.mjs';\r\n\r\nfunction useCombineMotionValues(values, combineValues) {\r\n /**\r\n * Initialise the returned motion value. This remains the same between renders.\r\n */\r\n const value = useMotionValue(combineValues());\r\n /**\r\n * Create a function that will update the template motion value with the latest values.\r\n * This is pre-bound so whenever a motion value updates it can schedule its\r\n * execution in Framesync. If it's already been scheduled it won't be fired twice\r\n * in a single frame.\r\n */\r\n const updateValue = () => value.set(combineValues());\r\n /**\r\n * Synchronously update the motion value with the latest values during the render.\r\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\r\n */\r\n updateValue();\r\n /**\r\n * Subscribe to all motion values found within the template. Whenever any of them change,\r\n * schedule an update.\r\n */\r\n useIsomorphicLayoutEffect(() => {\r\n const scheduleUpdate = () => frame.update(updateValue, false, true);\r\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate));\r\n return () => {\r\n subscriptions.forEach((unsubscribe) => unsubscribe());\r\n cancelFrame(updateValue);\r\n };\r\n });\r\n return value;\r\n}\r\n\r\nexport { useCombineMotionValues };\r\n","import { collectMotionValues } from './index.mjs';\r\nimport { useCombineMotionValues } from './use-combine-values.mjs';\r\n\r\nfunction useComputed(compute) {\r\n /**\r\n * Open session of collectMotionValues. Any MotionValue that calls get()\r\n * will be saved into this array.\r\n */\r\n collectMotionValues.current = [];\r\n compute();\r\n const value = useCombineMotionValues(collectMotionValues.current, compute);\r\n /**\r\n * Synchronously close session of collectMotionValues.\r\n */\r\n collectMotionValues.current = undefined;\r\n return value;\r\n}\r\n\r\nexport { useComputed };\r\n","import { transform } from '../utils/transform.mjs';\r\nimport { useCombineMotionValues } from './use-combine-values.mjs';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\nimport { useComputed } from './use-computed.mjs';\r\n\r\nfunction useTransform(input, inputRangeOrTransformer, outputRange, options) {\r\n if (typeof input === \"function\") {\r\n return useComputed(input);\r\n }\r\n const transformer = typeof inputRangeOrTransformer === \"function\"\r\n ? inputRangeOrTransformer\r\n : transform(inputRangeOrTransformer, outputRange, options);\r\n return Array.isArray(input)\r\n ? useListTransform(input, transformer)\r\n : useListTransform([input], ([latest]) => transformer(latest));\r\n}\r\nfunction useListTransform(values, transformer) {\r\n const latest = useConstant(() => []);\r\n return useCombineMotionValues(values, () => {\r\n latest.length = 0;\r\n const numValues = values.length;\r\n for (let i = 0; i < numValues; i++) {\r\n latest[i] = values[i].get();\r\n }\r\n return transformer(latest);\r\n });\r\n}\r\n\r\nexport { useTransform };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport * as React from 'react';\r\nimport { forwardRef, useContext } from 'react';\r\nimport { ReorderContext } from '../../context/ReorderContext.mjs';\r\nimport { motion } from '../../render/dom/motion.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { useMotionValue } from '../../value/use-motion-value.mjs';\r\nimport { useTransform } from '../../value/use-transform.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction useDefaultMotionValue(value, defaultValue = 0) {\r\n return isMotionValue(value) ? value : useMotionValue(defaultValue);\r\n}\r\nfunction ReorderItem({ children, style = {}, value, as = \"li\", onDrag, layout = true, ...props }, externalRef) {\r\n const Component = useConstant(() => motion(as));\r\n const context = useContext(ReorderContext);\r\n const point = {\r\n x: useDefaultMotionValue(style.x),\r\n y: useDefaultMotionValue(style.y),\r\n };\r\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : \"unset\");\r\n invariant(Boolean(context), \"Reorder.Item must be a child of Reorder.Group\");\r\n const { axis, registerItem, updateOrder } = context;\r\n return (React.createElement(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => {\r\n const { velocity } = gesturePoint;\r\n velocity[axis] &&\r\n updateOrder(value, point[axis].get(), velocity[axis]);\r\n onDrag && onDrag(event, gesturePoint);\r\n }, onLayoutMeasure: (measured) => registerItem(value, measured), ref: externalRef, ignoreStrict: true }, children));\r\n}\r\nconst Item = forwardRef(ReorderItem);\r\n\r\nexport { Item, ReorderItem };\r\n","import { Group } from './Group.mjs';\r\nimport { Item } from './Item.mjs';\r\n\r\nconst Reorder = {\r\n Group,\r\n Item,\r\n};\r\n\r\nexport { Reorder };\r\n","import { animations } from '../../motion/features/animations.mjs';\r\nimport { gestureAnimations } from '../../motion/features/gestures.mjs';\r\nimport { createDomVisualElement } from './create-visual-element.mjs';\r\n\r\n/**\r\n * @public\r\n */\r\nconst domAnimation = {\r\n renderer: createDomVisualElement,\r\n ...animations,\r\n ...gestureAnimations,\r\n};\r\n\r\nexport { domAnimation };\r\n","import { drag } from '../../motion/features/drag.mjs';\r\nimport { layout } from '../../motion/features/layout.mjs';\r\nimport { domAnimation } from './features-animation.mjs';\r\n\r\n/**\r\n * @public\r\n */\r\nconst domMax = {\r\n ...domAnimation,\r\n ...drag,\r\n ...layout,\r\n};\r\n\r\nexport { domMax };\r\n","import { useCombineMotionValues } from './use-combine-values.mjs';\r\nimport { isMotionValue } from './utils/is-motion-value.mjs';\r\n\r\n/**\r\n * Combine multiple motion values into a new one using a string template literal.\r\n *\r\n * ```jsx\r\n * import {\r\n * motion,\r\n * useSpring,\r\n * useMotionValue,\r\n * useMotionTemplate\r\n * } from \"framer-motion\"\r\n *\r\n * function Component() {\r\n * const shadowX = useSpring(0)\r\n * const shadowY = useMotionValue(0)\r\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useMotionTemplate(fragments, ...values) {\r\n /**\r\n * Create a function that will build a string from the latest motion values.\r\n */\r\n const numFragments = fragments.length;\r\n function buildValue() {\r\n let output = ``;\r\n for (let i = 0; i < numFragments; i++) {\r\n output += fragments[i];\r\n const value = values[i];\r\n if (value) {\r\n output += isMotionValue(value) ? value.get() : value;\r\n }\r\n }\r\n return output;\r\n }\r\n return useCombineMotionValues(values.filter(isMotionValue), buildValue);\r\n}\r\n\r\nexport { useMotionTemplate };\r\n","import { useContext, useRef, useInsertionEffect } from 'react';\r\nimport { isMotionValue } from './utils/is-motion-value.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\r\nimport { animateValue } from '../animation/animators/js/index.mjs';\r\nimport { millisecondsToSeconds } from '../utils/time-conversion.mjs';\r\nimport { frameData } from '../frameloop/frame.mjs';\r\n\r\n/**\r\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\r\n *\r\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\r\n * to another `MotionValue`.\r\n *\r\n * @remarks\r\n *\r\n * ```jsx\r\n * const x = useSpring(0, { stiffness: 300 })\r\n * const y = useSpring(x, { damping: 10 })\r\n * ```\r\n *\r\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\r\n * @param springConfig - Configuration options for the spring.\r\n * @returns `MotionValue`\r\n *\r\n * @public\r\n */\r\nfunction useSpring(source, config = {}) {\r\n const { isStatic } = useContext(MotionConfigContext);\r\n const activeSpringAnimation = useRef(null);\r\n const value = useMotionValue(isMotionValue(source) ? source.get() : source);\r\n const stopAnimation = () => {\r\n if (activeSpringAnimation.current) {\r\n activeSpringAnimation.current.stop();\r\n }\r\n };\r\n useInsertionEffect(() => {\r\n return value.attach((v, set) => {\r\n /**\r\n * A more hollistic approach to this might be to use isStatic to fix VisualElement animations\r\n * at that level, but this will work for now\r\n */\r\n if (isStatic)\r\n return set(v);\r\n stopAnimation();\r\n activeSpringAnimation.current = animateValue({\r\n keyframes: [value.get(), v],\r\n velocity: value.getVelocity(),\r\n type: \"spring\",\r\n restDelta: 0.001,\r\n restSpeed: 0.01,\r\n ...config,\r\n onUpdate: set,\r\n });\r\n /**\r\n * If we're between frames, resync the animation to the frameloop.\r\n */\r\n if (!frameData.isProcessing) {\r\n const delta = performance.now() - frameData.timestamp;\r\n if (delta < 30) {\r\n activeSpringAnimation.current.time =\r\n millisecondsToSeconds(delta);\r\n }\r\n }\r\n return value.get();\r\n }, stopAnimation);\r\n }, [JSON.stringify(config)]);\r\n useIsomorphicLayoutEffect(() => {\r\n if (isMotionValue(source)) {\r\n return source.on(\"change\", (v) => value.set(parseFloat(v)));\r\n }\r\n }, [value]);\r\n return value;\r\n}\r\n\r\nexport { useSpring };\r\n","import { useInsertionEffect } from 'react';\r\n\r\nfunction useMotionValueEvent(value, event, callback) {\r\n /**\r\n * useInsertionEffect will create subscriptions before any other\r\n * effects will run. Effects run upwards through the tree so it\r\n * can be that binding a useLayoutEffect higher up the tree can\r\n * miss changes from lower down the tree.\r\n */\r\n useInsertionEffect(() => value.on(event, callback), [value, event, callback]);\r\n}\r\n\r\nexport { useMotionValueEvent };\r\n","import { useMotionValueEvent } from '../utils/use-motion-value-event.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\n\r\n/**\r\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\r\n *\r\n * ```javascript\r\n * const x = useMotionValue(0)\r\n * const xVelocity = useVelocity(x)\r\n * const xAcceleration = useVelocity(xVelocity)\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useVelocity(value) {\r\n const velocity = useMotionValue(value.getVelocity());\r\n useMotionValueEvent(value, \"velocityChange\", (newVelocity) => {\r\n velocity.set(newVelocity);\r\n });\r\n return velocity;\r\n}\r\n\r\nexport { useVelocity };\r\n","import { invariant } from '../../../utils/errors.mjs';\r\n\r\nfunction resolveElements(elements, scope, selectorCache) {\r\n var _a;\r\n if (typeof elements === \"string\") {\r\n let root = document;\r\n if (scope) {\r\n invariant(Boolean(scope.current), \"Scope provided, but no element detected.\");\r\n root = scope.current;\r\n }\r\n if (selectorCache) {\r\n (_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : (selectorCache[elements] = root.querySelectorAll(elements));\r\n elements = selectorCache[elements];\r\n }\r\n else {\r\n elements = root.querySelectorAll(elements);\r\n }\r\n }\r\n else if (elements instanceof Element) {\r\n elements = [elements];\r\n }\r\n /**\r\n * Return an empty array\r\n */\r\n return Array.from(elements || []);\r\n}\r\n\r\nexport { resolveElements };\r\n","import { resolveElements } from '../utils/resolve-element.mjs';\r\n\r\nconst resizeHandlers = new WeakMap();\r\nlet observer;\r\nfunction getElementSize(target, borderBoxSize) {\r\n if (borderBoxSize) {\r\n const { inlineSize, blockSize } = borderBoxSize[0];\r\n return { width: inlineSize, height: blockSize };\r\n }\r\n else if (target instanceof SVGElement && \"getBBox\" in target) {\r\n return target.getBBox();\r\n }\r\n else {\r\n return {\r\n width: target.offsetWidth,\r\n height: target.offsetHeight,\r\n };\r\n }\r\n}\r\nfunction notifyTarget({ target, contentRect, borderBoxSize, }) {\r\n var _a;\r\n (_a = resizeHandlers.get(target)) === null || _a === void 0 ? void 0 : _a.forEach((handler) => {\r\n handler({\r\n target,\r\n contentSize: contentRect,\r\n get size() {\r\n return getElementSize(target, borderBoxSize);\r\n },\r\n });\r\n });\r\n}\r\nfunction notifyAll(entries) {\r\n entries.forEach(notifyTarget);\r\n}\r\nfunction createResizeObserver() {\r\n if (typeof ResizeObserver === \"undefined\")\r\n return;\r\n observer = new ResizeObserver(notifyAll);\r\n}\r\nfunction resizeElement(target, handler) {\r\n if (!observer)\r\n createResizeObserver();\r\n const elements = resolveElements(target);\r\n elements.forEach((element) => {\r\n let elementHandlers = resizeHandlers.get(element);\r\n if (!elementHandlers) {\r\n elementHandlers = new Set();\r\n resizeHandlers.set(element, elementHandlers);\r\n }\r\n elementHandlers.add(handler);\r\n observer === null || observer === void 0 ? void 0 : observer.observe(element);\r\n });\r\n return () => {\r\n elements.forEach((element) => {\r\n const elementHandlers = resizeHandlers.get(element);\r\n elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.delete(handler);\r\n if (!(elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.size)) {\r\n observer === null || observer === void 0 ? void 0 : observer.unobserve(element);\r\n }\r\n });\r\n };\r\n}\r\n\r\nexport { resizeElement };\r\n","const windowCallbacks = new Set();\r\nlet windowResizeHandler;\r\nfunction createWindowResizeHandler() {\r\n windowResizeHandler = () => {\r\n const size = {\r\n width: window.innerWidth,\r\n height: window.innerHeight,\r\n };\r\n const info = {\r\n target: window,\r\n size,\r\n contentSize: size,\r\n };\r\n windowCallbacks.forEach((callback) => callback(info));\r\n };\r\n window.addEventListener(\"resize\", windowResizeHandler);\r\n}\r\nfunction resizeWindow(callback) {\r\n windowCallbacks.add(callback);\r\n if (!windowResizeHandler)\r\n createWindowResizeHandler();\r\n return () => {\r\n windowCallbacks.delete(callback);\r\n if (!windowCallbacks.size && windowResizeHandler) {\r\n windowResizeHandler = undefined;\r\n }\r\n };\r\n}\r\n\r\nexport { resizeWindow };\r\n","import { resizeElement } from './handle-element.mjs';\r\nimport { resizeWindow } from './handle-window.mjs';\r\n\r\nfunction resize(a, b) {\r\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\r\n}\r\n\r\nexport { resize };\r\n","import { progress } from '../../../utils/progress.mjs';\r\nimport { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';\r\n\r\n/**\r\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\r\n */\r\nconst maxElapsed = 50;\r\nconst createAxisInfo = () => ({\r\n current: 0,\r\n offset: [],\r\n progress: 0,\r\n scrollLength: 0,\r\n targetOffset: 0,\r\n targetLength: 0,\r\n containerLength: 0,\r\n velocity: 0,\r\n});\r\nconst createScrollInfo = () => ({\r\n time: 0,\r\n x: createAxisInfo(),\r\n y: createAxisInfo(),\r\n});\r\nconst keys = {\r\n x: {\r\n length: \"Width\",\r\n position: \"Left\",\r\n },\r\n y: {\r\n length: \"Height\",\r\n position: \"Top\",\r\n },\r\n};\r\nfunction updateAxisInfo(element, axisName, info, time) {\r\n const axis = info[axisName];\r\n const { length, position } = keys[axisName];\r\n const prev = axis.current;\r\n const prevTime = info.time;\r\n axis.current = element[\"scroll\" + position];\r\n axis.scrollLength = element[\"scroll\" + length] - element[\"client\" + length];\r\n axis.offset.length = 0;\r\n axis.offset[0] = 0;\r\n axis.offset[1] = axis.scrollLength;\r\n axis.progress = progress(0, axis.scrollLength, axis.current);\r\n const elapsed = time - prevTime;\r\n axis.velocity =\r\n elapsed > maxElapsed\r\n ? 0\r\n : velocityPerSecond(axis.current - prev, elapsed);\r\n}\r\nfunction updateScrollInfo(element, info, time) {\r\n updateAxisInfo(element, \"x\", info, time);\r\n updateAxisInfo(element, \"y\", info, time);\r\n info.time = time;\r\n}\r\n\r\nexport { createScrollInfo, updateScrollInfo };\r\n","function calcInset(element, container) {\r\n const inset = { x: 0, y: 0 };\r\n let current = element;\r\n while (current && current !== container) {\r\n if (current instanceof HTMLElement) {\r\n inset.x += current.offsetLeft;\r\n inset.y += current.offsetTop;\r\n current = current.offsetParent;\r\n }\r\n else if (current.tagName === \"svg\") {\r\n /**\r\n * This isn't an ideal approach to measuring the offset of tags.\r\n * It would be preferable, given they behave like HTMLElements in most ways\r\n * to use offsetLeft/Top. But these don't exist on . Likewise we\r\n * can't use .getBBox() like most SVG elements as these provide the offset\r\n * relative to the SVG itself, which for is usually 0x0.\r\n */\r\n const svgBoundingBox = current.getBoundingClientRect();\r\n current = current.parentElement;\r\n const parentBoundingBox = current.getBoundingClientRect();\r\n inset.x += svgBoundingBox.left - parentBoundingBox.left;\r\n inset.y += svgBoundingBox.top - parentBoundingBox.top;\r\n }\r\n else if (current instanceof SVGGraphicsElement) {\r\n const { x, y } = current.getBBox();\r\n inset.x += x;\r\n inset.y += y;\r\n let svg = null;\r\n let parent = current.parentNode;\r\n while (!svg) {\r\n if (parent.tagName === \"svg\") {\r\n svg = parent;\r\n }\r\n parent = current.parentNode;\r\n }\r\n current = svg;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n return inset;\r\n}\r\n\r\nexport { calcInset };\r\n","const ScrollOffset = {\r\n Enter: [\r\n [0, 1],\r\n [1, 1],\r\n ],\r\n Exit: [\r\n [0, 0],\r\n [1, 0],\r\n ],\r\n Any: [\r\n [1, 0],\r\n [0, 1],\r\n ],\r\n All: [\r\n [0, 0],\r\n [1, 1],\r\n ],\r\n};\r\n\r\nexport { ScrollOffset };\r\n","const namedEdges = {\r\n start: 0,\r\n center: 0.5,\r\n end: 1,\r\n};\r\nfunction resolveEdge(edge, length, inset = 0) {\r\n let delta = 0;\r\n /**\r\n * If we have this edge defined as a preset, replace the definition\r\n * with the numerical value.\r\n */\r\n if (namedEdges[edge] !== undefined) {\r\n edge = namedEdges[edge];\r\n }\r\n /**\r\n * Handle unit values\r\n */\r\n if (typeof edge === \"string\") {\r\n const asNumber = parseFloat(edge);\r\n if (edge.endsWith(\"px\")) {\r\n delta = asNumber;\r\n }\r\n else if (edge.endsWith(\"%\")) {\r\n edge = asNumber / 100;\r\n }\r\n else if (edge.endsWith(\"vw\")) {\r\n delta = (asNumber / 100) * document.documentElement.clientWidth;\r\n }\r\n else if (edge.endsWith(\"vh\")) {\r\n delta = (asNumber / 100) * document.documentElement.clientHeight;\r\n }\r\n else {\r\n edge = asNumber;\r\n }\r\n }\r\n /**\r\n * If the edge is defined as a number, handle as a progress value.\r\n */\r\n if (typeof edge === \"number\") {\r\n delta = length * edge;\r\n }\r\n return inset + delta;\r\n}\r\n\r\nexport { namedEdges, resolveEdge };\r\n","import { namedEdges, resolveEdge } from './edge.mjs';\r\n\r\nconst defaultOffset = [0, 0];\r\nfunction resolveOffset(offset, containerLength, targetLength, targetInset) {\r\n let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;\r\n let targetPoint = 0;\r\n let containerPoint = 0;\r\n if (typeof offset === \"number\") {\r\n /**\r\n * If we're provided offset: [0, 0.5, 1] then each number x should become\r\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\r\n * and container etc.\r\n */\r\n offsetDefinition = [offset, offset];\r\n }\r\n else if (typeof offset === \"string\") {\r\n offset = offset.trim();\r\n if (offset.includes(\" \")) {\r\n offsetDefinition = offset.split(\" \");\r\n }\r\n else {\r\n /**\r\n * If we're provided a definition like \"100px\" then we want to apply\r\n * that only to the top of the target point, leaving the container at 0.\r\n * Whereas a named offset like \"end\" should be applied to both.\r\n */\r\n offsetDefinition = [offset, namedEdges[offset] ? offset : `0`];\r\n }\r\n }\r\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);\r\n containerPoint = resolveEdge(offsetDefinition[1], containerLength);\r\n return targetPoint - containerPoint;\r\n}\r\n\r\nexport { resolveOffset };\r\n","import { calcInset } from './inset.mjs';\r\nimport { ScrollOffset } from './presets.mjs';\r\nimport { resolveOffset } from './offset.mjs';\r\nimport { interpolate } from '../../../../utils/interpolate.mjs';\r\nimport { defaultOffset } from '../../../../utils/offsets/default.mjs';\r\n\r\nconst point = { x: 0, y: 0 };\r\nfunction getTargetSize(target) {\r\n return \"getBBox\" in target && target.tagName !== \"svg\"\r\n ? target.getBBox()\r\n : { width: target.clientWidth, height: target.clientHeight };\r\n}\r\nfunction resolveOffsets(container, info, options) {\r\n let { offset: offsetDefinition = ScrollOffset.All } = options;\r\n const { target = container, axis = \"y\" } = options;\r\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\";\r\n const inset = target !== container ? calcInset(target, container) : point;\r\n /**\r\n * Measure the target and container. If they're the same thing then we\r\n * use the container's scrollWidth/Height as the target, from there\r\n * all other calculations can remain the same.\r\n */\r\n const targetSize = target === container\r\n ? { width: container.scrollWidth, height: container.scrollHeight }\r\n : getTargetSize(target);\r\n const containerSize = {\r\n width: container.clientWidth,\r\n height: container.clientHeight,\r\n };\r\n /**\r\n * Reset the length of the resolved offset array rather than creating a new one.\r\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\r\n */\r\n info[axis].offset.length = 0;\r\n /**\r\n * Populate the offset array by resolving the user's offset definition into\r\n * a list of pixel scroll offets.\r\n */\r\n let hasChanged = !info[axis].interpolate;\r\n const numOffsets = offsetDefinition.length;\r\n for (let i = 0; i < numOffsets; i++) {\r\n const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);\r\n if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {\r\n hasChanged = true;\r\n }\r\n info[axis].offset[i] = offset;\r\n }\r\n /**\r\n * If the pixel scroll offsets have changed, create a new interpolator function\r\n * to map scroll value into a progress.\r\n */\r\n if (hasChanged) {\r\n info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition));\r\n info[axis].interpolatorOffsets = [...info[axis].offset];\r\n }\r\n info[axis].progress = info[axis].interpolate(info[axis].current);\r\n}\r\n\r\nexport { resolveOffsets };\r\n","import { warnOnce } from '../../../utils/warn-once.mjs';\r\nimport { updateScrollInfo } from './info.mjs';\r\nimport { resolveOffsets } from './offsets/index.mjs';\r\n\r\nfunction measure(container, target = container, info) {\r\n /**\r\n * Find inset of target within scrollable container\r\n */\r\n info.x.targetOffset = 0;\r\n info.y.targetOffset = 0;\r\n if (target !== container) {\r\n let node = target;\r\n while (node && node !== container) {\r\n info.x.targetOffset += node.offsetLeft;\r\n info.y.targetOffset += node.offsetTop;\r\n node = node.offsetParent;\r\n }\r\n }\r\n info.x.targetLength =\r\n target === container ? target.scrollWidth : target.clientWidth;\r\n info.y.targetLength =\r\n target === container ? target.scrollHeight : target.clientHeight;\r\n info.x.containerLength = container.clientWidth;\r\n info.y.containerLength = container.clientHeight;\r\n /**\r\n * In development mode ensure scroll containers aren't position: static as this makes\r\n * it difficult to measure their relative positions.\r\n */\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (container && target && target !== container) {\r\n warnOnce(getComputedStyle(container).position !== \"static\", \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\");\r\n }\r\n }\r\n}\r\nfunction createOnScrollHandler(element, onScroll, info, options = {}) {\r\n return {\r\n measure: () => measure(element, options.target, info),\r\n update: (time) => {\r\n updateScrollInfo(element, info, time);\r\n if (options.offset || options.target) {\r\n resolveOffsets(element, info, options);\r\n }\r\n },\r\n notify: () => onScroll(info),\r\n };\r\n}\r\n\r\nexport { createOnScrollHandler };\r\n","import { resize } from '../resize/index.mjs';\r\nimport { createScrollInfo } from './info.mjs';\r\nimport { createOnScrollHandler } from './on-scroll-handler.mjs';\r\nimport { frame, cancelFrame, frameData } from '../../../frameloop/frame.mjs';\r\n\r\nconst scrollListeners = new WeakMap();\r\nconst resizeListeners = new WeakMap();\r\nconst onScrollHandlers = new WeakMap();\r\nconst getEventTarget = (element) => element === document.documentElement ? window : element;\r\nfunction scrollInfo(onScroll, { container = document.documentElement, ...options } = {}) {\r\n let containerHandlers = onScrollHandlers.get(container);\r\n /**\r\n * Get the onScroll handlers for this container.\r\n * If one isn't found, create a new one.\r\n */\r\n if (!containerHandlers) {\r\n containerHandlers = new Set();\r\n onScrollHandlers.set(container, containerHandlers);\r\n }\r\n /**\r\n * Create a new onScroll handler for the provided callback.\r\n */\r\n const info = createScrollInfo();\r\n const containerHandler = createOnScrollHandler(container, onScroll, info, options);\r\n containerHandlers.add(containerHandler);\r\n /**\r\n * Check if there's a scroll event listener for this container.\r\n * If not, create one.\r\n */\r\n if (!scrollListeners.has(container)) {\r\n const measureAll = () => {\r\n for (const handler of containerHandlers)\r\n handler.measure();\r\n };\r\n const updateAll = () => {\r\n for (const handler of containerHandlers) {\r\n handler.update(frameData.timestamp);\r\n }\r\n };\r\n const notifyAll = () => {\r\n for (const handler of containerHandlers)\r\n handler.notify();\r\n };\r\n const listener = () => {\r\n frame.read(measureAll, false, true);\r\n frame.read(updateAll, false, true);\r\n frame.update(notifyAll, false, true);\r\n };\r\n scrollListeners.set(container, listener);\r\n const target = getEventTarget(container);\r\n window.addEventListener(\"resize\", listener, { passive: true });\r\n if (container !== document.documentElement) {\r\n resizeListeners.set(container, resize(container, listener));\r\n }\r\n target.addEventListener(\"scroll\", listener, { passive: true });\r\n }\r\n const listener = scrollListeners.get(container);\r\n frame.read(listener, false, true);\r\n return () => {\r\n var _a;\r\n cancelFrame(listener);\r\n /**\r\n * Check if we even have any handlers for this container.\r\n */\r\n const currentHandlers = onScrollHandlers.get(container);\r\n if (!currentHandlers)\r\n return;\r\n currentHandlers.delete(containerHandler);\r\n if (currentHandlers.size)\r\n return;\r\n /**\r\n * If no more handlers, remove the scroll listener too.\r\n */\r\n const scrollListener = scrollListeners.get(container);\r\n scrollListeners.delete(container);\r\n if (scrollListener) {\r\n getEventTarget(container).removeEventListener(\"scroll\", scrollListener);\r\n (_a = resizeListeners.get(container)) === null || _a === void 0 ? void 0 : _a();\r\n window.removeEventListener(\"resize\", scrollListener);\r\n }\r\n };\r\n}\r\n\r\nexport { scrollInfo };\r\n","import { motionValue } from './index.mjs';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\nimport { useEffect } from 'react';\r\nimport { warning } from '../utils/errors.mjs';\r\nimport { scrollInfo } from '../render/dom/scroll/track.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\r\n\r\nfunction refWarning(name, ref) {\r\n warning(Boolean(!ref || ref.current), `You have defined a ${name} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref, or setting its \\`layoutEffect: false\\` option.`);\r\n}\r\nconst createScrollMotionValues = () => ({\r\n scrollX: motionValue(0),\r\n scrollY: motionValue(0),\r\n scrollXProgress: motionValue(0),\r\n scrollYProgress: motionValue(0),\r\n});\r\nfunction useScroll({ container, target, layoutEffect = true, ...options } = {}) {\r\n const values = useConstant(createScrollMotionValues);\r\n const useLifecycleEffect = layoutEffect\r\n ? useIsomorphicLayoutEffect\r\n : useEffect;\r\n useLifecycleEffect(() => {\r\n refWarning(\"target\", target);\r\n refWarning(\"container\", container);\r\n return scrollInfo(({ x, y }) => {\r\n values.scrollX.set(x.current);\r\n values.scrollXProgress.set(x.progress);\r\n values.scrollY.set(y.current);\r\n values.scrollYProgress.set(y.progress);\r\n }, {\r\n ...options,\r\n container: (container === null || container === void 0 ? void 0 : container.current) || undefined,\r\n target: (target === null || target === void 0 ? void 0 : target.current) || undefined,\r\n });\r\n }, [container, target, JSON.stringify(options.offset)]);\r\n return values;\r\n}\r\n\r\nexport { useScroll };\r\n","import { warnOnce } from '../../utils/warn-once.mjs';\r\nimport { useScroll } from '../use-scroll.mjs';\r\n\r\n/**\r\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\r\n */\r\nfunction useElementScroll(ref) {\r\n if (process.env.NODE_ENV === \"development\") {\r\n warnOnce(false, \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\");\r\n }\r\n return useScroll({ container: ref });\r\n}\r\n\r\nexport { useElementScroll };\r\n","import { warnOnce } from '../../utils/warn-once.mjs';\r\nimport { useScroll } from '../use-scroll.mjs';\r\n\r\n/**\r\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\r\n */\r\nfunction useViewportScroll() {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(false, \"useViewportScroll is deprecated. Convert to useScroll().\");\r\n }\r\n return useScroll();\r\n}\r\n\r\nexport { useViewportScroll };\r\n","import { useRef, useContext, useEffect } from 'react';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\r\n\r\nfunction useAnimationFrame(callback) {\r\n const initialTimestamp = useRef(0);\r\n const { isStatic } = useContext(MotionConfigContext);\r\n useEffect(() => {\r\n if (isStatic)\r\n return;\r\n const provideTimeSinceStart = ({ timestamp, delta }) => {\r\n if (!initialTimestamp.current)\r\n initialTimestamp.current = timestamp;\r\n callback(timestamp - initialTimestamp.current, delta);\r\n };\r\n frame.update(provideTimeSinceStart, true);\r\n return () => cancelFrame(provideTimeSinceStart);\r\n }, [callback]);\r\n}\r\n\r\nexport { useAnimationFrame };\r\n","import { useAnimationFrame } from '../utils/use-animation-frame.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\n\r\nfunction useTime() {\r\n const time = useMotionValue(0);\r\n useAnimationFrame((t) => time.set(t));\r\n return time;\r\n}\r\n\r\nexport { useTime };\r\n","import { isCSSVariableName } from '../../render/dom/utils/is-css-variable.mjs';\r\nimport { transformProps } from '../../render/html/utils/transform.mjs';\r\nimport { addUniqueItem, removeItem } from '../../utils/array.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { MotionValue } from '../index.mjs';\r\nimport { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\r\n\r\nclass WillChangeMotionValue extends MotionValue {\r\n constructor() {\r\n super(...arguments);\r\n this.members = [];\r\n this.transforms = new Set();\r\n }\r\n add(name) {\r\n let memberName;\r\n if (transformProps.has(name)) {\r\n this.transforms.add(name);\r\n memberName = \"transform\";\r\n }\r\n else if (!name.startsWith(\"origin\") &&\r\n !isCSSVariableName(name) &&\r\n name !== \"willChange\") {\r\n memberName = camelToDash(name);\r\n }\r\n if (memberName) {\r\n addUniqueItem(this.members, memberName);\r\n this.update();\r\n }\r\n }\r\n remove(name) {\r\n if (transformProps.has(name)) {\r\n this.transforms.delete(name);\r\n if (!this.transforms.size) {\r\n removeItem(this.members, \"transform\");\r\n }\r\n }\r\n else {\r\n removeItem(this.members, camelToDash(name));\r\n }\r\n this.update();\r\n }\r\n update() {\r\n this.set(this.members.length ? this.members.join(\", \") : \"auto\");\r\n }\r\n}\r\nfunction useWillChange() {\r\n return useConstant(() => new WillChangeMotionValue(\"auto\"));\r\n}\r\n\r\nexport { WillChangeMotionValue, useWillChange };\r\n","import { useState } from 'react';\r\nimport { initPrefersReducedMotion } from './index.mjs';\r\nimport { warnOnce } from '../warn-once.mjs';\r\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\r\n\r\n/**\r\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\r\n *\r\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\r\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\r\n *\r\n * It will actively respond to changes and re-render your components with the latest setting.\r\n *\r\n * ```jsx\r\n * export function Sidebar({ isOpen }) {\r\n * const shouldReduceMotion = useReducedMotion()\r\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\r\n *\r\n * return (\r\n * \r\n * )\r\n * }\r\n * ```\r\n *\r\n * @return boolean\r\n *\r\n * @public\r\n */\r\nfunction useReducedMotion() {\r\n /**\r\n * Lazy initialisation of prefersReducedMotion\r\n */\r\n !hasReducedMotionListener.current && initPrefersReducedMotion();\r\n const [shouldReduceMotion] = useState(prefersReducedMotion.current);\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\");\r\n }\r\n /**\r\n * TODO See if people miss automatically updating shouldReduceMotion setting\r\n */\r\n return shouldReduceMotion;\r\n}\r\n\r\nexport { useReducedMotion };\r\n","import { useContext } from 'react';\r\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\r\nimport { useReducedMotion } from './use-reduced-motion.mjs';\r\n\r\nfunction useReducedMotionConfig() {\r\n const reducedMotionPreference = useReducedMotion();\r\n const { reducedMotion } = useContext(MotionConfigContext);\r\n if (reducedMotion === \"never\") {\r\n return false;\r\n }\r\n else if (reducedMotion === \"always\") {\r\n return true;\r\n }\r\n else {\r\n return reducedMotionPreference;\r\n }\r\n}\r\n\r\nexport { useReducedMotionConfig };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport { setValues } from '../../render/utils/setters.mjs';\r\nimport { animateVisualElement } from '../interfaces/visual-element.mjs';\r\n\r\nfunction stopAnimation(visualElement) {\r\n visualElement.values.forEach((value) => value.stop());\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction animationControls() {\r\n /**\r\n * Track whether the host component has mounted.\r\n */\r\n let hasMounted = false;\r\n /**\r\n * A collection of linked component animation controls.\r\n */\r\n const subscribers = new Set();\r\n const controls = {\r\n subscribe(visualElement) {\r\n subscribers.add(visualElement);\r\n return () => void subscribers.delete(visualElement);\r\n },\r\n start(definition, transitionOverride) {\r\n invariant(hasMounted, \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\r\n const animations = [];\r\n subscribers.forEach((visualElement) => {\r\n animations.push(animateVisualElement(visualElement, definition, {\r\n transitionOverride,\r\n }));\r\n });\r\n return Promise.all(animations);\r\n },\r\n set(definition) {\r\n invariant(hasMounted, \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\r\n return subscribers.forEach((visualElement) => {\r\n setValues(visualElement, definition);\r\n });\r\n },\r\n stop() {\r\n subscribers.forEach((visualElement) => {\r\n stopAnimation(visualElement);\r\n });\r\n },\r\n mount() {\r\n hasMounted = true;\r\n return () => {\r\n hasMounted = false;\r\n controls.stop();\r\n };\r\n },\r\n };\r\n return controls;\r\n}\r\n\r\nexport { animationControls };\r\n","import { frame, cancelFrame } from '../../../frameloop/frame.mjs';\r\n\r\nfunction observeTimeline(update, timeline) {\r\n let prevProgress;\r\n const onFrame = () => {\r\n const { currentTime } = timeline;\r\n const percentage = currentTime === null ? 0 : currentTime.value;\r\n const progress = percentage / 100;\r\n if (prevProgress !== progress) {\r\n update(progress);\r\n }\r\n prevProgress = progress;\r\n };\r\n frame.update(onFrame, true);\r\n return () => cancelFrame(onFrame);\r\n}\r\n\r\nexport { observeTimeline };\r\n","import { memo } from '../../../utils/memo.mjs';\r\n\r\nconst supportsScrollTimeline = memo(() => window.ScrollTimeline !== undefined);\r\n\r\nexport { supportsScrollTimeline };\r\n","import { observeTimeline } from '../render/dom/scroll/observe.mjs';\r\nimport { supportsScrollTimeline } from '../render/dom/scroll/supports.mjs';\r\n\r\nclass GroupPlaybackControls {\r\n constructor(animations) {\r\n this.animations = animations.filter(Boolean);\r\n }\r\n then(onResolve, onReject) {\r\n return Promise.all(this.animations).then(onResolve).catch(onReject);\r\n }\r\n /**\r\n * TODO: Filter out cancelled or stopped animations before returning\r\n */\r\n getAll(propName) {\r\n return this.animations[0][propName];\r\n }\r\n setAll(propName, newValue) {\r\n for (let i = 0; i < this.animations.length; i++) {\r\n this.animations[i][propName] = newValue;\r\n }\r\n }\r\n attachTimeline(timeline) {\r\n const cancelAll = this.animations.map((animation) => {\r\n if (supportsScrollTimeline() && animation.attachTimeline) {\r\n animation.attachTimeline(timeline);\r\n }\r\n else {\r\n animation.pause();\r\n return observeTimeline((progress) => {\r\n animation.time = animation.duration * progress;\r\n }, timeline);\r\n }\r\n });\r\n return () => {\r\n cancelAll.forEach((cancelTimeline, i) => {\r\n if (cancelTimeline)\r\n cancelTimeline();\r\n this.animations[i].stop();\r\n });\r\n };\r\n }\r\n get time() {\r\n return this.getAll(\"time\");\r\n }\r\n set time(time) {\r\n this.setAll(\"time\", time);\r\n }\r\n get speed() {\r\n return this.getAll(\"speed\");\r\n }\r\n set speed(speed) {\r\n this.setAll(\"speed\", speed);\r\n }\r\n get duration() {\r\n let max = 0;\r\n for (let i = 0; i < this.animations.length; i++) {\r\n max = Math.max(max, this.animations[i].duration);\r\n }\r\n return max;\r\n }\r\n runAll(methodName) {\r\n this.animations.forEach((controls) => controls[methodName]());\r\n }\r\n play() {\r\n this.runAll(\"play\");\r\n }\r\n pause() {\r\n this.runAll(\"pause\");\r\n }\r\n stop() {\r\n this.runAll(\"stop\");\r\n }\r\n cancel() {\r\n this.runAll(\"cancel\");\r\n }\r\n complete() {\r\n this.runAll(\"complete\");\r\n }\r\n}\r\n\r\nexport { GroupPlaybackControls };\r\n","function isDOMKeyframes(keyframes) {\r\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\r\n}\r\n\r\nexport { isDOMKeyframes };\r\n","import { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\r\nimport { SVGVisualElement } from '../../render/svg/SVGVisualElement.mjs';\r\nimport { HTMLVisualElement } from '../../render/html/HTMLVisualElement.mjs';\r\nimport { visualElementStore } from '../../render/store.mjs';\r\n\r\nfunction createVisualElement(element) {\r\n const options = {\r\n presenceContext: null,\r\n props: {},\r\n visualState: {\r\n renderState: {\r\n transform: {},\r\n transformOrigin: {},\r\n style: {},\r\n vars: {},\r\n attrs: {},\r\n },\r\n latestValues: {},\r\n },\r\n };\r\n const node = isSVGElement(element)\r\n ? new SVGVisualElement(options, {\r\n enableHardwareAcceleration: false,\r\n })\r\n : new HTMLVisualElement(options, {\r\n enableHardwareAcceleration: true,\r\n });\r\n node.mount(element);\r\n visualElementStore.set(element, node);\r\n}\r\n\r\nexport { createVisualElement };\r\n","import { spring } from '../../animation/generators/spring/index.mjs';\r\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../../animation/generators/utils/calc-duration.mjs';\r\nimport { millisecondsToSeconds } from '../../utils/time-conversion.mjs';\r\n\r\n/**\r\n * Create a progress => progress easing function from a generator.\r\n */\r\nfunction createGeneratorEasing(options, scale = 100) {\r\n const generator = spring({ keyframes: [0, scale], ...options });\r\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\r\n return {\r\n type: \"keyframes\",\r\n ease: (progress) => generator.next(duration * progress).value / scale,\r\n duration: millisecondsToSeconds(duration),\r\n };\r\n}\r\n\r\nexport { createGeneratorEasing };\r\n","/**\r\n * Given a absolute or relative time definition and current/prev time state of the sequence,\r\n * calculate an absolute time for the next keyframes.\r\n */\r\nfunction calcNextTime(current, next, prev, labels) {\r\n var _a;\r\n if (typeof next === \"number\") {\r\n return next;\r\n }\r\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\r\n return Math.max(0, current + parseFloat(next));\r\n }\r\n else if (next === \"<\") {\r\n return prev;\r\n }\r\n else {\r\n return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current;\r\n }\r\n}\r\n\r\nexport { calcNextTime };\r\n","const wrap = (min, max, v) => {\r\n const rangeSize = max - min;\r\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\r\n};\r\n\r\nexport { wrap };\r\n","import { wrap } from '../../utils/wrap.mjs';\r\nimport { isEasingArray } from './is-easing-array.mjs';\r\n\r\nfunction getEasingForSegment(easing, i) {\r\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\r\n}\r\n\r\nexport { getEasingForSegment };\r\n","import { getEasingForSegment } from '../../../easing/utils/get-easing-for-segment.mjs';\r\nimport { removeItem } from '../../../utils/array.mjs';\r\nimport { mix } from '../../../utils/mix.mjs';\r\n\r\nfunction eraseKeyframes(sequence, startTime, endTime) {\r\n for (let i = 0; i < sequence.length; i++) {\r\n const keyframe = sequence[i];\r\n if (keyframe.at > startTime && keyframe.at < endTime) {\r\n removeItem(sequence, keyframe);\r\n // If we remove this item we have to push the pointer back one\r\n i--;\r\n }\r\n }\r\n}\r\nfunction addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\r\n /**\r\n * Erase every existing value between currentTime and targetTime,\r\n * this will essentially splice this timeline into any currently\r\n * defined ones.\r\n */\r\n eraseKeyframes(sequence, startTime, endTime);\r\n for (let i = 0; i < keyframes.length; i++) {\r\n sequence.push({\r\n value: keyframes[i],\r\n at: mix(startTime, endTime, offset[i]),\r\n easing: getEasingForSegment(easing, i),\r\n });\r\n }\r\n}\r\n\r\nexport { addKeyframes, eraseKeyframes };\r\n","function compareByTime(a, b) {\r\n if (a.at === b.at) {\r\n if (a.value === null)\r\n return 1;\r\n if (b.value === null)\r\n return -1;\r\n return 0;\r\n }\r\n else {\r\n return a.at - b.at;\r\n }\r\n}\r\n\r\nexport { compareByTime };\r\n","import { createGeneratorEasing } from '../../easing/utils/create-generator-easing.mjs';\r\nimport { resolveElements } from '../../render/dom/utils/resolve-element.mjs';\r\nimport { defaultOffset } from '../../utils/offsets/default.mjs';\r\nimport { fillOffset } from '../../utils/offsets/fill.mjs';\r\nimport { progress } from '../../utils/progress.mjs';\r\nimport { secondsToMilliseconds } from '../../utils/time-conversion.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\nimport { calcNextTime } from './utils/calc-time.mjs';\r\nimport { addKeyframes } from './utils/edit.mjs';\r\nimport { compareByTime } from './utils/sort.mjs';\r\n\r\nconst defaultSegmentEasing = \"easeInOut\";\r\nfunction createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope) {\r\n const defaultDuration = defaultTransition.duration || 0.3;\r\n const animationDefinitions = new Map();\r\n const sequences = new Map();\r\n const elementCache = {};\r\n const timeLabels = new Map();\r\n let prevTime = 0;\r\n let currentTime = 0;\r\n let totalDuration = 0;\r\n /**\r\n * Build the timeline by mapping over the sequence array and converting\r\n * the definitions into keyframes and offsets with absolute time values.\r\n * These will later get converted into relative offsets in a second pass.\r\n */\r\n for (let i = 0; i < sequence.length; i++) {\r\n const segment = sequence[i];\r\n /**\r\n * If this is a timeline label, mark it and skip the rest of this iteration.\r\n */\r\n if (typeof segment === \"string\") {\r\n timeLabels.set(segment, currentTime);\r\n continue;\r\n }\r\n else if (!Array.isArray(segment)) {\r\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\r\n continue;\r\n }\r\n let [subject, keyframes, transition = {}] = segment;\r\n /**\r\n * If a relative or absolute time value has been specified we need to resolve\r\n * it in relation to the currentTime.\r\n */\r\n if (transition.at !== undefined) {\r\n currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);\r\n }\r\n /**\r\n * Keep track of the maximum duration in this definition. This will be\r\n * applied to currentTime once the definition has been parsed.\r\n */\r\n let maxDuration = 0;\r\n const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numElements = 0) => {\r\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\r\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = \"keyframes\", ...remainingTransition } = valueTransition;\r\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\r\n /**\r\n * Resolve stagger() if defined.\r\n */\r\n const calculatedDelay = typeof delay === \"function\"\r\n ? delay(elementIndex, numElements)\r\n : delay;\r\n /**\r\n * If this animation should and can use a spring, generate a spring easing function.\r\n */\r\n const numKeyframes = valueKeyframesAsList.length;\r\n if (numKeyframes <= 2 && type === \"spring\") {\r\n /**\r\n * As we're creating an easing function from a spring,\r\n * ideally we want to generate it using the real distance\r\n * between the two keyframes. However this isn't always\r\n * possible - in these situations we use 0-100.\r\n */\r\n let absoluteDelta = 100;\r\n if (numKeyframes === 2 &&\r\n isNumberKeyframesArray(valueKeyframesAsList)) {\r\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\r\n absoluteDelta = Math.abs(delta);\r\n }\r\n const springTransition = { ...remainingTransition };\r\n if (duration !== undefined) {\r\n springTransition.duration = secondsToMilliseconds(duration);\r\n }\r\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta);\r\n ease = springEasing.ease;\r\n duration = springEasing.duration;\r\n }\r\n duration !== null && duration !== void 0 ? duration : (duration = defaultDuration);\r\n const startTime = currentTime + calculatedDelay;\r\n const targetTime = startTime + duration;\r\n /**\r\n * If there's only one time offset of 0, fill in a second with length 1\r\n */\r\n if (times.length === 1 && times[0] === 0) {\r\n times[1] = 1;\r\n }\r\n /**\r\n * Fill out if offset if fewer offsets than keyframes\r\n */\r\n const remainder = times.length - valueKeyframesAsList.length;\r\n remainder > 0 && fillOffset(times, remainder);\r\n /**\r\n * If only one value has been set, ie [1], push a null to the start of\r\n * the keyframe array. This will let us mark a keyframe at this point\r\n * that will later be hydrated with the previous value.\r\n */\r\n valueKeyframesAsList.length === 1 &&\r\n valueKeyframesAsList.unshift(null);\r\n /**\r\n * Add keyframes, mapping offsets to absolute time.\r\n */\r\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\r\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\r\n totalDuration = Math.max(targetTime, totalDuration);\r\n };\r\n if (isMotionValue(subject)) {\r\n const subjectSequence = getSubjectSequence(subject, sequences);\r\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\r\n }\r\n else {\r\n /**\r\n * Find all the elements specified in the definition and parse value\r\n * keyframes from their timeline definitions.\r\n */\r\n const elements = resolveElements(subject, scope, elementCache);\r\n const numElements = elements.length;\r\n /**\r\n * For every element in this segment, process the defined values.\r\n */\r\n for (let elementIndex = 0; elementIndex < numElements; elementIndex++) {\r\n /**\r\n * Cast necessary, but we know these are of this type\r\n */\r\n keyframes = keyframes;\r\n transition = transition;\r\n const element = elements[elementIndex];\r\n const subjectSequence = getSubjectSequence(element, sequences);\r\n for (const key in keyframes) {\r\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), elementIndex, numElements);\r\n }\r\n }\r\n }\r\n prevTime = currentTime;\r\n currentTime += maxDuration;\r\n }\r\n /**\r\n * For every element and value combination create a new animation.\r\n */\r\n sequences.forEach((valueSequences, element) => {\r\n for (const key in valueSequences) {\r\n const valueSequence = valueSequences[key];\r\n /**\r\n * Arrange all the keyframes in ascending time order.\r\n */\r\n valueSequence.sort(compareByTime);\r\n const keyframes = [];\r\n const valueOffset = [];\r\n const valueEasing = [];\r\n /**\r\n * For each keyframe, translate absolute times into\r\n * relative offsets based on the total duration of the timeline.\r\n */\r\n for (let i = 0; i < valueSequence.length; i++) {\r\n const { at, value, easing } = valueSequence[i];\r\n keyframes.push(value);\r\n valueOffset.push(progress(0, totalDuration, at));\r\n valueEasing.push(easing || \"easeOut\");\r\n }\r\n /**\r\n * If the first keyframe doesn't land on offset: 0\r\n * provide one by duplicating the initial keyframe. This ensures\r\n * it snaps to the first keyframe when the animation starts.\r\n */\r\n if (valueOffset[0] !== 0) {\r\n valueOffset.unshift(0);\r\n keyframes.unshift(keyframes[0]);\r\n valueEasing.unshift(defaultSegmentEasing);\r\n }\r\n /**\r\n * If the last keyframe doesn't land on offset: 1\r\n * provide one with a null wildcard value. This will ensure it\r\n * stays static until the end of the animation.\r\n */\r\n if (valueOffset[valueOffset.length - 1] !== 1) {\r\n valueOffset.push(1);\r\n keyframes.push(null);\r\n }\r\n if (!animationDefinitions.has(element)) {\r\n animationDefinitions.set(element, {\r\n keyframes: {},\r\n transition: {},\r\n });\r\n }\r\n const definition = animationDefinitions.get(element);\r\n definition.keyframes[key] = keyframes;\r\n definition.transition[key] = {\r\n ...defaultTransition,\r\n duration: totalDuration,\r\n ease: valueEasing,\r\n times: valueOffset,\r\n ...sequenceTransition,\r\n };\r\n }\r\n });\r\n return animationDefinitions;\r\n}\r\nfunction getSubjectSequence(subject, sequences) {\r\n !sequences.has(subject) && sequences.set(subject, {});\r\n return sequences.get(subject);\r\n}\r\nfunction getValueSequence(name, sequences) {\r\n if (!sequences[name])\r\n sequences[name] = [];\r\n return sequences[name];\r\n}\r\nfunction keyframesAsList(keyframes) {\r\n return Array.isArray(keyframes) ? keyframes : [keyframes];\r\n}\r\nfunction getValueTransition(transition, key) {\r\n return transition[key]\r\n ? { ...transition, ...transition[key] }\r\n : { ...transition };\r\n}\r\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\r\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\r\n\r\nexport { createAnimationsFromSequence, getValueTransition };\r\n","import { resolveElements } from '../render/dom/utils/resolve-element.mjs';\r\nimport { visualElementStore } from '../render/store.mjs';\r\nimport { invariant } from '../utils/errors.mjs';\r\nimport { GroupPlaybackControls } from './GroupPlaybackControls.mjs';\r\nimport { isDOMKeyframes } from './utils/is-dom-keyframes.mjs';\r\nimport { animateTarget } from './interfaces/visual-element-target.mjs';\r\nimport { createVisualElement } from './utils/create-visual-element.mjs';\r\nimport { animateSingleValue } from './interfaces/single-value.mjs';\r\nimport { createAnimationsFromSequence } from './sequence/create.mjs';\r\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\r\n\r\nfunction animateElements(elementOrSelector, keyframes, options, scope) {\r\n const elements = resolveElements(elementOrSelector, scope);\r\n const numElements = elements.length;\r\n invariant(Boolean(numElements), \"No valid element provided.\");\r\n const animations = [];\r\n for (let i = 0; i < numElements; i++) {\r\n const element = elements[i];\r\n /**\r\n * Check each element for an associated VisualElement. If none exists,\r\n * we need to create one.\r\n */\r\n if (!visualElementStore.has(element)) {\r\n /**\r\n * TODO: We only need render-specific parts of the VisualElement.\r\n * With some additional work the size of the animate() function\r\n * could be reduced significantly.\r\n */\r\n createVisualElement(element);\r\n }\r\n const visualElement = visualElementStore.get(element);\r\n const transition = { ...options };\r\n /**\r\n * Resolve stagger function if provided.\r\n */\r\n if (typeof transition.delay === \"function\") {\r\n transition.delay = transition.delay(i, numElements);\r\n }\r\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\r\n }\r\n return new GroupPlaybackControls(animations);\r\n}\r\nconst isSequence = (value) => Array.isArray(value) && Array.isArray(value[0]);\r\nfunction animateSequence(sequence, options, scope) {\r\n const animations = [];\r\n const animationDefinitions = createAnimationsFromSequence(sequence, options, scope);\r\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\r\n let animation;\r\n if (isMotionValue(subject)) {\r\n animation = animateSingleValue(subject, keyframes.default, transition.default);\r\n }\r\n else {\r\n animation = animateElements(subject, keyframes, transition);\r\n }\r\n animations.push(animation);\r\n });\r\n return new GroupPlaybackControls(animations);\r\n}\r\nconst createScopedAnimate = (scope) => {\r\n /**\r\n * Implementation\r\n */\r\n function scopedAnimate(valueOrElementOrSequence, keyframes, options) {\r\n let animation;\r\n if (isSequence(valueOrElementOrSequence)) {\r\n animation = animateSequence(valueOrElementOrSequence, keyframes, scope);\r\n }\r\n else if (isDOMKeyframes(keyframes)) {\r\n animation = animateElements(valueOrElementOrSequence, keyframes, options, scope);\r\n }\r\n else {\r\n animation = animateSingleValue(valueOrElementOrSequence, keyframes, options);\r\n }\r\n if (scope) {\r\n scope.animations.push(animation);\r\n }\r\n return animation;\r\n }\r\n return scopedAnimate;\r\n};\r\nconst animate = createScopedAnimate();\r\n\r\nexport { animate, createScopedAnimate };\r\n","import { useConstant } from '../../utils/use-constant.mjs';\r\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\r\nimport { createScopedAnimate } from '../animate.mjs';\r\n\r\nfunction useAnimate() {\r\n const scope = useConstant(() => ({\r\n current: null,\r\n animations: [],\r\n }));\r\n const animate = useConstant(() => createScopedAnimate(scope));\r\n useUnmountEffect(() => {\r\n scope.animations.forEach((animation) => animation.stop());\r\n });\r\n return [scope, animate];\r\n}\r\n\r\nexport { useAnimate };\r\n","import { animationControls } from './animation-controls.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\r\n\r\n/**\r\n * Creates `AnimationControls`, which can be used to manually start, stop\r\n * and sequence animations on one or more components.\r\n *\r\n * The returned `AnimationControls` should be passed to the `animate` property\r\n * of the components you want to animate.\r\n *\r\n * These components can then be animated with the `start` method.\r\n *\r\n * ```jsx\r\n * import * as React from 'react'\r\n * import { motion, useAnimation } from 'framer-motion'\r\n *\r\n * export function MyComponent(props) {\r\n * const controls = useAnimation()\r\n *\r\n * controls.start({\r\n * x: 100,\r\n * transition: { duration: 0.5 },\r\n * })\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @returns Animation controller with `start` and `stop` methods\r\n *\r\n * @public\r\n */\r\nfunction useAnimationControls() {\r\n const controls = useConstant(animationControls);\r\n useIsomorphicLayoutEffect(controls.mount, []);\r\n return controls;\r\n}\r\nconst useAnimation = useAnimationControls;\r\n\r\nexport { useAnimation, useAnimationControls };\r\n","import { useRef, useState, useCallback } from 'react';\r\nimport { wrap } from './wrap.mjs';\r\n\r\n/**\r\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\r\n *\r\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\r\n *\r\n * ```jsx\r\n * import * as React from \"react\"\r\n * import { motion, useCycle } from \"framer-motion\"\r\n *\r\n * export const MyComponent = () => {\r\n * const [x, cycleX] = useCycle(0, 50, 100)\r\n *\r\n * return (\r\n * cycleX()}\r\n * />\r\n * )\r\n * }\r\n * ```\r\n *\r\n * @param items - items to cycle through\r\n * @returns [currentState, cycleState]\r\n *\r\n * @public\r\n */\r\nfunction useCycle(...items) {\r\n const index = useRef(0);\r\n const [item, setItem] = useState(items[index.current]);\r\n const runCycle = useCallback((next) => {\r\n index.current =\r\n typeof next !== \"number\"\r\n ? wrap(0, items.length, index.current + 1)\r\n : next;\r\n setItem(items[index.current]);\r\n }, \r\n // The array will change on each call, but by putting items.length at\r\n // the front of this array, we guarantee the dependency comparison will match up\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [items.length, ...items]);\r\n return [item, runCycle];\r\n}\r\n\r\nexport { useCycle };\r\n","import { resolveElements } from '../utils/resolve-element.mjs';\r\n\r\nconst thresholds = {\r\n some: 0,\r\n all: 1,\r\n};\r\nfunction inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = \"some\" } = {}) {\r\n const elements = resolveElements(elementOrSelector);\r\n const activeIntersections = new WeakMap();\r\n const onIntersectionChange = (entries) => {\r\n entries.forEach((entry) => {\r\n const onEnd = activeIntersections.get(entry.target);\r\n /**\r\n * If there's no change to the intersection, we don't need to\r\n * do anything here.\r\n */\r\n if (entry.isIntersecting === Boolean(onEnd))\r\n return;\r\n if (entry.isIntersecting) {\r\n const newOnEnd = onStart(entry);\r\n if (typeof newOnEnd === \"function\") {\r\n activeIntersections.set(entry.target, newOnEnd);\r\n }\r\n else {\r\n observer.unobserve(entry.target);\r\n }\r\n }\r\n else if (onEnd) {\r\n onEnd(entry);\r\n activeIntersections.delete(entry.target);\r\n }\r\n });\r\n };\r\n const observer = new IntersectionObserver(onIntersectionChange, {\r\n root,\r\n rootMargin,\r\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\r\n });\r\n elements.forEach((element) => observer.observe(element));\r\n return () => observer.disconnect();\r\n}\r\n\r\nexport { inView };\r\n","import { useState, useEffect } from 'react';\r\nimport { inView } from '../render/dom/viewport/index.mjs';\r\n\r\nfunction useInView(ref, { root, margin, amount, once = false } = {}) {\r\n const [isInView, setInView] = useState(false);\r\n useEffect(() => {\r\n if (!ref.current || (once && isInView))\r\n return;\r\n const onEnter = () => {\r\n setInView(true);\r\n return once ? undefined : () => setInView(false);\r\n };\r\n const options = {\r\n root: (root && root.current) || undefined,\r\n margin,\r\n amount,\r\n };\r\n return inView(ref.current, onEnter, options);\r\n }, [root, ref, margin, once, amount]);\r\n return isInView;\r\n}\r\n\r\nexport { useInView };\r\n","import { useConstant } from '../../utils/use-constant.mjs';\r\n\r\n/**\r\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\r\n *\r\n * ```jsx\r\n * const dragControls = useDragControls()\r\n *\r\n * function startDrag(event) {\r\n * dragControls.start(event, { snapToCursor: true })\r\n * }\r\n *\r\n * return (\r\n * <>\r\n *
\r\n * \r\n * \r\n * )\r\n * ```\r\n *\r\n * @public\r\n */\r\nclass DragControls {\r\n constructor() {\r\n this.componentControls = new Set();\r\n }\r\n /**\r\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\r\n *\r\n * @internal\r\n */\r\n subscribe(controls) {\r\n this.componentControls.add(controls);\r\n return () => this.componentControls.delete(controls);\r\n }\r\n /**\r\n * Start a drag gesture on every `motion` component that has this set of drag controls\r\n * passed into it via the `dragControls` prop.\r\n *\r\n * ```jsx\r\n * dragControls.start(e, {\r\n * snapToCursor: true\r\n * })\r\n * ```\r\n *\r\n * @param event - PointerEvent\r\n * @param options - Options\r\n *\r\n * @public\r\n */\r\n start(event, options) {\r\n this.componentControls.forEach((controls) => {\r\n controls.start(event.nativeEvent || event, options);\r\n });\r\n }\r\n}\r\nconst createDragControls = () => new DragControls();\r\n/**\r\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\r\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\r\n * might want to initiate that dragging from a different component than the draggable one.\r\n *\r\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\r\n * the draggable component's `dragControls` prop. It exposes a `start` method\r\n * that can start dragging from pointer events on other components.\r\n *\r\n * ```jsx\r\n * const dragControls = useDragControls()\r\n *\r\n * function startDrag(event) {\r\n * dragControls.start(event, { snapToCursor: true })\r\n * }\r\n *\r\n * return (\r\n * <>\r\n *
\r\n * \r\n * \r\n * )\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useDragControls() {\r\n return useConstant(createDragControls);\r\n}\r\n\r\nexport { DragControls, useDragControls };\r\n","import { useEffect } from 'react';\r\nimport { addDomEvent } from './add-dom-event.mjs';\r\n\r\n/**\r\n * Attaches an event listener directly to the provided DOM element.\r\n *\r\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\r\n * event handlers.\r\n *\r\n * ```jsx\r\n * const ref = useRef(null)\r\n *\r\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\r\n *\r\n * return
\r\n * ```\r\n *\r\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\r\n * @param eventName - Name of the event you want listen for.\r\n * @param handler - Function to fire when receiving the event.\r\n * @param options - Options to pass to `Event.addEventListener`.\r\n *\r\n * @public\r\n */\r\nfunction useDomEvent(ref, eventName, handler, options) {\r\n useEffect(() => {\r\n const element = ref.current;\r\n if (handler && element) {\r\n return addDomEvent(element, eventName, handler, options);\r\n }\r\n }, [ref, eventName, handler, options]);\r\n}\r\n\r\nexport { useDomEvent };\r\n","import { motionComponentSymbol } from './symbol.mjs';\r\n\r\n/**\r\n * Checks if a component is a `motion` component.\r\n */\r\nfunction isMotionComponent(component) {\r\n return (component !== null &&\r\n typeof component === \"object\" &&\r\n motionComponentSymbol in component);\r\n}\r\n\r\nexport { isMotionComponent };\r\n","import { isMotionComponent } from './is-motion-component.mjs';\r\nimport { motionComponentSymbol } from './symbol.mjs';\r\n\r\n/**\r\n * Unwraps a `motion` component and returns either a string for `motion.div` or\r\n * the React component for `motion(Component)`.\r\n *\r\n * If the component is not a `motion` component it returns undefined.\r\n */\r\nfunction unwrapMotionComponent(component) {\r\n if (isMotionComponent(component)) {\r\n return component[motionComponentSymbol];\r\n }\r\n return undefined;\r\n}\r\n\r\nexport { unwrapMotionComponent };\r\n","import { rootProjectionNode } from './node/HTMLProjectionNode.mjs';\r\n\r\nfunction useInstantLayoutTransition() {\r\n return startTransition;\r\n}\r\nfunction startTransition(callback) {\r\n if (!rootProjectionNode.current)\r\n return;\r\n rootProjectionNode.current.isUpdating = false;\r\n rootProjectionNode.current.blockUpdate();\r\n callback && callback();\r\n}\r\n\r\nexport { useInstantLayoutTransition };\r\n","import { useRef, useEffect } from 'react';\r\nimport { useInstantLayoutTransition } from '../projection/use-instant-layout-transition.mjs';\r\nimport { useForceUpdate } from './use-force-update.mjs';\r\nimport { instantAnimationState } from './use-instant-transition-state.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction useInstantTransition() {\r\n const [forceUpdate, forcedRenderCount] = useForceUpdate();\r\n const startInstantLayoutTransition = useInstantLayoutTransition();\r\n const unlockOnFrameRef = useRef();\r\n useEffect(() => {\r\n /**\r\n * Unblock after two animation frames, otherwise this will unblock too soon.\r\n */\r\n frame.postRender(() => frame.postRender(() => {\r\n /**\r\n * If the callback has been called again after the effect\r\n * triggered this 2 frame delay, don't unblock animations. This\r\n * prevents the previous effect from unblocking the current\r\n * instant transition too soon. This becomes more likely when\r\n * used in conjunction with React.startTransition().\r\n */\r\n if (forcedRenderCount !== unlockOnFrameRef.current)\r\n return;\r\n instantAnimationState.current = false;\r\n }));\r\n }, [forcedRenderCount]);\r\n return (callback) => {\r\n startInstantLayoutTransition(() => {\r\n instantAnimationState.current = true;\r\n forceUpdate();\r\n callback();\r\n unlockOnFrameRef.current = forcedRenderCount + 1;\r\n });\r\n };\r\n}\r\nfunction disableInstantTransitions() {\r\n instantAnimationState.current = false;\r\n}\r\n\r\nexport { disableInstantTransitions, useInstantTransition };\r\n","import * as React from 'react';\r\nimport { rootProjectionNode } from './node/HTMLProjectionNode.mjs';\r\n\r\nfunction useResetProjection() {\r\n const reset = React.useCallback(() => {\r\n const root = rootProjectionNode.current;\r\n if (!root)\r\n return;\r\n root.resetTree();\r\n }, []);\r\n return reset;\r\n}\r\n\r\nexport { useResetProjection };\r\n","const appearStoreId = (id, value) => `${id}: ${value}`;\r\n\r\nexport { appearStoreId };\r\n","const appearAnimationStore = new Map();\r\n\r\nexport { appearAnimationStore };\r\n","import { transformProps } from '../../render/html/utils/transform.mjs';\r\nimport { appearAnimationStore } from './store.mjs';\r\nimport { appearStoreId } from './store-id.mjs';\r\n\r\nlet handoffFrameTime;\r\nfunction handoffOptimizedAppearAnimation(elementId, valueName, \r\n/**\r\n * Legacy arguments. This function is inlined as part of SSG so it can be there's\r\n * a version mismatch between the main included Motion and the inlined script.\r\n *\r\n * Remove in early 2024.\r\n */\r\n_value, _frame) {\r\n const optimisedValueName = transformProps.has(valueName)\r\n ? \"transform\"\r\n : valueName;\r\n const storeId = appearStoreId(elementId, optimisedValueName);\r\n const optimisedAnimation = appearAnimationStore.get(storeId);\r\n if (!optimisedAnimation) {\r\n return null;\r\n }\r\n const { animation, startTime } = optimisedAnimation;\r\n const cancelAnimation = () => {\r\n appearAnimationStore.delete(storeId);\r\n try {\r\n animation.cancel();\r\n }\r\n catch (error) { }\r\n };\r\n /**\r\n * If the startTime is null, this animation is the Paint Ready detection animation\r\n * and we can cancel it immediately without handoff.\r\n *\r\n * Or if we've already handed off the animation then we're now interrupting it.\r\n * In which case we need to cancel it.\r\n */\r\n if (startTime === null || window.HandoffComplete) {\r\n cancelAnimation();\r\n return null;\r\n }\r\n else {\r\n /**\r\n * Otherwise we're handing off this animation to the main thread.\r\n *\r\n * Record the time of the first handoff. We call performance.now() once\r\n * here and once in startOptimisedAnimation to ensure we're getting\r\n * close to a frame-locked time. This keeps all animations in sync.\r\n */\r\n if (handoffFrameTime === undefined) {\r\n handoffFrameTime = performance.now();\r\n }\r\n /**\r\n * We use main thread timings vs those returned by Animation.currentTime as it\r\n * can be the case, particularly in Firefox, that currentTime doesn't return\r\n * an updated value for several frames, even as the animation plays smoothly via\r\n * the GPU.\r\n */\r\n return handoffFrameTime - startTime || 0;\r\n }\r\n}\r\n\r\nexport { handoffOptimizedAppearAnimation };\r\n","import { appearStoreId } from './store-id.mjs';\r\nimport { animateStyle } from '../animators/waapi/index.mjs';\r\nimport { optimizedAppearDataId } from './data-id.mjs';\r\nimport { handoffOptimizedAppearAnimation } from './handoff.mjs';\r\nimport { appearAnimationStore } from './store.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\n\r\n/**\r\n * A single time to use across all animations to manually set startTime\r\n * and ensure they're all in sync.\r\n */\r\nlet startFrameTime;\r\n/**\r\n * A dummy animation to detect when Chrome is ready to start\r\n * painting the page and hold off from triggering the real animation\r\n * until then. We only need one animation to detect paint ready.\r\n *\r\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\r\n */\r\nlet readyAnimation;\r\nfunction startOptimizedAppearAnimation(element, name, keyframes, options, onReady) {\r\n // Prevent optimised appear animations if Motion has already started animating.\r\n if (window.HandoffComplete) {\r\n window.HandoffAppearAnimations = undefined;\r\n return;\r\n }\r\n const id = element.dataset[optimizedAppearDataId];\r\n if (!id)\r\n return;\r\n window.HandoffAppearAnimations = handoffOptimizedAppearAnimation;\r\n const storeId = appearStoreId(id, name);\r\n if (!readyAnimation) {\r\n readyAnimation = animateStyle(element, name, [keyframes[0], keyframes[0]], \r\n /**\r\n * 10 secs is basically just a super-safe duration to give Chrome\r\n * long enough to get the animation ready.\r\n */\r\n { duration: 10000, ease: \"linear\" });\r\n appearAnimationStore.set(storeId, {\r\n animation: readyAnimation,\r\n startTime: null,\r\n });\r\n }\r\n const startAnimation = () => {\r\n readyAnimation.cancel();\r\n const appearAnimation = animateStyle(element, name, keyframes, options);\r\n /**\r\n * Record the time of the first started animation. We call performance.now() once\r\n * here and once in handoff to ensure we're getting\r\n * close to a frame-locked time. This keeps all animations in sync.\r\n */\r\n if (startFrameTime === undefined) {\r\n startFrameTime = performance.now();\r\n }\r\n appearAnimation.startTime = startFrameTime;\r\n appearAnimationStore.set(storeId, {\r\n animation: appearAnimation,\r\n startTime: startFrameTime,\r\n });\r\n if (onReady)\r\n onReady(appearAnimation);\r\n };\r\n if (readyAnimation.ready) {\r\n readyAnimation.ready.then(startAnimation).catch(noop);\r\n }\r\n else {\r\n startAnimation();\r\n }\r\n}\r\n\r\nexport { startOptimizedAppearAnimation };\r\n","import { useState, useEffect } from 'react';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { getOrigin, checkTargetForNewValues } from '../../render/utils/setters.mjs';\r\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\r\nimport { createBox } from '../../projection/geometry/models.mjs';\r\nimport { VisualElement } from '../../render/VisualElement.mjs';\r\nimport { animateVisualElement } from '../interfaces/visual-element.mjs';\r\n\r\nconst createObject = () => ({});\r\nclass StateVisualElement extends VisualElement {\r\n build() { }\r\n measureInstanceViewportBox() {\r\n return createBox();\r\n }\r\n resetTransform() { }\r\n restoreTransform() { }\r\n removeValueFromRenderState() { }\r\n renderInstance() { }\r\n scrapeMotionValuesFromProps() {\r\n return createObject();\r\n }\r\n getBaseTargetFromProps() {\r\n return undefined;\r\n }\r\n readValueFromInstance(_state, key, options) {\r\n return options.initialState[key] || 0;\r\n }\r\n sortInstanceNodePosition() {\r\n return 0;\r\n }\r\n makeTargetAnimatableFromInstance({ transition, transitionEnd, ...target }) {\r\n const origin = getOrigin(target, transition || {}, this);\r\n checkTargetForNewValues(this, target, origin);\r\n return { transition, transitionEnd, ...target };\r\n }\r\n}\r\nconst useVisualState = makeUseVisualState({\r\n scrapeMotionValuesFromProps: createObject,\r\n createRenderState: createObject,\r\n});\r\n/**\r\n * This is not an officially supported API and may be removed\r\n * on any version.\r\n */\r\nfunction useAnimatedState(initialState) {\r\n const [animationState, setAnimationState] = useState(initialState);\r\n const visualState = useVisualState({}, false);\r\n const element = useConstant(() => {\r\n return new StateVisualElement({ props: {}, visualState, presenceContext: null }, { initialState });\r\n });\r\n useEffect(() => {\r\n element.mount({});\r\n return () => element.unmount();\r\n }, [element]);\r\n useEffect(() => {\r\n element.update({\r\n onUpdate: (v) => {\r\n setAnimationState({ ...v });\r\n },\r\n }, null);\r\n }, [setAnimationState, element]);\r\n const startAnimation = useConstant(() => (animationDefinition) => {\r\n return animateVisualElement(element, animationDefinition);\r\n });\r\n return [animationState, startAnimation];\r\n}\r\n\r\nexport { useAnimatedState };\r\n","import { useTransform } from './use-transform.mjs';\r\nimport { invariant, warning } from '../utils/errors.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\nimport { MotionContext } from '../context/MotionContext/index.mjs';\r\nimport { useContext } from 'react';\r\n\r\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\r\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\r\n// to simply hide content at unreasonable scales.\r\nconst maxScale = 100000;\r\nconst invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale;\r\nlet hasWarned = false;\r\n/**\r\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\r\n * of their respective parent scales.\r\n *\r\n * This is useful for undoing the distortion of content when scaling a parent component.\r\n *\r\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\r\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\r\n * of those instead.\r\n *\r\n * ```jsx\r\n * const MyComponent = () => {\r\n * const { scaleX, scaleY } = useInvertedScale()\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @deprecated\r\n */\r\nfunction useInvertedScale(scale) {\r\n let parentScaleX = useMotionValue(1);\r\n let parentScaleY = useMotionValue(1);\r\n const { visualElement } = useContext(MotionContext);\r\n invariant(!!(scale || visualElement), \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\");\r\n warning(hasWarned, \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\");\r\n hasWarned = true;\r\n if (scale) {\r\n parentScaleX = scale.scaleX || parentScaleX;\r\n parentScaleY = scale.scaleY || parentScaleY;\r\n }\r\n else if (visualElement) {\r\n parentScaleX = visualElement.getValue(\"scaleX\", 1);\r\n parentScaleY = visualElement.getValue(\"scaleY\", 1);\r\n }\r\n const scaleX = useTransform(parentScaleX, invertScale);\r\n const scaleY = useTransform(parentScaleY, invertScale);\r\n return { scaleX, scaleY };\r\n}\r\n\r\nexport { invertScale, useInvertedScale };\r\n","import { invariant } from '../utils/errors.mjs';\r\nimport * as React from 'react';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\nimport { LayoutGroup } from './LayoutGroup/index.mjs';\r\n\r\nlet id = 0;\r\nconst AnimateSharedLayout = ({ children }) => {\r\n React.useEffect(() => {\r\n invariant(false, \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\");\r\n }, []);\r\n return (React.createElement(LayoutGroup, { id: useConstant(() => `asl-${id++}`) }, children));\r\n};\r\n\r\nexport { AnimateSharedLayout };\r\n","import { scrollInfo } from './track.mjs';\r\nimport { observeTimeline } from './observe.mjs';\r\nimport { supportsScrollTimeline } from './supports.mjs';\r\n\r\nfunction scrollTimelineFallback({ source, axis = \"y\" }) {\r\n // ScrollTimeline records progress as a percentage CSSUnitValue\r\n const currentTime = { value: 0 };\r\n const cancel = scrollInfo((info) => {\r\n currentTime.value = info[axis].progress * 100;\r\n }, { container: source, axis });\r\n return { currentTime, cancel };\r\n}\r\nconst timelineCache = new Map();\r\nfunction getTimeline({ source = document.documentElement, axis = \"y\", } = {}) {\r\n if (!timelineCache.has(source)) {\r\n timelineCache.set(source, {});\r\n }\r\n const elementCache = timelineCache.get(source);\r\n if (!elementCache[axis]) {\r\n elementCache[axis] = supportsScrollTimeline()\r\n ? new ScrollTimeline({ source, axis })\r\n : scrollTimelineFallback({ source, axis });\r\n }\r\n return elementCache[axis];\r\n}\r\nfunction scroll(onScroll, options) {\r\n const timeline = getTimeline(options);\r\n if (typeof onScroll === \"function\") {\r\n return observeTimeline(onScroll, timeline);\r\n }\r\n else {\r\n return onScroll.attachTimeline(timeline);\r\n }\r\n}\r\n\r\nexport { scroll };\r\n","import { easingDefinitionToFunction } from '../../easing/utils/map.mjs';\r\n\r\nfunction getOriginIndex(from, total) {\r\n if (from === \"first\") {\r\n return 0;\r\n }\r\n else {\r\n const lastIndex = total - 1;\r\n return from === \"last\" ? lastIndex : lastIndex / 2;\r\n }\r\n}\r\nfunction stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) {\r\n return (i, total) => {\r\n const fromIndex = typeof from === \"number\" ? from : getOriginIndex(from, total);\r\n const distance = Math.abs(fromIndex - i);\r\n let delay = duration * distance;\r\n if (ease) {\r\n const maxDelay = total * duration;\r\n const easingFunction = easingDefinitionToFunction(ease);\r\n delay = easingFunction(delay / maxDelay) * maxDelay;\r\n }\r\n return startDelay + delay;\r\n };\r\n}\r\n\r\nexport { getOriginIndex, stagger };\r\n","import { stepsOrder } from './batcher.mjs';\r\nimport { frame, cancelFrame } from './frame.mjs';\r\n\r\n/**\r\n * @deprecated\r\n *\r\n * Import as `frame` instead.\r\n */\r\nconst sync = frame;\r\n/**\r\n * @deprecated\r\n *\r\n * Use cancelFrame(callback) instead.\r\n */\r\nconst cancelSync = stepsOrder.reduce((acc, key) => {\r\n acc[key] = (process) => cancelFrame(process);\r\n return acc;\r\n}, {});\r\n\r\nexport { cancelSync, sync };\r\n"],"mappings":";;;;;;AAKA,IAAM,uBAAA,GAAA,aAAA,eAAoC;CACtC,qBAAqB,MAAM;CAC3B,UAAU;CACV,eAAe;CAClB,CAAC;;;ACPF,IAAM,iBAAA,GAAA,aAAA,eAA8B,EAAE,CAAC;;;;;;ACGvC,IAAM,mBAAA,GAAA,aAAA,eAAgC,KAAK;;;ACL3C,IAAM,YAAY,OAAO,aAAa;;;ACGtC,IAAM,4BAA4B,YAAYA,aAAAA,kBAAkBC,aAAAA;;;ACDhE,IAAM,eAAA,GAAA,aAAA,eAA4B,EAAE,QAAQ,OAAO,CAAC;;;;;;ACCpD,IAAM,eAAe,QAAQ,IAAI,QAAQ,mBAAmB,QAAQ,C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,GAAG,OAAO,GAAG,SAAS,EAAE,EAAE;AACtE,SAAQ,GAAG,UAAU;EACjB,MAAM,YAAY,OAAO,SAAS,WAAW,OAAO,eAAe,MAAM,MAAM;EAE/E,IAAI,QAAQ,WADK,KAAK,IAAI,YAAY,EAAE;AAExC,MAAI,MAAM;GACN,MAAM,WAAW,QAAQ;AAEzB,WADuB,2BAA2B,KAAK,CAChC,QAAQ,SAAS,GAAG;;AAE/C,SAAO,aAAa;;;;;;;;;;ACb5B,IAAM,OAAO;;;;;;AAMb,IAAM,aAAa,WAAW,QAAQ,KAAK,QAAQ;AAC/C,KAAI,QAAQ,YAAY,YAAY,QAAQ;AAC5C,QAAO;GACR,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"framer-motion.js","names":["useLayoutEffect","useEffect","calcOrigin","scrapeMotionValuesFromProps","maxElapsed","getVelocity","getAnimatableNone","getMixer","defaultOffset","defaultOffset","maxDuration","getValueTransition","getValueTransition","getValueTransition","id","xKeys","yKeys","id","getValueTransition","getComputedStyle","scrapeMotionValuesFromProps","defaultOffset","useEffect","defaultOffset"],"sources":["../../framer-motion/dist/es/context/MotionConfigContext.mjs","../../framer-motion/dist/es/context/MotionContext/index.mjs","../../framer-motion/dist/es/context/PresenceContext.mjs","../../framer-motion/dist/es/utils/is-browser.mjs","../../framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../framer-motion/dist/es/context/LazyContext.mjs","../../framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs","../../framer-motion/dist/es/animation/optimized-appear/data-id.mjs","../../framer-motion/dist/es/motion/utils/use-visual-element.mjs","../../framer-motion/dist/es/utils/is-ref-object.mjs","../../framer-motion/dist/es/motion/utils/use-motion-ref.mjs","../../framer-motion/dist/es/render/utils/is-variant-label.mjs","../../framer-motion/dist/es/animation/utils/is-animation-controls.mjs","../../framer-motion/dist/es/render/utils/variant-props.mjs","../../framer-motion/dist/es/render/utils/is-controlling-variants.mjs","../../framer-motion/dist/es/context/MotionContext/utils.mjs","../../framer-motion/dist/es/context/MotionContext/create.mjs","../../framer-motion/dist/es/motion/features/definitions.mjs","../../framer-motion/dist/es/motion/features/load-features.mjs","../../framer-motion/dist/es/context/LayoutGroupContext.mjs","../../framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","../../framer-motion/dist/es/motion/utils/symbol.mjs","../../framer-motion/dist/es/motion/index.mjs","../../framer-motion/dist/es/render/dom/motion-proxy.mjs","../../framer-motion/dist/es/render/svg/lowercase-elements.mjs","../../framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","../../framer-motion/dist/es/projection/styles/scale-correction.mjs","../../framer-motion/dist/es/render/html/utils/transform.mjs","../../framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs","../../framer-motion/dist/es/value/utils/is-motion-value.mjs","../../framer-motion/dist/es/render/html/utils/build-transform.mjs","../../framer-motion/dist/es/render/dom/utils/is-css-variable.mjs","../../framer-motion/dist/es/render/dom/value-types/get-as-type.mjs","../../framer-motion/dist/es/utils/clamp.mjs","../../framer-motion/dist/es/value/types/numbers/index.mjs","../../framer-motion/dist/es/value/types/utils.mjs","../../framer-motion/dist/es/value/types/numbers/units.mjs","../../framer-motion/dist/es/render/dom/value-types/type-int.mjs","../../framer-motion/dist/es/render/dom/value-types/number.mjs","../../framer-motion/dist/es/render/html/utils/build-styles.mjs","../../framer-motion/dist/es/render/html/utils/create-render-state.mjs","../../framer-motion/dist/es/render/html/use-props.mjs","../../framer-motion/dist/es/motion/utils/valid-prop.mjs","../../@emotion/memoize/dist/memoize.browser.esm.js","../../@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","../../framer-motion/dist/es/render/dom/utils/filter-props.mjs","../../framer-motion/dist/es/render/svg/utils/transform-origin.mjs","../../framer-motion/dist/es/render/svg/utils/path.mjs","../../framer-motion/dist/es/render/svg/utils/build-attrs.mjs","../../framer-motion/dist/es/render/svg/utils/create-render-state.mjs","../../framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs","../../framer-motion/dist/es/render/svg/use-props.mjs","../../framer-motion/dist/es/render/dom/use-render.mjs","../../framer-motion/dist/es/render/html/utils/render.mjs","../../framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs","../../framer-motion/dist/es/render/svg/utils/render.mjs","../../framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs","../../framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs","../../framer-motion/dist/es/render/utils/resolve-variants.mjs","../../framer-motion/dist/es/utils/use-constant.mjs","../../framer-motion/dist/es/animation/utils/is-keyframes-target.mjs","../../framer-motion/dist/es/utils/resolve-value.mjs","../../framer-motion/dist/es/value/utils/resolve-motion-value.mjs","../../framer-motion/dist/es/motion/utils/use-visual-state.mjs","../../framer-motion/dist/es/utils/noop.mjs","../../framer-motion/dist/es/frameloop/render-step.mjs","../../framer-motion/dist/es/frameloop/batcher.mjs","../../framer-motion/dist/es/frameloop/frame.mjs","../../framer-motion/dist/es/render/svg/config-motion.mjs","../../framer-motion/dist/es/render/html/config-motion.mjs","../../framer-motion/dist/es/render/dom/utils/create-config.mjs","../../framer-motion/dist/es/events/add-dom-event.mjs","../../framer-motion/dist/es/events/utils/is-primary-pointer.mjs","../../framer-motion/dist/es/events/event-info.mjs","../../framer-motion/dist/es/events/add-pointer-event.mjs","../../framer-motion/dist/es/utils/pipe.mjs","../../framer-motion/dist/es/gestures/drag/utils/lock.mjs","../../framer-motion/dist/es/motion/features/Feature.mjs","../../framer-motion/dist/es/gestures/hover.mjs","../../framer-motion/dist/es/gestures/focus.mjs","../../framer-motion/dist/es/gestures/utils/is-node-or-child.mjs","../../framer-motion/dist/es/gestures/press.mjs","../../framer-motion/dist/es/motion/features/viewport/observers.mjs","../../framer-motion/dist/es/motion/features/viewport/index.mjs","../../framer-motion/dist/es/motion/features/gestures.mjs","../../framer-motion/dist/es/utils/shallow-compare.mjs","../../framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs","../../framer-motion/dist/es/utils/errors.mjs","../../framer-motion/dist/es/utils/time-conversion.mjs","../../framer-motion/dist/es/utils/use-instant-transition-state.mjs","../../framer-motion/dist/es/easing/utils/is-bezier-definition.mjs","../../framer-motion/dist/es/animation/animators/waapi/easing.mjs","../../framer-motion/dist/es/animation/animators/waapi/index.mjs","../../framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs","../../framer-motion/dist/es/easing/cubic-bezier.mjs","../../framer-motion/dist/es/easing/ease.mjs","../../framer-motion/dist/es/easing/utils/is-easing-array.mjs","../../framer-motion/dist/es/easing/modifiers/mirror.mjs","../../framer-motion/dist/es/easing/modifiers/reverse.mjs","../../framer-motion/dist/es/easing/circ.mjs","../../framer-motion/dist/es/easing/back.mjs","../../framer-motion/dist/es/easing/anticipate.mjs","../../framer-motion/dist/es/easing/utils/map.mjs","../../framer-motion/dist/es/value/types/color/utils.mjs","../../framer-motion/dist/es/value/types/color/rgba.mjs","../../framer-motion/dist/es/value/types/color/hex.mjs","../../framer-motion/dist/es/value/types/color/hsla.mjs","../../framer-motion/dist/es/value/types/color/index.mjs","../../framer-motion/dist/es/utils/mix.mjs","../../framer-motion/dist/es/utils/hsla-to-rgba.mjs","../../framer-motion/dist/es/utils/mix-color.mjs","../../framer-motion/dist/es/value/types/complex/index.mjs","../../framer-motion/dist/es/utils/mix-complex.mjs","../../framer-motion/dist/es/utils/progress.mjs","../../framer-motion/dist/es/utils/interpolate.mjs","../../framer-motion/dist/es/utils/offsets/fill.mjs","../../framer-motion/dist/es/utils/offsets/default.mjs","../../framer-motion/dist/es/utils/offsets/time.mjs","../../framer-motion/dist/es/animation/generators/keyframes.mjs","../../framer-motion/dist/es/utils/velocity-per-second.mjs","../../framer-motion/dist/es/animation/generators/utils/velocity.mjs","../../framer-motion/dist/es/animation/generators/spring/find.mjs","../../framer-motion/dist/es/animation/generators/spring/index.mjs","../../framer-motion/dist/es/animation/generators/inertia.mjs","../../framer-motion/dist/es/animation/animators/js/driver-frameloop.mjs","../../framer-motion/dist/es/animation/generators/utils/calc-duration.mjs","../../framer-motion/dist/es/animation/animators/js/index.mjs","../../framer-motion/dist/es/utils/memo.mjs","../../framer-motion/dist/es/animation/animators/waapi/create-accelerated-animation.mjs","../../framer-motion/dist/es/animation/animators/instant.mjs","../../framer-motion/dist/es/animation/utils/default-transitions.mjs","../../framer-motion/dist/es/animation/utils/is-animatable.mjs","../../framer-motion/dist/es/value/types/complex/filter.mjs","../../framer-motion/dist/es/render/dom/value-types/defaults.mjs","../../framer-motion/dist/es/render/dom/value-types/animatable-none.mjs","../../framer-motion/dist/es/utils/is-zero-value-string.mjs","../../framer-motion/dist/es/animation/utils/is-none.mjs","../../framer-motion/dist/es/animation/utils/keyframes.mjs","../../framer-motion/dist/es/animation/utils/transitions.mjs","../../framer-motion/dist/es/utils/GlobalConfig.mjs","../../framer-motion/dist/es/animation/interfaces/motion-value.mjs","../../framer-motion/dist/es/value/use-will-change/is.mjs","../../framer-motion/dist/es/utils/is-numerical-string.mjs","../../framer-motion/dist/es/utils/array.mjs","../../framer-motion/dist/es/utils/subscription-manager.mjs","../../framer-motion/dist/es/utils/warn-once.mjs","../../framer-motion/dist/es/value/index.mjs","../../framer-motion/dist/es/render/dom/value-types/test.mjs","../../framer-motion/dist/es/render/dom/value-types/type-auto.mjs","../../framer-motion/dist/es/render/dom/value-types/dimensions.mjs","../../framer-motion/dist/es/render/dom/value-types/find.mjs","../../framer-motion/dist/es/render/utils/setters.mjs","../../framer-motion/dist/es/animation/interfaces/visual-element-target.mjs","../../framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs","../../framer-motion/dist/es/animation/interfaces/visual-element.mjs","../../framer-motion/dist/es/render/utils/animation-state.mjs","../../framer-motion/dist/es/motion/features/animation/index.mjs","../../framer-motion/dist/es/motion/features/animation/exit.mjs","../../framer-motion/dist/es/motion/features/animations.mjs","../../framer-motion/dist/es/utils/distance.mjs","../../framer-motion/dist/es/gestures/pan/PanSession.mjs","../../framer-motion/dist/es/projection/geometry/delta-calc.mjs","../../framer-motion/dist/es/gestures/drag/utils/constraints.mjs","../../framer-motion/dist/es/projection/geometry/models.mjs","../../framer-motion/dist/es/projection/utils/each-axis.mjs","../../framer-motion/dist/es/projection/geometry/conversion.mjs","../../framer-motion/dist/es/projection/utils/has-transform.mjs","../../framer-motion/dist/es/projection/geometry/delta-apply.mjs","../../framer-motion/dist/es/projection/utils/measure.mjs","../../framer-motion/dist/es/utils/get-context-window.mjs","../../framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","../../framer-motion/dist/es/gestures/drag/index.mjs","../../framer-motion/dist/es/gestures/pan/index.mjs","../../framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../framer-motion/dist/es/projection/node/state.mjs","../../framer-motion/dist/es/projection/styles/scale-border-radius.mjs","../../framer-motion/dist/es/projection/styles/scale-box-shadow.mjs","../../framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","../../framer-motion/dist/es/projection/animation/mix-values.mjs","../../framer-motion/dist/es/projection/geometry/copy.mjs","../../framer-motion/dist/es/projection/geometry/delta-remove.mjs","../../framer-motion/dist/es/projection/geometry/utils.mjs","../../framer-motion/dist/es/projection/shared/stack.mjs","../../framer-motion/dist/es/projection/styles/transform.mjs","../../framer-motion/dist/es/render/utils/compare-by-depth.mjs","../../framer-motion/dist/es/render/utils/flat-tree.mjs","../../framer-motion/dist/es/utils/delay.mjs","../../framer-motion/dist/es/debug/record.mjs","../../framer-motion/dist/es/render/dom/utils/is-svg-element.mjs","../../framer-motion/dist/es/animation/interfaces/single-value.mjs","../../framer-motion/dist/es/projection/node/create-projection-node.mjs","../../framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs","../../framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs","../../framer-motion/dist/es/motion/features/drag.mjs","../../framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs","../../framer-motion/dist/es/render/dom/utils/unit-conversion.mjs","../../framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs","../../framer-motion/dist/es/utils/reduced-motion/state.mjs","../../framer-motion/dist/es/utils/reduced-motion/index.mjs","../../framer-motion/dist/es/render/utils/motion-values.mjs","../../framer-motion/dist/es/render/store.mjs","../../framer-motion/dist/es/render/VisualElement.mjs","../../framer-motion/dist/es/render/dom/DOMVisualElement.mjs","../../framer-motion/dist/es/render/html/HTMLVisualElement.mjs","../../framer-motion/dist/es/render/svg/SVGVisualElement.mjs","../../framer-motion/dist/es/render/dom/create-visual-element.mjs","../../framer-motion/dist/es/motion/features/layout.mjs","../../framer-motion/dist/es/render/dom/motion.mjs","../../framer-motion/dist/es/render/dom/motion-minimal.mjs","../../framer-motion/dist/es/utils/use-is-mounted.mjs","../../framer-motion/dist/es/utils/use-force-update.mjs","../../framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../framer-motion/dist/es/utils/use-unmount-effect.mjs","../../framer-motion/dist/es/components/AnimatePresence/index.mjs","../../framer-motion/dist/es/components/MotionConfig/index.mjs","../../framer-motion/dist/es/components/LazyMotion/index.mjs","../../framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs","../../framer-motion/dist/es/projection/node/group.mjs","../../framer-motion/dist/es/components/LayoutGroup/index.mjs","../../framer-motion/dist/es/context/ReorderContext.mjs","../../framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs","../../framer-motion/dist/es/components/Reorder/Group.mjs","../../framer-motion/dist/es/value/use-motion-value.mjs","../../framer-motion/dist/es/utils/transform.mjs","../../framer-motion/dist/es/value/use-combine-values.mjs","../../framer-motion/dist/es/value/use-computed.mjs","../../framer-motion/dist/es/value/use-transform.mjs","../../framer-motion/dist/es/components/Reorder/Item.mjs","../../framer-motion/dist/es/components/Reorder/index.mjs","../../framer-motion/dist/es/render/dom/features-animation.mjs","../../framer-motion/dist/es/render/dom/features-max.mjs","../../framer-motion/dist/es/value/use-motion-template.mjs","../../framer-motion/dist/es/value/use-spring.mjs","../../framer-motion/dist/es/utils/use-motion-value-event.mjs","../../framer-motion/dist/es/value/use-velocity.mjs","../../framer-motion/dist/es/render/dom/utils/resolve-element.mjs","../../framer-motion/dist/es/render/dom/resize/handle-element.mjs","../../framer-motion/dist/es/render/dom/resize/handle-window.mjs","../../framer-motion/dist/es/render/dom/resize/index.mjs","../../framer-motion/dist/es/render/dom/scroll/info.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs","../../framer-motion/dist/es/render/dom/scroll/offsets/index.mjs","../../framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs","../../framer-motion/dist/es/render/dom/scroll/track.mjs","../../framer-motion/dist/es/value/use-scroll.mjs","../../framer-motion/dist/es/value/scroll/use-element-scroll.mjs","../../framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs","../../framer-motion/dist/es/utils/use-animation-frame.mjs","../../framer-motion/dist/es/value/use-time.mjs","../../framer-motion/dist/es/value/use-will-change/index.mjs","../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs","../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs","../../framer-motion/dist/es/animation/hooks/animation-controls.mjs","../../framer-motion/dist/es/render/dom/scroll/observe.mjs","../../framer-motion/dist/es/render/dom/scroll/supports.mjs","../../framer-motion/dist/es/animation/GroupPlaybackControls.mjs","../../framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs","../../framer-motion/dist/es/animation/utils/create-visual-element.mjs","../../framer-motion/dist/es/easing/utils/create-generator-easing.mjs","../../framer-motion/dist/es/animation/sequence/utils/calc-time.mjs","../../framer-motion/dist/es/utils/wrap.mjs","../../framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs","../../framer-motion/dist/es/animation/sequence/utils/edit.mjs","../../framer-motion/dist/es/animation/sequence/utils/sort.mjs","../../framer-motion/dist/es/animation/sequence/create.mjs","../../framer-motion/dist/es/animation/animate.mjs","../../framer-motion/dist/es/animation/hooks/use-animate.mjs","../../framer-motion/dist/es/animation/hooks/use-animation.mjs","../../framer-motion/dist/es/utils/use-cycle.mjs","../../framer-motion/dist/es/render/dom/viewport/index.mjs","../../framer-motion/dist/es/utils/use-in-view.mjs","../../framer-motion/dist/es/gestures/drag/use-drag-controls.mjs","../../framer-motion/dist/es/events/use-dom-event.mjs","../../framer-motion/dist/es/motion/utils/is-motion-component.mjs","../../framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs","../../framer-motion/dist/es/projection/use-instant-layout-transition.mjs","../../framer-motion/dist/es/utils/use-instant-transition.mjs","../../framer-motion/dist/es/projection/use-reset-projection.mjs","../../framer-motion/dist/es/animation/optimized-appear/store-id.mjs","../../framer-motion/dist/es/animation/optimized-appear/store.mjs","../../framer-motion/dist/es/animation/optimized-appear/handoff.mjs","../../framer-motion/dist/es/animation/optimized-appear/start.mjs","../../framer-motion/dist/es/animation/hooks/use-animated-state.mjs","../../framer-motion/dist/es/value/use-inverted-scale.mjs","../../framer-motion/dist/es/components/AnimateSharedLayout.mjs","../../framer-motion/dist/es/render/dom/scroll/index.mjs","../../framer-motion/dist/es/animation/utils/stagger.mjs","../../framer-motion/dist/es/frameloop/index-legacy.mjs"],"sourcesContent":["import { createContext } from 'react';\r\n\r\n/**\r\n * @public\r\n */\r\nconst MotionConfigContext = createContext({\r\n transformPagePoint: (p) => p,\r\n isStatic: false,\r\n reducedMotion: \"never\",\r\n});\r\n\r\nexport { MotionConfigContext };\r\n","import { createContext } from 'react';\r\n\r\nconst MotionContext = createContext({});\r\n\r\nexport { MotionContext };\r\n","import { createContext } from 'react';\r\n\r\n/**\r\n * @public\r\n */\r\nconst PresenceContext = createContext(null);\r\n\r\nexport { PresenceContext };\r\n","const isBrowser = typeof document !== \"undefined\";\r\n\r\nexport { isBrowser };\r\n","import { useLayoutEffect, useEffect } from 'react';\r\nimport { isBrowser } from './is-browser.mjs';\r\n\r\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\r\n\r\nexport { useIsomorphicLayoutEffect };\r\n","import { createContext } from 'react';\r\n\r\nconst LazyContext = createContext({ strict: false });\r\n\r\nexport { LazyContext };\r\n","/**\r\n * Convert camelCase to dash-case properties.\r\n */\r\nconst camelToDash = (str) => str.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\r\n\r\nexport { camelToDash };\r\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\r\n\r\nconst optimizedAppearDataId = \"framerAppearId\";\r\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\r\n\r\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\r\n","import { useContext, useRef, useInsertionEffect, useEffect } from 'react';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\r\nimport { LazyContext } from '../../context/LazyContext.mjs';\r\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\r\nimport { optimizedAppearDataAttribute } from '../../animation/optimized-appear/data-id.mjs';\r\n\r\nfunction useVisualElement(Component, visualState, props, createVisualElement) {\r\n const { visualElement: parent } = useContext(MotionContext);\r\n const lazyContext = useContext(LazyContext);\r\n const presenceContext = useContext(PresenceContext);\r\n const reducedMotionConfig = useContext(MotionConfigContext).reducedMotion;\r\n const visualElementRef = useRef();\r\n /**\r\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\r\n */\r\n createVisualElement = createVisualElement || lazyContext.renderer;\r\n if (!visualElementRef.current && createVisualElement) {\r\n visualElementRef.current = createVisualElement(Component, {\r\n visualState,\r\n parent,\r\n props,\r\n presenceContext,\r\n blockInitialAnimation: presenceContext\r\n ? presenceContext.initial === false\r\n : false,\r\n reducedMotionConfig,\r\n });\r\n }\r\n const visualElement = visualElementRef.current;\r\n useInsertionEffect(() => {\r\n visualElement && visualElement.update(props, presenceContext);\r\n });\r\n /**\r\n * Cache this value as we want to know whether HandoffAppearAnimations\r\n * was present on initial render - it will be deleted after this.\r\n */\r\n const wantsHandoff = useRef(Boolean(props[optimizedAppearDataAttribute] && !window.HandoffComplete));\r\n useIsomorphicLayoutEffect(() => {\r\n if (!visualElement)\r\n return;\r\n visualElement.render();\r\n /**\r\n * Ideally this function would always run in a useEffect.\r\n *\r\n * However, if we have optimised appear animations to handoff from,\r\n * it needs to happen synchronously to ensure there's no flash of\r\n * incorrect styles in the event of a hydration error.\r\n *\r\n * So if we detect a situtation where optimised appear animations\r\n * are running, we use useLayoutEffect to trigger animations.\r\n */\r\n if (wantsHandoff.current && visualElement.animationState) {\r\n visualElement.animationState.animateChanges();\r\n }\r\n });\r\n useEffect(() => {\r\n if (!visualElement)\r\n return;\r\n visualElement.updateFeatures();\r\n if (!wantsHandoff.current && visualElement.animationState) {\r\n visualElement.animationState.animateChanges();\r\n }\r\n if (wantsHandoff.current) {\r\n wantsHandoff.current = false;\r\n // This ensures all future calls to animateChanges() will run in useEffect\r\n window.HandoffComplete = true;\r\n }\r\n });\r\n return visualElement;\r\n}\r\n\r\nexport { useVisualElement };\r\n","function isRefObject(ref) {\r\n return (ref &&\r\n typeof ref === \"object\" &&\r\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\r\n}\r\n\r\nexport { isRefObject };\r\n","import { useCallback } from 'react';\r\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\r\n\r\n/**\r\n * Creates a ref function that, when called, hydrates the provided\r\n * external ref and VisualElement.\r\n */\r\nfunction useMotionRef(visualState, visualElement, externalRef) {\r\n return useCallback((instance) => {\r\n instance && visualState.mount && visualState.mount(instance);\r\n if (visualElement) {\r\n instance\r\n ? visualElement.mount(instance)\r\n : visualElement.unmount();\r\n }\r\n if (externalRef) {\r\n if (typeof externalRef === \"function\") {\r\n externalRef(instance);\r\n }\r\n else if (isRefObject(externalRef)) {\r\n externalRef.current = instance;\r\n }\r\n }\r\n }, \r\n /**\r\n * Only pass a new ref callback to React if we've received a visual element\r\n * factory. Otherwise we'll be mounting/remounting every time externalRef\r\n * or other dependencies change.\r\n */\r\n [visualElement]);\r\n}\r\n\r\nexport { useMotionRef };\r\n","/**\r\n * Decides if the supplied variable is variant label\r\n */\r\nfunction isVariantLabel(v) {\r\n return typeof v === \"string\" || Array.isArray(v);\r\n}\r\n\r\nexport { isVariantLabel };\r\n","function isAnimationControls(v) {\r\n return (v !== null &&\r\n typeof v === \"object\" &&\r\n typeof v.start === \"function\");\r\n}\r\n\r\nexport { isAnimationControls };\r\n","const variantPriorityOrder = [\r\n \"animate\",\r\n \"whileInView\",\r\n \"whileFocus\",\r\n \"whileHover\",\r\n \"whileTap\",\r\n \"whileDrag\",\r\n \"exit\",\r\n];\r\nconst variantProps = [\"initial\", ...variantPriorityOrder];\r\n\r\nexport { variantPriorityOrder, variantProps };\r\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\r\nimport { isVariantLabel } from './is-variant-label.mjs';\r\nimport { variantProps } from './variant-props.mjs';\r\n\r\nfunction isControllingVariants(props) {\r\n return (isAnimationControls(props.animate) ||\r\n variantProps.some((name) => isVariantLabel(props[name])));\r\n}\r\nfunction isVariantNode(props) {\r\n return Boolean(isControllingVariants(props) || props.variants);\r\n}\r\n\r\nexport { isControllingVariants, isVariantNode };\r\n","import { isVariantLabel } from '../../render/utils/is-variant-label.mjs';\r\nimport { isControllingVariants } from '../../render/utils/is-controlling-variants.mjs';\r\n\r\nfunction getCurrentTreeVariants(props, context) {\r\n if (isControllingVariants(props)) {\r\n const { initial, animate } = props;\r\n return {\r\n initial: initial === false || isVariantLabel(initial)\r\n ? initial\r\n : undefined,\r\n animate: isVariantLabel(animate) ? animate : undefined,\r\n };\r\n }\r\n return props.inherit !== false ? context : {};\r\n}\r\n\r\nexport { getCurrentTreeVariants };\r\n","import { useContext, useMemo } from 'react';\r\nimport { MotionContext } from './index.mjs';\r\nimport { getCurrentTreeVariants } from './utils.mjs';\r\n\r\nfunction useCreateMotionContext(props) {\r\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\r\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\r\n}\r\nfunction variantLabelsAsDependency(prop) {\r\n return Array.isArray(prop) ? prop.join(\" \") : prop;\r\n}\r\n\r\nexport { useCreateMotionContext };\r\n","const featureProps = {\r\n animation: [\r\n \"animate\",\r\n \"variants\",\r\n \"whileHover\",\r\n \"whileTap\",\r\n \"exit\",\r\n \"whileInView\",\r\n \"whileFocus\",\r\n \"whileDrag\",\r\n ],\r\n exit: [\"exit\"],\r\n drag: [\"drag\", \"dragControls\"],\r\n focus: [\"whileFocus\"],\r\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\r\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\r\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\r\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\r\n layout: [\"layout\", \"layoutId\"],\r\n};\r\nconst featureDefinitions = {};\r\nfor (const key in featureProps) {\r\n featureDefinitions[key] = {\r\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\r\n };\r\n}\r\n\r\nexport { featureDefinitions };\r\n","import { featureDefinitions } from './definitions.mjs';\r\n\r\nfunction loadFeatures(features) {\r\n for (const key in features) {\r\n featureDefinitions[key] = {\r\n ...featureDefinitions[key],\r\n ...features[key],\r\n };\r\n }\r\n}\r\n\r\nexport { loadFeatures };\r\n","import { createContext } from 'react';\r\n\r\nconst LayoutGroupContext = createContext({});\r\n\r\nexport { LayoutGroupContext };\r\n","import { createContext } from 'react';\r\n\r\n/**\r\n * Internal, exported only for usage in Framer\r\n */\r\nconst SwitchLayoutGroupContext = createContext({});\r\n\r\nexport { SwitchLayoutGroupContext };\r\n","const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\r\n\r\nexport { motionComponentSymbol };\r\n","import * as React from 'react';\r\nimport { forwardRef, useContext } from 'react';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { MotionContext } from '../context/MotionContext/index.mjs';\r\nimport { useVisualElement } from './utils/use-visual-element.mjs';\r\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\r\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\r\nimport { loadFeatures } from './features/load-features.mjs';\r\nimport { isBrowser } from '../utils/is-browser.mjs';\r\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\r\nimport { LazyContext } from '../context/LazyContext.mjs';\r\nimport { SwitchLayoutGroupContext } from '../context/SwitchLayoutGroupContext.mjs';\r\nimport { motionComponentSymbol } from './utils/symbol.mjs';\r\n\r\n/**\r\n * Create a `motion` component.\r\n *\r\n * This function accepts a Component argument, which can be either a string (ie \"div\"\r\n * for `motion.div`), or an actual React component.\r\n *\r\n * Alongside this is a config option which provides a way of rendering the provided\r\n * component \"offline\", or outside the React render cycle.\r\n */\r\nfunction createMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {\r\n preloadedFeatures && loadFeatures(preloadedFeatures);\r\n function MotionComponent(props, externalRef) {\r\n /**\r\n * If we need to measure the element we load this functionality in a\r\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\r\n */\r\n let MeasureLayout;\r\n const configAndProps = {\r\n ...useContext(MotionConfigContext),\r\n ...props,\r\n layoutId: useLayoutId(props),\r\n };\r\n const { isStatic } = configAndProps;\r\n const context = useCreateMotionContext(props);\r\n const visualState = useVisualState(props, isStatic);\r\n if (!isStatic && isBrowser) {\r\n /**\r\n * Create a VisualElement for this component. A VisualElement provides a common\r\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\r\n * providing a way of rendering to these APIs outside of the React render loop\r\n * for more performant animations and interactions\r\n */\r\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement);\r\n /**\r\n * Load Motion gesture and animation features. These are rendered as renderless\r\n * components so each feature can optionally make use of React lifecycle methods.\r\n */\r\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\r\n const isStrict = useContext(LazyContext).strict;\r\n if (context.visualElement) {\r\n MeasureLayout = context.visualElement.loadFeatures(\r\n // Note: Pass the full new combined props to correctly re-render dynamic feature components.\r\n configAndProps, isStrict, preloadedFeatures, initialLayoutGroupConfig);\r\n }\r\n }\r\n /**\r\n * The mount order and hierarchy is specific to ensure our element ref\r\n * is hydrated by the time features fire their effects.\r\n */\r\n return (React.createElement(MotionContext.Provider, { value: context },\r\n MeasureLayout && context.visualElement ? (React.createElement(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null,\r\n useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)));\r\n }\r\n const ForwardRefComponent = forwardRef(MotionComponent);\r\n ForwardRefComponent[motionComponentSymbol] = Component;\r\n return ForwardRefComponent;\r\n}\r\nfunction useLayoutId({ layoutId }) {\r\n const layoutGroupId = useContext(LayoutGroupContext).id;\r\n return layoutGroupId && layoutId !== undefined\r\n ? layoutGroupId + \"-\" + layoutId\r\n : layoutId;\r\n}\r\n\r\nexport { createMotionComponent };\r\n","import { createMotionComponent } from '../../motion/index.mjs';\r\n\r\n/**\r\n * Convert any React component into a `motion` component. The provided component\r\n * **must** use `React.forwardRef` to the underlying DOM component you want to animate.\r\n *\r\n * ```jsx\r\n * const Component = React.forwardRef((props, ref) => {\r\n * return
\r\n * })\r\n *\r\n * const MotionComponent = motion(Component)\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction createMotionProxy(createConfig) {\r\n function custom(Component, customMotionComponentConfig = {}) {\r\n return createMotionComponent(createConfig(Component, customMotionComponentConfig));\r\n }\r\n if (typeof Proxy === \"undefined\") {\r\n return custom;\r\n }\r\n /**\r\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\r\n * Rather than generating them anew every render.\r\n */\r\n const componentCache = new Map();\r\n return new Proxy(custom, {\r\n /**\r\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\r\n * The prop name is passed through as `key` and we can use that to generate a `motion`\r\n * DOM component with that name.\r\n */\r\n get: (_target, key) => {\r\n /**\r\n * If this element doesn't exist in the component cache, create it and cache.\r\n */\r\n if (!componentCache.has(key)) {\r\n componentCache.set(key, custom(key));\r\n }\r\n return componentCache.get(key);\r\n },\r\n });\r\n}\r\n\r\nexport { createMotionProxy };\r\n","/**\r\n * We keep these listed seperately as we use the lowercase tag names as part\r\n * of the runtime bundle to detect SVG components\r\n */\r\nconst lowercaseSVGElements = [\r\n \"animate\",\r\n \"circle\",\r\n \"defs\",\r\n \"desc\",\r\n \"ellipse\",\r\n \"g\",\r\n \"image\",\r\n \"line\",\r\n \"filter\",\r\n \"marker\",\r\n \"mask\",\r\n \"metadata\",\r\n \"path\",\r\n \"pattern\",\r\n \"polygon\",\r\n \"polyline\",\r\n \"rect\",\r\n \"stop\",\r\n \"switch\",\r\n \"symbol\",\r\n \"svg\",\r\n \"text\",\r\n \"tspan\",\r\n \"use\",\r\n \"view\",\r\n];\r\n\r\nexport { lowercaseSVGElements };\r\n","import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs';\r\n\r\nfunction isSVGComponent(Component) {\r\n if (\r\n /**\r\n * If it's not a string, it's a custom React component. Currently we only support\r\n * HTML custom React components.\r\n */\r\n typeof Component !== \"string\" ||\r\n /**\r\n * If it contains a dash, the element is a custom HTML webcomponent.\r\n */\r\n Component.includes(\"-\")) {\r\n return false;\r\n }\r\n else if (\r\n /**\r\n * If it's in our list of lowercase SVG tags, it's an SVG component\r\n */\r\n lowercaseSVGElements.indexOf(Component) > -1 ||\r\n /**\r\n * If it contains a capital letter, it's an SVG component\r\n */\r\n /[A-Z]/.test(Component)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport { isSVGComponent };\r\n","const scaleCorrectors = {};\r\nfunction addScaleCorrector(correctors) {\r\n Object.assign(scaleCorrectors, correctors);\r\n}\r\n\r\nexport { addScaleCorrector, scaleCorrectors };\r\n","/**\r\n * Generate a list of every possible transform key.\r\n */\r\nconst transformPropOrder = [\r\n \"transformPerspective\",\r\n \"x\",\r\n \"y\",\r\n \"z\",\r\n \"translateX\",\r\n \"translateY\",\r\n \"translateZ\",\r\n \"scale\",\r\n \"scaleX\",\r\n \"scaleY\",\r\n \"rotate\",\r\n \"rotateX\",\r\n \"rotateY\",\r\n \"rotateZ\",\r\n \"skew\",\r\n \"skewX\",\r\n \"skewY\",\r\n];\r\n/**\r\n * A quick lookup for transform props.\r\n */\r\nconst transformProps = new Set(transformPropOrder);\r\n\r\nexport { transformPropOrder, transformProps };\r\n","import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\r\nimport { transformProps } from '../../render/html/utils/transform.mjs';\r\n\r\nfunction isForcedMotionValue(key, { layout, layoutId }) {\r\n return (transformProps.has(key) ||\r\n key.startsWith(\"origin\") ||\r\n ((layout || layoutId !== undefined) &&\r\n (!!scaleCorrectors[key] || key === \"opacity\")));\r\n}\r\n\r\nexport { isForcedMotionValue };\r\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\r\n\r\nexport { isMotionValue };\r\n","import { transformPropOrder } from './transform.mjs';\r\n\r\nconst translateAlias = {\r\n x: \"translateX\",\r\n y: \"translateY\",\r\n z: \"translateZ\",\r\n transformPerspective: \"perspective\",\r\n};\r\nconst numTransforms = transformPropOrder.length;\r\n/**\r\n * Build a CSS transform style from individual x/y/scale etc properties.\r\n *\r\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\r\n * providing a transformTemplate function.\r\n */\r\nfunction buildTransform(transform, { enableHardwareAcceleration = true, allowTransformNone = true, }, transformIsDefault, transformTemplate) {\r\n // The transform string we're going to build into.\r\n let transformString = \"\";\r\n /**\r\n * Loop over all possible transforms in order, adding the ones that\r\n * are present to the transform string.\r\n */\r\n for (let i = 0; i < numTransforms; i++) {\r\n const key = transformPropOrder[i];\r\n if (transform[key] !== undefined) {\r\n const transformName = translateAlias[key] || key;\r\n transformString += `${transformName}(${transform[key]}) `;\r\n }\r\n }\r\n if (enableHardwareAcceleration && !transform.z) {\r\n transformString += \"translateZ(0)\";\r\n }\r\n transformString = transformString.trim();\r\n // If we have a custom `transform` template, pass our transform values and\r\n // generated transformString to that before returning\r\n if (transformTemplate) {\r\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\r\n }\r\n else if (allowTransformNone && transformIsDefault) {\r\n transformString = \"none\";\r\n }\r\n return transformString;\r\n}\r\n\r\nexport { buildTransform };\r\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\r\nconst isCSSVariableName = checkStringStartsWith(\"--\");\r\nconst isCSSVariableToken = checkStringStartsWith(\"var(--\");\r\nconst cssVariableRegex = /var\\s*\\(\\s*--[\\w-]+(\\s*,\\s*(?:(?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)+)?\\s*\\)/g;\r\n\r\nexport { cssVariableRegex, isCSSVariableName, isCSSVariableToken };\r\n","/**\r\n * Provided a value and a ValueType, returns the value as that value type.\r\n */\r\nconst getValueAsType = (value, type) => {\r\n return type && typeof value === \"number\"\r\n ? type.transform(value)\r\n : value;\r\n};\r\n\r\nexport { getValueAsType };\r\n","const clamp = (min, max, v) => Math.min(Math.max(v, min), max);\r\n\r\nexport { clamp };\r\n","import { clamp } from '../../../utils/clamp.mjs';\r\n\r\nconst number = {\r\n test: (v) => typeof v === \"number\",\r\n parse: parseFloat,\r\n transform: (v) => v,\r\n};\r\nconst alpha = {\r\n ...number,\r\n transform: (v) => clamp(0, 1, v),\r\n};\r\nconst scale = {\r\n ...number,\r\n default: 1,\r\n};\r\n\r\nexport { alpha, number, scale };\r\n","/**\r\n * TODO: When we move from string as a source of truth to data models\r\n * everything in this folder should probably be referred to as models vs types\r\n */\r\n// If this number is a decimal, make it just five decimal places\r\n// to avoid exponents\r\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\r\nconst floatRegex = /(-)?([\\d]*\\.?[\\d])+/g;\r\nconst colorRegex = /(#[0-9a-f]{3,8}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2}(-?[\\d\\.]+%?)\\s*[\\,\\/]?\\s*[\\d\\.]*%?\\))/gi;\r\nconst singleColorRegex = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2}(-?[\\d\\.]+%?)\\s*[\\,\\/]?\\s*[\\d\\.]*%?\\))$/i;\r\nfunction isString(v) {\r\n return typeof v === \"string\";\r\n}\r\n\r\nexport { colorRegex, floatRegex, isString, sanitize, singleColorRegex };\r\n","import { isString } from '../utils.mjs';\r\n\r\nconst createUnitType = (unit) => ({\r\n test: (v) => isString(v) && v.endsWith(unit) && v.split(\" \").length === 1,\r\n parse: parseFloat,\r\n transform: (v) => `${v}${unit}`,\r\n});\r\nconst degrees = createUnitType(\"deg\");\r\nconst percent = createUnitType(\"%\");\r\nconst px = createUnitType(\"px\");\r\nconst vh = createUnitType(\"vh\");\r\nconst vw = createUnitType(\"vw\");\r\nconst progressPercentage = {\r\n ...percent,\r\n parse: (v) => percent.parse(v) / 100,\r\n transform: (v) => percent.transform(v * 100),\r\n};\r\n\r\nexport { degrees, percent, progressPercentage, px, vh, vw };\r\n","import { number } from '../../../value/types/numbers/index.mjs';\r\n\r\nconst int = {\r\n ...number,\r\n transform: Math.round,\r\n};\r\n\r\nexport { int };\r\n","import { scale, alpha } from '../../../value/types/numbers/index.mjs';\r\nimport { px, degrees, progressPercentage } from '../../../value/types/numbers/units.mjs';\r\nimport { int } from './type-int.mjs';\r\n\r\nconst numberValueTypes = {\r\n // Border props\r\n borderWidth: px,\r\n borderTopWidth: px,\r\n borderRightWidth: px,\r\n borderBottomWidth: px,\r\n borderLeftWidth: px,\r\n borderRadius: px,\r\n radius: px,\r\n borderTopLeftRadius: px,\r\n borderTopRightRadius: px,\r\n borderBottomRightRadius: px,\r\n borderBottomLeftRadius: px,\r\n // Positioning props\r\n width: px,\r\n maxWidth: px,\r\n height: px,\r\n maxHeight: px,\r\n size: px,\r\n top: px,\r\n right: px,\r\n bottom: px,\r\n left: px,\r\n // Spacing props\r\n padding: px,\r\n paddingTop: px,\r\n paddingRight: px,\r\n paddingBottom: px,\r\n paddingLeft: px,\r\n margin: px,\r\n marginTop: px,\r\n marginRight: px,\r\n marginBottom: px,\r\n marginLeft: px,\r\n // Transform props\r\n rotate: degrees,\r\n rotateX: degrees,\r\n rotateY: degrees,\r\n rotateZ: degrees,\r\n scale,\r\n scaleX: scale,\r\n scaleY: scale,\r\n scaleZ: scale,\r\n skew: degrees,\r\n skewX: degrees,\r\n skewY: degrees,\r\n distance: px,\r\n translateX: px,\r\n translateY: px,\r\n translateZ: px,\r\n x: px,\r\n y: px,\r\n z: px,\r\n perspective: px,\r\n transformPerspective: px,\r\n opacity: alpha,\r\n originX: progressPercentage,\r\n originY: progressPercentage,\r\n originZ: px,\r\n // Misc\r\n zIndex: int,\r\n // SVG\r\n fillOpacity: alpha,\r\n strokeOpacity: alpha,\r\n numOctaves: int,\r\n};\r\n\r\nexport { numberValueTypes };\r\n","import { buildTransform } from './build-transform.mjs';\r\nimport { isCSSVariableName } from '../../dom/utils/is-css-variable.mjs';\r\nimport { transformProps } from './transform.mjs';\r\nimport { getValueAsType } from '../../dom/value-types/get-as-type.mjs';\r\nimport { numberValueTypes } from '../../dom/value-types/number.mjs';\r\n\r\nfunction buildHTMLStyles(state, latestValues, options, transformTemplate) {\r\n const { style, vars, transform, transformOrigin } = state;\r\n // Track whether we encounter any transform or transformOrigin values.\r\n let hasTransform = false;\r\n let hasTransformOrigin = false;\r\n // Does the calculated transform essentially equal \"none\"?\r\n let transformIsNone = true;\r\n /**\r\n * Loop over all our latest animated values and decide whether to handle them\r\n * as a style or CSS variable.\r\n *\r\n * Transforms and transform origins are kept seperately for further processing.\r\n */\r\n for (const key in latestValues) {\r\n const value = latestValues[key];\r\n /**\r\n * If this is a CSS variable we don't do any further processing.\r\n */\r\n if (isCSSVariableName(key)) {\r\n vars[key] = value;\r\n continue;\r\n }\r\n // Convert the value to its default value type, ie 0 -> \"0px\"\r\n const valueType = numberValueTypes[key];\r\n const valueAsType = getValueAsType(value, valueType);\r\n if (transformProps.has(key)) {\r\n // If this is a transform, flag to enable further transform processing\r\n hasTransform = true;\r\n transform[key] = valueAsType;\r\n // If we already know we have a non-default transform, early return\r\n if (!transformIsNone)\r\n continue;\r\n // Otherwise check to see if this is a default transform\r\n if (value !== (valueType.default || 0))\r\n transformIsNone = false;\r\n }\r\n else if (key.startsWith(\"origin\")) {\r\n // If this is a transform origin, flag and enable further transform-origin processing\r\n hasTransformOrigin = true;\r\n transformOrigin[key] = valueAsType;\r\n }\r\n else {\r\n style[key] = valueAsType;\r\n }\r\n }\r\n if (!latestValues.transform) {\r\n if (hasTransform || transformTemplate) {\r\n style.transform = buildTransform(state.transform, options, transformIsNone, transformTemplate);\r\n }\r\n else if (style.transform) {\r\n /**\r\n * If we have previously created a transform but currently don't have any,\r\n * reset transform style to none.\r\n */\r\n style.transform = \"none\";\r\n }\r\n }\r\n /**\r\n * Build a transformOrigin style. Uses the same defaults as the browser for\r\n * undefined origins.\r\n */\r\n if (hasTransformOrigin) {\r\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\r\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\r\n }\r\n}\r\n\r\nexport { buildHTMLStyles };\r\n","const createHtmlRenderState = () => ({\r\n style: {},\r\n transform: {},\r\n transformOrigin: {},\r\n vars: {},\r\n});\r\n\r\nexport { createHtmlRenderState };\r\n","import { useMemo } from 'react';\r\nimport { isForcedMotionValue } from '../../motion/utils/is-forced-motion-value.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\r\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\r\n\r\nfunction copyRawValuesOnly(target, source, props) {\r\n for (const key in source) {\r\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\r\n target[key] = source[key];\r\n }\r\n }\r\n}\r\nfunction useInitialMotionValues({ transformTemplate }, visualState, isStatic) {\r\n return useMemo(() => {\r\n const state = createHtmlRenderState();\r\n buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);\r\n return Object.assign({}, state.vars, state.style);\r\n }, [visualState]);\r\n}\r\nfunction useStyle(props, visualState, isStatic) {\r\n const styleProp = props.style || {};\r\n const style = {};\r\n /**\r\n * Copy non-Motion Values straight into style\r\n */\r\n copyRawValuesOnly(style, styleProp, props);\r\n Object.assign(style, useInitialMotionValues(props, visualState, isStatic));\r\n return props.transformValues ? props.transformValues(style) : style;\r\n}\r\nfunction useHTMLProps(props, visualState, isStatic) {\r\n // The `any` isn't ideal but it is the type of createElement props argument\r\n const htmlProps = {};\r\n const style = useStyle(props, visualState, isStatic);\r\n if (props.drag && props.dragListener !== false) {\r\n // Disable the ghost element when a user drags\r\n htmlProps.draggable = false;\r\n // Disable text selection\r\n style.userSelect =\r\n style.WebkitUserSelect =\r\n style.WebkitTouchCallout =\r\n \"none\";\r\n // Disable scrolling on the draggable direction\r\n style.touchAction =\r\n props.drag === true\r\n ? \"none\"\r\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\r\n }\r\n if (props.tabIndex === undefined &&\r\n (props.onTap || props.onTapStart || props.whileTap)) {\r\n htmlProps.tabIndex = 0;\r\n }\r\n htmlProps.style = style;\r\n return htmlProps;\r\n}\r\n\r\nexport { copyRawValuesOnly, useHTMLProps };\r\n","/**\r\n * A list of all valid MotionProps.\r\n *\r\n * @privateRemarks\r\n * This doesn't throw if a `MotionProp` name is missing - it should.\r\n */\r\nconst validMotionProps = new Set([\r\n \"animate\",\r\n \"exit\",\r\n \"variants\",\r\n \"initial\",\r\n \"style\",\r\n \"values\",\r\n \"variants\",\r\n \"transition\",\r\n \"transformTemplate\",\r\n \"transformValues\",\r\n \"custom\",\r\n \"inherit\",\r\n \"onBeforeLayoutMeasure\",\r\n \"onAnimationStart\",\r\n \"onAnimationComplete\",\r\n \"onUpdate\",\r\n \"onDragStart\",\r\n \"onDrag\",\r\n \"onDragEnd\",\r\n \"onMeasureDragConstraints\",\r\n \"onDirectionLock\",\r\n \"onDragTransitionEnd\",\r\n \"_dragX\",\r\n \"_dragY\",\r\n \"onHoverStart\",\r\n \"onHoverEnd\",\r\n \"onViewportEnter\",\r\n \"onViewportLeave\",\r\n \"globalTapTarget\",\r\n \"ignoreStrict\",\r\n \"viewport\",\r\n]);\r\n/**\r\n * Check whether a prop name is a valid `MotionProp` key.\r\n *\r\n * @param key - Name of the property to check\r\n * @returns `true` is key is a valid `MotionProp`.\r\n *\r\n * @public\r\n */\r\nfunction isValidMotionProp(key) {\r\n return (key.startsWith(\"while\") ||\r\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\r\n key.startsWith(\"layout\") ||\r\n key.startsWith(\"onTap\") ||\r\n key.startsWith(\"onPan\") ||\r\n key.startsWith(\"onLayout\") ||\r\n validMotionProps.has(key));\r\n}\r\n\r\nexport { isValidMotionProp };\r\n","function memoize(fn) {\r\n var cache = {};\r\n return function (arg) {\r\n if (cache[arg] === undefined) cache[arg] = fn(arg);\r\n return cache[arg];\r\n };\r\n}\r\n\r\nexport default memoize;\r\n","import memoize from '@emotion/memoize';\r\n\r\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\r\n\r\nvar index = memoize(function (prop) {\r\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\r\n /* o */\r\n && prop.charCodeAt(1) === 110\r\n /* n */\r\n && prop.charCodeAt(2) < 91;\r\n}\r\n/* Z+1 */\r\n);\r\n\r\nexport default index;\r\n","import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\r\n\r\nlet shouldForward = (key) => !isValidMotionProp(key);\r\nfunction loadExternalIsValidProp(isValidProp) {\r\n if (!isValidProp)\r\n return;\r\n // Explicitly filter our events\r\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\r\n}\r\n/**\r\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\r\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\r\n * of these should be passed to the underlying DOM node.\r\n *\r\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\r\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\r\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\r\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\r\n *\r\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\r\n * actually required.\r\n */\r\ntry {\r\n /**\r\n * We attempt to import this package but require won't be defined in esm environments, in that case\r\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\r\n * in favour of explicit injection.\r\n */\r\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\r\n}\r\ncatch (_a) {\r\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\r\n}\r\nfunction filterProps(props, isDom, forwardMotionProps) {\r\n const filteredProps = {};\r\n for (const key in props) {\r\n /**\r\n * values is considered a valid prop by Emotion, so if it's present\r\n * this will be rendered out to the DOM unless explicitly filtered.\r\n *\r\n * We check the type as it could be used with the `feColorMatrix`\r\n * element, which we support.\r\n */\r\n if (key === \"values\" && typeof props.values === \"object\")\r\n continue;\r\n if (shouldForward(key) ||\r\n (forwardMotionProps === true && isValidMotionProp(key)) ||\r\n (!isDom && !isValidMotionProp(key)) ||\r\n // If trying to use native HTML drag events, forward drag listeners\r\n (props[\"draggable\"] && key.startsWith(\"onDrag\"))) {\r\n filteredProps[key] = props[key];\r\n }\r\n }\r\n return filteredProps;\r\n}\r\n\r\nexport { filterProps, loadExternalIsValidProp };\r\n","import { px } from '../../../value/types/numbers/units.mjs';\r\n\r\nfunction calcOrigin(origin, offset, size) {\r\n return typeof origin === \"string\"\r\n ? origin\r\n : px.transform(offset + size * origin);\r\n}\r\n/**\r\n * The SVG transform origin defaults are different to CSS and is less intuitive,\r\n * so we use the measured dimensions of the SVG to reconcile these.\r\n */\r\nfunction calcSVGTransformOrigin(dimensions, originX, originY) {\r\n const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);\r\n const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);\r\n return `${pxOriginX} ${pxOriginY}`;\r\n}\r\n\r\nexport { calcSVGTransformOrigin };\r\n","import { px } from '../../../value/types/numbers/units.mjs';\r\n\r\nconst dashKeys = {\r\n offset: \"stroke-dashoffset\",\r\n array: \"stroke-dasharray\",\r\n};\r\nconst camelKeys = {\r\n offset: \"strokeDashoffset\",\r\n array: \"strokeDasharray\",\r\n};\r\n/**\r\n * Build SVG path properties. Uses the path's measured length to convert\r\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\r\n * and stroke-dasharray attributes.\r\n *\r\n * This function is mutative to reduce per-frame GC.\r\n */\r\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\r\n // Normalise path length by setting SVG attribute pathLength to 1\r\n attrs.pathLength = 1;\r\n // We use dash case when setting attributes directly to the DOM node and camel case\r\n // when defining props on a React component.\r\n const keys = useDashCase ? dashKeys : camelKeys;\r\n // Build the dash offset\r\n attrs[keys.offset] = px.transform(-offset);\r\n // Build the dash array\r\n const pathLength = px.transform(length);\r\n const pathSpacing = px.transform(spacing);\r\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\r\n}\r\n\r\nexport { buildSVGPath };\r\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\r\nimport { calcSVGTransformOrigin } from './transform-origin.mjs';\r\nimport { buildSVGPath } from './path.mjs';\r\n\r\n/**\r\n * Build SVG visual attrbutes, like cx and style.transform\r\n */\r\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0, \r\n// This is object creation, which we try to avoid per-frame.\r\n...latest }, options, isSVGTag, transformTemplate) {\r\n buildHTMLStyles(state, latest, options, transformTemplate);\r\n /**\r\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\r\n * as normal HTML tags.\r\n */\r\n if (isSVGTag) {\r\n if (state.style.viewBox) {\r\n state.attrs.viewBox = state.style.viewBox;\r\n }\r\n return;\r\n }\r\n state.attrs = state.style;\r\n state.style = {};\r\n const { attrs, style, dimensions } = state;\r\n /**\r\n * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs\r\n * and copy it into style.\r\n */\r\n if (attrs.transform) {\r\n if (dimensions)\r\n style.transform = attrs.transform;\r\n delete attrs.transform;\r\n }\r\n // Parse transformOrigin\r\n if (dimensions &&\r\n (originX !== undefined || originY !== undefined || style.transform)) {\r\n style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);\r\n }\r\n // Render attrX/attrY/attrScale as attributes\r\n if (attrX !== undefined)\r\n attrs.x = attrX;\r\n if (attrY !== undefined)\r\n attrs.y = attrY;\r\n if (attrScale !== undefined)\r\n attrs.scale = attrScale;\r\n // Build SVG path if one has been defined\r\n if (pathLength !== undefined) {\r\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\r\n }\r\n}\r\n\r\nexport { buildSVGAttrs };\r\n","import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs';\r\n\r\nconst createSvgRenderState = () => ({\r\n ...createHtmlRenderState(),\r\n attrs: {},\r\n});\r\n\r\nexport { createSvgRenderState };\r\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\r\n\r\nexport { isSVGTag };\r\n","import { useMemo } from 'react';\r\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\r\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\r\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\r\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\r\n\r\nfunction useSVGProps(props, visualState, _isStatic, Component) {\r\n const visualProps = useMemo(() => {\r\n const state = createSvgRenderState();\r\n buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, isSVGTag(Component), props.transformTemplate);\r\n return {\r\n ...state.attrs,\r\n style: { ...state.style },\r\n };\r\n }, [visualState]);\r\n if (props.style) {\r\n const rawStyles = {};\r\n copyRawValuesOnly(rawStyles, props.style, props);\r\n visualProps.style = { ...rawStyles, ...visualProps.style };\r\n }\r\n return visualProps;\r\n}\r\n\r\nexport { useSVGProps };\r\n","import { useMemo, createElement } from 'react';\r\nimport { useHTMLProps } from '../html/use-props.mjs';\r\nimport { filterProps } from './utils/filter-props.mjs';\r\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\r\nimport { useSVGProps } from '../svg/use-props.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction createUseRender(forwardMotionProps = false) {\r\n const useRender = (Component, props, ref, { latestValues }, isStatic) => {\r\n const useVisualProps = isSVGComponent(Component)\r\n ? useSVGProps\r\n : useHTMLProps;\r\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\r\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\r\n const elementProps = {\r\n ...filteredProps,\r\n ...visualProps,\r\n ref,\r\n };\r\n /**\r\n * If component has been handed a motion value as its child,\r\n * memoise its initial value and render that. Subsequent updates\r\n * will be handled by the onChange handler\r\n */\r\n const { children } = props;\r\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\r\n return createElement(Component, {\r\n ...elementProps,\r\n children: renderedChildren,\r\n });\r\n };\r\n return useRender;\r\n}\r\n\r\nexport { createUseRender };\r\n","function renderHTML(element, { style, vars }, styleProp, projection) {\r\n Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));\r\n // Loop over any CSS variables and assign those.\r\n for (const key in vars) {\r\n element.style.setProperty(key, vars[key]);\r\n }\r\n}\r\n\r\nexport { renderHTML };\r\n","/**\r\n * A set of attribute names that are always read/written as camel case.\r\n */\r\nconst camelCaseAttributes = new Set([\r\n \"baseFrequency\",\r\n \"diffuseConstant\",\r\n \"kernelMatrix\",\r\n \"kernelUnitLength\",\r\n \"keySplines\",\r\n \"keyTimes\",\r\n \"limitingConeAngle\",\r\n \"markerHeight\",\r\n \"markerWidth\",\r\n \"numOctaves\",\r\n \"targetX\",\r\n \"targetY\",\r\n \"surfaceScale\",\r\n \"specularConstant\",\r\n \"specularExponent\",\r\n \"stdDeviation\",\r\n \"tableValues\",\r\n \"viewBox\",\r\n \"gradientTransform\",\r\n \"pathLength\",\r\n \"startOffset\",\r\n \"textLength\",\r\n \"lengthAdjust\",\r\n]);\r\n\r\nexport { camelCaseAttributes };\r\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\r\nimport { renderHTML } from '../../html/utils/render.mjs';\r\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\r\n\r\nfunction renderSVG(element, renderState, _styleProp, projection) {\r\n renderHTML(element, renderState, undefined, projection);\r\n for (const key in renderState.attrs) {\r\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\r\n }\r\n}\r\n\r\nexport { renderSVG };\r\n","import { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';\r\nimport { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\r\n\r\nfunction scrapeMotionValuesFromProps(props, prevProps) {\r\n const { style } = props;\r\n const newValues = {};\r\n for (const key in style) {\r\n if (isMotionValue(style[key]) ||\r\n (prevProps.style && isMotionValue(prevProps.style[key])) ||\r\n isForcedMotionValue(key, props)) {\r\n newValues[key] = style[key];\r\n }\r\n }\r\n return newValues;\r\n}\r\n\r\nexport { scrapeMotionValuesFromProps };\r\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\r\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\r\nimport { transformPropOrder } from '../../html/utils/transform.mjs';\r\n\r\nfunction scrapeMotionValuesFromProps(props, prevProps) {\r\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps);\r\n for (const key in props) {\r\n if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) {\r\n const targetKey = transformPropOrder.indexOf(key) !== -1\r\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\r\n : key;\r\n newValues[targetKey] = props[key];\r\n }\r\n }\r\n return newValues;\r\n}\r\n\r\nexport { scrapeMotionValuesFromProps };\r\n","function resolveVariantFromProps(props, definition, custom, currentValues = {}, currentVelocity = {}) {\r\n /**\r\n * If the variant definition is a function, resolve.\r\n */\r\n if (typeof definition === \"function\") {\r\n definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);\r\n }\r\n /**\r\n * If the variant definition is a variant label, or\r\n * the function returned a variant label, resolve.\r\n */\r\n if (typeof definition === \"string\") {\r\n definition = props.variants && props.variants[definition];\r\n }\r\n /**\r\n * At this point we've resolved both functions and variant labels,\r\n * but the resolved variant label might itself have been a function.\r\n * If so, resolve. This can only have returned a valid target object.\r\n */\r\n if (typeof definition === \"function\") {\r\n definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);\r\n }\r\n return definition;\r\n}\r\n\r\nexport { resolveVariantFromProps };\r\n","import { useRef } from 'react';\r\n\r\n/**\r\n * Creates a constant value over the lifecycle of a component.\r\n *\r\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\r\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\r\n * you can ensure that initialisers don't execute twice or more.\r\n */\r\nfunction useConstant(init) {\r\n const ref = useRef(null);\r\n if (ref.current === null) {\r\n ref.current = init();\r\n }\r\n return ref.current;\r\n}\r\n\r\nexport { useConstant };\r\n","const isKeyframesTarget = (v) => {\r\n return Array.isArray(v);\r\n};\r\n\r\nexport { isKeyframesTarget };\r\n","import { isKeyframesTarget } from '../animation/utils/is-keyframes-target.mjs';\r\n\r\nconst isCustomValue = (v) => {\r\n return Boolean(v && typeof v === \"object\" && v.mix && v.toValue);\r\n};\r\nconst resolveFinalValueInKeyframes = (v) => {\r\n // TODO maybe throw if v.length - 1 is placeholder token?\r\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\r\n};\r\n\r\nexport { isCustomValue, resolveFinalValueInKeyframes };\r\n","import { isCustomValue } from '../../utils/resolve-value.mjs';\r\nimport { isMotionValue } from './is-motion-value.mjs';\r\n\r\n/**\r\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\r\n *\r\n * TODO: Remove and move to library\r\n */\r\nfunction resolveMotionValue(value) {\r\n const unwrappedValue = isMotionValue(value) ? value.get() : value;\r\n return isCustomValue(unwrappedValue)\r\n ? unwrappedValue.toValue()\r\n : unwrappedValue;\r\n}\r\n\r\nexport { resolveMotionValue };\r\n","import { useContext } from 'react';\r\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\nimport { resolveVariantFromProps } from '../../render/utils/resolve-variants.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\r\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\r\nimport { isControllingVariants, isVariantNode } from '../../render/utils/is-controlling-variants.mjs';\r\n\r\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, onMount, }, props, context, presenceContext) {\r\n const state = {\r\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\r\n renderState: createRenderState(),\r\n };\r\n if (onMount) {\r\n state.mount = (instance) => onMount(props, instance, state);\r\n }\r\n return state;\r\n}\r\nconst makeUseVisualState = (config) => (props, isStatic) => {\r\n const context = useContext(MotionContext);\r\n const presenceContext = useContext(PresenceContext);\r\n const make = () => makeState(config, props, context, presenceContext);\r\n return isStatic ? make() : useConstant(make);\r\n};\r\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\r\n const values = {};\r\n const motionValues = scrapeMotionValues(props, {});\r\n for (const key in motionValues) {\r\n values[key] = resolveMotionValue(motionValues[key]);\r\n }\r\n let { initial, animate } = props;\r\n const isControllingVariants$1 = isControllingVariants(props);\r\n const isVariantNode$1 = isVariantNode(props);\r\n if (context &&\r\n isVariantNode$1 &&\r\n !isControllingVariants$1 &&\r\n props.inherit !== false) {\r\n if (initial === undefined)\r\n initial = context.initial;\r\n if (animate === undefined)\r\n animate = context.animate;\r\n }\r\n let isInitialAnimationBlocked = presenceContext\r\n ? presenceContext.initial === false\r\n : false;\r\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\r\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\r\n if (variantToSet &&\r\n typeof variantToSet !== \"boolean\" &&\r\n !isAnimationControls(variantToSet)) {\r\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\r\n list.forEach((definition) => {\r\n const resolved = resolveVariantFromProps(props, definition);\r\n if (!resolved)\r\n return;\r\n const { transitionEnd, transition, ...target } = resolved;\r\n for (const key in target) {\r\n let valueTarget = target[key];\r\n if (Array.isArray(valueTarget)) {\r\n /**\r\n * Take final keyframe if the initial animation is blocked because\r\n * we want to initialise at the end of that blocked animation.\r\n */\r\n const index = isInitialAnimationBlocked\r\n ? valueTarget.length - 1\r\n : 0;\r\n valueTarget = valueTarget[index];\r\n }\r\n if (valueTarget !== null) {\r\n values[key] = valueTarget;\r\n }\r\n }\r\n for (const key in transitionEnd)\r\n values[key] = transitionEnd[key];\r\n });\r\n }\r\n return values;\r\n}\r\n\r\nexport { makeUseVisualState };\r\n","const noop = (any) => any;\r\n\r\nexport { noop };\r\n","class Queue {\r\n constructor() {\r\n this.order = [];\r\n this.scheduled = new Set();\r\n }\r\n add(process) {\r\n if (!this.scheduled.has(process)) {\r\n this.scheduled.add(process);\r\n this.order.push(process);\r\n return true;\r\n }\r\n }\r\n remove(process) {\r\n const index = this.order.indexOf(process);\r\n if (index !== -1) {\r\n this.order.splice(index, 1);\r\n this.scheduled.delete(process);\r\n }\r\n }\r\n clear() {\r\n this.order.length = 0;\r\n this.scheduled.clear();\r\n }\r\n}\r\nfunction createRenderStep(runNextFrame) {\r\n /**\r\n * We create and reuse two queues, one to queue jobs for the current frame\r\n * and one for the next. We reuse to avoid triggering GC after x frames.\r\n */\r\n let thisFrame = new Queue();\r\n let nextFrame = new Queue();\r\n let numToRun = 0;\r\n /**\r\n * Track whether we're currently processing jobs in this step. This way\r\n * we can decide whether to schedule new jobs for this frame or next.\r\n */\r\n let isProcessing = false;\r\n let flushNextFrame = false;\r\n /**\r\n * A set of processes which were marked keepAlive when scheduled.\r\n */\r\n const toKeepAlive = new WeakSet();\r\n const step = {\r\n /**\r\n * Schedule a process to run on the next frame.\r\n */\r\n schedule: (callback, keepAlive = false, immediate = false) => {\r\n const addToCurrentFrame = immediate && isProcessing;\r\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\r\n if (keepAlive)\r\n toKeepAlive.add(callback);\r\n if (queue.add(callback) && addToCurrentFrame && isProcessing) {\r\n // If we're adding it to the currently running queue, update its measured size\r\n numToRun = thisFrame.order.length;\r\n }\r\n return callback;\r\n },\r\n /**\r\n * Cancel the provided callback from running on the next frame.\r\n */\r\n cancel: (callback) => {\r\n nextFrame.remove(callback);\r\n toKeepAlive.delete(callback);\r\n },\r\n /**\r\n * Execute all schedule callbacks.\r\n */\r\n process: (frameData) => {\r\n /**\r\n * If we're already processing we've probably been triggered by a flushSync\r\n * inside an existing process. Instead of executing, mark flushNextFrame\r\n * as true and ensure we flush the following frame at the end of this one.\r\n */\r\n if (isProcessing) {\r\n flushNextFrame = true;\r\n return;\r\n }\r\n isProcessing = true;\r\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\r\n // Clear the next frame queue\r\n nextFrame.clear();\r\n // Execute this frame\r\n numToRun = thisFrame.order.length;\r\n if (numToRun) {\r\n for (let i = 0; i < numToRun; i++) {\r\n const callback = thisFrame.order[i];\r\n callback(frameData);\r\n if (toKeepAlive.has(callback)) {\r\n step.schedule(callback);\r\n runNextFrame();\r\n }\r\n }\r\n }\r\n isProcessing = false;\r\n if (flushNextFrame) {\r\n flushNextFrame = false;\r\n step.process(frameData);\r\n }\r\n },\r\n };\r\n return step;\r\n}\r\n\r\nexport { createRenderStep };\r\n","import { createRenderStep } from './render-step.mjs';\r\n\r\nconst stepsOrder = [\r\n \"prepare\",\r\n \"read\",\r\n \"update\",\r\n \"preRender\",\r\n \"render\",\r\n \"postRender\",\r\n];\r\nconst maxElapsed = 40;\r\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\r\n let runNextFrame = false;\r\n let useDefaultElapsed = true;\r\n const state = {\r\n delta: 0,\r\n timestamp: 0,\r\n isProcessing: false,\r\n };\r\n const steps = stepsOrder.reduce((acc, key) => {\r\n acc[key] = createRenderStep(() => (runNextFrame = true));\r\n return acc;\r\n }, {});\r\n const processStep = (stepId) => steps[stepId].process(state);\r\n const processBatch = () => {\r\n const timestamp = performance.now();\r\n runNextFrame = false;\r\n state.delta = useDefaultElapsed\r\n ? 1000 / 60\r\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\r\n state.timestamp = timestamp;\r\n state.isProcessing = true;\r\n stepsOrder.forEach(processStep);\r\n state.isProcessing = false;\r\n if (runNextFrame && allowKeepAlive) {\r\n useDefaultElapsed = false;\r\n scheduleNextBatch(processBatch);\r\n }\r\n };\r\n const wake = () => {\r\n runNextFrame = true;\r\n useDefaultElapsed = true;\r\n if (!state.isProcessing) {\r\n scheduleNextBatch(processBatch);\r\n }\r\n };\r\n const schedule = stepsOrder.reduce((acc, key) => {\r\n const step = steps[key];\r\n acc[key] = (process, keepAlive = false, immediate = false) => {\r\n if (!runNextFrame)\r\n wake();\r\n return step.schedule(process, keepAlive, immediate);\r\n };\r\n return acc;\r\n }, {});\r\n const cancel = (process) => stepsOrder.forEach((key) => steps[key].cancel(process));\r\n return { schedule, cancel, state, steps };\r\n}\r\n\r\nexport { createRenderBatcher, stepsOrder };\r\n","import { noop } from '../utils/noop.mjs';\r\nimport { createRenderBatcher } from './batcher.mjs';\r\n\r\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps, } = createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\r\n\r\nexport { cancelFrame, frame, frameData, steps };\r\n","import { renderSVG } from './utils/render.mjs';\r\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\r\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\r\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\r\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\nconst svgMotionConfig = {\r\n useVisualState: makeUseVisualState({\r\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\r\n createRenderState: createSvgRenderState,\r\n onMount: (props, instance, { renderState, latestValues }) => {\r\n frame.read(() => {\r\n try {\r\n renderState.dimensions =\r\n typeof instance.getBBox ===\r\n \"function\"\r\n ? instance.getBBox()\r\n : instance.getBoundingClientRect();\r\n }\r\n catch (e) {\r\n // Most likely trying to measure an unrendered element under Firefox\r\n renderState.dimensions = {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0,\r\n };\r\n }\r\n });\r\n frame.render(() => {\r\n buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, isSVGTag(instance.tagName), props.transformTemplate);\r\n renderSVG(instance, renderState);\r\n });\r\n },\r\n }),\r\n};\r\n\r\nexport { svgMotionConfig };\r\n","import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\r\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\r\n\r\nconst htmlMotionConfig = {\r\n useVisualState: makeUseVisualState({\r\n scrapeMotionValuesFromProps,\r\n createRenderState: createHtmlRenderState,\r\n }),\r\n};\r\n\r\nexport { htmlMotionConfig };\r\n","import { isSVGComponent } from './is-svg-component.mjs';\r\nimport { createUseRender } from '../use-render.mjs';\r\nimport { svgMotionConfig } from '../../svg/config-motion.mjs';\r\nimport { htmlMotionConfig } from '../../html/config-motion.mjs';\r\n\r\nfunction createDomMotionConfig(Component, { forwardMotionProps = false }, preloadedFeatures, createVisualElement) {\r\n const baseConfig = isSVGComponent(Component)\r\n ? svgMotionConfig\r\n : htmlMotionConfig;\r\n return {\r\n ...baseConfig,\r\n preloadedFeatures,\r\n useRender: createUseRender(forwardMotionProps),\r\n createVisualElement,\r\n Component,\r\n };\r\n}\r\n\r\nexport { createDomMotionConfig };\r\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\r\n target.addEventListener(eventName, handler, options);\r\n return () => target.removeEventListener(eventName, handler);\r\n}\r\n\r\nexport { addDomEvent };\r\n","const isPrimaryPointer = (event) => {\r\n if (event.pointerType === \"mouse\") {\r\n return typeof event.button !== \"number\" || event.button <= 0;\r\n }\r\n else {\r\n /**\r\n * isPrimary is true for all mice buttons, whereas every touch point\r\n * is regarded as its own input. So subsequent concurrent touch points\r\n * will be false.\r\n *\r\n * Specifically match against false here as incomplete versions of\r\n * PointerEvents in very old browser might have it set as undefined.\r\n */\r\n return event.isPrimary !== false;\r\n }\r\n};\r\n\r\nexport { isPrimaryPointer };\r\n","import { isPrimaryPointer } from './utils/is-primary-pointer.mjs';\r\n\r\nfunction extractEventInfo(event, pointType = \"page\") {\r\n return {\r\n point: {\r\n x: event[pointType + \"X\"],\r\n y: event[pointType + \"Y\"],\r\n },\r\n };\r\n}\r\nconst addPointerInfo = (handler) => {\r\n return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\r\n};\r\n\r\nexport { addPointerInfo, extractEventInfo };\r\n","import { addDomEvent } from './add-dom-event.mjs';\r\nimport { addPointerInfo } from './event-info.mjs';\r\n\r\nfunction addPointerEvent(target, eventName, handler, options) {\r\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\r\n}\r\n\r\nexport { addPointerEvent };\r\n","/**\r\n * Pipe\r\n * Compose other transformers to run linearily\r\n * pipe(min(20), max(40))\r\n * @param {...functions} transformers\r\n * @return {function}\r\n */\r\nconst combineFunctions = (a, b) => (v) => b(a(v));\r\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\r\n\r\nexport { pipe };\r\n","function createLock(name) {\r\n let lock = null;\r\n return () => {\r\n const openLock = () => {\r\n lock = null;\r\n };\r\n if (lock === null) {\r\n lock = name;\r\n return openLock;\r\n }\r\n return false;\r\n };\r\n}\r\nconst globalHorizontalLock = createLock(\"dragHorizontal\");\r\nconst globalVerticalLock = createLock(\"dragVertical\");\r\nfunction getGlobalLock(drag) {\r\n let lock = false;\r\n if (drag === \"y\") {\r\n lock = globalVerticalLock();\r\n }\r\n else if (drag === \"x\") {\r\n lock = globalHorizontalLock();\r\n }\r\n else {\r\n const openHorizontal = globalHorizontalLock();\r\n const openVertical = globalVerticalLock();\r\n if (openHorizontal && openVertical) {\r\n lock = () => {\r\n openHorizontal();\r\n openVertical();\r\n };\r\n }\r\n else {\r\n // Release the locks because we don't use them\r\n if (openHorizontal)\r\n openHorizontal();\r\n if (openVertical)\r\n openVertical();\r\n }\r\n }\r\n return lock;\r\n}\r\nfunction isDragActive() {\r\n // Check the gesture lock - if we get it, it means no drag gesture is active\r\n // and we can safely fire the tap gesture.\r\n const openGestureLock = getGlobalLock(true);\r\n if (!openGestureLock)\r\n return true;\r\n openGestureLock();\r\n return false;\r\n}\r\n\r\nexport { createLock, getGlobalLock, isDragActive };\r\n","class Feature {\r\n constructor(node) {\r\n this.isMounted = false;\r\n this.node = node;\r\n }\r\n update() { }\r\n}\r\n\r\nexport { Feature };\r\n","import { addPointerEvent } from '../events/add-pointer-event.mjs';\r\nimport { pipe } from '../utils/pipe.mjs';\r\nimport { isDragActive } from './drag/utils/lock.mjs';\r\nimport { Feature } from '../motion/features/Feature.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction addHoverEvent(node, isActive) {\r\n const eventName = \"pointer\" + (isActive ? \"enter\" : \"leave\");\r\n const callbackName = \"onHover\" + (isActive ? \"Start\" : \"End\");\r\n const handleEvent = (event, info) => {\r\n if (event.pointerType === \"touch\" || isDragActive())\r\n return;\r\n const props = node.getProps();\r\n if (node.animationState && props.whileHover) {\r\n node.animationState.setActive(\"whileHover\", isActive);\r\n }\r\n if (props[callbackName]) {\r\n frame.update(() => props[callbackName](event, info));\r\n }\r\n };\r\n return addPointerEvent(node.current, eventName, handleEvent, {\r\n passive: !node.getProps()[callbackName],\r\n });\r\n}\r\nclass HoverGesture extends Feature {\r\n mount() {\r\n this.unmount = pipe(addHoverEvent(this.node, true), addHoverEvent(this.node, false));\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { HoverGesture };\r\n","import { addDomEvent } from '../events/add-dom-event.mjs';\r\nimport { Feature } from '../motion/features/Feature.mjs';\r\nimport { pipe } from '../utils/pipe.mjs';\r\n\r\nclass FocusGesture extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.isActive = false;\r\n }\r\n onFocus() {\r\n let isFocusVisible = false;\r\n /**\r\n * If this element doesn't match focus-visible then don't\r\n * apply whileHover. But, if matches throws that focus-visible\r\n * is not a valid selector then in that browser outline styles will be applied\r\n * to the element by default and we want to match that behaviour with whileFocus.\r\n */\r\n try {\r\n isFocusVisible = this.node.current.matches(\":focus-visible\");\r\n }\r\n catch (e) {\r\n isFocusVisible = true;\r\n }\r\n if (!isFocusVisible || !this.node.animationState)\r\n return;\r\n this.node.animationState.setActive(\"whileFocus\", true);\r\n this.isActive = true;\r\n }\r\n onBlur() {\r\n if (!this.isActive || !this.node.animationState)\r\n return;\r\n this.node.animationState.setActive(\"whileFocus\", false);\r\n this.isActive = false;\r\n }\r\n mount() {\r\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { FocusGesture };\r\n","/**\r\n * Recursively traverse up the tree to check whether the provided child node\r\n * is the parent or a descendant of it.\r\n *\r\n * @param parent - Element to find\r\n * @param child - Element to test against parent\r\n */\r\nconst isNodeOrChild = (parent, child) => {\r\n if (!child) {\r\n return false;\r\n }\r\n else if (parent === child) {\r\n return true;\r\n }\r\n else {\r\n return isNodeOrChild(parent, child.parentElement);\r\n }\r\n};\r\n\r\nexport { isNodeOrChild };\r\n","import { extractEventInfo } from '../events/event-info.mjs';\r\nimport { addDomEvent } from '../events/add-dom-event.mjs';\r\nimport { addPointerEvent } from '../events/add-pointer-event.mjs';\r\nimport { Feature } from '../motion/features/Feature.mjs';\r\nimport { pipe } from '../utils/pipe.mjs';\r\nimport { isDragActive } from './drag/utils/lock.mjs';\r\nimport { isNodeOrChild } from './utils/is-node-or-child.mjs';\r\nimport { noop } from '../utils/noop.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction fireSyntheticPointerEvent(name, handler) {\r\n if (!handler)\r\n return;\r\n const syntheticPointerEvent = new PointerEvent(\"pointer\" + name);\r\n handler(syntheticPointerEvent, extractEventInfo(syntheticPointerEvent));\r\n}\r\nclass PressGesture extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.removeStartListeners = noop;\r\n this.removeEndListeners = noop;\r\n this.removeAccessibleListeners = noop;\r\n this.startPointerPress = (startEvent, startInfo) => {\r\n if (this.isPressing)\r\n return;\r\n this.removeEndListeners();\r\n const props = this.node.getProps();\r\n const endPointerPress = (endEvent, endInfo) => {\r\n if (!this.checkPressEnd())\r\n return;\r\n const { onTap, onTapCancel, globalTapTarget } = this.node.getProps();\r\n frame.update(() => {\r\n /**\r\n * We only count this as a tap gesture if the event.target is the same\r\n * as, or a child of, this component's element\r\n */\r\n !globalTapTarget &&\r\n !isNodeOrChild(this.node.current, endEvent.target)\r\n ? onTapCancel && onTapCancel(endEvent, endInfo)\r\n : onTap && onTap(endEvent, endInfo);\r\n });\r\n };\r\n const removePointerUpListener = addPointerEvent(window, \"pointerup\", endPointerPress, { passive: !(props.onTap || props[\"onPointerUp\"]) });\r\n const removePointerCancelListener = addPointerEvent(window, \"pointercancel\", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo), { passive: !(props.onTapCancel || props[\"onPointerCancel\"]) });\r\n this.removeEndListeners = pipe(removePointerUpListener, removePointerCancelListener);\r\n this.startPress(startEvent, startInfo);\r\n };\r\n this.startAccessiblePress = () => {\r\n const handleKeydown = (keydownEvent) => {\r\n if (keydownEvent.key !== \"Enter\" || this.isPressing)\r\n return;\r\n const handleKeyup = (keyupEvent) => {\r\n if (keyupEvent.key !== \"Enter\" || !this.checkPressEnd())\r\n return;\r\n fireSyntheticPointerEvent(\"up\", (event, info) => {\r\n const { onTap } = this.node.getProps();\r\n if (onTap) {\r\n frame.update(() => onTap(event, info));\r\n }\r\n });\r\n };\r\n this.removeEndListeners();\r\n this.removeEndListeners = addDomEvent(this.node.current, \"keyup\", handleKeyup);\r\n fireSyntheticPointerEvent(\"down\", (event, info) => {\r\n this.startPress(event, info);\r\n });\r\n };\r\n const removeKeydownListener = addDomEvent(this.node.current, \"keydown\", handleKeydown);\r\n const handleBlur = () => {\r\n if (!this.isPressing)\r\n return;\r\n fireSyntheticPointerEvent(\"cancel\", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo));\r\n };\r\n const removeBlurListener = addDomEvent(this.node.current, \"blur\", handleBlur);\r\n this.removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener);\r\n };\r\n }\r\n startPress(event, info) {\r\n this.isPressing = true;\r\n const { onTapStart, whileTap } = this.node.getProps();\r\n /**\r\n * Ensure we trigger animations before firing event callback\r\n */\r\n if (whileTap && this.node.animationState) {\r\n this.node.animationState.setActive(\"whileTap\", true);\r\n }\r\n if (onTapStart) {\r\n frame.update(() => onTapStart(event, info));\r\n }\r\n }\r\n checkPressEnd() {\r\n this.removeEndListeners();\r\n this.isPressing = false;\r\n const props = this.node.getProps();\r\n if (props.whileTap && this.node.animationState) {\r\n this.node.animationState.setActive(\"whileTap\", false);\r\n }\r\n return !isDragActive();\r\n }\r\n cancelPress(event, info) {\r\n if (!this.checkPressEnd())\r\n return;\r\n const { onTapCancel } = this.node.getProps();\r\n if (onTapCancel) {\r\n frame.update(() => onTapCancel(event, info));\r\n }\r\n }\r\n mount() {\r\n const props = this.node.getProps();\r\n const removePointerListener = addPointerEvent(props.globalTapTarget ? window : this.node.current, \"pointerdown\", this.startPointerPress, { passive: !(props.onTapStart || props[\"onPointerStart\"]) });\r\n const removeFocusListener = addDomEvent(this.node.current, \"focus\", this.startAccessiblePress);\r\n this.removeStartListeners = pipe(removePointerListener, removeFocusListener);\r\n }\r\n unmount() {\r\n this.removeStartListeners();\r\n this.removeEndListeners();\r\n this.removeAccessibleListeners();\r\n }\r\n}\r\n\r\nexport { PressGesture };\r\n","/**\r\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\r\n * element, so even though these handlers might all be triggered by different\r\n * observers, we can keep them in the same map.\r\n */\r\nconst observerCallbacks = new WeakMap();\r\n/**\r\n * Multiple observers can be created for multiple element/document roots. Each with\r\n * different settings. So here we store dictionaries of observers to each root,\r\n * using serialised settings (threshold/margin) as lookup keys.\r\n */\r\nconst observers = new WeakMap();\r\nconst fireObserverCallback = (entry) => {\r\n const callback = observerCallbacks.get(entry.target);\r\n callback && callback(entry);\r\n};\r\nconst fireAllObserverCallbacks = (entries) => {\r\n entries.forEach(fireObserverCallback);\r\n};\r\nfunction initIntersectionObserver({ root, ...options }) {\r\n const lookupRoot = root || document;\r\n /**\r\n * If we don't have an observer lookup map for this root, create one.\r\n */\r\n if (!observers.has(lookupRoot)) {\r\n observers.set(lookupRoot, {});\r\n }\r\n const rootObservers = observers.get(lookupRoot);\r\n const key = JSON.stringify(options);\r\n /**\r\n * If we don't have an observer for this combination of root and settings,\r\n * create one.\r\n */\r\n if (!rootObservers[key]) {\r\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\r\n }\r\n return rootObservers[key];\r\n}\r\nfunction observeIntersection(element, options, callback) {\r\n const rootInteresectionObserver = initIntersectionObserver(options);\r\n observerCallbacks.set(element, callback);\r\n rootInteresectionObserver.observe(element);\r\n return () => {\r\n observerCallbacks.delete(element);\r\n rootInteresectionObserver.unobserve(element);\r\n };\r\n}\r\n\r\nexport { observeIntersection };\r\n","import { Feature } from '../Feature.mjs';\r\nimport { observeIntersection } from './observers.mjs';\r\n\r\nconst thresholdNames = {\r\n some: 0,\r\n all: 1,\r\n};\r\nclass InViewFeature extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.hasEnteredView = false;\r\n this.isInView = false;\r\n }\r\n startObserver() {\r\n this.unmount();\r\n const { viewport = {} } = this.node.getProps();\r\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\r\n const options = {\r\n root: root ? root.current : undefined,\r\n rootMargin,\r\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\r\n };\r\n const onIntersectionUpdate = (entry) => {\r\n const { isIntersecting } = entry;\r\n /**\r\n * If there's been no change in the viewport state, early return.\r\n */\r\n if (this.isInView === isIntersecting)\r\n return;\r\n this.isInView = isIntersecting;\r\n /**\r\n * Handle hasEnteredView. If this is only meant to run once, and\r\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\r\n */\r\n if (once && !isIntersecting && this.hasEnteredView) {\r\n return;\r\n }\r\n else if (isIntersecting) {\r\n this.hasEnteredView = true;\r\n }\r\n if (this.node.animationState) {\r\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\r\n }\r\n /**\r\n * Use the latest committed props rather than the ones in scope\r\n * when this observer is created\r\n */\r\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\r\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\r\n callback && callback(entry);\r\n };\r\n return observeIntersection(this.node.current, options, onIntersectionUpdate);\r\n }\r\n mount() {\r\n this.startObserver();\r\n }\r\n update() {\r\n if (typeof IntersectionObserver === \"undefined\")\r\n return;\r\n const { props, prevProps } = this.node;\r\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\r\n if (hasOptionsChanged) {\r\n this.startObserver();\r\n }\r\n }\r\n unmount() { }\r\n}\r\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\r\n return (name) => viewport[name] !== prevViewport[name];\r\n}\r\n\r\nexport { InViewFeature };\r\n","import { HoverGesture } from '../../gestures/hover.mjs';\r\nimport { FocusGesture } from '../../gestures/focus.mjs';\r\nimport { PressGesture } from '../../gestures/press.mjs';\r\nimport { InViewFeature } from './viewport/index.mjs';\r\n\r\nconst gestureAnimations = {\r\n inView: {\r\n Feature: InViewFeature,\r\n },\r\n tap: {\r\n Feature: PressGesture,\r\n },\r\n focus: {\r\n Feature: FocusGesture,\r\n },\r\n hover: {\r\n Feature: HoverGesture,\r\n },\r\n};\r\n\r\nexport { gestureAnimations };\r\n","function shallowCompare(next, prev) {\r\n if (!Array.isArray(prev))\r\n return false;\r\n const prevLength = prev.length;\r\n if (prevLength !== next.length)\r\n return false;\r\n for (let i = 0; i < prevLength; i++) {\r\n if (prev[i] !== next[i])\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\nexport { shallowCompare };\r\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\r\n\r\n/**\r\n * Creates an object containing the latest state of every MotionValue on a VisualElement\r\n */\r\nfunction getCurrent(visualElement) {\r\n const current = {};\r\n visualElement.values.forEach((value, key) => (current[key] = value.get()));\r\n return current;\r\n}\r\n/**\r\n * Creates an object containing the latest velocity of every MotionValue on a VisualElement\r\n */\r\nfunction getVelocity(visualElement) {\r\n const velocity = {};\r\n visualElement.values.forEach((value, key) => (velocity[key] = value.getVelocity()));\r\n return velocity;\r\n}\r\nfunction resolveVariant(visualElement, definition, custom) {\r\n const props = visualElement.getProps();\r\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement));\r\n}\r\n\r\nexport { resolveVariant };\r\n","import { noop } from './noop.mjs';\r\n\r\nlet warning = noop;\r\nlet invariant = noop;\r\nif (process.env.NODE_ENV !== \"production\") {\r\n warning = (check, message) => {\r\n if (!check && typeof console !== \"undefined\") {\r\n console.warn(message);\r\n }\r\n };\r\n invariant = (check, message) => {\r\n if (!check) {\r\n throw new Error(message);\r\n }\r\n };\r\n}\r\n\r\nexport { invariant, warning };\r\n","/**\r\n * Converts seconds to milliseconds\r\n *\r\n * @param seconds - Time in seconds.\r\n * @return milliseconds - Converted time in milliseconds.\r\n */\r\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\r\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\r\n\r\nexport { millisecondsToSeconds, secondsToMilliseconds };\r\n","const instantAnimationState = {\r\n current: false,\r\n};\r\n\r\nexport { instantAnimationState };\r\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\r\n\r\nexport { isBezierDefinition };\r\n","import { isBezierDefinition } from '../../../easing/utils/is-bezier-definition.mjs';\r\n\r\nfunction isWaapiSupportedEasing(easing) {\r\n return Boolean(!easing ||\r\n (typeof easing === \"string\" && supportedWaapiEasing[easing]) ||\r\n isBezierDefinition(easing) ||\r\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));\r\n}\r\nconst cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\r\nconst supportedWaapiEasing = {\r\n linear: \"linear\",\r\n ease: \"ease\",\r\n easeIn: \"ease-in\",\r\n easeOut: \"ease-out\",\r\n easeInOut: \"ease-in-out\",\r\n circIn: cubicBezierAsString([0, 0.65, 0.55, 1]),\r\n circOut: cubicBezierAsString([0.55, 0, 1, 0.45]),\r\n backIn: cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\r\n backOut: cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\r\n};\r\nfunction mapEasingToNativeEasing(easing) {\r\n if (!easing)\r\n return undefined;\r\n return isBezierDefinition(easing)\r\n ? cubicBezierAsString(easing)\r\n : Array.isArray(easing)\r\n ? easing.map(mapEasingToNativeEasing)\r\n : supportedWaapiEasing[easing];\r\n}\r\n\r\nexport { cubicBezierAsString, isWaapiSupportedEasing, mapEasingToNativeEasing, supportedWaapiEasing };\r\n","import { mapEasingToNativeEasing } from './easing.mjs';\r\n\r\nfunction animateStyle(element, valueName, keyframes, { delay = 0, duration, repeat = 0, repeatType = \"loop\", ease, times, } = {}) {\r\n const keyframeOptions = { [valueName]: keyframes };\r\n if (times)\r\n keyframeOptions.offset = times;\r\n const easing = mapEasingToNativeEasing(ease);\r\n /**\r\n * If this is an easing array, apply to keyframes, not animation as a whole\r\n */\r\n if (Array.isArray(easing))\r\n keyframeOptions.easing = easing;\r\n return element.animate(keyframeOptions, {\r\n delay,\r\n duration,\r\n easing: !Array.isArray(easing) ? easing : \"linear\",\r\n fill: \"both\",\r\n iterations: repeat + 1,\r\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\r\n });\r\n}\r\n\r\nexport { animateStyle };\r\n","function getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }) {\r\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\r\n ? 0\r\n : keyframes.length - 1;\r\n return keyframes[index];\r\n}\r\n\r\nexport { getFinalKeyframe };\r\n","import { noop } from '../utils/noop.mjs';\r\n\r\n/*\r\n Bezier function generator\r\n This has been modified from Gaëtan Renaudeau's BezierEasing\r\n https://github.com/gre/bezier-easing/blob/master/src/index.js\r\n https://github.com/gre/bezier-easing/blob/master/LICENSE\r\n \r\n I've removed the newtonRaphsonIterate algo because in benchmarking it\r\n wasn't noticiably faster than binarySubdivision, indeed removing it\r\n usually improved times, depending on the curve.\r\n I also removed the lookup table, as for the added bundle size and loop we're\r\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\r\n to 12 to compensate and this still tended to be faster for no perceivable\r\n loss in accuracy.\r\n Usage\r\n const easeOut = cubicBezier(.17,.67,.83,.67);\r\n const x = easeOut(0.5); // returns 0.627...\r\n*/\r\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\r\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\r\n t;\r\nconst subdivisionPrecision = 0.0000001;\r\nconst subdivisionMaxIterations = 12;\r\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\r\n let currentX;\r\n let currentT;\r\n let i = 0;\r\n do {\r\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\r\n currentX = calcBezier(currentT, mX1, mX2) - x;\r\n if (currentX > 0.0) {\r\n upperBound = currentT;\r\n }\r\n else {\r\n lowerBound = currentT;\r\n }\r\n } while (Math.abs(currentX) > subdivisionPrecision &&\r\n ++i < subdivisionMaxIterations);\r\n return currentT;\r\n}\r\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\r\n // If this is a linear gradient, return linear easing\r\n if (mX1 === mY1 && mX2 === mY2)\r\n return noop;\r\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\r\n // If animation is at start/end, return t without easing\r\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\r\n}\r\n\r\nexport { cubicBezier };\r\n","import { cubicBezier } from './cubic-bezier.mjs';\r\n\r\nconst easeIn = cubicBezier(0.42, 0, 1, 1);\r\nconst easeOut = cubicBezier(0, 0, 0.58, 1);\r\nconst easeInOut = cubicBezier(0.42, 0, 0.58, 1);\r\n\r\nexport { easeIn, easeInOut, easeOut };\r\n","const isEasingArray = (ease) => {\r\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\r\n};\r\n\r\nexport { isEasingArray };\r\n","// Accepts an easing function and returns a new one that outputs mirrored values for\r\n// the second half of the animation. Turns easeIn into easeInOut.\r\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\r\n\r\nexport { mirrorEasing };\r\n","// Accepts an easing function and returns a new one that outputs reversed values.\r\n// Turns easeIn into easeOut.\r\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\r\n\r\nexport { reverseEasing };\r\n","import { mirrorEasing } from './modifiers/mirror.mjs';\r\nimport { reverseEasing } from './modifiers/reverse.mjs';\r\n\r\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\r\nconst circOut = reverseEasing(circIn);\r\nconst circInOut = mirrorEasing(circIn);\r\n\r\nexport { circIn, circInOut, circOut };\r\n","import { cubicBezier } from './cubic-bezier.mjs';\r\nimport { mirrorEasing } from './modifiers/mirror.mjs';\r\nimport { reverseEasing } from './modifiers/reverse.mjs';\r\n\r\nconst backOut = cubicBezier(0.33, 1.53, 0.69, 0.99);\r\nconst backIn = reverseEasing(backOut);\r\nconst backInOut = mirrorEasing(backIn);\r\n\r\nexport { backIn, backInOut, backOut };\r\n","import { backIn } from './back.mjs';\r\n\r\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\r\n\r\nexport { anticipate };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport { cubicBezier } from '../cubic-bezier.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\r\nimport { circIn, circInOut, circOut } from '../circ.mjs';\r\nimport { backIn, backInOut, backOut } from '../back.mjs';\r\nimport { anticipate } from '../anticipate.mjs';\r\n\r\nconst easingLookup = {\r\n linear: noop,\r\n easeIn,\r\n easeInOut,\r\n easeOut,\r\n circIn,\r\n circInOut,\r\n circOut,\r\n backIn,\r\n backInOut,\r\n backOut,\r\n anticipate,\r\n};\r\nconst easingDefinitionToFunction = (definition) => {\r\n if (Array.isArray(definition)) {\r\n // If cubic bezier definition, create bezier curve\r\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);\r\n const [x1, y1, x2, y2] = definition;\r\n return cubicBezier(x1, y1, x2, y2);\r\n }\r\n else if (typeof definition === \"string\") {\r\n // Else lookup from table\r\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`);\r\n return easingLookup[definition];\r\n }\r\n return definition;\r\n};\r\n\r\nexport { easingDefinitionToFunction };\r\n","import { isString, singleColorRegex, floatRegex } from '../utils.mjs';\r\n\r\n/**\r\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\r\n * but false if a number or multiple colors\r\n */\r\nconst isColorString = (type, testProp) => (v) => {\r\n return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) ||\r\n (testProp && Object.prototype.hasOwnProperty.call(v, testProp)));\r\n};\r\nconst splitColor = (aName, bName, cName) => (v) => {\r\n if (!isString(v))\r\n return v;\r\n const [a, b, c, alpha] = v.match(floatRegex);\r\n return {\r\n [aName]: parseFloat(a),\r\n [bName]: parseFloat(b),\r\n [cName]: parseFloat(c),\r\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\r\n };\r\n};\r\n\r\nexport { isColorString, splitColor };\r\n","import { clamp } from '../../../utils/clamp.mjs';\r\nimport { number, alpha } from '../numbers/index.mjs';\r\nimport { sanitize } from '../utils.mjs';\r\nimport { isColorString, splitColor } from './utils.mjs';\r\n\r\nconst clampRgbUnit = (v) => clamp(0, 255, v);\r\nconst rgbUnit = {\r\n ...number,\r\n transform: (v) => Math.round(clampRgbUnit(v)),\r\n};\r\nconst rgba = {\r\n test: isColorString(\"rgb\", \"red\"),\r\n parse: splitColor(\"red\", \"green\", \"blue\"),\r\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\r\n rgbUnit.transform(red) +\r\n \", \" +\r\n rgbUnit.transform(green) +\r\n \", \" +\r\n rgbUnit.transform(blue) +\r\n \", \" +\r\n sanitize(alpha.transform(alpha$1)) +\r\n \")\",\r\n};\r\n\r\nexport { rgbUnit, rgba };\r\n","import { rgba } from './rgba.mjs';\r\nimport { isColorString } from './utils.mjs';\r\n\r\nfunction parseHex(v) {\r\n let r = \"\";\r\n let g = \"\";\r\n let b = \"\";\r\n let a = \"\";\r\n // If we have 6 characters, ie #FF0000\r\n if (v.length > 5) {\r\n r = v.substring(1, 3);\r\n g = v.substring(3, 5);\r\n b = v.substring(5, 7);\r\n a = v.substring(7, 9);\r\n // Or we have 3 characters, ie #F00\r\n }\r\n else {\r\n r = v.substring(1, 2);\r\n g = v.substring(2, 3);\r\n b = v.substring(3, 4);\r\n a = v.substring(4, 5);\r\n r += r;\r\n g += g;\r\n b += b;\r\n a += a;\r\n }\r\n return {\r\n red: parseInt(r, 16),\r\n green: parseInt(g, 16),\r\n blue: parseInt(b, 16),\r\n alpha: a ? parseInt(a, 16) / 255 : 1,\r\n };\r\n}\r\nconst hex = {\r\n test: isColorString(\"#\"),\r\n parse: parseHex,\r\n transform: rgba.transform,\r\n};\r\n\r\nexport { hex };\r\n","import { alpha } from '../numbers/index.mjs';\r\nimport { percent } from '../numbers/units.mjs';\r\nimport { sanitize } from '../utils.mjs';\r\nimport { isColorString, splitColor } from './utils.mjs';\r\n\r\nconst hsla = {\r\n test: isColorString(\"hsl\", \"hue\"),\r\n parse: splitColor(\"hue\", \"saturation\", \"lightness\"),\r\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\r\n return (\"hsla(\" +\r\n Math.round(hue) +\r\n \", \" +\r\n percent.transform(sanitize(saturation)) +\r\n \", \" +\r\n percent.transform(sanitize(lightness)) +\r\n \", \" +\r\n sanitize(alpha.transform(alpha$1)) +\r\n \")\");\r\n },\r\n};\r\n\r\nexport { hsla };\r\n","import { isString } from '../utils.mjs';\r\nimport { hex } from './hex.mjs';\r\nimport { hsla } from './hsla.mjs';\r\nimport { rgba } from './rgba.mjs';\r\n\r\nconst color = {\r\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\r\n parse: (v) => {\r\n if (rgba.test(v)) {\r\n return rgba.parse(v);\r\n }\r\n else if (hsla.test(v)) {\r\n return hsla.parse(v);\r\n }\r\n else {\r\n return hex.parse(v);\r\n }\r\n },\r\n transform: (v) => {\r\n return isString(v)\r\n ? v\r\n : v.hasOwnProperty(\"red\")\r\n ? rgba.transform(v)\r\n : hsla.transform(v);\r\n },\r\n};\r\n\r\nexport { color };\r\n","/*\r\n Value in range from progress\r\n\r\n Given a lower limit and an upper limit, we return the value within\r\n that range as expressed by progress (usually a number from 0 to 1)\r\n\r\n So progress = 0.5 would change\r\n\r\n from -------- to\r\n\r\n to\r\n\r\n from ---- to\r\n\r\n E.g. from = 10, to = 20, progress = 0.5 => 15\r\n\r\n @param [number]: Lower limit of range\r\n @param [number]: Upper limit of range\r\n @param [number]: The progress between lower and upper limits expressed 0-1\r\n @return [number]: Value as calculated from progress within range (not limited within range)\r\n*/\r\nconst mix = (from, to, progress) => -progress * from + progress * to + from;\r\n\r\nexport { mix };\r\n","// Adapted from https://gist.github.com/mjackson/5311256\r\nfunction hueToRgb(p, q, t) {\r\n if (t < 0)\r\n t += 1;\r\n if (t > 1)\r\n t -= 1;\r\n if (t < 1 / 6)\r\n return p + (q - p) * 6 * t;\r\n if (t < 1 / 2)\r\n return q;\r\n if (t < 2 / 3)\r\n return p + (q - p) * (2 / 3 - t) * 6;\r\n return p;\r\n}\r\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\r\n hue /= 360;\r\n saturation /= 100;\r\n lightness /= 100;\r\n let red = 0;\r\n let green = 0;\r\n let blue = 0;\r\n if (!saturation) {\r\n red = green = blue = lightness;\r\n }\r\n else {\r\n const q = lightness < 0.5\r\n ? lightness * (1 + saturation)\r\n : lightness + saturation - lightness * saturation;\r\n const p = 2 * lightness - q;\r\n red = hueToRgb(p, q, hue + 1 / 3);\r\n green = hueToRgb(p, q, hue);\r\n blue = hueToRgb(p, q, hue - 1 / 3);\r\n }\r\n return {\r\n red: Math.round(red * 255),\r\n green: Math.round(green * 255),\r\n blue: Math.round(blue * 255),\r\n alpha,\r\n };\r\n}\r\n\r\nexport { hslaToRgba };\r\n","import { mix } from './mix.mjs';\r\nimport { invariant } from './errors.mjs';\r\nimport { hslaToRgba } from './hsla-to-rgba.mjs';\r\nimport { hex } from '../value/types/color/hex.mjs';\r\nimport { rgba } from '../value/types/color/rgba.mjs';\r\nimport { hsla } from '../value/types/color/hsla.mjs';\r\n\r\n// Linear color space blending\r\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\r\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\r\nconst mixLinearColor = (from, to, v) => {\r\n const fromExpo = from * from;\r\n return Math.sqrt(Math.max(0, v * (to * to - fromExpo) + fromExpo));\r\n};\r\nconst colorTypes = [hex, rgba, hsla];\r\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\r\nfunction asRGBA(color) {\r\n const type = getColorType(color);\r\n invariant(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`);\r\n let model = type.parse(color);\r\n if (type === hsla) {\r\n // TODO Remove this cast - needed since Framer Motion's stricter typing\r\n model = hslaToRgba(model);\r\n }\r\n return model;\r\n}\r\nconst mixColor = (from, to) => {\r\n const fromRGBA = asRGBA(from);\r\n const toRGBA = asRGBA(to);\r\n const blended = { ...fromRGBA };\r\n return (v) => {\r\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\r\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\r\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\r\n blended.alpha = mix(fromRGBA.alpha, toRGBA.alpha, v);\r\n return rgba.transform(blended);\r\n };\r\n};\r\n\r\nexport { mixColor, mixLinearColor };\r\n","import { cssVariableRegex } from '../../../render/dom/utils/is-css-variable.mjs';\r\nimport { noop } from '../../../utils/noop.mjs';\r\nimport { color } from '../color/index.mjs';\r\nimport { number } from '../numbers/index.mjs';\r\nimport { colorRegex, floatRegex, isString, sanitize } from '../utils.mjs';\r\n\r\nfunction test(v) {\r\n var _a, _b;\r\n return (isNaN(v) &&\r\n isString(v) &&\r\n (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +\r\n (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) >\r\n 0);\r\n}\r\nconst cssVarTokeniser = {\r\n regex: cssVariableRegex,\r\n countKey: \"Vars\",\r\n token: \"${v}\",\r\n parse: noop,\r\n};\r\nconst colorTokeniser = {\r\n regex: colorRegex,\r\n countKey: \"Colors\",\r\n token: \"${c}\",\r\n parse: color.parse,\r\n};\r\nconst numberTokeniser = {\r\n regex: floatRegex,\r\n countKey: \"Numbers\",\r\n token: \"${n}\",\r\n parse: number.parse,\r\n};\r\nfunction tokenise(info, { regex, countKey, token, parse }) {\r\n const matches = info.tokenised.match(regex);\r\n if (!matches)\r\n return;\r\n info[\"num\" + countKey] = matches.length;\r\n info.tokenised = info.tokenised.replace(regex, token);\r\n info.values.push(...matches.map(parse));\r\n}\r\nfunction analyseComplexValue(value) {\r\n const originalValue = value.toString();\r\n const info = {\r\n value: originalValue,\r\n tokenised: originalValue,\r\n values: [],\r\n numVars: 0,\r\n numColors: 0,\r\n numNumbers: 0,\r\n };\r\n if (info.value.includes(\"var(--\"))\r\n tokenise(info, cssVarTokeniser);\r\n tokenise(info, colorTokeniser);\r\n tokenise(info, numberTokeniser);\r\n return info;\r\n}\r\nfunction parseComplexValue(v) {\r\n return analyseComplexValue(v).values;\r\n}\r\nfunction createTransformer(source) {\r\n const { values, numColors, numVars, tokenised } = analyseComplexValue(source);\r\n const numValues = values.length;\r\n return (v) => {\r\n let output = tokenised;\r\n for (let i = 0; i < numValues; i++) {\r\n if (i < numVars) {\r\n output = output.replace(cssVarTokeniser.token, v[i]);\r\n }\r\n else if (i < numVars + numColors) {\r\n output = output.replace(colorTokeniser.token, color.transform(v[i]));\r\n }\r\n else {\r\n output = output.replace(numberTokeniser.token, sanitize(v[i]));\r\n }\r\n }\r\n return output;\r\n };\r\n}\r\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : v;\r\nfunction getAnimatableNone(v) {\r\n const parsed = parseComplexValue(v);\r\n const transformer = createTransformer(v);\r\n return transformer(parsed.map(convertNumbersToZero));\r\n}\r\nconst complex = {\r\n test,\r\n parse: parseComplexValue,\r\n createTransformer,\r\n getAnimatableNone,\r\n};\r\n\r\nexport { analyseComplexValue, complex };\r\n","import { mix } from './mix.mjs';\r\nimport { mixColor } from './mix-color.mjs';\r\nimport { pipe } from './pipe.mjs';\r\nimport { warning } from './errors.mjs';\r\nimport { color } from '../value/types/color/index.mjs';\r\nimport { complex, analyseComplexValue } from '../value/types/complex/index.mjs';\r\n\r\nconst mixImmediate = (origin, target) => (p) => `${p > 0 ? target : origin}`;\r\nfunction getMixer(origin, target) {\r\n if (typeof origin === \"number\") {\r\n return (v) => mix(origin, target, v);\r\n }\r\n else if (color.test(origin)) {\r\n return mixColor(origin, target);\r\n }\r\n else {\r\n return origin.startsWith(\"var(\")\r\n ? mixImmediate(origin, target)\r\n : mixComplex(origin, target);\r\n }\r\n}\r\nconst mixArray = (from, to) => {\r\n const output = [...from];\r\n const numValues = output.length;\r\n const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i]));\r\n return (v) => {\r\n for (let i = 0; i < numValues; i++) {\r\n output[i] = blendValue[i](v);\r\n }\r\n return output;\r\n };\r\n};\r\nconst mixObject = (origin, target) => {\r\n const output = { ...origin, ...target };\r\n const blendValue = {};\r\n for (const key in output) {\r\n if (origin[key] !== undefined && target[key] !== undefined) {\r\n blendValue[key] = getMixer(origin[key], target[key]);\r\n }\r\n }\r\n return (v) => {\r\n for (const key in blendValue) {\r\n output[key] = blendValue[key](v);\r\n }\r\n return output;\r\n };\r\n};\r\nconst mixComplex = (origin, target) => {\r\n const template = complex.createTransformer(target);\r\n const originStats = analyseComplexValue(origin);\r\n const targetStats = analyseComplexValue(target);\r\n const canInterpolate = originStats.numVars === targetStats.numVars &&\r\n originStats.numColors === targetStats.numColors &&\r\n originStats.numNumbers >= targetStats.numNumbers;\r\n if (canInterpolate) {\r\n return pipe(mixArray(originStats.values, targetStats.values), template);\r\n }\r\n else {\r\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);\r\n return mixImmediate(origin, target);\r\n }\r\n};\r\n\r\nexport { mixArray, mixComplex, mixObject };\r\n","/*\r\n Progress within given range\r\n\r\n Given a lower limit and an upper limit, we return the progress\r\n (expressed as a number 0-1) represented by the given value, and\r\n limit that progress to within 0-1.\r\n\r\n @param [number]: Lower limit\r\n @param [number]: Upper limit\r\n @param [number]: Value to find progress within given range\r\n @return [number]: Progress of value within range as expressed 0-1\r\n*/\r\nconst progress = (from, to, value) => {\r\n const toFromDifference = to - from;\r\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\r\n};\r\n\r\nexport { progress };\r\n","import { invariant } from './errors.mjs';\r\nimport { color } from '../value/types/color/index.mjs';\r\nimport { clamp } from './clamp.mjs';\r\nimport { mix } from './mix.mjs';\r\nimport { mixColor } from './mix-color.mjs';\r\nimport { mixComplex, mixArray, mixObject } from './mix-complex.mjs';\r\nimport { pipe } from './pipe.mjs';\r\nimport { progress } from './progress.mjs';\r\nimport { noop } from './noop.mjs';\r\n\r\nconst mixNumber = (from, to) => (p) => mix(from, to, p);\r\nfunction detectMixerFactory(v) {\r\n if (typeof v === \"number\") {\r\n return mixNumber;\r\n }\r\n else if (typeof v === \"string\") {\r\n return color.test(v) ? mixColor : mixComplex;\r\n }\r\n else if (Array.isArray(v)) {\r\n return mixArray;\r\n }\r\n else if (typeof v === \"object\") {\r\n return mixObject;\r\n }\r\n return mixNumber;\r\n}\r\nfunction createMixers(output, ease, customMixer) {\r\n const mixers = [];\r\n const mixerFactory = customMixer || detectMixerFactory(output[0]);\r\n const numMixers = output.length - 1;\r\n for (let i = 0; i < numMixers; i++) {\r\n let mixer = mixerFactory(output[i], output[i + 1]);\r\n if (ease) {\r\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\r\n mixer = pipe(easingFunction, mixer);\r\n }\r\n mixers.push(mixer);\r\n }\r\n return mixers;\r\n}\r\n/**\r\n * Create a function that maps from a numerical input array to a generic output array.\r\n *\r\n * Accepts:\r\n * - Numbers\r\n * - Colors (hex, hsl, hsla, rgb, rgba)\r\n * - Complex (combinations of one or more numbers or strings)\r\n *\r\n * ```jsx\r\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\r\n *\r\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\r\n * ```\r\n *\r\n * TODO Revist this approach once we've moved to data models for values,\r\n * probably not needed to pregenerate mixer functions.\r\n *\r\n * @public\r\n */\r\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\r\n const inputLength = input.length;\r\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\");\r\n /**\r\n * If we're only provided a single input, we can just make a function\r\n * that returns the output.\r\n */\r\n if (inputLength === 1)\r\n return () => output[0];\r\n // If input runs highest -> lowest, reverse both arrays\r\n if (input[0] > input[inputLength - 1]) {\r\n input = [...input].reverse();\r\n output = [...output].reverse();\r\n }\r\n const mixers = createMixers(output, ease, mixer);\r\n const numMixers = mixers.length;\r\n const interpolator = (v) => {\r\n let i = 0;\r\n if (numMixers > 1) {\r\n for (; i < input.length - 2; i++) {\r\n if (v < input[i + 1])\r\n break;\r\n }\r\n }\r\n const progressInRange = progress(input[i], input[i + 1], v);\r\n return mixers[i](progressInRange);\r\n };\r\n return isClamp\r\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\r\n : interpolator;\r\n}\r\n\r\nexport { interpolate };\r\n","import { mix } from '../mix.mjs';\r\nimport { progress } from '../progress.mjs';\r\n\r\nfunction fillOffset(offset, remaining) {\r\n const min = offset[offset.length - 1];\r\n for (let i = 1; i <= remaining; i++) {\r\n const offsetProgress = progress(0, remaining, i);\r\n offset.push(mix(min, 1, offsetProgress));\r\n }\r\n}\r\n\r\nexport { fillOffset };\r\n","import { fillOffset } from './fill.mjs';\r\n\r\nfunction defaultOffset(arr) {\r\n const offset = [0];\r\n fillOffset(offset, arr.length - 1);\r\n return offset;\r\n}\r\n\r\nexport { defaultOffset };\r\n","function convertOffsetToTimes(offset, duration) {\r\n return offset.map((o) => o * duration);\r\n}\r\n\r\nexport { convertOffsetToTimes };\r\n","import { easeInOut } from '../../easing/ease.mjs';\r\nimport { isEasingArray } from '../../easing/utils/is-easing-array.mjs';\r\nimport { easingDefinitionToFunction } from '../../easing/utils/map.mjs';\r\nimport { interpolate } from '../../utils/interpolate.mjs';\r\nimport { defaultOffset } from '../../utils/offsets/default.mjs';\r\nimport { convertOffsetToTimes } from '../../utils/offsets/time.mjs';\r\n\r\nfunction defaultEasing(values, easing) {\r\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\r\n}\r\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\r\n /**\r\n * Easing functions can be externally defined as strings. Here we convert them\r\n * into actual functions.\r\n */\r\n const easingFunctions = isEasingArray(ease)\r\n ? ease.map(easingDefinitionToFunction)\r\n : easingDefinitionToFunction(ease);\r\n /**\r\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\r\n * to reduce GC during animation.\r\n */\r\n const state = {\r\n done: false,\r\n value: keyframeValues[0],\r\n };\r\n /**\r\n * Create a times array based on the provided 0-1 offsets\r\n */\r\n const absoluteTimes = convertOffsetToTimes(\r\n // Only use the provided offsets if they're the correct length\r\n // TODO Maybe we should warn here if there's a length mismatch\r\n times && times.length === keyframeValues.length\r\n ? times\r\n : defaultOffset(keyframeValues), duration);\r\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\r\n ease: Array.isArray(easingFunctions)\r\n ? easingFunctions\r\n : defaultEasing(keyframeValues, easingFunctions),\r\n });\r\n return {\r\n calculatedDuration: duration,\r\n next: (t) => {\r\n state.value = mapTimeToKeyframe(t);\r\n state.done = t >= duration;\r\n return state;\r\n },\r\n };\r\n}\r\n\r\nexport { defaultEasing, keyframes };\r\n","/*\r\n Convert velocity into velocity per second\r\n\r\n @param [number]: Unit per frame\r\n @param [number]: Frame duration in ms\r\n*/\r\nfunction velocityPerSecond(velocity, frameDuration) {\r\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\r\n}\r\n\r\nexport { velocityPerSecond };\r\n","import { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';\r\n\r\nconst velocitySampleDuration = 5; // ms\r\nfunction calcGeneratorVelocity(resolveValue, t, current) {\r\n const prevT = Math.max(t - velocitySampleDuration, 0);\r\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\r\n}\r\n\r\nexport { calcGeneratorVelocity };\r\n","import { warning } from '../../../utils/errors.mjs';\r\nimport { clamp } from '../../../utils/clamp.mjs';\r\nimport { secondsToMilliseconds, millisecondsToSeconds } from '../../../utils/time-conversion.mjs';\r\n\r\nconst safeMin = 0.001;\r\nconst minDuration = 0.01;\r\nconst maxDuration = 10.0;\r\nconst minDamping = 0.05;\r\nconst maxDamping = 1;\r\nfunction findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) {\r\n let envelope;\r\n let derivative;\r\n warning(duration <= secondsToMilliseconds(maxDuration), \"Spring duration must be 10 seconds or less\");\r\n let dampingRatio = 1 - bounce;\r\n /**\r\n * Restrict dampingRatio and duration to within acceptable ranges.\r\n */\r\n dampingRatio = clamp(minDamping, maxDamping, dampingRatio);\r\n duration = clamp(minDuration, maxDuration, millisecondsToSeconds(duration));\r\n if (dampingRatio < 1) {\r\n /**\r\n * Underdamped spring\r\n */\r\n envelope = (undampedFreq) => {\r\n const exponentialDecay = undampedFreq * dampingRatio;\r\n const delta = exponentialDecay * duration;\r\n const a = exponentialDecay - velocity;\r\n const b = calcAngularFreq(undampedFreq, dampingRatio);\r\n const c = Math.exp(-delta);\r\n return safeMin - (a / b) * c;\r\n };\r\n derivative = (undampedFreq) => {\r\n const exponentialDecay = undampedFreq * dampingRatio;\r\n const delta = exponentialDecay * duration;\r\n const d = delta * velocity + velocity;\r\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\r\n const f = Math.exp(-delta);\r\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\r\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\r\n return (factor * ((d - e) * f)) / g;\r\n };\r\n }\r\n else {\r\n /**\r\n * Critically-damped spring\r\n */\r\n envelope = (undampedFreq) => {\r\n const a = Math.exp(-undampedFreq * duration);\r\n const b = (undampedFreq - velocity) * duration + 1;\r\n return -safeMin + a * b;\r\n };\r\n derivative = (undampedFreq) => {\r\n const a = Math.exp(-undampedFreq * duration);\r\n const b = (velocity - undampedFreq) * (duration * duration);\r\n return a * b;\r\n };\r\n }\r\n const initialGuess = 5 / duration;\r\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\r\n duration = secondsToMilliseconds(duration);\r\n if (isNaN(undampedFreq)) {\r\n return {\r\n stiffness: 100,\r\n damping: 10,\r\n duration,\r\n };\r\n }\r\n else {\r\n const stiffness = Math.pow(undampedFreq, 2) * mass;\r\n return {\r\n stiffness,\r\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\r\n duration,\r\n };\r\n }\r\n}\r\nconst rootIterations = 12;\r\nfunction approximateRoot(envelope, derivative, initialGuess) {\r\n let result = initialGuess;\r\n for (let i = 1; i < rootIterations; i++) {\r\n result = result - envelope(result) / derivative(result);\r\n }\r\n return result;\r\n}\r\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\r\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\r\n}\r\n\r\nexport { calcAngularFreq, findSpring, maxDamping, maxDuration, minDamping, minDuration };\r\n","import { millisecondsToSeconds } from '../../../utils/time-conversion.mjs';\r\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\r\nimport { findSpring, calcAngularFreq } from './find.mjs';\r\n\r\nconst durationKeys = [\"duration\", \"bounce\"];\r\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\r\nfunction isSpringType(options, keys) {\r\n return keys.some((key) => options[key] !== undefined);\r\n}\r\nfunction getSpringOptions(options) {\r\n let springOptions = {\r\n velocity: 0.0,\r\n stiffness: 100,\r\n damping: 10,\r\n mass: 1.0,\r\n isResolvedFromDuration: false,\r\n ...options,\r\n };\r\n // stiffness/damping/mass overrides duration/bounce\r\n if (!isSpringType(options, physicsKeys) &&\r\n isSpringType(options, durationKeys)) {\r\n const derived = findSpring(options);\r\n springOptions = {\r\n ...springOptions,\r\n ...derived,\r\n mass: 1.0,\r\n };\r\n springOptions.isResolvedFromDuration = true;\r\n }\r\n return springOptions;\r\n}\r\nfunction spring({ keyframes, restDelta, restSpeed, ...options }) {\r\n const origin = keyframes[0];\r\n const target = keyframes[keyframes.length - 1];\r\n /**\r\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\r\n * to reduce GC during animation.\r\n */\r\n const state = { done: false, value: origin };\r\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\r\n ...options,\r\n velocity: -millisecondsToSeconds(options.velocity || 0),\r\n });\r\n const initialVelocity = velocity || 0.0;\r\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\r\n const initialDelta = target - origin;\r\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\r\n /**\r\n * If we're working on a granular scale, use smaller defaults for determining\r\n * when the spring is finished.\r\n *\r\n * These defaults have been selected emprically based on what strikes a good\r\n * ratio between feeling good and finishing as soon as changes are imperceptible.\r\n */\r\n const isGranularScale = Math.abs(initialDelta) < 5;\r\n restSpeed || (restSpeed = isGranularScale ? 0.01 : 2);\r\n restDelta || (restDelta = isGranularScale ? 0.005 : 0.5);\r\n let resolveSpring;\r\n if (dampingRatio < 1) {\r\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\r\n // Underdamped spring\r\n resolveSpring = (t) => {\r\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\r\n return (target -\r\n envelope *\r\n (((initialVelocity +\r\n dampingRatio * undampedAngularFreq * initialDelta) /\r\n angularFreq) *\r\n Math.sin(angularFreq * t) +\r\n initialDelta * Math.cos(angularFreq * t)));\r\n };\r\n }\r\n else if (dampingRatio === 1) {\r\n // Critically damped spring\r\n resolveSpring = (t) => target -\r\n Math.exp(-undampedAngularFreq * t) *\r\n (initialDelta +\r\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\r\n }\r\n else {\r\n // Overdamped spring\r\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\r\n resolveSpring = (t) => {\r\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\r\n // When performing sinh or cosh values can hit Infinity so we cap them here\r\n const freqForT = Math.min(dampedAngularFreq * t, 300);\r\n return (target -\r\n (envelope *\r\n ((initialVelocity +\r\n dampingRatio * undampedAngularFreq * initialDelta) *\r\n Math.sinh(freqForT) +\r\n dampedAngularFreq *\r\n initialDelta *\r\n Math.cosh(freqForT))) /\r\n dampedAngularFreq);\r\n };\r\n }\r\n return {\r\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\r\n next: (t) => {\r\n const current = resolveSpring(t);\r\n if (!isResolvedFromDuration) {\r\n let currentVelocity = initialVelocity;\r\n if (t !== 0) {\r\n /**\r\n * We only need to calculate velocity for under-damped springs\r\n * as over- and critically-damped springs can't overshoot, so\r\n * checking only for displacement is enough.\r\n */\r\n if (dampingRatio < 1) {\r\n currentVelocity = calcGeneratorVelocity(resolveSpring, t, current);\r\n }\r\n else {\r\n currentVelocity = 0;\r\n }\r\n }\r\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\r\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\r\n state.done =\r\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\r\n }\r\n else {\r\n state.done = t >= duration;\r\n }\r\n state.value = state.done ? target : current;\r\n return state;\r\n },\r\n };\r\n}\r\n\r\nexport { spring };\r\n","import { spring } from './spring/index.mjs';\r\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\r\n\r\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\r\n const origin = keyframes[0];\r\n const state = {\r\n done: false,\r\n value: origin,\r\n };\r\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\r\n const nearestBoundary = (v) => {\r\n if (min === undefined)\r\n return max;\r\n if (max === undefined)\r\n return min;\r\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\r\n };\r\n let amplitude = power * velocity;\r\n const ideal = origin + amplitude;\r\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\r\n /**\r\n * If the target has changed we need to re-calculate the amplitude, otherwise\r\n * the animation will start from the wrong position.\r\n */\r\n if (target !== ideal)\r\n amplitude = target - origin;\r\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\r\n const calcLatest = (t) => target + calcDelta(t);\r\n const applyFriction = (t) => {\r\n const delta = calcDelta(t);\r\n const latest = calcLatest(t);\r\n state.done = Math.abs(delta) <= restDelta;\r\n state.value = state.done ? target : latest;\r\n };\r\n /**\r\n * Ideally this would resolve for t in a stateless way, we could\r\n * do that by always precalculating the animation but as we know\r\n * this will be done anyway we can assume that spring will\r\n * be discovered during that.\r\n */\r\n let timeReachedBoundary;\r\n let spring$1;\r\n const checkCatchBoundary = (t) => {\r\n if (!isOutOfBounds(state.value))\r\n return;\r\n timeReachedBoundary = t;\r\n spring$1 = spring({\r\n keyframes: [state.value, nearestBoundary(state.value)],\r\n velocity: calcGeneratorVelocity(calcLatest, t, state.value),\r\n damping: bounceDamping,\r\n stiffness: bounceStiffness,\r\n restDelta,\r\n restSpeed,\r\n });\r\n };\r\n checkCatchBoundary(0);\r\n return {\r\n calculatedDuration: null,\r\n next: (t) => {\r\n /**\r\n * We need to resolve the friction to figure out if we need a\r\n * spring but we don't want to do this twice per frame. So here\r\n * we flag if we updated for this frame and later if we did\r\n * we can skip doing it again.\r\n */\r\n let hasUpdatedFrame = false;\r\n if (!spring$1 && timeReachedBoundary === undefined) {\r\n hasUpdatedFrame = true;\r\n applyFriction(t);\r\n checkCatchBoundary(t);\r\n }\r\n /**\r\n * If we have a spring and the provided t is beyond the moment the friction\r\n * animation crossed the min/max boundary, use the spring.\r\n */\r\n if (timeReachedBoundary !== undefined && t > timeReachedBoundary) {\r\n return spring$1.next(t - timeReachedBoundary);\r\n }\r\n else {\r\n !hasUpdatedFrame && applyFriction(t);\r\n return state;\r\n }\r\n },\r\n };\r\n}\r\n\r\nexport { inertia };\r\n","import { frame, cancelFrame, frameData } from '../../../frameloop/frame.mjs';\r\n\r\nconst frameloopDriver = (update) => {\r\n const passTimestamp = ({ timestamp }) => update(timestamp);\r\n return {\r\n start: () => frame.update(passTimestamp, true),\r\n stop: () => cancelFrame(passTimestamp),\r\n /**\r\n * If we're processing this frame we can use the\r\n * framelocked timestamp to keep things in sync.\r\n */\r\n now: () => frameData.isProcessing ? frameData.timestamp : performance.now(),\r\n };\r\n};\r\n\r\nexport { frameloopDriver };\r\n","/**\r\n * Implement a practical max duration for keyframe generation\r\n * to prevent infinite loops\r\n */\r\nconst maxGeneratorDuration = 20000;\r\nfunction calcGeneratorDuration(generator) {\r\n let duration = 0;\r\n const timeStep = 50;\r\n let state = generator.next(duration);\r\n while (!state.done && duration < maxGeneratorDuration) {\r\n duration += timeStep;\r\n state = generator.next(duration);\r\n }\r\n return duration >= maxGeneratorDuration ? Infinity : duration;\r\n}\r\n\r\nexport { calcGeneratorDuration, maxGeneratorDuration };\r\n","import { keyframes } from '../../generators/keyframes.mjs';\r\nimport { spring } from '../../generators/spring/index.mjs';\r\nimport { inertia } from '../../generators/inertia.mjs';\r\nimport { frameloopDriver } from './driver-frameloop.mjs';\r\nimport { interpolate } from '../../../utils/interpolate.mjs';\r\nimport { clamp } from '../../../utils/clamp.mjs';\r\nimport { millisecondsToSeconds, secondsToMilliseconds } from '../../../utils/time-conversion.mjs';\r\nimport { calcGeneratorDuration } from '../../generators/utils/calc-duration.mjs';\r\nimport { invariant } from '../../../utils/errors.mjs';\r\n\r\nconst types = {\r\n decay: inertia,\r\n inertia,\r\n tween: keyframes,\r\n keyframes: keyframes,\r\n spring,\r\n};\r\n/**\r\n * Animate a single value on the main thread.\r\n *\r\n * This function is written, where functionality overlaps,\r\n * to be largely spec-compliant with WAAPI to allow fungibility\r\n * between the two.\r\n */\r\nfunction animateValue({ autoplay = true, delay = 0, driver = frameloopDriver, keyframes: keyframes$1, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", onPlay, onStop, onComplete, onUpdate, ...options }) {\r\n let speed = 1;\r\n let hasStopped = false;\r\n let resolveFinishedPromise;\r\n let currentFinishedPromise;\r\n /**\r\n * Resolve the current Promise every time we enter the\r\n * finished state. This is WAAPI-compatible behaviour.\r\n */\r\n const updateFinishedPromise = () => {\r\n currentFinishedPromise = new Promise((resolve) => {\r\n resolveFinishedPromise = resolve;\r\n });\r\n };\r\n // Create the first finished promise\r\n updateFinishedPromise();\r\n let animationDriver;\r\n const generatorFactory = types[type] || keyframes;\r\n /**\r\n * If this isn't the keyframes generator and we've been provided\r\n * strings as keyframes, we need to interpolate these.\r\n */\r\n let mapNumbersToKeyframes;\r\n if (generatorFactory !== keyframes &&\r\n typeof keyframes$1[0] !== \"number\") {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);\r\n }\r\n mapNumbersToKeyframes = interpolate([0, 100], keyframes$1, {\r\n clamp: false,\r\n });\r\n keyframes$1 = [0, 100];\r\n }\r\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\r\n let mirroredGenerator;\r\n if (repeatType === \"mirror\") {\r\n mirroredGenerator = generatorFactory({\r\n ...options,\r\n keyframes: [...keyframes$1].reverse(),\r\n velocity: -(options.velocity || 0),\r\n });\r\n }\r\n let playState = \"idle\";\r\n let holdTime = null;\r\n let startTime = null;\r\n let cancelTime = null;\r\n /**\r\n * If duration is undefined and we have repeat options,\r\n * we need to calculate a duration from the generator.\r\n *\r\n * We set it to the generator itself to cache the duration.\r\n * Any timeline resolver will need to have already precalculated\r\n * the duration by this step.\r\n */\r\n if (generator.calculatedDuration === null && repeat) {\r\n generator.calculatedDuration = calcGeneratorDuration(generator);\r\n }\r\n const { calculatedDuration } = generator;\r\n let resolvedDuration = Infinity;\r\n let totalDuration = Infinity;\r\n if (calculatedDuration !== null) {\r\n resolvedDuration = calculatedDuration + repeatDelay;\r\n totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;\r\n }\r\n let currentTime = 0;\r\n const tick = (timestamp) => {\r\n if (startTime === null)\r\n return;\r\n /**\r\n * requestAnimationFrame timestamps can come through as lower than\r\n * the startTime as set by performance.now(). Here we prevent this,\r\n * though in the future it could be possible to make setting startTime\r\n * a pending operation that gets resolved here.\r\n */\r\n if (speed > 0)\r\n startTime = Math.min(startTime, timestamp);\r\n if (speed < 0)\r\n startTime = Math.min(timestamp - totalDuration / speed, startTime);\r\n if (holdTime !== null) {\r\n currentTime = holdTime;\r\n }\r\n else {\r\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\r\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\r\n // example.\r\n currentTime = Math.round(timestamp - startTime) * speed;\r\n }\r\n // Rebase on delay\r\n const timeWithoutDelay = currentTime - delay * (speed >= 0 ? 1 : -1);\r\n const isInDelayPhase = speed >= 0 ? timeWithoutDelay < 0 : timeWithoutDelay > totalDuration;\r\n currentTime = Math.max(timeWithoutDelay, 0);\r\n /**\r\n * If this animation has finished, set the current time\r\n * to the total duration.\r\n */\r\n if (playState === \"finished\" && holdTime === null) {\r\n currentTime = totalDuration;\r\n }\r\n let elapsed = currentTime;\r\n let frameGenerator = generator;\r\n if (repeat) {\r\n /**\r\n * Get the current progress (0-1) of the animation. If t is >\r\n * than duration we'll get values like 2.5 (midway through the\r\n * third iteration)\r\n */\r\n const progress = Math.min(currentTime, totalDuration) / resolvedDuration;\r\n /**\r\n * Get the current iteration (0 indexed). For instance the floor of\r\n * 2.5 is 2.\r\n */\r\n let currentIteration = Math.floor(progress);\r\n /**\r\n * Get the current progress of the iteration by taking the remainder\r\n * so 2.5 is 0.5 through iteration 2\r\n */\r\n let iterationProgress = progress % 1.0;\r\n /**\r\n * If iteration progress is 1 we count that as the end\r\n * of the previous iteration.\r\n */\r\n if (!iterationProgress && progress >= 1) {\r\n iterationProgress = 1;\r\n }\r\n iterationProgress === 1 && currentIteration--;\r\n currentIteration = Math.min(currentIteration, repeat + 1);\r\n /**\r\n * Reverse progress if we're not running in \"normal\" direction\r\n */\r\n const isOddIteration = Boolean(currentIteration % 2);\r\n if (isOddIteration) {\r\n if (repeatType === \"reverse\") {\r\n iterationProgress = 1 - iterationProgress;\r\n if (repeatDelay) {\r\n iterationProgress -= repeatDelay / resolvedDuration;\r\n }\r\n }\r\n else if (repeatType === \"mirror\") {\r\n frameGenerator = mirroredGenerator;\r\n }\r\n }\r\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\r\n }\r\n /**\r\n * If we're in negative time, set state as the initial keyframe.\r\n * This prevents delay: x, duration: 0 animations from finishing\r\n * instantly.\r\n */\r\n const state = isInDelayPhase\r\n ? { done: false, value: keyframes$1[0] }\r\n : frameGenerator.next(elapsed);\r\n if (mapNumbersToKeyframes) {\r\n state.value = mapNumbersToKeyframes(state.value);\r\n }\r\n let { done } = state;\r\n if (!isInDelayPhase && calculatedDuration !== null) {\r\n done = speed >= 0 ? currentTime >= totalDuration : currentTime <= 0;\r\n }\r\n const isAnimationFinished = holdTime === null &&\r\n (playState === \"finished\" || (playState === \"running\" && done));\r\n if (onUpdate) {\r\n onUpdate(state.value);\r\n }\r\n if (isAnimationFinished) {\r\n finish();\r\n }\r\n return state;\r\n };\r\n const stopAnimationDriver = () => {\r\n animationDriver && animationDriver.stop();\r\n animationDriver = undefined;\r\n };\r\n const cancel = () => {\r\n playState = \"idle\";\r\n stopAnimationDriver();\r\n resolveFinishedPromise();\r\n updateFinishedPromise();\r\n startTime = cancelTime = null;\r\n };\r\n const finish = () => {\r\n playState = \"finished\";\r\n onComplete && onComplete();\r\n stopAnimationDriver();\r\n resolveFinishedPromise();\r\n };\r\n const play = () => {\r\n if (hasStopped)\r\n return;\r\n if (!animationDriver)\r\n animationDriver = driver(tick);\r\n const now = animationDriver.now();\r\n onPlay && onPlay();\r\n if (holdTime !== null) {\r\n startTime = now - holdTime;\r\n }\r\n else if (!startTime || playState === \"finished\") {\r\n startTime = now;\r\n }\r\n if (playState === \"finished\") {\r\n updateFinishedPromise();\r\n }\r\n cancelTime = startTime;\r\n holdTime = null;\r\n /**\r\n * Set playState to running only after we've used it in\r\n * the previous logic.\r\n */\r\n playState = \"running\";\r\n animationDriver.start();\r\n };\r\n if (autoplay) {\r\n play();\r\n }\r\n const controls = {\r\n then(resolve, reject) {\r\n return currentFinishedPromise.then(resolve, reject);\r\n },\r\n get time() {\r\n return millisecondsToSeconds(currentTime);\r\n },\r\n set time(newTime) {\r\n newTime = secondsToMilliseconds(newTime);\r\n currentTime = newTime;\r\n if (holdTime !== null || !animationDriver || speed === 0) {\r\n holdTime = newTime;\r\n }\r\n else {\r\n startTime = animationDriver.now() - newTime / speed;\r\n }\r\n },\r\n get duration() {\r\n const duration = generator.calculatedDuration === null\r\n ? calcGeneratorDuration(generator)\r\n : generator.calculatedDuration;\r\n return millisecondsToSeconds(duration);\r\n },\r\n get speed() {\r\n return speed;\r\n },\r\n set speed(newSpeed) {\r\n if (newSpeed === speed || !animationDriver)\r\n return;\r\n speed = newSpeed;\r\n controls.time = millisecondsToSeconds(currentTime);\r\n },\r\n get state() {\r\n return playState;\r\n },\r\n play,\r\n pause: () => {\r\n playState = \"paused\";\r\n holdTime = currentTime;\r\n },\r\n stop: () => {\r\n hasStopped = true;\r\n if (playState === \"idle\")\r\n return;\r\n playState = \"idle\";\r\n onStop && onStop();\r\n cancel();\r\n },\r\n cancel: () => {\r\n if (cancelTime !== null)\r\n tick(cancelTime);\r\n cancel();\r\n },\r\n complete: () => {\r\n playState = \"finished\";\r\n },\r\n sample: (elapsed) => {\r\n startTime = 0;\r\n return tick(elapsed);\r\n },\r\n };\r\n return controls;\r\n}\r\n\r\nexport { animateValue };\r\n","function memo(callback) {\r\n let result;\r\n return () => {\r\n if (result === undefined)\r\n result = callback();\r\n return result;\r\n };\r\n}\r\n\r\nexport { memo };\r\n","import { animateStyle } from './index.mjs';\r\nimport { isWaapiSupportedEasing } from './easing.mjs';\r\nimport { getFinalKeyframe } from './utils/get-final-keyframe.mjs';\r\nimport { animateValue } from '../js/index.mjs';\r\nimport { millisecondsToSeconds, secondsToMilliseconds } from '../../../utils/time-conversion.mjs';\r\nimport { memo } from '../../../utils/memo.mjs';\r\nimport { noop } from '../../../utils/noop.mjs';\r\nimport { frame, cancelFrame } from '../../../frameloop/frame.mjs';\r\n\r\nconst supportsWaapi = memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\r\n/**\r\n * A list of values that can be hardware-accelerated.\r\n */\r\nconst acceleratedValues = new Set([\r\n \"opacity\",\r\n \"clipPath\",\r\n \"filter\",\r\n \"transform\",\r\n \"backgroundColor\",\r\n]);\r\n/**\r\n * 10ms is chosen here as it strikes a balance between smooth\r\n * results (more than one keyframe per frame at 60fps) and\r\n * keyframe quantity.\r\n */\r\nconst sampleDelta = 10; //ms\r\n/**\r\n * Implement a practical max duration for keyframe generation\r\n * to prevent infinite loops\r\n */\r\nconst maxDuration = 20000;\r\nconst requiresPregeneratedKeyframes = (valueName, options) => options.type === \"spring\" ||\r\n valueName === \"backgroundColor\" ||\r\n !isWaapiSupportedEasing(options.ease);\r\nfunction createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {\r\n const canAccelerateAnimation = supportsWaapi() &&\r\n acceleratedValues.has(valueName) &&\r\n !options.repeatDelay &&\r\n options.repeatType !== \"mirror\" &&\r\n options.damping !== 0 &&\r\n options.type !== \"inertia\";\r\n if (!canAccelerateAnimation)\r\n return false;\r\n /**\r\n * TODO: Unify with js/index\r\n */\r\n let hasStopped = false;\r\n let resolveFinishedPromise;\r\n let currentFinishedPromise;\r\n /**\r\n * Cancelling an animation will write to the DOM. For safety we want to defer\r\n * this until the next `update` frame lifecycle. This flag tracks whether we\r\n * have a pending cancel, if so we shouldn't allow animations to finish.\r\n */\r\n let pendingCancel = false;\r\n /**\r\n * Resolve the current Promise every time we enter the\r\n * finished state. This is WAAPI-compatible behaviour.\r\n */\r\n const updateFinishedPromise = () => {\r\n currentFinishedPromise = new Promise((resolve) => {\r\n resolveFinishedPromise = resolve;\r\n });\r\n };\r\n // Create the first finished promise\r\n updateFinishedPromise();\r\n let { keyframes, duration = 300, ease, times } = options;\r\n /**\r\n * If this animation needs pre-generated keyframes then generate.\r\n */\r\n if (requiresPregeneratedKeyframes(valueName, options)) {\r\n const sampleAnimation = animateValue({\r\n ...options,\r\n repeat: 0,\r\n delay: 0,\r\n });\r\n let state = { done: false, value: keyframes[0] };\r\n const pregeneratedKeyframes = [];\r\n /**\r\n * Bail after 20 seconds of pre-generated keyframes as it's likely\r\n * we're heading for an infinite loop.\r\n */\r\n let t = 0;\r\n while (!state.done && t < maxDuration) {\r\n state = sampleAnimation.sample(t);\r\n pregeneratedKeyframes.push(state.value);\r\n t += sampleDelta;\r\n }\r\n times = undefined;\r\n keyframes = pregeneratedKeyframes;\r\n duration = t - sampleDelta;\r\n ease = \"linear\";\r\n }\r\n const animation = animateStyle(value.owner.current, valueName, keyframes, {\r\n ...options,\r\n duration,\r\n /**\r\n * This function is currently not called if ease is provided\r\n * as a function so the cast is safe.\r\n *\r\n * However it would be possible for a future refinement to port\r\n * in easing pregeneration from Motion One for browsers that\r\n * support the upcoming `linear()` easing function.\r\n */\r\n ease: ease,\r\n times,\r\n });\r\n const cancelAnimation = () => {\r\n pendingCancel = false;\r\n animation.cancel();\r\n };\r\n const safeCancel = () => {\r\n pendingCancel = true;\r\n frame.update(cancelAnimation);\r\n resolveFinishedPromise();\r\n updateFinishedPromise();\r\n };\r\n /**\r\n * Prefer the `onfinish` prop as it's more widely supported than\r\n * the `finished` promise.\r\n *\r\n * Here, we synchronously set the provided MotionValue to the end\r\n * keyframe. If we didn't, when the WAAPI animation is finished it would\r\n * be removed from the element which would then revert to its old styles.\r\n */\r\n animation.onfinish = () => {\r\n if (pendingCancel)\r\n return;\r\n value.set(getFinalKeyframe(keyframes, options));\r\n onComplete && onComplete();\r\n safeCancel();\r\n };\r\n /**\r\n * Animation interrupt callback.\r\n */\r\n const controls = {\r\n then(resolve, reject) {\r\n return currentFinishedPromise.then(resolve, reject);\r\n },\r\n attachTimeline(timeline) {\r\n animation.timeline = timeline;\r\n animation.onfinish = null;\r\n return noop;\r\n },\r\n get time() {\r\n return millisecondsToSeconds(animation.currentTime || 0);\r\n },\r\n set time(newTime) {\r\n animation.currentTime = secondsToMilliseconds(newTime);\r\n },\r\n get speed() {\r\n return animation.playbackRate;\r\n },\r\n set speed(newSpeed) {\r\n animation.playbackRate = newSpeed;\r\n },\r\n get duration() {\r\n return millisecondsToSeconds(duration);\r\n },\r\n play: () => {\r\n if (hasStopped)\r\n return;\r\n animation.play();\r\n /**\r\n * Cancel any pending cancel tasks\r\n */\r\n cancelFrame(cancelAnimation);\r\n },\r\n pause: () => animation.pause(),\r\n stop: () => {\r\n hasStopped = true;\r\n if (animation.playState === \"idle\")\r\n return;\r\n /**\r\n * WAAPI doesn't natively have any interruption capabilities.\r\n *\r\n * Rather than read commited styles back out of the DOM, we can\r\n * create a renderless JS animation and sample it twice to calculate\r\n * its current value, \"previous\" value, and therefore allow\r\n * Motion to calculate velocity for any subsequent animation.\r\n */\r\n const { currentTime } = animation;\r\n if (currentTime) {\r\n const sampleAnimation = animateValue({\r\n ...options,\r\n autoplay: false,\r\n });\r\n value.setWithVelocity(sampleAnimation.sample(currentTime - sampleDelta).value, sampleAnimation.sample(currentTime).value, sampleDelta);\r\n }\r\n safeCancel();\r\n },\r\n complete: () => {\r\n if (pendingCancel)\r\n return;\r\n animation.finish();\r\n },\r\n cancel: safeCancel,\r\n };\r\n return controls;\r\n}\r\n\r\nexport { createAcceleratedAnimation };\r\n","import { animateValue } from './js/index.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\n\r\nfunction createInstantAnimation({ keyframes, delay, onUpdate, onComplete, }) {\r\n const setValue = () => {\r\n onUpdate && onUpdate(keyframes[keyframes.length - 1]);\r\n onComplete && onComplete();\r\n /**\r\n * TODO: As this API grows it could make sense to always return\r\n * animateValue. This will be a bigger project as animateValue\r\n * is frame-locked whereas this function resolves instantly.\r\n * This is a behavioural change and also has ramifications regarding\r\n * assumptions within tests.\r\n */\r\n return {\r\n time: 0,\r\n speed: 1,\r\n duration: 0,\r\n play: (noop),\r\n pause: (noop),\r\n stop: (noop),\r\n then: (resolve) => {\r\n resolve();\r\n return Promise.resolve();\r\n },\r\n cancel: (noop),\r\n complete: (noop),\r\n };\r\n };\r\n return delay\r\n ? animateValue({\r\n keyframes: [0, 1],\r\n duration: 0,\r\n delay,\r\n onComplete: setValue,\r\n })\r\n : setValue();\r\n}\r\n\r\nexport { createInstantAnimation };\r\n","import { transformProps } from '../../render/html/utils/transform.mjs';\r\n\r\nconst underDampedSpring = {\r\n type: \"spring\",\r\n stiffness: 500,\r\n damping: 25,\r\n restSpeed: 10,\r\n};\r\nconst criticallyDampedSpring = (target) => ({\r\n type: \"spring\",\r\n stiffness: 550,\r\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\r\n restSpeed: 10,\r\n});\r\nconst keyframesTransition = {\r\n type: \"keyframes\",\r\n duration: 0.8,\r\n};\r\n/**\r\n * Default easing curve is a slightly shallower version of\r\n * the default browser easing curve.\r\n */\r\nconst ease = {\r\n type: \"keyframes\",\r\n ease: [0.25, 0.1, 0.35, 1],\r\n duration: 0.3,\r\n};\r\nconst getDefaultTransition = (valueKey, { keyframes }) => {\r\n if (keyframes.length > 2) {\r\n return keyframesTransition;\r\n }\r\n else if (transformProps.has(valueKey)) {\r\n return valueKey.startsWith(\"scale\")\r\n ? criticallyDampedSpring(keyframes[1])\r\n : underDampedSpring;\r\n }\r\n return ease;\r\n};\r\n\r\nexport { getDefaultTransition };\r\n","import { complex } from '../../value/types/complex/index.mjs';\r\n\r\n/**\r\n * Check if a value is animatable. Examples:\r\n *\r\n * ✅: 100, \"100px\", \"#fff\"\r\n * ❌: \"block\", \"url(2.jpg)\"\r\n * @param value\r\n *\r\n * @internal\r\n */\r\nconst isAnimatable = (key, value) => {\r\n // If the list of keys tat might be non-animatable grows, replace with Set\r\n if (key === \"zIndex\")\r\n return false;\r\n // If it's a number or a keyframes array, we can animate it. We might at some point\r\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\r\n // but for now lets leave it like this for performance reasons\r\n if (typeof value === \"number\" || Array.isArray(value))\r\n return true;\r\n if (typeof value === \"string\" && // It's animatable if we have a string\r\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\r\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\nexport { isAnimatable };\r\n","import { complex } from './index.mjs';\r\nimport { floatRegex } from '../utils.mjs';\r\n\r\n/**\r\n * Properties that should default to 1 or 100%\r\n */\r\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\r\nfunction applyDefaultFilter(v) {\r\n const [name, value] = v.slice(0, -1).split(\"(\");\r\n if (name === \"drop-shadow\")\r\n return v;\r\n const [number] = value.match(floatRegex) || [];\r\n if (!number)\r\n return v;\r\n const unit = value.replace(number, \"\");\r\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\r\n if (number !== value)\r\n defaultValue *= 100;\r\n return name + \"(\" + defaultValue + unit + \")\";\r\n}\r\nconst functionRegex = /([a-z-]*)\\(.*?\\)/g;\r\nconst filter = {\r\n ...complex,\r\n getAnimatableNone: (v) => {\r\n const functions = v.match(functionRegex);\r\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\r\n },\r\n};\r\n\r\nexport { filter };\r\n","import { color } from '../../../value/types/color/index.mjs';\r\nimport { filter } from '../../../value/types/complex/filter.mjs';\r\nimport { numberValueTypes } from './number.mjs';\r\n\r\n/**\r\n * A map of default value types for common values\r\n */\r\nconst defaultValueTypes = {\r\n ...numberValueTypes,\r\n // Color props\r\n color,\r\n backgroundColor: color,\r\n outlineColor: color,\r\n fill: color,\r\n stroke: color,\r\n // Border props\r\n borderColor: color,\r\n borderTopColor: color,\r\n borderRightColor: color,\r\n borderBottomColor: color,\r\n borderLeftColor: color,\r\n filter,\r\n WebkitFilter: filter,\r\n};\r\n/**\r\n * Gets the default ValueType for the provided value key\r\n */\r\nconst getDefaultValueType = (key) => defaultValueTypes[key];\r\n\r\nexport { defaultValueTypes, getDefaultValueType };\r\n","import { complex } from '../../../value/types/complex/index.mjs';\r\nimport { filter } from '../../../value/types/complex/filter.mjs';\r\nimport { getDefaultValueType } from './defaults.mjs';\r\n\r\nfunction getAnimatableNone(key, value) {\r\n let defaultValueType = getDefaultValueType(key);\r\n if (defaultValueType !== filter)\r\n defaultValueType = complex;\r\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\r\n return defaultValueType.getAnimatableNone\r\n ? defaultValueType.getAnimatableNone(value)\r\n : undefined;\r\n}\r\n\r\nexport { getAnimatableNone };\r\n","/**\r\n * Check if the value is a zero value string like \"0px\" or \"0%\"\r\n */\r\nconst isZeroValueString = (v) => /^0[^.\\s]+$/.test(v);\r\n\r\nexport { isZeroValueString };\r\n","import { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\r\n\r\nfunction isNone(value) {\r\n if (typeof value === \"number\") {\r\n return value === 0;\r\n }\r\n else if (value !== null) {\r\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\r\n }\r\n}\r\n\r\nexport { isNone };\r\n","import { getAnimatableNone } from '../../render/dom/value-types/animatable-none.mjs';\r\nimport { isAnimatable } from './is-animatable.mjs';\r\nimport { isNone } from './is-none.mjs';\r\n\r\nfunction getKeyframes(value, valueName, target, transition) {\r\n const isTargetAnimatable = isAnimatable(valueName, target);\r\n let keyframes;\r\n if (Array.isArray(target)) {\r\n keyframes = [...target];\r\n }\r\n else {\r\n keyframes = [null, target];\r\n }\r\n const defaultOrigin = transition.from !== undefined ? transition.from : value.get();\r\n let animatableTemplateValue = undefined;\r\n const noneKeyframeIndexes = [];\r\n for (let i = 0; i < keyframes.length; i++) {\r\n /**\r\n * Fill null/wildcard keyframes\r\n */\r\n if (keyframes[i] === null) {\r\n keyframes[i] = i === 0 ? defaultOrigin : keyframes[i - 1];\r\n }\r\n if (isNone(keyframes[i])) {\r\n noneKeyframeIndexes.push(i);\r\n }\r\n // TODO: Clean this conditional, it works for now\r\n if (typeof keyframes[i] === \"string\" &&\r\n keyframes[i] !== \"none\" &&\r\n keyframes[i] !== \"0\") {\r\n animatableTemplateValue = keyframes[i];\r\n }\r\n }\r\n if (isTargetAnimatable &&\r\n noneKeyframeIndexes.length &&\r\n animatableTemplateValue) {\r\n for (let i = 0; i < noneKeyframeIndexes.length; i++) {\r\n const index = noneKeyframeIndexes[i];\r\n keyframes[index] = getAnimatableNone(valueName, animatableTemplateValue);\r\n }\r\n }\r\n return keyframes;\r\n}\r\n\r\nexport { getKeyframes };\r\n","/**\r\n * Decide whether a transition is defined on a given Transition.\r\n * This filters out orchestration options and returns true\r\n * if any options are left.\r\n */\r\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\r\n return !!Object.keys(transition).length;\r\n}\r\nfunction getValueTransition(transition, key) {\r\n return transition[key] || transition[\"default\"] || transition;\r\n}\r\n\r\nexport { getValueTransition, isTransitionDefined };\r\n","const MotionGlobalConfig = {\r\n skipAnimations: false,\r\n};\r\n\r\nexport { MotionGlobalConfig };\r\n","import { warning } from '../../utils/errors.mjs';\r\nimport { secondsToMilliseconds } from '../../utils/time-conversion.mjs';\r\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\r\nimport { createAcceleratedAnimation } from '../animators/waapi/create-accelerated-animation.mjs';\r\nimport { createInstantAnimation } from '../animators/instant.mjs';\r\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\r\nimport { isAnimatable } from '../utils/is-animatable.mjs';\r\nimport { getKeyframes } from '../utils/keyframes.mjs';\r\nimport { getValueTransition, isTransitionDefined } from '../utils/transitions.mjs';\r\nimport { animateValue } from '../animators/js/index.mjs';\r\nimport { MotionGlobalConfig } from '../../utils/GlobalConfig.mjs';\r\n\r\nconst animateMotionValue = (valueName, value, target, transition = {}) => {\r\n return (onComplete) => {\r\n const valueTransition = getValueTransition(transition, valueName) || {};\r\n /**\r\n * Most transition values are currently completely overwritten by value-specific\r\n * transitions. In the future it'd be nicer to blend these transitions. But for now\r\n * delay actually does inherit from the root transition if not value-specific.\r\n */\r\n const delay = valueTransition.delay || transition.delay || 0;\r\n /**\r\n * Elapsed isn't a public transition option but can be passed through from\r\n * optimized appear effects in milliseconds.\r\n */\r\n let { elapsed = 0 } = transition;\r\n elapsed = elapsed - secondsToMilliseconds(delay);\r\n const keyframes = getKeyframes(value, valueName, target, valueTransition);\r\n /**\r\n * Check if we're able to animate between the start and end keyframes,\r\n * and throw a warning if we're attempting to animate between one that's\r\n * animatable and another that isn't.\r\n */\r\n const originKeyframe = keyframes[0];\r\n const targetKeyframe = keyframes[keyframes.length - 1];\r\n const isOriginAnimatable = isAnimatable(valueName, originKeyframe);\r\n const isTargetAnimatable = isAnimatable(valueName, targetKeyframe);\r\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${valueName} from \"${originKeyframe}\" to \"${targetKeyframe}\". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \\`style\\` property.`);\r\n let options = {\r\n keyframes,\r\n velocity: value.getVelocity(),\r\n ease: \"easeOut\",\r\n ...valueTransition,\r\n delay: -elapsed,\r\n onUpdate: (v) => {\r\n value.set(v);\r\n valueTransition.onUpdate && valueTransition.onUpdate(v);\r\n },\r\n onComplete: () => {\r\n onComplete();\r\n valueTransition.onComplete && valueTransition.onComplete();\r\n },\r\n };\r\n /**\r\n * If there's no transition defined for this value, we can generate\r\n * unqiue transition settings for this value.\r\n */\r\n if (!isTransitionDefined(valueTransition)) {\r\n options = {\r\n ...options,\r\n ...getDefaultTransition(valueName, options),\r\n };\r\n }\r\n /**\r\n * Both WAAPI and our internal animation functions use durations\r\n * as defined by milliseconds, while our external API defines them\r\n * as seconds.\r\n */\r\n if (options.duration) {\r\n options.duration = secondsToMilliseconds(options.duration);\r\n }\r\n if (options.repeatDelay) {\r\n options.repeatDelay = secondsToMilliseconds(options.repeatDelay);\r\n }\r\n if (!isOriginAnimatable ||\r\n !isTargetAnimatable ||\r\n instantAnimationState.current ||\r\n valueTransition.type === false ||\r\n MotionGlobalConfig.skipAnimations) {\r\n /**\r\n * If we can't animate this value, or the global instant animation flag is set,\r\n * or this is simply defined as an instant transition, return an instant transition.\r\n */\r\n return createInstantAnimation(instantAnimationState.current\r\n ? { ...options, delay: 0 }\r\n : options);\r\n }\r\n /**\r\n * Animate via WAAPI if possible.\r\n */\r\n if (\r\n /**\r\n * If this is a handoff animation, the optimised animation will be running via\r\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\r\n * optimised animation.\r\n */\r\n !transition.isHandoff &&\r\n value.owner &&\r\n value.owner.current instanceof HTMLElement &&\r\n /**\r\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\r\n * no way to read the value from WAAPI every frame.\r\n */\r\n !value.owner.getProps().onUpdate) {\r\n const acceleratedAnimation = createAcceleratedAnimation(value, valueName, options);\r\n if (acceleratedAnimation)\r\n return acceleratedAnimation;\r\n }\r\n /**\r\n * If we didn't create an accelerated animation, create a JS animation\r\n */\r\n return animateValue(options);\r\n };\r\n};\r\n\r\nexport { animateMotionValue };\r\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\r\n\r\nfunction isWillChangeMotionValue(value) {\r\n return Boolean(isMotionValue(value) && value.add);\r\n}\r\n\r\nexport { isWillChangeMotionValue };\r\n","/**\r\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\r\n */\r\nconst isNumericalString = (v) => /^\\-?\\d*\\.?\\d+$/.test(v);\r\n\r\nexport { isNumericalString };\r\n","function addUniqueItem(arr, item) {\r\n if (arr.indexOf(item) === -1)\r\n arr.push(item);\r\n}\r\nfunction removeItem(arr, item) {\r\n const index = arr.indexOf(item);\r\n if (index > -1)\r\n arr.splice(index, 1);\r\n}\r\n// Adapted from array-move\r\nfunction moveItem([...arr], fromIndex, toIndex) {\r\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\r\n if (startIndex >= 0 && startIndex < arr.length) {\r\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\r\n const [item] = arr.splice(fromIndex, 1);\r\n arr.splice(endIndex, 0, item);\r\n }\r\n return arr;\r\n}\r\n\r\nexport { addUniqueItem, moveItem, removeItem };\r\n","import { addUniqueItem, removeItem } from './array.mjs';\r\n\r\nclass SubscriptionManager {\r\n constructor() {\r\n this.subscriptions = [];\r\n }\r\n add(handler) {\r\n addUniqueItem(this.subscriptions, handler);\r\n return () => removeItem(this.subscriptions, handler);\r\n }\r\n notify(a, b, c) {\r\n const numSubscriptions = this.subscriptions.length;\r\n if (!numSubscriptions)\r\n return;\r\n if (numSubscriptions === 1) {\r\n /**\r\n * If there's only a single handler we can just call it without invoking a loop.\r\n */\r\n this.subscriptions[0](a, b, c);\r\n }\r\n else {\r\n for (let i = 0; i < numSubscriptions; i++) {\r\n /**\r\n * Check whether the handler exists before firing as it's possible\r\n * the subscriptions were modified during this loop running.\r\n */\r\n const handler = this.subscriptions[i];\r\n handler && handler(a, b, c);\r\n }\r\n }\r\n }\r\n getSize() {\r\n return this.subscriptions.length;\r\n }\r\n clear() {\r\n this.subscriptions.length = 0;\r\n }\r\n}\r\n\r\nexport { SubscriptionManager };\r\n","const warned = new Set();\r\nfunction warnOnce(condition, message, element) {\r\n if (condition || warned.has(message))\r\n return;\r\n console.warn(message);\r\n if (element)\r\n console.warn(element);\r\n warned.add(message);\r\n}\r\n\r\nexport { warnOnce };\r\n","import { SubscriptionManager } from '../utils/subscription-manager.mjs';\r\nimport { velocityPerSecond } from '../utils/velocity-per-second.mjs';\r\nimport { warnOnce } from '../utils/warn-once.mjs';\r\nimport { frame, frameData } from '../frameloop/frame.mjs';\r\n\r\nconst isFloat = (value) => {\r\n return !isNaN(parseFloat(value));\r\n};\r\nconst collectMotionValues = {\r\n current: undefined,\r\n};\r\n/**\r\n * `MotionValue` is used to track the state and velocity of motion values.\r\n *\r\n * @public\r\n */\r\nclass MotionValue {\r\n /**\r\n * @param init - The initiating value\r\n * @param config - Optional configuration options\r\n *\r\n * - `transformer`: A function to transform incoming values with.\r\n *\r\n * @internal\r\n */\r\n constructor(init, options = {}) {\r\n /**\r\n * This will be replaced by the build step with the latest version number.\r\n * When MotionValues are provided to motion components, warn if versions are mixed.\r\n */\r\n this.version = \"10.18.0\";\r\n /**\r\n * Duration, in milliseconds, since last updating frame.\r\n *\r\n * @internal\r\n */\r\n this.timeDelta = 0;\r\n /**\r\n * Timestamp of the last time this `MotionValue` was updated.\r\n *\r\n * @internal\r\n */\r\n this.lastUpdated = 0;\r\n /**\r\n * Tracks whether this value can output a velocity. Currently this is only true\r\n * if the value is numerical, but we might be able to widen the scope here and support\r\n * other value types.\r\n *\r\n * @internal\r\n */\r\n this.canTrackVelocity = false;\r\n /**\r\n * An object containing a SubscriptionManager for each active event.\r\n */\r\n this.events = {};\r\n this.updateAndNotify = (v, render = true) => {\r\n this.prev = this.current;\r\n this.current = v;\r\n // Update timestamp\r\n const { delta, timestamp } = frameData;\r\n if (this.lastUpdated !== timestamp) {\r\n this.timeDelta = delta;\r\n this.lastUpdated = timestamp;\r\n frame.postRender(this.scheduleVelocityCheck);\r\n }\r\n // Update update subscribers\r\n if (this.prev !== this.current && this.events.change) {\r\n this.events.change.notify(this.current);\r\n }\r\n // Update velocity subscribers\r\n if (this.events.velocityChange) {\r\n this.events.velocityChange.notify(this.getVelocity());\r\n }\r\n // Update render subscribers\r\n if (render && this.events.renderRequest) {\r\n this.events.renderRequest.notify(this.current);\r\n }\r\n };\r\n /**\r\n * Schedule a velocity check for the next frame.\r\n *\r\n * This is an instanced and bound function to prevent generating a new\r\n * function once per frame.\r\n *\r\n * @internal\r\n */\r\n this.scheduleVelocityCheck = () => frame.postRender(this.velocityCheck);\r\n /**\r\n * Updates `prev` with `current` if the value hasn't been updated this frame.\r\n * This ensures velocity calculations return `0`.\r\n *\r\n * This is an instanced and bound function to prevent generating a new\r\n * function once per frame.\r\n *\r\n * @internal\r\n */\r\n this.velocityCheck = ({ timestamp }) => {\r\n if (timestamp !== this.lastUpdated) {\r\n this.prev = this.current;\r\n if (this.events.velocityChange) {\r\n this.events.velocityChange.notify(this.getVelocity());\r\n }\r\n }\r\n };\r\n this.hasAnimated = false;\r\n this.prev = this.current = init;\r\n this.canTrackVelocity = isFloat(this.current);\r\n this.owner = options.owner;\r\n }\r\n /**\r\n * Adds a function that will be notified when the `MotionValue` is updated.\r\n *\r\n * It returns a function that, when called, will cancel the subscription.\r\n *\r\n * When calling `onChange` inside a React component, it should be wrapped with the\r\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\r\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\r\n *\r\n * ```jsx\r\n * export const MyComponent = () => {\r\n * const x = useMotionValue(0)\r\n * const y = useMotionValue(0)\r\n * const opacity = useMotionValue(1)\r\n *\r\n * useEffect(() => {\r\n * function updateOpacity() {\r\n * const maxXY = Math.max(x.get(), y.get())\r\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\r\n * opacity.set(newOpacity)\r\n * }\r\n *\r\n * const unsubscribeX = x.on(\"change\", updateOpacity)\r\n * const unsubscribeY = y.on(\"change\", updateOpacity)\r\n *\r\n * return () => {\r\n * unsubscribeX()\r\n * unsubscribeY()\r\n * }\r\n * }, [])\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @param subscriber - A function that receives the latest value.\r\n * @returns A function that, when called, will cancel this subscription.\r\n *\r\n * @deprecated\r\n */\r\n onChange(subscription) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\r\n }\r\n return this.on(\"change\", subscription);\r\n }\r\n on(eventName, callback) {\r\n if (!this.events[eventName]) {\r\n this.events[eventName] = new SubscriptionManager();\r\n }\r\n const unsubscribe = this.events[eventName].add(callback);\r\n if (eventName === \"change\") {\r\n return () => {\r\n unsubscribe();\r\n /**\r\n * If we have no more change listeners by the start\r\n * of the next frame, stop active animations.\r\n */\r\n frame.read(() => {\r\n if (!this.events.change.getSize()) {\r\n this.stop();\r\n }\r\n });\r\n };\r\n }\r\n return unsubscribe;\r\n }\r\n clearListeners() {\r\n for (const eventManagers in this.events) {\r\n this.events[eventManagers].clear();\r\n }\r\n }\r\n /**\r\n * Attaches a passive effect to the `MotionValue`.\r\n *\r\n * @internal\r\n */\r\n attach(passiveEffect, stopPassiveEffect) {\r\n this.passiveEffect = passiveEffect;\r\n this.stopPassiveEffect = stopPassiveEffect;\r\n }\r\n /**\r\n * Sets the state of the `MotionValue`.\r\n *\r\n * @remarks\r\n *\r\n * ```jsx\r\n * const x = useMotionValue(0)\r\n * x.set(10)\r\n * ```\r\n *\r\n * @param latest - Latest value to set.\r\n * @param render - Whether to notify render subscribers. Defaults to `true`\r\n *\r\n * @public\r\n */\r\n set(v, render = true) {\r\n if (!render || !this.passiveEffect) {\r\n this.updateAndNotify(v, render);\r\n }\r\n else {\r\n this.passiveEffect(v, this.updateAndNotify);\r\n }\r\n }\r\n setWithVelocity(prev, current, delta) {\r\n this.set(current);\r\n this.prev = prev;\r\n this.timeDelta = delta;\r\n }\r\n /**\r\n * Set the state of the `MotionValue`, stopping any active animations,\r\n * effects, and resets velocity to `0`.\r\n */\r\n jump(v) {\r\n this.updateAndNotify(v);\r\n this.prev = v;\r\n this.stop();\r\n if (this.stopPassiveEffect)\r\n this.stopPassiveEffect();\r\n }\r\n /**\r\n * Returns the latest state of `MotionValue`\r\n *\r\n * @returns - The latest state of `MotionValue`\r\n *\r\n * @public\r\n */\r\n get() {\r\n if (collectMotionValues.current) {\r\n collectMotionValues.current.push(this);\r\n }\r\n return this.current;\r\n }\r\n /**\r\n * @public\r\n */\r\n getPrevious() {\r\n return this.prev;\r\n }\r\n /**\r\n * Returns the latest velocity of `MotionValue`\r\n *\r\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\r\n *\r\n * @public\r\n */\r\n getVelocity() {\r\n // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful\r\n return this.canTrackVelocity\r\n ? // These casts could be avoided if parseFloat would be typed better\r\n velocityPerSecond(parseFloat(this.current) -\r\n parseFloat(this.prev), this.timeDelta)\r\n : 0;\r\n }\r\n /**\r\n * Registers a new animation to control this `MotionValue`. Only one\r\n * animation can drive a `MotionValue` at one time.\r\n *\r\n * ```jsx\r\n * value.start()\r\n * ```\r\n *\r\n * @param animation - A function that starts the provided animation\r\n *\r\n * @internal\r\n */\r\n start(startAnimation) {\r\n this.stop();\r\n return new Promise((resolve) => {\r\n this.hasAnimated = true;\r\n this.animation = startAnimation(resolve);\r\n if (this.events.animationStart) {\r\n this.events.animationStart.notify();\r\n }\r\n }).then(() => {\r\n if (this.events.animationComplete) {\r\n this.events.animationComplete.notify();\r\n }\r\n this.clearAnimation();\r\n });\r\n }\r\n /**\r\n * Stop the currently active animation.\r\n *\r\n * @public\r\n */\r\n stop() {\r\n if (this.animation) {\r\n this.animation.stop();\r\n if (this.events.animationCancel) {\r\n this.events.animationCancel.notify();\r\n }\r\n }\r\n this.clearAnimation();\r\n }\r\n /**\r\n * Returns `true` if this value is currently animating.\r\n *\r\n * @public\r\n */\r\n isAnimating() {\r\n return !!this.animation;\r\n }\r\n clearAnimation() {\r\n delete this.animation;\r\n }\r\n /**\r\n * Destroy and clean up subscribers to this `MotionValue`.\r\n *\r\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\r\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\r\n * created a `MotionValue` via the `motionValue` function.\r\n *\r\n * @public\r\n */\r\n destroy() {\r\n this.clearListeners();\r\n this.stop();\r\n if (this.stopPassiveEffect) {\r\n this.stopPassiveEffect();\r\n }\r\n }\r\n}\r\nfunction motionValue(init, options) {\r\n return new MotionValue(init, options);\r\n}\r\n\r\nexport { MotionValue, collectMotionValues, motionValue };\r\n","/**\r\n * Tests a provided value against a ValueType\r\n */\r\nconst testValueType = (v) => (type) => type.test(v);\r\n\r\nexport { testValueType };\r\n","/**\r\n * ValueType for \"auto\"\r\n */\r\nconst auto = {\r\n test: (v) => v === \"auto\",\r\n parse: (v) => v,\r\n};\r\n\r\nexport { auto };\r\n","import { number } from '../../../value/types/numbers/index.mjs';\r\nimport { px, percent, degrees, vw, vh } from '../../../value/types/numbers/units.mjs';\r\nimport { testValueType } from './test.mjs';\r\nimport { auto } from './type-auto.mjs';\r\n\r\n/**\r\n * A list of value types commonly used for dimensions\r\n */\r\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\r\n/**\r\n * Tests a dimensional value against the list of dimension ValueTypes\r\n */\r\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\r\n\r\nexport { dimensionValueTypes, findDimensionValueType };\r\n","import { color } from '../../../value/types/color/index.mjs';\r\nimport { complex } from '../../../value/types/complex/index.mjs';\r\nimport { dimensionValueTypes } from './dimensions.mjs';\r\nimport { testValueType } from './test.mjs';\r\n\r\n/**\r\n * A list of all ValueTypes\r\n */\r\nconst valueTypes = [...dimensionValueTypes, color, complex];\r\n/**\r\n * Tests a value against the list of ValueTypes\r\n */\r\nconst findValueType = (v) => valueTypes.find(testValueType(v));\r\n\r\nexport { findValueType };\r\n","import { isNumericalString } from '../../utils/is-numerical-string.mjs';\r\nimport { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\r\nimport { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';\r\nimport { motionValue } from '../../value/index.mjs';\r\nimport { complex } from '../../value/types/complex/index.mjs';\r\nimport { getAnimatableNone } from '../dom/value-types/animatable-none.mjs';\r\nimport { findValueType } from '../dom/value-types/find.mjs';\r\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\r\n\r\n/**\r\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\r\n * it doesn't exist.\r\n */\r\nfunction setMotionValue(visualElement, key, value) {\r\n if (visualElement.hasValue(key)) {\r\n visualElement.getValue(key).set(value);\r\n }\r\n else {\r\n visualElement.addValue(key, motionValue(value));\r\n }\r\n}\r\nfunction setTarget(visualElement, definition) {\r\n const resolved = resolveVariant(visualElement, definition);\r\n let { transitionEnd = {}, transition = {}, ...target } = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {};\r\n target = { ...target, ...transitionEnd };\r\n for (const key in target) {\r\n const value = resolveFinalValueInKeyframes(target[key]);\r\n setMotionValue(visualElement, key, value);\r\n }\r\n}\r\nfunction setVariants(visualElement, variantLabels) {\r\n const reversedLabels = [...variantLabels].reverse();\r\n reversedLabels.forEach((key) => {\r\n const variant = visualElement.getVariant(key);\r\n variant && setTarget(visualElement, variant);\r\n if (visualElement.variantChildren) {\r\n visualElement.variantChildren.forEach((child) => {\r\n setVariants(child, variantLabels);\r\n });\r\n }\r\n });\r\n}\r\nfunction setValues(visualElement, definition) {\r\n if (Array.isArray(definition)) {\r\n return setVariants(visualElement, definition);\r\n }\r\n else if (typeof definition === \"string\") {\r\n return setVariants(visualElement, [definition]);\r\n }\r\n else {\r\n setTarget(visualElement, definition);\r\n }\r\n}\r\nfunction checkTargetForNewValues(visualElement, target, origin) {\r\n var _a, _b;\r\n const newValueKeys = Object.keys(target).filter((key) => !visualElement.hasValue(key));\r\n const numNewValues = newValueKeys.length;\r\n if (!numNewValues)\r\n return;\r\n for (let i = 0; i < numNewValues; i++) {\r\n const key = newValueKeys[i];\r\n const targetValue = target[key];\r\n let value = null;\r\n /**\r\n * If the target is a series of keyframes, we can use the first value\r\n * in the array. If this first value is null, we'll still need to read from the DOM.\r\n */\r\n if (Array.isArray(targetValue)) {\r\n value = targetValue[0];\r\n }\r\n /**\r\n * If the target isn't keyframes, or the first keyframe was null, we need to\r\n * first check if an origin value was explicitly defined in the transition as \"from\",\r\n * if not read the value from the DOM. As an absolute fallback, take the defined target value.\r\n */\r\n if (value === null) {\r\n value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key];\r\n }\r\n /**\r\n * If value is still undefined or null, ignore it. Preferably this would throw,\r\n * but this was causing issues in Framer.\r\n */\r\n if (value === undefined || value === null)\r\n continue;\r\n if (typeof value === \"string\" &&\r\n (isNumericalString(value) || isZeroValueString(value))) {\r\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\r\n value = parseFloat(value);\r\n }\r\n else if (!findValueType(value) && complex.test(targetValue)) {\r\n value = getAnimatableNone(key, targetValue);\r\n }\r\n visualElement.addValue(key, motionValue(value, { owner: visualElement }));\r\n if (origin[key] === undefined) {\r\n origin[key] = value;\r\n }\r\n if (value !== null)\r\n visualElement.setBaseTarget(key, value);\r\n }\r\n}\r\nfunction getOriginFromTransition(key, transition) {\r\n if (!transition)\r\n return;\r\n const valueTransition = transition[key] || transition[\"default\"] || transition;\r\n return valueTransition.from;\r\n}\r\nfunction getOrigin(target, transition, visualElement) {\r\n const origin = {};\r\n for (const key in target) {\r\n const transitionOrigin = getOriginFromTransition(key, transition);\r\n if (transitionOrigin !== undefined) {\r\n origin[key] = transitionOrigin;\r\n }\r\n else {\r\n const value = visualElement.getValue(key);\r\n if (value) {\r\n origin[key] = value.get();\r\n }\r\n }\r\n }\r\n return origin;\r\n}\r\n\r\nexport { checkTargetForNewValues, getOrigin, getOriginFromTransition, setTarget, setValues };\r\n","import { transformProps } from '../../render/html/utils/transform.mjs';\r\nimport { optimizedAppearDataAttribute } from '../optimized-appear/data-id.mjs';\r\nimport { animateMotionValue } from './motion-value.mjs';\r\nimport { isWillChangeMotionValue } from '../../value/use-will-change/is.mjs';\r\nimport { setTarget } from '../../render/utils/setters.mjs';\r\nimport { getValueTransition } from '../utils/transitions.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\n/**\r\n * Decide whether we should block this animation. Previously, we achieved this\r\n * just by checking whether the key was listed in protectedKeys, but this\r\n * posed problems if an animation was triggered by afterChildren and protectedKeys\r\n * had been set to true in the meantime.\r\n */\r\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\r\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\r\n needsAnimating[key] = false;\r\n return shouldBlock;\r\n}\r\nfunction hasKeyframesChanged(value, target) {\r\n const current = value.get();\r\n if (Array.isArray(target)) {\r\n for (let i = 0; i < target.length; i++) {\r\n if (target[i] !== current)\r\n return true;\r\n }\r\n }\r\n else {\r\n return current !== target;\r\n }\r\n}\r\nfunction animateTarget(visualElement, definition, { delay = 0, transitionOverride, type } = {}) {\r\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = visualElement.makeTargetAnimatable(definition);\r\n const willChange = visualElement.getValue(\"willChange\");\r\n if (transitionOverride)\r\n transition = transitionOverride;\r\n const animations = [];\r\n const animationTypeState = type &&\r\n visualElement.animationState &&\r\n visualElement.animationState.getState()[type];\r\n for (const key in target) {\r\n const value = visualElement.getValue(key);\r\n const valueTarget = target[key];\r\n if (!value ||\r\n valueTarget === undefined ||\r\n (animationTypeState &&\r\n shouldBlockAnimation(animationTypeState, key))) {\r\n continue;\r\n }\r\n const valueTransition = {\r\n delay,\r\n elapsed: 0,\r\n ...getValueTransition(transition || {}, key),\r\n };\r\n /**\r\n * If this is the first time a value is being animated, check\r\n * to see if we're handling off from an existing animation.\r\n */\r\n if (window.HandoffAppearAnimations) {\r\n const appearId = visualElement.getProps()[optimizedAppearDataAttribute];\r\n if (appearId) {\r\n const elapsed = window.HandoffAppearAnimations(appearId, key, value, frame);\r\n if (elapsed !== null) {\r\n valueTransition.elapsed = elapsed;\r\n valueTransition.isHandoff = true;\r\n }\r\n }\r\n }\r\n let canSkip = !valueTransition.isHandoff &&\r\n !hasKeyframesChanged(value, valueTarget);\r\n if (valueTransition.type === \"spring\" &&\r\n (value.getVelocity() || valueTransition.velocity)) {\r\n canSkip = false;\r\n }\r\n /**\r\n * Temporarily disable skipping animations if there's an animation in\r\n * progress. Better would be to track the current target of a value\r\n * and compare that against valueTarget.\r\n */\r\n if (value.animation) {\r\n canSkip = false;\r\n }\r\n if (canSkip)\r\n continue;\r\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key)\r\n ? { type: false }\r\n : valueTransition));\r\n const animation = value.animation;\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.add(key);\r\n animation.then(() => willChange.remove(key));\r\n }\r\n animations.push(animation);\r\n }\r\n if (transitionEnd) {\r\n Promise.all(animations).then(() => {\r\n transitionEnd && setTarget(visualElement, transitionEnd);\r\n });\r\n }\r\n return animations;\r\n}\r\n\r\nexport { animateTarget };\r\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\r\nimport { animateTarget } from './visual-element-target.mjs';\r\n\r\nfunction animateVariant(visualElement, variant, options = {}) {\r\n const resolved = resolveVariant(visualElement, variant, options.custom);\r\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\r\n if (options.transitionOverride) {\r\n transition = options.transitionOverride;\r\n }\r\n /**\r\n * If we have a variant, create a callback that runs it as an animation.\r\n * Otherwise, we resolve a Promise immediately for a composable no-op.\r\n */\r\n const getAnimation = resolved\r\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\r\n : () => Promise.resolve();\r\n /**\r\n * If we have children, create a callback that runs all their animations.\r\n * Otherwise, we resolve a Promise immediately for a composable no-op.\r\n */\r\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\r\n ? (forwardDelay = 0) => {\r\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\r\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\r\n }\r\n : () => Promise.resolve();\r\n /**\r\n * If the transition explicitly defines a \"when\" option, we need to resolve either\r\n * this animation or all children animations before playing the other.\r\n */\r\n const { when } = transition;\r\n if (when) {\r\n const [first, last] = when === \"beforeChildren\"\r\n ? [getAnimation, getChildAnimations]\r\n : [getChildAnimations, getAnimation];\r\n return first().then(() => last());\r\n }\r\n else {\r\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\r\n }\r\n}\r\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\r\n const animations = [];\r\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\r\n const generateStaggerDuration = staggerDirection === 1\r\n ? (i = 0) => i * staggerChildren\r\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\r\n Array.from(visualElement.variantChildren)\r\n .sort(sortByTreeOrder)\r\n .forEach((child, i) => {\r\n child.notify(\"AnimationStart\", variant);\r\n animations.push(animateVariant(child, variant, {\r\n ...options,\r\n delay: delayChildren + generateStaggerDuration(i),\r\n }).then(() => child.notify(\"AnimationComplete\", variant)));\r\n });\r\n return Promise.all(animations);\r\n}\r\nfunction sortByTreeOrder(a, b) {\r\n return a.sortNodePosition(b);\r\n}\r\n\r\nexport { animateVariant, sortByTreeOrder };\r\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\r\nimport { animateTarget } from './visual-element-target.mjs';\r\nimport { animateVariant } from './visual-element-variant.mjs';\r\n\r\nfunction animateVisualElement(visualElement, definition, options = {}) {\r\n visualElement.notify(\"AnimationStart\", definition);\r\n let animation;\r\n if (Array.isArray(definition)) {\r\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\r\n animation = Promise.all(animations);\r\n }\r\n else if (typeof definition === \"string\") {\r\n animation = animateVariant(visualElement, definition, options);\r\n }\r\n else {\r\n const resolvedDefinition = typeof definition === \"function\"\r\n ? resolveVariant(visualElement, definition, options.custom)\r\n : definition;\r\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\r\n }\r\n return animation.then(() => visualElement.notify(\"AnimationComplete\", definition));\r\n}\r\n\r\nexport { animateVisualElement };\r\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\r\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\r\nimport { shallowCompare } from '../../utils/shallow-compare.mjs';\r\nimport { isVariantLabel } from './is-variant-label.mjs';\r\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\r\nimport { variantPriorityOrder } from './variant-props.mjs';\r\nimport { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\r\n\r\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\r\nconst numAnimationTypes = variantPriorityOrder.length;\r\nfunction animateList(visualElement) {\r\n return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\r\n}\r\nfunction createAnimationState(visualElement) {\r\n let animate = animateList(visualElement);\r\n const state = createState();\r\n let isInitialRender = true;\r\n /**\r\n * This function will be used to reduce the animation definitions for\r\n * each active animation type into an object of resolved values for it.\r\n */\r\n const buildResolvedTypeValues = (acc, definition) => {\r\n const resolved = resolveVariant(visualElement, definition);\r\n if (resolved) {\r\n const { transition, transitionEnd, ...target } = resolved;\r\n acc = { ...acc, ...target, ...transitionEnd };\r\n }\r\n return acc;\r\n };\r\n /**\r\n * This just allows us to inject mocked animation functions\r\n * @internal\r\n */\r\n function setAnimateFunction(makeAnimator) {\r\n animate = makeAnimator(visualElement);\r\n }\r\n /**\r\n * When we receive new props, we need to:\r\n * 1. Create a list of protected keys for each type. This is a directory of\r\n * value keys that are currently being \"handled\" by types of a higher priority\r\n * so that whenever an animation is played of a given type, these values are\r\n * protected from being animated.\r\n * 2. Determine if an animation type needs animating.\r\n * 3. Determine if any values have been removed from a type and figure out\r\n * what to animate those to.\r\n */\r\n function animateChanges(options, changedActiveType) {\r\n const props = visualElement.getProps();\r\n const context = visualElement.getVariantContext(true) || {};\r\n /**\r\n * A list of animations that we'll build into as we iterate through the animation\r\n * types. This will get executed at the end of the function.\r\n */\r\n const animations = [];\r\n /**\r\n * Keep track of which values have been removed. Then, as we hit lower priority\r\n * animation types, we can check if they contain removed values and animate to that.\r\n */\r\n const removedKeys = new Set();\r\n /**\r\n * A dictionary of all encountered keys. This is an object to let us build into and\r\n * copy it without iteration. Each time we hit an animation type we set its protected\r\n * keys - the keys its not allowed to animate - to the latest version of this object.\r\n */\r\n let encounteredKeys = {};\r\n /**\r\n * If a variant has been removed at a given index, and this component is controlling\r\n * variant animations, we want to ensure lower-priority variants are forced to animate.\r\n */\r\n let removedVariantIndex = Infinity;\r\n /**\r\n * Iterate through all animation types in reverse priority order. For each, we want to\r\n * detect which values it's handling and whether or not they've changed (and therefore\r\n * need to be animated). If any values have been removed, we want to detect those in\r\n * lower priority props and flag for animation.\r\n */\r\n for (let i = 0; i < numAnimationTypes; i++) {\r\n const type = reversePriorityOrder[i];\r\n const typeState = state[type];\r\n const prop = props[type] !== undefined ? props[type] : context[type];\r\n const propIsVariant = isVariantLabel(prop);\r\n /**\r\n * If this type has *just* changed isActive status, set activeDelta\r\n * to that status. Otherwise set to null.\r\n */\r\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\r\n if (activeDelta === false)\r\n removedVariantIndex = i;\r\n /**\r\n * If this prop is an inherited variant, rather than been set directly on the\r\n * component itself, we want to make sure we allow the parent to trigger animations.\r\n *\r\n * TODO: Can probably change this to a !isControllingVariants check\r\n */\r\n let isInherited = prop === context[type] && prop !== props[type] && propIsVariant;\r\n /**\r\n *\r\n */\r\n if (isInherited &&\r\n isInitialRender &&\r\n visualElement.manuallyAnimateOnMount) {\r\n isInherited = false;\r\n }\r\n /**\r\n * Set all encountered keys so far as the protected keys for this type. This will\r\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\r\n */\r\n typeState.protectedKeys = { ...encounteredKeys };\r\n // Check if we can skip analysing this prop early\r\n if (\r\n // If it isn't active and hasn't *just* been set as inactive\r\n (!typeState.isActive && activeDelta === null) ||\r\n // If we didn't and don't have any defined prop for this animation type\r\n (!prop && !typeState.prevProp) ||\r\n // Or if the prop doesn't define an animation\r\n isAnimationControls(prop) ||\r\n typeof prop === \"boolean\") {\r\n continue;\r\n }\r\n /**\r\n * As we go look through the values defined on this type, if we detect\r\n * a changed value or a value that was removed in a higher priority, we set\r\n * this to true and add this prop to the animation list.\r\n */\r\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\r\n let shouldAnimateType = variantDidChange ||\r\n // If we're making this variant active, we want to always make it active\r\n (type === changedActiveType &&\r\n typeState.isActive &&\r\n !isInherited &&\r\n propIsVariant) ||\r\n // If we removed a higher-priority variant (i is in reverse order)\r\n (i > removedVariantIndex && propIsVariant);\r\n let handledRemovedValues = false;\r\n /**\r\n * As animations can be set as variant lists, variants or target objects, we\r\n * coerce everything to an array if it isn't one already\r\n */\r\n const definitionList = Array.isArray(prop) ? prop : [prop];\r\n /**\r\n * Build an object of all the resolved values. We'll use this in the subsequent\r\n * animateChanges calls to determine whether a value has changed.\r\n */\r\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});\r\n if (activeDelta === false)\r\n resolvedValues = {};\r\n /**\r\n * Now we need to loop through all the keys in the prev prop and this prop,\r\n * and decide:\r\n * 1. If the value has changed, and needs animating\r\n * 2. If it has been removed, and needs adding to the removedKeys set\r\n * 3. If it has been removed in a higher priority type and needs animating\r\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\r\n * needs adding to the type's protectedKeys list.\r\n */\r\n const { prevResolvedValues = {} } = typeState;\r\n const allKeys = {\r\n ...prevResolvedValues,\r\n ...resolvedValues,\r\n };\r\n const markToAnimate = (key) => {\r\n shouldAnimateType = true;\r\n if (removedKeys.has(key)) {\r\n handledRemovedValues = true;\r\n removedKeys.delete(key);\r\n }\r\n typeState.needsAnimating[key] = true;\r\n };\r\n for (const key in allKeys) {\r\n const next = resolvedValues[key];\r\n const prev = prevResolvedValues[key];\r\n // If we've already handled this we can just skip ahead\r\n if (encounteredKeys.hasOwnProperty(key))\r\n continue;\r\n /**\r\n * If the value has changed, we probably want to animate it.\r\n */\r\n let valueHasChanged = false;\r\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\r\n valueHasChanged = !shallowCompare(next, prev);\r\n }\r\n else {\r\n valueHasChanged = next !== prev;\r\n }\r\n if (valueHasChanged) {\r\n if (next !== undefined) {\r\n // If next is defined and doesn't equal prev, it needs animating\r\n markToAnimate(key);\r\n }\r\n else {\r\n // If it's undefined, it's been removed.\r\n removedKeys.add(key);\r\n }\r\n }\r\n else if (next !== undefined && removedKeys.has(key)) {\r\n /**\r\n * If next hasn't changed and it isn't undefined, we want to check if it's\r\n * been removed by a higher priority\r\n */\r\n markToAnimate(key);\r\n }\r\n else {\r\n /**\r\n * If it hasn't changed, we add it to the list of protected values\r\n * to ensure it doesn't get animated.\r\n */\r\n typeState.protectedKeys[key] = true;\r\n }\r\n }\r\n /**\r\n * Update the typeState so next time animateChanges is called we can compare the\r\n * latest prop and resolvedValues to these.\r\n */\r\n typeState.prevProp = prop;\r\n typeState.prevResolvedValues = resolvedValues;\r\n /**\r\n *\r\n */\r\n if (typeState.isActive) {\r\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\r\n }\r\n if (isInitialRender && visualElement.blockInitialAnimation) {\r\n shouldAnimateType = false;\r\n }\r\n /**\r\n * If this is an inherited prop we want to hard-block animations\r\n */\r\n if (shouldAnimateType && (!isInherited || handledRemovedValues)) {\r\n animations.push(...definitionList.map((animation) => ({\r\n animation: animation,\r\n options: { type, ...options },\r\n })));\r\n }\r\n }\r\n /**\r\n * If there are some removed value that haven't been dealt with,\r\n * we need to create a new animation that falls back either to the value\r\n * defined in the style prop, or the last read value.\r\n */\r\n if (removedKeys.size) {\r\n const fallbackAnimation = {};\r\n removedKeys.forEach((key) => {\r\n const fallbackTarget = visualElement.getBaseTarget(key);\r\n if (fallbackTarget !== undefined) {\r\n fallbackAnimation[key] = fallbackTarget;\r\n }\r\n });\r\n animations.push({ animation: fallbackAnimation });\r\n }\r\n let shouldAnimate = Boolean(animations.length);\r\n if (isInitialRender &&\r\n (props.initial === false || props.initial === props.animate) &&\r\n !visualElement.manuallyAnimateOnMount) {\r\n shouldAnimate = false;\r\n }\r\n isInitialRender = false;\r\n return shouldAnimate ? animate(animations) : Promise.resolve();\r\n }\r\n /**\r\n * Change whether a certain animation type is active.\r\n */\r\n function setActive(type, isActive, options) {\r\n var _a;\r\n // If the active state hasn't changed, we can safely do nothing here\r\n if (state[type].isActive === isActive)\r\n return Promise.resolve();\r\n // Propagate active change to children\r\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });\r\n state[type].isActive = isActive;\r\n const animations = animateChanges(options, type);\r\n for (const key in state) {\r\n state[key].protectedKeys = {};\r\n }\r\n return animations;\r\n }\r\n return {\r\n animateChanges,\r\n setActive,\r\n setAnimateFunction,\r\n getState: () => state,\r\n };\r\n}\r\nfunction checkVariantsDidChange(prev, next) {\r\n if (typeof next === \"string\") {\r\n return next !== prev;\r\n }\r\n else if (Array.isArray(next)) {\r\n return !shallowCompare(next, prev);\r\n }\r\n return false;\r\n}\r\nfunction createTypeState(isActive = false) {\r\n return {\r\n isActive,\r\n protectedKeys: {},\r\n needsAnimating: {},\r\n prevResolvedValues: {},\r\n };\r\n}\r\nfunction createState() {\r\n return {\r\n animate: createTypeState(true),\r\n whileInView: createTypeState(),\r\n whileHover: createTypeState(),\r\n whileTap: createTypeState(),\r\n whileDrag: createTypeState(),\r\n whileFocus: createTypeState(),\r\n exit: createTypeState(),\r\n };\r\n}\r\n\r\nexport { checkVariantsDidChange, createAnimationState };\r\n","import { isAnimationControls } from '../../../animation/utils/is-animation-controls.mjs';\r\nimport { createAnimationState } from '../../../render/utils/animation-state.mjs';\r\nimport { Feature } from '../Feature.mjs';\r\n\r\nclass AnimationFeature extends Feature {\r\n /**\r\n * We dynamically generate the AnimationState manager as it contains a reference\r\n * to the underlying animation library. We only want to load that if we load this,\r\n * so people can optionally code split it out using the `m` component.\r\n */\r\n constructor(node) {\r\n super(node);\r\n node.animationState || (node.animationState = createAnimationState(node));\r\n }\r\n updateAnimationControlsSubscription() {\r\n const { animate } = this.node.getProps();\r\n this.unmount();\r\n if (isAnimationControls(animate)) {\r\n this.unmount = animate.subscribe(this.node);\r\n }\r\n }\r\n /**\r\n * Subscribe any provided AnimationControls to the component's VisualElement\r\n */\r\n mount() {\r\n this.updateAnimationControlsSubscription();\r\n }\r\n update() {\r\n const { animate } = this.node.getProps();\r\n const { animate: prevAnimate } = this.node.prevProps || {};\r\n if (animate !== prevAnimate) {\r\n this.updateAnimationControlsSubscription();\r\n }\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { AnimationFeature };\r\n","import { Feature } from '../Feature.mjs';\r\n\r\nlet id = 0;\r\nclass ExitAnimationFeature extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.id = id++;\r\n }\r\n update() {\r\n if (!this.node.presenceContext)\r\n return;\r\n const { isPresent, onExitComplete, custom } = this.node.presenceContext;\r\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\r\n if (!this.node.animationState || isPresent === prevIsPresent) {\r\n return;\r\n }\r\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent, { custom: custom !== null && custom !== void 0 ? custom : this.node.getProps().custom });\r\n if (onExitComplete && !isPresent) {\r\n exitAnimation.then(() => onExitComplete(this.id));\r\n }\r\n }\r\n mount() {\r\n const { register } = this.node.presenceContext || {};\r\n if (register) {\r\n this.unmount = register(this.id);\r\n }\r\n }\r\n unmount() { }\r\n}\r\n\r\nexport { ExitAnimationFeature };\r\n","import { AnimationFeature } from './animation/index.mjs';\r\nimport { ExitAnimationFeature } from './animation/exit.mjs';\r\n\r\nconst animations = {\r\n animation: {\r\n Feature: AnimationFeature,\r\n },\r\n exit: {\r\n Feature: ExitAnimationFeature,\r\n },\r\n};\r\n\r\nexport { animations };\r\n","const distance = (a, b) => Math.abs(a - b);\r\nfunction distance2D(a, b) {\r\n // Multi-dimensional\r\n const xDelta = distance(a.x, b.x);\r\n const yDelta = distance(a.y, b.y);\r\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\r\n}\r\n\r\nexport { distance, distance2D };\r\n","import { extractEventInfo } from '../../events/event-info.mjs';\r\nimport { secondsToMilliseconds, millisecondsToSeconds } from '../../utils/time-conversion.mjs';\r\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\r\nimport { pipe } from '../../utils/pipe.mjs';\r\nimport { distance2D } from '../../utils/distance.mjs';\r\nimport { isPrimaryPointer } from '../../events/utils/is-primary-pointer.mjs';\r\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\r\n\r\n/**\r\n * @internal\r\n */\r\nclass PanSession {\r\n constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) {\r\n /**\r\n * @internal\r\n */\r\n this.startEvent = null;\r\n /**\r\n * @internal\r\n */\r\n this.lastMoveEvent = null;\r\n /**\r\n * @internal\r\n */\r\n this.lastMoveEventInfo = null;\r\n /**\r\n * @internal\r\n */\r\n this.handlers = {};\r\n /**\r\n * @internal\r\n */\r\n this.contextWindow = window;\r\n this.updatePoint = () => {\r\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\r\n return;\r\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\r\n const isPanStarted = this.startEvent !== null;\r\n // Only start panning if the offset is larger than 3 pixels. If we make it\r\n // any larger than this we'll want to reset the pointer history\r\n // on the first update to avoid visual snapping to the cursoe.\r\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;\r\n if (!isPanStarted && !isDistancePastThreshold)\r\n return;\r\n const { point } = info;\r\n const { timestamp } = frameData;\r\n this.history.push({ ...point, timestamp });\r\n const { onStart, onMove } = this.handlers;\r\n if (!isPanStarted) {\r\n onStart && onStart(this.lastMoveEvent, info);\r\n this.startEvent = this.lastMoveEvent;\r\n }\r\n onMove && onMove(this.lastMoveEvent, info);\r\n };\r\n this.handlePointerMove = (event, info) => {\r\n this.lastMoveEvent = event;\r\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\r\n // Throttle mouse move event to once per frame\r\n frame.update(this.updatePoint, true);\r\n };\r\n this.handlePointerUp = (event, info) => {\r\n this.end();\r\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\r\n if (this.dragSnapToOrigin)\r\n resumeAnimation && resumeAnimation();\r\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\r\n return;\r\n const panInfo = getPanInfo(event.type === \"pointercancel\"\r\n ? this.lastMoveEventInfo\r\n : transformPoint(info, this.transformPagePoint), this.history);\r\n if (this.startEvent && onEnd) {\r\n onEnd(event, panInfo);\r\n }\r\n onSessionEnd && onSessionEnd(event, panInfo);\r\n };\r\n // If we have more than one touch, don't start detecting this gesture\r\n if (!isPrimaryPointer(event))\r\n return;\r\n this.dragSnapToOrigin = dragSnapToOrigin;\r\n this.handlers = handlers;\r\n this.transformPagePoint = transformPagePoint;\r\n this.contextWindow = contextWindow || window;\r\n const info = extractEventInfo(event);\r\n const initialInfo = transformPoint(info, this.transformPagePoint);\r\n const { point } = initialInfo;\r\n const { timestamp } = frameData;\r\n this.history = [{ ...point, timestamp }];\r\n const { onSessionStart } = handlers;\r\n onSessionStart &&\r\n onSessionStart(event, getPanInfo(initialInfo, this.history));\r\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\r\n }\r\n updateHandlers(handlers) {\r\n this.handlers = handlers;\r\n }\r\n end() {\r\n this.removeListeners && this.removeListeners();\r\n cancelFrame(this.updatePoint);\r\n }\r\n}\r\nfunction transformPoint(info, transformPagePoint) {\r\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\r\n}\r\nfunction subtractPoint(a, b) {\r\n return { x: a.x - b.x, y: a.y - b.y };\r\n}\r\nfunction getPanInfo({ point }, history) {\r\n return {\r\n point,\r\n delta: subtractPoint(point, lastDevicePoint(history)),\r\n offset: subtractPoint(point, startDevicePoint(history)),\r\n velocity: getVelocity(history, 0.1),\r\n };\r\n}\r\nfunction startDevicePoint(history) {\r\n return history[0];\r\n}\r\nfunction lastDevicePoint(history) {\r\n return history[history.length - 1];\r\n}\r\nfunction getVelocity(history, timeDelta) {\r\n if (history.length < 2) {\r\n return { x: 0, y: 0 };\r\n }\r\n let i = history.length - 1;\r\n let timestampedPoint = null;\r\n const lastPoint = lastDevicePoint(history);\r\n while (i >= 0) {\r\n timestampedPoint = history[i];\r\n if (lastPoint.timestamp - timestampedPoint.timestamp >\r\n secondsToMilliseconds(timeDelta)) {\r\n break;\r\n }\r\n i--;\r\n }\r\n if (!timestampedPoint) {\r\n return { x: 0, y: 0 };\r\n }\r\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\r\n if (time === 0) {\r\n return { x: 0, y: 0 };\r\n }\r\n const currentVelocity = {\r\n x: (lastPoint.x - timestampedPoint.x) / time,\r\n y: (lastPoint.y - timestampedPoint.y) / time,\r\n };\r\n if (currentVelocity.x === Infinity) {\r\n currentVelocity.x = 0;\r\n }\r\n if (currentVelocity.y === Infinity) {\r\n currentVelocity.y = 0;\r\n }\r\n return currentVelocity;\r\n}\r\n\r\nexport { PanSession };\r\n","import { mix } from '../../utils/mix.mjs';\r\n\r\nfunction calcLength(axis) {\r\n return axis.max - axis.min;\r\n}\r\nfunction isNear(value, target = 0, maxDistance = 0.01) {\r\n return Math.abs(value - target) <= maxDistance;\r\n}\r\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\r\n delta.origin = origin;\r\n delta.originPoint = mix(source.min, source.max, delta.origin);\r\n delta.scale = calcLength(target) / calcLength(source);\r\n if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale))\r\n delta.scale = 1;\r\n delta.translate =\r\n mix(target.min, target.max, delta.origin) - delta.originPoint;\r\n if (isNear(delta.translate) || isNaN(delta.translate))\r\n delta.translate = 0;\r\n}\r\nfunction calcBoxDelta(delta, source, target, origin) {\r\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\r\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\r\n}\r\nfunction calcRelativeAxis(target, relative, parent) {\r\n target.min = parent.min + relative.min;\r\n target.max = target.min + calcLength(relative);\r\n}\r\nfunction calcRelativeBox(target, relative, parent) {\r\n calcRelativeAxis(target.x, relative.x, parent.x);\r\n calcRelativeAxis(target.y, relative.y, parent.y);\r\n}\r\nfunction calcRelativeAxisPosition(target, layout, parent) {\r\n target.min = layout.min - parent.min;\r\n target.max = target.min + calcLength(layout);\r\n}\r\nfunction calcRelativePosition(target, layout, parent) {\r\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\r\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\r\n}\r\n\r\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\r\n","import { progress } from '../../../utils/progress.mjs';\r\nimport { calcLength } from '../../../projection/geometry/delta-calc.mjs';\r\nimport { clamp } from '../../../utils/clamp.mjs';\r\nimport { mix } from '../../../utils/mix.mjs';\r\n\r\n/**\r\n * Apply constraints to a point. These constraints are both physical along an\r\n * axis, and an elastic factor that determines how much to constrain the point\r\n * by if it does lie outside the defined parameters.\r\n */\r\nfunction applyConstraints(point, { min, max }, elastic) {\r\n if (min !== undefined && point < min) {\r\n // If we have a min point defined, and this is outside of that, constrain\r\n point = elastic ? mix(min, point, elastic.min) : Math.max(point, min);\r\n }\r\n else if (max !== undefined && point > max) {\r\n // If we have a max point defined, and this is outside of that, constrain\r\n point = elastic ? mix(max, point, elastic.max) : Math.min(point, max);\r\n }\r\n return point;\r\n}\r\n/**\r\n * Calculate constraints in terms of the viewport when defined relatively to the\r\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\r\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\r\n */\r\nfunction calcRelativeAxisConstraints(axis, min, max) {\r\n return {\r\n min: min !== undefined ? axis.min + min : undefined,\r\n max: max !== undefined\r\n ? axis.max + max - (axis.max - axis.min)\r\n : undefined,\r\n };\r\n}\r\n/**\r\n * Calculate constraints in terms of the viewport when\r\n * defined relatively to the measured bounding box.\r\n */\r\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\r\n return {\r\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\r\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\r\n };\r\n}\r\n/**\r\n * Calculate viewport constraints when defined as another viewport-relative axis\r\n */\r\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\r\n let min = constraintsAxis.min - layoutAxis.min;\r\n let max = constraintsAxis.max - layoutAxis.max;\r\n // If the constraints axis is actually smaller than the layout axis then we can\r\n // flip the constraints\r\n if (constraintsAxis.max - constraintsAxis.min <\r\n layoutAxis.max - layoutAxis.min) {\r\n [min, max] = [max, min];\r\n }\r\n return { min, max };\r\n}\r\n/**\r\n * Calculate viewport constraints when defined as another viewport-relative box\r\n */\r\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\r\n return {\r\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\r\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\r\n };\r\n}\r\n/**\r\n * Calculate a transform origin relative to the source axis, between 0-1, that results\r\n * in an asthetically pleasing scale/transform needed to project from source to target.\r\n */\r\nfunction calcOrigin(source, target) {\r\n let origin = 0.5;\r\n const sourceLength = calcLength(source);\r\n const targetLength = calcLength(target);\r\n if (targetLength > sourceLength) {\r\n origin = progress(target.min, target.max - sourceLength, source.min);\r\n }\r\n else if (sourceLength > targetLength) {\r\n origin = progress(source.min, source.max - targetLength, target.min);\r\n }\r\n return clamp(0, 1, origin);\r\n}\r\n/**\r\n * Rebase the calculated viewport constraints relative to the layout.min point.\r\n */\r\nfunction rebaseAxisConstraints(layout, constraints) {\r\n const relativeConstraints = {};\r\n if (constraints.min !== undefined) {\r\n relativeConstraints.min = constraints.min - layout.min;\r\n }\r\n if (constraints.max !== undefined) {\r\n relativeConstraints.max = constraints.max - layout.min;\r\n }\r\n return relativeConstraints;\r\n}\r\nconst defaultElastic = 0.35;\r\n/**\r\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\r\n */\r\nfunction resolveDragElastic(dragElastic = defaultElastic) {\r\n if (dragElastic === false) {\r\n dragElastic = 0;\r\n }\r\n else if (dragElastic === true) {\r\n dragElastic = defaultElastic;\r\n }\r\n return {\r\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\r\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\r\n };\r\n}\r\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\r\n return {\r\n min: resolvePointElastic(dragElastic, minLabel),\r\n max: resolvePointElastic(dragElastic, maxLabel),\r\n };\r\n}\r\nfunction resolvePointElastic(dragElastic, label) {\r\n return typeof dragElastic === \"number\"\r\n ? dragElastic\r\n : dragElastic[label] || 0;\r\n}\r\n\r\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\r\n","const createAxisDelta = () => ({\r\n translate: 0,\r\n scale: 1,\r\n origin: 0,\r\n originPoint: 0,\r\n});\r\nconst createDelta = () => ({\r\n x: createAxisDelta(),\r\n y: createAxisDelta(),\r\n});\r\nconst createAxis = () => ({ min: 0, max: 0 });\r\nconst createBox = () => ({\r\n x: createAxis(),\r\n y: createAxis(),\r\n});\r\n\r\nexport { createAxis, createAxisDelta, createBox, createDelta };\r\n","function eachAxis(callback) {\r\n return [callback(\"x\"), callback(\"y\")];\r\n}\r\n\r\nexport { eachAxis };\r\n","/**\r\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\r\n * it's easier to consider each axis individually. This function returns a bounding box\r\n * as a map of single-axis min/max values.\r\n */\r\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\r\n return {\r\n x: { min: left, max: right },\r\n y: { min: top, max: bottom },\r\n };\r\n}\r\nfunction convertBoxToBoundingBox({ x, y }) {\r\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\r\n}\r\n/**\r\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\r\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\r\n * when measuring DOM elements and DOM event points.\r\n */\r\nfunction transformBoxPoints(point, transformPoint) {\r\n if (!transformPoint)\r\n return point;\r\n const topLeft = transformPoint({ x: point.left, y: point.top });\r\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\r\n return {\r\n top: topLeft.y,\r\n left: topLeft.x,\r\n bottom: bottomRight.y,\r\n right: bottomRight.x,\r\n };\r\n}\r\n\r\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\r\n","function isIdentityScale(scale) {\r\n return scale === undefined || scale === 1;\r\n}\r\nfunction hasScale({ scale, scaleX, scaleY }) {\r\n return (!isIdentityScale(scale) ||\r\n !isIdentityScale(scaleX) ||\r\n !isIdentityScale(scaleY));\r\n}\r\nfunction hasTransform(values) {\r\n return (hasScale(values) ||\r\n has2DTranslate(values) ||\r\n values.z ||\r\n values.rotate ||\r\n values.rotateX ||\r\n values.rotateY);\r\n}\r\nfunction has2DTranslate(values) {\r\n return is2DTranslate(values.x) || is2DTranslate(values.y);\r\n}\r\nfunction is2DTranslate(value) {\r\n return value && value !== \"0%\";\r\n}\r\n\r\nexport { has2DTranslate, hasScale, hasTransform };\r\n","import { mix } from '../../utils/mix.mjs';\r\nimport { hasTransform } from '../utils/has-transform.mjs';\r\n\r\n/**\r\n * Scales a point based on a factor and an originPoint\r\n */\r\nfunction scalePoint(point, scale, originPoint) {\r\n const distanceFromOrigin = point - originPoint;\r\n const scaled = scale * distanceFromOrigin;\r\n return originPoint + scaled;\r\n}\r\n/**\r\n * Applies a translate/scale delta to a point\r\n */\r\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\r\n if (boxScale !== undefined) {\r\n point = scalePoint(point, boxScale, originPoint);\r\n }\r\n return scalePoint(point, scale, originPoint) + translate;\r\n}\r\n/**\r\n * Applies a translate/scale delta to an axis\r\n */\r\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\r\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\r\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\r\n}\r\n/**\r\n * Applies a translate/scale delta to a box\r\n */\r\nfunction applyBoxDelta(box, { x, y }) {\r\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\r\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\r\n}\r\n/**\r\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\r\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\r\n *\r\n * This is the final nested loop within updateLayoutDelta for future refactoring\r\n */\r\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\r\n const treeLength = treePath.length;\r\n if (!treeLength)\r\n return;\r\n // Reset the treeScale\r\n treeScale.x = treeScale.y = 1;\r\n let node;\r\n let delta;\r\n for (let i = 0; i < treeLength; i++) {\r\n node = treePath[i];\r\n delta = node.projectionDelta;\r\n /**\r\n * TODO: Prefer to remove this, but currently we have motion components with\r\n * display: contents in Framer.\r\n */\r\n const instance = node.instance;\r\n if (instance &&\r\n instance.style &&\r\n instance.style.display === \"contents\") {\r\n continue;\r\n }\r\n if (isSharedTransition &&\r\n node.options.layoutScroll &&\r\n node.scroll &&\r\n node !== node.root) {\r\n transformBox(box, {\r\n x: -node.scroll.offset.x,\r\n y: -node.scroll.offset.y,\r\n });\r\n }\r\n if (delta) {\r\n // Incoporate each ancestor's scale into a culmulative treeScale for this component\r\n treeScale.x *= delta.x.scale;\r\n treeScale.y *= delta.y.scale;\r\n // Apply each ancestor's calculated delta into this component's recorded layout box\r\n applyBoxDelta(box, delta);\r\n }\r\n if (isSharedTransition && hasTransform(node.latestValues)) {\r\n transformBox(box, node.latestValues);\r\n }\r\n }\r\n /**\r\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\r\n * This will help reduce useless scales getting rendered.\r\n */\r\n treeScale.x = snapToDefault(treeScale.x);\r\n treeScale.y = snapToDefault(treeScale.y);\r\n}\r\nfunction snapToDefault(scale) {\r\n if (Number.isInteger(scale))\r\n return scale;\r\n return scale > 1.0000000000001 || scale < 0.999999999999 ? scale : 1;\r\n}\r\nfunction translateAxis(axis, distance) {\r\n axis.min = axis.min + distance;\r\n axis.max = axis.max + distance;\r\n}\r\n/**\r\n * Apply a transform to an axis from the latest resolved motion values.\r\n * This function basically acts as a bridge between a flat motion value map\r\n * and applyAxisDelta\r\n */\r\nfunction transformAxis(axis, transforms, [key, scaleKey, originKey]) {\r\n const axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5;\r\n const originPoint = mix(axis.min, axis.max, axisOrigin);\r\n // Apply the axis delta to the final axis\r\n applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale);\r\n}\r\n/**\r\n * The names of the motion values we want to apply as translation, scale and origin.\r\n */\r\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\r\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\r\n/**\r\n * Apply a transform to a box from the latest resolved motion values.\r\n */\r\nfunction transformBox(box, transform) {\r\n transformAxis(box.x, transform, xKeys);\r\n transformAxis(box.y, transform, yKeys);\r\n}\r\n\r\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\r\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\r\nimport { translateAxis } from '../geometry/delta-apply.mjs';\r\n\r\nfunction measureViewportBox(instance, transformPoint) {\r\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\r\n}\r\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\r\n const viewportBox = measureViewportBox(element, transformPagePoint);\r\n const { scroll } = rootProjectionNode;\r\n if (scroll) {\r\n translateAxis(viewportBox.x, scroll.offset.x);\r\n translateAxis(viewportBox.y, scroll.offset.y);\r\n }\r\n return viewportBox;\r\n}\r\n\r\nexport { measurePageBox, measureViewportBox };\r\n","// Fixes https://github.com/framer/motion/issues/2270\r\nconst getContextWindow = ({ current }) => {\r\n return current ? current.ownerDocument.defaultView : null;\r\n};\r\n\r\nexport { getContextWindow };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport { PanSession } from '../pan/PanSession.mjs';\r\nimport { getGlobalLock } from './utils/lock.mjs';\r\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\r\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\r\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, calcOrigin } from './utils/constraints.mjs';\r\nimport { createBox } from '../../projection/geometry/models.mjs';\r\nimport { eachAxis } from '../../projection/utils/each-axis.mjs';\r\nimport { measurePageBox } from '../../projection/utils/measure.mjs';\r\nimport { extractEventInfo } from '../../events/event-info.mjs';\r\nimport { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';\r\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\r\nimport { calcLength } from '../../projection/geometry/delta-calc.mjs';\r\nimport { mix } from '../../utils/mix.mjs';\r\nimport { percent } from '../../value/types/numbers/units.mjs';\r\nimport { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';\r\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\nconst elementDragControls = new WeakMap();\r\n/**\r\n *\r\n */\r\n// let latestPointerEvent: PointerEvent\r\nclass VisualElementDragControls {\r\n constructor(visualElement) {\r\n // This is a reference to the global drag gesture lock, ensuring only one component\r\n // can \"capture\" the drag of one or both axes.\r\n // TODO: Look into moving this into pansession?\r\n this.openGlobalLock = null;\r\n this.isDragging = false;\r\n this.currentDirection = null;\r\n this.originPoint = { x: 0, y: 0 };\r\n /**\r\n * The permitted boundaries of travel, in pixels.\r\n */\r\n this.constraints = false;\r\n this.hasMutatedConstraints = false;\r\n /**\r\n * The per-axis resolved elastic values.\r\n */\r\n this.elastic = createBox();\r\n this.visualElement = visualElement;\r\n }\r\n start(originEvent, { snapToCursor = false } = {}) {\r\n /**\r\n * Don't start dragging if this component is exiting\r\n */\r\n const { presenceContext } = this.visualElement;\r\n if (presenceContext && presenceContext.isPresent === false)\r\n return;\r\n const onSessionStart = (event) => {\r\n const { dragSnapToOrigin } = this.getProps();\r\n // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch\r\n // the component.\r\n dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();\r\n if (snapToCursor) {\r\n this.snapToCursor(extractEventInfo(event, \"page\").point);\r\n }\r\n };\r\n const onStart = (event, info) => {\r\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\r\n const { drag, dragPropagation, onDragStart } = this.getProps();\r\n if (drag && !dragPropagation) {\r\n if (this.openGlobalLock)\r\n this.openGlobalLock();\r\n this.openGlobalLock = getGlobalLock(drag);\r\n // If we don 't have the lock, don't start dragging\r\n if (!this.openGlobalLock)\r\n return;\r\n }\r\n this.isDragging = true;\r\n this.currentDirection = null;\r\n this.resolveConstraints();\r\n if (this.visualElement.projection) {\r\n this.visualElement.projection.isAnimationBlocked = true;\r\n this.visualElement.projection.target = undefined;\r\n }\r\n /**\r\n * Record gesture origin\r\n */\r\n eachAxis((axis) => {\r\n let current = this.getAxisMotionValue(axis).get() || 0;\r\n /**\r\n * If the MotionValue is a percentage value convert to px\r\n */\r\n if (percent.test(current)) {\r\n const { projection } = this.visualElement;\r\n if (projection && projection.layout) {\r\n const measuredAxis = projection.layout.layoutBox[axis];\r\n if (measuredAxis) {\r\n const length = calcLength(measuredAxis);\r\n current = length * (parseFloat(current) / 100);\r\n }\r\n }\r\n }\r\n this.originPoint[axis] = current;\r\n });\r\n // Fire onDragStart event\r\n if (onDragStart) {\r\n frame.update(() => onDragStart(event, info), false, true);\r\n }\r\n const { animationState } = this.visualElement;\r\n animationState && animationState.setActive(\"whileDrag\", true);\r\n };\r\n const onMove = (event, info) => {\r\n // latestPointerEvent = event\r\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\r\n // If we didn't successfully receive the gesture lock, early return.\r\n if (!dragPropagation && !this.openGlobalLock)\r\n return;\r\n const { offset } = info;\r\n // Attempt to detect drag direction if directionLock is true\r\n if (dragDirectionLock && this.currentDirection === null) {\r\n this.currentDirection = getCurrentDirection(offset);\r\n // If we've successfully set a direction, notify listener\r\n if (this.currentDirection !== null) {\r\n onDirectionLock && onDirectionLock(this.currentDirection);\r\n }\r\n return;\r\n }\r\n // Update each point with the latest position\r\n this.updateAxis(\"x\", info.point, offset);\r\n this.updateAxis(\"y\", info.point, offset);\r\n /**\r\n * Ideally we would leave the renderer to fire naturally at the end of\r\n * this frame but if the element is about to change layout as the result\r\n * of a re-render we want to ensure the browser can read the latest\r\n * bounding box to ensure the pointer and element don't fall out of sync.\r\n */\r\n this.visualElement.render();\r\n /**\r\n * This must fire after the render call as it might trigger a state\r\n * change which itself might trigger a layout update.\r\n */\r\n onDrag && onDrag(event, info);\r\n };\r\n const onSessionEnd = (event, info) => this.stop(event, info);\r\n const resumeAnimation = () => eachAxis((axis) => {\r\n var _a;\r\n return this.getAnimationState(axis) === \"paused\" &&\r\n ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());\r\n });\r\n const { dragSnapToOrigin } = this.getProps();\r\n this.panSession = new PanSession(originEvent, {\r\n onSessionStart,\r\n onStart,\r\n onMove,\r\n onSessionEnd,\r\n resumeAnimation,\r\n }, {\r\n transformPagePoint: this.visualElement.getTransformPagePoint(),\r\n dragSnapToOrigin,\r\n contextWindow: getContextWindow(this.visualElement),\r\n });\r\n }\r\n stop(event, info) {\r\n const isDragging = this.isDragging;\r\n this.cancel();\r\n if (!isDragging)\r\n return;\r\n const { velocity } = info;\r\n this.startAnimation(velocity);\r\n const { onDragEnd } = this.getProps();\r\n if (onDragEnd) {\r\n frame.update(() => onDragEnd(event, info));\r\n }\r\n }\r\n cancel() {\r\n this.isDragging = false;\r\n const { projection, animationState } = this.visualElement;\r\n if (projection) {\r\n projection.isAnimationBlocked = false;\r\n }\r\n this.panSession && this.panSession.end();\r\n this.panSession = undefined;\r\n const { dragPropagation } = this.getProps();\r\n if (!dragPropagation && this.openGlobalLock) {\r\n this.openGlobalLock();\r\n this.openGlobalLock = null;\r\n }\r\n animationState && animationState.setActive(\"whileDrag\", false);\r\n }\r\n updateAxis(axis, _point, offset) {\r\n const { drag } = this.getProps();\r\n // If we're not dragging this axis, do an early return.\r\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\r\n return;\r\n const axisValue = this.getAxisMotionValue(axis);\r\n let next = this.originPoint[axis] + offset[axis];\r\n // Apply constraints\r\n if (this.constraints && this.constraints[axis]) {\r\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\r\n }\r\n axisValue.set(next);\r\n }\r\n resolveConstraints() {\r\n var _a;\r\n const { dragConstraints, dragElastic } = this.getProps();\r\n const layout = this.visualElement.projection &&\r\n !this.visualElement.projection.layout\r\n ? this.visualElement.projection.measure(false)\r\n : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;\r\n const prevConstraints = this.constraints;\r\n if (dragConstraints && isRefObject(dragConstraints)) {\r\n if (!this.constraints) {\r\n this.constraints = this.resolveRefConstraints();\r\n }\r\n }\r\n else {\r\n if (dragConstraints && layout) {\r\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\r\n }\r\n else {\r\n this.constraints = false;\r\n }\r\n }\r\n this.elastic = resolveDragElastic(dragElastic);\r\n /**\r\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\r\n * from viewport-relative to component-relative.\r\n */\r\n if (prevConstraints !== this.constraints &&\r\n layout &&\r\n this.constraints &&\r\n !this.hasMutatedConstraints) {\r\n eachAxis((axis) => {\r\n if (this.getAxisMotionValue(axis)) {\r\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\r\n }\r\n });\r\n }\r\n }\r\n resolveRefConstraints() {\r\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\r\n if (!constraints || !isRefObject(constraints))\r\n return false;\r\n const constraintsElement = constraints.current;\r\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\");\r\n const { projection } = this.visualElement;\r\n // TODO\r\n if (!projection || !projection.layout)\r\n return false;\r\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\r\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\r\n /**\r\n * If there's an onMeasureDragConstraints listener we call it and\r\n * if different constraints are returned, set constraints to that\r\n */\r\n if (onMeasureDragConstraints) {\r\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\r\n this.hasMutatedConstraints = !!userConstraints;\r\n if (userConstraints) {\r\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\r\n }\r\n }\r\n return measuredConstraints;\r\n }\r\n startAnimation(velocity) {\r\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\r\n const constraints = this.constraints || {};\r\n const momentumAnimations = eachAxis((axis) => {\r\n if (!shouldDrag(axis, drag, this.currentDirection)) {\r\n return;\r\n }\r\n let transition = (constraints && constraints[axis]) || {};\r\n if (dragSnapToOrigin)\r\n transition = { min: 0, max: 0 };\r\n /**\r\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\r\n * of spring animations so we should look into adding a disable spring option to `inertia`.\r\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\r\n * using the value of `dragElastic`.\r\n */\r\n const bounceStiffness = dragElastic ? 200 : 1000000;\r\n const bounceDamping = dragElastic ? 40 : 10000000;\r\n const inertia = {\r\n type: \"inertia\",\r\n velocity: dragMomentum ? velocity[axis] : 0,\r\n bounceStiffness,\r\n bounceDamping,\r\n timeConstant: 750,\r\n restDelta: 1,\r\n restSpeed: 10,\r\n ...dragTransition,\r\n ...transition,\r\n };\r\n // If we're not animating on an externally-provided `MotionValue` we can use the\r\n // component's animation controls which will handle interactions with whileHover (etc),\r\n // otherwise we just have to animate the `MotionValue` itself.\r\n return this.startAxisValueAnimation(axis, inertia);\r\n });\r\n // Run all animations and then resolve the new drag constraints.\r\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\r\n }\r\n startAxisValueAnimation(axis, transition) {\r\n const axisValue = this.getAxisMotionValue(axis);\r\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition));\r\n }\r\n stopAnimation() {\r\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\r\n }\r\n pauseAnimation() {\r\n eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });\r\n }\r\n getAnimationState(axis) {\r\n var _a;\r\n return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;\r\n }\r\n /**\r\n * Drag works differently depending on which props are provided.\r\n *\r\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\r\n * - Otherwise, we apply the delta to the x/y motion values.\r\n */\r\n getAxisMotionValue(axis) {\r\n const dragKey = \"_drag\" + axis.toUpperCase();\r\n const props = this.visualElement.getProps();\r\n const externalMotionValue = props[dragKey];\r\n return externalMotionValue\r\n ? externalMotionValue\r\n : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : undefined) || 0);\r\n }\r\n snapToCursor(point) {\r\n eachAxis((axis) => {\r\n const { drag } = this.getProps();\r\n // If we're not dragging this axis, do an early return.\r\n if (!shouldDrag(axis, drag, this.currentDirection))\r\n return;\r\n const { projection } = this.visualElement;\r\n const axisValue = this.getAxisMotionValue(axis);\r\n if (projection && projection.layout) {\r\n const { min, max } = projection.layout.layoutBox[axis];\r\n axisValue.set(point[axis] - mix(min, max, 0.5));\r\n }\r\n });\r\n }\r\n /**\r\n * When the viewport resizes we want to check if the measured constraints\r\n * have changed and, if so, reposition the element within those new constraints\r\n * relative to where it was before the resize.\r\n */\r\n scalePositionWithinConstraints() {\r\n if (!this.visualElement.current)\r\n return;\r\n const { drag, dragConstraints } = this.getProps();\r\n const { projection } = this.visualElement;\r\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\r\n return;\r\n /**\r\n * Stop current animations as there can be visual glitching if we try to do\r\n * this mid-animation\r\n */\r\n this.stopAnimation();\r\n /**\r\n * Record the relative position of the dragged element relative to the\r\n * constraints box and save as a progress value.\r\n */\r\n const boxProgress = { x: 0, y: 0 };\r\n eachAxis((axis) => {\r\n const axisValue = this.getAxisMotionValue(axis);\r\n if (axisValue) {\r\n const latest = axisValue.get();\r\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\r\n }\r\n });\r\n /**\r\n * Update the layout of this element and resolve the latest drag constraints\r\n */\r\n const { transformTemplate } = this.visualElement.getProps();\r\n this.visualElement.current.style.transform = transformTemplate\r\n ? transformTemplate({}, \"\")\r\n : \"none\";\r\n projection.root && projection.root.updateScroll();\r\n projection.updateLayout();\r\n this.resolveConstraints();\r\n /**\r\n * For each axis, calculate the current progress of the layout axis\r\n * within the new constraints.\r\n */\r\n eachAxis((axis) => {\r\n if (!shouldDrag(axis, drag, null))\r\n return;\r\n /**\r\n * Calculate a new transform based on the previous box progress\r\n */\r\n const axisValue = this.getAxisMotionValue(axis);\r\n const { min, max } = this.constraints[axis];\r\n axisValue.set(mix(min, max, boxProgress[axis]));\r\n });\r\n }\r\n addListeners() {\r\n if (!this.visualElement.current)\r\n return;\r\n elementDragControls.set(this.visualElement, this);\r\n const element = this.visualElement.current;\r\n /**\r\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\r\n */\r\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\r\n const { drag, dragListener = true } = this.getProps();\r\n drag && dragListener && this.start(event);\r\n });\r\n const measureDragConstraints = () => {\r\n const { dragConstraints } = this.getProps();\r\n if (isRefObject(dragConstraints)) {\r\n this.constraints = this.resolveRefConstraints();\r\n }\r\n };\r\n const { projection } = this.visualElement;\r\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\r\n if (projection && !projection.layout) {\r\n projection.root && projection.root.updateScroll();\r\n projection.updateLayout();\r\n }\r\n measureDragConstraints();\r\n /**\r\n * Attach a window resize listener to scale the draggable target within its defined\r\n * constraints as the window resizes.\r\n */\r\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\r\n /**\r\n * If the element's layout changes, calculate the delta and apply that to\r\n * the drag gesture's origin point.\r\n */\r\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\r\n if (this.isDragging && hasLayoutChanged) {\r\n eachAxis((axis) => {\r\n const motionValue = this.getAxisMotionValue(axis);\r\n if (!motionValue)\r\n return;\r\n this.originPoint[axis] += delta[axis].translate;\r\n motionValue.set(motionValue.get() + delta[axis].translate);\r\n });\r\n this.visualElement.render();\r\n }\r\n }));\r\n return () => {\r\n stopResizeListener();\r\n stopPointerListener();\r\n stopMeasureLayoutListener();\r\n stopLayoutUpdateListener && stopLayoutUpdateListener();\r\n };\r\n }\r\n getProps() {\r\n const props = this.visualElement.getProps();\r\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\r\n return {\r\n ...props,\r\n drag,\r\n dragDirectionLock,\r\n dragPropagation,\r\n dragConstraints,\r\n dragElastic,\r\n dragMomentum,\r\n };\r\n }\r\n}\r\nfunction shouldDrag(direction, drag, currentDirection) {\r\n return ((drag === true || drag === direction) &&\r\n (currentDirection === null || currentDirection === direction));\r\n}\r\n/**\r\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\r\n * than the provided threshold, return `null`.\r\n *\r\n * @param offset - The x/y offset from origin.\r\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\r\n */\r\nfunction getCurrentDirection(offset, lockThreshold = 10) {\r\n let direction = null;\r\n if (Math.abs(offset.y) > lockThreshold) {\r\n direction = \"y\";\r\n }\r\n else if (Math.abs(offset.x) > lockThreshold) {\r\n direction = \"x\";\r\n }\r\n return direction;\r\n}\r\n\r\nexport { VisualElementDragControls, elementDragControls };\r\n","import { Feature } from '../../motion/features/Feature.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { VisualElementDragControls } from './VisualElementDragControls.mjs';\r\n\r\nclass DragGesture extends Feature {\r\n constructor(node) {\r\n super(node);\r\n this.removeGroupControls = noop;\r\n this.removeListeners = noop;\r\n this.controls = new VisualElementDragControls(node);\r\n }\r\n mount() {\r\n // If we've been provided a DragControls for manual control over the drag gesture,\r\n // subscribe this component to it on mount.\r\n const { dragControls } = this.node.getProps();\r\n if (dragControls) {\r\n this.removeGroupControls = dragControls.subscribe(this.controls);\r\n }\r\n this.removeListeners = this.controls.addListeners() || noop;\r\n }\r\n unmount() {\r\n this.removeGroupControls();\r\n this.removeListeners();\r\n }\r\n}\r\n\r\nexport { DragGesture };\r\n","import { PanSession } from './PanSession.mjs';\r\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\r\nimport { Feature } from '../../motion/features/Feature.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\r\nimport { frame } from '../../frameloop/frame.mjs';\r\n\r\nconst asyncHandler = (handler) => (event, info) => {\r\n if (handler) {\r\n frame.update(() => handler(event, info));\r\n }\r\n};\r\nclass PanGesture extends Feature {\r\n constructor() {\r\n super(...arguments);\r\n this.removePointerDownListener = noop;\r\n }\r\n onPointerDown(pointerDownEvent) {\r\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\r\n transformPagePoint: this.node.getTransformPagePoint(),\r\n contextWindow: getContextWindow(this.node),\r\n });\r\n }\r\n createPanHandlers() {\r\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\r\n return {\r\n onSessionStart: asyncHandler(onPanSessionStart),\r\n onStart: asyncHandler(onPanStart),\r\n onMove: onPan,\r\n onEnd: (event, info) => {\r\n delete this.session;\r\n if (onPanEnd) {\r\n frame.update(() => onPanEnd(event, info));\r\n }\r\n },\r\n };\r\n }\r\n mount() {\r\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\r\n }\r\n update() {\r\n this.session && this.session.updateHandlers(this.createPanHandlers());\r\n }\r\n unmount() {\r\n this.removePointerDownListener();\r\n this.session && this.session.end();\r\n }\r\n}\r\n\r\nexport { PanGesture };\r\n","import { useContext, useId, useEffect } from 'react';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\n\r\n/**\r\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\r\n * to access information about whether it's still present in the React tree.\r\n *\r\n * ```jsx\r\n * import { usePresence } from \"framer-motion\"\r\n *\r\n * export const Component = () => {\r\n * const [isPresent, safeToRemove] = usePresence()\r\n *\r\n * useEffect(() => {\r\n * !isPresent && setTimeout(safeToRemove, 1000)\r\n * }, [isPresent])\r\n *\r\n * return
\r\n * }\r\n * ```\r\n *\r\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\r\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\r\n *\r\n * @public\r\n */\r\nfunction usePresence() {\r\n const context = useContext(PresenceContext);\r\n if (context === null)\r\n return [true, null];\r\n const { isPresent, onExitComplete, register } = context;\r\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\r\n // either be null or non-null for the lifespan of the component.\r\n const id = useId();\r\n useEffect(() => register(id), []);\r\n const safeToRemove = () => onExitComplete && onExitComplete(id);\r\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\r\n}\r\n/**\r\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\r\n * There is no `safeToRemove` function.\r\n *\r\n * ```jsx\r\n * import { useIsPresent } from \"framer-motion\"\r\n *\r\n * export const Component = () => {\r\n * const isPresent = useIsPresent()\r\n *\r\n * useEffect(() => {\r\n * !isPresent && console.log(\"I've been removed!\")\r\n * }, [isPresent])\r\n *\r\n * return
\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useIsPresent() {\r\n return isPresent(useContext(PresenceContext));\r\n}\r\nfunction isPresent(context) {\r\n return context === null ? true : context.isPresent;\r\n}\r\n\r\nexport { isPresent, useIsPresent, usePresence };\r\n","/**\r\n * This should only ever be modified on the client otherwise it'll\r\n * persist through server requests. If we need instanced states we\r\n * could lazy-init via root.\r\n */\r\nconst globalProjectionState = {\r\n /**\r\n * Global flag as to whether the tree has animated since the last time\r\n * we resized the window\r\n */\r\n hasAnimatedSinceResize: true,\r\n /**\r\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\r\n * update will be given a `data-projection-id` attribute.\r\n */\r\n hasEverUpdated: false,\r\n};\r\n\r\nexport { globalProjectionState };\r\n","import { px } from '../../value/types/numbers/units.mjs';\r\n\r\nfunction pixelsToPercent(pixels, axis) {\r\n if (axis.max === axis.min)\r\n return 0;\r\n return (pixels / (axis.max - axis.min)) * 100;\r\n}\r\n/**\r\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\r\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\r\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\r\n * borderRadius in both states. If we animate between the two in pixels that will trigger\r\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\r\n */\r\nconst correctBorderRadius = {\r\n correct: (latest, node) => {\r\n if (!node.target)\r\n return latest;\r\n /**\r\n * If latest is a string, if it's a percentage we can return immediately as it's\r\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\r\n */\r\n if (typeof latest === \"string\") {\r\n if (px.test(latest)) {\r\n latest = parseFloat(latest);\r\n }\r\n else {\r\n return latest;\r\n }\r\n }\r\n /**\r\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\r\n * pixel value as a percentage of each axis\r\n */\r\n const x = pixelsToPercent(latest, node.target.x);\r\n const y = pixelsToPercent(latest, node.target.y);\r\n return `${x}% ${y}%`;\r\n },\r\n};\r\n\r\nexport { correctBorderRadius, pixelsToPercent };\r\n","import { mix } from '../../utils/mix.mjs';\r\nimport { complex } from '../../value/types/complex/index.mjs';\r\n\r\nconst correctBoxShadow = {\r\n correct: (latest, { treeScale, projectionDelta }) => {\r\n const original = latest;\r\n const shadow = complex.parse(latest);\r\n // TODO: Doesn't support multiple shadows\r\n if (shadow.length > 5)\r\n return original;\r\n const template = complex.createTransformer(latest);\r\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\r\n // Calculate the overall context scale\r\n const xScale = projectionDelta.x.scale * treeScale.x;\r\n const yScale = projectionDelta.y.scale * treeScale.y;\r\n shadow[0 + offset] /= xScale;\r\n shadow[1 + offset] /= yScale;\r\n /**\r\n * Ideally we'd correct x and y scales individually, but because blur and\r\n * spread apply to both we have to take a scale average and apply that instead.\r\n * We could potentially improve the outcome of this by incorporating the ratio between\r\n * the two scales.\r\n */\r\n const averageScale = mix(xScale, yScale, 0.5);\r\n // Blur\r\n if (typeof shadow[2 + offset] === \"number\")\r\n shadow[2 + offset] /= averageScale;\r\n // Spread\r\n if (typeof shadow[3 + offset] === \"number\")\r\n shadow[3 + offset] /= averageScale;\r\n return template(shadow);\r\n },\r\n};\r\n\r\nexport { correctBoxShadow };\r\n","import React__default, { useContext } from 'react';\r\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';\r\nimport { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';\r\nimport { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';\r\nimport { globalProjectionState } from '../../../projection/node/state.mjs';\r\nimport { correctBorderRadius } from '../../../projection/styles/scale-border-radius.mjs';\r\nimport { correctBoxShadow } from '../../../projection/styles/scale-box-shadow.mjs';\r\nimport { addScaleCorrector } from '../../../projection/styles/scale-correction.mjs';\r\nimport { frame } from '../../../frameloop/frame.mjs';\r\n\r\nclass MeasureLayoutWithContext extends React__default.Component {\r\n /**\r\n * This only mounts projection nodes for components that\r\n * need measuring, we might want to do it for all components\r\n * in order to incorporate transforms\r\n */\r\n componentDidMount() {\r\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\r\n const { projection } = visualElement;\r\n addScaleCorrector(defaultScaleCorrectors);\r\n if (projection) {\r\n if (layoutGroup.group)\r\n layoutGroup.group.add(projection);\r\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\r\n switchLayoutGroup.register(projection);\r\n }\r\n projection.root.didUpdate();\r\n projection.addEventListener(\"animationComplete\", () => {\r\n this.safeToRemove();\r\n });\r\n projection.setOptions({\r\n ...projection.options,\r\n onExitComplete: () => this.safeToRemove(),\r\n });\r\n }\r\n globalProjectionState.hasEverUpdated = true;\r\n }\r\n getSnapshotBeforeUpdate(prevProps) {\r\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\r\n const projection = visualElement.projection;\r\n if (!projection)\r\n return null;\r\n /**\r\n * TODO: We use this data in relegate to determine whether to\r\n * promote a previous element. There's no guarantee its presence data\r\n * will have updated by this point - if a bug like this arises it will\r\n * have to be that we markForRelegation and then find a new lead some other way,\r\n * perhaps in didUpdate\r\n */\r\n projection.isPresent = isPresent;\r\n if (drag ||\r\n prevProps.layoutDependency !== layoutDependency ||\r\n layoutDependency === undefined) {\r\n projection.willUpdate();\r\n }\r\n else {\r\n this.safeToRemove();\r\n }\r\n if (prevProps.isPresent !== isPresent) {\r\n if (isPresent) {\r\n projection.promote();\r\n }\r\n else if (!projection.relegate()) {\r\n /**\r\n * If there's another stack member taking over from this one,\r\n * it's in charge of the exit animation and therefore should\r\n * be in charge of the safe to remove. Otherwise we call it here.\r\n */\r\n frame.postRender(() => {\r\n const stack = projection.getStack();\r\n if (!stack || !stack.members.length) {\r\n this.safeToRemove();\r\n }\r\n });\r\n }\r\n }\r\n return null;\r\n }\r\n componentDidUpdate() {\r\n const { projection } = this.props.visualElement;\r\n if (projection) {\r\n projection.root.didUpdate();\r\n queueMicrotask(() => {\r\n if (!projection.currentAnimation && projection.isLead()) {\r\n this.safeToRemove();\r\n }\r\n });\r\n }\r\n }\r\n componentWillUnmount() {\r\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\r\n const { projection } = visualElement;\r\n if (projection) {\r\n projection.scheduleCheckAfterUnmount();\r\n if (layoutGroup && layoutGroup.group)\r\n layoutGroup.group.remove(projection);\r\n if (promoteContext && promoteContext.deregister)\r\n promoteContext.deregister(projection);\r\n }\r\n }\r\n safeToRemove() {\r\n const { safeToRemove } = this.props;\r\n safeToRemove && safeToRemove();\r\n }\r\n render() {\r\n return null;\r\n }\r\n}\r\nfunction MeasureLayout(props) {\r\n const [isPresent, safeToRemove] = usePresence();\r\n const layoutGroup = useContext(LayoutGroupContext);\r\n return (React__default.createElement(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\r\n}\r\nconst defaultScaleCorrectors = {\r\n borderRadius: {\r\n ...correctBorderRadius,\r\n applyTo: [\r\n \"borderTopLeftRadius\",\r\n \"borderTopRightRadius\",\r\n \"borderBottomLeftRadius\",\r\n \"borderBottomRightRadius\",\r\n ],\r\n },\r\n borderTopLeftRadius: correctBorderRadius,\r\n borderTopRightRadius: correctBorderRadius,\r\n borderBottomLeftRadius: correctBorderRadius,\r\n borderBottomRightRadius: correctBorderRadius,\r\n boxShadow: correctBoxShadow,\r\n};\r\n\r\nexport { MeasureLayout };\r\n","import { circOut } from '../../easing/circ.mjs';\r\nimport { progress } from '../../utils/progress.mjs';\r\nimport { mix } from '../../utils/mix.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\nimport { percent, px } from '../../value/types/numbers/units.mjs';\r\n\r\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\r\nconst numBorders = borders.length;\r\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\r\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\r\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\r\n if (shouldCrossfadeOpacity) {\r\n target.opacity = mix(0, \r\n // TODO Reinstate this if only child\r\n lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));\r\n target.opacityExit = mix(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));\r\n }\r\n else if (isOnlyMember) {\r\n target.opacity = mix(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);\r\n }\r\n /**\r\n * Mix border radius\r\n */\r\n for (let i = 0; i < numBorders; i++) {\r\n const borderLabel = `border${borders[i]}Radius`;\r\n let followRadius = getRadius(follow, borderLabel);\r\n let leadRadius = getRadius(lead, borderLabel);\r\n if (followRadius === undefined && leadRadius === undefined)\r\n continue;\r\n followRadius || (followRadius = 0);\r\n leadRadius || (leadRadius = 0);\r\n const canMix = followRadius === 0 ||\r\n leadRadius === 0 ||\r\n isPx(followRadius) === isPx(leadRadius);\r\n if (canMix) {\r\n target[borderLabel] = Math.max(mix(asNumber(followRadius), asNumber(leadRadius), progress), 0);\r\n if (percent.test(leadRadius) || percent.test(followRadius)) {\r\n target[borderLabel] += \"%\";\r\n }\r\n }\r\n else {\r\n target[borderLabel] = leadRadius;\r\n }\r\n }\r\n /**\r\n * Mix rotation\r\n */\r\n if (follow.rotate || lead.rotate) {\r\n target.rotate = mix(follow.rotate || 0, lead.rotate || 0, progress);\r\n }\r\n}\r\nfunction getRadius(values, radiusName) {\r\n return values[radiusName] !== undefined\r\n ? values[radiusName]\r\n : values.borderRadius;\r\n}\r\n// /**\r\n// * We only want to mix the background color if there's a follow element\r\n// * that we're not crossfading opacity between. For instance with switch\r\n// * AnimateSharedLayout animations, this helps the illusion of a continuous\r\n// * element being animated but also cuts down on the number of paints triggered\r\n// * for elements where opacity is doing that work for us.\r\n// */\r\n// if (\r\n// !hasFollowElement &&\r\n// latestLeadValues.backgroundColor &&\r\n// latestFollowValues.backgroundColor\r\n// ) {\r\n// /**\r\n// * This isn't ideal performance-wise as mixColor is creating a new function every frame.\r\n// * We could probably create a mixer that runs at the start of the animation but\r\n// * the idea behind the crossfader is that it runs dynamically between two potentially\r\n// * changing targets (ie opacity or borderRadius may be animating independently via variants)\r\n// */\r\n// leadState.backgroundColor = followState.backgroundColor = mixColor(\r\n// latestFollowValues.backgroundColor as string,\r\n// latestLeadValues.backgroundColor as string\r\n// )(p)\r\n// }\r\nconst easeCrossfadeIn = compress(0, 0.5, circOut);\r\nconst easeCrossfadeOut = compress(0.5, 0.95, noop);\r\nfunction compress(min, max, easing) {\r\n return (p) => {\r\n // Could replace ifs with clamp\r\n if (p < min)\r\n return 0;\r\n if (p > max)\r\n return 1;\r\n return easing(progress(min, max, p));\r\n };\r\n}\r\n\r\nexport { mixValues };\r\n","/**\r\n * Reset an axis to the provided origin box.\r\n *\r\n * This is a mutative operation.\r\n */\r\nfunction copyAxisInto(axis, originAxis) {\r\n axis.min = originAxis.min;\r\n axis.max = originAxis.max;\r\n}\r\n/**\r\n * Reset a box to the provided origin box.\r\n *\r\n * This is a mutative operation.\r\n */\r\nfunction copyBoxInto(box, originBox) {\r\n copyAxisInto(box.x, originBox.x);\r\n copyAxisInto(box.y, originBox.y);\r\n}\r\n\r\nexport { copyAxisInto, copyBoxInto };\r\n","import { mix } from '../../utils/mix.mjs';\r\nimport { percent } from '../../value/types/numbers/units.mjs';\r\nimport { scalePoint } from './delta-apply.mjs';\r\n\r\n/**\r\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\r\n */\r\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\r\n point -= translate;\r\n point = scalePoint(point, 1 / scale, originPoint);\r\n if (boxScale !== undefined) {\r\n point = scalePoint(point, 1 / boxScale, originPoint);\r\n }\r\n return point;\r\n}\r\n/**\r\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\r\n */\r\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\r\n if (percent.test(translate)) {\r\n translate = parseFloat(translate);\r\n const relativeProgress = mix(sourceAxis.min, sourceAxis.max, translate / 100);\r\n translate = relativeProgress - sourceAxis.min;\r\n }\r\n if (typeof translate !== \"number\")\r\n return;\r\n let originPoint = mix(originAxis.min, originAxis.max, origin);\r\n if (axis === originAxis)\r\n originPoint -= translate;\r\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\r\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\r\n}\r\n/**\r\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\r\n * and acts as a bridge between motion values and removeAxisDelta\r\n */\r\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\r\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\r\n}\r\n/**\r\n * The names of the motion values we want to apply as translation, scale and origin.\r\n */\r\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\r\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\r\n/**\r\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\r\n * and acts as a bridge between motion values and removeAxisDelta\r\n */\r\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\r\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\r\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\r\n}\r\n\r\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\r\n","import { calcLength } from './delta-calc.mjs';\r\n\r\nfunction isAxisDeltaZero(delta) {\r\n return delta.translate === 0 && delta.scale === 1;\r\n}\r\nfunction isDeltaZero(delta) {\r\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\r\n}\r\nfunction boxEquals(a, b) {\r\n return (a.x.min === b.x.min &&\r\n a.x.max === b.x.max &&\r\n a.y.min === b.y.min &&\r\n a.y.max === b.y.max);\r\n}\r\nfunction boxEqualsRounded(a, b) {\r\n return (Math.round(a.x.min) === Math.round(b.x.min) &&\r\n Math.round(a.x.max) === Math.round(b.x.max) &&\r\n Math.round(a.y.min) === Math.round(b.y.min) &&\r\n Math.round(a.y.max) === Math.round(b.y.max));\r\n}\r\nfunction aspectRatio(box) {\r\n return calcLength(box.x) / calcLength(box.y);\r\n}\r\n\r\nexport { aspectRatio, boxEquals, boxEqualsRounded, isDeltaZero };\r\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\r\n\r\nclass NodeStack {\r\n constructor() {\r\n this.members = [];\r\n }\r\n add(node) {\r\n addUniqueItem(this.members, node);\r\n node.scheduleRender();\r\n }\r\n remove(node) {\r\n removeItem(this.members, node);\r\n if (node === this.prevLead) {\r\n this.prevLead = undefined;\r\n }\r\n if (node === this.lead) {\r\n const prevLead = this.members[this.members.length - 1];\r\n if (prevLead) {\r\n this.promote(prevLead);\r\n }\r\n }\r\n }\r\n relegate(node) {\r\n const indexOfNode = this.members.findIndex((member) => node === member);\r\n if (indexOfNode === 0)\r\n return false;\r\n /**\r\n * Find the next projection node that is present\r\n */\r\n let prevLead;\r\n for (let i = indexOfNode; i >= 0; i--) {\r\n const member = this.members[i];\r\n if (member.isPresent !== false) {\r\n prevLead = member;\r\n break;\r\n }\r\n }\r\n if (prevLead) {\r\n this.promote(prevLead);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n promote(node, preserveFollowOpacity) {\r\n const prevLead = this.lead;\r\n if (node === prevLead)\r\n return;\r\n this.prevLead = prevLead;\r\n this.lead = node;\r\n node.show();\r\n if (prevLead) {\r\n prevLead.instance && prevLead.scheduleRender();\r\n node.scheduleRender();\r\n node.resumeFrom = prevLead;\r\n if (preserveFollowOpacity) {\r\n node.resumeFrom.preserveOpacity = true;\r\n }\r\n if (prevLead.snapshot) {\r\n node.snapshot = prevLead.snapshot;\r\n node.snapshot.latestValues =\r\n prevLead.animationValues || prevLead.latestValues;\r\n }\r\n if (node.root && node.root.isUpdating) {\r\n node.isLayoutDirty = true;\r\n }\r\n const { crossfade } = node.options;\r\n if (crossfade === false) {\r\n prevLead.hide();\r\n }\r\n /**\r\n * TODO:\r\n * - Test border radius when previous node was deleted\r\n * - boxShadow mixing\r\n * - Shared between element A in scrolled container and element B (scroll stays the same or changes)\r\n * - Shared between element A in transformed container and element B (transform stays the same or changes)\r\n * - Shared between element A in scrolled page and element B (scroll stays the same or changes)\r\n * ---\r\n * - Crossfade opacity of root nodes\r\n * - layoutId changes after animation\r\n * - layoutId changes mid animation\r\n */\r\n }\r\n }\r\n exitAnimationComplete() {\r\n this.members.forEach((node) => {\r\n const { options, resumingFrom } = node;\r\n options.onExitComplete && options.onExitComplete();\r\n if (resumingFrom) {\r\n resumingFrom.options.onExitComplete &&\r\n resumingFrom.options.onExitComplete();\r\n }\r\n });\r\n }\r\n scheduleRender() {\r\n this.members.forEach((node) => {\r\n node.instance && node.scheduleRender(false);\r\n });\r\n }\r\n /**\r\n * Clear any leads that have been removed this render to prevent them from being\r\n * used in future animations and to prevent memory leaks\r\n */\r\n removeLeadSnapshot() {\r\n if (this.lead && this.lead.snapshot) {\r\n this.lead.snapshot = undefined;\r\n }\r\n }\r\n}\r\n\r\nexport { NodeStack };\r\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\r\n let transform = \"\";\r\n /**\r\n * The translations we use to calculate are always relative to the viewport coordinate space.\r\n * But when we apply scales, we also scale the coordinate space of an element and its children.\r\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\r\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\r\n */\r\n const xTranslate = delta.x.translate / treeScale.x;\r\n const yTranslate = delta.y.translate / treeScale.y;\r\n if (xTranslate || yTranslate) {\r\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, 0) `;\r\n }\r\n /**\r\n * Apply scale correction for the tree transform.\r\n * This will apply scale to the screen-orientated axes.\r\n */\r\n if (treeScale.x !== 1 || treeScale.y !== 1) {\r\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\r\n }\r\n if (latestTransform) {\r\n const { rotate, rotateX, rotateY } = latestTransform;\r\n if (rotate)\r\n transform += `rotate(${rotate}deg) `;\r\n if (rotateX)\r\n transform += `rotateX(${rotateX}deg) `;\r\n if (rotateY)\r\n transform += `rotateY(${rotateY}deg) `;\r\n }\r\n /**\r\n * Apply scale to match the size of the element to the size we want it.\r\n * This will apply scale to the element-orientated axes.\r\n */\r\n const elementScaleX = delta.x.scale * treeScale.x;\r\n const elementScaleY = delta.y.scale * treeScale.y;\r\n if (elementScaleX !== 1 || elementScaleY !== 1) {\r\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\r\n }\r\n return transform || \"none\";\r\n}\r\n\r\nexport { buildProjectionTransform };\r\n","const compareByDepth = (a, b) => a.depth - b.depth;\r\n\r\nexport { compareByDepth };\r\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\r\nimport { compareByDepth } from './compare-by-depth.mjs';\r\n\r\nclass FlatTree {\r\n constructor() {\r\n this.children = [];\r\n this.isDirty = false;\r\n }\r\n add(child) {\r\n addUniqueItem(this.children, child);\r\n this.isDirty = true;\r\n }\r\n remove(child) {\r\n removeItem(this.children, child);\r\n this.isDirty = true;\r\n }\r\n forEach(callback) {\r\n this.isDirty && this.children.sort(compareByDepth);\r\n this.isDirty = false;\r\n this.children.forEach(callback);\r\n }\r\n}\r\n\r\nexport { FlatTree };\r\n","import { frame, cancelFrame } from '../frameloop/frame.mjs';\r\n\r\n/**\r\n * Timeout defined in ms\r\n */\r\nfunction delay(callback, timeout) {\r\n const start = performance.now();\r\n const checkElapsed = ({ timestamp }) => {\r\n const elapsed = timestamp - start;\r\n if (elapsed >= timeout) {\r\n cancelFrame(checkElapsed);\r\n callback(elapsed - timeout);\r\n }\r\n };\r\n frame.read(checkElapsed, true);\r\n return () => cancelFrame(checkElapsed);\r\n}\r\n\r\nexport { delay };\r\n","function record(data) {\r\n if (window.MotionDebug) {\r\n window.MotionDebug.record(data);\r\n }\r\n}\r\n\r\nexport { record };\r\n","function isSVGElement(element) {\r\n return element instanceof SVGElement && element.tagName !== \"svg\";\r\n}\r\n\r\nexport { isSVGElement };\r\n","import { animateMotionValue } from './motion-value.mjs';\r\nimport { motionValue } from '../../value/index.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction animateSingleValue(value, keyframes, options) {\r\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\r\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\r\n return motionValue$1.animation;\r\n}\r\n\r\nexport { animateSingleValue };\r\n","import { SubscriptionManager } from '../../utils/subscription-manager.mjs';\r\nimport { mixValues } from '../animation/mix-values.mjs';\r\nimport { copyBoxInto } from '../geometry/copy.mjs';\r\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\r\nimport { calcRelativePosition, calcRelativeBox, calcBoxDelta, calcLength, isNear } from '../geometry/delta-calc.mjs';\r\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\r\nimport { createBox, createDelta } from '../geometry/models.mjs';\r\nimport { getValueTransition } from '../../animation/utils/transitions.mjs';\r\nimport { boxEqualsRounded, isDeltaZero, aspectRatio, boxEquals } from '../geometry/utils.mjs';\r\nimport { NodeStack } from '../shared/stack.mjs';\r\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\r\nimport { buildProjectionTransform } from '../styles/transform.mjs';\r\nimport { eachAxis } from '../utils/each-axis.mjs';\r\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\r\nimport { FlatTree } from '../../render/utils/flat-tree.mjs';\r\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\r\nimport { globalProjectionState } from './state.mjs';\r\nimport { delay } from '../../utils/delay.mjs';\r\nimport { mix } from '../../utils/mix.mjs';\r\nimport { record } from '../../debug/record.mjs';\r\nimport { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\r\nimport { animateSingleValue } from '../../animation/interfaces/single-value.mjs';\r\nimport { clamp } from '../../utils/clamp.mjs';\r\nimport { cancelFrame, frameData, steps, frame } from '../../frameloop/frame.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\n\r\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\r\nconst hiddenVisibility = { visibility: \"hidden\" };\r\n/**\r\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\r\n * which has a noticeable difference in spring animations\r\n */\r\nconst animationTarget = 1000;\r\nlet id = 0;\r\n/**\r\n * Use a mutable data object for debug data so as to not create a new\r\n * object every frame.\r\n */\r\nconst projectionFrameData = {\r\n type: \"projectionFrame\",\r\n totalNodes: 0,\r\n resolvedTargetDeltas: 0,\r\n recalculatedProjection: 0,\r\n};\r\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\r\n return class ProjectionNode {\r\n constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {\r\n /**\r\n * A unique ID generated for every projection node.\r\n */\r\n this.id = id++;\r\n /**\r\n * An id that represents a unique session instigated by startUpdate.\r\n */\r\n this.animationId = 0;\r\n /**\r\n * A Set containing all this component's children. This is used to iterate\r\n * through the children.\r\n *\r\n * TODO: This could be faster to iterate as a flat array stored on the root node.\r\n */\r\n this.children = new Set();\r\n /**\r\n * Options for the node. We use this to configure what kind of layout animations\r\n * we should perform (if any).\r\n */\r\n this.options = {};\r\n /**\r\n * We use this to detect when its safe to shut down part of a projection tree.\r\n * We have to keep projecting children for scale correction and relative projection\r\n * until all their parents stop performing layout animations.\r\n */\r\n this.isTreeAnimating = false;\r\n this.isAnimationBlocked = false;\r\n /**\r\n * Flag to true if we think this layout has been changed. We can't always know this,\r\n * currently we set it to true every time a component renders, or if it has a layoutDependency\r\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\r\n * and if one node is dirtied, they all are.\r\n */\r\n this.isLayoutDirty = false;\r\n /**\r\n * Flag to true if we think the projection calculations for this node needs\r\n * recalculating as a result of an updated transform or layout animation.\r\n */\r\n this.isProjectionDirty = false;\r\n /**\r\n * Flag to true if the layout *or* transform has changed. This then gets propagated\r\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\r\n */\r\n this.isSharedProjectionDirty = false;\r\n /**\r\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\r\n * respected by shared nodes.\r\n */\r\n this.isTransformDirty = false;\r\n /**\r\n * Block layout updates for instant layout transitions throughout the tree.\r\n */\r\n this.updateManuallyBlocked = false;\r\n this.updateBlockedByResize = false;\r\n /**\r\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\r\n * call.\r\n */\r\n this.isUpdating = false;\r\n /**\r\n * If this is an SVG element we currently disable projection transforms\r\n */\r\n this.isSVG = false;\r\n /**\r\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\r\n * its projection styles.\r\n */\r\n this.needsReset = false;\r\n /**\r\n * Flags whether this node should have its transform reset prior to measuring.\r\n */\r\n this.shouldResetTransform = false;\r\n /**\r\n * An object representing the calculated contextual/accumulated/tree scale.\r\n * This will be used to scale calculcated projection transforms, as these are\r\n * calculated in screen-space but need to be scaled for elements to layoutly\r\n * make it to their calculated destinations.\r\n *\r\n * TODO: Lazy-init\r\n */\r\n this.treeScale = { x: 1, y: 1 };\r\n /**\r\n *\r\n */\r\n this.eventHandlers = new Map();\r\n this.hasTreeAnimated = false;\r\n // Note: Currently only running on root node\r\n this.updateScheduled = false;\r\n this.projectionUpdateScheduled = false;\r\n this.checkUpdateFailed = () => {\r\n if (this.isUpdating) {\r\n this.isUpdating = false;\r\n this.clearAllSnapshots();\r\n }\r\n };\r\n /**\r\n * This is a multi-step process as shared nodes might be of different depths. Nodes\r\n * are sorted by depth order, so we need to resolve the entire tree before moving to\r\n * the next step.\r\n */\r\n this.updateProjection = () => {\r\n this.projectionUpdateScheduled = false;\r\n /**\r\n * Reset debug counts. Manually resetting rather than creating a new\r\n * object each frame.\r\n */\r\n projectionFrameData.totalNodes =\r\n projectionFrameData.resolvedTargetDeltas =\r\n projectionFrameData.recalculatedProjection =\r\n 0;\r\n this.nodes.forEach(propagateDirtyNodes);\r\n this.nodes.forEach(resolveTargetDelta);\r\n this.nodes.forEach(calcProjection);\r\n this.nodes.forEach(cleanDirtyNodes);\r\n record(projectionFrameData);\r\n };\r\n this.hasProjected = false;\r\n this.isVisible = true;\r\n this.animationProgress = 0;\r\n /**\r\n * Shared layout\r\n */\r\n // TODO Only running on root node\r\n this.sharedNodes = new Map();\r\n this.latestValues = latestValues;\r\n this.root = parent ? parent.root || parent : this;\r\n this.path = parent ? [...parent.path, parent] : [];\r\n this.parent = parent;\r\n this.depth = parent ? parent.depth + 1 : 0;\r\n for (let i = 0; i < this.path.length; i++) {\r\n this.path[i].shouldResetTransform = true;\r\n }\r\n if (this.root === this)\r\n this.nodes = new FlatTree();\r\n }\r\n addEventListener(name, handler) {\r\n if (!this.eventHandlers.has(name)) {\r\n this.eventHandlers.set(name, new SubscriptionManager());\r\n }\r\n return this.eventHandlers.get(name).add(handler);\r\n }\r\n notifyListeners(name, ...args) {\r\n const subscriptionManager = this.eventHandlers.get(name);\r\n subscriptionManager && subscriptionManager.notify(...args);\r\n }\r\n hasListeners(name) {\r\n return this.eventHandlers.has(name);\r\n }\r\n /**\r\n * Lifecycles\r\n */\r\n mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {\r\n if (this.instance)\r\n return;\r\n this.isSVG = isSVGElement(instance);\r\n this.instance = instance;\r\n const { layoutId, layout, visualElement } = this.options;\r\n if (visualElement && !visualElement.current) {\r\n visualElement.mount(instance);\r\n }\r\n this.root.nodes.add(this);\r\n this.parent && this.parent.children.add(this);\r\n if (isLayoutDirty && (layout || layoutId)) {\r\n this.isLayoutDirty = true;\r\n }\r\n if (attachResizeListener) {\r\n let cancelDelay;\r\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\r\n attachResizeListener(instance, () => {\r\n this.root.updateBlockedByResize = true;\r\n cancelDelay && cancelDelay();\r\n cancelDelay = delay(resizeUnblockUpdate, 250);\r\n if (globalProjectionState.hasAnimatedSinceResize) {\r\n globalProjectionState.hasAnimatedSinceResize = false;\r\n this.nodes.forEach(finishAnimation);\r\n }\r\n });\r\n }\r\n if (layoutId) {\r\n this.root.registerSharedNode(layoutId, this);\r\n }\r\n // Only register the handler if it requires layout animation\r\n if (this.options.animate !== false &&\r\n visualElement &&\r\n (layoutId || layout)) {\r\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {\r\n if (this.isTreeAnimationBlocked()) {\r\n this.target = undefined;\r\n this.relativeTarget = undefined;\r\n return;\r\n }\r\n // TODO: Check here if an animation exists\r\n const layoutTransition = this.options.transition ||\r\n visualElement.getDefaultTransition() ||\r\n defaultLayoutTransition;\r\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\r\n /**\r\n * The target layout of the element might stay the same,\r\n * but its position relative to its parent has changed.\r\n */\r\n const targetChanged = !this.targetLayout ||\r\n !boxEqualsRounded(this.targetLayout, newLayout) ||\r\n hasRelativeTargetChanged;\r\n /**\r\n * If the layout hasn't seemed to have changed, it might be that the\r\n * element is visually in the same place in the document but its position\r\n * relative to its parent has indeed changed. So here we check for that.\r\n */\r\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;\r\n if (this.options.layoutRoot ||\r\n (this.resumeFrom && this.resumeFrom.instance) ||\r\n hasOnlyRelativeTargetChanged ||\r\n (hasLayoutChanged &&\r\n (targetChanged || !this.currentAnimation))) {\r\n if (this.resumeFrom) {\r\n this.resumingFrom = this.resumeFrom;\r\n this.resumingFrom.resumingFrom = undefined;\r\n }\r\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\r\n const animationOptions = {\r\n ...getValueTransition(layoutTransition, \"layout\"),\r\n onPlay: onLayoutAnimationStart,\r\n onComplete: onLayoutAnimationComplete,\r\n };\r\n if (visualElement.shouldReduceMotion ||\r\n this.options.layoutRoot) {\r\n animationOptions.delay = 0;\r\n animationOptions.type = false;\r\n }\r\n this.startAnimation(animationOptions);\r\n }\r\n else {\r\n /**\r\n * If the layout hasn't changed and we have an animation that hasn't started yet,\r\n * finish it immediately. Otherwise it will be animating from a location\r\n * that was probably never commited to screen and look like a jumpy box.\r\n */\r\n if (!hasLayoutChanged) {\r\n finishAnimation(this);\r\n }\r\n if (this.isLead() && this.options.onExitComplete) {\r\n this.options.onExitComplete();\r\n }\r\n }\r\n this.targetLayout = newLayout;\r\n });\r\n }\r\n }\r\n unmount() {\r\n this.options.layoutId && this.willUpdate();\r\n this.root.nodes.remove(this);\r\n const stack = this.getStack();\r\n stack && stack.remove(this);\r\n this.parent && this.parent.children.delete(this);\r\n this.instance = undefined;\r\n cancelFrame(this.updateProjection);\r\n }\r\n // only on the root\r\n blockUpdate() {\r\n this.updateManuallyBlocked = true;\r\n }\r\n unblockUpdate() {\r\n this.updateManuallyBlocked = false;\r\n }\r\n isUpdateBlocked() {\r\n return this.updateManuallyBlocked || this.updateBlockedByResize;\r\n }\r\n isTreeAnimationBlocked() {\r\n return (this.isAnimationBlocked ||\r\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\r\n false);\r\n }\r\n // Note: currently only running on root node\r\n startUpdate() {\r\n if (this.isUpdateBlocked())\r\n return;\r\n this.isUpdating = true;\r\n this.nodes && this.nodes.forEach(resetRotation);\r\n this.animationId++;\r\n }\r\n getTransformTemplate() {\r\n const { visualElement } = this.options;\r\n return visualElement && visualElement.getProps().transformTemplate;\r\n }\r\n willUpdate(shouldNotifyListeners = true) {\r\n this.root.hasTreeAnimated = true;\r\n if (this.root.isUpdateBlocked()) {\r\n this.options.onExitComplete && this.options.onExitComplete();\r\n return;\r\n }\r\n !this.root.isUpdating && this.root.startUpdate();\r\n if (this.isLayoutDirty)\r\n return;\r\n this.isLayoutDirty = true;\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n node.shouldResetTransform = true;\r\n node.updateScroll(\"snapshot\");\r\n if (node.options.layoutRoot) {\r\n node.willUpdate(false);\r\n }\r\n }\r\n const { layoutId, layout } = this.options;\r\n if (layoutId === undefined && !layout)\r\n return;\r\n const transformTemplate = this.getTransformTemplate();\r\n this.prevTransformTemplateValue = transformTemplate\r\n ? transformTemplate(this.latestValues, \"\")\r\n : undefined;\r\n this.updateSnapshot();\r\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\r\n }\r\n update() {\r\n this.updateScheduled = false;\r\n const updateWasBlocked = this.isUpdateBlocked();\r\n // When doing an instant transition, we skip the layout update,\r\n // but should still clean up the measurements so that the next\r\n // snapshot could be taken correctly.\r\n if (updateWasBlocked) {\r\n this.unblockUpdate();\r\n this.clearAllSnapshots();\r\n this.nodes.forEach(clearMeasurements);\r\n return;\r\n }\r\n if (!this.isUpdating) {\r\n this.nodes.forEach(clearIsLayoutDirty);\r\n }\r\n this.isUpdating = false;\r\n /**\r\n * Write\r\n */\r\n this.nodes.forEach(resetTransformStyle);\r\n /**\r\n * Read ==================\r\n */\r\n // Update layout measurements of updated children\r\n this.nodes.forEach(updateLayout);\r\n /**\r\n * Write\r\n */\r\n // Notify listeners that the layout is updated\r\n this.nodes.forEach(notifyLayoutUpdate);\r\n this.clearAllSnapshots();\r\n /**\r\n * Manually flush any pending updates. Ideally\r\n * we could leave this to the following requestAnimationFrame but this seems\r\n * to leave a flash of incorrectly styled content.\r\n */\r\n const now = performance.now();\r\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\r\n frameData.timestamp = now;\r\n frameData.isProcessing = true;\r\n steps.update.process(frameData);\r\n steps.preRender.process(frameData);\r\n steps.render.process(frameData);\r\n frameData.isProcessing = false;\r\n }\r\n didUpdate() {\r\n if (!this.updateScheduled) {\r\n this.updateScheduled = true;\r\n queueMicrotask(() => this.update());\r\n }\r\n }\r\n clearAllSnapshots() {\r\n this.nodes.forEach(clearSnapshot);\r\n this.sharedNodes.forEach(removeLeadSnapshots);\r\n }\r\n scheduleUpdateProjection() {\r\n if (!this.projectionUpdateScheduled) {\r\n this.projectionUpdateScheduled = true;\r\n frame.preRender(this.updateProjection, false, true);\r\n }\r\n }\r\n scheduleCheckAfterUnmount() {\r\n /**\r\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\r\n * we manually call didUpdate to give a chance to the siblings to animate.\r\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\r\n */\r\n frame.postRender(() => {\r\n if (this.isLayoutDirty) {\r\n this.root.didUpdate();\r\n }\r\n else {\r\n this.root.checkUpdateFailed();\r\n }\r\n });\r\n }\r\n /**\r\n * Update measurements\r\n */\r\n updateSnapshot() {\r\n if (this.snapshot || !this.instance)\r\n return;\r\n this.snapshot = this.measure();\r\n }\r\n updateLayout() {\r\n if (!this.instance)\r\n return;\r\n // TODO: Incorporate into a forwarded scroll offset\r\n this.updateScroll();\r\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\r\n !this.isLayoutDirty) {\r\n return;\r\n }\r\n /**\r\n * When a node is mounted, it simply resumes from the prevLead's\r\n * snapshot instead of taking a new one, but the ancestors scroll\r\n * might have updated while the prevLead is unmounted. We need to\r\n * update the scroll again to make sure the layout we measure is\r\n * up to date.\r\n */\r\n if (this.resumeFrom && !this.resumeFrom.instance) {\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n node.updateScroll();\r\n }\r\n }\r\n const prevLayout = this.layout;\r\n this.layout = this.measure(false);\r\n this.layoutCorrected = createBox();\r\n this.isLayoutDirty = false;\r\n this.projectionDelta = undefined;\r\n this.notifyListeners(\"measure\", this.layout.layoutBox);\r\n const { visualElement } = this.options;\r\n visualElement &&\r\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\r\n }\r\n updateScroll(phase = \"measure\") {\r\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\r\n if (this.scroll &&\r\n this.scroll.animationId === this.root.animationId &&\r\n this.scroll.phase === phase) {\r\n needsMeasurement = false;\r\n }\r\n if (needsMeasurement) {\r\n this.scroll = {\r\n animationId: this.root.animationId,\r\n phase,\r\n isRoot: checkIsScrollRoot(this.instance),\r\n offset: measureScroll(this.instance),\r\n };\r\n }\r\n }\r\n resetTransform() {\r\n if (!resetTransform)\r\n return;\r\n const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;\r\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\r\n const transformTemplate = this.getTransformTemplate();\r\n const transformTemplateValue = transformTemplate\r\n ? transformTemplate(this.latestValues, \"\")\r\n : undefined;\r\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\r\n if (isResetRequested &&\r\n (hasProjection ||\r\n hasTransform(this.latestValues) ||\r\n transformTemplateHasChanged)) {\r\n resetTransform(this.instance, transformTemplateValue);\r\n this.shouldResetTransform = false;\r\n this.scheduleRender();\r\n }\r\n }\r\n measure(removeTransform = true) {\r\n const pageBox = this.measurePageBox();\r\n let layoutBox = this.removeElementScroll(pageBox);\r\n /**\r\n * Measurements taken during the pre-render stage\r\n * still have transforms applied so we remove them\r\n * via calculation.\r\n */\r\n if (removeTransform) {\r\n layoutBox = this.removeTransform(layoutBox);\r\n }\r\n roundBox(layoutBox);\r\n return {\r\n animationId: this.root.animationId,\r\n measuredBox: pageBox,\r\n layoutBox,\r\n latestValues: {},\r\n source: this.id,\r\n };\r\n }\r\n measurePageBox() {\r\n const { visualElement } = this.options;\r\n if (!visualElement)\r\n return createBox();\r\n const box = visualElement.measureViewportBox();\r\n // Remove viewport scroll to give page-relative coordinates\r\n const { scroll } = this.root;\r\n if (scroll) {\r\n translateAxis(box.x, scroll.offset.x);\r\n translateAxis(box.y, scroll.offset.y);\r\n }\r\n return box;\r\n }\r\n removeElementScroll(box) {\r\n const boxWithoutScroll = createBox();\r\n copyBoxInto(boxWithoutScroll, box);\r\n /**\r\n * Performance TODO: Keep a cumulative scroll offset down the tree\r\n * rather than loop back up the path.\r\n */\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n const { scroll, options } = node;\r\n if (node !== this.root && scroll && options.layoutScroll) {\r\n /**\r\n * If this is a new scroll root, we want to remove all previous scrolls\r\n * from the viewport box.\r\n */\r\n if (scroll.isRoot) {\r\n copyBoxInto(boxWithoutScroll, box);\r\n const { scroll: rootScroll } = this.root;\r\n /**\r\n * Undo the application of page scroll that was originally added\r\n * to the measured bounding box.\r\n */\r\n if (rootScroll) {\r\n translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);\r\n translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);\r\n }\r\n }\r\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\r\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\r\n }\r\n }\r\n return boxWithoutScroll;\r\n }\r\n applyTransform(box, transformOnly = false) {\r\n const withTransforms = createBox();\r\n copyBoxInto(withTransforms, box);\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n if (!transformOnly &&\r\n node.options.layoutScroll &&\r\n node.scroll &&\r\n node !== node.root) {\r\n transformBox(withTransforms, {\r\n x: -node.scroll.offset.x,\r\n y: -node.scroll.offset.y,\r\n });\r\n }\r\n if (!hasTransform(node.latestValues))\r\n continue;\r\n transformBox(withTransforms, node.latestValues);\r\n }\r\n if (hasTransform(this.latestValues)) {\r\n transformBox(withTransforms, this.latestValues);\r\n }\r\n return withTransforms;\r\n }\r\n removeTransform(box) {\r\n const boxWithoutTransform = createBox();\r\n copyBoxInto(boxWithoutTransform, box);\r\n for (let i = 0; i < this.path.length; i++) {\r\n const node = this.path[i];\r\n if (!node.instance)\r\n continue;\r\n if (!hasTransform(node.latestValues))\r\n continue;\r\n hasScale(node.latestValues) && node.updateSnapshot();\r\n const sourceBox = createBox();\r\n const nodeBox = node.measurePageBox();\r\n copyBoxInto(sourceBox, nodeBox);\r\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\r\n }\r\n if (hasTransform(this.latestValues)) {\r\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\r\n }\r\n return boxWithoutTransform;\r\n }\r\n setTargetDelta(delta) {\r\n this.targetDelta = delta;\r\n this.root.scheduleUpdateProjection();\r\n this.isProjectionDirty = true;\r\n }\r\n setOptions(options) {\r\n this.options = {\r\n ...this.options,\r\n ...options,\r\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\r\n };\r\n }\r\n clearMeasurements() {\r\n this.scroll = undefined;\r\n this.layout = undefined;\r\n this.snapshot = undefined;\r\n this.prevTransformTemplateValue = undefined;\r\n this.targetDelta = undefined;\r\n this.target = undefined;\r\n this.isLayoutDirty = false;\r\n }\r\n forceRelativeParentToResolveTarget() {\r\n if (!this.relativeParent)\r\n return;\r\n /**\r\n * If the parent target isn't up-to-date, force it to update.\r\n * This is an unfortunate de-optimisation as it means any updating relative\r\n * projection will cause all the relative parents to recalculate back\r\n * up the tree.\r\n */\r\n if (this.relativeParent.resolvedRelativeTargetAt !==\r\n frameData.timestamp) {\r\n this.relativeParent.resolveTargetDelta(true);\r\n }\r\n }\r\n resolveTargetDelta(forceRecalculation = false) {\r\n var _a;\r\n /**\r\n * Once the dirty status of nodes has been spread through the tree, we also\r\n * need to check if we have a shared node of a different depth that has itself\r\n * been dirtied.\r\n */\r\n const lead = this.getLead();\r\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\r\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\r\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\r\n const isShared = Boolean(this.resumingFrom) || this !== lead;\r\n /**\r\n * We don't use transform for this step of processing so we don't\r\n * need to check whether any nodes have changed transform.\r\n */\r\n const canSkip = !(forceRecalculation ||\r\n (isShared && this.isSharedProjectionDirty) ||\r\n this.isProjectionDirty ||\r\n ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||\r\n this.attemptToResolveRelativeTarget);\r\n if (canSkip)\r\n return;\r\n const { layout, layoutId } = this.options;\r\n /**\r\n * If we have no layout, we can't perform projection, so early return\r\n */\r\n if (!this.layout || !(layout || layoutId))\r\n return;\r\n this.resolvedRelativeTargetAt = frameData.timestamp;\r\n /**\r\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\r\n * a relativeParent. This will allow a component to perform scale correction\r\n * even if no animation has started.\r\n */\r\n // TODO If this is unsuccessful this currently happens every frame\r\n if (!this.targetDelta && !this.relativeTarget) {\r\n // TODO: This is a semi-repetition of further down this function, make DRY\r\n const relativeParent = this.getClosestProjectingParent();\r\n if (relativeParent &&\r\n relativeParent.layout &&\r\n this.animationProgress !== 1) {\r\n this.relativeParent = relativeParent;\r\n this.forceRelativeParentToResolveTarget();\r\n this.relativeTarget = createBox();\r\n this.relativeTargetOrigin = createBox();\r\n calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);\r\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\r\n }\r\n else {\r\n this.relativeParent = this.relativeTarget = undefined;\r\n }\r\n }\r\n /**\r\n * If we have no relative target or no target delta our target isn't valid\r\n * for this frame.\r\n */\r\n if (!this.relativeTarget && !this.targetDelta)\r\n return;\r\n /**\r\n * Lazy-init target data structure\r\n */\r\n if (!this.target) {\r\n this.target = createBox();\r\n this.targetWithTransforms = createBox();\r\n }\r\n /**\r\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\r\n */\r\n if (this.relativeTarget &&\r\n this.relativeTargetOrigin &&\r\n this.relativeParent &&\r\n this.relativeParent.target) {\r\n this.forceRelativeParentToResolveTarget();\r\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\r\n /**\r\n * If we've only got a targetDelta, resolve it into a target\r\n */\r\n }\r\n else if (this.targetDelta) {\r\n if (Boolean(this.resumingFrom)) {\r\n // TODO: This is creating a new object every frame\r\n this.target = this.applyTransform(this.layout.layoutBox);\r\n }\r\n else {\r\n copyBoxInto(this.target, this.layout.layoutBox);\r\n }\r\n applyBoxDelta(this.target, this.targetDelta);\r\n }\r\n else {\r\n /**\r\n * If no target, use own layout as target\r\n */\r\n copyBoxInto(this.target, this.layout.layoutBox);\r\n }\r\n /**\r\n * If we've been told to attempt to resolve a relative target, do so.\r\n */\r\n if (this.attemptToResolveRelativeTarget) {\r\n this.attemptToResolveRelativeTarget = false;\r\n const relativeParent = this.getClosestProjectingParent();\r\n if (relativeParent &&\r\n Boolean(relativeParent.resumingFrom) ===\r\n Boolean(this.resumingFrom) &&\r\n !relativeParent.options.layoutScroll &&\r\n relativeParent.target &&\r\n this.animationProgress !== 1) {\r\n this.relativeParent = relativeParent;\r\n this.forceRelativeParentToResolveTarget();\r\n this.relativeTarget = createBox();\r\n this.relativeTargetOrigin = createBox();\r\n calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);\r\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\r\n }\r\n else {\r\n this.relativeParent = this.relativeTarget = undefined;\r\n }\r\n }\r\n /**\r\n * Increase debug counter for resolved target deltas\r\n */\r\n projectionFrameData.resolvedTargetDeltas++;\r\n }\r\n getClosestProjectingParent() {\r\n if (!this.parent ||\r\n hasScale(this.parent.latestValues) ||\r\n has2DTranslate(this.parent.latestValues)) {\r\n return undefined;\r\n }\r\n if (this.parent.isProjecting()) {\r\n return this.parent;\r\n }\r\n else {\r\n return this.parent.getClosestProjectingParent();\r\n }\r\n }\r\n isProjecting() {\r\n return Boolean((this.relativeTarget ||\r\n this.targetDelta ||\r\n this.options.layoutRoot) &&\r\n this.layout);\r\n }\r\n calcProjection() {\r\n var _a;\r\n const lead = this.getLead();\r\n const isShared = Boolean(this.resumingFrom) || this !== lead;\r\n let canSkip = true;\r\n /**\r\n * If this is a normal layout animation and neither this node nor its nearest projecting\r\n * is dirty then we can't skip.\r\n */\r\n if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {\r\n canSkip = false;\r\n }\r\n /**\r\n * If this is a shared layout animation and this node's shared projection is dirty then\r\n * we can't skip.\r\n */\r\n if (isShared &&\r\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\r\n canSkip = false;\r\n }\r\n /**\r\n * If we have resolved the target this frame we must recalculate the\r\n * projection to ensure it visually represents the internal calculations.\r\n */\r\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\r\n canSkip = false;\r\n }\r\n if (canSkip)\r\n return;\r\n const { layout, layoutId } = this.options;\r\n /**\r\n * If this section of the tree isn't animating we can\r\n * delete our target sources for the following frame.\r\n */\r\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\r\n this.currentAnimation ||\r\n this.pendingAnimation);\r\n if (!this.isTreeAnimating) {\r\n this.targetDelta = this.relativeTarget = undefined;\r\n }\r\n if (!this.layout || !(layout || layoutId))\r\n return;\r\n /**\r\n * Reset the corrected box with the latest values from box, as we're then going\r\n * to perform mutative operations on it.\r\n */\r\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\r\n /**\r\n * Record previous tree scales before updating.\r\n */\r\n const prevTreeScaleX = this.treeScale.x;\r\n const prevTreeScaleY = this.treeScale.y;\r\n /**\r\n * Apply all the parent deltas to this box to produce the corrected box. This\r\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\r\n */\r\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\r\n /**\r\n * If this layer needs to perform scale correction but doesn't have a target,\r\n * use the layout as the target.\r\n */\r\n if (lead.layout &&\r\n !lead.target &&\r\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\r\n lead.target = lead.layout.layoutBox;\r\n }\r\n const { target } = lead;\r\n if (!target) {\r\n /**\r\n * If we don't have a target to project into, but we were previously\r\n * projecting, we want to remove the stored transform and schedule\r\n * a render to ensure the elements reflect the removed transform.\r\n */\r\n if (this.projectionTransform) {\r\n this.projectionDelta = createDelta();\r\n this.projectionTransform = \"none\";\r\n this.scheduleRender();\r\n }\r\n return;\r\n }\r\n if (!this.projectionDelta) {\r\n this.projectionDelta = createDelta();\r\n this.projectionDeltaWithTransform = createDelta();\r\n }\r\n const prevProjectionTransform = this.projectionTransform;\r\n /**\r\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\r\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\r\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\r\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\r\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\r\n * to allow people to choose whether these styles are corrected based on just the\r\n * layout reprojection or the final bounding box.\r\n */\r\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\r\n this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale);\r\n if (this.projectionTransform !== prevProjectionTransform ||\r\n this.treeScale.x !== prevTreeScaleX ||\r\n this.treeScale.y !== prevTreeScaleY) {\r\n this.hasProjected = true;\r\n this.scheduleRender();\r\n this.notifyListeners(\"projectionUpdate\", target);\r\n }\r\n /**\r\n * Increase debug counter for recalculated projections\r\n */\r\n projectionFrameData.recalculatedProjection++;\r\n }\r\n hide() {\r\n this.isVisible = false;\r\n // TODO: Schedule render\r\n }\r\n show() {\r\n this.isVisible = true;\r\n // TODO: Schedule render\r\n }\r\n scheduleRender(notifyAll = true) {\r\n this.options.scheduleRender && this.options.scheduleRender();\r\n if (notifyAll) {\r\n const stack = this.getStack();\r\n stack && stack.scheduleRender();\r\n }\r\n if (this.resumingFrom && !this.resumingFrom.instance) {\r\n this.resumingFrom = undefined;\r\n }\r\n }\r\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\r\n const snapshot = this.snapshot;\r\n const snapshotLatestValues = snapshot\r\n ? snapshot.latestValues\r\n : {};\r\n const mixedValues = { ...this.latestValues };\r\n const targetDelta = createDelta();\r\n if (!this.relativeParent ||\r\n !this.relativeParent.options.layoutRoot) {\r\n this.relativeTarget = this.relativeTargetOrigin = undefined;\r\n }\r\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\r\n const relativeLayout = createBox();\r\n const snapshotSource = snapshot ? snapshot.source : undefined;\r\n const layoutSource = this.layout ? this.layout.source : undefined;\r\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\r\n const stack = this.getStack();\r\n const isOnlyMember = !stack || stack.members.length <= 1;\r\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\r\n !isOnlyMember &&\r\n this.options.crossfade === true &&\r\n !this.path.some(hasOpacityCrossfade));\r\n this.animationProgress = 0;\r\n let prevRelativeTarget;\r\n this.mixTargetDelta = (latest) => {\r\n const progress = latest / 1000;\r\n mixAxisDelta(targetDelta.x, delta.x, progress);\r\n mixAxisDelta(targetDelta.y, delta.y, progress);\r\n this.setTargetDelta(targetDelta);\r\n if (this.relativeTarget &&\r\n this.relativeTargetOrigin &&\r\n this.layout &&\r\n this.relativeParent &&\r\n this.relativeParent.layout) {\r\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\r\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\r\n /**\r\n * If this is an unchanged relative target we can consider the\r\n * projection not dirty.\r\n */\r\n if (prevRelativeTarget &&\r\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\r\n this.isProjectionDirty = false;\r\n }\r\n if (!prevRelativeTarget)\r\n prevRelativeTarget = createBox();\r\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\r\n }\r\n if (isSharedLayoutAnimation) {\r\n this.animationValues = mixedValues;\r\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\r\n }\r\n this.root.scheduleUpdateProjection();\r\n this.scheduleRender();\r\n this.animationProgress = progress;\r\n };\r\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\r\n }\r\n startAnimation(options) {\r\n this.notifyListeners(\"animationStart\");\r\n this.currentAnimation && this.currentAnimation.stop();\r\n if (this.resumingFrom && this.resumingFrom.currentAnimation) {\r\n this.resumingFrom.currentAnimation.stop();\r\n }\r\n if (this.pendingAnimation) {\r\n cancelFrame(this.pendingAnimation);\r\n this.pendingAnimation = undefined;\r\n }\r\n /**\r\n * Start the animation in the next frame to have a frame with progress 0,\r\n * where the target is the same as when the animation started, so we can\r\n * calculate the relative positions correctly for instant transitions.\r\n */\r\n this.pendingAnimation = frame.update(() => {\r\n globalProjectionState.hasAnimatedSinceResize = true;\r\n this.currentAnimation = animateSingleValue(0, animationTarget, {\r\n ...options,\r\n onUpdate: (latest) => {\r\n this.mixTargetDelta(latest);\r\n options.onUpdate && options.onUpdate(latest);\r\n },\r\n onComplete: () => {\r\n options.onComplete && options.onComplete();\r\n this.completeAnimation();\r\n },\r\n });\r\n if (this.resumingFrom) {\r\n this.resumingFrom.currentAnimation = this.currentAnimation;\r\n }\r\n this.pendingAnimation = undefined;\r\n });\r\n }\r\n completeAnimation() {\r\n if (this.resumingFrom) {\r\n this.resumingFrom.currentAnimation = undefined;\r\n this.resumingFrom.preserveOpacity = undefined;\r\n }\r\n const stack = this.getStack();\r\n stack && stack.exitAnimationComplete();\r\n this.resumingFrom =\r\n this.currentAnimation =\r\n this.animationValues =\r\n undefined;\r\n this.notifyListeners(\"animationComplete\");\r\n }\r\n finishAnimation() {\r\n if (this.currentAnimation) {\r\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\r\n this.currentAnimation.stop();\r\n }\r\n this.completeAnimation();\r\n }\r\n applyTransformsToTarget() {\r\n const lead = this.getLead();\r\n let { targetWithTransforms, target, layout, latestValues } = lead;\r\n if (!targetWithTransforms || !target || !layout)\r\n return;\r\n /**\r\n * If we're only animating position, and this element isn't the lead element,\r\n * then instead of projecting into the lead box we instead want to calculate\r\n * a new target that aligns the two boxes but maintains the layout shape.\r\n */\r\n if (this !== lead &&\r\n this.layout &&\r\n layout &&\r\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\r\n target = this.target || createBox();\r\n const xLength = calcLength(this.layout.layoutBox.x);\r\n target.x.min = lead.target.x.min;\r\n target.x.max = target.x.min + xLength;\r\n const yLength = calcLength(this.layout.layoutBox.y);\r\n target.y.min = lead.target.y.min;\r\n target.y.max = target.y.min + yLength;\r\n }\r\n copyBoxInto(targetWithTransforms, target);\r\n /**\r\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\r\n * This is the final box that we will then project into by calculating a transform delta and\r\n * applying it to the corrected box.\r\n */\r\n transformBox(targetWithTransforms, latestValues);\r\n /**\r\n * Update the delta between the corrected box and the final target box, after\r\n * user-set transforms are applied to it. This will be used by the renderer to\r\n * create a transform style that will reproject the element from its layout layout\r\n * into the desired bounding box.\r\n */\r\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\r\n }\r\n registerSharedNode(layoutId, node) {\r\n if (!this.sharedNodes.has(layoutId)) {\r\n this.sharedNodes.set(layoutId, new NodeStack());\r\n }\r\n const stack = this.sharedNodes.get(layoutId);\r\n stack.add(node);\r\n const config = node.options.initialPromotionConfig;\r\n node.promote({\r\n transition: config ? config.transition : undefined,\r\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\r\n ? config.shouldPreserveFollowOpacity(node)\r\n : undefined,\r\n });\r\n }\r\n isLead() {\r\n const stack = this.getStack();\r\n return stack ? stack.lead === this : true;\r\n }\r\n getLead() {\r\n var _a;\r\n const { layoutId } = this.options;\r\n return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;\r\n }\r\n getPrevLead() {\r\n var _a;\r\n const { layoutId } = this.options;\r\n return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;\r\n }\r\n getStack() {\r\n const { layoutId } = this.options;\r\n if (layoutId)\r\n return this.root.sharedNodes.get(layoutId);\r\n }\r\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\r\n const stack = this.getStack();\r\n if (stack)\r\n stack.promote(this, preserveFollowOpacity);\r\n if (needsReset) {\r\n this.projectionDelta = undefined;\r\n this.needsReset = true;\r\n }\r\n if (transition)\r\n this.setOptions({ transition });\r\n }\r\n relegate() {\r\n const stack = this.getStack();\r\n if (stack) {\r\n return stack.relegate(this);\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n resetRotation() {\r\n const { visualElement } = this.options;\r\n if (!visualElement)\r\n return;\r\n // If there's no detected rotation values, we can early return without a forced render.\r\n let hasRotate = false;\r\n /**\r\n * An unrolled check for rotation values. Most elements don't have any rotation and\r\n * skipping the nested loop and new object creation is 50% faster.\r\n */\r\n const { latestValues } = visualElement;\r\n if (latestValues.rotate ||\r\n latestValues.rotateX ||\r\n latestValues.rotateY ||\r\n latestValues.rotateZ) {\r\n hasRotate = true;\r\n }\r\n // If there's no rotation values, we don't need to do any more.\r\n if (!hasRotate)\r\n return;\r\n const resetValues = {};\r\n // Check the rotate value of all axes and reset to 0\r\n for (let i = 0; i < transformAxes.length; i++) {\r\n const key = \"rotate\" + transformAxes[i];\r\n // Record the rotation and then temporarily set it to 0\r\n if (latestValues[key]) {\r\n resetValues[key] = latestValues[key];\r\n visualElement.setStaticValue(key, 0);\r\n }\r\n }\r\n // Force a render of this element to apply the transform with all rotations\r\n // set to 0.\r\n visualElement.render();\r\n // Put back all the values we reset\r\n for (const key in resetValues) {\r\n visualElement.setStaticValue(key, resetValues[key]);\r\n }\r\n // Schedule a render for the next frame. This ensures we won't visually\r\n // see the element with the reset rotate value applied.\r\n visualElement.scheduleRender();\r\n }\r\n getProjectionStyles(styleProp) {\r\n var _a, _b;\r\n if (!this.instance || this.isSVG)\r\n return undefined;\r\n if (!this.isVisible) {\r\n return hiddenVisibility;\r\n }\r\n const styles = {\r\n visibility: \"\",\r\n };\r\n const transformTemplate = this.getTransformTemplate();\r\n if (this.needsReset) {\r\n this.needsReset = false;\r\n styles.opacity = \"\";\r\n styles.pointerEvents =\r\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\r\n styles.transform = transformTemplate\r\n ? transformTemplate(this.latestValues, \"\")\r\n : \"none\";\r\n return styles;\r\n }\r\n const lead = this.getLead();\r\n if (!this.projectionDelta || !this.layout || !lead.target) {\r\n const emptyStyles = {};\r\n if (this.options.layoutId) {\r\n emptyStyles.opacity =\r\n this.latestValues.opacity !== undefined\r\n ? this.latestValues.opacity\r\n : 1;\r\n emptyStyles.pointerEvents =\r\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\r\n }\r\n if (this.hasProjected && !hasTransform(this.latestValues)) {\r\n emptyStyles.transform = transformTemplate\r\n ? transformTemplate({}, \"\")\r\n : \"none\";\r\n this.hasProjected = false;\r\n }\r\n return emptyStyles;\r\n }\r\n const valuesToRender = lead.animationValues || lead.latestValues;\r\n this.applyTransformsToTarget();\r\n styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\r\n if (transformTemplate) {\r\n styles.transform = transformTemplate(valuesToRender, styles.transform);\r\n }\r\n const { x, y } = this.projectionDelta;\r\n styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\r\n if (lead.animationValues) {\r\n /**\r\n * If the lead component is animating, assign this either the entering/leaving\r\n * opacity\r\n */\r\n styles.opacity =\r\n lead === this\r\n ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1\r\n : this.preserveOpacity\r\n ? this.latestValues.opacity\r\n : valuesToRender.opacityExit;\r\n }\r\n else {\r\n /**\r\n * Or we're not animating at all, set the lead component to its layout\r\n * opacity and other components to hidden.\r\n */\r\n styles.opacity =\r\n lead === this\r\n ? valuesToRender.opacity !== undefined\r\n ? valuesToRender.opacity\r\n : \"\"\r\n : valuesToRender.opacityExit !== undefined\r\n ? valuesToRender.opacityExit\r\n : 0;\r\n }\r\n /**\r\n * Apply scale correction\r\n */\r\n for (const key in scaleCorrectors) {\r\n if (valuesToRender[key] === undefined)\r\n continue;\r\n const { correct, applyTo } = scaleCorrectors[key];\r\n /**\r\n * Only apply scale correction to the value if we have an\r\n * active projection transform. Otherwise these values become\r\n * vulnerable to distortion if the element changes size without\r\n * a corresponding layout animation.\r\n */\r\n const corrected = styles.transform === \"none\"\r\n ? valuesToRender[key]\r\n : correct(valuesToRender[key], lead);\r\n if (applyTo) {\r\n const num = applyTo.length;\r\n for (let i = 0; i < num; i++) {\r\n styles[applyTo[i]] = corrected;\r\n }\r\n }\r\n else {\r\n styles[key] = corrected;\r\n }\r\n }\r\n /**\r\n * Disable pointer events on follow components. This is to ensure\r\n * that if a follow component covers a lead component it doesn't block\r\n * pointer events on the lead.\r\n */\r\n if (this.options.layoutId) {\r\n styles.pointerEvents =\r\n lead === this\r\n ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\"\r\n : \"none\";\r\n }\r\n return styles;\r\n }\r\n clearSnapshot() {\r\n this.resumeFrom = this.snapshot = undefined;\r\n }\r\n // Only run on root\r\n resetTree() {\r\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\r\n this.root.nodes.forEach(clearMeasurements);\r\n this.root.sharedNodes.clear();\r\n }\r\n };\r\n}\r\nfunction updateLayout(node) {\r\n node.updateLayout();\r\n}\r\nfunction notifyLayoutUpdate(node) {\r\n var _a;\r\n const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;\r\n if (node.isLead() &&\r\n node.layout &&\r\n snapshot &&\r\n node.hasListeners(\"didUpdate\")) {\r\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\r\n const { animationType } = node.options;\r\n const isShared = snapshot.source !== node.layout.source;\r\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\r\n // animations for instance if layout=\"size\" and an element has only changed position\r\n if (animationType === \"size\") {\r\n eachAxis((axis) => {\r\n const axisSnapshot = isShared\r\n ? snapshot.measuredBox[axis]\r\n : snapshot.layoutBox[axis];\r\n const length = calcLength(axisSnapshot);\r\n axisSnapshot.min = layout[axis].min;\r\n axisSnapshot.max = axisSnapshot.min + length;\r\n });\r\n }\r\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\r\n eachAxis((axis) => {\r\n const axisSnapshot = isShared\r\n ? snapshot.measuredBox[axis]\r\n : snapshot.layoutBox[axis];\r\n const length = calcLength(layout[axis]);\r\n axisSnapshot.max = axisSnapshot.min + length;\r\n /**\r\n * Ensure relative target gets resized and rerendererd\r\n */\r\n if (node.relativeTarget && !node.currentAnimation) {\r\n node.isProjectionDirty = true;\r\n node.relativeTarget[axis].max =\r\n node.relativeTarget[axis].min + length;\r\n }\r\n });\r\n }\r\n const layoutDelta = createDelta();\r\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\r\n const visualDelta = createDelta();\r\n if (isShared) {\r\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\r\n }\r\n else {\r\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\r\n }\r\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\r\n let hasRelativeTargetChanged = false;\r\n if (!node.resumeFrom) {\r\n const relativeParent = node.getClosestProjectingParent();\r\n /**\r\n * If the relativeParent is itself resuming from a different element then\r\n * the relative snapshot is not relavent\r\n */\r\n if (relativeParent && !relativeParent.resumeFrom) {\r\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\r\n if (parentSnapshot && parentLayout) {\r\n const relativeSnapshot = createBox();\r\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\r\n const relativeLayout = createBox();\r\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\r\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\r\n hasRelativeTargetChanged = true;\r\n }\r\n if (relativeParent.options.layoutRoot) {\r\n node.relativeTarget = relativeLayout;\r\n node.relativeTargetOrigin = relativeSnapshot;\r\n node.relativeParent = relativeParent;\r\n }\r\n }\r\n }\r\n }\r\n node.notifyListeners(\"didUpdate\", {\r\n layout,\r\n snapshot,\r\n delta: visualDelta,\r\n layoutDelta,\r\n hasLayoutChanged,\r\n hasRelativeTargetChanged,\r\n });\r\n }\r\n else if (node.isLead()) {\r\n const { onExitComplete } = node.options;\r\n onExitComplete && onExitComplete();\r\n }\r\n /**\r\n * Clearing transition\r\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\r\n * and why we need it at all\r\n */\r\n node.options.transition = undefined;\r\n}\r\nfunction propagateDirtyNodes(node) {\r\n /**\r\n * Increase debug counter for nodes encountered this frame\r\n */\r\n projectionFrameData.totalNodes++;\r\n if (!node.parent)\r\n return;\r\n /**\r\n * If this node isn't projecting, propagate isProjectionDirty. It will have\r\n * no performance impact but it will allow the next child that *is* projecting\r\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\r\n * correcting.\r\n */\r\n if (!node.isProjecting()) {\r\n node.isProjectionDirty = node.parent.isProjectionDirty;\r\n }\r\n /**\r\n * Propagate isSharedProjectionDirty and isTransformDirty\r\n * throughout the whole tree. A future revision can take another look at\r\n * this but for safety we still recalcualte shared nodes.\r\n */\r\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\r\n node.parent.isProjectionDirty ||\r\n node.parent.isSharedProjectionDirty));\r\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\r\n}\r\nfunction cleanDirtyNodes(node) {\r\n node.isProjectionDirty =\r\n node.isSharedProjectionDirty =\r\n node.isTransformDirty =\r\n false;\r\n}\r\nfunction clearSnapshot(node) {\r\n node.clearSnapshot();\r\n}\r\nfunction clearMeasurements(node) {\r\n node.clearMeasurements();\r\n}\r\nfunction clearIsLayoutDirty(node) {\r\n node.isLayoutDirty = false;\r\n}\r\nfunction resetTransformStyle(node) {\r\n const { visualElement } = node.options;\r\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\r\n visualElement.notify(\"BeforeLayoutMeasure\");\r\n }\r\n node.resetTransform();\r\n}\r\nfunction finishAnimation(node) {\r\n node.finishAnimation();\r\n node.targetDelta = node.relativeTarget = node.target = undefined;\r\n node.isProjectionDirty = true;\r\n}\r\nfunction resolveTargetDelta(node) {\r\n node.resolveTargetDelta();\r\n}\r\nfunction calcProjection(node) {\r\n node.calcProjection();\r\n}\r\nfunction resetRotation(node) {\r\n node.resetRotation();\r\n}\r\nfunction removeLeadSnapshots(stack) {\r\n stack.removeLeadSnapshot();\r\n}\r\nfunction mixAxisDelta(output, delta, p) {\r\n output.translate = mix(delta.translate, 0, p);\r\n output.scale = mix(delta.scale, 1, p);\r\n output.origin = delta.origin;\r\n output.originPoint = delta.originPoint;\r\n}\r\nfunction mixAxis(output, from, to, p) {\r\n output.min = mix(from.min, to.min, p);\r\n output.max = mix(from.max, to.max, p);\r\n}\r\nfunction mixBox(output, from, to, p) {\r\n mixAxis(output.x, from.x, to.x, p);\r\n mixAxis(output.y, from.y, to.y, p);\r\n}\r\nfunction hasOpacityCrossfade(node) {\r\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\r\n}\r\nconst defaultLayoutTransition = {\r\n duration: 0.45,\r\n ease: [0.4, 0, 0.1, 1],\r\n};\r\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\r\n navigator.userAgent.toLowerCase().includes(string);\r\n/**\r\n * Measured bounding boxes must be rounded in Safari and\r\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\r\n * can appear to jump.\r\n */\r\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\r\n ? Math.round\r\n : noop;\r\nfunction roundAxis(axis) {\r\n // Round to the nearest .5 pixels to support subpixel layouts\r\n axis.min = roundPoint(axis.min);\r\n axis.max = roundPoint(axis.max);\r\n}\r\nfunction roundBox(box) {\r\n roundAxis(box.x);\r\n roundAxis(box.y);\r\n}\r\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\r\n return (animationType === \"position\" ||\r\n (animationType === \"preserve-aspect\" &&\r\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\r\n}\r\n\r\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\r\n","import { createProjectionNode } from './create-projection-node.mjs';\r\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\r\n\r\nconst DocumentProjectionNode = createProjectionNode({\r\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\r\n measureScroll: () => ({\r\n x: document.documentElement.scrollLeft || document.body.scrollLeft,\r\n y: document.documentElement.scrollTop || document.body.scrollTop,\r\n }),\r\n checkIsScrollRoot: () => true,\r\n});\r\n\r\nexport { DocumentProjectionNode };\r\n","import { createProjectionNode } from './create-projection-node.mjs';\r\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\r\n\r\nconst rootProjectionNode = {\r\n current: undefined,\r\n};\r\nconst HTMLProjectionNode = createProjectionNode({\r\n measureScroll: (instance) => ({\r\n x: instance.scrollLeft,\r\n y: instance.scrollTop,\r\n }),\r\n defaultParent: () => {\r\n if (!rootProjectionNode.current) {\r\n const documentNode = new DocumentProjectionNode({});\r\n documentNode.mount(window);\r\n documentNode.setOptions({ layoutScroll: true });\r\n rootProjectionNode.current = documentNode;\r\n }\r\n return rootProjectionNode.current;\r\n },\r\n resetTransform: (instance, value) => {\r\n instance.style.transform = value !== undefined ? value : \"none\";\r\n },\r\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\r\n});\r\n\r\nexport { HTMLProjectionNode, rootProjectionNode };\r\n","import { DragGesture } from '../../gestures/drag/index.mjs';\r\nimport { PanGesture } from '../../gestures/pan/index.mjs';\r\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\r\nimport { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\r\n\r\nconst drag = {\r\n pan: {\r\n Feature: PanGesture,\r\n },\r\n drag: {\r\n Feature: DragGesture,\r\n ProjectionNode: HTMLProjectionNode,\r\n MeasureLayout,\r\n },\r\n};\r\n\r\nexport { drag };\r\n","import { invariant } from '../../../utils/errors.mjs';\r\nimport { isNumericalString } from '../../../utils/is-numerical-string.mjs';\r\nimport { isCSSVariableToken } from './is-css-variable.mjs';\r\n\r\n/**\r\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\r\n *\r\n * ```\r\n * `var(--foo, #fff)` => [`--foo`, '#fff']\r\n * ```\r\n *\r\n * @param current\r\n */\r\nconst splitCSSVariableRegex = /var\\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\\)/;\r\nfunction parseCSSVariable(current) {\r\n const match = splitCSSVariableRegex.exec(current);\r\n if (!match)\r\n return [,];\r\n const [, token, fallback] = match;\r\n return [token, fallback];\r\n}\r\nconst maxDepth = 4;\r\nfunction getVariableValue(current, element, depth = 1) {\r\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`);\r\n const [token, fallback] = parseCSSVariable(current);\r\n // No CSS variable detected\r\n if (!token)\r\n return;\r\n // Attempt to read this CSS variable off the element\r\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\r\n if (resolved) {\r\n const trimmed = resolved.trim();\r\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\r\n }\r\n else if (isCSSVariableToken(fallback)) {\r\n // The fallback might itself be a CSS variable, in which case we attempt to resolve it too.\r\n return getVariableValue(fallback, element, depth + 1);\r\n }\r\n else {\r\n return fallback;\r\n }\r\n}\r\n/**\r\n * Resolve CSS variables from\r\n *\r\n * @internal\r\n */\r\nfunction resolveCSSVariables(visualElement, { ...target }, transitionEnd) {\r\n const element = visualElement.current;\r\n if (!(element instanceof Element))\r\n return { target, transitionEnd };\r\n // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd`\r\n // only if they change but I think this reads clearer and this isn't a performance-critical path.\r\n if (transitionEnd) {\r\n transitionEnd = { ...transitionEnd };\r\n }\r\n // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved\r\n visualElement.values.forEach((value) => {\r\n const current = value.get();\r\n if (!isCSSVariableToken(current))\r\n return;\r\n const resolved = getVariableValue(current, element);\r\n if (resolved)\r\n value.set(resolved);\r\n });\r\n // Cycle through every target property and resolve CSS variables. Currently\r\n // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)`\r\n for (const key in target) {\r\n const current = target[key];\r\n if (!isCSSVariableToken(current))\r\n continue;\r\n const resolved = getVariableValue(current, element);\r\n if (!resolved)\r\n continue;\r\n // Clone target if it hasn't already been\r\n target[key] = resolved;\r\n if (!transitionEnd)\r\n transitionEnd = {};\r\n // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved\r\n // CSS variable. This will ensure that after the animation the component will reflect\r\n // changes in the value of the CSS variable.\r\n if (transitionEnd[key] === undefined) {\r\n transitionEnd[key] = current;\r\n }\r\n }\r\n return { target, transitionEnd };\r\n}\r\n\r\nexport { parseCSSVariable, resolveCSSVariables };\r\n","import { isKeyframesTarget } from '../../../animation/utils/is-keyframes-target.mjs';\r\nimport { invariant } from '../../../utils/errors.mjs';\r\nimport { transformPropOrder } from '../../html/utils/transform.mjs';\r\nimport { findDimensionValueType } from '../value-types/dimensions.mjs';\r\nimport { isBrowser } from '../../../utils/is-browser.mjs';\r\nimport { number } from '../../../value/types/numbers/index.mjs';\r\nimport { px } from '../../../value/types/numbers/units.mjs';\r\n\r\nconst positionalKeys = new Set([\r\n \"width\",\r\n \"height\",\r\n \"top\",\r\n \"left\",\r\n \"right\",\r\n \"bottom\",\r\n \"x\",\r\n \"y\",\r\n \"translateX\",\r\n \"translateY\",\r\n]);\r\nconst isPositionalKey = (key) => positionalKeys.has(key);\r\nconst hasPositionalKey = (target) => {\r\n return Object.keys(target).some(isPositionalKey);\r\n};\r\nconst isNumOrPxType = (v) => v === number || v === px;\r\nconst getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(\", \")[pos]);\r\nconst getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {\r\n if (transform === \"none\" || !transform)\r\n return 0;\r\n const matrix3d = transform.match(/^matrix3d\\((.+)\\)$/);\r\n if (matrix3d) {\r\n return getPosFromMatrix(matrix3d[1], pos3);\r\n }\r\n else {\r\n const matrix = transform.match(/^matrix\\((.+)\\)$/);\r\n if (matrix) {\r\n return getPosFromMatrix(matrix[1], pos2);\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n};\r\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\r\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\r\nfunction removeNonTranslationalTransform(visualElement) {\r\n const removedTransforms = [];\r\n nonTranslationalTransformKeys.forEach((key) => {\r\n const value = visualElement.getValue(key);\r\n if (value !== undefined) {\r\n removedTransforms.push([key, value.get()]);\r\n value.set(key.startsWith(\"scale\") ? 1 : 0);\r\n }\r\n });\r\n // Apply changes to element before measurement\r\n if (removedTransforms.length)\r\n visualElement.render();\r\n return removedTransforms;\r\n}\r\nconst positionalValues = {\r\n // Dimensions\r\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\r\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\r\n top: (_bbox, { top }) => parseFloat(top),\r\n left: (_bbox, { left }) => parseFloat(left),\r\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\r\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\r\n // Transform\r\n x: getTranslateFromMatrix(4, 13),\r\n y: getTranslateFromMatrix(5, 14),\r\n};\r\n// Alias translate longform names\r\npositionalValues.translateX = positionalValues.x;\r\npositionalValues.translateY = positionalValues.y;\r\nconst convertChangedValueTypes = (target, visualElement, changedKeys) => {\r\n const originBbox = visualElement.measureViewportBox();\r\n const element = visualElement.current;\r\n const elementComputedStyle = getComputedStyle(element);\r\n const { display } = elementComputedStyle;\r\n const origin = {};\r\n // If the element is currently set to display: \"none\", make it visible before\r\n // measuring the target bounding box\r\n if (display === \"none\") {\r\n visualElement.setStaticValue(\"display\", target.display || \"block\");\r\n }\r\n /**\r\n * Record origins before we render and update styles\r\n */\r\n changedKeys.forEach((key) => {\r\n origin[key] = positionalValues[key](originBbox, elementComputedStyle);\r\n });\r\n // Apply the latest values (as set in checkAndConvertChangedValueTypes)\r\n visualElement.render();\r\n const targetBbox = visualElement.measureViewportBox();\r\n changedKeys.forEach((key) => {\r\n // Restore styles to their **calculated computed style**, not their actual\r\n // originally set style. This allows us to animate between equivalent pixel units.\r\n const value = visualElement.getValue(key);\r\n value && value.jump(origin[key]);\r\n target[key] = positionalValues[key](targetBbox, elementComputedStyle);\r\n });\r\n return target;\r\n};\r\nconst checkAndConvertChangedValueTypes = (visualElement, target, origin = {}, transitionEnd = {}) => {\r\n target = { ...target };\r\n transitionEnd = { ...transitionEnd };\r\n const targetPositionalKeys = Object.keys(target).filter(isPositionalKey);\r\n // We want to remove any transform values that could affect the element's bounding box before\r\n // it's measured. We'll reapply these later.\r\n let removedTransformValues = [];\r\n let hasAttemptedToRemoveTransformValues = false;\r\n const changedValueTypeKeys = [];\r\n targetPositionalKeys.forEach((key) => {\r\n const value = visualElement.getValue(key);\r\n if (!visualElement.hasValue(key))\r\n return;\r\n let from = origin[key];\r\n let fromType = findDimensionValueType(from);\r\n const to = target[key];\r\n let toType;\r\n // TODO: The current implementation of this basically throws an error\r\n // if you try and do value conversion via keyframes. There's probably\r\n // a way of doing this but the performance implications would need greater scrutiny,\r\n // as it'd be doing multiple resize-remeasure operations.\r\n if (isKeyframesTarget(to)) {\r\n const numKeyframes = to.length;\r\n const fromIndex = to[0] === null ? 1 : 0;\r\n from = to[fromIndex];\r\n fromType = findDimensionValueType(from);\r\n for (let i = fromIndex; i < numKeyframes; i++) {\r\n /**\r\n * Don't allow wildcard keyframes to be used to detect\r\n * a difference in value types.\r\n */\r\n if (to[i] === null)\r\n break;\r\n if (!toType) {\r\n toType = findDimensionValueType(to[i]);\r\n invariant(toType === fromType ||\r\n (isNumOrPxType(fromType) && isNumOrPxType(toType)), \"Keyframes must be of the same dimension as the current value\");\r\n }\r\n else {\r\n invariant(findDimensionValueType(to[i]) === toType, \"All keyframes must be of the same type\");\r\n }\r\n }\r\n }\r\n else {\r\n toType = findDimensionValueType(to);\r\n }\r\n if (fromType !== toType) {\r\n // If they're both just number or px, convert them both to numbers rather than\r\n // relying on resize/remeasure to convert (which is wasteful in this situation)\r\n if (isNumOrPxType(fromType) && isNumOrPxType(toType)) {\r\n const current = value.get();\r\n if (typeof current === \"string\") {\r\n value.set(parseFloat(current));\r\n }\r\n if (typeof to === \"string\") {\r\n target[key] = parseFloat(to);\r\n }\r\n else if (Array.isArray(to) && toType === px) {\r\n target[key] = to.map(parseFloat);\r\n }\r\n }\r\n else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) &&\r\n (toType === null || toType === void 0 ? void 0 : toType.transform) &&\r\n (from === 0 || to === 0)) {\r\n // If one or the other value is 0, it's safe to coerce it to the\r\n // type of the other without measurement\r\n if (from === 0) {\r\n value.set(toType.transform(from));\r\n }\r\n else {\r\n target[key] = fromType.transform(to);\r\n }\r\n }\r\n else {\r\n // If we're going to do value conversion via DOM measurements, we first\r\n // need to remove non-positional transform values that could affect the bbox measurements.\r\n if (!hasAttemptedToRemoveTransformValues) {\r\n removedTransformValues =\r\n removeNonTranslationalTransform(visualElement);\r\n hasAttemptedToRemoveTransformValues = true;\r\n }\r\n changedValueTypeKeys.push(key);\r\n transitionEnd[key] =\r\n transitionEnd[key] !== undefined\r\n ? transitionEnd[key]\r\n : target[key];\r\n value.jump(to);\r\n }\r\n }\r\n });\r\n if (changedValueTypeKeys.length) {\r\n const scrollY = changedValueTypeKeys.indexOf(\"height\") >= 0\r\n ? window.pageYOffset\r\n : null;\r\n const convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);\r\n // If we removed transform values, reapply them before the next render\r\n if (removedTransformValues.length) {\r\n removedTransformValues.forEach(([key, value]) => {\r\n visualElement.getValue(key).set(value);\r\n });\r\n }\r\n // Reapply original values\r\n visualElement.render();\r\n // Restore scroll position\r\n if (isBrowser && scrollY !== null) {\r\n window.scrollTo({ top: scrollY });\r\n }\r\n return { target: convertedTarget, transitionEnd };\r\n }\r\n else {\r\n return { target, transitionEnd };\r\n }\r\n};\r\n/**\r\n * Convert value types for x/y/width/height/top/left/bottom/right\r\n *\r\n * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'`\r\n *\r\n * @internal\r\n */\r\nfunction unitConversion(visualElement, target, origin, transitionEnd) {\r\n return hasPositionalKey(target)\r\n ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd)\r\n : { target, transitionEnd };\r\n}\r\n\r\nexport { positionalValues, unitConversion };\r\n","import { resolveCSSVariables } from './css-variables-conversion.mjs';\r\nimport { unitConversion } from './unit-conversion.mjs';\r\n\r\n/**\r\n * Parse a DOM variant to make it animatable. This involves resolving CSS variables\r\n * and ensuring animations like \"20%\" => \"calc(50vw)\" are performed in pixels.\r\n */\r\nconst parseDomVariant = (visualElement, target, origin, transitionEnd) => {\r\n const resolved = resolveCSSVariables(visualElement, target, transitionEnd);\r\n target = resolved.target;\r\n transitionEnd = resolved.transitionEnd;\r\n return unitConversion(visualElement, target, origin, transitionEnd);\r\n};\r\n\r\nexport { parseDomVariant };\r\n","// Does this device prefer reduced motion? Returns `null` server-side.\r\nconst prefersReducedMotion = { current: null };\r\nconst hasReducedMotionListener = { current: false };\r\n\r\nexport { hasReducedMotionListener, prefersReducedMotion };\r\n","import { isBrowser } from '../is-browser.mjs';\r\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\r\n\r\nfunction initPrefersReducedMotion() {\r\n hasReducedMotionListener.current = true;\r\n if (!isBrowser)\r\n return;\r\n if (window.matchMedia) {\r\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\r\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\r\n motionMediaQuery.addListener(setReducedMotionPreferences);\r\n setReducedMotionPreferences();\r\n }\r\n else {\r\n prefersReducedMotion.current = false;\r\n }\r\n}\r\n\r\nexport { initPrefersReducedMotion };\r\n","import { isWillChangeMotionValue } from '../../value/use-will-change/is.mjs';\r\nimport { warnOnce } from '../../utils/warn-once.mjs';\r\nimport { motionValue } from '../../value/index.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction updateMotionValuesFromProps(element, next, prev) {\r\n const { willChange } = next;\r\n for (const key in next) {\r\n const nextValue = next[key];\r\n const prevValue = prev[key];\r\n if (isMotionValue(nextValue)) {\r\n /**\r\n * If this is a motion value found in props or style, we want to add it\r\n * to our visual element's motion value map.\r\n */\r\n element.addValue(key, nextValue);\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.add(key);\r\n }\r\n /**\r\n * Check the version of the incoming motion value with this version\r\n * and warn against mismatches.\r\n */\r\n if (process.env.NODE_ENV === \"development\") {\r\n warnOnce(nextValue.version === \"10.18.0\", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.18.0 may not work as expected.`);\r\n }\r\n }\r\n else if (isMotionValue(prevValue)) {\r\n /**\r\n * If we're swapping from a motion value to a static value,\r\n * create a new motion value from that\r\n */\r\n element.addValue(key, motionValue(nextValue, { owner: element }));\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.remove(key);\r\n }\r\n }\r\n else if (prevValue !== nextValue) {\r\n /**\r\n * If this is a flat value that has changed, update the motion value\r\n * or create one if it doesn't exist. We only want to do this if we're\r\n * not handling the value with our animation state.\r\n */\r\n if (element.hasValue(key)) {\r\n const existingValue = element.getValue(key);\r\n // TODO: Only update values that aren't being animated or even looked at\r\n !existingValue.hasAnimated && existingValue.set(nextValue);\r\n }\r\n else {\r\n const latestValue = element.getStaticValue(key);\r\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\r\n }\r\n }\r\n }\r\n // Handle removed values\r\n for (const key in prev) {\r\n if (next[key] === undefined)\r\n element.removeValue(key);\r\n }\r\n return next;\r\n}\r\n\r\nexport { updateMotionValuesFromProps };\r\n","const visualElementStore = new WeakMap();\r\n\r\nexport { visualElementStore };\r\n","import { warning, invariant } from '../utils/errors.mjs';\r\nimport { createBox } from '../projection/geometry/models.mjs';\r\nimport { isRefObject } from '../utils/is-ref-object.mjs';\r\nimport { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';\r\nimport { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';\r\nimport { SubscriptionManager } from '../utils/subscription-manager.mjs';\r\nimport { motionValue } from '../value/index.mjs';\r\nimport { isWillChangeMotionValue } from '../value/use-will-change/is.mjs';\r\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\r\nimport { transformProps } from './html/utils/transform.mjs';\r\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\r\nimport { isVariantLabel } from './utils/is-variant-label.mjs';\r\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\r\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\r\nimport { warnOnce } from '../utils/warn-once.mjs';\r\nimport { featureDefinitions } from '../motion/features/definitions.mjs';\r\nimport { variantProps } from './utils/variant-props.mjs';\r\nimport { visualElementStore } from './store.mjs';\r\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\r\n\r\nconst featureNames = Object.keys(featureDefinitions);\r\nconst numFeatures = featureNames.length;\r\nconst propEventHandlers = [\r\n \"AnimationStart\",\r\n \"AnimationComplete\",\r\n \"Update\",\r\n \"BeforeLayoutMeasure\",\r\n \"LayoutMeasure\",\r\n \"LayoutAnimationStart\",\r\n \"LayoutAnimationComplete\",\r\n];\r\nconst numVariantProps = variantProps.length;\r\n/**\r\n * A VisualElement is an imperative abstraction around UI elements such as\r\n * HTMLElement, SVGElement, Three.Object3D etc.\r\n */\r\nclass VisualElement {\r\n constructor({ parent, props, presenceContext, reducedMotionConfig, visualState, }, options = {}) {\r\n /**\r\n * A reference to the current underlying Instance, e.g. a HTMLElement\r\n * or Three.Mesh etc.\r\n */\r\n this.current = null;\r\n /**\r\n * A set containing references to this VisualElement's children.\r\n */\r\n this.children = new Set();\r\n /**\r\n * Determine what role this visual element should take in the variant tree.\r\n */\r\n this.isVariantNode = false;\r\n this.isControllingVariants = false;\r\n /**\r\n * Decides whether this VisualElement should animate in reduced motion\r\n * mode.\r\n *\r\n * TODO: This is currently set on every individual VisualElement but feels\r\n * like it could be set globally.\r\n */\r\n this.shouldReduceMotion = null;\r\n /**\r\n * A map of all motion values attached to this visual element. Motion\r\n * values are source of truth for any given animated value. A motion\r\n * value might be provided externally by the component via props.\r\n */\r\n this.values = new Map();\r\n /**\r\n * Cleanup functions for active features (hover/tap/exit etc)\r\n */\r\n this.features = {};\r\n /**\r\n * A map of every subscription that binds the provided or generated\r\n * motion values onChange listeners to this visual element.\r\n */\r\n this.valueSubscriptions = new Map();\r\n /**\r\n * A reference to the previously-provided motion values as returned\r\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\r\n * if any motion values need to be removed after props are updated.\r\n */\r\n this.prevMotionValues = {};\r\n /**\r\n * An object containing a SubscriptionManager for each active event.\r\n */\r\n this.events = {};\r\n /**\r\n * An object containing an unsubscribe function for each prop event subscription.\r\n * For example, every \"Update\" event can have multiple subscribers via\r\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\r\n */\r\n this.propEventSubscriptions = {};\r\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\r\n this.render = () => {\r\n if (!this.current)\r\n return;\r\n this.triggerBuild();\r\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\r\n };\r\n this.scheduleRender = () => frame.render(this.render, false, true);\r\n const { latestValues, renderState } = visualState;\r\n this.latestValues = latestValues;\r\n this.baseTarget = { ...latestValues };\r\n this.initialValues = props.initial ? { ...latestValues } : {};\r\n this.renderState = renderState;\r\n this.parent = parent;\r\n this.props = props;\r\n this.presenceContext = presenceContext;\r\n this.depth = parent ? parent.depth + 1 : 0;\r\n this.reducedMotionConfig = reducedMotionConfig;\r\n this.options = options;\r\n this.isControllingVariants = isControllingVariants(props);\r\n this.isVariantNode = isVariantNode(props);\r\n if (this.isVariantNode) {\r\n this.variantChildren = new Set();\r\n }\r\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\r\n /**\r\n * Any motion values that are provided to the element when created\r\n * aren't yet bound to the element, as this would technically be impure.\r\n * However, we iterate through the motion values and set them to the\r\n * initial values for this component.\r\n *\r\n * TODO: This is impure and we should look at changing this to run on mount.\r\n * Doing so will break some tests but this isn't neccessarily a breaking change,\r\n * more a reflection of the test.\r\n */\r\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {});\r\n for (const key in initialMotionValues) {\r\n const value = initialMotionValues[key];\r\n if (latestValues[key] !== undefined && isMotionValue(value)) {\r\n value.set(latestValues[key], false);\r\n if (isWillChangeMotionValue(willChange)) {\r\n willChange.add(key);\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * This method takes React props and returns found MotionValues. For example, HTML\r\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\r\n *\r\n * This isn't an abstract method as it needs calling in the constructor, but it is\r\n * intended to be one.\r\n */\r\n scrapeMotionValuesFromProps(_props, _prevProps) {\r\n return {};\r\n }\r\n mount(instance) {\r\n this.current = instance;\r\n visualElementStore.set(instance, this);\r\n if (this.projection && !this.projection.instance) {\r\n this.projection.mount(instance);\r\n }\r\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\r\n this.removeFromVariantTree = this.parent.addVariantChild(this);\r\n }\r\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\r\n if (!hasReducedMotionListener.current) {\r\n initPrefersReducedMotion();\r\n }\r\n this.shouldReduceMotion =\r\n this.reducedMotionConfig === \"never\"\r\n ? false\r\n : this.reducedMotionConfig === \"always\"\r\n ? true\r\n : prefersReducedMotion.current;\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\");\r\n }\r\n if (this.parent)\r\n this.parent.children.add(this);\r\n this.update(this.props, this.presenceContext);\r\n }\r\n unmount() {\r\n visualElementStore.delete(this.current);\r\n this.projection && this.projection.unmount();\r\n cancelFrame(this.notifyUpdate);\r\n cancelFrame(this.render);\r\n this.valueSubscriptions.forEach((remove) => remove());\r\n this.removeFromVariantTree && this.removeFromVariantTree();\r\n this.parent && this.parent.children.delete(this);\r\n for (const key in this.events) {\r\n this.events[key].clear();\r\n }\r\n for (const key in this.features) {\r\n this.features[key].unmount();\r\n }\r\n this.current = null;\r\n }\r\n bindToMotionValue(key, value) {\r\n const valueIsTransform = transformProps.has(key);\r\n const removeOnChange = value.on(\"change\", (latestValue) => {\r\n this.latestValues[key] = latestValue;\r\n this.props.onUpdate &&\r\n frame.update(this.notifyUpdate, false, true);\r\n if (valueIsTransform && this.projection) {\r\n this.projection.isTransformDirty = true;\r\n }\r\n });\r\n const removeOnRenderRequest = value.on(\"renderRequest\", this.scheduleRender);\r\n this.valueSubscriptions.set(key, () => {\r\n removeOnChange();\r\n removeOnRenderRequest();\r\n });\r\n }\r\n sortNodePosition(other) {\r\n /**\r\n * If these nodes aren't even of the same type we can't compare their depth.\r\n */\r\n if (!this.current ||\r\n !this.sortInstanceNodePosition ||\r\n this.type !== other.type) {\r\n return 0;\r\n }\r\n return this.sortInstanceNodePosition(this.current, other.current);\r\n }\r\n loadFeatures({ children, ...renderedProps }, isStrict, preloadedFeatures, initialLayoutGroupConfig) {\r\n let ProjectionNodeConstructor;\r\n let MeasureLayout;\r\n /**\r\n * If we're in development mode, check to make sure we're not rendering a motion component\r\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\r\n */\r\n if (process.env.NODE_ENV !== \"production\" &&\r\n preloadedFeatures &&\r\n isStrict) {\r\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\r\n renderedProps.ignoreStrict\r\n ? warning(false, strictMessage)\r\n : invariant(false, strictMessage);\r\n }\r\n for (let i = 0; i < numFeatures; i++) {\r\n const name = featureNames[i];\r\n const { isEnabled, Feature: FeatureConstructor, ProjectionNode, MeasureLayout: MeasureLayoutComponent, } = featureDefinitions[name];\r\n if (ProjectionNode)\r\n ProjectionNodeConstructor = ProjectionNode;\r\n if (isEnabled(renderedProps)) {\r\n if (!this.features[name] && FeatureConstructor) {\r\n this.features[name] = new FeatureConstructor(this);\r\n }\r\n if (MeasureLayoutComponent) {\r\n MeasureLayout = MeasureLayoutComponent;\r\n }\r\n }\r\n }\r\n if ((this.type === \"html\" || this.type === \"svg\") &&\r\n !this.projection &&\r\n ProjectionNodeConstructor) {\r\n this.projection = new ProjectionNodeConstructor(this.latestValues, this.parent && this.parent.projection);\r\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = renderedProps;\r\n this.projection.setOptions({\r\n layoutId,\r\n layout,\r\n alwaysMeasureLayout: Boolean(drag) ||\r\n (dragConstraints && isRefObject(dragConstraints)),\r\n visualElement: this,\r\n scheduleRender: () => this.scheduleRender(),\r\n /**\r\n * TODO: Update options in an effect. This could be tricky as it'll be too late\r\n * to update by the time layout animations run.\r\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\r\n * ensuring it gets called if there's no potential layout animations.\r\n *\r\n */\r\n animationType: typeof layout === \"string\" ? layout : \"both\",\r\n initialPromotionConfig: initialLayoutGroupConfig,\r\n layoutScroll,\r\n layoutRoot,\r\n });\r\n }\r\n return MeasureLayout;\r\n }\r\n updateFeatures() {\r\n for (const key in this.features) {\r\n const feature = this.features[key];\r\n if (feature.isMounted) {\r\n feature.update();\r\n }\r\n else {\r\n feature.mount();\r\n feature.isMounted = true;\r\n }\r\n }\r\n }\r\n triggerBuild() {\r\n this.build(this.renderState, this.latestValues, this.options, this.props);\r\n }\r\n /**\r\n * Measure the current viewport box with or without transforms.\r\n * Only measures axis-aligned boxes, rotate and skew must be manually\r\n * removed with a re-render to work.\r\n */\r\n measureViewportBox() {\r\n return this.current\r\n ? this.measureInstanceViewportBox(this.current, this.props)\r\n : createBox();\r\n }\r\n getStaticValue(key) {\r\n return this.latestValues[key];\r\n }\r\n setStaticValue(key, value) {\r\n this.latestValues[key] = value;\r\n }\r\n /**\r\n * Make a target animatable by Popmotion. For instance, if we're\r\n * trying to animate width from 100px to 100vw we need to measure 100vw\r\n * in pixels to determine what we really need to animate to. This is also\r\n * pluggable to support Framer's custom value types like Color,\r\n * and CSS variables.\r\n */\r\n makeTargetAnimatable(target, canMutate = true) {\r\n return this.makeTargetAnimatableFromInstance(target, this.props, canMutate);\r\n }\r\n /**\r\n * Update the provided props. Ensure any newly-added motion values are\r\n * added to our map, old ones removed, and listeners updated.\r\n */\r\n update(props, presenceContext) {\r\n if (props.transformTemplate || this.props.transformTemplate) {\r\n this.scheduleRender();\r\n }\r\n this.prevProps = this.props;\r\n this.props = props;\r\n this.prevPresenceContext = this.presenceContext;\r\n this.presenceContext = presenceContext;\r\n /**\r\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\r\n */\r\n for (let i = 0; i < propEventHandlers.length; i++) {\r\n const key = propEventHandlers[i];\r\n if (this.propEventSubscriptions[key]) {\r\n this.propEventSubscriptions[key]();\r\n delete this.propEventSubscriptions[key];\r\n }\r\n const listener = props[\"on\" + key];\r\n if (listener) {\r\n this.propEventSubscriptions[key] = this.on(key, listener);\r\n }\r\n }\r\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps), this.prevMotionValues);\r\n if (this.handleChildMotionValue) {\r\n this.handleChildMotionValue();\r\n }\r\n }\r\n getProps() {\r\n return this.props;\r\n }\r\n /**\r\n * Returns the variant definition with a given name.\r\n */\r\n getVariant(name) {\r\n return this.props.variants ? this.props.variants[name] : undefined;\r\n }\r\n /**\r\n * Returns the defined default transition on this component.\r\n */\r\n getDefaultTransition() {\r\n return this.props.transition;\r\n }\r\n getTransformPagePoint() {\r\n return this.props.transformPagePoint;\r\n }\r\n getClosestVariantNode() {\r\n return this.isVariantNode\r\n ? this\r\n : this.parent\r\n ? this.parent.getClosestVariantNode()\r\n : undefined;\r\n }\r\n getVariantContext(startAtParent = false) {\r\n if (startAtParent) {\r\n return this.parent ? this.parent.getVariantContext() : undefined;\r\n }\r\n if (!this.isControllingVariants) {\r\n const context = this.parent\r\n ? this.parent.getVariantContext() || {}\r\n : {};\r\n if (this.props.initial !== undefined) {\r\n context.initial = this.props.initial;\r\n }\r\n return context;\r\n }\r\n const context = {};\r\n for (let i = 0; i < numVariantProps; i++) {\r\n const name = variantProps[i];\r\n const prop = this.props[name];\r\n if (isVariantLabel(prop) || prop === false) {\r\n context[name] = prop;\r\n }\r\n }\r\n return context;\r\n }\r\n /**\r\n * Add a child visual element to our set of children.\r\n */\r\n addVariantChild(child) {\r\n const closestVariantNode = this.getClosestVariantNode();\r\n if (closestVariantNode) {\r\n closestVariantNode.variantChildren &&\r\n closestVariantNode.variantChildren.add(child);\r\n return () => closestVariantNode.variantChildren.delete(child);\r\n }\r\n }\r\n /**\r\n * Add a motion value and bind it to this visual element.\r\n */\r\n addValue(key, value) {\r\n // Remove existing value if it exists\r\n if (value !== this.values.get(key)) {\r\n this.removeValue(key);\r\n this.bindToMotionValue(key, value);\r\n }\r\n this.values.set(key, value);\r\n this.latestValues[key] = value.get();\r\n }\r\n /**\r\n * Remove a motion value and unbind any active subscriptions.\r\n */\r\n removeValue(key) {\r\n this.values.delete(key);\r\n const unsubscribe = this.valueSubscriptions.get(key);\r\n if (unsubscribe) {\r\n unsubscribe();\r\n this.valueSubscriptions.delete(key);\r\n }\r\n delete this.latestValues[key];\r\n this.removeValueFromRenderState(key, this.renderState);\r\n }\r\n /**\r\n * Check whether we have a motion value for this key\r\n */\r\n hasValue(key) {\r\n return this.values.has(key);\r\n }\r\n getValue(key, defaultValue) {\r\n if (this.props.values && this.props.values[key]) {\r\n return this.props.values[key];\r\n }\r\n let value = this.values.get(key);\r\n if (value === undefined && defaultValue !== undefined) {\r\n value = motionValue(defaultValue, { owner: this });\r\n this.addValue(key, value);\r\n }\r\n return value;\r\n }\r\n /**\r\n * If we're trying to animate to a previously unencountered value,\r\n * we need to check for it in our state and as a last resort read it\r\n * directly from the instance (which might have performance implications).\r\n */\r\n readValue(key) {\r\n var _a;\r\n return this.latestValues[key] !== undefined || !this.current\r\n ? this.latestValues[key]\r\n : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options);\r\n }\r\n /**\r\n * Set the base target to later animate back to. This is currently\r\n * only hydrated on creation and when we first read a value.\r\n */\r\n setBaseTarget(key, value) {\r\n this.baseTarget[key] = value;\r\n }\r\n /**\r\n * Find the base target for a value thats been removed from all animation\r\n * props.\r\n */\r\n getBaseTarget(key) {\r\n var _a;\r\n const { initial } = this.props;\r\n const valueFromInitial = typeof initial === \"string\" || typeof initial === \"object\"\r\n ? (_a = resolveVariantFromProps(this.props, initial)) === null || _a === void 0 ? void 0 : _a[key]\r\n : undefined;\r\n /**\r\n * If this value still exists in the current initial variant, read that.\r\n */\r\n if (initial && valueFromInitial !== undefined) {\r\n return valueFromInitial;\r\n }\r\n /**\r\n * Alternatively, if this VisualElement config has defined a getBaseTarget\r\n * so we can read the value from an alternative source, try that.\r\n */\r\n const target = this.getBaseTargetFromProps(this.props, key);\r\n if (target !== undefined && !isMotionValue(target))\r\n return target;\r\n /**\r\n * If the value was initially defined on initial, but it doesn't any more,\r\n * return undefined. Otherwise return the value as initially read from the DOM.\r\n */\r\n return this.initialValues[key] !== undefined &&\r\n valueFromInitial === undefined\r\n ? undefined\r\n : this.baseTarget[key];\r\n }\r\n on(eventName, callback) {\r\n if (!this.events[eventName]) {\r\n this.events[eventName] = new SubscriptionManager();\r\n }\r\n return this.events[eventName].add(callback);\r\n }\r\n notify(eventName, ...args) {\r\n if (this.events[eventName]) {\r\n this.events[eventName].notify(...args);\r\n }\r\n }\r\n}\r\n\r\nexport { VisualElement };\r\n","import { getOrigin, checkTargetForNewValues } from '../utils/setters.mjs';\r\nimport { parseDomVariant } from './utils/parse-dom-variant.mjs';\r\nimport { VisualElement } from '../VisualElement.mjs';\r\n\r\nclass DOMVisualElement extends VisualElement {\r\n sortInstanceNodePosition(a, b) {\r\n /**\r\n * compareDocumentPosition returns a bitmask, by using the bitwise &\r\n * we're returning true if 2 in that bitmask is set to true. 2 is set\r\n * to true if b preceeds a.\r\n */\r\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\r\n }\r\n getBaseTargetFromProps(props, key) {\r\n return props.style ? props.style[key] : undefined;\r\n }\r\n removeValueFromRenderState(key, { vars, style }) {\r\n delete vars[key];\r\n delete style[key];\r\n }\r\n makeTargetAnimatableFromInstance({ transition, transitionEnd, ...target }, { transformValues }, isMounted) {\r\n let origin = getOrigin(target, transition || {}, this);\r\n /**\r\n * If Framer has provided a function to convert `Color` etc value types, convert them\r\n */\r\n if (transformValues) {\r\n if (transitionEnd)\r\n transitionEnd = transformValues(transitionEnd);\r\n if (target)\r\n target = transformValues(target);\r\n if (origin)\r\n origin = transformValues(origin);\r\n }\r\n if (isMounted) {\r\n checkTargetForNewValues(this, target, origin);\r\n const parsed = parseDomVariant(this, target, origin, transitionEnd);\r\n transitionEnd = parsed.transitionEnd;\r\n target = parsed.target;\r\n }\r\n return {\r\n transition,\r\n transitionEnd,\r\n ...target,\r\n };\r\n }\r\n}\r\n\r\nexport { DOMVisualElement };\r\n","import { buildHTMLStyles } from './utils/build-styles.mjs';\r\nimport { isCSSVariableName } from '../dom/utils/is-css-variable.mjs';\r\nimport { transformProps } from './utils/transform.mjs';\r\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { renderHTML } from './utils/render.mjs';\r\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\r\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\r\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction getComputedStyle(element) {\r\n return window.getComputedStyle(element);\r\n}\r\nclass HTMLVisualElement extends DOMVisualElement {\r\n constructor() {\r\n super(...arguments);\r\n this.type = \"html\";\r\n }\r\n readValueFromInstance(instance, key) {\r\n if (transformProps.has(key)) {\r\n const defaultType = getDefaultValueType(key);\r\n return defaultType ? defaultType.default || 0 : 0;\r\n }\r\n else {\r\n const computedStyle = getComputedStyle(instance);\r\n const value = (isCSSVariableName(key)\r\n ? computedStyle.getPropertyValue(key)\r\n : computedStyle[key]) || 0;\r\n return typeof value === \"string\" ? value.trim() : value;\r\n }\r\n }\r\n measureInstanceViewportBox(instance, { transformPagePoint }) {\r\n return measureViewportBox(instance, transformPagePoint);\r\n }\r\n build(renderState, latestValues, options, props) {\r\n buildHTMLStyles(renderState, latestValues, options, props.transformTemplate);\r\n }\r\n scrapeMotionValuesFromProps(props, prevProps) {\r\n return scrapeMotionValuesFromProps(props, prevProps);\r\n }\r\n handleChildMotionValue() {\r\n if (this.childSubscription) {\r\n this.childSubscription();\r\n delete this.childSubscription;\r\n }\r\n const { children } = this.props;\r\n if (isMotionValue(children)) {\r\n this.childSubscription = children.on(\"change\", (latest) => {\r\n if (this.current)\r\n this.current.textContent = `${latest}`;\r\n });\r\n }\r\n }\r\n renderInstance(instance, renderState, styleProp, projection) {\r\n renderHTML(instance, renderState, styleProp, projection);\r\n }\r\n}\r\n\r\nexport { HTMLVisualElement, getComputedStyle };\r\n","import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\r\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\r\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\r\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\r\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\r\nimport { transformProps } from '../html/utils/transform.mjs';\r\nimport { renderSVG } from './utils/render.mjs';\r\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\r\nimport { createBox } from '../../projection/geometry/models.mjs';\r\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\r\n\r\nclass SVGVisualElement extends DOMVisualElement {\r\n constructor() {\r\n super(...arguments);\r\n this.type = \"svg\";\r\n this.isSVGTag = false;\r\n }\r\n getBaseTargetFromProps(props, key) {\r\n return props[key];\r\n }\r\n readValueFromInstance(instance, key) {\r\n if (transformProps.has(key)) {\r\n const defaultType = getDefaultValueType(key);\r\n return defaultType ? defaultType.default || 0 : 0;\r\n }\r\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\r\n return instance.getAttribute(key);\r\n }\r\n measureInstanceViewportBox() {\r\n return createBox();\r\n }\r\n scrapeMotionValuesFromProps(props, prevProps) {\r\n return scrapeMotionValuesFromProps(props, prevProps);\r\n }\r\n build(renderState, latestValues, options, props) {\r\n buildSVGAttrs(renderState, latestValues, options, this.isSVGTag, props.transformTemplate);\r\n }\r\n renderInstance(instance, renderState, styleProp, projection) {\r\n renderSVG(instance, renderState, styleProp, projection);\r\n }\r\n mount(instance) {\r\n this.isSVGTag = isSVGTag(instance.tagName);\r\n super.mount(instance);\r\n }\r\n}\r\n\r\nexport { SVGVisualElement };\r\n","import { HTMLVisualElement } from '../html/HTMLVisualElement.mjs';\r\nimport { SVGVisualElement } from '../svg/SVGVisualElement.mjs';\r\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\r\n\r\nconst createDomVisualElement = (Component, options) => {\r\n return isSVGComponent(Component)\r\n ? new SVGVisualElement(options, { enableHardwareAcceleration: false })\r\n : new HTMLVisualElement(options, { enableHardwareAcceleration: true });\r\n};\r\n\r\nexport { createDomVisualElement };\r\n","import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\r\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\r\n\r\nconst layout = {\r\n layout: {\r\n ProjectionNode: HTMLProjectionNode,\r\n MeasureLayout,\r\n },\r\n};\r\n\r\nexport { layout };\r\n","import { createMotionComponent } from '../../motion/index.mjs';\r\nimport { createMotionProxy } from './motion-proxy.mjs';\r\nimport { createDomMotionConfig } from './utils/create-config.mjs';\r\nimport { gestureAnimations } from '../../motion/features/gestures.mjs';\r\nimport { animations } from '../../motion/features/animations.mjs';\r\nimport { drag } from '../../motion/features/drag.mjs';\r\nimport { createDomVisualElement } from './create-visual-element.mjs';\r\nimport { layout } from '../../motion/features/layout.mjs';\r\n\r\nconst preloadedFeatures = {\r\n ...animations,\r\n ...gestureAnimations,\r\n ...drag,\r\n ...layout,\r\n};\r\n/**\r\n * HTML & SVG components, optimised for use with gestures and animation. These can be used as\r\n * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported.\r\n *\r\n * @public\r\n */\r\nconst motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomMotionConfig(Component, config, preloadedFeatures, createDomVisualElement));\r\n/**\r\n * Create a DOM `motion` component with the provided string. This is primarily intended\r\n * as a full alternative to `motion` for consumers who have to support environments that don't\r\n * support `Proxy`.\r\n *\r\n * ```javascript\r\n * import { createDomMotionComponent } from \"framer-motion\"\r\n *\r\n * const motion = {\r\n * div: createDomMotionComponent('div')\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction createDomMotionComponent(key) {\r\n return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, preloadedFeatures, createDomVisualElement));\r\n}\r\n\r\nexport { createDomMotionComponent, motion };\r\n","import { createMotionProxy } from './motion-proxy.mjs';\r\nimport { createDomMotionConfig } from './utils/create-config.mjs';\r\n\r\n/**\r\n * @public\r\n */\r\nconst m = createMotionProxy(createDomMotionConfig);\r\n\r\nexport { m };\r\n","import { useRef } from 'react';\r\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs';\r\n\r\nfunction useIsMounted() {\r\n const isMounted = useRef(false);\r\n useIsomorphicLayoutEffect(() => {\r\n isMounted.current = true;\r\n return () => {\r\n isMounted.current = false;\r\n };\r\n }, []);\r\n return isMounted;\r\n}\r\n\r\nexport { useIsMounted };\r\n","import { useState, useCallback } from 'react';\r\nimport { useIsMounted } from './use-is-mounted.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction useForceUpdate() {\r\n const isMounted = useIsMounted();\r\n const [forcedRenderCount, setForcedRenderCount] = useState(0);\r\n const forceRender = useCallback(() => {\r\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1);\r\n }, [forcedRenderCount]);\r\n /**\r\n * Defer this to the end of the next animation frame in case there are multiple\r\n * synchronous calls.\r\n */\r\n const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]);\r\n return [deferredForceRender, forcedRenderCount];\r\n}\r\n\r\nexport { useForceUpdate };\r\n","import * as React from 'react';\r\nimport { useId, useRef, useInsertionEffect } from 'react';\r\n\r\n/**\r\n * Measurement functionality has to be within a separate component\r\n * to leverage snapshot lifecycle.\r\n */\r\nclass PopChildMeasure extends React.Component {\r\n getSnapshotBeforeUpdate(prevProps) {\r\n const element = this.props.childRef.current;\r\n if (element && prevProps.isPresent && !this.props.isPresent) {\r\n const size = this.props.sizeRef.current;\r\n size.height = element.offsetHeight || 0;\r\n size.width = element.offsetWidth || 0;\r\n size.top = element.offsetTop;\r\n size.left = element.offsetLeft;\r\n }\r\n return null;\r\n }\r\n /**\r\n * Required with getSnapshotBeforeUpdate to stop React complaining.\r\n */\r\n componentDidUpdate() { }\r\n render() {\r\n return this.props.children;\r\n }\r\n}\r\nfunction PopChild({ children, isPresent }) {\r\n const id = useId();\r\n const ref = useRef(null);\r\n const size = useRef({\r\n width: 0,\r\n height: 0,\r\n top: 0,\r\n left: 0,\r\n });\r\n /**\r\n * We create and inject a style block so we can apply this explicit\r\n * sizing in a non-destructive manner by just deleting the style block.\r\n *\r\n * We can't apply size via render as the measurement happens\r\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\r\n * styles directly on the DOM node, we might be overwriting\r\n * styles set via the style prop.\r\n */\r\n useInsertionEffect(() => {\r\n const { width, height, top, left } = size.current;\r\n if (isPresent || !ref.current || !width || !height)\r\n return;\r\n ref.current.dataset.motionPopId = id;\r\n const style = document.createElement(\"style\");\r\n document.head.appendChild(style);\r\n if (style.sheet) {\r\n style.sheet.insertRule(`\r\n [data-motion-pop-id=\"${id}\"] {\r\n position: absolute !important;\r\n width: ${width}px !important;\r\n height: ${height}px !important;\r\n top: ${top}px !important;\r\n left: ${left}px !important;\r\n }\r\n `);\r\n }\r\n return () => {\r\n document.head.removeChild(style);\r\n };\r\n }, [isPresent]);\r\n return (React.createElement(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size }, React.cloneElement(children, { ref })));\r\n}\r\n\r\nexport { PopChild };\r\n","import * as React from 'react';\r\nimport { useId, useMemo } from 'react';\r\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { PopChild } from './PopChild.mjs';\r\n\r\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\r\n const presenceChildren = useConstant(newChildrenMap);\r\n const id = useId();\r\n const context = useMemo(() => ({\r\n id,\r\n initial,\r\n isPresent,\r\n custom,\r\n onExitComplete: (childId) => {\r\n presenceChildren.set(childId, true);\r\n for (const isComplete of presenceChildren.values()) {\r\n if (!isComplete)\r\n return; // can stop searching when any is incomplete\r\n }\r\n onExitComplete && onExitComplete();\r\n },\r\n register: (childId) => {\r\n presenceChildren.set(childId, false);\r\n return () => presenceChildren.delete(childId);\r\n },\r\n }), \r\n /**\r\n * If the presence of a child affects the layout of the components around it,\r\n * we want to make a new context value to ensure they get re-rendered\r\n * so they can detect that layout change.\r\n */\r\n presenceAffectsLayout ? undefined : [isPresent]);\r\n useMemo(() => {\r\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\r\n }, [isPresent]);\r\n /**\r\n * If there's no `motion` components to fire exit animations, we want to remove this\r\n * component immediately.\r\n */\r\n React.useEffect(() => {\r\n !isPresent &&\r\n !presenceChildren.size &&\r\n onExitComplete &&\r\n onExitComplete();\r\n }, [isPresent]);\r\n if (mode === \"popLayout\") {\r\n children = React.createElement(PopChild, { isPresent: isPresent }, children);\r\n }\r\n return (React.createElement(PresenceContext.Provider, { value: context }, children));\r\n};\r\nfunction newChildrenMap() {\r\n return new Map();\r\n}\r\n\r\nexport { PresenceChild };\r\n","import { useEffect } from 'react';\r\n\r\nfunction useUnmountEffect(callback) {\r\n return useEffect(() => () => callback(), []);\r\n}\r\n\r\nexport { useUnmountEffect };\r\n","import * as React from 'react';\r\nimport { useContext, useRef, cloneElement, Children, isValidElement } from 'react';\r\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\r\nimport { useIsMounted } from '../../utils/use-is-mounted.mjs';\r\nimport { PresenceChild } from './PresenceChild.mjs';\r\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\r\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\r\nimport { invariant } from '../../utils/errors.mjs';\r\n\r\nconst getChildKey = (child) => child.key || \"\";\r\nfunction updateChildLookup(children, allChildren) {\r\n children.forEach((child) => {\r\n const key = getChildKey(child);\r\n allChildren.set(key, child);\r\n });\r\n}\r\nfunction onlyElements(children) {\r\n const filtered = [];\r\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\r\n Children.forEach(children, (child) => {\r\n if (isValidElement(child))\r\n filtered.push(child);\r\n });\r\n return filtered;\r\n}\r\n/**\r\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\r\n *\r\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\r\n *\r\n * Any `motion` components that have an `exit` property defined will animate out when removed from\r\n * the tree.\r\n *\r\n * ```jsx\r\n * import { motion, AnimatePresence } from 'framer-motion'\r\n *\r\n * export const Items = ({ items }) => (\r\n * \r\n * {items.map(item => (\r\n * \r\n * ))}\r\n * \r\n * )\r\n * ```\r\n *\r\n * You can sequence exit animations throughout a tree using variants.\r\n *\r\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\r\n * once all `motion` components have finished animating out. Likewise, any components using\r\n * `usePresence` all need to call `safeToRemove`.\r\n *\r\n * @public\r\n */\r\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, exitBeforeEnter, presenceAffectsLayout = true, mode = \"sync\", }) => {\r\n invariant(!exitBeforeEnter, \"Replace exitBeforeEnter with mode='wait'\");\r\n // We want to force a re-render once all exiting animations have finished. We\r\n // either use a local forceRender function, or one from a parent context if it exists.\r\n const forceRender = useContext(LayoutGroupContext).forceRender || useForceUpdate()[0];\r\n const isMounted = useIsMounted();\r\n // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key\r\n const filteredChildren = onlyElements(children);\r\n let childrenToRender = filteredChildren;\r\n const exitingChildren = useRef(new Map()).current;\r\n // Keep a living record of the children we're actually rendering so we\r\n // can diff to figure out which are entering and exiting\r\n const presentChildren = useRef(childrenToRender);\r\n // A lookup table to quickly reference components by key\r\n const allChildren = useRef(new Map()).current;\r\n // If this is the initial component render, just deal with logic surrounding whether\r\n // we play onMount animations or not.\r\n const isInitialRender = useRef(true);\r\n useIsomorphicLayoutEffect(() => {\r\n isInitialRender.current = false;\r\n updateChildLookup(filteredChildren, allChildren);\r\n presentChildren.current = childrenToRender;\r\n });\r\n useUnmountEffect(() => {\r\n isInitialRender.current = true;\r\n allChildren.clear();\r\n exitingChildren.clear();\r\n });\r\n if (isInitialRender.current) {\r\n return (React.createElement(React.Fragment, null, childrenToRender.map((child) => (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child)))));\r\n }\r\n // If this is a subsequent render, deal with entering and exiting children\r\n childrenToRender = [...childrenToRender];\r\n // Diff the keys of the currently-present and target children to update our\r\n // exiting list.\r\n const presentKeys = presentChildren.current.map(getChildKey);\r\n const targetKeys = filteredChildren.map(getChildKey);\r\n // Diff the present children with our target children and mark those that are exiting\r\n const numPresent = presentKeys.length;\r\n for (let i = 0; i < numPresent; i++) {\r\n const key = presentKeys[i];\r\n if (targetKeys.indexOf(key) === -1 && !exitingChildren.has(key)) {\r\n exitingChildren.set(key, undefined);\r\n }\r\n }\r\n // If we currently have exiting children, and we're deferring rendering incoming children\r\n // until after all current children have exiting, empty the childrenToRender array\r\n if (mode === \"wait\" && exitingChildren.size) {\r\n childrenToRender = [];\r\n }\r\n // Loop through all currently exiting components and clone them to overwrite `animate`\r\n // with any `exit` prop they might have defined.\r\n exitingChildren.forEach((component, key) => {\r\n // If this component is actually entering again, early return\r\n if (targetKeys.indexOf(key) !== -1)\r\n return;\r\n const child = allChildren.get(key);\r\n if (!child)\r\n return;\r\n const insertionIndex = presentKeys.indexOf(key);\r\n let exitingComponent = component;\r\n if (!exitingComponent) {\r\n const onExit = () => {\r\n // clean up the exiting children map\r\n exitingChildren.delete(key);\r\n // compute the keys of children that were rendered once but are no longer present\r\n // this could happen in case of too many fast consequent renderings\r\n // @link https://github.com/framer/motion/issues/2023\r\n const leftOverKeys = Array.from(allChildren.keys()).filter((childKey) => !targetKeys.includes(childKey));\r\n // clean up the all children map\r\n leftOverKeys.forEach((leftOverKey) => allChildren.delete(leftOverKey));\r\n // make sure to render only the children that are actually visible\r\n presentChildren.current = filteredChildren.filter((presentChild) => {\r\n const presentChildKey = getChildKey(presentChild);\r\n return (\r\n // filter out the node exiting\r\n presentChildKey === key ||\r\n // filter out the leftover children\r\n leftOverKeys.includes(presentChildKey));\r\n });\r\n // Defer re-rendering until all exiting children have indeed left\r\n if (!exitingChildren.size) {\r\n if (isMounted.current === false)\r\n return;\r\n forceRender();\r\n onExitComplete && onExitComplete();\r\n }\r\n };\r\n exitingComponent = (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\r\n exitingChildren.set(key, exitingComponent);\r\n }\r\n childrenToRender.splice(insertionIndex, 0, exitingComponent);\r\n });\r\n // Add `MotionContext` even to children that don't need it to ensure we're rendering\r\n // the same tree between renders\r\n childrenToRender = childrenToRender.map((child) => {\r\n const key = child.key;\r\n return exitingChildren.has(key) ? (child) : (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\r\n });\r\n if (process.env.NODE_ENV !== \"production\" &&\r\n mode === \"wait\" &&\r\n childrenToRender.length > 1) {\r\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\r\n }\r\n return (React.createElement(React.Fragment, null, exitingChildren.size\r\n ? childrenToRender\r\n : childrenToRender.map((child) => cloneElement(child))));\r\n};\r\n\r\nexport { AnimatePresence };\r\n","import * as React from 'react';\r\nimport { useContext, useMemo } from 'react';\r\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\r\nimport { loadExternalIsValidProp } from '../../render/dom/utils/filter-props.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\n\r\n/**\r\n * `MotionConfig` is used to set configuration options for all children `motion` components.\r\n *\r\n * ```jsx\r\n * import { motion, MotionConfig } from \"framer-motion\"\r\n *\r\n * export function App() {\r\n * return (\r\n * \r\n * \r\n * \r\n * )\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction MotionConfig({ children, isValidProp, ...config }) {\r\n isValidProp && loadExternalIsValidProp(isValidProp);\r\n /**\r\n * Inherit props from any parent MotionConfig components\r\n */\r\n config = { ...useContext(MotionConfigContext), ...config };\r\n /**\r\n * Don't allow isStatic to change between renders as it affects how many hooks\r\n * motion components fire.\r\n */\r\n config.isStatic = useConstant(() => config.isStatic);\r\n /**\r\n * Creating a new config context object will re-render every `motion` component\r\n * every time it renders. So we only want to create a new one sparingly.\r\n */\r\n const context = useMemo(() => config, [JSON.stringify(config.transition), config.transformPagePoint, config.reducedMotion]);\r\n return (React.createElement(MotionConfigContext.Provider, { value: context }, children));\r\n}\r\n\r\nexport { MotionConfig };\r\n","import * as React from 'react';\r\nimport { useState, useRef, useEffect } from 'react';\r\nimport { LazyContext } from '../../context/LazyContext.mjs';\r\nimport { loadFeatures } from '../../motion/features/load-features.mjs';\r\n\r\n/**\r\n * Used in conjunction with the `m` component to reduce bundle size.\r\n *\r\n * `m` is a version of the `motion` component that only loads functionality\r\n * critical for the initial render.\r\n *\r\n * `LazyMotion` can then be used to either synchronously or asynchronously\r\n * load animation and gesture support.\r\n *\r\n * ```jsx\r\n * // Synchronous loading\r\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\r\n *\r\n * function App() {\r\n * return (\r\n * \r\n * \r\n * \r\n * )\r\n * }\r\n *\r\n * // Asynchronous loading\r\n * import { LazyMotion, m } from \"framer-motion\"\r\n *\r\n * function App() {\r\n * return (\r\n * import('./path/to/domAnimation')}>\r\n * \r\n * \r\n * )\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction LazyMotion({ children, features, strict = false }) {\r\n const [, setIsLoaded] = useState(!isLazyBundle(features));\r\n const loadedRenderer = useRef(undefined);\r\n /**\r\n * If this is a synchronous load, load features immediately\r\n */\r\n if (!isLazyBundle(features)) {\r\n const { renderer, ...loadedFeatures } = features;\r\n loadedRenderer.current = renderer;\r\n loadFeatures(loadedFeatures);\r\n }\r\n useEffect(() => {\r\n if (isLazyBundle(features)) {\r\n features().then(({ renderer, ...loadedFeatures }) => {\r\n loadFeatures(loadedFeatures);\r\n loadedRenderer.current = renderer;\r\n setIsLoaded(true);\r\n });\r\n }\r\n }, []);\r\n return (React.createElement(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict } }, children));\r\n}\r\nfunction isLazyBundle(features) {\r\n return typeof features === \"function\";\r\n}\r\n\r\nexport { LazyMotion };\r\n","import { createContext } from 'react';\r\n\r\n/**\r\n * Note: Still used by components generated by old versions of Framer\r\n *\r\n * @deprecated\r\n */\r\nconst DeprecatedLayoutGroupContext = createContext(null);\r\n\r\nexport { DeprecatedLayoutGroupContext };\r\n","const notify = (node) => !node.isLayoutDirty && node.willUpdate(false);\r\nfunction nodeGroup() {\r\n const nodes = new Set();\r\n const subscriptions = new WeakMap();\r\n const dirtyAll = () => nodes.forEach(notify);\r\n return {\r\n add: (node) => {\r\n nodes.add(node);\r\n subscriptions.set(node, node.addEventListener(\"willUpdate\", dirtyAll));\r\n },\r\n remove: (node) => {\r\n nodes.delete(node);\r\n const unsubscribe = subscriptions.get(node);\r\n if (unsubscribe) {\r\n unsubscribe();\r\n subscriptions.delete(node);\r\n }\r\n dirtyAll();\r\n },\r\n dirty: dirtyAll,\r\n };\r\n}\r\n\r\nexport { nodeGroup };\r\n","import * as React from 'react';\r\nimport { useContext, useRef, useMemo } from 'react';\r\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\r\nimport { DeprecatedLayoutGroupContext } from '../../context/DeprecatedLayoutGroupContext.mjs';\r\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\r\nimport { nodeGroup } from '../../projection/node/group.mjs';\r\n\r\nconst shouldInheritGroup = (inherit) => inherit === true;\r\nconst shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === \"id\";\r\nconst LayoutGroup = ({ children, id, inherit = true }) => {\r\n const layoutGroupContext = useContext(LayoutGroupContext);\r\n const deprecatedLayoutGroupContext = useContext(DeprecatedLayoutGroupContext);\r\n const [forceRender, key] = useForceUpdate();\r\n const context = useRef(null);\r\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext;\r\n if (context.current === null) {\r\n if (shouldInheritId(inherit) && upstreamId) {\r\n id = id ? upstreamId + \"-\" + id : upstreamId;\r\n }\r\n context.current = {\r\n id,\r\n group: shouldInheritGroup(inherit)\r\n ? layoutGroupContext.group || nodeGroup()\r\n : nodeGroup(),\r\n };\r\n }\r\n const memoizedContext = useMemo(() => ({ ...context.current, forceRender }), [key]);\r\n return (React.createElement(LayoutGroupContext.Provider, { value: memoizedContext }, children));\r\n};\r\n\r\nexport { LayoutGroup };\r\n","import { createContext } from 'react';\r\n\r\nconst ReorderContext = createContext(null);\r\n\r\nexport { ReorderContext };\r\n","import { moveItem } from '../../../utils/array.mjs';\r\nimport { mix } from '../../../utils/mix.mjs';\r\n\r\nfunction checkReorder(order, value, offset, velocity) {\r\n if (!velocity)\r\n return order;\r\n const index = order.findIndex((item) => item.value === value);\r\n if (index === -1)\r\n return order;\r\n const nextOffset = velocity > 0 ? 1 : -1;\r\n const nextItem = order[index + nextOffset];\r\n if (!nextItem)\r\n return order;\r\n const item = order[index];\r\n const nextLayout = nextItem.layout;\r\n const nextItemCenter = mix(nextLayout.min, nextLayout.max, 0.5);\r\n if ((nextOffset === 1 && item.layout.max + offset > nextItemCenter) ||\r\n (nextOffset === -1 && item.layout.min + offset < nextItemCenter)) {\r\n return moveItem(order, index, index + nextOffset);\r\n }\r\n return order;\r\n}\r\n\r\nexport { checkReorder };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport * as React from 'react';\r\nimport { forwardRef, useRef, useEffect } from 'react';\r\nimport { ReorderContext } from '../../context/ReorderContext.mjs';\r\nimport { motion } from '../../render/dom/motion.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { checkReorder } from './utils/check-reorder.mjs';\r\n\r\nfunction ReorderGroup({ children, as = \"ul\", axis = \"y\", onReorder, values, ...props }, externalRef) {\r\n const Component = useConstant(() => motion(as));\r\n const order = [];\r\n const isReordering = useRef(false);\r\n invariant(Boolean(values), \"Reorder.Group must be provided a values prop\");\r\n const context = {\r\n axis,\r\n registerItem: (value, layout) => {\r\n // If the entry was already added, update it rather than adding it again\r\n const idx = order.findIndex((entry) => value === entry.value);\r\n if (idx !== -1) {\r\n order[idx].layout = layout[axis];\r\n }\r\n else {\r\n order.push({ value: value, layout: layout[axis] });\r\n }\r\n order.sort(compareMin);\r\n },\r\n updateOrder: (item, offset, velocity) => {\r\n if (isReordering.current)\r\n return;\r\n const newOrder = checkReorder(order, item, offset, velocity);\r\n if (order !== newOrder) {\r\n isReordering.current = true;\r\n onReorder(newOrder\r\n .map(getValue)\r\n .filter((value) => values.indexOf(value) !== -1));\r\n }\r\n },\r\n };\r\n useEffect(() => {\r\n isReordering.current = false;\r\n });\r\n return (React.createElement(Component, { ...props, ref: externalRef, ignoreStrict: true },\r\n React.createElement(ReorderContext.Provider, { value: context }, children)));\r\n}\r\nconst Group = forwardRef(ReorderGroup);\r\nfunction getValue(item) {\r\n return item.value;\r\n}\r\nfunction compareMin(a, b) {\r\n return a.layout.min - b.layout.min;\r\n}\r\n\r\nexport { Group, ReorderGroup };\r\n","import { useContext, useState, useEffect } from 'react';\r\nimport { motionValue } from './index.mjs';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\n\r\n/**\r\n * Creates a `MotionValue` to track the state and velocity of a value.\r\n *\r\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\r\n *\r\n * ```jsx\r\n * export const MyComponent = () => {\r\n * const scale = useMotionValue(1)\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @param initial - The initial state.\r\n *\r\n * @public\r\n */\r\nfunction useMotionValue(initial) {\r\n const value = useConstant(() => motionValue(initial));\r\n /**\r\n * If this motion value is being used in static mode, like on\r\n * the Framer canvas, force components to rerender when the motion\r\n * value is updated.\r\n */\r\n const { isStatic } = useContext(MotionConfigContext);\r\n if (isStatic) {\r\n const [, setLatest] = useState(initial);\r\n useEffect(() => value.on(\"change\", setLatest), []);\r\n }\r\n return value;\r\n}\r\n\r\nexport { useMotionValue };\r\n","import { interpolate } from './interpolate.mjs';\r\n\r\nconst isCustomValueType = (v) => {\r\n return v && typeof v === \"object\" && v.mix;\r\n};\r\nconst getMixer = (v) => (isCustomValueType(v) ? v.mix : undefined);\r\nfunction transform(...args) {\r\n const useImmediate = !Array.isArray(args[0]);\r\n const argOffset = useImmediate ? 0 : -1;\r\n const inputValue = args[0 + argOffset];\r\n const inputRange = args[1 + argOffset];\r\n const outputRange = args[2 + argOffset];\r\n const options = args[3 + argOffset];\r\n const interpolator = interpolate(inputRange, outputRange, {\r\n mixer: getMixer(outputRange[0]),\r\n ...options,\r\n });\r\n return useImmediate ? interpolator(inputValue) : interpolator;\r\n}\r\n\r\nexport { transform };\r\n","import { useMotionValue } from './use-motion-value.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\r\nimport { cancelFrame, frame } from '../frameloop/frame.mjs';\r\n\r\nfunction useCombineMotionValues(values, combineValues) {\r\n /**\r\n * Initialise the returned motion value. This remains the same between renders.\r\n */\r\n const value = useMotionValue(combineValues());\r\n /**\r\n * Create a function that will update the template motion value with the latest values.\r\n * This is pre-bound so whenever a motion value updates it can schedule its\r\n * execution in Framesync. If it's already been scheduled it won't be fired twice\r\n * in a single frame.\r\n */\r\n const updateValue = () => value.set(combineValues());\r\n /**\r\n * Synchronously update the motion value with the latest values during the render.\r\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\r\n */\r\n updateValue();\r\n /**\r\n * Subscribe to all motion values found within the template. Whenever any of them change,\r\n * schedule an update.\r\n */\r\n useIsomorphicLayoutEffect(() => {\r\n const scheduleUpdate = () => frame.update(updateValue, false, true);\r\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate));\r\n return () => {\r\n subscriptions.forEach((unsubscribe) => unsubscribe());\r\n cancelFrame(updateValue);\r\n };\r\n });\r\n return value;\r\n}\r\n\r\nexport { useCombineMotionValues };\r\n","import { collectMotionValues } from './index.mjs';\r\nimport { useCombineMotionValues } from './use-combine-values.mjs';\r\n\r\nfunction useComputed(compute) {\r\n /**\r\n * Open session of collectMotionValues. Any MotionValue that calls get()\r\n * will be saved into this array.\r\n */\r\n collectMotionValues.current = [];\r\n compute();\r\n const value = useCombineMotionValues(collectMotionValues.current, compute);\r\n /**\r\n * Synchronously close session of collectMotionValues.\r\n */\r\n collectMotionValues.current = undefined;\r\n return value;\r\n}\r\n\r\nexport { useComputed };\r\n","import { transform } from '../utils/transform.mjs';\r\nimport { useCombineMotionValues } from './use-combine-values.mjs';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\nimport { useComputed } from './use-computed.mjs';\r\n\r\nfunction useTransform(input, inputRangeOrTransformer, outputRange, options) {\r\n if (typeof input === \"function\") {\r\n return useComputed(input);\r\n }\r\n const transformer = typeof inputRangeOrTransformer === \"function\"\r\n ? inputRangeOrTransformer\r\n : transform(inputRangeOrTransformer, outputRange, options);\r\n return Array.isArray(input)\r\n ? useListTransform(input, transformer)\r\n : useListTransform([input], ([latest]) => transformer(latest));\r\n}\r\nfunction useListTransform(values, transformer) {\r\n const latest = useConstant(() => []);\r\n return useCombineMotionValues(values, () => {\r\n latest.length = 0;\r\n const numValues = values.length;\r\n for (let i = 0; i < numValues; i++) {\r\n latest[i] = values[i].get();\r\n }\r\n return transformer(latest);\r\n });\r\n}\r\n\r\nexport { useTransform };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport * as React from 'react';\r\nimport { forwardRef, useContext } from 'react';\r\nimport { ReorderContext } from '../../context/ReorderContext.mjs';\r\nimport { motion } from '../../render/dom/motion.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { useMotionValue } from '../../value/use-motion-value.mjs';\r\nimport { useTransform } from '../../value/use-transform.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\n\r\nfunction useDefaultMotionValue(value, defaultValue = 0) {\r\n return isMotionValue(value) ? value : useMotionValue(defaultValue);\r\n}\r\nfunction ReorderItem({ children, style = {}, value, as = \"li\", onDrag, layout = true, ...props }, externalRef) {\r\n const Component = useConstant(() => motion(as));\r\n const context = useContext(ReorderContext);\r\n const point = {\r\n x: useDefaultMotionValue(style.x),\r\n y: useDefaultMotionValue(style.y),\r\n };\r\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : \"unset\");\r\n invariant(Boolean(context), \"Reorder.Item must be a child of Reorder.Group\");\r\n const { axis, registerItem, updateOrder } = context;\r\n return (React.createElement(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => {\r\n const { velocity } = gesturePoint;\r\n velocity[axis] &&\r\n updateOrder(value, point[axis].get(), velocity[axis]);\r\n onDrag && onDrag(event, gesturePoint);\r\n }, onLayoutMeasure: (measured) => registerItem(value, measured), ref: externalRef, ignoreStrict: true }, children));\r\n}\r\nconst Item = forwardRef(ReorderItem);\r\n\r\nexport { Item, ReorderItem };\r\n","import { Group } from './Group.mjs';\r\nimport { Item } from './Item.mjs';\r\n\r\nconst Reorder = {\r\n Group,\r\n Item,\r\n};\r\n\r\nexport { Reorder };\r\n","import { animations } from '../../motion/features/animations.mjs';\r\nimport { gestureAnimations } from '../../motion/features/gestures.mjs';\r\nimport { createDomVisualElement } from './create-visual-element.mjs';\r\n\r\n/**\r\n * @public\r\n */\r\nconst domAnimation = {\r\n renderer: createDomVisualElement,\r\n ...animations,\r\n ...gestureAnimations,\r\n};\r\n\r\nexport { domAnimation };\r\n","import { drag } from '../../motion/features/drag.mjs';\r\nimport { layout } from '../../motion/features/layout.mjs';\r\nimport { domAnimation } from './features-animation.mjs';\r\n\r\n/**\r\n * @public\r\n */\r\nconst domMax = {\r\n ...domAnimation,\r\n ...drag,\r\n ...layout,\r\n};\r\n\r\nexport { domMax };\r\n","import { useCombineMotionValues } from './use-combine-values.mjs';\r\nimport { isMotionValue } from './utils/is-motion-value.mjs';\r\n\r\n/**\r\n * Combine multiple motion values into a new one using a string template literal.\r\n *\r\n * ```jsx\r\n * import {\r\n * motion,\r\n * useSpring,\r\n * useMotionValue,\r\n * useMotionTemplate\r\n * } from \"framer-motion\"\r\n *\r\n * function Component() {\r\n * const shadowX = useSpring(0)\r\n * const shadowY = useMotionValue(0)\r\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useMotionTemplate(fragments, ...values) {\r\n /**\r\n * Create a function that will build a string from the latest motion values.\r\n */\r\n const numFragments = fragments.length;\r\n function buildValue() {\r\n let output = ``;\r\n for (let i = 0; i < numFragments; i++) {\r\n output += fragments[i];\r\n const value = values[i];\r\n if (value) {\r\n output += isMotionValue(value) ? value.get() : value;\r\n }\r\n }\r\n return output;\r\n }\r\n return useCombineMotionValues(values.filter(isMotionValue), buildValue);\r\n}\r\n\r\nexport { useMotionTemplate };\r\n","import { useContext, useRef, useInsertionEffect } from 'react';\r\nimport { isMotionValue } from './utils/is-motion-value.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\r\nimport { animateValue } from '../animation/animators/js/index.mjs';\r\nimport { millisecondsToSeconds } from '../utils/time-conversion.mjs';\r\nimport { frameData } from '../frameloop/frame.mjs';\r\n\r\n/**\r\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\r\n *\r\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\r\n * to another `MotionValue`.\r\n *\r\n * @remarks\r\n *\r\n * ```jsx\r\n * const x = useSpring(0, { stiffness: 300 })\r\n * const y = useSpring(x, { damping: 10 })\r\n * ```\r\n *\r\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\r\n * @param springConfig - Configuration options for the spring.\r\n * @returns `MotionValue`\r\n *\r\n * @public\r\n */\r\nfunction useSpring(source, config = {}) {\r\n const { isStatic } = useContext(MotionConfigContext);\r\n const activeSpringAnimation = useRef(null);\r\n const value = useMotionValue(isMotionValue(source) ? source.get() : source);\r\n const stopAnimation = () => {\r\n if (activeSpringAnimation.current) {\r\n activeSpringAnimation.current.stop();\r\n }\r\n };\r\n useInsertionEffect(() => {\r\n return value.attach((v, set) => {\r\n /**\r\n * A more hollistic approach to this might be to use isStatic to fix VisualElement animations\r\n * at that level, but this will work for now\r\n */\r\n if (isStatic)\r\n return set(v);\r\n stopAnimation();\r\n activeSpringAnimation.current = animateValue({\r\n keyframes: [value.get(), v],\r\n velocity: value.getVelocity(),\r\n type: \"spring\",\r\n restDelta: 0.001,\r\n restSpeed: 0.01,\r\n ...config,\r\n onUpdate: set,\r\n });\r\n /**\r\n * If we're between frames, resync the animation to the frameloop.\r\n */\r\n if (!frameData.isProcessing) {\r\n const delta = performance.now() - frameData.timestamp;\r\n if (delta < 30) {\r\n activeSpringAnimation.current.time =\r\n millisecondsToSeconds(delta);\r\n }\r\n }\r\n return value.get();\r\n }, stopAnimation);\r\n }, [JSON.stringify(config)]);\r\n useIsomorphicLayoutEffect(() => {\r\n if (isMotionValue(source)) {\r\n return source.on(\"change\", (v) => value.set(parseFloat(v)));\r\n }\r\n }, [value]);\r\n return value;\r\n}\r\n\r\nexport { useSpring };\r\n","import { useInsertionEffect } from 'react';\r\n\r\nfunction useMotionValueEvent(value, event, callback) {\r\n /**\r\n * useInsertionEffect will create subscriptions before any other\r\n * effects will run. Effects run upwards through the tree so it\r\n * can be that binding a useLayoutEffect higher up the tree can\r\n * miss changes from lower down the tree.\r\n */\r\n useInsertionEffect(() => value.on(event, callback), [value, event, callback]);\r\n}\r\n\r\nexport { useMotionValueEvent };\r\n","import { useMotionValueEvent } from '../utils/use-motion-value-event.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\n\r\n/**\r\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\r\n *\r\n * ```javascript\r\n * const x = useMotionValue(0)\r\n * const xVelocity = useVelocity(x)\r\n * const xAcceleration = useVelocity(xVelocity)\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useVelocity(value) {\r\n const velocity = useMotionValue(value.getVelocity());\r\n useMotionValueEvent(value, \"velocityChange\", (newVelocity) => {\r\n velocity.set(newVelocity);\r\n });\r\n return velocity;\r\n}\r\n\r\nexport { useVelocity };\r\n","import { invariant } from '../../../utils/errors.mjs';\r\n\r\nfunction resolveElements(elements, scope, selectorCache) {\r\n var _a;\r\n if (typeof elements === \"string\") {\r\n let root = document;\r\n if (scope) {\r\n invariant(Boolean(scope.current), \"Scope provided, but no element detected.\");\r\n root = scope.current;\r\n }\r\n if (selectorCache) {\r\n (_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : (selectorCache[elements] = root.querySelectorAll(elements));\r\n elements = selectorCache[elements];\r\n }\r\n else {\r\n elements = root.querySelectorAll(elements);\r\n }\r\n }\r\n else if (elements instanceof Element) {\r\n elements = [elements];\r\n }\r\n /**\r\n * Return an empty array\r\n */\r\n return Array.from(elements || []);\r\n}\r\n\r\nexport { resolveElements };\r\n","import { resolveElements } from '../utils/resolve-element.mjs';\r\n\r\nconst resizeHandlers = new WeakMap();\r\nlet observer;\r\nfunction getElementSize(target, borderBoxSize) {\r\n if (borderBoxSize) {\r\n const { inlineSize, blockSize } = borderBoxSize[0];\r\n return { width: inlineSize, height: blockSize };\r\n }\r\n else if (target instanceof SVGElement && \"getBBox\" in target) {\r\n return target.getBBox();\r\n }\r\n else {\r\n return {\r\n width: target.offsetWidth,\r\n height: target.offsetHeight,\r\n };\r\n }\r\n}\r\nfunction notifyTarget({ target, contentRect, borderBoxSize, }) {\r\n var _a;\r\n (_a = resizeHandlers.get(target)) === null || _a === void 0 ? void 0 : _a.forEach((handler) => {\r\n handler({\r\n target,\r\n contentSize: contentRect,\r\n get size() {\r\n return getElementSize(target, borderBoxSize);\r\n },\r\n });\r\n });\r\n}\r\nfunction notifyAll(entries) {\r\n entries.forEach(notifyTarget);\r\n}\r\nfunction createResizeObserver() {\r\n if (typeof ResizeObserver === \"undefined\")\r\n return;\r\n observer = new ResizeObserver(notifyAll);\r\n}\r\nfunction resizeElement(target, handler) {\r\n if (!observer)\r\n createResizeObserver();\r\n const elements = resolveElements(target);\r\n elements.forEach((element) => {\r\n let elementHandlers = resizeHandlers.get(element);\r\n if (!elementHandlers) {\r\n elementHandlers = new Set();\r\n resizeHandlers.set(element, elementHandlers);\r\n }\r\n elementHandlers.add(handler);\r\n observer === null || observer === void 0 ? void 0 : observer.observe(element);\r\n });\r\n return () => {\r\n elements.forEach((element) => {\r\n const elementHandlers = resizeHandlers.get(element);\r\n elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.delete(handler);\r\n if (!(elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.size)) {\r\n observer === null || observer === void 0 ? void 0 : observer.unobserve(element);\r\n }\r\n });\r\n };\r\n}\r\n\r\nexport { resizeElement };\r\n","const windowCallbacks = new Set();\r\nlet windowResizeHandler;\r\nfunction createWindowResizeHandler() {\r\n windowResizeHandler = () => {\r\n const size = {\r\n width: window.innerWidth,\r\n height: window.innerHeight,\r\n };\r\n const info = {\r\n target: window,\r\n size,\r\n contentSize: size,\r\n };\r\n windowCallbacks.forEach((callback) => callback(info));\r\n };\r\n window.addEventListener(\"resize\", windowResizeHandler);\r\n}\r\nfunction resizeWindow(callback) {\r\n windowCallbacks.add(callback);\r\n if (!windowResizeHandler)\r\n createWindowResizeHandler();\r\n return () => {\r\n windowCallbacks.delete(callback);\r\n if (!windowCallbacks.size && windowResizeHandler) {\r\n windowResizeHandler = undefined;\r\n }\r\n };\r\n}\r\n\r\nexport { resizeWindow };\r\n","import { resizeElement } from './handle-element.mjs';\r\nimport { resizeWindow } from './handle-window.mjs';\r\n\r\nfunction resize(a, b) {\r\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\r\n}\r\n\r\nexport { resize };\r\n","import { progress } from '../../../utils/progress.mjs';\r\nimport { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';\r\n\r\n/**\r\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\r\n */\r\nconst maxElapsed = 50;\r\nconst createAxisInfo = () => ({\r\n current: 0,\r\n offset: [],\r\n progress: 0,\r\n scrollLength: 0,\r\n targetOffset: 0,\r\n targetLength: 0,\r\n containerLength: 0,\r\n velocity: 0,\r\n});\r\nconst createScrollInfo = () => ({\r\n time: 0,\r\n x: createAxisInfo(),\r\n y: createAxisInfo(),\r\n});\r\nconst keys = {\r\n x: {\r\n length: \"Width\",\r\n position: \"Left\",\r\n },\r\n y: {\r\n length: \"Height\",\r\n position: \"Top\",\r\n },\r\n};\r\nfunction updateAxisInfo(element, axisName, info, time) {\r\n const axis = info[axisName];\r\n const { length, position } = keys[axisName];\r\n const prev = axis.current;\r\n const prevTime = info.time;\r\n axis.current = element[\"scroll\" + position];\r\n axis.scrollLength = element[\"scroll\" + length] - element[\"client\" + length];\r\n axis.offset.length = 0;\r\n axis.offset[0] = 0;\r\n axis.offset[1] = axis.scrollLength;\r\n axis.progress = progress(0, axis.scrollLength, axis.current);\r\n const elapsed = time - prevTime;\r\n axis.velocity =\r\n elapsed > maxElapsed\r\n ? 0\r\n : velocityPerSecond(axis.current - prev, elapsed);\r\n}\r\nfunction updateScrollInfo(element, info, time) {\r\n updateAxisInfo(element, \"x\", info, time);\r\n updateAxisInfo(element, \"y\", info, time);\r\n info.time = time;\r\n}\r\n\r\nexport { createScrollInfo, updateScrollInfo };\r\n","function calcInset(element, container) {\r\n const inset = { x: 0, y: 0 };\r\n let current = element;\r\n while (current && current !== container) {\r\n if (current instanceof HTMLElement) {\r\n inset.x += current.offsetLeft;\r\n inset.y += current.offsetTop;\r\n current = current.offsetParent;\r\n }\r\n else if (current.tagName === \"svg\") {\r\n /**\r\n * This isn't an ideal approach to measuring the offset of tags.\r\n * It would be preferable, given they behave like HTMLElements in most ways\r\n * to use offsetLeft/Top. But these don't exist on . Likewise we\r\n * can't use .getBBox() like most SVG elements as these provide the offset\r\n * relative to the SVG itself, which for is usually 0x0.\r\n */\r\n const svgBoundingBox = current.getBoundingClientRect();\r\n current = current.parentElement;\r\n const parentBoundingBox = current.getBoundingClientRect();\r\n inset.x += svgBoundingBox.left - parentBoundingBox.left;\r\n inset.y += svgBoundingBox.top - parentBoundingBox.top;\r\n }\r\n else if (current instanceof SVGGraphicsElement) {\r\n const { x, y } = current.getBBox();\r\n inset.x += x;\r\n inset.y += y;\r\n let svg = null;\r\n let parent = current.parentNode;\r\n while (!svg) {\r\n if (parent.tagName === \"svg\") {\r\n svg = parent;\r\n }\r\n parent = current.parentNode;\r\n }\r\n current = svg;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n return inset;\r\n}\r\n\r\nexport { calcInset };\r\n","const ScrollOffset = {\r\n Enter: [\r\n [0, 1],\r\n [1, 1],\r\n ],\r\n Exit: [\r\n [0, 0],\r\n [1, 0],\r\n ],\r\n Any: [\r\n [1, 0],\r\n [0, 1],\r\n ],\r\n All: [\r\n [0, 0],\r\n [1, 1],\r\n ],\r\n};\r\n\r\nexport { ScrollOffset };\r\n","const namedEdges = {\r\n start: 0,\r\n center: 0.5,\r\n end: 1,\r\n};\r\nfunction resolveEdge(edge, length, inset = 0) {\r\n let delta = 0;\r\n /**\r\n * If we have this edge defined as a preset, replace the definition\r\n * with the numerical value.\r\n */\r\n if (namedEdges[edge] !== undefined) {\r\n edge = namedEdges[edge];\r\n }\r\n /**\r\n * Handle unit values\r\n */\r\n if (typeof edge === \"string\") {\r\n const asNumber = parseFloat(edge);\r\n if (edge.endsWith(\"px\")) {\r\n delta = asNumber;\r\n }\r\n else if (edge.endsWith(\"%\")) {\r\n edge = asNumber / 100;\r\n }\r\n else if (edge.endsWith(\"vw\")) {\r\n delta = (asNumber / 100) * document.documentElement.clientWidth;\r\n }\r\n else if (edge.endsWith(\"vh\")) {\r\n delta = (asNumber / 100) * document.documentElement.clientHeight;\r\n }\r\n else {\r\n edge = asNumber;\r\n }\r\n }\r\n /**\r\n * If the edge is defined as a number, handle as a progress value.\r\n */\r\n if (typeof edge === \"number\") {\r\n delta = length * edge;\r\n }\r\n return inset + delta;\r\n}\r\n\r\nexport { namedEdges, resolveEdge };\r\n","import { namedEdges, resolveEdge } from './edge.mjs';\r\n\r\nconst defaultOffset = [0, 0];\r\nfunction resolveOffset(offset, containerLength, targetLength, targetInset) {\r\n let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;\r\n let targetPoint = 0;\r\n let containerPoint = 0;\r\n if (typeof offset === \"number\") {\r\n /**\r\n * If we're provided offset: [0, 0.5, 1] then each number x should become\r\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\r\n * and container etc.\r\n */\r\n offsetDefinition = [offset, offset];\r\n }\r\n else if (typeof offset === \"string\") {\r\n offset = offset.trim();\r\n if (offset.includes(\" \")) {\r\n offsetDefinition = offset.split(\" \");\r\n }\r\n else {\r\n /**\r\n * If we're provided a definition like \"100px\" then we want to apply\r\n * that only to the top of the target point, leaving the container at 0.\r\n * Whereas a named offset like \"end\" should be applied to both.\r\n */\r\n offsetDefinition = [offset, namedEdges[offset] ? offset : `0`];\r\n }\r\n }\r\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);\r\n containerPoint = resolveEdge(offsetDefinition[1], containerLength);\r\n return targetPoint - containerPoint;\r\n}\r\n\r\nexport { resolveOffset };\r\n","import { calcInset } from './inset.mjs';\r\nimport { ScrollOffset } from './presets.mjs';\r\nimport { resolveOffset } from './offset.mjs';\r\nimport { interpolate } from '../../../../utils/interpolate.mjs';\r\nimport { defaultOffset } from '../../../../utils/offsets/default.mjs';\r\n\r\nconst point = { x: 0, y: 0 };\r\nfunction getTargetSize(target) {\r\n return \"getBBox\" in target && target.tagName !== \"svg\"\r\n ? target.getBBox()\r\n : { width: target.clientWidth, height: target.clientHeight };\r\n}\r\nfunction resolveOffsets(container, info, options) {\r\n let { offset: offsetDefinition = ScrollOffset.All } = options;\r\n const { target = container, axis = \"y\" } = options;\r\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\";\r\n const inset = target !== container ? calcInset(target, container) : point;\r\n /**\r\n * Measure the target and container. If they're the same thing then we\r\n * use the container's scrollWidth/Height as the target, from there\r\n * all other calculations can remain the same.\r\n */\r\n const targetSize = target === container\r\n ? { width: container.scrollWidth, height: container.scrollHeight }\r\n : getTargetSize(target);\r\n const containerSize = {\r\n width: container.clientWidth,\r\n height: container.clientHeight,\r\n };\r\n /**\r\n * Reset the length of the resolved offset array rather than creating a new one.\r\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\r\n */\r\n info[axis].offset.length = 0;\r\n /**\r\n * Populate the offset array by resolving the user's offset definition into\r\n * a list of pixel scroll offets.\r\n */\r\n let hasChanged = !info[axis].interpolate;\r\n const numOffsets = offsetDefinition.length;\r\n for (let i = 0; i < numOffsets; i++) {\r\n const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);\r\n if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {\r\n hasChanged = true;\r\n }\r\n info[axis].offset[i] = offset;\r\n }\r\n /**\r\n * If the pixel scroll offsets have changed, create a new interpolator function\r\n * to map scroll value into a progress.\r\n */\r\n if (hasChanged) {\r\n info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition));\r\n info[axis].interpolatorOffsets = [...info[axis].offset];\r\n }\r\n info[axis].progress = info[axis].interpolate(info[axis].current);\r\n}\r\n\r\nexport { resolveOffsets };\r\n","import { warnOnce } from '../../../utils/warn-once.mjs';\r\nimport { updateScrollInfo } from './info.mjs';\r\nimport { resolveOffsets } from './offsets/index.mjs';\r\n\r\nfunction measure(container, target = container, info) {\r\n /**\r\n * Find inset of target within scrollable container\r\n */\r\n info.x.targetOffset = 0;\r\n info.y.targetOffset = 0;\r\n if (target !== container) {\r\n let node = target;\r\n while (node && node !== container) {\r\n info.x.targetOffset += node.offsetLeft;\r\n info.y.targetOffset += node.offsetTop;\r\n node = node.offsetParent;\r\n }\r\n }\r\n info.x.targetLength =\r\n target === container ? target.scrollWidth : target.clientWidth;\r\n info.y.targetLength =\r\n target === container ? target.scrollHeight : target.clientHeight;\r\n info.x.containerLength = container.clientWidth;\r\n info.y.containerLength = container.clientHeight;\r\n /**\r\n * In development mode ensure scroll containers aren't position: static as this makes\r\n * it difficult to measure their relative positions.\r\n */\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (container && target && target !== container) {\r\n warnOnce(getComputedStyle(container).position !== \"static\", \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\");\r\n }\r\n }\r\n}\r\nfunction createOnScrollHandler(element, onScroll, info, options = {}) {\r\n return {\r\n measure: () => measure(element, options.target, info),\r\n update: (time) => {\r\n updateScrollInfo(element, info, time);\r\n if (options.offset || options.target) {\r\n resolveOffsets(element, info, options);\r\n }\r\n },\r\n notify: () => onScroll(info),\r\n };\r\n}\r\n\r\nexport { createOnScrollHandler };\r\n","import { resize } from '../resize/index.mjs';\r\nimport { createScrollInfo } from './info.mjs';\r\nimport { createOnScrollHandler } from './on-scroll-handler.mjs';\r\nimport { frame, cancelFrame, frameData } from '../../../frameloop/frame.mjs';\r\n\r\nconst scrollListeners = new WeakMap();\r\nconst resizeListeners = new WeakMap();\r\nconst onScrollHandlers = new WeakMap();\r\nconst getEventTarget = (element) => element === document.documentElement ? window : element;\r\nfunction scrollInfo(onScroll, { container = document.documentElement, ...options } = {}) {\r\n let containerHandlers = onScrollHandlers.get(container);\r\n /**\r\n * Get the onScroll handlers for this container.\r\n * If one isn't found, create a new one.\r\n */\r\n if (!containerHandlers) {\r\n containerHandlers = new Set();\r\n onScrollHandlers.set(container, containerHandlers);\r\n }\r\n /**\r\n * Create a new onScroll handler for the provided callback.\r\n */\r\n const info = createScrollInfo();\r\n const containerHandler = createOnScrollHandler(container, onScroll, info, options);\r\n containerHandlers.add(containerHandler);\r\n /**\r\n * Check if there's a scroll event listener for this container.\r\n * If not, create one.\r\n */\r\n if (!scrollListeners.has(container)) {\r\n const measureAll = () => {\r\n for (const handler of containerHandlers)\r\n handler.measure();\r\n };\r\n const updateAll = () => {\r\n for (const handler of containerHandlers) {\r\n handler.update(frameData.timestamp);\r\n }\r\n };\r\n const notifyAll = () => {\r\n for (const handler of containerHandlers)\r\n handler.notify();\r\n };\r\n const listener = () => {\r\n frame.read(measureAll, false, true);\r\n frame.read(updateAll, false, true);\r\n frame.update(notifyAll, false, true);\r\n };\r\n scrollListeners.set(container, listener);\r\n const target = getEventTarget(container);\r\n window.addEventListener(\"resize\", listener, { passive: true });\r\n if (container !== document.documentElement) {\r\n resizeListeners.set(container, resize(container, listener));\r\n }\r\n target.addEventListener(\"scroll\", listener, { passive: true });\r\n }\r\n const listener = scrollListeners.get(container);\r\n frame.read(listener, false, true);\r\n return () => {\r\n var _a;\r\n cancelFrame(listener);\r\n /**\r\n * Check if we even have any handlers for this container.\r\n */\r\n const currentHandlers = onScrollHandlers.get(container);\r\n if (!currentHandlers)\r\n return;\r\n currentHandlers.delete(containerHandler);\r\n if (currentHandlers.size)\r\n return;\r\n /**\r\n * If no more handlers, remove the scroll listener too.\r\n */\r\n const scrollListener = scrollListeners.get(container);\r\n scrollListeners.delete(container);\r\n if (scrollListener) {\r\n getEventTarget(container).removeEventListener(\"scroll\", scrollListener);\r\n (_a = resizeListeners.get(container)) === null || _a === void 0 ? void 0 : _a();\r\n window.removeEventListener(\"resize\", scrollListener);\r\n }\r\n };\r\n}\r\n\r\nexport { scrollInfo };\r\n","import { motionValue } from './index.mjs';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\nimport { useEffect } from 'react';\r\nimport { warning } from '../utils/errors.mjs';\r\nimport { scrollInfo } from '../render/dom/scroll/track.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\r\n\r\nfunction refWarning(name, ref) {\r\n warning(Boolean(!ref || ref.current), `You have defined a ${name} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref, or setting its \\`layoutEffect: false\\` option.`);\r\n}\r\nconst createScrollMotionValues = () => ({\r\n scrollX: motionValue(0),\r\n scrollY: motionValue(0),\r\n scrollXProgress: motionValue(0),\r\n scrollYProgress: motionValue(0),\r\n});\r\nfunction useScroll({ container, target, layoutEffect = true, ...options } = {}) {\r\n const values = useConstant(createScrollMotionValues);\r\n const useLifecycleEffect = layoutEffect\r\n ? useIsomorphicLayoutEffect\r\n : useEffect;\r\n useLifecycleEffect(() => {\r\n refWarning(\"target\", target);\r\n refWarning(\"container\", container);\r\n return scrollInfo(({ x, y }) => {\r\n values.scrollX.set(x.current);\r\n values.scrollXProgress.set(x.progress);\r\n values.scrollY.set(y.current);\r\n values.scrollYProgress.set(y.progress);\r\n }, {\r\n ...options,\r\n container: (container === null || container === void 0 ? void 0 : container.current) || undefined,\r\n target: (target === null || target === void 0 ? void 0 : target.current) || undefined,\r\n });\r\n }, [container, target, JSON.stringify(options.offset)]);\r\n return values;\r\n}\r\n\r\nexport { useScroll };\r\n","import { warnOnce } from '../../utils/warn-once.mjs';\r\nimport { useScroll } from '../use-scroll.mjs';\r\n\r\n/**\r\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\r\n */\r\nfunction useElementScroll(ref) {\r\n if (process.env.NODE_ENV === \"development\") {\r\n warnOnce(false, \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\");\r\n }\r\n return useScroll({ container: ref });\r\n}\r\n\r\nexport { useElementScroll };\r\n","import { warnOnce } from '../../utils/warn-once.mjs';\r\nimport { useScroll } from '../use-scroll.mjs';\r\n\r\n/**\r\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\r\n */\r\nfunction useViewportScroll() {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(false, \"useViewportScroll is deprecated. Convert to useScroll().\");\r\n }\r\n return useScroll();\r\n}\r\n\r\nexport { useViewportScroll };\r\n","import { useRef, useContext, useEffect } from 'react';\r\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\r\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\r\n\r\nfunction useAnimationFrame(callback) {\r\n const initialTimestamp = useRef(0);\r\n const { isStatic } = useContext(MotionConfigContext);\r\n useEffect(() => {\r\n if (isStatic)\r\n return;\r\n const provideTimeSinceStart = ({ timestamp, delta }) => {\r\n if (!initialTimestamp.current)\r\n initialTimestamp.current = timestamp;\r\n callback(timestamp - initialTimestamp.current, delta);\r\n };\r\n frame.update(provideTimeSinceStart, true);\r\n return () => cancelFrame(provideTimeSinceStart);\r\n }, [callback]);\r\n}\r\n\r\nexport { useAnimationFrame };\r\n","import { useAnimationFrame } from '../utils/use-animation-frame.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\n\r\nfunction useTime() {\r\n const time = useMotionValue(0);\r\n useAnimationFrame((t) => time.set(t));\r\n return time;\r\n}\r\n\r\nexport { useTime };\r\n","import { isCSSVariableName } from '../../render/dom/utils/is-css-variable.mjs';\r\nimport { transformProps } from '../../render/html/utils/transform.mjs';\r\nimport { addUniqueItem, removeItem } from '../../utils/array.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { MotionValue } from '../index.mjs';\r\nimport { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\r\n\r\nclass WillChangeMotionValue extends MotionValue {\r\n constructor() {\r\n super(...arguments);\r\n this.members = [];\r\n this.transforms = new Set();\r\n }\r\n add(name) {\r\n let memberName;\r\n if (transformProps.has(name)) {\r\n this.transforms.add(name);\r\n memberName = \"transform\";\r\n }\r\n else if (!name.startsWith(\"origin\") &&\r\n !isCSSVariableName(name) &&\r\n name !== \"willChange\") {\r\n memberName = camelToDash(name);\r\n }\r\n if (memberName) {\r\n addUniqueItem(this.members, memberName);\r\n this.update();\r\n }\r\n }\r\n remove(name) {\r\n if (transformProps.has(name)) {\r\n this.transforms.delete(name);\r\n if (!this.transforms.size) {\r\n removeItem(this.members, \"transform\");\r\n }\r\n }\r\n else {\r\n removeItem(this.members, camelToDash(name));\r\n }\r\n this.update();\r\n }\r\n update() {\r\n this.set(this.members.length ? this.members.join(\", \") : \"auto\");\r\n }\r\n}\r\nfunction useWillChange() {\r\n return useConstant(() => new WillChangeMotionValue(\"auto\"));\r\n}\r\n\r\nexport { WillChangeMotionValue, useWillChange };\r\n","import { useState } from 'react';\r\nimport { initPrefersReducedMotion } from './index.mjs';\r\nimport { warnOnce } from '../warn-once.mjs';\r\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\r\n\r\n/**\r\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\r\n *\r\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\r\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\r\n *\r\n * It will actively respond to changes and re-render your components with the latest setting.\r\n *\r\n * ```jsx\r\n * export function Sidebar({ isOpen }) {\r\n * const shouldReduceMotion = useReducedMotion()\r\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\r\n *\r\n * return (\r\n * \r\n * )\r\n * }\r\n * ```\r\n *\r\n * @return boolean\r\n *\r\n * @public\r\n */\r\nfunction useReducedMotion() {\r\n /**\r\n * Lazy initialisation of prefersReducedMotion\r\n */\r\n !hasReducedMotionListener.current && initPrefersReducedMotion();\r\n const [shouldReduceMotion] = useState(prefersReducedMotion.current);\r\n if (process.env.NODE_ENV !== \"production\") {\r\n warnOnce(shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\");\r\n }\r\n /**\r\n * TODO See if people miss automatically updating shouldReduceMotion setting\r\n */\r\n return shouldReduceMotion;\r\n}\r\n\r\nexport { useReducedMotion };\r\n","import { useContext } from 'react';\r\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\r\nimport { useReducedMotion } from './use-reduced-motion.mjs';\r\n\r\nfunction useReducedMotionConfig() {\r\n const reducedMotionPreference = useReducedMotion();\r\n const { reducedMotion } = useContext(MotionConfigContext);\r\n if (reducedMotion === \"never\") {\r\n return false;\r\n }\r\n else if (reducedMotion === \"always\") {\r\n return true;\r\n }\r\n else {\r\n return reducedMotionPreference;\r\n }\r\n}\r\n\r\nexport { useReducedMotionConfig };\r\n","import { invariant } from '../../utils/errors.mjs';\r\nimport { setValues } from '../../render/utils/setters.mjs';\r\nimport { animateVisualElement } from '../interfaces/visual-element.mjs';\r\n\r\nfunction stopAnimation(visualElement) {\r\n visualElement.values.forEach((value) => value.stop());\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction animationControls() {\r\n /**\r\n * Track whether the host component has mounted.\r\n */\r\n let hasMounted = false;\r\n /**\r\n * A collection of linked component animation controls.\r\n */\r\n const subscribers = new Set();\r\n const controls = {\r\n subscribe(visualElement) {\r\n subscribers.add(visualElement);\r\n return () => void subscribers.delete(visualElement);\r\n },\r\n start(definition, transitionOverride) {\r\n invariant(hasMounted, \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\r\n const animations = [];\r\n subscribers.forEach((visualElement) => {\r\n animations.push(animateVisualElement(visualElement, definition, {\r\n transitionOverride,\r\n }));\r\n });\r\n return Promise.all(animations);\r\n },\r\n set(definition) {\r\n invariant(hasMounted, \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\r\n return subscribers.forEach((visualElement) => {\r\n setValues(visualElement, definition);\r\n });\r\n },\r\n stop() {\r\n subscribers.forEach((visualElement) => {\r\n stopAnimation(visualElement);\r\n });\r\n },\r\n mount() {\r\n hasMounted = true;\r\n return () => {\r\n hasMounted = false;\r\n controls.stop();\r\n };\r\n },\r\n };\r\n return controls;\r\n}\r\n\r\nexport { animationControls };\r\n","import { frame, cancelFrame } from '../../../frameloop/frame.mjs';\r\n\r\nfunction observeTimeline(update, timeline) {\r\n let prevProgress;\r\n const onFrame = () => {\r\n const { currentTime } = timeline;\r\n const percentage = currentTime === null ? 0 : currentTime.value;\r\n const progress = percentage / 100;\r\n if (prevProgress !== progress) {\r\n update(progress);\r\n }\r\n prevProgress = progress;\r\n };\r\n frame.update(onFrame, true);\r\n return () => cancelFrame(onFrame);\r\n}\r\n\r\nexport { observeTimeline };\r\n","import { memo } from '../../../utils/memo.mjs';\r\n\r\nconst supportsScrollTimeline = memo(() => window.ScrollTimeline !== undefined);\r\n\r\nexport { supportsScrollTimeline };\r\n","import { observeTimeline } from '../render/dom/scroll/observe.mjs';\r\nimport { supportsScrollTimeline } from '../render/dom/scroll/supports.mjs';\r\n\r\nclass GroupPlaybackControls {\r\n constructor(animations) {\r\n this.animations = animations.filter(Boolean);\r\n }\r\n then(onResolve, onReject) {\r\n return Promise.all(this.animations).then(onResolve).catch(onReject);\r\n }\r\n /**\r\n * TODO: Filter out cancelled or stopped animations before returning\r\n */\r\n getAll(propName) {\r\n return this.animations[0][propName];\r\n }\r\n setAll(propName, newValue) {\r\n for (let i = 0; i < this.animations.length; i++) {\r\n this.animations[i][propName] = newValue;\r\n }\r\n }\r\n attachTimeline(timeline) {\r\n const cancelAll = this.animations.map((animation) => {\r\n if (supportsScrollTimeline() && animation.attachTimeline) {\r\n animation.attachTimeline(timeline);\r\n }\r\n else {\r\n animation.pause();\r\n return observeTimeline((progress) => {\r\n animation.time = animation.duration * progress;\r\n }, timeline);\r\n }\r\n });\r\n return () => {\r\n cancelAll.forEach((cancelTimeline, i) => {\r\n if (cancelTimeline)\r\n cancelTimeline();\r\n this.animations[i].stop();\r\n });\r\n };\r\n }\r\n get time() {\r\n return this.getAll(\"time\");\r\n }\r\n set time(time) {\r\n this.setAll(\"time\", time);\r\n }\r\n get speed() {\r\n return this.getAll(\"speed\");\r\n }\r\n set speed(speed) {\r\n this.setAll(\"speed\", speed);\r\n }\r\n get duration() {\r\n let max = 0;\r\n for (let i = 0; i < this.animations.length; i++) {\r\n max = Math.max(max, this.animations[i].duration);\r\n }\r\n return max;\r\n }\r\n runAll(methodName) {\r\n this.animations.forEach((controls) => controls[methodName]());\r\n }\r\n play() {\r\n this.runAll(\"play\");\r\n }\r\n pause() {\r\n this.runAll(\"pause\");\r\n }\r\n stop() {\r\n this.runAll(\"stop\");\r\n }\r\n cancel() {\r\n this.runAll(\"cancel\");\r\n }\r\n complete() {\r\n this.runAll(\"complete\");\r\n }\r\n}\r\n\r\nexport { GroupPlaybackControls };\r\n","function isDOMKeyframes(keyframes) {\r\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\r\n}\r\n\r\nexport { isDOMKeyframes };\r\n","import { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\r\nimport { SVGVisualElement } from '../../render/svg/SVGVisualElement.mjs';\r\nimport { HTMLVisualElement } from '../../render/html/HTMLVisualElement.mjs';\r\nimport { visualElementStore } from '../../render/store.mjs';\r\n\r\nfunction createVisualElement(element) {\r\n const options = {\r\n presenceContext: null,\r\n props: {},\r\n visualState: {\r\n renderState: {\r\n transform: {},\r\n transformOrigin: {},\r\n style: {},\r\n vars: {},\r\n attrs: {},\r\n },\r\n latestValues: {},\r\n },\r\n };\r\n const node = isSVGElement(element)\r\n ? new SVGVisualElement(options, {\r\n enableHardwareAcceleration: false,\r\n })\r\n : new HTMLVisualElement(options, {\r\n enableHardwareAcceleration: true,\r\n });\r\n node.mount(element);\r\n visualElementStore.set(element, node);\r\n}\r\n\r\nexport { createVisualElement };\r\n","import { spring } from '../../animation/generators/spring/index.mjs';\r\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../../animation/generators/utils/calc-duration.mjs';\r\nimport { millisecondsToSeconds } from '../../utils/time-conversion.mjs';\r\n\r\n/**\r\n * Create a progress => progress easing function from a generator.\r\n */\r\nfunction createGeneratorEasing(options, scale = 100) {\r\n const generator = spring({ keyframes: [0, scale], ...options });\r\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\r\n return {\r\n type: \"keyframes\",\r\n ease: (progress) => generator.next(duration * progress).value / scale,\r\n duration: millisecondsToSeconds(duration),\r\n };\r\n}\r\n\r\nexport { createGeneratorEasing };\r\n","/**\r\n * Given a absolute or relative time definition and current/prev time state of the sequence,\r\n * calculate an absolute time for the next keyframes.\r\n */\r\nfunction calcNextTime(current, next, prev, labels) {\r\n var _a;\r\n if (typeof next === \"number\") {\r\n return next;\r\n }\r\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\r\n return Math.max(0, current + parseFloat(next));\r\n }\r\n else if (next === \"<\") {\r\n return prev;\r\n }\r\n else {\r\n return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current;\r\n }\r\n}\r\n\r\nexport { calcNextTime };\r\n","const wrap = (min, max, v) => {\r\n const rangeSize = max - min;\r\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\r\n};\r\n\r\nexport { wrap };\r\n","import { wrap } from '../../utils/wrap.mjs';\r\nimport { isEasingArray } from './is-easing-array.mjs';\r\n\r\nfunction getEasingForSegment(easing, i) {\r\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\r\n}\r\n\r\nexport { getEasingForSegment };\r\n","import { getEasingForSegment } from '../../../easing/utils/get-easing-for-segment.mjs';\r\nimport { removeItem } from '../../../utils/array.mjs';\r\nimport { mix } from '../../../utils/mix.mjs';\r\n\r\nfunction eraseKeyframes(sequence, startTime, endTime) {\r\n for (let i = 0; i < sequence.length; i++) {\r\n const keyframe = sequence[i];\r\n if (keyframe.at > startTime && keyframe.at < endTime) {\r\n removeItem(sequence, keyframe);\r\n // If we remove this item we have to push the pointer back one\r\n i--;\r\n }\r\n }\r\n}\r\nfunction addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\r\n /**\r\n * Erase every existing value between currentTime and targetTime,\r\n * this will essentially splice this timeline into any currently\r\n * defined ones.\r\n */\r\n eraseKeyframes(sequence, startTime, endTime);\r\n for (let i = 0; i < keyframes.length; i++) {\r\n sequence.push({\r\n value: keyframes[i],\r\n at: mix(startTime, endTime, offset[i]),\r\n easing: getEasingForSegment(easing, i),\r\n });\r\n }\r\n}\r\n\r\nexport { addKeyframes, eraseKeyframes };\r\n","function compareByTime(a, b) {\r\n if (a.at === b.at) {\r\n if (a.value === null)\r\n return 1;\r\n if (b.value === null)\r\n return -1;\r\n return 0;\r\n }\r\n else {\r\n return a.at - b.at;\r\n }\r\n}\r\n\r\nexport { compareByTime };\r\n","import { createGeneratorEasing } from '../../easing/utils/create-generator-easing.mjs';\r\nimport { resolveElements } from '../../render/dom/utils/resolve-element.mjs';\r\nimport { defaultOffset } from '../../utils/offsets/default.mjs';\r\nimport { fillOffset } from '../../utils/offsets/fill.mjs';\r\nimport { progress } from '../../utils/progress.mjs';\r\nimport { secondsToMilliseconds } from '../../utils/time-conversion.mjs';\r\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\r\nimport { calcNextTime } from './utils/calc-time.mjs';\r\nimport { addKeyframes } from './utils/edit.mjs';\r\nimport { compareByTime } from './utils/sort.mjs';\r\n\r\nconst defaultSegmentEasing = \"easeInOut\";\r\nfunction createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope) {\r\n const defaultDuration = defaultTransition.duration || 0.3;\r\n const animationDefinitions = new Map();\r\n const sequences = new Map();\r\n const elementCache = {};\r\n const timeLabels = new Map();\r\n let prevTime = 0;\r\n let currentTime = 0;\r\n let totalDuration = 0;\r\n /**\r\n * Build the timeline by mapping over the sequence array and converting\r\n * the definitions into keyframes and offsets with absolute time values.\r\n * These will later get converted into relative offsets in a second pass.\r\n */\r\n for (let i = 0; i < sequence.length; i++) {\r\n const segment = sequence[i];\r\n /**\r\n * If this is a timeline label, mark it and skip the rest of this iteration.\r\n */\r\n if (typeof segment === \"string\") {\r\n timeLabels.set(segment, currentTime);\r\n continue;\r\n }\r\n else if (!Array.isArray(segment)) {\r\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\r\n continue;\r\n }\r\n let [subject, keyframes, transition = {}] = segment;\r\n /**\r\n * If a relative or absolute time value has been specified we need to resolve\r\n * it in relation to the currentTime.\r\n */\r\n if (transition.at !== undefined) {\r\n currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);\r\n }\r\n /**\r\n * Keep track of the maximum duration in this definition. This will be\r\n * applied to currentTime once the definition has been parsed.\r\n */\r\n let maxDuration = 0;\r\n const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numElements = 0) => {\r\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\r\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = \"keyframes\", ...remainingTransition } = valueTransition;\r\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\r\n /**\r\n * Resolve stagger() if defined.\r\n */\r\n const calculatedDelay = typeof delay === \"function\"\r\n ? delay(elementIndex, numElements)\r\n : delay;\r\n /**\r\n * If this animation should and can use a spring, generate a spring easing function.\r\n */\r\n const numKeyframes = valueKeyframesAsList.length;\r\n if (numKeyframes <= 2 && type === \"spring\") {\r\n /**\r\n * As we're creating an easing function from a spring,\r\n * ideally we want to generate it using the real distance\r\n * between the two keyframes. However this isn't always\r\n * possible - in these situations we use 0-100.\r\n */\r\n let absoluteDelta = 100;\r\n if (numKeyframes === 2 &&\r\n isNumberKeyframesArray(valueKeyframesAsList)) {\r\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\r\n absoluteDelta = Math.abs(delta);\r\n }\r\n const springTransition = { ...remainingTransition };\r\n if (duration !== undefined) {\r\n springTransition.duration = secondsToMilliseconds(duration);\r\n }\r\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta);\r\n ease = springEasing.ease;\r\n duration = springEasing.duration;\r\n }\r\n duration !== null && duration !== void 0 ? duration : (duration = defaultDuration);\r\n const startTime = currentTime + calculatedDelay;\r\n const targetTime = startTime + duration;\r\n /**\r\n * If there's only one time offset of 0, fill in a second with length 1\r\n */\r\n if (times.length === 1 && times[0] === 0) {\r\n times[1] = 1;\r\n }\r\n /**\r\n * Fill out if offset if fewer offsets than keyframes\r\n */\r\n const remainder = times.length - valueKeyframesAsList.length;\r\n remainder > 0 && fillOffset(times, remainder);\r\n /**\r\n * If only one value has been set, ie [1], push a null to the start of\r\n * the keyframe array. This will let us mark a keyframe at this point\r\n * that will later be hydrated with the previous value.\r\n */\r\n valueKeyframesAsList.length === 1 &&\r\n valueKeyframesAsList.unshift(null);\r\n /**\r\n * Add keyframes, mapping offsets to absolute time.\r\n */\r\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\r\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\r\n totalDuration = Math.max(targetTime, totalDuration);\r\n };\r\n if (isMotionValue(subject)) {\r\n const subjectSequence = getSubjectSequence(subject, sequences);\r\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\r\n }\r\n else {\r\n /**\r\n * Find all the elements specified in the definition and parse value\r\n * keyframes from their timeline definitions.\r\n */\r\n const elements = resolveElements(subject, scope, elementCache);\r\n const numElements = elements.length;\r\n /**\r\n * For every element in this segment, process the defined values.\r\n */\r\n for (let elementIndex = 0; elementIndex < numElements; elementIndex++) {\r\n /**\r\n * Cast necessary, but we know these are of this type\r\n */\r\n keyframes = keyframes;\r\n transition = transition;\r\n const element = elements[elementIndex];\r\n const subjectSequence = getSubjectSequence(element, sequences);\r\n for (const key in keyframes) {\r\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), elementIndex, numElements);\r\n }\r\n }\r\n }\r\n prevTime = currentTime;\r\n currentTime += maxDuration;\r\n }\r\n /**\r\n * For every element and value combination create a new animation.\r\n */\r\n sequences.forEach((valueSequences, element) => {\r\n for (const key in valueSequences) {\r\n const valueSequence = valueSequences[key];\r\n /**\r\n * Arrange all the keyframes in ascending time order.\r\n */\r\n valueSequence.sort(compareByTime);\r\n const keyframes = [];\r\n const valueOffset = [];\r\n const valueEasing = [];\r\n /**\r\n * For each keyframe, translate absolute times into\r\n * relative offsets based on the total duration of the timeline.\r\n */\r\n for (let i = 0; i < valueSequence.length; i++) {\r\n const { at, value, easing } = valueSequence[i];\r\n keyframes.push(value);\r\n valueOffset.push(progress(0, totalDuration, at));\r\n valueEasing.push(easing || \"easeOut\");\r\n }\r\n /**\r\n * If the first keyframe doesn't land on offset: 0\r\n * provide one by duplicating the initial keyframe. This ensures\r\n * it snaps to the first keyframe when the animation starts.\r\n */\r\n if (valueOffset[0] !== 0) {\r\n valueOffset.unshift(0);\r\n keyframes.unshift(keyframes[0]);\r\n valueEasing.unshift(defaultSegmentEasing);\r\n }\r\n /**\r\n * If the last keyframe doesn't land on offset: 1\r\n * provide one with a null wildcard value. This will ensure it\r\n * stays static until the end of the animation.\r\n */\r\n if (valueOffset[valueOffset.length - 1] !== 1) {\r\n valueOffset.push(1);\r\n keyframes.push(null);\r\n }\r\n if (!animationDefinitions.has(element)) {\r\n animationDefinitions.set(element, {\r\n keyframes: {},\r\n transition: {},\r\n });\r\n }\r\n const definition = animationDefinitions.get(element);\r\n definition.keyframes[key] = keyframes;\r\n definition.transition[key] = {\r\n ...defaultTransition,\r\n duration: totalDuration,\r\n ease: valueEasing,\r\n times: valueOffset,\r\n ...sequenceTransition,\r\n };\r\n }\r\n });\r\n return animationDefinitions;\r\n}\r\nfunction getSubjectSequence(subject, sequences) {\r\n !sequences.has(subject) && sequences.set(subject, {});\r\n return sequences.get(subject);\r\n}\r\nfunction getValueSequence(name, sequences) {\r\n if (!sequences[name])\r\n sequences[name] = [];\r\n return sequences[name];\r\n}\r\nfunction keyframesAsList(keyframes) {\r\n return Array.isArray(keyframes) ? keyframes : [keyframes];\r\n}\r\nfunction getValueTransition(transition, key) {\r\n return transition[key]\r\n ? { ...transition, ...transition[key] }\r\n : { ...transition };\r\n}\r\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\r\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\r\n\r\nexport { createAnimationsFromSequence, getValueTransition };\r\n","import { resolveElements } from '../render/dom/utils/resolve-element.mjs';\r\nimport { visualElementStore } from '../render/store.mjs';\r\nimport { invariant } from '../utils/errors.mjs';\r\nimport { GroupPlaybackControls } from './GroupPlaybackControls.mjs';\r\nimport { isDOMKeyframes } from './utils/is-dom-keyframes.mjs';\r\nimport { animateTarget } from './interfaces/visual-element-target.mjs';\r\nimport { createVisualElement } from './utils/create-visual-element.mjs';\r\nimport { animateSingleValue } from './interfaces/single-value.mjs';\r\nimport { createAnimationsFromSequence } from './sequence/create.mjs';\r\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\r\n\r\nfunction animateElements(elementOrSelector, keyframes, options, scope) {\r\n const elements = resolveElements(elementOrSelector, scope);\r\n const numElements = elements.length;\r\n invariant(Boolean(numElements), \"No valid element provided.\");\r\n const animations = [];\r\n for (let i = 0; i < numElements; i++) {\r\n const element = elements[i];\r\n /**\r\n * Check each element for an associated VisualElement. If none exists,\r\n * we need to create one.\r\n */\r\n if (!visualElementStore.has(element)) {\r\n /**\r\n * TODO: We only need render-specific parts of the VisualElement.\r\n * With some additional work the size of the animate() function\r\n * could be reduced significantly.\r\n */\r\n createVisualElement(element);\r\n }\r\n const visualElement = visualElementStore.get(element);\r\n const transition = { ...options };\r\n /**\r\n * Resolve stagger function if provided.\r\n */\r\n if (typeof transition.delay === \"function\") {\r\n transition.delay = transition.delay(i, numElements);\r\n }\r\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\r\n }\r\n return new GroupPlaybackControls(animations);\r\n}\r\nconst isSequence = (value) => Array.isArray(value) && Array.isArray(value[0]);\r\nfunction animateSequence(sequence, options, scope) {\r\n const animations = [];\r\n const animationDefinitions = createAnimationsFromSequence(sequence, options, scope);\r\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\r\n let animation;\r\n if (isMotionValue(subject)) {\r\n animation = animateSingleValue(subject, keyframes.default, transition.default);\r\n }\r\n else {\r\n animation = animateElements(subject, keyframes, transition);\r\n }\r\n animations.push(animation);\r\n });\r\n return new GroupPlaybackControls(animations);\r\n}\r\nconst createScopedAnimate = (scope) => {\r\n /**\r\n * Implementation\r\n */\r\n function scopedAnimate(valueOrElementOrSequence, keyframes, options) {\r\n let animation;\r\n if (isSequence(valueOrElementOrSequence)) {\r\n animation = animateSequence(valueOrElementOrSequence, keyframes, scope);\r\n }\r\n else if (isDOMKeyframes(keyframes)) {\r\n animation = animateElements(valueOrElementOrSequence, keyframes, options, scope);\r\n }\r\n else {\r\n animation = animateSingleValue(valueOrElementOrSequence, keyframes, options);\r\n }\r\n if (scope) {\r\n scope.animations.push(animation);\r\n }\r\n return animation;\r\n }\r\n return scopedAnimate;\r\n};\r\nconst animate = createScopedAnimate();\r\n\r\nexport { animate, createScopedAnimate };\r\n","import { useConstant } from '../../utils/use-constant.mjs';\r\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\r\nimport { createScopedAnimate } from '../animate.mjs';\r\n\r\nfunction useAnimate() {\r\n const scope = useConstant(() => ({\r\n current: null,\r\n animations: [],\r\n }));\r\n const animate = useConstant(() => createScopedAnimate(scope));\r\n useUnmountEffect(() => {\r\n scope.animations.forEach((animation) => animation.stop());\r\n });\r\n return [scope, animate];\r\n}\r\n\r\nexport { useAnimate };\r\n","import { animationControls } from './animation-controls.mjs';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\r\n\r\n/**\r\n * Creates `AnimationControls`, which can be used to manually start, stop\r\n * and sequence animations on one or more components.\r\n *\r\n * The returned `AnimationControls` should be passed to the `animate` property\r\n * of the components you want to animate.\r\n *\r\n * These components can then be animated with the `start` method.\r\n *\r\n * ```jsx\r\n * import * as React from 'react'\r\n * import { motion, useAnimation } from 'framer-motion'\r\n *\r\n * export function MyComponent(props) {\r\n * const controls = useAnimation()\r\n *\r\n * controls.start({\r\n * x: 100,\r\n * transition: { duration: 0.5 },\r\n * })\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @returns Animation controller with `start` and `stop` methods\r\n *\r\n * @public\r\n */\r\nfunction useAnimationControls() {\r\n const controls = useConstant(animationControls);\r\n useIsomorphicLayoutEffect(controls.mount, []);\r\n return controls;\r\n}\r\nconst useAnimation = useAnimationControls;\r\n\r\nexport { useAnimation, useAnimationControls };\r\n","import { useRef, useState, useCallback } from 'react';\r\nimport { wrap } from './wrap.mjs';\r\n\r\n/**\r\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\r\n *\r\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\r\n *\r\n * ```jsx\r\n * import * as React from \"react\"\r\n * import { motion, useCycle } from \"framer-motion\"\r\n *\r\n * export const MyComponent = () => {\r\n * const [x, cycleX] = useCycle(0, 50, 100)\r\n *\r\n * return (\r\n * cycleX()}\r\n * />\r\n * )\r\n * }\r\n * ```\r\n *\r\n * @param items - items to cycle through\r\n * @returns [currentState, cycleState]\r\n *\r\n * @public\r\n */\r\nfunction useCycle(...items) {\r\n const index = useRef(0);\r\n const [item, setItem] = useState(items[index.current]);\r\n const runCycle = useCallback((next) => {\r\n index.current =\r\n typeof next !== \"number\"\r\n ? wrap(0, items.length, index.current + 1)\r\n : next;\r\n setItem(items[index.current]);\r\n }, \r\n // The array will change on each call, but by putting items.length at\r\n // the front of this array, we guarantee the dependency comparison will match up\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [items.length, ...items]);\r\n return [item, runCycle];\r\n}\r\n\r\nexport { useCycle };\r\n","import { resolveElements } from '../utils/resolve-element.mjs';\r\n\r\nconst thresholds = {\r\n some: 0,\r\n all: 1,\r\n};\r\nfunction inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = \"some\" } = {}) {\r\n const elements = resolveElements(elementOrSelector);\r\n const activeIntersections = new WeakMap();\r\n const onIntersectionChange = (entries) => {\r\n entries.forEach((entry) => {\r\n const onEnd = activeIntersections.get(entry.target);\r\n /**\r\n * If there's no change to the intersection, we don't need to\r\n * do anything here.\r\n */\r\n if (entry.isIntersecting === Boolean(onEnd))\r\n return;\r\n if (entry.isIntersecting) {\r\n const newOnEnd = onStart(entry);\r\n if (typeof newOnEnd === \"function\") {\r\n activeIntersections.set(entry.target, newOnEnd);\r\n }\r\n else {\r\n observer.unobserve(entry.target);\r\n }\r\n }\r\n else if (onEnd) {\r\n onEnd(entry);\r\n activeIntersections.delete(entry.target);\r\n }\r\n });\r\n };\r\n const observer = new IntersectionObserver(onIntersectionChange, {\r\n root,\r\n rootMargin,\r\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\r\n });\r\n elements.forEach((element) => observer.observe(element));\r\n return () => observer.disconnect();\r\n}\r\n\r\nexport { inView };\r\n","import { useState, useEffect } from 'react';\r\nimport { inView } from '../render/dom/viewport/index.mjs';\r\n\r\nfunction useInView(ref, { root, margin, amount, once = false } = {}) {\r\n const [isInView, setInView] = useState(false);\r\n useEffect(() => {\r\n if (!ref.current || (once && isInView))\r\n return;\r\n const onEnter = () => {\r\n setInView(true);\r\n return once ? undefined : () => setInView(false);\r\n };\r\n const options = {\r\n root: (root && root.current) || undefined,\r\n margin,\r\n amount,\r\n };\r\n return inView(ref.current, onEnter, options);\r\n }, [root, ref, margin, once, amount]);\r\n return isInView;\r\n}\r\n\r\nexport { useInView };\r\n","import { useConstant } from '../../utils/use-constant.mjs';\r\n\r\n/**\r\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\r\n *\r\n * ```jsx\r\n * const dragControls = useDragControls()\r\n *\r\n * function startDrag(event) {\r\n * dragControls.start(event, { snapToCursor: true })\r\n * }\r\n *\r\n * return (\r\n * <>\r\n *
\r\n * \r\n * \r\n * )\r\n * ```\r\n *\r\n * @public\r\n */\r\nclass DragControls {\r\n constructor() {\r\n this.componentControls = new Set();\r\n }\r\n /**\r\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\r\n *\r\n * @internal\r\n */\r\n subscribe(controls) {\r\n this.componentControls.add(controls);\r\n return () => this.componentControls.delete(controls);\r\n }\r\n /**\r\n * Start a drag gesture on every `motion` component that has this set of drag controls\r\n * passed into it via the `dragControls` prop.\r\n *\r\n * ```jsx\r\n * dragControls.start(e, {\r\n * snapToCursor: true\r\n * })\r\n * ```\r\n *\r\n * @param event - PointerEvent\r\n * @param options - Options\r\n *\r\n * @public\r\n */\r\n start(event, options) {\r\n this.componentControls.forEach((controls) => {\r\n controls.start(event.nativeEvent || event, options);\r\n });\r\n }\r\n}\r\nconst createDragControls = () => new DragControls();\r\n/**\r\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\r\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\r\n * might want to initiate that dragging from a different component than the draggable one.\r\n *\r\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\r\n * the draggable component's `dragControls` prop. It exposes a `start` method\r\n * that can start dragging from pointer events on other components.\r\n *\r\n * ```jsx\r\n * const dragControls = useDragControls()\r\n *\r\n * function startDrag(event) {\r\n * dragControls.start(event, { snapToCursor: true })\r\n * }\r\n *\r\n * return (\r\n * <>\r\n *
\r\n * \r\n * \r\n * )\r\n * ```\r\n *\r\n * @public\r\n */\r\nfunction useDragControls() {\r\n return useConstant(createDragControls);\r\n}\r\n\r\nexport { DragControls, useDragControls };\r\n","import { useEffect } from 'react';\r\nimport { addDomEvent } from './add-dom-event.mjs';\r\n\r\n/**\r\n * Attaches an event listener directly to the provided DOM element.\r\n *\r\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\r\n * event handlers.\r\n *\r\n * ```jsx\r\n * const ref = useRef(null)\r\n *\r\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\r\n *\r\n * return
\r\n * ```\r\n *\r\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\r\n * @param eventName - Name of the event you want listen for.\r\n * @param handler - Function to fire when receiving the event.\r\n * @param options - Options to pass to `Event.addEventListener`.\r\n *\r\n * @public\r\n */\r\nfunction useDomEvent(ref, eventName, handler, options) {\r\n useEffect(() => {\r\n const element = ref.current;\r\n if (handler && element) {\r\n return addDomEvent(element, eventName, handler, options);\r\n }\r\n }, [ref, eventName, handler, options]);\r\n}\r\n\r\nexport { useDomEvent };\r\n","import { motionComponentSymbol } from './symbol.mjs';\r\n\r\n/**\r\n * Checks if a component is a `motion` component.\r\n */\r\nfunction isMotionComponent(component) {\r\n return (component !== null &&\r\n typeof component === \"object\" &&\r\n motionComponentSymbol in component);\r\n}\r\n\r\nexport { isMotionComponent };\r\n","import { isMotionComponent } from './is-motion-component.mjs';\r\nimport { motionComponentSymbol } from './symbol.mjs';\r\n\r\n/**\r\n * Unwraps a `motion` component and returns either a string for `motion.div` or\r\n * the React component for `motion(Component)`.\r\n *\r\n * If the component is not a `motion` component it returns undefined.\r\n */\r\nfunction unwrapMotionComponent(component) {\r\n if (isMotionComponent(component)) {\r\n return component[motionComponentSymbol];\r\n }\r\n return undefined;\r\n}\r\n\r\nexport { unwrapMotionComponent };\r\n","import { rootProjectionNode } from './node/HTMLProjectionNode.mjs';\r\n\r\nfunction useInstantLayoutTransition() {\r\n return startTransition;\r\n}\r\nfunction startTransition(callback) {\r\n if (!rootProjectionNode.current)\r\n return;\r\n rootProjectionNode.current.isUpdating = false;\r\n rootProjectionNode.current.blockUpdate();\r\n callback && callback();\r\n}\r\n\r\nexport { useInstantLayoutTransition };\r\n","import { useRef, useEffect } from 'react';\r\nimport { useInstantLayoutTransition } from '../projection/use-instant-layout-transition.mjs';\r\nimport { useForceUpdate } from './use-force-update.mjs';\r\nimport { instantAnimationState } from './use-instant-transition-state.mjs';\r\nimport { frame } from '../frameloop/frame.mjs';\r\n\r\nfunction useInstantTransition() {\r\n const [forceUpdate, forcedRenderCount] = useForceUpdate();\r\n const startInstantLayoutTransition = useInstantLayoutTransition();\r\n const unlockOnFrameRef = useRef();\r\n useEffect(() => {\r\n /**\r\n * Unblock after two animation frames, otherwise this will unblock too soon.\r\n */\r\n frame.postRender(() => frame.postRender(() => {\r\n /**\r\n * If the callback has been called again after the effect\r\n * triggered this 2 frame delay, don't unblock animations. This\r\n * prevents the previous effect from unblocking the current\r\n * instant transition too soon. This becomes more likely when\r\n * used in conjunction with React.startTransition().\r\n */\r\n if (forcedRenderCount !== unlockOnFrameRef.current)\r\n return;\r\n instantAnimationState.current = false;\r\n }));\r\n }, [forcedRenderCount]);\r\n return (callback) => {\r\n startInstantLayoutTransition(() => {\r\n instantAnimationState.current = true;\r\n forceUpdate();\r\n callback();\r\n unlockOnFrameRef.current = forcedRenderCount + 1;\r\n });\r\n };\r\n}\r\nfunction disableInstantTransitions() {\r\n instantAnimationState.current = false;\r\n}\r\n\r\nexport { disableInstantTransitions, useInstantTransition };\r\n","import * as React from 'react';\r\nimport { rootProjectionNode } from './node/HTMLProjectionNode.mjs';\r\n\r\nfunction useResetProjection() {\r\n const reset = React.useCallback(() => {\r\n const root = rootProjectionNode.current;\r\n if (!root)\r\n return;\r\n root.resetTree();\r\n }, []);\r\n return reset;\r\n}\r\n\r\nexport { useResetProjection };\r\n","const appearStoreId = (id, value) => `${id}: ${value}`;\r\n\r\nexport { appearStoreId };\r\n","const appearAnimationStore = new Map();\r\n\r\nexport { appearAnimationStore };\r\n","import { transformProps } from '../../render/html/utils/transform.mjs';\r\nimport { appearAnimationStore } from './store.mjs';\r\nimport { appearStoreId } from './store-id.mjs';\r\n\r\nlet handoffFrameTime;\r\nfunction handoffOptimizedAppearAnimation(elementId, valueName, \r\n/**\r\n * Legacy arguments. This function is inlined as part of SSG so it can be there's\r\n * a version mismatch between the main included Motion and the inlined script.\r\n *\r\n * Remove in early 2024.\r\n */\r\n_value, _frame) {\r\n const optimisedValueName = transformProps.has(valueName)\r\n ? \"transform\"\r\n : valueName;\r\n const storeId = appearStoreId(elementId, optimisedValueName);\r\n const optimisedAnimation = appearAnimationStore.get(storeId);\r\n if (!optimisedAnimation) {\r\n return null;\r\n }\r\n const { animation, startTime } = optimisedAnimation;\r\n const cancelAnimation = () => {\r\n appearAnimationStore.delete(storeId);\r\n try {\r\n animation.cancel();\r\n }\r\n catch (error) { }\r\n };\r\n /**\r\n * If the startTime is null, this animation is the Paint Ready detection animation\r\n * and we can cancel it immediately without handoff.\r\n *\r\n * Or if we've already handed off the animation then we're now interrupting it.\r\n * In which case we need to cancel it.\r\n */\r\n if (startTime === null || window.HandoffComplete) {\r\n cancelAnimation();\r\n return null;\r\n }\r\n else {\r\n /**\r\n * Otherwise we're handing off this animation to the main thread.\r\n *\r\n * Record the time of the first handoff. We call performance.now() once\r\n * here and once in startOptimisedAnimation to ensure we're getting\r\n * close to a frame-locked time. This keeps all animations in sync.\r\n */\r\n if (handoffFrameTime === undefined) {\r\n handoffFrameTime = performance.now();\r\n }\r\n /**\r\n * We use main thread timings vs those returned by Animation.currentTime as it\r\n * can be the case, particularly in Firefox, that currentTime doesn't return\r\n * an updated value for several frames, even as the animation plays smoothly via\r\n * the GPU.\r\n */\r\n return handoffFrameTime - startTime || 0;\r\n }\r\n}\r\n\r\nexport { handoffOptimizedAppearAnimation };\r\n","import { appearStoreId } from './store-id.mjs';\r\nimport { animateStyle } from '../animators/waapi/index.mjs';\r\nimport { optimizedAppearDataId } from './data-id.mjs';\r\nimport { handoffOptimizedAppearAnimation } from './handoff.mjs';\r\nimport { appearAnimationStore } from './store.mjs';\r\nimport { noop } from '../../utils/noop.mjs';\r\n\r\n/**\r\n * A single time to use across all animations to manually set startTime\r\n * and ensure they're all in sync.\r\n */\r\nlet startFrameTime;\r\n/**\r\n * A dummy animation to detect when Chrome is ready to start\r\n * painting the page and hold off from triggering the real animation\r\n * until then. We only need one animation to detect paint ready.\r\n *\r\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\r\n */\r\nlet readyAnimation;\r\nfunction startOptimizedAppearAnimation(element, name, keyframes, options, onReady) {\r\n // Prevent optimised appear animations if Motion has already started animating.\r\n if (window.HandoffComplete) {\r\n window.HandoffAppearAnimations = undefined;\r\n return;\r\n }\r\n const id = element.dataset[optimizedAppearDataId];\r\n if (!id)\r\n return;\r\n window.HandoffAppearAnimations = handoffOptimizedAppearAnimation;\r\n const storeId = appearStoreId(id, name);\r\n if (!readyAnimation) {\r\n readyAnimation = animateStyle(element, name, [keyframes[0], keyframes[0]], \r\n /**\r\n * 10 secs is basically just a super-safe duration to give Chrome\r\n * long enough to get the animation ready.\r\n */\r\n { duration: 10000, ease: \"linear\" });\r\n appearAnimationStore.set(storeId, {\r\n animation: readyAnimation,\r\n startTime: null,\r\n });\r\n }\r\n const startAnimation = () => {\r\n readyAnimation.cancel();\r\n const appearAnimation = animateStyle(element, name, keyframes, options);\r\n /**\r\n * Record the time of the first started animation. We call performance.now() once\r\n * here and once in handoff to ensure we're getting\r\n * close to a frame-locked time. This keeps all animations in sync.\r\n */\r\n if (startFrameTime === undefined) {\r\n startFrameTime = performance.now();\r\n }\r\n appearAnimation.startTime = startFrameTime;\r\n appearAnimationStore.set(storeId, {\r\n animation: appearAnimation,\r\n startTime: startFrameTime,\r\n });\r\n if (onReady)\r\n onReady(appearAnimation);\r\n };\r\n if (readyAnimation.ready) {\r\n readyAnimation.ready.then(startAnimation).catch(noop);\r\n }\r\n else {\r\n startAnimation();\r\n }\r\n}\r\n\r\nexport { startOptimizedAppearAnimation };\r\n","import { useState, useEffect } from 'react';\r\nimport { useConstant } from '../../utils/use-constant.mjs';\r\nimport { getOrigin, checkTargetForNewValues } from '../../render/utils/setters.mjs';\r\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\r\nimport { createBox } from '../../projection/geometry/models.mjs';\r\nimport { VisualElement } from '../../render/VisualElement.mjs';\r\nimport { animateVisualElement } from '../interfaces/visual-element.mjs';\r\n\r\nconst createObject = () => ({});\r\nclass StateVisualElement extends VisualElement {\r\n build() { }\r\n measureInstanceViewportBox() {\r\n return createBox();\r\n }\r\n resetTransform() { }\r\n restoreTransform() { }\r\n removeValueFromRenderState() { }\r\n renderInstance() { }\r\n scrapeMotionValuesFromProps() {\r\n return createObject();\r\n }\r\n getBaseTargetFromProps() {\r\n return undefined;\r\n }\r\n readValueFromInstance(_state, key, options) {\r\n return options.initialState[key] || 0;\r\n }\r\n sortInstanceNodePosition() {\r\n return 0;\r\n }\r\n makeTargetAnimatableFromInstance({ transition, transitionEnd, ...target }) {\r\n const origin = getOrigin(target, transition || {}, this);\r\n checkTargetForNewValues(this, target, origin);\r\n return { transition, transitionEnd, ...target };\r\n }\r\n}\r\nconst useVisualState = makeUseVisualState({\r\n scrapeMotionValuesFromProps: createObject,\r\n createRenderState: createObject,\r\n});\r\n/**\r\n * This is not an officially supported API and may be removed\r\n * on any version.\r\n */\r\nfunction useAnimatedState(initialState) {\r\n const [animationState, setAnimationState] = useState(initialState);\r\n const visualState = useVisualState({}, false);\r\n const element = useConstant(() => {\r\n return new StateVisualElement({ props: {}, visualState, presenceContext: null }, { initialState });\r\n });\r\n useEffect(() => {\r\n element.mount({});\r\n return () => element.unmount();\r\n }, [element]);\r\n useEffect(() => {\r\n element.update({\r\n onUpdate: (v) => {\r\n setAnimationState({ ...v });\r\n },\r\n }, null);\r\n }, [setAnimationState, element]);\r\n const startAnimation = useConstant(() => (animationDefinition) => {\r\n return animateVisualElement(element, animationDefinition);\r\n });\r\n return [animationState, startAnimation];\r\n}\r\n\r\nexport { useAnimatedState };\r\n","import { useTransform } from './use-transform.mjs';\r\nimport { invariant, warning } from '../utils/errors.mjs';\r\nimport { useMotionValue } from './use-motion-value.mjs';\r\nimport { MotionContext } from '../context/MotionContext/index.mjs';\r\nimport { useContext } from 'react';\r\n\r\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\r\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\r\n// to simply hide content at unreasonable scales.\r\nconst maxScale = 100000;\r\nconst invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale;\r\nlet hasWarned = false;\r\n/**\r\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\r\n * of their respective parent scales.\r\n *\r\n * This is useful for undoing the distortion of content when scaling a parent component.\r\n *\r\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\r\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\r\n * of those instead.\r\n *\r\n * ```jsx\r\n * const MyComponent = () => {\r\n * const { scaleX, scaleY } = useInvertedScale()\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @deprecated\r\n */\r\nfunction useInvertedScale(scale) {\r\n let parentScaleX = useMotionValue(1);\r\n let parentScaleY = useMotionValue(1);\r\n const { visualElement } = useContext(MotionContext);\r\n invariant(!!(scale || visualElement), \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\");\r\n warning(hasWarned, \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\");\r\n hasWarned = true;\r\n if (scale) {\r\n parentScaleX = scale.scaleX || parentScaleX;\r\n parentScaleY = scale.scaleY || parentScaleY;\r\n }\r\n else if (visualElement) {\r\n parentScaleX = visualElement.getValue(\"scaleX\", 1);\r\n parentScaleY = visualElement.getValue(\"scaleY\", 1);\r\n }\r\n const scaleX = useTransform(parentScaleX, invertScale);\r\n const scaleY = useTransform(parentScaleY, invertScale);\r\n return { scaleX, scaleY };\r\n}\r\n\r\nexport { invertScale, useInvertedScale };\r\n","import { invariant } from '../utils/errors.mjs';\r\nimport * as React from 'react';\r\nimport { useConstant } from '../utils/use-constant.mjs';\r\nimport { LayoutGroup } from './LayoutGroup/index.mjs';\r\n\r\nlet id = 0;\r\nconst AnimateSharedLayout = ({ children }) => {\r\n React.useEffect(() => {\r\n invariant(false, \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\");\r\n }, []);\r\n return (React.createElement(LayoutGroup, { id: useConstant(() => `asl-${id++}`) }, children));\r\n};\r\n\r\nexport { AnimateSharedLayout };\r\n","import { scrollInfo } from './track.mjs';\r\nimport { observeTimeline } from './observe.mjs';\r\nimport { supportsScrollTimeline } from './supports.mjs';\r\n\r\nfunction scrollTimelineFallback({ source, axis = \"y\" }) {\r\n // ScrollTimeline records progress as a percentage CSSUnitValue\r\n const currentTime = { value: 0 };\r\n const cancel = scrollInfo((info) => {\r\n currentTime.value = info[axis].progress * 100;\r\n }, { container: source, axis });\r\n return { currentTime, cancel };\r\n}\r\nconst timelineCache = new Map();\r\nfunction getTimeline({ source = document.documentElement, axis = \"y\", } = {}) {\r\n if (!timelineCache.has(source)) {\r\n timelineCache.set(source, {});\r\n }\r\n const elementCache = timelineCache.get(source);\r\n if (!elementCache[axis]) {\r\n elementCache[axis] = supportsScrollTimeline()\r\n ? new ScrollTimeline({ source, axis })\r\n : scrollTimelineFallback({ source, axis });\r\n }\r\n return elementCache[axis];\r\n}\r\nfunction scroll(onScroll, options) {\r\n const timeline = getTimeline(options);\r\n if (typeof onScroll === \"function\") {\r\n return observeTimeline(onScroll, timeline);\r\n }\r\n else {\r\n return onScroll.attachTimeline(timeline);\r\n }\r\n}\r\n\r\nexport { scroll };\r\n","import { easingDefinitionToFunction } from '../../easing/utils/map.mjs';\r\n\r\nfunction getOriginIndex(from, total) {\r\n if (from === \"first\") {\r\n return 0;\r\n }\r\n else {\r\n const lastIndex = total - 1;\r\n return from === \"last\" ? lastIndex : lastIndex / 2;\r\n }\r\n}\r\nfunction stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) {\r\n return (i, total) => {\r\n const fromIndex = typeof from === \"number\" ? from : getOriginIndex(from, total);\r\n const distance = Math.abs(fromIndex - i);\r\n let delay = duration * distance;\r\n if (ease) {\r\n const maxDelay = total * duration;\r\n const easingFunction = easingDefinitionToFunction(ease);\r\n delay = easingFunction(delay / maxDelay) * maxDelay;\r\n }\r\n return startDelay + delay;\r\n };\r\n}\r\n\r\nexport { getOriginIndex, stagger };\r\n","import { stepsOrder } from './batcher.mjs';\r\nimport { frame, cancelFrame } from './frame.mjs';\r\n\r\n/**\r\n * @deprecated\r\n *\r\n * Import as `frame` instead.\r\n */\r\nconst sync = frame;\r\n/**\r\n * @deprecated\r\n *\r\n * Use cancelFrame(callback) instead.\r\n */\r\nconst cancelSync = stepsOrder.reduce((acc, key) => {\r\n acc[key] = (process) => cancelFrame(process);\r\n return acc;\r\n}, {});\r\n\r\nexport { cancelSync, sync };\r\n"],"mappings":";;;;;;;AAKA,IAAM,uBAAA,GAAA,aAAA,eAAoC;CACtC,qBAAqB,MAAM;CAC3B,UAAU;CACV,eAAe;CAClB,CAAC;;;ACPF,IAAM,iBAAA,GAAA,aAAA,eAA8B,EAAE,CAAC;;;;;;ACGvC,IAAM,mBAAA,GAAA,aAAA,eAAgC,KAAK;;;ACL3C,IAAM,YAAY,OAAO,aAAa;;;ACGtC,IAAM,4BAA4B,YAAYA,aAAAA,kBAAkBC,aAAAA;;;ACDhE,IAAM,eAAA,GAAA,aAAA,eAA4B,EAAE,QAAQ,OAAO,CAAC;;;;;;ACCpD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AAY;;;AAGzD,SAAS,QAAQ,WAAW,IAAK,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,EAAE,EAAE;AACtE,SAAQ,GAAG,UAAU;EACjB,MAAM,YAAY,OAAO,SAAS,WAAW,OAAO,eAAe,MAAM,MAAM;EAE/E,IAAI,QAAQ,WADK,KAAK,IAAI,YAAY,EAAE;AAExC,MAAI,MAAM;GACN,MAAM,WAAW,QAAQ;AAEzB,WADuB,2BAA2B,KAAK,CAChC,QAAQ,SAAS,GAAG;;AAE/C,SAAO,aAAa;;;;;;;;;;ACb5B,IAAM,OAAO;;;;;;AAMb,IAAM,aAAa,WAAW,QAAQ,KAAK,QAAQ;AAC/C,KAAI,QAAQ,YAAY,YAAY,QAAQ;AAC5C,QAAO;GACR,EAAE,CAAC"} \ No newline at end of file diff --git a/Frontend/node_modules/.vite/deps/iconBase-BCeeRc1F.js b/Frontend/node_modules/.vite/deps/iconBase-BCeeRc1F.js deleted file mode 100644 index 30be738d..00000000 --- a/Frontend/node_modules/.vite/deps/iconBase-BCeeRc1F.js +++ /dev/null @@ -1,72 +0,0 @@ -import { o as __toESM, t as require_react } from "./react-Dayigfg7.js"; -//#region node_modules/react-icons/lib/esm/iconContext.js -var import_react = /* @__PURE__ */ __toESM(require_react()); -var DefaultContext = { - color: void 0, - size: void 0, - className: void 0, - style: void 0, - attr: void 0 -}; -var IconContext = import_react.createContext && import_react.createContext(DefaultContext); -//#endregion -//#region node_modules/react-icons/lib/esm/iconBase.js -var __assign = function() { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __rest = function(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") { - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; - } - return t; -}; -function Tree2Element(tree) { - return tree && tree.map(function(node, i) { - return import_react.createElement(node.tag, __assign({ key: i }, node.attr), Tree2Element(node.child)); - }); -} -function GenIcon(data) { - return function(props) { - return import_react.createElement(IconBase, __assign({ attr: __assign({}, data.attr) }, props), Tree2Element(data.child)); - }; -} -function IconBase(props) { - var elem = function(conf) { - var attr = props.attr, size = props.size, title = props.title, svgProps = __rest(props, [ - "attr", - "size", - "title" - ]); - var computedSize = size || conf.size || "1em"; - var className; - if (conf.className) className = conf.className; - if (props.className) className = (className ? className + " " : "") + props.className; - return import_react.createElement("svg", __assign({ - stroke: "currentColor", - fill: "currentColor", - strokeWidth: "0" - }, conf.attr, attr, svgProps, { - className, - style: __assign(__assign({ color: props.color || conf.color }, conf.style), props.style), - height: computedSize, - width: computedSize, - xmlns: "http://www.w3.org/2000/svg" - }), title && import_react.createElement("title", null, title), props.children); - }; - return IconContext !== void 0 ? import_react.createElement(IconContext.Consumer, null, function(conf) { - return elem(conf); - }) : elem(DefaultContext); -} -//#endregion -export { GenIcon as t }; - -//# sourceMappingURL=iconBase-BCeeRc1F.js.map \ No newline at end of file diff --git a/Frontend/node_modules/.vite/deps/iconBase-BCeeRc1F.js.map b/Frontend/node_modules/.vite/deps/iconBase-BCeeRc1F.js.map deleted file mode 100644 index 56ee38a1..00000000 --- a/Frontend/node_modules/.vite/deps/iconBase-BCeeRc1F.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iconBase-BCeeRc1F.js","names":[],"sources":["../../react-icons/lib/esm/iconContext.js","../../react-icons/lib/esm/iconBase.js"],"sourcesContent":["import React from \"react\";\r\nexport var DefaultContext = {\r\n color: undefined,\r\n size: undefined,\r\n className: undefined,\r\n style: undefined,\r\n attr: undefined\r\n};\r\nexport var IconContext = React.createContext && React.createContext(DefaultContext);","var __assign = this && this.__assign || function () {\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nvar __rest = this && this.__rest || function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n};\r\nimport React from \"react\";\r\nimport { IconContext, DefaultContext } from \"./iconContext\";\r\nfunction Tree2Element(tree) {\r\n return tree && tree.map(function (node, i) {\r\n return React.createElement(node.tag, __assign({\r\n key: i\r\n }, node.attr), Tree2Element(node.child));\r\n });\r\n}\r\nexport function GenIcon(data) {\r\n // eslint-disable-next-line react/display-name\r\n return function (props) {\r\n return React.createElement(IconBase, __assign({\r\n attr: __assign({}, data.attr)\r\n }, props), Tree2Element(data.child));\r\n };\r\n}\r\nexport function IconBase(props) {\r\n var elem = function (conf) {\r\n var attr = props.attr,\r\n size = props.size,\r\n title = props.title,\r\n svgProps = __rest(props, [\"attr\", \"size\", \"title\"]);\r\n var computedSize = size || conf.size || \"1em\";\r\n var className;\r\n if (conf.className) className = conf.className;\r\n if (props.className) className = (className ? className + \" \" : \"\") + props.className;\r\n return React.createElement(\"svg\", __assign({\r\n stroke: \"currentColor\",\r\n fill: \"currentColor\",\r\n strokeWidth: \"0\"\r\n }, conf.attr, attr, svgProps, {\r\n className: className,\r\n style: __assign(__assign({\r\n color: props.color || conf.color\r\n }, conf.style), props.style),\r\n height: computedSize,\r\n width: computedSize,\r\n xmlns: \"http://www.w3.org/2000/svg\"\r\n }), title && React.createElement(\"title\", null, title), props.children);\r\n };\r\n return IconContext !== undefined ? React.createElement(IconContext.Consumer, null, function (conf) {\r\n return elem(conf);\r\n }) : elem(DefaultContext);\r\n}"],"mappings":";;;AACA,IAAW,iBAAiB;CAC1B,OAAO,KAAA;CACP,MAAM,KAAA;CACN,WAAW,KAAA;CACX,OAAO,KAAA;CACP,MAAM,KAAA;CACP;AACD,IAAW,cAAA,aAAoB,iBAAA,aAAuB,cAAc,eAAe;;;ACRnF,IAAI,WAAoC,WAAY;AAClD,YAAW,OAAO,UAAU,SAAU,GAAG;AACvC,OAAK,IAAI,GAAG,IAAI,GAAG,IAAI,UAAU,QAAQ,IAAI,GAAG,KAAK;AACnD,OAAI,UAAU;AACd,QAAK,IAAI,KAAK,EAAG,KAAI,OAAO,UAAU,eAAe,KAAK,GAAG,EAAE,CAAE,GAAE,KAAK,EAAE;;AAE5E,SAAO;;AAET,QAAO,SAAS,MAAM,MAAM,UAAU;;AAExC,IAAI,SAAgC,SAAU,GAAG,GAAG;CAClD,IAAI,IAAI,EAAE;AACV,MAAK,IAAI,KAAK,EAAG,KAAI,OAAO,UAAU,eAAe,KAAK,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAG,GAAE,KAAK,EAAE;AAC9F,KAAI,KAAK,QAAQ,OAAO,OAAO,0BAA0B;OAAiB,IAAI,IAAI,GAAG,IAAI,OAAO,sBAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,IACtI,KAAI,EAAE,QAAQ,EAAE,GAAG,GAAG,KAAK,OAAO,UAAU,qBAAqB,KAAK,GAAG,EAAE,GAAG,CAAE,GAAE,EAAE,MAAM,EAAE,EAAE;;AAEhG,QAAO;;AAIT,SAAS,aAAa,MAAM;AAC1B,QAAO,QAAQ,KAAK,IAAI,SAAU,MAAM,GAAG;AACzC,SAAA,aAAa,cAAc,KAAK,KAAK,SAAS,EAC5C,KAAK,GACN,EAAE,KAAK,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC;GACxC;;AAEJ,SAAgB,QAAQ,MAAM;AAE5B,QAAO,SAAU,OAAO;AACtB,SAAA,aAAa,cAAc,UAAU,SAAS,EAC5C,MAAM,SAAS,EAAE,EAAE,KAAK,KAAK,EAC9B,EAAE,MAAM,EAAE,aAAa,KAAK,MAAM,CAAC;;;AAGxC,SAAgB,SAAS,OAAO;CAC9B,IAAI,OAAO,SAAU,MAAM;EACzB,IAAI,OAAO,MAAM,MACf,OAAO,MAAM,MACb,QAAQ,MAAM,OACd,WAAW,OAAO,OAAO;GAAC;GAAQ;GAAQ;GAAQ,CAAC;EACrD,IAAI,eAAe,QAAQ,KAAK,QAAQ;EACxC,IAAI;AACJ,MAAI,KAAK,UAAW,aAAY,KAAK;AACrC,MAAI,MAAM,UAAW,cAAa,YAAY,YAAY,MAAM,MAAM,MAAM;AAC5E,SAAA,aAAa,cAAc,OAAO,SAAS;GACzC,QAAQ;GACR,MAAM;GACN,aAAa;GACd,EAAE,KAAK,MAAM,MAAM,UAAU;GACjB;GACX,OAAO,SAAS,SAAS,EACvB,OAAO,MAAM,SAAS,KAAK,OAC5B,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM;GAC5B,QAAQ;GACR,OAAO;GACP,OAAO;GACR,CAAC,EAAE,SAAA,aAAe,cAAc,SAAS,MAAM,MAAM,EAAE,MAAM,SAAS;;AAEzE,QAAO,gBAAgB,KAAA,IAAA,aAAkB,cAAc,YAAY,UAAU,MAAM,SAAU,MAAM;AACjG,SAAO,KAAK,KAAK;GACjB,GAAG,KAAK,eAAe"} \ No newline at end of file diff --git a/Frontend/node_modules/.vite/deps/react-Dayigfg7.js b/Frontend/node_modules/.vite/deps/react-Dayigfg7.js deleted file mode 100644 index 36472881..00000000 --- a/Frontend/node_modules/.vite/deps/react-Dayigfg7.js +++ /dev/null @@ -1,1565 +0,0 @@ -//#region \0rolldown/runtime.js -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); -var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); -var __exportAll = (all, no_symbols) => { - let target = {}; - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); - return target; -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { - key = keys[i]; - if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: ((k) => from[k]).bind(null, key), - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { - value: mod, - enumerable: true -}) : target, mod)); -var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod); -//#endregion -//#region node_modules/react/cjs/react.development.js -/** -* @license React -* react.development.js -* -* Copyright (c) Facebook, Inc. and its affiliates. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ -var require_react_development = /* @__PURE__ */ __commonJSMin(((exports, module) => { - (function() { - "use strict"; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(/* @__PURE__ */ new Error()); - var ReactVersion = "18.3.1"; - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") return null; - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof maybeIterator === "function") return maybeIterator; - return null; - } - /** - * Keeps track of the current dispatcher. - */ - var ReactCurrentDispatcher = { current: null }; - /** - * Keeps track of the current batch's configuration such as how long an update - * should suspend for if it needs to. - */ - var ReactCurrentBatchConfig = { transition: null }; - var ReactCurrentActQueue = { - current: null, - isBatchingLegacy: false, - didScheduleLegacyUpdate: false - }; - /** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - */ - var ReactCurrentOwner = { current: null }; - var ReactDebugCurrentFrame = {}; - var currentExtraStackFrame = null; - function setExtraStackFrame(stack) { - currentExtraStackFrame = stack; - } - ReactDebugCurrentFrame.setExtraStackFrame = function(stack) { - currentExtraStackFrame = stack; - }; - ReactDebugCurrentFrame.getCurrentStack = null; - ReactDebugCurrentFrame.getStackAddendum = function() { - var stack = ""; - if (currentExtraStackFrame) stack += currentExtraStackFrame; - var impl = ReactDebugCurrentFrame.getCurrentStack; - if (impl) stack += impl() || ""; - return stack; - }; - var enableScopeAPI = false; - var enableCacheElement = false; - var enableTransitionTracing = false; - var enableLegacyHidden = false; - var enableDebugTracing = false; - var ReactSharedInternals = { - ReactCurrentDispatcher, - ReactCurrentBatchConfig, - ReactCurrentOwner - }; - ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; - ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; - function warn(format) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; - printWarning("warn", format, args); - } - function error(format) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2]; - printWarning("error", format, args); - } - function printWarning(level, format, args) { - var stack = ReactSharedInternals.ReactDebugCurrentFrame.getStackAddendum(); - if (stack !== "") { - format += "%s"; - args = args.concat([stack]); - } - var argsWithFormat = args.map(function(item) { - return String(item); - }); - argsWithFormat.unshift("Warning: " + format); - Function.prototype.apply.call(console[level], console, argsWithFormat); - } - var didWarnStateUpdateForUnmountedComponent = {}; - function warnNoop(publicInstance, callerName) { - var _constructor = publicInstance.constructor; - var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass"; - var warningKey = componentName + "." + callerName; - if (didWarnStateUpdateForUnmountedComponent[warningKey]) return; - error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName); - didWarnStateUpdateForUnmountedComponent[warningKey] = true; - } - /** - * This is the abstract API for an update queue. - */ - var ReactNoopUpdateQueue = { - isMounted: function(publicInstance) { - return false; - }, - enqueueForceUpdate: function(publicInstance, callback, callerName) { - warnNoop(publicInstance, "forceUpdate"); - }, - enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { - warnNoop(publicInstance, "replaceState"); - }, - enqueueSetState: function(publicInstance, partialState, callback, callerName) { - warnNoop(publicInstance, "setState"); - } - }; - var assign = Object.assign; - var emptyObject = {}; - Object.freeze(emptyObject); - /** - * Base class helpers for the updating state of a component. - */ - function Component(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - } - Component.prototype.isReactComponent = {}; - /** - * Sets a subset of the state. Always use this to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * When a function is provided to setState, it will be called at some point in - * the future (not synchronously). It will be called with the up to date - * component arguments (state, props, context). These values can be different - * from this.* because your function may be called after receiveProps but before - * shouldComponentUpdate, and this new state, props, and context will not yet be - * assigned to this. - * - * @param {object|function} partialState Next partial state or function to - * produce next partial state to be merged with current state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ - Component.prototype.setState = function(partialState, callback) { - if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); - this.updater.enqueueSetState(this, partialState, callback, "setState"); - }; - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ - Component.prototype.forceUpdate = function(callback) { - this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); - }; - var deprecatedAPIs = { - isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."], - replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."] - }; - var defineDeprecationWarning = function(methodName, info) { - Object.defineProperty(Component.prototype, methodName, { get: function() { - warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]); - } }); - }; - for (var fnName in deprecatedAPIs) if (deprecatedAPIs.hasOwnProperty(fnName)) defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - function ComponentDummy() {} - ComponentDummy.prototype = Component.prototype; - /** - * Convenience component with default shallow equality check for sCU. - */ - function PureComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - } - var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); - pureComponentPrototype.constructor = PureComponent; - assign(pureComponentPrototype, Component.prototype); - pureComponentPrototype.isPureReactComponent = true; - function createRef() { - var refObject = { current: null }; - Object.seal(refObject); - return refObject; - } - var isArrayImpl = Array.isArray; - function isArray(a) { - return isArrayImpl(a); - } - function typeName(value) { - return typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; - } - function willCoercionThrow(value) { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - if (willCoercionThrow(value)) { - error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - function getWrappedName(outerType, innerType, wrapperName) { - var displayName = outerType.displayName; - if (displayName) return displayName; - var functionName = innerType.displayName || innerType.name || ""; - return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; - } - function getContextName(type) { - return type.displayName || "Context"; - } - function getComponentNameFromType(type) { - if (type == null) return null; - if (typeof type.tag === "number") error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); - if (typeof type === "function") return type.displayName || type.name || null; - if (typeof type === "string") return type; - switch (type) { - case REACT_FRAGMENT_TYPE: return "Fragment"; - case REACT_PORTAL_TYPE: return "Portal"; - case REACT_PROFILER_TYPE: return "Profiler"; - case REACT_STRICT_MODE_TYPE: return "StrictMode"; - case REACT_SUSPENSE_TYPE: return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; - } - if (typeof type === "object") switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: return getContextName(type) + ".Consumer"; - case REACT_PROVIDER_TYPE: return getContextName(type._context) + ".Provider"; - case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); - case REACT_MEMO_TYPE: - var outerName = type.displayName || null; - if (outerName !== null) return outerName; - return getComponentNameFromType(type.type) || "Memo"; - case REACT_LAZY_TYPE: - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return getComponentNameFromType(init(payload)); - } catch (x) { - return null; - } - } - return null; - } - var hasOwnProperty = Object.prototype.hasOwnProperty; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; - var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs = {}; - function hasValidRef(config) { - if (hasOwnProperty.call(config, "ref")) { - var getter = Object.getOwnPropertyDescriptor(config, "ref").get; - if (getter && getter.isReactWarning) return false; - } - return config.ref !== void 0; - } - function hasValidKey(config) { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) return false; - } - return config.key !== void 0; - } - function defineKeyPropWarningGetter(props, displayName) { - var warnAboutAccessingKey = function() { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); - } - }; - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: true - }); - } - function defineRefPropWarningGetter(props, displayName) { - var warnAboutAccessingRef = function() { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); - } - }; - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, "ref", { - get: warnAboutAccessingRef, - configurable: true - }); - } - function warnIfStringRefCannotBeAutoConverted(config) { - if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { - var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); - if (!didWarnAboutStringRefs[componentName]) { - error("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", componentName, config.ref); - didWarnAboutStringRefs[componentName] = true; - } - } - } - /** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, instanceof check - * will not work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} props - * @param {*} key - * @param {string|object} ref - * @param {*} owner - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @internal - */ - var ReactElement = function(type, key, ref, self, source, owner, props) { - var element = { - $$typeof: REACT_ELEMENT_TYPE, - type, - key, - ref, - props, - _owner: owner - }; - element._store = {}; - Object.defineProperty(element._store, "validated", { - configurable: false, - enumerable: false, - writable: true, - value: false - }); - Object.defineProperty(element, "_self", { - configurable: false, - enumerable: false, - writable: false, - value: self - }); - Object.defineProperty(element, "_source", { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - return element; - }; - /** - * Create and return a new ReactElement of the given type. - * See https://reactjs.org/docs/react-api.html#createelement - */ - function createElement(type, config, children) { - var propName; - var props = {}; - var key = null; - var ref = null; - var self = null; - var source = null; - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - warnIfStringRefCannotBeAutoConverted(config); - } - if (hasValidKey(config)) { - checkKeyStringCoercion(config.key); - key = "" + config.key; - } - self = config.__self === void 0 ? null : config.__self; - source = config.__source === void 0 ? null : config.__source; - for (propName in config) if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) props[propName] = config[propName]; - } - var childrenLength = arguments.length - 2; - if (childrenLength === 1) props.children = children; - else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2]; - if (Object.freeze) Object.freeze(childArray); - props.children = childArray; - } - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - for (propName in defaultProps) if (props[propName] === void 0) props[propName] = defaultProps[propName]; - } - if (key || ref) { - var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; - if (key) defineKeyPropWarningGetter(props, displayName); - if (ref) defineRefPropWarningGetter(props, displayName); - } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); - } - function cloneAndReplaceKey(oldElement, newKey) { - return ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - } - /** - * Clone and return a new ReactElement using element as the starting point. - * See https://reactjs.org/docs/react-api.html#cloneelement - */ - function cloneElement(element, config, children) { - if (element === null || element === void 0) throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); - var propName; - var props = assign({}, element.props); - var key = element.key; - var ref = element.ref; - var self = element._self; - var source = element._source; - var owner = element._owner; - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - owner = ReactCurrentOwner.current; - } - if (hasValidKey(config)) { - checkKeyStringCoercion(config.key); - key = "" + config.key; - } - var defaultProps; - if (element.type && element.type.defaultProps) defaultProps = element.type.defaultProps; - for (propName in config) if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) if (config[propName] === void 0 && defaultProps !== void 0) props[propName] = defaultProps[propName]; - else props[propName] = config[propName]; - } - var childrenLength = arguments.length - 2; - if (childrenLength === 1) props.children = children; - else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2]; - props.children = childArray; - } - return ReactElement(element.type, key, ref, self, source, owner, props); - } - /** - * Verifies the object is a ReactElement. - * See https://reactjs.org/docs/react-api.html#isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a ReactElement. - * @final - */ - function isValidElement(object) { - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } - var SEPARATOR = "."; - var SUBSEPARATOR = ":"; - /** - * Escape and wrap key so it is safe to use as a reactid - * - * @param {string} key to be escaped. - * @return {string} the escaped key. - */ - function escape(key) { - var escapeRegex = /[=:]/g; - var escaperLookup = { - "=": "=0", - ":": "=2" - }; - return "$" + key.replace(escapeRegex, function(match) { - return escaperLookup[match]; - }); - } - /** - * TODO: Test that a single child and an array with one item have the same key - * pattern. - */ - var didWarnAboutMaps = false; - var userProvidedKeyEscapeRegex = /\/+/g; - function escapeUserProvidedKey(text) { - return text.replace(userProvidedKeyEscapeRegex, "$&/"); - } - /** - * Generate a key string that identifies a element within a set. - * - * @param {*} element A element that could contain a manual key. - * @param {number} index Index that is used if a manual key is not provided. - * @return {string} - */ - function getElementKey(element, index) { - if (typeof element === "object" && element !== null && element.key != null) { - checkKeyStringCoercion(element.key); - return escape("" + element.key); - } - return index.toString(36); - } - function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - if (type === "undefined" || type === "boolean") children = null; - var invokeCallback = false; - if (children === null) invokeCallback = true; - else switch (type) { - case "string": - case "number": - invokeCallback = true; - break; - case "object": switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: invokeCallback = true; - } - } - if (invokeCallback) { - var _child = children; - var mappedChild = callback(_child); - var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; - if (isArray(mappedChild)) { - var escapedChildKey = ""; - if (childKey != null) escapedChildKey = escapeUserProvidedKey(childKey) + "/"; - mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) { - return c; - }); - } else if (mappedChild != null) { - if (isValidElement(mappedChild)) { - if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) checkKeyStringCoercion(mappedChild.key); - mappedChild = cloneAndReplaceKey(mappedChild, escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey("" + mappedChild.key) + "/" : "") + childKey); - } - array.push(mappedChild); - } - return 1; - } - var child; - var nextName; - var subtreeCount = 0; - var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR; - if (isArray(children)) for (var i = 0; i < children.length; i++) { - child = children[i]; - nextName = nextNamePrefix + getElementKey(child, i); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - else { - var iteratorFn = getIteratorFn(children); - if (typeof iteratorFn === "function") { - var iterableChildren = children; - if (iteratorFn === iterableChildren.entries) { - if (!didWarnAboutMaps) warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."); - didWarnAboutMaps = true; - } - var iterator = iteratorFn.call(iterableChildren); - var step; - var ii = 0; - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getElementKey(child, ii++); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - } else if (type === "object") { - var childrenString = String(children); - throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead."); - } - } - return subtreeCount; - } - /** - * Maps children that are typically specified as `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenmap - * - * The provided mapFunction(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} func The map function. - * @param {*} context Context for mapFunction. - * @return {object} Object containing the ordered map of results. - */ - function mapChildren(children, func, context) { - if (children == null) return children; - var result = []; - var count = 0; - mapIntoArray(children, result, "", "", function(child) { - return func.call(context, child, count++); - }); - return result; - } - /** - * Count the number of children that are typically specified as - * `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrencount - * - * @param {?*} children Children tree container. - * @return {number} The number of children. - */ - function countChildren(children) { - var n = 0; - mapChildren(children, function() { - n++; - }); - return n; - } - /** - * Iterates through children that are typically specified as `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenforeach - * - * The provided forEachFunc(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} forEachFunc - * @param {*} forEachContext Context for forEachContext. - */ - function forEachChildren(children, forEachFunc, forEachContext) { - mapChildren(children, function() { - forEachFunc.apply(this, arguments); - }, forEachContext); - } - /** - * Flatten a children object (typically specified as `props.children`) and - * return an array with appropriately re-keyed children. - * - * See https://reactjs.org/docs/react-api.html#reactchildrentoarray - */ - function toArray(children) { - return mapChildren(children, function(child) { - return child; - }) || []; - } - /** - * Returns the first child in a collection of children and verifies that there - * is only one child in the collection. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenonly - * - * The current implementation of this function assumes that a single child gets - * passed without a wrapper, but the purpose of this helper function is to - * abstract away the particular structure of children. - * - * @param {?object} children Child collection structure. - * @return {ReactElement} The first and only `ReactElement` contained in the - * structure. - */ - function onlyChild(children) { - if (!isValidElement(children)) throw new Error("React.Children.only expected to receive a single React element child."); - return children; - } - function createContext(defaultValue) { - var context = { - $$typeof: REACT_CONTEXT_TYPE, - _currentValue: defaultValue, - _currentValue2: defaultValue, - _threadCount: 0, - Provider: null, - Consumer: null, - _defaultValue: null, - _globalName: null - }; - context.Provider = { - $$typeof: REACT_PROVIDER_TYPE, - _context: context - }; - var hasWarnedAboutUsingNestedContextConsumers = false; - var hasWarnedAboutUsingConsumerProvider = false; - var hasWarnedAboutDisplayNameOnConsumer = false; - var Consumer = { - $$typeof: REACT_CONTEXT_TYPE, - _context: context - }; - Object.defineProperties(Consumer, { - Provider: { - get: function() { - if (!hasWarnedAboutUsingConsumerProvider) { - hasWarnedAboutUsingConsumerProvider = true; - error("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"); - } - return context.Provider; - }, - set: function(_Provider) { - context.Provider = _Provider; - } - }, - _currentValue: { - get: function() { - return context._currentValue; - }, - set: function(_currentValue) { - context._currentValue = _currentValue; - } - }, - _currentValue2: { - get: function() { - return context._currentValue2; - }, - set: function(_currentValue2) { - context._currentValue2 = _currentValue2; - } - }, - _threadCount: { - get: function() { - return context._threadCount; - }, - set: function(_threadCount) { - context._threadCount = _threadCount; - } - }, - Consumer: { get: function() { - if (!hasWarnedAboutUsingNestedContextConsumers) { - hasWarnedAboutUsingNestedContextConsumers = true; - error("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"); - } - return context.Consumer; - } }, - displayName: { - get: function() { - return context.displayName; - }, - set: function(displayName) { - if (!hasWarnedAboutDisplayNameOnConsumer) { - warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName); - hasWarnedAboutDisplayNameOnConsumer = true; - } - } - } - }); - context.Consumer = Consumer; - context._currentRenderer = null; - context._currentRenderer2 = null; - return context; - } - var Uninitialized = -1; - var Pending = 0; - var Resolved = 1; - var Rejected = 2; - function lazyInitializer(payload) { - if (payload._status === Uninitialized) { - var ctor = payload._result; - var thenable = ctor(); - thenable.then(function(moduleObject) { - if (payload._status === Pending || payload._status === Uninitialized) { - var resolved = payload; - resolved._status = Resolved; - resolved._result = moduleObject; - } - }, function(error) { - if (payload._status === Pending || payload._status === Uninitialized) { - var rejected = payload; - rejected._status = Rejected; - rejected._result = error; - } - }); - if (payload._status === Uninitialized) { - var pending = payload; - pending._status = Pending; - pending._result = thenable; - } - } - if (payload._status === Resolved) { - var moduleObject = payload._result; - if (moduleObject === void 0) error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject); - if (!("default" in moduleObject)) error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); - return moduleObject.default; - } else throw payload._result; - } - function lazy(ctor) { - var lazyType = { - $$typeof: REACT_LAZY_TYPE, - _payload: { - _status: Uninitialized, - _result: ctor - }, - _init: lazyInitializer - }; - var defaultProps; - var propTypes; - Object.defineProperties(lazyType, { - defaultProps: { - configurable: true, - get: function() { - return defaultProps; - }, - set: function(newDefaultProps) { - error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); - defaultProps = newDefaultProps; - Object.defineProperty(lazyType, "defaultProps", { enumerable: true }); - } - }, - propTypes: { - configurable: true, - get: function() { - return propTypes; - }, - set: function(newPropTypes) { - error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); - propTypes = newPropTypes; - Object.defineProperty(lazyType, "propTypes", { enumerable: true }); - } - } - }); - return lazyType; - } - function forwardRef(render) { - if (render != null && render.$$typeof === REACT_MEMO_TYPE) error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."); - else if (typeof render !== "function") error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render); - else if (render.length !== 0 && render.length !== 2) error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."); - if (render != null) { - if (render.defaultProps != null || render.propTypes != null) error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"); - } - var elementType = { - $$typeof: REACT_FORWARD_REF_TYPE, - render - }; - var ownName; - Object.defineProperty(elementType, "displayName", { - enumerable: false, - configurable: true, - get: function() { - return ownName; - }, - set: function(name) { - ownName = name; - if (!render.name && !render.displayName) render.displayName = name; - } - }); - return elementType; - } - var REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); - function isValidElementType(type) { - if (typeof type === "string" || typeof type === "function") return true; - if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) return true; - if (typeof type === "object" && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) return true; - } - return false; - } - function memo(type, compare) { - if (!isValidElementType(type)) error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type); - var elementType = { - $$typeof: REACT_MEMO_TYPE, - type, - compare: compare === void 0 ? null : compare - }; - var ownName; - Object.defineProperty(elementType, "displayName", { - enumerable: false, - configurable: true, - get: function() { - return ownName; - }, - set: function(name) { - ownName = name; - if (!type.name && !type.displayName) type.displayName = name; - } - }); - return elementType; - } - function resolveDispatcher() { - var dispatcher = ReactCurrentDispatcher.current; - if (dispatcher === null) error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); - return dispatcher; - } - function useContext(Context) { - var dispatcher = resolveDispatcher(); - if (Context._context !== void 0) { - var realContext = Context._context; - if (realContext.Consumer === Context) error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"); - else if (realContext.Provider === Context) error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?"); - } - return dispatcher.useContext(Context); - } - function useState(initialState) { - return resolveDispatcher().useState(initialState); - } - function useReducer(reducer, initialArg, init) { - return resolveDispatcher().useReducer(reducer, initialArg, init); - } - function useRef(initialValue) { - return resolveDispatcher().useRef(initialValue); - } - function useEffect(create, deps) { - return resolveDispatcher().useEffect(create, deps); - } - function useInsertionEffect(create, deps) { - return resolveDispatcher().useInsertionEffect(create, deps); - } - function useLayoutEffect(create, deps) { - return resolveDispatcher().useLayoutEffect(create, deps); - } - function useCallback(callback, deps) { - return resolveDispatcher().useCallback(callback, deps); - } - function useMemo(create, deps) { - return resolveDispatcher().useMemo(create, deps); - } - function useImperativeHandle(ref, create, deps) { - return resolveDispatcher().useImperativeHandle(ref, create, deps); - } - function useDebugValue(value, formatterFn) { - return resolveDispatcher().useDebugValue(value, formatterFn); - } - function useTransition() { - return resolveDispatcher().useTransition(); - } - function useDeferredValue(value) { - return resolveDispatcher().useDeferredValue(value); - } - function useId() { - return resolveDispatcher().useId(); - } - function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - return resolveDispatcher().useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); - } - var disabledDepth = 0; - var prevLog; - var prevInfo; - var prevWarn; - var prevError; - var prevGroup; - var prevGroupCollapsed; - var prevGroupEnd; - function disabledLog() {} - disabledLog.__reactDisabledLog = true; - function disableLogs() { - if (disabledDepth === 0) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (disabledDepth === 0) { - var props = { - configurable: true, - enumerable: true, - writable: true - }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - if (disabledDepth < 0) error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); - } - var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, source, ownerFn) { - if (prefix === void 0) try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ""; - } - return "\n" + prefix + name; - } - var reentry = false; - var componentFrameCache = new (typeof WeakMap === "function" ? WeakMap : Map)(); - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (frame !== void 0) return frame; - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = ReactCurrentDispatcher$1.current; - ReactCurrentDispatcher$1.current = null; - disableLogs(); - try { - if (construct) { - var Fake = function() { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { set: function() { - throw Error(); - } }); - if (typeof Reflect === "object" && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - fn(); - } - } catch (sample) { - if (sample && control && typeof sample.stack === "string") { - var sampleLines = sample.stack.split("\n"); - var controlLines = control.stack.split("\n"); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) c--; - for (; s >= 1 && c >= 0; s--, c--) if (sampleLines[s] !== controlLines[c]) { - if (s !== 1 || c !== 1) do { - s--; - c--; - if (c < 0 || sampleLines[s] !== controlLines[c]) { - var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); - if (fn.displayName && _frame.includes("")) _frame = _frame.replace("", fn.displayName); - if (typeof fn === "function") componentFrameCache.set(fn, _frame); - return _frame; - } - } while (s >= 1 && c >= 0); - break; - } - } - } finally { - reentry = false; - ReactCurrentDispatcher$1.current = previousDispatcher; - reenableLogs(); - Error.prepareStackTrace = previousPrepareStackTrace; - } - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - if (typeof fn === "function") componentFrameCache.set(fn, syntheticFrame); - return syntheticFrame; - } - function describeFunctionComponentFrame(fn, source, ownerFn) { - return describeNativeComponentFrame(fn, false); - } - function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); - } - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - if (type == null) return ""; - if (typeof type === "function") return describeNativeComponentFrame(type, shouldConstruct(type)); - if (typeof type === "string") return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); - } - if (typeof type === "object") switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); - case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_LAZY_TYPE: - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) {} - } - return ""; - } - var loggedTypeFailures = {}; - var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; - function setCurrentlyValidatingElement(element) { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); - } else ReactDebugCurrentFrame$1.setExtraStackFrame(null); - } - function checkPropTypes(typeSpecs, values, location, componentName, element) { - var has = Function.call.bind(hasOwnProperty); - for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) { - var error$1 = void 0; - try { - if (typeof typeSpecs[typeSpecName] !== "function") { - var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); - err.name = "Invariant Violation"; - throw err; - } - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); - } catch (ex) { - error$1 = ex; - } - if (error$1 && !(error$1 instanceof Error)) { - setCurrentlyValidatingElement(element); - error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); - setCurrentlyValidatingElement(null); - } - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { - loggedTypeFailures[error$1.message] = true; - setCurrentlyValidatingElement(element); - error("Failed %s type: %s", location, error$1.message); - setCurrentlyValidatingElement(null); - } - } - } - function setCurrentlyValidatingElement$1(element) { - if (element) { - var owner = element._owner; - setExtraStackFrame(describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null)); - } else setExtraStackFrame(null); - } - var propTypesMisspellWarningShown = false; - function getDeclarationErrorAddendum() { - if (ReactCurrentOwner.current) { - var name = getComponentNameFromType(ReactCurrentOwner.current.type); - if (name) return "\n\nCheck the render method of `" + name + "`."; - } - return ""; - } - function getSourceInfoErrorAddendum(source) { - if (source !== void 0) { - var fileName = source.fileName.replace(/^.*[\\\/]/, ""); - var lineNumber = source.lineNumber; - return "\n\nCheck your code at " + fileName + ":" + lineNumber + "."; - } - return ""; - } - function getSourceInfoErrorAddendumForProps(elementProps) { - if (elementProps !== null && elementProps !== void 0) return getSourceInfoErrorAddendum(elementProps.__source); - return ""; - } - /** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - var ownerHasKeyUseWarning = {}; - function getCurrentComponentErrorInfo(parentType) { - var info = getDeclarationErrorAddendum(); - if (!info) { - var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name; - if (parentName) info = "\n\nCheck the top-level render call using <" + parentName + ">."; - } - return info; - } - /** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ - function validateExplicitKey(element, parentType) { - if (!element._store || element._store.validated || element.key != null) return; - element._store.validated = true; - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) return; - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; - var childOwner = ""; - if (element && element._owner && element._owner !== ReactCurrentOwner.current) childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; - setCurrentlyValidatingElement$1(element); - error("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", currentComponentErrorInfo, childOwner); - setCurrentlyValidatingElement$1(null); - } - /** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ - function validateChildKeys(node, parentType) { - if (typeof node !== "object") return; - if (isArray(node)) for (var i = 0; i < node.length; i++) { - var child = node[i]; - if (isValidElement(child)) validateExplicitKey(child, parentType); - } - else if (isValidElement(node)) { - if (node._store) node._store.validated = true; - } else if (node) { - var iteratorFn = getIteratorFn(node); - if (typeof iteratorFn === "function") { - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - while (!(step = iterator.next()).done) if (isValidElement(step.value)) validateExplicitKey(step.value, parentType); - } - } - } - } - /** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ - function validatePropTypes(element) { - var type = element.type; - if (type === null || type === void 0 || typeof type === "string") return; - var propTypes; - if (typeof type === "function") propTypes = type.propTypes; - else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) propTypes = type.propTypes; - else return; - if (propTypes) { - var name = getComponentNameFromType(type); - checkPropTypes(propTypes, element.props, "prop", name, element); - } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; - error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", getComponentNameFromType(type) || "Unknown"); - } - if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); - } - /** - * Given a fragment, validate that it can only be provided with fragment props - * @param {ReactElement} fragment - */ - function validateFragmentProps(fragment) { - var keys = Object.keys(fragment.props); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key !== "children" && key !== "key") { - setCurrentlyValidatingElement$1(fragment); - error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); - setCurrentlyValidatingElement$1(null); - break; - } - } - if (fragment.ref !== null) { - setCurrentlyValidatingElement$1(fragment); - error("Invalid attribute `ref` supplied to `React.Fragment`."); - setCurrentlyValidatingElement$1(null); - } - } - function createElementWithValidation(type, props, children) { - var validType = isValidElementType(type); - if (!validType) { - var info = ""; - if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - var sourceInfo = getSourceInfoErrorAddendumForProps(props); - if (sourceInfo) info += sourceInfo; - else info += getDeclarationErrorAddendum(); - var typeString; - if (type === null) typeString = "null"; - else if (isArray(type)) typeString = "array"; - else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; - info = " Did you accidentally export a JSX literal instead of a component?"; - } else typeString = typeof type; - error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); - } - var element = createElement.apply(this, arguments); - if (element == null) return element; - if (validType) for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i], type); - if (type === REACT_FRAGMENT_TYPE) validateFragmentProps(element); - else validatePropTypes(element); - return element; - } - var didWarnAboutDeprecatedCreateFactory = false; - function createFactoryWithValidation(type) { - var validatedFactory = createElementWithValidation.bind(null, type); - validatedFactory.type = type; - if (!didWarnAboutDeprecatedCreateFactory) { - didWarnAboutDeprecatedCreateFactory = true; - warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead."); - } - Object.defineProperty(validatedFactory, "type", { - enumerable: false, - get: function() { - warn("Factory.type is deprecated. Access the class directly before passing it to createFactory."); - Object.defineProperty(this, "type", { value: type }); - return type; - } - }); - return validatedFactory; - } - function cloneElementWithValidation(element, props, children) { - var newElement = cloneElement.apply(this, arguments); - for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i], newElement.type); - validatePropTypes(newElement); - return newElement; - } - function startTransition(scope, options) { - var prevTransition = ReactCurrentBatchConfig.transition; - ReactCurrentBatchConfig.transition = {}; - var currentTransition = ReactCurrentBatchConfig.transition; - ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set(); - try { - scope(); - } finally { - ReactCurrentBatchConfig.transition = prevTransition; - if (prevTransition === null && currentTransition._updatedFibers) { - if (currentTransition._updatedFibers.size > 10) warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."); - currentTransition._updatedFibers.clear(); - } - } - } - var didWarnAboutMessageChannel = false; - var enqueueTaskImpl = null; - function enqueueTask(task) { - if (enqueueTaskImpl === null) try { - var requireString = ("require" + Math.random()).slice(0, 7); - enqueueTaskImpl = (module && module[requireString]).call(module, "timers").setImmediate; - } catch (_err) { - enqueueTaskImpl = function(callback) { - if (didWarnAboutMessageChannel === false) { - didWarnAboutMessageChannel = true; - if (typeof MessageChannel === "undefined") error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."); - } - var channel = new MessageChannel(); - channel.port1.onmessage = callback; - channel.port2.postMessage(void 0); - }; - } - return enqueueTaskImpl(task); - } - var actScopeDepth = 0; - var didWarnNoAwaitAct = false; - function act(callback) { - var prevActScopeDepth = actScopeDepth; - actScopeDepth++; - if (ReactCurrentActQueue.current === null) ReactCurrentActQueue.current = []; - var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; - var result; - try { - ReactCurrentActQueue.isBatchingLegacy = true; - result = callback(); - if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { - var queue = ReactCurrentActQueue.current; - if (queue !== null) { - ReactCurrentActQueue.didScheduleLegacyUpdate = false; - flushActQueue(queue); - } - } - } catch (error) { - popActScope(prevActScopeDepth); - throw error; - } finally { - ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; - } - if (result !== null && typeof result === "object" && typeof result.then === "function") { - var thenableResult = result; - var wasAwaited = false; - var thenable = { then: function(resolve, reject) { - wasAwaited = true; - thenableResult.then(function(returnValue) { - popActScope(prevActScopeDepth); - if (actScopeDepth === 0) recursivelyFlushAsyncActWork(returnValue, resolve, reject); - else resolve(returnValue); - }, function(error) { - popActScope(prevActScopeDepth); - reject(error); - }); - } }; - if (!didWarnNoAwaitAct && typeof Promise !== "undefined") Promise.resolve().then(function() {}).then(function() { - if (!wasAwaited) { - didWarnNoAwaitAct = true; - error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"); - } - }); - return thenable; - } else { - var returnValue = result; - popActScope(prevActScopeDepth); - if (actScopeDepth === 0) { - var _queue = ReactCurrentActQueue.current; - if (_queue !== null) { - flushActQueue(_queue); - ReactCurrentActQueue.current = null; - } - return { then: function(resolve, reject) { - if (ReactCurrentActQueue.current === null) { - ReactCurrentActQueue.current = []; - recursivelyFlushAsyncActWork(returnValue, resolve, reject); - } else resolve(returnValue); - } }; - } else return { then: function(resolve, reject) { - resolve(returnValue); - } }; - } - } - function popActScope(prevActScopeDepth) { - if (prevActScopeDepth !== actScopeDepth - 1) error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "); - actScopeDepth = prevActScopeDepth; - } - function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { - var queue = ReactCurrentActQueue.current; - if (queue !== null) try { - flushActQueue(queue); - enqueueTask(function() { - if (queue.length === 0) { - ReactCurrentActQueue.current = null; - resolve(returnValue); - } else recursivelyFlushAsyncActWork(returnValue, resolve, reject); - }); - } catch (error) { - reject(error); - } - else resolve(returnValue); - } - var isFlushing = false; - function flushActQueue(queue) { - if (!isFlushing) { - isFlushing = true; - var i = 0; - try { - for (; i < queue.length; i++) { - var callback = queue[i]; - do - callback = callback(true); - while (callback !== null); - } - queue.length = 0; - } catch (error) { - queue = queue.slice(i + 1); - throw error; - } finally { - isFlushing = false; - } - } - } - var createElement$1 = createElementWithValidation; - var cloneElement$1 = cloneElementWithValidation; - var createFactory = createFactoryWithValidation; - exports.Children = { - map: mapChildren, - forEach: forEachChildren, - count: countChildren, - toArray, - only: onlyChild - }; - exports.Component = Component; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.Profiler = REACT_PROFILER_TYPE; - exports.PureComponent = PureComponent; - exports.StrictMode = REACT_STRICT_MODE_TYPE; - exports.Suspense = REACT_SUSPENSE_TYPE; - exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; - exports.act = act; - exports.cloneElement = cloneElement$1; - exports.createContext = createContext; - exports.createElement = createElement$1; - exports.createFactory = createFactory; - exports.createRef = createRef; - exports.forwardRef = forwardRef; - exports.isValidElement = isValidElement; - exports.lazy = lazy; - exports.memo = memo; - exports.startTransition = startTransition; - exports.unstable_act = act; - exports.useCallback = useCallback; - exports.useContext = useContext; - exports.useDebugValue = useDebugValue; - exports.useDeferredValue = useDeferredValue; - exports.useEffect = useEffect; - exports.useId = useId; - exports.useImperativeHandle = useImperativeHandle; - exports.useInsertionEffect = useInsertionEffect; - exports.useLayoutEffect = useLayoutEffect; - exports.useMemo = useMemo; - exports.useReducer = useReducer; - exports.useRef = useRef; - exports.useState = useState; - exports.useSyncExternalStore = useSyncExternalStore; - exports.useTransition = useTransition; - exports.version = ReactVersion; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(/* @__PURE__ */ new Error()); - })(); -})); -//#endregion -//#region node_modules/react/index.js -var require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = require_react_development(); -})); -//#endregion -export { __toCommonJS as a, __exportAll as i, __commonJSMin as n, __toESM as o, __esmMin as r, require_react as t }; - -//# sourceMappingURL=react-Dayigfg7.js.map \ No newline at end of file diff --git a/Frontend/node_modules/.vite/deps/react-Dayigfg7.js.map b/Frontend/node_modules/.vite/deps/react-Dayigfg7.js.map deleted file mode 100644 index 3c54e0ce..00000000 --- a/Frontend/node_modules/.vite/deps/react-Dayigfg7.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"react-Dayigfg7.js","names":[],"sources":["../../react/cjs/react.development.js","../../react/index.js"],"sourcesContent":["/**\r\n * @license React\r\n * react.development.js\r\n *\r\n * Copyright (c) Facebook, Inc. and its affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n */\r\n\r\n'use strict';\r\n\r\nif (process.env.NODE_ENV !== \"production\") {\r\n (function() {\r\n\r\n 'use strict';\r\n\r\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\r\nif (\r\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\r\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\r\n 'function'\r\n) {\r\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\r\n}\r\n var ReactVersion = '18.3.1';\r\n\r\n// ATTENTION\r\n// When adding new symbols to this file,\r\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\r\n// The Symbol used to tag the ReactElement-like types.\r\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\r\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\r\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\r\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\r\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\r\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\r\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\r\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\r\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\r\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\r\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\r\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\r\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\r\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\r\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\r\nfunction getIteratorFn(maybeIterable) {\r\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\r\n return null;\r\n }\r\n\r\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\r\n\r\n if (typeof maybeIterator === 'function') {\r\n return maybeIterator;\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Keeps track of the current dispatcher.\r\n */\r\nvar ReactCurrentDispatcher = {\r\n /**\r\n * @internal\r\n * @type {ReactComponent}\r\n */\r\n current: null\r\n};\r\n\r\n/**\r\n * Keeps track of the current batch's configuration such as how long an update\r\n * should suspend for if it needs to.\r\n */\r\nvar ReactCurrentBatchConfig = {\r\n transition: null\r\n};\r\n\r\nvar ReactCurrentActQueue = {\r\n current: null,\r\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\r\n isBatchingLegacy: false,\r\n didScheduleLegacyUpdate: false\r\n};\r\n\r\n/**\r\n * Keeps track of the current owner.\r\n *\r\n * The current owner is the component who should own any components that are\r\n * currently being constructed.\r\n */\r\nvar ReactCurrentOwner = {\r\n /**\r\n * @internal\r\n * @type {ReactComponent}\r\n */\r\n current: null\r\n};\r\n\r\nvar ReactDebugCurrentFrame = {};\r\nvar currentExtraStackFrame = null;\r\nfunction setExtraStackFrame(stack) {\r\n {\r\n currentExtraStackFrame = stack;\r\n }\r\n}\r\n\r\n{\r\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\r\n {\r\n currentExtraStackFrame = stack;\r\n }\r\n }; // Stack implementation injected by the current renderer.\r\n\r\n\r\n ReactDebugCurrentFrame.getCurrentStack = null;\r\n\r\n ReactDebugCurrentFrame.getStackAddendum = function () {\r\n var stack = ''; // Add an extra top frame while an element is being validated\r\n\r\n if (currentExtraStackFrame) {\r\n stack += currentExtraStackFrame;\r\n } // Delegate to the injected renderer-specific implementation\r\n\r\n\r\n var impl = ReactDebugCurrentFrame.getCurrentStack;\r\n\r\n if (impl) {\r\n stack += impl() || '';\r\n }\r\n\r\n return stack;\r\n };\r\n}\r\n\r\n// -----------------------------------------------------------------------------\r\n\r\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\r\nvar enableCacheElement = false;\r\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\r\n\r\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\r\n// stuff. Intended to enable React core members to more easily debug scheduling\r\n// issues in DEV builds.\r\n\r\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\r\n\r\nvar ReactSharedInternals = {\r\n ReactCurrentDispatcher: ReactCurrentDispatcher,\r\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\r\n ReactCurrentOwner: ReactCurrentOwner\r\n};\r\n\r\n{\r\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\r\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\r\n}\r\n\r\n// by calls to these methods by a Babel plugin.\r\n//\r\n// In PROD (or in packages without access to React internals),\r\n// they are left as they are instead.\r\n\r\nfunction warn(format) {\r\n {\r\n {\r\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\r\n args[_key - 1] = arguments[_key];\r\n }\r\n\r\n printWarning('warn', format, args);\r\n }\r\n }\r\n}\r\nfunction error(format) {\r\n {\r\n {\r\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\r\n args[_key2 - 1] = arguments[_key2];\r\n }\r\n\r\n printWarning('error', format, args);\r\n }\r\n }\r\n}\r\n\r\nfunction printWarning(level, format, args) {\r\n // When changing this logic, you might want to also\r\n // update consoleWithStackDev.www.js as well.\r\n {\r\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\r\n var stack = ReactDebugCurrentFrame.getStackAddendum();\r\n\r\n if (stack !== '') {\r\n format += '%s';\r\n args = args.concat([stack]);\r\n } // eslint-disable-next-line react-internal/safe-string-coercion\r\n\r\n\r\n var argsWithFormat = args.map(function (item) {\r\n return String(item);\r\n }); // Careful: RN currently depends on this prefix\r\n\r\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\r\n // breaks IE9: https://github.com/facebook/react/issues/13610\r\n // eslint-disable-next-line react-internal/no-production-logging\r\n\r\n Function.prototype.apply.call(console[level], console, argsWithFormat);\r\n }\r\n}\r\n\r\nvar didWarnStateUpdateForUnmountedComponent = {};\r\n\r\nfunction warnNoop(publicInstance, callerName) {\r\n {\r\n var _constructor = publicInstance.constructor;\r\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\r\n var warningKey = componentName + \".\" + callerName;\r\n\r\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\r\n return;\r\n }\r\n\r\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\r\n\r\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\r\n }\r\n}\r\n/**\r\n * This is the abstract API for an update queue.\r\n */\r\n\r\n\r\nvar ReactNoopUpdateQueue = {\r\n /**\r\n * Checks whether or not this composite component is mounted.\r\n * @param {ReactClass} publicInstance The instance we want to test.\r\n * @return {boolean} True if mounted, false otherwise.\r\n * @protected\r\n * @final\r\n */\r\n isMounted: function (publicInstance) {\r\n return false;\r\n },\r\n\r\n /**\r\n * Forces an update. This should only be invoked when it is known with\r\n * certainty that we are **not** in a DOM transaction.\r\n *\r\n * You may want to call this when you know that some deeper aspect of the\r\n * component's state has changed but `setState` was not called.\r\n *\r\n * This will not invoke `shouldComponentUpdate`, but it will invoke\r\n * `componentWillUpdate` and `componentDidUpdate`.\r\n *\r\n * @param {ReactClass} publicInstance The instance that should rerender.\r\n * @param {?function} callback Called after component is updated.\r\n * @param {?string} callerName name of the calling function in the public API.\r\n * @internal\r\n */\r\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\r\n warnNoop(publicInstance, 'forceUpdate');\r\n },\r\n\r\n /**\r\n * Replaces all of the state. Always use this or `setState` to mutate state.\r\n * You should treat `this.state` as immutable.\r\n *\r\n * There is no guarantee that `this.state` will be immediately updated, so\r\n * accessing `this.state` after calling this method may return the old value.\r\n *\r\n * @param {ReactClass} publicInstance The instance that should rerender.\r\n * @param {object} completeState Next state.\r\n * @param {?function} callback Called after component is updated.\r\n * @param {?string} callerName name of the calling function in the public API.\r\n * @internal\r\n */\r\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\r\n warnNoop(publicInstance, 'replaceState');\r\n },\r\n\r\n /**\r\n * Sets a subset of the state. This only exists because _pendingState is\r\n * internal. This provides a merging strategy that is not available to deep\r\n * properties which is confusing. TODO: Expose pendingState or don't use it\r\n * during the merge.\r\n *\r\n * @param {ReactClass} publicInstance The instance that should rerender.\r\n * @param {object} partialState Next partial state to be merged with state.\r\n * @param {?function} callback Called after component is updated.\r\n * @param {?string} Name of the calling function in the public API.\r\n * @internal\r\n */\r\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\r\n warnNoop(publicInstance, 'setState');\r\n }\r\n};\r\n\r\nvar assign = Object.assign;\r\n\r\nvar emptyObject = {};\r\n\r\n{\r\n Object.freeze(emptyObject);\r\n}\r\n/**\r\n * Base class helpers for the updating state of a component.\r\n */\r\n\r\n\r\nfunction Component(props, context, updater) {\r\n this.props = props;\r\n this.context = context; // If a component has string refs, we will assign a different object later.\r\n\r\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\r\n // renderer.\r\n\r\n this.updater = updater || ReactNoopUpdateQueue;\r\n}\r\n\r\nComponent.prototype.isReactComponent = {};\r\n/**\r\n * Sets a subset of the state. Always use this to mutate\r\n * state. You should treat `this.state` as immutable.\r\n *\r\n * There is no guarantee that `this.state` will be immediately updated, so\r\n * accessing `this.state` after calling this method may return the old value.\r\n *\r\n * There is no guarantee that calls to `setState` will run synchronously,\r\n * as they may eventually be batched together. You can provide an optional\r\n * callback that will be executed when the call to setState is actually\r\n * completed.\r\n *\r\n * When a function is provided to setState, it will be called at some point in\r\n * the future (not synchronously). It will be called with the up to date\r\n * component arguments (state, props, context). These values can be different\r\n * from this.* because your function may be called after receiveProps but before\r\n * shouldComponentUpdate, and this new state, props, and context will not yet be\r\n * assigned to this.\r\n *\r\n * @param {object|function} partialState Next partial state or function to\r\n * produce next partial state to be merged with current state.\r\n * @param {?function} callback Called after state is updated.\r\n * @final\r\n * @protected\r\n */\r\n\r\nComponent.prototype.setState = function (partialState, callback) {\r\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\r\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\r\n }\r\n\r\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\r\n};\r\n/**\r\n * Forces an update. This should only be invoked when it is known with\r\n * certainty that we are **not** in a DOM transaction.\r\n *\r\n * You may want to call this when you know that some deeper aspect of the\r\n * component's state has changed but `setState` was not called.\r\n *\r\n * This will not invoke `shouldComponentUpdate`, but it will invoke\r\n * `componentWillUpdate` and `componentDidUpdate`.\r\n *\r\n * @param {?function} callback Called after update is complete.\r\n * @final\r\n * @protected\r\n */\r\n\r\n\r\nComponent.prototype.forceUpdate = function (callback) {\r\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\r\n};\r\n/**\r\n * Deprecated APIs. These APIs used to exist on classic React classes but since\r\n * we would like to deprecate them, we're not going to move them over to this\r\n * modern base class. Instead, we define a getter that warns if it's accessed.\r\n */\r\n\r\n\r\n{\r\n var deprecatedAPIs = {\r\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\r\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\r\n };\r\n\r\n var defineDeprecationWarning = function (methodName, info) {\r\n Object.defineProperty(Component.prototype, methodName, {\r\n get: function () {\r\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\r\n\r\n return undefined;\r\n }\r\n });\r\n };\r\n\r\n for (var fnName in deprecatedAPIs) {\r\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\r\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\r\n }\r\n }\r\n}\r\n\r\nfunction ComponentDummy() {}\r\n\r\nComponentDummy.prototype = Component.prototype;\r\n/**\r\n * Convenience component with default shallow equality check for sCU.\r\n */\r\n\r\nfunction PureComponent(props, context, updater) {\r\n this.props = props;\r\n this.context = context; // If a component has string refs, we will assign a different object later.\r\n\r\n this.refs = emptyObject;\r\n this.updater = updater || ReactNoopUpdateQueue;\r\n}\r\n\r\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\r\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\r\n\r\nassign(pureComponentPrototype, Component.prototype);\r\npureComponentPrototype.isPureReactComponent = true;\r\n\r\n// an immutable object with a single mutable value\r\nfunction createRef() {\r\n var refObject = {\r\n current: null\r\n };\r\n\r\n {\r\n Object.seal(refObject);\r\n }\r\n\r\n return refObject;\r\n}\r\n\r\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\r\n\r\nfunction isArray(a) {\r\n return isArrayImpl(a);\r\n}\r\n\r\n/*\r\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\r\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\r\n *\r\n * The functions in this module will throw an easier-to-understand,\r\n * easier-to-debug exception with a clear errors message message explaining the\r\n * problem. (Instead of a confusing exception thrown inside the implementation\r\n * of the `value` object).\r\n */\r\n// $FlowFixMe only called in DEV, so void return is not possible.\r\nfunction typeName(value) {\r\n {\r\n // toStringTag is needed for namespaced types like Temporal.Instant\r\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\r\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\r\n return type;\r\n }\r\n} // $FlowFixMe only called in DEV, so void return is not possible.\r\n\r\n\r\nfunction willCoercionThrow(value) {\r\n {\r\n try {\r\n testStringCoercion(value);\r\n return false;\r\n } catch (e) {\r\n return true;\r\n }\r\n }\r\n}\r\n\r\nfunction testStringCoercion(value) {\r\n // If you ended up here by following an exception call stack, here's what's\r\n // happened: you supplied an object or symbol value to React (as a prop, key,\r\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\r\n // coerce it to a string using `'' + value`, an exception was thrown.\r\n //\r\n // The most common types that will cause this exception are `Symbol` instances\r\n // and Temporal objects like `Temporal.Instant`. But any object that has a\r\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\r\n // exception. (Library authors do this to prevent users from using built-in\r\n // numeric operators like `+` or comparison operators like `>=` because custom\r\n // methods are needed to perform accurate arithmetic or comparison.)\r\n //\r\n // To fix the problem, coerce this object or symbol value to a string before\r\n // passing it to React. The most reliable way is usually `String(value)`.\r\n //\r\n // To find which value is throwing, check the browser or debugger console.\r\n // Before this exception was thrown, there should be `console.error` output\r\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\r\n // problem and how that type was used: key, atrribute, input value prop, etc.\r\n // In most cases, this console output also shows the component and its\r\n // ancestor components where the exception happened.\r\n //\r\n // eslint-disable-next-line react-internal/safe-string-coercion\r\n return '' + value;\r\n}\r\nfunction checkKeyStringCoercion(value) {\r\n {\r\n if (willCoercionThrow(value)) {\r\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\r\n\r\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\r\n }\r\n }\r\n}\r\n\r\nfunction getWrappedName(outerType, innerType, wrapperName) {\r\n var displayName = outerType.displayName;\r\n\r\n if (displayName) {\r\n return displayName;\r\n }\r\n\r\n var functionName = innerType.displayName || innerType.name || '';\r\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\r\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\r\n\r\n\r\nfunction getContextName(type) {\r\n return type.displayName || 'Context';\r\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\r\n\r\n\r\nfunction getComponentNameFromType(type) {\r\n if (type == null) {\r\n // Host root, text node or just invalid type.\r\n return null;\r\n }\r\n\r\n {\r\n if (typeof type.tag === 'number') {\r\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\r\n }\r\n }\r\n\r\n if (typeof type === 'function') {\r\n return type.displayName || type.name || null;\r\n }\r\n\r\n if (typeof type === 'string') {\r\n return type;\r\n }\r\n\r\n switch (type) {\r\n case REACT_FRAGMENT_TYPE:\r\n return 'Fragment';\r\n\r\n case REACT_PORTAL_TYPE:\r\n return 'Portal';\r\n\r\n case REACT_PROFILER_TYPE:\r\n return 'Profiler';\r\n\r\n case REACT_STRICT_MODE_TYPE:\r\n return 'StrictMode';\r\n\r\n case REACT_SUSPENSE_TYPE:\r\n return 'Suspense';\r\n\r\n case REACT_SUSPENSE_LIST_TYPE:\r\n return 'SuspenseList';\r\n\r\n }\r\n\r\n if (typeof type === 'object') {\r\n switch (type.$$typeof) {\r\n case REACT_CONTEXT_TYPE:\r\n var context = type;\r\n return getContextName(context) + '.Consumer';\r\n\r\n case REACT_PROVIDER_TYPE:\r\n var provider = type;\r\n return getContextName(provider._context) + '.Provider';\r\n\r\n case REACT_FORWARD_REF_TYPE:\r\n return getWrappedName(type, type.render, 'ForwardRef');\r\n\r\n case REACT_MEMO_TYPE:\r\n var outerName = type.displayName || null;\r\n\r\n if (outerName !== null) {\r\n return outerName;\r\n }\r\n\r\n return getComponentNameFromType(type.type) || 'Memo';\r\n\r\n case REACT_LAZY_TYPE:\r\n {\r\n var lazyComponent = type;\r\n var payload = lazyComponent._payload;\r\n var init = lazyComponent._init;\r\n\r\n try {\r\n return getComponentNameFromType(init(payload));\r\n } catch (x) {\r\n return null;\r\n }\r\n }\r\n\r\n // eslint-disable-next-line no-fallthrough\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\r\n\r\nvar RESERVED_PROPS = {\r\n key: true,\r\n ref: true,\r\n __self: true,\r\n __source: true\r\n};\r\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\r\n\r\n{\r\n didWarnAboutStringRefs = {};\r\n}\r\n\r\nfunction hasValidRef(config) {\r\n {\r\n if (hasOwnProperty.call(config, 'ref')) {\r\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\r\n\r\n if (getter && getter.isReactWarning) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return config.ref !== undefined;\r\n}\r\n\r\nfunction hasValidKey(config) {\r\n {\r\n if (hasOwnProperty.call(config, 'key')) {\r\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\r\n\r\n if (getter && getter.isReactWarning) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return config.key !== undefined;\r\n}\r\n\r\nfunction defineKeyPropWarningGetter(props, displayName) {\r\n var warnAboutAccessingKey = function () {\r\n {\r\n if (!specialPropKeyWarningShown) {\r\n specialPropKeyWarningShown = true;\r\n\r\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\r\n }\r\n }\r\n };\r\n\r\n warnAboutAccessingKey.isReactWarning = true;\r\n Object.defineProperty(props, 'key', {\r\n get: warnAboutAccessingKey,\r\n configurable: true\r\n });\r\n}\r\n\r\nfunction defineRefPropWarningGetter(props, displayName) {\r\n var warnAboutAccessingRef = function () {\r\n {\r\n if (!specialPropRefWarningShown) {\r\n specialPropRefWarningShown = true;\r\n\r\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\r\n }\r\n }\r\n };\r\n\r\n warnAboutAccessingRef.isReactWarning = true;\r\n Object.defineProperty(props, 'ref', {\r\n get: warnAboutAccessingRef,\r\n configurable: true\r\n });\r\n}\r\n\r\nfunction warnIfStringRefCannotBeAutoConverted(config) {\r\n {\r\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\r\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\r\n\r\n if (!didWarnAboutStringRefs[componentName]) {\r\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\r\n\r\n didWarnAboutStringRefs[componentName] = true;\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Factory method to create a new React element. This no longer adheres to\r\n * the class pattern, so do not use new to call it. Also, instanceof check\r\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\r\n * if something is a React Element.\r\n *\r\n * @param {*} type\r\n * @param {*} props\r\n * @param {*} key\r\n * @param {string|object} ref\r\n * @param {*} owner\r\n * @param {*} self A *temporary* helper to detect places where `this` is\r\n * different from the `owner` when React.createElement is called, so that we\r\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\r\n * functions, and as long as `this` and owner are the same, there will be no\r\n * change in behavior.\r\n * @param {*} source An annotation object (added by a transpiler or otherwise)\r\n * indicating filename, line number, and/or other information.\r\n * @internal\r\n */\r\n\r\n\r\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\r\n var element = {\r\n // This tag allows us to uniquely identify this as a React Element\r\n $$typeof: REACT_ELEMENT_TYPE,\r\n // Built-in properties that belong on the element\r\n type: type,\r\n key: key,\r\n ref: ref,\r\n props: props,\r\n // Record the component responsible for creating this element.\r\n _owner: owner\r\n };\r\n\r\n {\r\n // The validation flag is currently mutative. We put it on\r\n // an external backing store so that we can freeze the whole object.\r\n // This can be replaced with a WeakMap once they are implemented in\r\n // commonly used development environments.\r\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\r\n // the validation flag non-enumerable (where possible, which should\r\n // include every environment we run tests in), so the test framework\r\n // ignores it.\r\n\r\n Object.defineProperty(element._store, 'validated', {\r\n configurable: false,\r\n enumerable: false,\r\n writable: true,\r\n value: false\r\n }); // self and source are DEV only properties.\r\n\r\n Object.defineProperty(element, '_self', {\r\n configurable: false,\r\n enumerable: false,\r\n writable: false,\r\n value: self\r\n }); // Two elements created in two different places should be considered\r\n // equal for testing purposes and therefore we hide it from enumeration.\r\n\r\n Object.defineProperty(element, '_source', {\r\n configurable: false,\r\n enumerable: false,\r\n writable: false,\r\n value: source\r\n });\r\n\r\n if (Object.freeze) {\r\n Object.freeze(element.props);\r\n Object.freeze(element);\r\n }\r\n }\r\n\r\n return element;\r\n};\r\n/**\r\n * Create and return a new ReactElement of the given type.\r\n * See https://reactjs.org/docs/react-api.html#createelement\r\n */\r\n\r\nfunction createElement(type, config, children) {\r\n var propName; // Reserved names are extracted\r\n\r\n var props = {};\r\n var key = null;\r\n var ref = null;\r\n var self = null;\r\n var source = null;\r\n\r\n if (config != null) {\r\n if (hasValidRef(config)) {\r\n ref = config.ref;\r\n\r\n {\r\n warnIfStringRefCannotBeAutoConverted(config);\r\n }\r\n }\r\n\r\n if (hasValidKey(config)) {\r\n {\r\n checkKeyStringCoercion(config.key);\r\n }\r\n\r\n key = '' + config.key;\r\n }\r\n\r\n self = config.__self === undefined ? null : config.__self;\r\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\r\n\r\n for (propName in config) {\r\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\r\n props[propName] = config[propName];\r\n }\r\n }\r\n } // Children can be more than one argument, and those are transferred onto\r\n // the newly allocated props object.\r\n\r\n\r\n var childrenLength = arguments.length - 2;\r\n\r\n if (childrenLength === 1) {\r\n props.children = children;\r\n } else if (childrenLength > 1) {\r\n var childArray = Array(childrenLength);\r\n\r\n for (var i = 0; i < childrenLength; i++) {\r\n childArray[i] = arguments[i + 2];\r\n }\r\n\r\n {\r\n if (Object.freeze) {\r\n Object.freeze(childArray);\r\n }\r\n }\r\n\r\n props.children = childArray;\r\n } // Resolve default props\r\n\r\n\r\n if (type && type.defaultProps) {\r\n var defaultProps = type.defaultProps;\r\n\r\n for (propName in defaultProps) {\r\n if (props[propName] === undefined) {\r\n props[propName] = defaultProps[propName];\r\n }\r\n }\r\n }\r\n\r\n {\r\n if (key || ref) {\r\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\r\n\r\n if (key) {\r\n defineKeyPropWarningGetter(props, displayName);\r\n }\r\n\r\n if (ref) {\r\n defineRefPropWarningGetter(props, displayName);\r\n }\r\n }\r\n }\r\n\r\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\r\n}\r\nfunction cloneAndReplaceKey(oldElement, newKey) {\r\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\r\n return newElement;\r\n}\r\n/**\r\n * Clone and return a new ReactElement using element as the starting point.\r\n * See https://reactjs.org/docs/react-api.html#cloneelement\r\n */\r\n\r\nfunction cloneElement(element, config, children) {\r\n if (element === null || element === undefined) {\r\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\r\n }\r\n\r\n var propName; // Original props are copied\r\n\r\n var props = assign({}, element.props); // Reserved names are extracted\r\n\r\n var key = element.key;\r\n var ref = element.ref; // Self is preserved since the owner is preserved.\r\n\r\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\r\n // transpiler, and the original source is probably a better indicator of the\r\n // true owner.\r\n\r\n var source = element._source; // Owner will be preserved, unless ref is overridden\r\n\r\n var owner = element._owner;\r\n\r\n if (config != null) {\r\n if (hasValidRef(config)) {\r\n // Silently steal the ref from the parent.\r\n ref = config.ref;\r\n owner = ReactCurrentOwner.current;\r\n }\r\n\r\n if (hasValidKey(config)) {\r\n {\r\n checkKeyStringCoercion(config.key);\r\n }\r\n\r\n key = '' + config.key;\r\n } // Remaining properties override existing props\r\n\r\n\r\n var defaultProps;\r\n\r\n if (element.type && element.type.defaultProps) {\r\n defaultProps = element.type.defaultProps;\r\n }\r\n\r\n for (propName in config) {\r\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\r\n if (config[propName] === undefined && defaultProps !== undefined) {\r\n // Resolve default props\r\n props[propName] = defaultProps[propName];\r\n } else {\r\n props[propName] = config[propName];\r\n }\r\n }\r\n }\r\n } // Children can be more than one argument, and those are transferred onto\r\n // the newly allocated props object.\r\n\r\n\r\n var childrenLength = arguments.length - 2;\r\n\r\n if (childrenLength === 1) {\r\n props.children = children;\r\n } else if (childrenLength > 1) {\r\n var childArray = Array(childrenLength);\r\n\r\n for (var i = 0; i < childrenLength; i++) {\r\n childArray[i] = arguments[i + 2];\r\n }\r\n\r\n props.children = childArray;\r\n }\r\n\r\n return ReactElement(element.type, key, ref, self, source, owner, props);\r\n}\r\n/**\r\n * Verifies the object is a ReactElement.\r\n * See https://reactjs.org/docs/react-api.html#isvalidelement\r\n * @param {?object} object\r\n * @return {boolean} True if `object` is a ReactElement.\r\n * @final\r\n */\r\n\r\nfunction isValidElement(object) {\r\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\r\n}\r\n\r\nvar SEPARATOR = '.';\r\nvar SUBSEPARATOR = ':';\r\n/**\r\n * Escape and wrap key so it is safe to use as a reactid\r\n *\r\n * @param {string} key to be escaped.\r\n * @return {string} the escaped key.\r\n */\r\n\r\nfunction escape(key) {\r\n var escapeRegex = /[=:]/g;\r\n var escaperLookup = {\r\n '=': '=0',\r\n ':': '=2'\r\n };\r\n var escapedString = key.replace(escapeRegex, function (match) {\r\n return escaperLookup[match];\r\n });\r\n return '$' + escapedString;\r\n}\r\n/**\r\n * TODO: Test that a single child and an array with one item have the same key\r\n * pattern.\r\n */\r\n\r\n\r\nvar didWarnAboutMaps = false;\r\nvar userProvidedKeyEscapeRegex = /\\/+/g;\r\n\r\nfunction escapeUserProvidedKey(text) {\r\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\r\n}\r\n/**\r\n * Generate a key string that identifies a element within a set.\r\n *\r\n * @param {*} element A element that could contain a manual key.\r\n * @param {number} index Index that is used if a manual key is not provided.\r\n * @return {string}\r\n */\r\n\r\n\r\nfunction getElementKey(element, index) {\r\n // Do some typechecking here since we call this blindly. We want to ensure\r\n // that we don't block potential future ES APIs.\r\n if (typeof element === 'object' && element !== null && element.key != null) {\r\n // Explicit key\r\n {\r\n checkKeyStringCoercion(element.key);\r\n }\r\n\r\n return escape('' + element.key);\r\n } // Implicit key determined by the index in the set\r\n\r\n\r\n return index.toString(36);\r\n}\r\n\r\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\r\n var type = typeof children;\r\n\r\n if (type === 'undefined' || type === 'boolean') {\r\n // All of the above are perceived as null.\r\n children = null;\r\n }\r\n\r\n var invokeCallback = false;\r\n\r\n if (children === null) {\r\n invokeCallback = true;\r\n } else {\r\n switch (type) {\r\n case 'string':\r\n case 'number':\r\n invokeCallback = true;\r\n break;\r\n\r\n case 'object':\r\n switch (children.$$typeof) {\r\n case REACT_ELEMENT_TYPE:\r\n case REACT_PORTAL_TYPE:\r\n invokeCallback = true;\r\n }\r\n\r\n }\r\n }\r\n\r\n if (invokeCallback) {\r\n var _child = children;\r\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\r\n // so that it's consistent if the number of children grows:\r\n\r\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\r\n\r\n if (isArray(mappedChild)) {\r\n var escapedChildKey = '';\r\n\r\n if (childKey != null) {\r\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\r\n }\r\n\r\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\r\n return c;\r\n });\r\n } else if (mappedChild != null) {\r\n if (isValidElement(mappedChild)) {\r\n {\r\n // The `if` statement here prevents auto-disabling of the safe\r\n // coercion ESLint rule, so we must manually disable it below.\r\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\r\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\r\n checkKeyStringCoercion(mappedChild.key);\r\n }\r\n }\r\n\r\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\r\n // traverseAllChildren used to do for objects as children\r\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\r\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\r\n // eslint-disable-next-line react-internal/safe-string-coercion\r\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\r\n }\r\n\r\n array.push(mappedChild);\r\n }\r\n\r\n return 1;\r\n }\r\n\r\n var child;\r\n var nextName;\r\n var subtreeCount = 0; // Count of children found in the current subtree.\r\n\r\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\r\n\r\n if (isArray(children)) {\r\n for (var i = 0; i < children.length; i++) {\r\n child = children[i];\r\n nextName = nextNamePrefix + getElementKey(child, i);\r\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\r\n }\r\n } else {\r\n var iteratorFn = getIteratorFn(children);\r\n\r\n if (typeof iteratorFn === 'function') {\r\n var iterableChildren = children;\r\n\r\n {\r\n // Warn about using Maps as children\r\n if (iteratorFn === iterableChildren.entries) {\r\n if (!didWarnAboutMaps) {\r\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\r\n }\r\n\r\n didWarnAboutMaps = true;\r\n }\r\n }\r\n\r\n var iterator = iteratorFn.call(iterableChildren);\r\n var step;\r\n var ii = 0;\r\n\r\n while (!(step = iterator.next()).done) {\r\n child = step.value;\r\n nextName = nextNamePrefix + getElementKey(child, ii++);\r\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\r\n }\r\n } else if (type === 'object') {\r\n // eslint-disable-next-line react-internal/safe-string-coercion\r\n var childrenString = String(children);\r\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\r\n }\r\n }\r\n\r\n return subtreeCount;\r\n}\r\n\r\n/**\r\n * Maps children that are typically specified as `props.children`.\r\n *\r\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\r\n *\r\n * The provided mapFunction(child, index) will be called for each\r\n * leaf child.\r\n *\r\n * @param {?*} children Children tree container.\r\n * @param {function(*, int)} func The map function.\r\n * @param {*} context Context for mapFunction.\r\n * @return {object} Object containing the ordered map of results.\r\n */\r\nfunction mapChildren(children, func, context) {\r\n if (children == null) {\r\n return children;\r\n }\r\n\r\n var result = [];\r\n var count = 0;\r\n mapIntoArray(children, result, '', '', function (child) {\r\n return func.call(context, child, count++);\r\n });\r\n return result;\r\n}\r\n/**\r\n * Count the number of children that are typically specified as\r\n * `props.children`.\r\n *\r\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\r\n *\r\n * @param {?*} children Children tree container.\r\n * @return {number} The number of children.\r\n */\r\n\r\n\r\nfunction countChildren(children) {\r\n var n = 0;\r\n mapChildren(children, function () {\r\n n++; // Don't return anything\r\n });\r\n return n;\r\n}\r\n\r\n/**\r\n * Iterates through children that are typically specified as `props.children`.\r\n *\r\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\r\n *\r\n * The provided forEachFunc(child, index) will be called for each\r\n * leaf child.\r\n *\r\n * @param {?*} children Children tree container.\r\n * @param {function(*, int)} forEachFunc\r\n * @param {*} forEachContext Context for forEachContext.\r\n */\r\nfunction forEachChildren(children, forEachFunc, forEachContext) {\r\n mapChildren(children, function () {\r\n forEachFunc.apply(this, arguments); // Don't return anything.\r\n }, forEachContext);\r\n}\r\n/**\r\n * Flatten a children object (typically specified as `props.children`) and\r\n * return an array with appropriately re-keyed children.\r\n *\r\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\r\n */\r\n\r\n\r\nfunction toArray(children) {\r\n return mapChildren(children, function (child) {\r\n return child;\r\n }) || [];\r\n}\r\n/**\r\n * Returns the first child in a collection of children and verifies that there\r\n * is only one child in the collection.\r\n *\r\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\r\n *\r\n * The current implementation of this function assumes that a single child gets\r\n * passed without a wrapper, but the purpose of this helper function is to\r\n * abstract away the particular structure of children.\r\n *\r\n * @param {?object} children Child collection structure.\r\n * @return {ReactElement} The first and only `ReactElement` contained in the\r\n * structure.\r\n */\r\n\r\n\r\nfunction onlyChild(children) {\r\n if (!isValidElement(children)) {\r\n throw new Error('React.Children.only expected to receive a single React element child.');\r\n }\r\n\r\n return children;\r\n}\r\n\r\nfunction createContext(defaultValue) {\r\n // TODO: Second argument used to be an optional `calculateChangedBits`\r\n // function. Warn to reserve for future use?\r\n var context = {\r\n $$typeof: REACT_CONTEXT_TYPE,\r\n // As a workaround to support multiple concurrent renderers, we categorize\r\n // some renderers as primary and others as secondary. We only expect\r\n // there to be two concurrent renderers at most: React Native (primary) and\r\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\r\n // Secondary renderers store their context values on separate fields.\r\n _currentValue: defaultValue,\r\n _currentValue2: defaultValue,\r\n // Used to track how many concurrent renderers this context currently\r\n // supports within in a single renderer. Such as parallel server rendering.\r\n _threadCount: 0,\r\n // These are circular\r\n Provider: null,\r\n Consumer: null,\r\n // Add these to use same hidden class in VM as ServerContext\r\n _defaultValue: null,\r\n _globalName: null\r\n };\r\n context.Provider = {\r\n $$typeof: REACT_PROVIDER_TYPE,\r\n _context: context\r\n };\r\n var hasWarnedAboutUsingNestedContextConsumers = false;\r\n var hasWarnedAboutUsingConsumerProvider = false;\r\n var hasWarnedAboutDisplayNameOnConsumer = false;\r\n\r\n {\r\n // A separate object, but proxies back to the original context object for\r\n // backwards compatibility. It has a different $$typeof, so we can properly\r\n // warn for the incorrect usage of Context as a Consumer.\r\n var Consumer = {\r\n $$typeof: REACT_CONTEXT_TYPE,\r\n _context: context\r\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\r\n\r\n Object.defineProperties(Consumer, {\r\n Provider: {\r\n get: function () {\r\n if (!hasWarnedAboutUsingConsumerProvider) {\r\n hasWarnedAboutUsingConsumerProvider = true;\r\n\r\n error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?');\r\n }\r\n\r\n return context.Provider;\r\n },\r\n set: function (_Provider) {\r\n context.Provider = _Provider;\r\n }\r\n },\r\n _currentValue: {\r\n get: function () {\r\n return context._currentValue;\r\n },\r\n set: function (_currentValue) {\r\n context._currentValue = _currentValue;\r\n }\r\n },\r\n _currentValue2: {\r\n get: function () {\r\n return context._currentValue2;\r\n },\r\n set: function (_currentValue2) {\r\n context._currentValue2 = _currentValue2;\r\n }\r\n },\r\n _threadCount: {\r\n get: function () {\r\n return context._threadCount;\r\n },\r\n set: function (_threadCount) {\r\n context._threadCount = _threadCount;\r\n }\r\n },\r\n Consumer: {\r\n get: function () {\r\n if (!hasWarnedAboutUsingNestedContextConsumers) {\r\n hasWarnedAboutUsingNestedContextConsumers = true;\r\n\r\n error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?');\r\n }\r\n\r\n return context.Consumer;\r\n }\r\n },\r\n displayName: {\r\n get: function () {\r\n return context.displayName;\r\n },\r\n set: function (displayName) {\r\n if (!hasWarnedAboutDisplayNameOnConsumer) {\r\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\r\n\r\n hasWarnedAboutDisplayNameOnConsumer = true;\r\n }\r\n }\r\n }\r\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\r\n\r\n context.Consumer = Consumer;\r\n }\r\n\r\n {\r\n context._currentRenderer = null;\r\n context._currentRenderer2 = null;\r\n }\r\n\r\n return context;\r\n}\r\n\r\nvar Uninitialized = -1;\r\nvar Pending = 0;\r\nvar Resolved = 1;\r\nvar Rejected = 2;\r\n\r\nfunction lazyInitializer(payload) {\r\n if (payload._status === Uninitialized) {\r\n var ctor = payload._result;\r\n var thenable = ctor(); // Transition to the next state.\r\n // This might throw either because it's missing or throws. If so, we treat it\r\n // as still uninitialized and try again next time. Which is the same as what\r\n // happens if the ctor or any wrappers processing the ctor throws. This might\r\n // end up fixing it if the resolution was a concurrency bug.\r\n\r\n thenable.then(function (moduleObject) {\r\n if (payload._status === Pending || payload._status === Uninitialized) {\r\n // Transition to the next state.\r\n var resolved = payload;\r\n resolved._status = Resolved;\r\n resolved._result = moduleObject;\r\n }\r\n }, function (error) {\r\n if (payload._status === Pending || payload._status === Uninitialized) {\r\n // Transition to the next state.\r\n var rejected = payload;\r\n rejected._status = Rejected;\r\n rejected._result = error;\r\n }\r\n });\r\n\r\n if (payload._status === Uninitialized) {\r\n // In case, we're still uninitialized, then we're waiting for the thenable\r\n // to resolve. Set it as pending in the meantime.\r\n var pending = payload;\r\n pending._status = Pending;\r\n pending._result = thenable;\r\n }\r\n }\r\n\r\n if (payload._status === Resolved) {\r\n var moduleObject = payload._result;\r\n\r\n {\r\n if (moduleObject === undefined) {\r\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\r\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\r\n }\r\n }\r\n\r\n {\r\n if (!('default' in moduleObject)) {\r\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\r\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\r\n }\r\n }\r\n\r\n return moduleObject.default;\r\n } else {\r\n throw payload._result;\r\n }\r\n}\r\n\r\nfunction lazy(ctor) {\r\n var payload = {\r\n // We use these fields to store the result.\r\n _status: Uninitialized,\r\n _result: ctor\r\n };\r\n var lazyType = {\r\n $$typeof: REACT_LAZY_TYPE,\r\n _payload: payload,\r\n _init: lazyInitializer\r\n };\r\n\r\n {\r\n // In production, this would just set it on the object.\r\n var defaultProps;\r\n var propTypes; // $FlowFixMe\r\n\r\n Object.defineProperties(lazyType, {\r\n defaultProps: {\r\n configurable: true,\r\n get: function () {\r\n return defaultProps;\r\n },\r\n set: function (newDefaultProps) {\r\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\r\n\r\n defaultProps = newDefaultProps; // Match production behavior more closely:\r\n // $FlowFixMe\r\n\r\n Object.defineProperty(lazyType, 'defaultProps', {\r\n enumerable: true\r\n });\r\n }\r\n },\r\n propTypes: {\r\n configurable: true,\r\n get: function () {\r\n return propTypes;\r\n },\r\n set: function (newPropTypes) {\r\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\r\n\r\n propTypes = newPropTypes; // Match production behavior more closely:\r\n // $FlowFixMe\r\n\r\n Object.defineProperty(lazyType, 'propTypes', {\r\n enumerable: true\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n return lazyType;\r\n}\r\n\r\nfunction forwardRef(render) {\r\n {\r\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\r\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\r\n } else if (typeof render !== 'function') {\r\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\r\n } else {\r\n if (render.length !== 0 && render.length !== 2) {\r\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\r\n }\r\n }\r\n\r\n if (render != null) {\r\n if (render.defaultProps != null || render.propTypes != null) {\r\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\r\n }\r\n }\r\n }\r\n\r\n var elementType = {\r\n $$typeof: REACT_FORWARD_REF_TYPE,\r\n render: render\r\n };\r\n\r\n {\r\n var ownName;\r\n Object.defineProperty(elementType, 'displayName', {\r\n enumerable: false,\r\n configurable: true,\r\n get: function () {\r\n return ownName;\r\n },\r\n set: function (name) {\r\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\r\n // because the component may be used elsewhere.\r\n // But it's nice for anonymous functions to inherit the name,\r\n // so that our component-stack generation logic will display their frames.\r\n // An anonymous function generally suggests a pattern like:\r\n // React.forwardRef((props, ref) => {...});\r\n // This kind of inner function is not used elsewhere so the side effect is okay.\r\n\r\n if (!render.name && !render.displayName) {\r\n render.displayName = name;\r\n }\r\n }\r\n });\r\n }\r\n\r\n return elementType;\r\n}\r\n\r\nvar REACT_MODULE_REFERENCE;\r\n\r\n{\r\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\r\n}\r\n\r\nfunction isValidElementType(type) {\r\n if (typeof type === 'string' || typeof type === 'function') {\r\n return true;\r\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\r\n\r\n\r\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\r\n return true;\r\n }\r\n\r\n if (typeof type === 'object' && type !== null) {\r\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\r\n // types supported by any Flight configuration anywhere since\r\n // we don't know which Flight build this will end up being used\r\n // with.\r\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction memo(type, compare) {\r\n {\r\n if (!isValidElementType(type)) {\r\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\r\n }\r\n }\r\n\r\n var elementType = {\r\n $$typeof: REACT_MEMO_TYPE,\r\n type: type,\r\n compare: compare === undefined ? null : compare\r\n };\r\n\r\n {\r\n var ownName;\r\n Object.defineProperty(elementType, 'displayName', {\r\n enumerable: false,\r\n configurable: true,\r\n get: function () {\r\n return ownName;\r\n },\r\n set: function (name) {\r\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\r\n // because the component may be used elsewhere.\r\n // But it's nice for anonymous functions to inherit the name,\r\n // so that our component-stack generation logic will display their frames.\r\n // An anonymous function generally suggests a pattern like:\r\n // React.memo((props) => {...});\r\n // This kind of inner function is not used elsewhere so the side effect is okay.\r\n\r\n if (!type.name && !type.displayName) {\r\n type.displayName = name;\r\n }\r\n }\r\n });\r\n }\r\n\r\n return elementType;\r\n}\r\n\r\nfunction resolveDispatcher() {\r\n var dispatcher = ReactCurrentDispatcher.current;\r\n\r\n {\r\n if (dispatcher === null) {\r\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\r\n }\r\n } // Will result in a null access error if accessed outside render phase. We\r\n // intentionally don't throw our own error because this is in a hot path.\r\n // Also helps ensure this is inlined.\r\n\r\n\r\n return dispatcher;\r\n}\r\nfunction useContext(Context) {\r\n var dispatcher = resolveDispatcher();\r\n\r\n {\r\n // TODO: add a more generic warning for invalid values.\r\n if (Context._context !== undefined) {\r\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\r\n // and nobody should be using this in existing code.\r\n\r\n if (realContext.Consumer === Context) {\r\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\r\n } else if (realContext.Provider === Context) {\r\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\r\n }\r\n }\r\n }\r\n\r\n return dispatcher.useContext(Context);\r\n}\r\nfunction useState(initialState) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useState(initialState);\r\n}\r\nfunction useReducer(reducer, initialArg, init) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useReducer(reducer, initialArg, init);\r\n}\r\nfunction useRef(initialValue) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useRef(initialValue);\r\n}\r\nfunction useEffect(create, deps) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useEffect(create, deps);\r\n}\r\nfunction useInsertionEffect(create, deps) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useInsertionEffect(create, deps);\r\n}\r\nfunction useLayoutEffect(create, deps) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useLayoutEffect(create, deps);\r\n}\r\nfunction useCallback(callback, deps) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useCallback(callback, deps);\r\n}\r\nfunction useMemo(create, deps) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useMemo(create, deps);\r\n}\r\nfunction useImperativeHandle(ref, create, deps) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useImperativeHandle(ref, create, deps);\r\n}\r\nfunction useDebugValue(value, formatterFn) {\r\n {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useDebugValue(value, formatterFn);\r\n }\r\n}\r\nfunction useTransition() {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useTransition();\r\n}\r\nfunction useDeferredValue(value) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useDeferredValue(value);\r\n}\r\nfunction useId() {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useId();\r\n}\r\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\r\n var dispatcher = resolveDispatcher();\r\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\r\n}\r\n\r\n// Helpers to patch console.logs to avoid logging during side-effect free\r\n// replaying on render function. This currently only patches the object\r\n// lazily which won't cover if the log function was extracted eagerly.\r\n// We could also eagerly patch the method.\r\nvar disabledDepth = 0;\r\nvar prevLog;\r\nvar prevInfo;\r\nvar prevWarn;\r\nvar prevError;\r\nvar prevGroup;\r\nvar prevGroupCollapsed;\r\nvar prevGroupEnd;\r\n\r\nfunction disabledLog() {}\r\n\r\ndisabledLog.__reactDisabledLog = true;\r\nfunction disableLogs() {\r\n {\r\n if (disabledDepth === 0) {\r\n /* eslint-disable react-internal/no-production-logging */\r\n prevLog = console.log;\r\n prevInfo = console.info;\r\n prevWarn = console.warn;\r\n prevError = console.error;\r\n prevGroup = console.group;\r\n prevGroupCollapsed = console.groupCollapsed;\r\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\r\n\r\n var props = {\r\n configurable: true,\r\n enumerable: true,\r\n value: disabledLog,\r\n writable: true\r\n }; // $FlowFixMe Flow thinks console is immutable.\r\n\r\n Object.defineProperties(console, {\r\n info: props,\r\n log: props,\r\n warn: props,\r\n error: props,\r\n group: props,\r\n groupCollapsed: props,\r\n groupEnd: props\r\n });\r\n /* eslint-enable react-internal/no-production-logging */\r\n }\r\n\r\n disabledDepth++;\r\n }\r\n}\r\nfunction reenableLogs() {\r\n {\r\n disabledDepth--;\r\n\r\n if (disabledDepth === 0) {\r\n /* eslint-disable react-internal/no-production-logging */\r\n var props = {\r\n configurable: true,\r\n enumerable: true,\r\n writable: true\r\n }; // $FlowFixMe Flow thinks console is immutable.\r\n\r\n Object.defineProperties(console, {\r\n log: assign({}, props, {\r\n value: prevLog\r\n }),\r\n info: assign({}, props, {\r\n value: prevInfo\r\n }),\r\n warn: assign({}, props, {\r\n value: prevWarn\r\n }),\r\n error: assign({}, props, {\r\n value: prevError\r\n }),\r\n group: assign({}, props, {\r\n value: prevGroup\r\n }),\r\n groupCollapsed: assign({}, props, {\r\n value: prevGroupCollapsed\r\n }),\r\n groupEnd: assign({}, props, {\r\n value: prevGroupEnd\r\n })\r\n });\r\n /* eslint-enable react-internal/no-production-logging */\r\n }\r\n\r\n if (disabledDepth < 0) {\r\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\r\n }\r\n }\r\n}\r\n\r\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\r\nvar prefix;\r\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\r\n {\r\n if (prefix === undefined) {\r\n // Extract the VM specific prefix used by each line.\r\n try {\r\n throw Error();\r\n } catch (x) {\r\n var match = x.stack.trim().match(/\\n( *(at )?)/);\r\n prefix = match && match[1] || '';\r\n }\r\n } // We use the prefix to ensure our stacks line up with native stack frames.\r\n\r\n\r\n return '\\n' + prefix + name;\r\n }\r\n}\r\nvar reentry = false;\r\nvar componentFrameCache;\r\n\r\n{\r\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\r\n componentFrameCache = new PossiblyWeakMap();\r\n}\r\n\r\nfunction describeNativeComponentFrame(fn, construct) {\r\n // If something asked for a stack inside a fake render, it should get ignored.\r\n if ( !fn || reentry) {\r\n return '';\r\n }\r\n\r\n {\r\n var frame = componentFrameCache.get(fn);\r\n\r\n if (frame !== undefined) {\r\n return frame;\r\n }\r\n }\r\n\r\n var control;\r\n reentry = true;\r\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\r\n\r\n Error.prepareStackTrace = undefined;\r\n var previousDispatcher;\r\n\r\n {\r\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\r\n // for warnings.\r\n\r\n ReactCurrentDispatcher$1.current = null;\r\n disableLogs();\r\n }\r\n\r\n try {\r\n // This should throw.\r\n if (construct) {\r\n // Something should be setting the props in the constructor.\r\n var Fake = function () {\r\n throw Error();\r\n }; // $FlowFixMe\r\n\r\n\r\n Object.defineProperty(Fake.prototype, 'props', {\r\n set: function () {\r\n // We use a throwing setter instead of frozen or non-writable props\r\n // because that won't throw in a non-strict mode function.\r\n throw Error();\r\n }\r\n });\r\n\r\n if (typeof Reflect === 'object' && Reflect.construct) {\r\n // We construct a different control for this case to include any extra\r\n // frames added by the construct call.\r\n try {\r\n Reflect.construct(Fake, []);\r\n } catch (x) {\r\n control = x;\r\n }\r\n\r\n Reflect.construct(fn, [], Fake);\r\n } else {\r\n try {\r\n Fake.call();\r\n } catch (x) {\r\n control = x;\r\n }\r\n\r\n fn.call(Fake.prototype);\r\n }\r\n } else {\r\n try {\r\n throw Error();\r\n } catch (x) {\r\n control = x;\r\n }\r\n\r\n fn();\r\n }\r\n } catch (sample) {\r\n // This is inlined manually because closure doesn't do it for us.\r\n if (sample && control && typeof sample.stack === 'string') {\r\n // This extracts the first frame from the sample that isn't also in the control.\r\n // Skipping one frame that we assume is the frame that calls the two.\r\n var sampleLines = sample.stack.split('\\n');\r\n var controlLines = control.stack.split('\\n');\r\n var s = sampleLines.length - 1;\r\n var c = controlLines.length - 1;\r\n\r\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\r\n // We expect at least one stack frame to be shared.\r\n // Typically this will be the root most one. However, stack frames may be\r\n // cut off due to maximum stack limits. In this case, one maybe cut off\r\n // earlier than the other. We assume that the sample is longer or the same\r\n // and there for cut off earlier. So we should find the root most frame in\r\n // the sample somewhere in the control.\r\n c--;\r\n }\r\n\r\n for (; s >= 1 && c >= 0; s--, c--) {\r\n // Next we find the first one that isn't the same which should be the\r\n // frame that called our sample function and the control.\r\n if (sampleLines[s] !== controlLines[c]) {\r\n // In V8, the first line is describing the message but other VMs don't.\r\n // If we're about to return the first line, and the control is also on the same\r\n // line, that's a pretty good indicator that our sample threw at same line as\r\n // the control. I.e. before we entered the sample frame. So we ignore this result.\r\n // This can happen if you passed a class to function component, or non-function.\r\n if (s !== 1 || c !== 1) {\r\n do {\r\n s--;\r\n c--; // We may still have similar intermediate frames from the construct call.\r\n // The next one that isn't the same should be our match though.\r\n\r\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\r\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\r\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\r\n // but we have a user-provided \"displayName\"\r\n // splice it in to make the stack more readable.\r\n\r\n\r\n if (fn.displayName && _frame.includes('')) {\r\n _frame = _frame.replace('', fn.displayName);\r\n }\r\n\r\n {\r\n if (typeof fn === 'function') {\r\n componentFrameCache.set(fn, _frame);\r\n }\r\n } // Return the line we found.\r\n\r\n\r\n return _frame;\r\n }\r\n } while (s >= 1 && c >= 0);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n } finally {\r\n reentry = false;\r\n\r\n {\r\n ReactCurrentDispatcher$1.current = previousDispatcher;\r\n reenableLogs();\r\n }\r\n\r\n Error.prepareStackTrace = previousPrepareStackTrace;\r\n } // Fallback to just using the name if we couldn't make it throw.\r\n\r\n\r\n var name = fn ? fn.displayName || fn.name : '';\r\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\r\n\r\n {\r\n if (typeof fn === 'function') {\r\n componentFrameCache.set(fn, syntheticFrame);\r\n }\r\n }\r\n\r\n return syntheticFrame;\r\n}\r\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\r\n {\r\n return describeNativeComponentFrame(fn, false);\r\n }\r\n}\r\n\r\nfunction shouldConstruct(Component) {\r\n var prototype = Component.prototype;\r\n return !!(prototype && prototype.isReactComponent);\r\n}\r\n\r\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\r\n\r\n if (type == null) {\r\n return '';\r\n }\r\n\r\n if (typeof type === 'function') {\r\n {\r\n return describeNativeComponentFrame(type, shouldConstruct(type));\r\n }\r\n }\r\n\r\n if (typeof type === 'string') {\r\n return describeBuiltInComponentFrame(type);\r\n }\r\n\r\n switch (type) {\r\n case REACT_SUSPENSE_TYPE:\r\n return describeBuiltInComponentFrame('Suspense');\r\n\r\n case REACT_SUSPENSE_LIST_TYPE:\r\n return describeBuiltInComponentFrame('SuspenseList');\r\n }\r\n\r\n if (typeof type === 'object') {\r\n switch (type.$$typeof) {\r\n case REACT_FORWARD_REF_TYPE:\r\n return describeFunctionComponentFrame(type.render);\r\n\r\n case REACT_MEMO_TYPE:\r\n // Memo may contain any component type so we recursively resolve it.\r\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\r\n\r\n case REACT_LAZY_TYPE:\r\n {\r\n var lazyComponent = type;\r\n var payload = lazyComponent._payload;\r\n var init = lazyComponent._init;\r\n\r\n try {\r\n // Lazy may contain any component type so we recursively resolve it.\r\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\r\n } catch (x) {}\r\n }\r\n }\r\n }\r\n\r\n return '';\r\n}\r\n\r\nvar loggedTypeFailures = {};\r\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\r\n\r\nfunction setCurrentlyValidatingElement(element) {\r\n {\r\n if (element) {\r\n var owner = element._owner;\r\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\r\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\r\n } else {\r\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\r\n }\r\n }\r\n}\r\n\r\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\r\n {\r\n // $FlowFixMe This is okay but Flow doesn't know it.\r\n var has = Function.call.bind(hasOwnProperty);\r\n\r\n for (var typeSpecName in typeSpecs) {\r\n if (has(typeSpecs, typeSpecName)) {\r\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\r\n // fail the render phase where it didn't fail before. So we log it.\r\n // After these have been cleaned up, we'll let them throw.\r\n\r\n try {\r\n // This is intentionally an invariant that gets caught. It's the same\r\n // behavior as without this statement except with a better message.\r\n if (typeof typeSpecs[typeSpecName] !== 'function') {\r\n // eslint-disable-next-line react-internal/prod-error-codes\r\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\r\n err.name = 'Invariant Violation';\r\n throw err;\r\n }\r\n\r\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\r\n } catch (ex) {\r\n error$1 = ex;\r\n }\r\n\r\n if (error$1 && !(error$1 instanceof Error)) {\r\n setCurrentlyValidatingElement(element);\r\n\r\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\r\n\r\n setCurrentlyValidatingElement(null);\r\n }\r\n\r\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\r\n // Only monitor this failure once because there tends to be a lot of the\r\n // same error.\r\n loggedTypeFailures[error$1.message] = true;\r\n setCurrentlyValidatingElement(element);\r\n\r\n error('Failed %s type: %s', location, error$1.message);\r\n\r\n setCurrentlyValidatingElement(null);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction setCurrentlyValidatingElement$1(element) {\r\n {\r\n if (element) {\r\n var owner = element._owner;\r\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\r\n setExtraStackFrame(stack);\r\n } else {\r\n setExtraStackFrame(null);\r\n }\r\n }\r\n}\r\n\r\nvar propTypesMisspellWarningShown;\r\n\r\n{\r\n propTypesMisspellWarningShown = false;\r\n}\r\n\r\nfunction getDeclarationErrorAddendum() {\r\n if (ReactCurrentOwner.current) {\r\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\r\n\r\n if (name) {\r\n return '\\n\\nCheck the render method of `' + name + '`.';\r\n }\r\n }\r\n\r\n return '';\r\n}\r\n\r\nfunction getSourceInfoErrorAddendum(source) {\r\n if (source !== undefined) {\r\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\r\n var lineNumber = source.lineNumber;\r\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\r\n }\r\n\r\n return '';\r\n}\r\n\r\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\r\n if (elementProps !== null && elementProps !== undefined) {\r\n return getSourceInfoErrorAddendum(elementProps.__source);\r\n }\r\n\r\n return '';\r\n}\r\n/**\r\n * Warn if there's no key explicitly set on dynamic arrays of children or\r\n * object keys are not valid. This allows us to keep track of children between\r\n * updates.\r\n */\r\n\r\n\r\nvar ownerHasKeyUseWarning = {};\r\n\r\nfunction getCurrentComponentErrorInfo(parentType) {\r\n var info = getDeclarationErrorAddendum();\r\n\r\n if (!info) {\r\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\r\n\r\n if (parentName) {\r\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\r\n }\r\n }\r\n\r\n return info;\r\n}\r\n/**\r\n * Warn if the element doesn't have an explicit key assigned to it.\r\n * This element is in an array. The array could grow and shrink or be\r\n * reordered. All children that haven't already been validated are required to\r\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\r\n * will only be shown once.\r\n *\r\n * @internal\r\n * @param {ReactElement} element Element that requires a key.\r\n * @param {*} parentType element's parent's type.\r\n */\r\n\r\n\r\nfunction validateExplicitKey(element, parentType) {\r\n if (!element._store || element._store.validated || element.key != null) {\r\n return;\r\n }\r\n\r\n element._store.validated = true;\r\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\r\n\r\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\r\n return;\r\n }\r\n\r\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\r\n // property, it may be the creator of the child that's responsible for\r\n // assigning it a key.\r\n\r\n var childOwner = '';\r\n\r\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\r\n // Give the component that originally created this child.\r\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\r\n }\r\n\r\n {\r\n setCurrentlyValidatingElement$1(element);\r\n\r\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\r\n\r\n setCurrentlyValidatingElement$1(null);\r\n }\r\n}\r\n/**\r\n * Ensure that every element either is passed in a static location, in an\r\n * array with an explicit keys property defined, or in an object literal\r\n * with valid key property.\r\n *\r\n * @internal\r\n * @param {ReactNode} node Statically passed child of any type.\r\n * @param {*} parentType node's parent's type.\r\n */\r\n\r\n\r\nfunction validateChildKeys(node, parentType) {\r\n if (typeof node !== 'object') {\r\n return;\r\n }\r\n\r\n if (isArray(node)) {\r\n for (var i = 0; i < node.length; i++) {\r\n var child = node[i];\r\n\r\n if (isValidElement(child)) {\r\n validateExplicitKey(child, parentType);\r\n }\r\n }\r\n } else if (isValidElement(node)) {\r\n // This element was passed in a valid location.\r\n if (node._store) {\r\n node._store.validated = true;\r\n }\r\n } else if (node) {\r\n var iteratorFn = getIteratorFn(node);\r\n\r\n if (typeof iteratorFn === 'function') {\r\n // Entry iterators used to provide implicit keys,\r\n // but now we print a separate warning for them later.\r\n if (iteratorFn !== node.entries) {\r\n var iterator = iteratorFn.call(node);\r\n var step;\r\n\r\n while (!(step = iterator.next()).done) {\r\n if (isValidElement(step.value)) {\r\n validateExplicitKey(step.value, parentType);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Given an element, validate that its props follow the propTypes definition,\r\n * provided by the type.\r\n *\r\n * @param {ReactElement} element\r\n */\r\n\r\n\r\nfunction validatePropTypes(element) {\r\n {\r\n var type = element.type;\r\n\r\n if (type === null || type === undefined || typeof type === 'string') {\r\n return;\r\n }\r\n\r\n var propTypes;\r\n\r\n if (typeof type === 'function') {\r\n propTypes = type.propTypes;\r\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\r\n // Inner props are checked in the reconciler.\r\n type.$$typeof === REACT_MEMO_TYPE)) {\r\n propTypes = type.propTypes;\r\n } else {\r\n return;\r\n }\r\n\r\n if (propTypes) {\r\n // Intentionally inside to avoid triggering lazy initializers:\r\n var name = getComponentNameFromType(type);\r\n checkPropTypes(propTypes, element.props, 'prop', name, element);\r\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\r\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\r\n\r\n var _name = getComponentNameFromType(type);\r\n\r\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\r\n }\r\n\r\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\r\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\r\n }\r\n }\r\n}\r\n/**\r\n * Given a fragment, validate that it can only be provided with fragment props\r\n * @param {ReactElement} fragment\r\n */\r\n\r\n\r\nfunction validateFragmentProps(fragment) {\r\n {\r\n var keys = Object.keys(fragment.props);\r\n\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n\r\n if (key !== 'children' && key !== 'key') {\r\n setCurrentlyValidatingElement$1(fragment);\r\n\r\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\r\n\r\n setCurrentlyValidatingElement$1(null);\r\n break;\r\n }\r\n }\r\n\r\n if (fragment.ref !== null) {\r\n setCurrentlyValidatingElement$1(fragment);\r\n\r\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\r\n\r\n setCurrentlyValidatingElement$1(null);\r\n }\r\n }\r\n}\r\nfunction createElementWithValidation(type, props, children) {\r\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\r\n // succeed and there will likely be errors in render.\r\n\r\n if (!validType) {\r\n var info = '';\r\n\r\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\r\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\r\n }\r\n\r\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\r\n\r\n if (sourceInfo) {\r\n info += sourceInfo;\r\n } else {\r\n info += getDeclarationErrorAddendum();\r\n }\r\n\r\n var typeString;\r\n\r\n if (type === null) {\r\n typeString = 'null';\r\n } else if (isArray(type)) {\r\n typeString = 'array';\r\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\r\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\r\n info = ' Did you accidentally export a JSX literal instead of a component?';\r\n } else {\r\n typeString = typeof type;\r\n }\r\n\r\n {\r\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\r\n }\r\n }\r\n\r\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\r\n // TODO: Drop this when these are no longer allowed as the type argument.\r\n\r\n if (element == null) {\r\n return element;\r\n } // Skip key warning if the type isn't valid since our key validation logic\r\n // doesn't expect a non-string/function type and can throw confusing errors.\r\n // We don't want exception behavior to differ between dev and prod.\r\n // (Rendering will throw with a helpful message and as soon as the type is\r\n // fixed, the key warnings will appear.)\r\n\r\n\r\n if (validType) {\r\n for (var i = 2; i < arguments.length; i++) {\r\n validateChildKeys(arguments[i], type);\r\n }\r\n }\r\n\r\n if (type === REACT_FRAGMENT_TYPE) {\r\n validateFragmentProps(element);\r\n } else {\r\n validatePropTypes(element);\r\n }\r\n\r\n return element;\r\n}\r\nvar didWarnAboutDeprecatedCreateFactory = false;\r\nfunction createFactoryWithValidation(type) {\r\n var validatedFactory = createElementWithValidation.bind(null, type);\r\n validatedFactory.type = type;\r\n\r\n {\r\n if (!didWarnAboutDeprecatedCreateFactory) {\r\n didWarnAboutDeprecatedCreateFactory = true;\r\n\r\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\r\n } // Legacy hook: remove it\r\n\r\n\r\n Object.defineProperty(validatedFactory, 'type', {\r\n enumerable: false,\r\n get: function () {\r\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\r\n\r\n Object.defineProperty(this, 'type', {\r\n value: type\r\n });\r\n return type;\r\n }\r\n });\r\n }\r\n\r\n return validatedFactory;\r\n}\r\nfunction cloneElementWithValidation(element, props, children) {\r\n var newElement = cloneElement.apply(this, arguments);\r\n\r\n for (var i = 2; i < arguments.length; i++) {\r\n validateChildKeys(arguments[i], newElement.type);\r\n }\r\n\r\n validatePropTypes(newElement);\r\n return newElement;\r\n}\r\n\r\nfunction startTransition(scope, options) {\r\n var prevTransition = ReactCurrentBatchConfig.transition;\r\n ReactCurrentBatchConfig.transition = {};\r\n var currentTransition = ReactCurrentBatchConfig.transition;\r\n\r\n {\r\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\r\n }\r\n\r\n try {\r\n scope();\r\n } finally {\r\n ReactCurrentBatchConfig.transition = prevTransition;\r\n\r\n {\r\n if (prevTransition === null && currentTransition._updatedFibers) {\r\n var updatedFibersCount = currentTransition._updatedFibers.size;\r\n\r\n if (updatedFibersCount > 10) {\r\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\r\n }\r\n\r\n currentTransition._updatedFibers.clear();\r\n }\r\n }\r\n }\r\n}\r\n\r\nvar didWarnAboutMessageChannel = false;\r\nvar enqueueTaskImpl = null;\r\nfunction enqueueTask(task) {\r\n if (enqueueTaskImpl === null) {\r\n try {\r\n // read require off the module object to get around the bundlers.\r\n // we don't want them to detect a require and bundle a Node polyfill.\r\n var requireString = ('require' + Math.random()).slice(0, 7);\r\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\r\n // version of setImmediate, bypassing fake timers if any.\r\n\r\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\r\n } catch (_err) {\r\n // we're in a browser\r\n // we can't use regular timers because they may still be faked\r\n // so we try MessageChannel+postMessage instead\r\n enqueueTaskImpl = function (callback) {\r\n {\r\n if (didWarnAboutMessageChannel === false) {\r\n didWarnAboutMessageChannel = true;\r\n\r\n if (typeof MessageChannel === 'undefined') {\r\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\r\n }\r\n }\r\n }\r\n\r\n var channel = new MessageChannel();\r\n channel.port1.onmessage = callback;\r\n channel.port2.postMessage(undefined);\r\n };\r\n }\r\n }\r\n\r\n return enqueueTaskImpl(task);\r\n}\r\n\r\nvar actScopeDepth = 0;\r\nvar didWarnNoAwaitAct = false;\r\nfunction act(callback) {\r\n {\r\n // `act` calls can be nested, so we track the depth. This represents the\r\n // number of `act` scopes on the stack.\r\n var prevActScopeDepth = actScopeDepth;\r\n actScopeDepth++;\r\n\r\n if (ReactCurrentActQueue.current === null) {\r\n // This is the outermost `act` scope. Initialize the queue. The reconciler\r\n // will detect the queue and use it instead of Scheduler.\r\n ReactCurrentActQueue.current = [];\r\n }\r\n\r\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\r\n var result;\r\n\r\n try {\r\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\r\n // set to `true` while the given callback is executed, not for updates\r\n // triggered during an async event, because this is how the legacy\r\n // implementation of `act` behaved.\r\n ReactCurrentActQueue.isBatchingLegacy = true;\r\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\r\n // which flushed updates immediately after the scope function exits, even\r\n // if it's an async function.\r\n\r\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\r\n var queue = ReactCurrentActQueue.current;\r\n\r\n if (queue !== null) {\r\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\r\n flushActQueue(queue);\r\n }\r\n }\r\n } catch (error) {\r\n popActScope(prevActScopeDepth);\r\n throw error;\r\n } finally {\r\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\r\n }\r\n\r\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\r\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\r\n // for it to resolve before exiting the current scope.\r\n\r\n var wasAwaited = false;\r\n var thenable = {\r\n then: function (resolve, reject) {\r\n wasAwaited = true;\r\n thenableResult.then(function (returnValue) {\r\n popActScope(prevActScopeDepth);\r\n\r\n if (actScopeDepth === 0) {\r\n // We've exited the outermost act scope. Recursively flush the\r\n // queue until there's no remaining work.\r\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\r\n } else {\r\n resolve(returnValue);\r\n }\r\n }, function (error) {\r\n // The callback threw an error.\r\n popActScope(prevActScopeDepth);\r\n reject(error);\r\n });\r\n }\r\n };\r\n\r\n {\r\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\r\n // eslint-disable-next-line no-undef\r\n Promise.resolve().then(function () {}).then(function () {\r\n if (!wasAwaited) {\r\n didWarnNoAwaitAct = true;\r\n\r\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\r\n }\r\n });\r\n }\r\n }\r\n\r\n return thenable;\r\n } else {\r\n var returnValue = result; // The callback is not an async function. Exit the current scope\r\n // immediately, without awaiting.\r\n\r\n popActScope(prevActScopeDepth);\r\n\r\n if (actScopeDepth === 0) {\r\n // Exiting the outermost act scope. Flush the queue.\r\n var _queue = ReactCurrentActQueue.current;\r\n\r\n if (_queue !== null) {\r\n flushActQueue(_queue);\r\n ReactCurrentActQueue.current = null;\r\n } // Return a thenable. If the user awaits it, we'll flush again in\r\n // case additional work was scheduled by a microtask.\r\n\r\n\r\n var _thenable = {\r\n then: function (resolve, reject) {\r\n // Confirm we haven't re-entered another `act` scope, in case\r\n // the user does something weird like await the thenable\r\n // multiple times.\r\n if (ReactCurrentActQueue.current === null) {\r\n // Recursively flush the queue until there's no remaining work.\r\n ReactCurrentActQueue.current = [];\r\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\r\n } else {\r\n resolve(returnValue);\r\n }\r\n }\r\n };\r\n return _thenable;\r\n } else {\r\n // Since we're inside a nested `act` scope, the returned thenable\r\n // immediately resolves. The outer scope will flush the queue.\r\n var _thenable2 = {\r\n then: function (resolve, reject) {\r\n resolve(returnValue);\r\n }\r\n };\r\n return _thenable2;\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction popActScope(prevActScopeDepth) {\r\n {\r\n if (prevActScopeDepth !== actScopeDepth - 1) {\r\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\r\n }\r\n\r\n actScopeDepth = prevActScopeDepth;\r\n }\r\n}\r\n\r\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\r\n {\r\n var queue = ReactCurrentActQueue.current;\r\n\r\n if (queue !== null) {\r\n try {\r\n flushActQueue(queue);\r\n enqueueTask(function () {\r\n if (queue.length === 0) {\r\n // No additional work was scheduled. Finish.\r\n ReactCurrentActQueue.current = null;\r\n resolve(returnValue);\r\n } else {\r\n // Keep flushing work until there's none left.\r\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\r\n }\r\n });\r\n } catch (error) {\r\n reject(error);\r\n }\r\n } else {\r\n resolve(returnValue);\r\n }\r\n }\r\n}\r\n\r\nvar isFlushing = false;\r\n\r\nfunction flushActQueue(queue) {\r\n {\r\n if (!isFlushing) {\r\n // Prevent re-entrance.\r\n isFlushing = true;\r\n var i = 0;\r\n\r\n try {\r\n for (; i < queue.length; i++) {\r\n var callback = queue[i];\r\n\r\n do {\r\n callback = callback(true);\r\n } while (callback !== null);\r\n }\r\n\r\n queue.length = 0;\r\n } catch (error) {\r\n // If something throws, leave the remaining callbacks on the queue.\r\n queue = queue.slice(i + 1);\r\n throw error;\r\n } finally {\r\n isFlushing = false;\r\n }\r\n }\r\n }\r\n}\r\n\r\nvar createElement$1 = createElementWithValidation ;\r\nvar cloneElement$1 = cloneElementWithValidation ;\r\nvar createFactory = createFactoryWithValidation ;\r\nvar Children = {\r\n map: mapChildren,\r\n forEach: forEachChildren,\r\n count: countChildren,\r\n toArray: toArray,\r\n only: onlyChild\r\n};\r\n\r\nexports.Children = Children;\r\nexports.Component = Component;\r\nexports.Fragment = REACT_FRAGMENT_TYPE;\r\nexports.Profiler = REACT_PROFILER_TYPE;\r\nexports.PureComponent = PureComponent;\r\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\r\nexports.Suspense = REACT_SUSPENSE_TYPE;\r\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\r\nexports.act = act;\r\nexports.cloneElement = cloneElement$1;\r\nexports.createContext = createContext;\r\nexports.createElement = createElement$1;\r\nexports.createFactory = createFactory;\r\nexports.createRef = createRef;\r\nexports.forwardRef = forwardRef;\r\nexports.isValidElement = isValidElement;\r\nexports.lazy = lazy;\r\nexports.memo = memo;\r\nexports.startTransition = startTransition;\r\nexports.unstable_act = act;\r\nexports.useCallback = useCallback;\r\nexports.useContext = useContext;\r\nexports.useDebugValue = useDebugValue;\r\nexports.useDeferredValue = useDeferredValue;\r\nexports.useEffect = useEffect;\r\nexports.useId = useId;\r\nexports.useImperativeHandle = useImperativeHandle;\r\nexports.useInsertionEffect = useInsertionEffect;\r\nexports.useLayoutEffect = useLayoutEffect;\r\nexports.useMemo = useMemo;\r\nexports.useReducer = useReducer;\r\nexports.useRef = useRef;\r\nexports.useState = useState;\r\nexports.useSyncExternalStore = useSyncExternalStore;\r\nexports.useTransition = useTransition;\r\nexports.version = ReactVersion;\r\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\r\nif (\r\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\r\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\r\n 'function'\r\n) {\r\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\r\n}\r\n \r\n })();\r\n}\r\n","'use strict';\r\n\r\nif (process.env.NODE_ENV === 'production') {\r\n module.exports = require('./cjs/react.production.min.js');\r\n} else {\r\n module.exports = require('./cjs/react.development.js');\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaE,EAAC,WAAW;AAEJ;AAGV,MACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,gCACpC,WAEF,gCAA+B,4CAA4B,IAAI,OAAO,CAAC;EAE/D,IAAI,eAAe;EAM7B,IAAI,qBAAqB,OAAO,IAAI,gBAAgB;EACpD,IAAI,oBAAoB,OAAO,IAAI,eAAe;EAClD,IAAI,sBAAsB,OAAO,IAAI,iBAAiB;EACtD,IAAI,yBAAyB,OAAO,IAAI,oBAAoB;EAC5D,IAAI,sBAAsB,OAAO,IAAI,iBAAiB;EACtD,IAAI,sBAAsB,OAAO,IAAI,iBAAiB;EACtD,IAAI,qBAAqB,OAAO,IAAI,gBAAgB;EACpD,IAAI,yBAAyB,OAAO,IAAI,oBAAoB;EAC5D,IAAI,sBAAsB,OAAO,IAAI,iBAAiB;EACtD,IAAI,2BAA2B,OAAO,IAAI,sBAAsB;EAChE,IAAI,kBAAkB,OAAO,IAAI,aAAa;EAC9C,IAAI,kBAAkB,OAAO,IAAI,aAAa;EAC9C,IAAI,uBAAuB,OAAO,IAAI,kBAAkB;EACxD,IAAI,wBAAwB,OAAO;EACnC,IAAI,uBAAuB;EAC3B,SAAS,cAAc,eAAe;AACpC,OAAI,kBA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leted file mode 100644 index c25b5b89..00000000 --- a/Frontend/node_modules/.vite/deps/react-dom-BTcKy37o.js +++ /dev/null @@ -1,17262 +0,0 @@ -import { n as __commonJSMin, t as require_react } from "./react-Dayigfg7.js"; -//#region node_modules/scheduler/cjs/scheduler.development.js -/** -* @license React -* scheduler.development.js -* -* Copyright (c) Facebook, Inc. and its affiliates. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ -var require_scheduler_development = /* @__PURE__ */ __commonJSMin(((exports) => { - (function() { - "use strict"; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(/* @__PURE__ */ new Error()); - var enableSchedulerDebugging = false; - var enableProfiling = false; - var frameYieldMs = 5; - function push(heap, node) { - var index = heap.length; - heap.push(node); - siftUp(heap, node, index); - } - function peek(heap) { - return heap.length === 0 ? null : heap[0]; - } - function pop(heap) { - if (heap.length === 0) return null; - var first = heap[0]; - var last = heap.pop(); - if (last !== first) { - heap[0] = last; - siftDown(heap, last, 0); - } - return first; - } - function siftUp(heap, node, i) { - var index = i; - while (index > 0) { - var parentIndex = index - 1 >>> 1; - var parent = heap[parentIndex]; - if (compare(parent, node) > 0) { - heap[parentIndex] = node; - heap[index] = parent; - index = parentIndex; - } else return; - } - } - function siftDown(heap, node, i) { - var index = i; - var length = heap.length; - var halfLength = length >>> 1; - while (index < halfLength) { - var leftIndex = (index + 1) * 2 - 1; - var left = heap[leftIndex]; - var rightIndex = leftIndex + 1; - var right = heap[rightIndex]; - if (compare(left, node) < 0) if (rightIndex < length && compare(right, left) < 0) { - heap[index] = right; - heap[rightIndex] = node; - index = rightIndex; - } else { - heap[index] = left; - heap[leftIndex] = node; - index = leftIndex; - } - else if (rightIndex < length && compare(right, node) < 0) { - heap[index] = right; - heap[rightIndex] = node; - index = rightIndex; - } else return; - } - } - function compare(a, b) { - var diff = a.sortIndex - b.sortIndex; - return diff !== 0 ? diff : a.id - b.id; - } - var ImmediatePriority = 1; - var UserBlockingPriority = 2; - var NormalPriority = 3; - var LowPriority = 4; - var IdlePriority = 5; - function markTaskErrored(task, ms) {} - if (typeof performance === "object" && typeof performance.now === "function") { - var localPerformance = performance; - exports.unstable_now = function() { - return localPerformance.now(); - }; - } else { - var localDate = Date; - var initialTime = localDate.now(); - exports.unstable_now = function() { - return localDate.now() - initialTime; - }; - } - var maxSigned31BitInt = 1073741823; - var IMMEDIATE_PRIORITY_TIMEOUT = -1; - var USER_BLOCKING_PRIORITY_TIMEOUT = 250; - var NORMAL_PRIORITY_TIMEOUT = 5e3; - var LOW_PRIORITY_TIMEOUT = 1e4; - var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; - var taskQueue = []; - var timerQueue = []; - var taskIdCounter = 1; - var currentTask = null; - var currentPriorityLevel = NormalPriority; - var isPerformingWork = false; - var isHostCallbackScheduled = false; - var isHostTimeoutScheduled = false; - var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null; - var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null; - var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null; - typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); - function advanceTimers(currentTime) { - var timer = peek(timerQueue); - while (timer !== null) { - if (timer.callback === null) pop(timerQueue); - else if (timer.startTime <= currentTime) { - pop(timerQueue); - timer.sortIndex = timer.expirationTime; - push(taskQueue, timer); - } else return; - timer = peek(timerQueue); - } - } - function handleTimeout(currentTime) { - isHostTimeoutScheduled = false; - advanceTimers(currentTime); - if (!isHostCallbackScheduled) if (peek(taskQueue) !== null) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } else { - var firstTimer = peek(timerQueue); - if (firstTimer !== null) requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); - } - } - function flushWork(hasTimeRemaining, initialTime) { - isHostCallbackScheduled = false; - if (isHostTimeoutScheduled) { - isHostTimeoutScheduled = false; - cancelHostTimeout(); - } - isPerformingWork = true; - var previousPriorityLevel = currentPriorityLevel; - try { - if (enableProfiling) try { - return workLoop(hasTimeRemaining, initialTime); - } catch (error) { - if (currentTask !== null) { - var currentTime = exports.unstable_now(); - markTaskErrored(currentTask, currentTime); - currentTask.isQueued = false; - } - throw error; - } - else return workLoop(hasTimeRemaining, initialTime); - } finally { - currentTask = null; - currentPriorityLevel = previousPriorityLevel; - isPerformingWork = false; - } - } - function workLoop(hasTimeRemaining, initialTime) { - var currentTime = initialTime; - advanceTimers(currentTime); - currentTask = peek(taskQueue); - while (currentTask !== null && !enableSchedulerDebugging) { - if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) break; - var callback = currentTask.callback; - if (typeof callback === "function") { - currentTask.callback = null; - currentPriorityLevel = currentTask.priorityLevel; - var continuationCallback = callback(currentTask.expirationTime <= currentTime); - currentTime = exports.unstable_now(); - if (typeof continuationCallback === "function") currentTask.callback = continuationCallback; - else if (currentTask === peek(taskQueue)) pop(taskQueue); - advanceTimers(currentTime); - } else pop(taskQueue); - currentTask = peek(taskQueue); - } - if (currentTask !== null) return true; - else { - var firstTimer = peek(timerQueue); - if (firstTimer !== null) requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); - return false; - } - } - function unstable_runWithPriority(priorityLevel, eventHandler) { - switch (priorityLevel) { - case ImmediatePriority: - case UserBlockingPriority: - case NormalPriority: - case LowPriority: - case IdlePriority: break; - default: priorityLevel = NormalPriority; - } - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = priorityLevel; - try { - return eventHandler(); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - } - function unstable_next(eventHandler) { - var priorityLevel; - switch (currentPriorityLevel) { - case ImmediatePriority: - case UserBlockingPriority: - case NormalPriority: - priorityLevel = NormalPriority; - break; - default: - priorityLevel = currentPriorityLevel; - break; - } - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = priorityLevel; - try { - return eventHandler(); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - } - function unstable_wrapCallback(callback) { - var parentPriorityLevel = currentPriorityLevel; - return function() { - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = parentPriorityLevel; - try { - return callback.apply(this, arguments); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - }; - } - function unstable_scheduleCallback(priorityLevel, callback, options) { - var currentTime = exports.unstable_now(); - var startTime; - if (typeof options === "object" && options !== null) { - var delay = options.delay; - if (typeof delay === "number" && delay > 0) startTime = currentTime + delay; - else startTime = currentTime; - } else startTime = currentTime; - var timeout; - switch (priorityLevel) { - case ImmediatePriority: - timeout = IMMEDIATE_PRIORITY_TIMEOUT; - break; - case UserBlockingPriority: - timeout = USER_BLOCKING_PRIORITY_TIMEOUT; - break; - case IdlePriority: - timeout = IDLE_PRIORITY_TIMEOUT; - break; - case LowPriority: - timeout = LOW_PRIORITY_TIMEOUT; - break; - case NormalPriority: - default: - timeout = NORMAL_PRIORITY_TIMEOUT; - break; - } - var expirationTime = startTime + timeout; - var newTask = { - id: taskIdCounter++, - callback, - priorityLevel, - startTime, - expirationTime, - sortIndex: -1 - }; - if (startTime > currentTime) { - newTask.sortIndex = startTime; - push(timerQueue, newTask); - if (peek(taskQueue) === null && newTask === peek(timerQueue)) { - if (isHostTimeoutScheduled) cancelHostTimeout(); - else isHostTimeoutScheduled = true; - requestHostTimeout(handleTimeout, startTime - currentTime); - } - } else { - newTask.sortIndex = expirationTime; - push(taskQueue, newTask); - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } - } - return newTask; - } - function unstable_pauseExecution() {} - function unstable_continueExecution() { - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } - } - function unstable_getFirstCallbackNode() { - return peek(taskQueue); - } - function unstable_cancelCallback(task) { - task.callback = null; - } - function unstable_getCurrentPriorityLevel() { - return currentPriorityLevel; - } - var isMessageLoopRunning = false; - var scheduledHostCallback = null; - var taskTimeoutID = -1; - var frameInterval = frameYieldMs; - var startTime = -1; - function shouldYieldToHost() { - if (exports.unstable_now() - startTime < frameInterval) return false; - return true; - } - function requestPaint() {} - function forceFrameRate(fps) { - if (fps < 0 || fps > 125) { - console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); - return; - } - if (fps > 0) frameInterval = Math.floor(1e3 / fps); - else frameInterval = frameYieldMs; - } - var performWorkUntilDeadline = function() { - if (scheduledHostCallback !== null) { - var currentTime = exports.unstable_now(); - startTime = currentTime; - var hasTimeRemaining = true; - var hasMoreWork = true; - try { - hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); - } finally { - if (hasMoreWork) schedulePerformWorkUntilDeadline(); - else { - isMessageLoopRunning = false; - scheduledHostCallback = null; - } - } - } else isMessageLoopRunning = false; - }; - var schedulePerformWorkUntilDeadline; - if (typeof localSetImmediate === "function") schedulePerformWorkUntilDeadline = function() { - localSetImmediate(performWorkUntilDeadline); - }; - else if (typeof MessageChannel !== "undefined") { - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = performWorkUntilDeadline; - schedulePerformWorkUntilDeadline = function() { - port.postMessage(null); - }; - } else schedulePerformWorkUntilDeadline = function() { - localSetTimeout(performWorkUntilDeadline, 0); - }; - function requestHostCallback(callback) { - scheduledHostCallback = callback; - if (!isMessageLoopRunning) { - isMessageLoopRunning = true; - schedulePerformWorkUntilDeadline(); - } - } - function requestHostTimeout(callback, ms) { - taskTimeoutID = localSetTimeout(function() { - callback(exports.unstable_now()); - }, ms); - } - function cancelHostTimeout() { - localClearTimeout(taskTimeoutID); - taskTimeoutID = -1; - } - var unstable_requestPaint = requestPaint; - var unstable_Profiling = null; - exports.unstable_IdlePriority = IdlePriority; - exports.unstable_ImmediatePriority = ImmediatePriority; - exports.unstable_LowPriority = LowPriority; - exports.unstable_NormalPriority = NormalPriority; - exports.unstable_Profiling = unstable_Profiling; - exports.unstable_UserBlockingPriority = UserBlockingPriority; - exports.unstable_cancelCallback = unstable_cancelCallback; - exports.unstable_continueExecution = unstable_continueExecution; - exports.unstable_forceFrameRate = forceFrameRate; - exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; - exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; - exports.unstable_next = unstable_next; - exports.unstable_pauseExecution = unstable_pauseExecution; - exports.unstable_requestPaint = unstable_requestPaint; - exports.unstable_runWithPriority = unstable_runWithPriority; - exports.unstable_scheduleCallback = unstable_scheduleCallback; - exports.unstable_shouldYield = shouldYieldToHost; - exports.unstable_wrapCallback = unstable_wrapCallback; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(/* @__PURE__ */ new Error()); - })(); -})); -//#endregion -//#region node_modules/scheduler/index.js -var require_scheduler = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = require_scheduler_development(); -})); -//#endregion -//#region node_modules/react-dom/cjs/react-dom.development.js -/** -* @license React -* react-dom.development.js -* -* Copyright (c) Facebook, Inc. and its affiliates. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ -var require_react_dom_development = /* @__PURE__ */ __commonJSMin(((exports) => { - (function() { - "use strict"; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(/* @__PURE__ */ new Error()); - var React = require_react(); - var Scheduler = require_scheduler(); - var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - var suppressWarning = false; - function setSuppressWarning(newSuppressWarning) { - suppressWarning = newSuppressWarning; - } - function warn(format) { - if (!suppressWarning) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; - printWarning("warn", format, args); - } - } - function error(format) { - if (!suppressWarning) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2]; - printWarning("error", format, args); - } - } - function printWarning(level, format, args) { - var stack = ReactSharedInternals.ReactDebugCurrentFrame.getStackAddendum(); - if (stack !== "") { - format += "%s"; - args = args.concat([stack]); - } - var argsWithFormat = args.map(function(item) { - return String(item); - }); - argsWithFormat.unshift("Warning: " + format); - Function.prototype.apply.call(console[level], console, argsWithFormat); - } - var FunctionComponent = 0; - var ClassComponent = 1; - var IndeterminateComponent = 2; - var HostRoot = 3; - var HostPortal = 4; - var HostComponent = 5; - var HostText = 6; - var Fragment = 7; - var Mode = 8; - var ContextConsumer = 9; - var ContextProvider = 10; - var ForwardRef = 11; - var Profiler = 12; - var SuspenseComponent = 13; - var MemoComponent = 14; - var SimpleMemoComponent = 15; - var LazyComponent = 16; - var IncompleteClassComponent = 17; - var DehydratedFragment = 18; - var SuspenseListComponent = 19; - var ScopeComponent = 21; - var OffscreenComponent = 22; - var LegacyHiddenComponent = 23; - var CacheComponent = 24; - var TracingMarkerComponent = 25; - var enableClientRenderFallbackOnTextMismatch = true; - var enableNewReconciler = false; - var enableLazyContextPropagation = false; - var enableLegacyHidden = false; - var enableSuspenseAvoidThisFallback = false; - var disableCommentsAsDOMContainers = true; - var enableCustomElementPropertySupport = false; - var warnAboutStringRefs = true; - var enableSchedulingProfiler = true; - var enableProfilerTimer = true; - var enableProfilerCommitHooks = true; - var allNativeEvents = /* @__PURE__ */ new Set(); - /** - * Mapping from registration name to event name - */ - var registrationNameDependencies = {}; - /** - * Mapping from lowercase registration names to the properly cased version, - * used to warn in the case of missing event handlers. Available - * only in true. - * @type {Object} - */ - var possibleRegistrationNames = {}; - function registerTwoPhaseEvent(registrationName, dependencies) { - registerDirectEvent(registrationName, dependencies); - registerDirectEvent(registrationName + "Capture", dependencies); - } - function registerDirectEvent(registrationName, dependencies) { - if (registrationNameDependencies[registrationName]) error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName); - registrationNameDependencies[registrationName] = dependencies; - var lowerCasedName = registrationName.toLowerCase(); - possibleRegistrationNames[lowerCasedName] = registrationName; - if (registrationName === "onDoubleClick") possibleRegistrationNames.ondblclick = registrationName; - for (var i = 0; i < dependencies.length; i++) allNativeEvents.add(dependencies[i]); - } - var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); - var hasOwnProperty = Object.prototype.hasOwnProperty; - function typeName(value) { - return typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; - } - function willCoercionThrow(value) { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } - function testStringCoercion(value) { - return "" + value; - } - function checkAttributeStringCoercion(value, attributeName) { - if (willCoercionThrow(value)) { - error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value)); - return testStringCoercion(value); - } - } - function checkKeyStringCoercion(value) { - if (willCoercionThrow(value)) { - error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - function checkPropStringCoercion(value, propName) { - if (willCoercionThrow(value)) { - error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); - return testStringCoercion(value); - } - } - function checkCSSPropertyStringCoercion(value, propName) { - if (willCoercionThrow(value)) { - error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); - return testStringCoercion(value); - } - } - function checkHtmlStringCoercion(value) { - if (willCoercionThrow(value)) { - error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - function checkFormFieldValueStringCoercion(value) { - if (willCoercionThrow(value)) { - error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value)); - return testStringCoercion(value); - } - } - var RESERVED = 0; - var STRING = 1; - var BOOLEANISH_STRING = 2; - var BOOLEAN = 3; - var OVERLOADED_BOOLEAN = 4; - var NUMERIC = 5; - var POSITIVE_NUMERIC = 6; - var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"); - var illegalAttributeNameCache = {}; - var validatedAttributeNameCache = {}; - function isAttributeNameSafe(attributeName) { - if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) return true; - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return false; - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - illegalAttributeNameCache[attributeName] = true; - error("Invalid attribute name: `%s`", attributeName); - return false; - } - function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null) return propertyInfo.type === RESERVED; - if (isCustomComponentTag) return false; - if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) return true; - return false; - } - function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null && propertyInfo.type === RESERVED) return false; - switch (typeof value) { - case "function": - case "symbol": return true; - case "boolean": - if (isCustomComponentTag) return false; - if (propertyInfo !== null) return !propertyInfo.acceptsBooleans; - else { - var prefix = name.toLowerCase().slice(0, 5); - return prefix !== "data-" && prefix !== "aria-"; - } - default: return false; - } - } - function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { - if (value === null || typeof value === "undefined") return true; - if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) return true; - if (isCustomComponentTag) return false; - if (propertyInfo !== null) switch (propertyInfo.type) { - case BOOLEAN: return !value; - case OVERLOADED_BOOLEAN: return value === false; - case NUMERIC: return isNaN(value); - case POSITIVE_NUMERIC: return isNaN(value) || value < 1; - } - return false; - } - function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; - } - function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; - this.attributeName = attributeName; - this.attributeNamespace = attributeNamespace; - this.mustUseProperty = mustUseProperty; - this.propertyName = name; - this.type = type; - this.sanitizeURL = sanitizeURL; - this.removeEmptyString = removeEmptyString; - } - var properties = {}; - [ - "children", - "dangerouslySetInnerHTML", - "defaultValue", - "defaultChecked", - "innerHTML", - "suppressContentEditableWarning", - "suppressHydrationWarning", - "style" - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, RESERVED, false, name, null, false, false); - }); - [ - ["acceptCharset", "accept-charset"], - ["className", "class"], - ["htmlFor", "for"], - ["httpEquiv", "http-equiv"] - ].forEach(function(_ref) { - var name = _ref[0], attributeName = _ref[1]; - properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false); - }); - [ - "contentEditable", - "draggable", - "spellCheck", - "value" - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name.toLowerCase(), null, false, false); - }); - [ - "autoReverse", - "externalResourcesRequired", - "focusable", - "preserveAlpha" - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name, null, false, false); - }); - [ - "allowFullScreen", - "async", - "autoFocus", - "autoPlay", - "controls", - "default", - "defer", - "disabled", - "disablePictureInPicture", - "disableRemotePlayback", - "formNoValidate", - "hidden", - "loop", - "noModule", - "noValidate", - "open", - "playsInline", - "readOnly", - "required", - "reversed", - "scoped", - "seamless", - "itemScope" - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, name.toLowerCase(), null, false, false); - }); - [ - "checked", - "multiple", - "muted", - "selected" - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, name, null, false, false); - }); - ["capture", "download"].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, name, null, false, false); - }); - [ - "cols", - "rows", - "size", - "span" - ].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, name, null, false, false); - }); - ["rowSpan", "start"].forEach(function(name) { - properties[name] = new PropertyInfoRecord(name, NUMERIC, false, name.toLowerCase(), null, false, false); - }); - var CAMELIZE = /[\-\:]([a-z])/g; - var capitalize = function(token) { - return token[1].toUpperCase(); - }; - [ - "accent-height", - "alignment-baseline", - "arabic-form", - "baseline-shift", - "cap-height", - "clip-path", - "clip-rule", - "color-interpolation", - "color-interpolation-filters", - "color-profile", - "color-rendering", - "dominant-baseline", - "enable-background", - "fill-opacity", - "fill-rule", - "flood-color", - "flood-opacity", - "font-family", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-variant", - "font-weight", - "glyph-name", - "glyph-orientation-horizontal", - "glyph-orientation-vertical", - "horiz-adv-x", - "horiz-origin-x", - "image-rendering", - "letter-spacing", - "lighting-color", - "marker-end", - "marker-mid", - "marker-start", - "overline-position", - "overline-thickness", - "paint-order", - "panose-1", - "pointer-events", - "rendering-intent", - "shape-rendering", - "stop-color", - "stop-opacity", - "strikethrough-position", - "strikethrough-thickness", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "text-anchor", - "text-decoration", - "text-rendering", - "underline-position", - "underline-thickness", - "unicode-bidi", - "unicode-range", - "units-per-em", - "v-alphabetic", - "v-hanging", - "v-ideographic", - "v-mathematical", - "vector-effect", - "vert-adv-y", - "vert-origin-x", - "vert-origin-y", - "word-spacing", - "writing-mode", - "xmlns:xlink", - "x-height" - ].forEach(function(attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false); - }); - [ - "xlink:actuate", - "xlink:arcrole", - "xlink:role", - "xlink:show", - "xlink:title", - "xlink:type" - ].forEach(function(attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/1999/xlink", false, false); - }); - [ - "xml:base", - "xml:lang", - "xml:space" - ].forEach(function(attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/XML/1998/namespace", false, false); - }); - ["tabIndex", "crossOrigin"].forEach(function(attributeName) { - properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, false, false); - }); - var xlinkHref = "xlinkHref"; - properties[xlinkHref] = new PropertyInfoRecord("xlinkHref", STRING, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); - [ - "src", - "href", - "action", - "formAction" - ].forEach(function(attributeName) { - properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, true, true); - }); - var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; - var didWarn = false; - function sanitizeURL(url) { - if (!didWarn && isJavaScriptProtocol.test(url)) { - didWarn = true; - error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url)); - } - } - /** - * Get the value for a property on a node. Only used in DEV for SSR validation. - * The "expected" argument is used as a hint of what the expected value is. - * Some properties have multiple equivalent values. - */ - function getValueForProperty(node, name, expected, propertyInfo) { - if (propertyInfo.mustUseProperty) return node[propertyInfo.propertyName]; - else { - checkAttributeStringCoercion(expected, name); - if (propertyInfo.sanitizeURL) sanitizeURL("" + expected); - var attributeName = propertyInfo.attributeName; - var stringValue = null; - if (propertyInfo.type === OVERLOADED_BOOLEAN) { - if (node.hasAttribute(attributeName)) { - var value = node.getAttribute(attributeName); - if (value === "") return true; - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) return value; - if (value === "" + expected) return expected; - return value; - } - } else if (node.hasAttribute(attributeName)) { - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) return node.getAttribute(attributeName); - if (propertyInfo.type === BOOLEAN) return expected; - stringValue = node.getAttribute(attributeName); - } - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) return stringValue === null ? expected : stringValue; - else if (stringValue === "" + expected) return expected; - else return stringValue; - } - } - /** - * Get the value for a attribute on a node. Only used in DEV for SSR validation. - * The third argument is used as a hint of what the expected value is. Some - * attributes have multiple equivalent values. - */ - function getValueForAttribute(node, name, expected, isCustomComponentTag) { - if (!isAttributeNameSafe(name)) return; - if (!node.hasAttribute(name)) return expected === void 0 ? void 0 : null; - var value = node.getAttribute(name); - checkAttributeStringCoercion(expected, name); - if (value === "" + expected) return expected; - return value; - } - /** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ - function setValueForProperty(node, name, value, isCustomComponentTag) { - var propertyInfo = getPropertyInfo(name); - if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) return; - if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) value = null; - if (isCustomComponentTag || propertyInfo === null) { - if (isAttributeNameSafe(name)) { - var _attributeName = name; - if (value === null) node.removeAttribute(_attributeName); - else { - checkAttributeStringCoercion(value, name); - node.setAttribute(_attributeName, "" + value); - } - } - return; - } - if (propertyInfo.mustUseProperty) { - var propertyName = propertyInfo.propertyName; - if (value === null) node[propertyName] = propertyInfo.type === BOOLEAN ? false : ""; - else node[propertyName] = value; - return; - } - var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace; - if (value === null) node.removeAttribute(attributeName); - else { - var _type = propertyInfo.type; - var attributeValue; - if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) attributeValue = ""; - else { - checkAttributeStringCoercion(value, attributeName); - attributeValue = "" + value; - if (propertyInfo.sanitizeURL) sanitizeURL(attributeValue.toString()); - } - if (attributeNamespace) node.setAttributeNS(attributeNamespace, attributeName, attributeValue); - else node.setAttribute(attributeName, attributeValue); - } - } - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_SCOPE_TYPE = Symbol.for("react.scope"); - var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); - var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); - var REACT_CACHE_TYPE = Symbol.for("react.cache"); - var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") return null; - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof maybeIterator === "function") return maybeIterator; - return null; - } - var assign = Object.assign; - var disabledDepth = 0; - var prevLog; - var prevInfo; - var prevWarn; - var prevError; - var prevGroup; - var prevGroupCollapsed; - var prevGroupEnd; - function disabledLog() {} - disabledLog.__reactDisabledLog = true; - function disableLogs() { - if (disabledDepth === 0) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (disabledDepth === 0) { - var props = { - configurable: true, - enumerable: true, - writable: true - }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - if (disabledDepth < 0) error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); - } - var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, source, ownerFn) { - if (prefix === void 0) try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ""; - } - return "\n" + prefix + name; - } - var reentry = false; - var componentFrameCache = new (typeof WeakMap === "function" ? WeakMap : Map)(); - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (frame !== void 0) return frame; - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = ReactCurrentDispatcher.current; - ReactCurrentDispatcher.current = null; - disableLogs(); - try { - if (construct) { - var Fake = function() { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { set: function() { - throw Error(); - } }); - if (typeof Reflect === "object" && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - fn(); - } - } catch (sample) { - if (sample && control && typeof sample.stack === "string") { - var sampleLines = sample.stack.split("\n"); - var controlLines = control.stack.split("\n"); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) c--; - for (; s >= 1 && c >= 0; s--, c--) if (sampleLines[s] !== controlLines[c]) { - if (s !== 1 || c !== 1) do { - s--; - c--; - if (c < 0 || sampleLines[s] !== controlLines[c]) { - var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); - if (fn.displayName && _frame.includes("")) _frame = _frame.replace("", fn.displayName); - if (typeof fn === "function") componentFrameCache.set(fn, _frame); - return _frame; - } - } while (s >= 1 && c >= 0); - break; - } - } - } finally { - reentry = false; - ReactCurrentDispatcher.current = previousDispatcher; - reenableLogs(); - Error.prepareStackTrace = previousPrepareStackTrace; - } - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - if (typeof fn === "function") componentFrameCache.set(fn, syntheticFrame); - return syntheticFrame; - } - function describeClassComponentFrame(ctor, source, ownerFn) { - return describeNativeComponentFrame(ctor, true); - } - function describeFunctionComponentFrame(fn, source, ownerFn) { - return describeNativeComponentFrame(fn, false); - } - function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); - } - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - if (type == null) return ""; - if (typeof type === "function") return describeNativeComponentFrame(type, shouldConstruct(type)); - if (typeof type === "string") return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); - } - if (typeof type === "object") switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); - case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_LAZY_TYPE: - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) {} - } - return ""; - } - function describeFiber(fiber) { - fiber._debugOwner && fiber._debugOwner.type; - fiber._debugSource; - switch (fiber.tag) { - case HostComponent: return describeBuiltInComponentFrame(fiber.type); - case LazyComponent: return describeBuiltInComponentFrame("Lazy"); - case SuspenseComponent: return describeBuiltInComponentFrame("Suspense"); - case SuspenseListComponent: return describeBuiltInComponentFrame("SuspenseList"); - case FunctionComponent: - case IndeterminateComponent: - case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); - case ForwardRef: return describeFunctionComponentFrame(fiber.type.render); - case ClassComponent: return describeClassComponentFrame(fiber.type); - default: return ""; - } - } - function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = ""; - var node = workInProgress; - do { - info += describeFiber(node); - node = node.return; - } while (node); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } - function getWrappedName(outerType, innerType, wrapperName) { - var displayName = outerType.displayName; - if (displayName) return displayName; - var functionName = innerType.displayName || innerType.name || ""; - return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; - } - function getContextName(type) { - return type.displayName || "Context"; - } - function getComponentNameFromType(type) { - if (type == null) return null; - if (typeof type.tag === "number") error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); - if (typeof type === "function") return type.displayName || type.name || null; - if (typeof type === "string") return type; - switch (type) { - case REACT_FRAGMENT_TYPE: return "Fragment"; - case REACT_PORTAL_TYPE: return "Portal"; - case REACT_PROFILER_TYPE: return "Profiler"; - case REACT_STRICT_MODE_TYPE: return "StrictMode"; - case REACT_SUSPENSE_TYPE: return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; - } - if (typeof type === "object") switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: return getContextName(type) + ".Consumer"; - case REACT_PROVIDER_TYPE: return getContextName(type._context) + ".Provider"; - case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); - case REACT_MEMO_TYPE: - var outerName = type.displayName || null; - if (outerName !== null) return outerName; - return getComponentNameFromType(type.type) || "Memo"; - case REACT_LAZY_TYPE: - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return getComponentNameFromType(init(payload)); - } catch (x) { - return null; - } - } - return null; - } - function getWrappedName$1(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ""; - return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); - } - function getContextName$1(type) { - return type.displayName || "Context"; - } - function getComponentNameFromFiber(fiber) { - var tag = fiber.tag, type = fiber.type; - switch (tag) { - case CacheComponent: return "Cache"; - case ContextConsumer: return getContextName$1(type) + ".Consumer"; - case ContextProvider: return getContextName$1(type._context) + ".Provider"; - case DehydratedFragment: return "DehydratedFragment"; - case ForwardRef: return getWrappedName$1(type, type.render, "ForwardRef"); - case Fragment: return "Fragment"; - case HostComponent: return type; - case HostPortal: return "Portal"; - case HostRoot: return "Root"; - case HostText: return "Text"; - case LazyComponent: return getComponentNameFromType(type); - case Mode: - if (type === REACT_STRICT_MODE_TYPE) return "StrictMode"; - return "Mode"; - case OffscreenComponent: return "Offscreen"; - case Profiler: return "Profiler"; - case ScopeComponent: return "Scope"; - case SuspenseComponent: return "Suspense"; - case SuspenseListComponent: return "SuspenseList"; - case TracingMarkerComponent: return "TracingMarker"; - case ClassComponent: - case FunctionComponent: - case IncompleteClassComponent: - case IndeterminateComponent: - case MemoComponent: - case SimpleMemoComponent: - if (typeof type === "function") return type.displayName || type.name || null; - if (typeof type === "string") return type; - break; - } - return null; - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var current = null; - var isRendering = false; - function getCurrentFiberOwnerNameInDevOrNull() { - if (current === null) return null; - var owner = current._debugOwner; - if (owner !== null && typeof owner !== "undefined") return getComponentNameFromFiber(owner); - return null; - } - function getCurrentFiberStackInDev() { - if (current === null) return ""; - return getStackByFiberInDevAndProd(current); - } - function resetCurrentFiber() { - ReactDebugCurrentFrame.getCurrentStack = null; - current = null; - isRendering = false; - } - function setCurrentFiber(fiber) { - ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; - current = fiber; - isRendering = false; - } - function getCurrentFiber() { - return current; - } - function setIsRendering(rendering) { - isRendering = rendering; - } - function toString(value) { - return "" + value; - } - function getToStringValue(value) { - switch (typeof value) { - case "boolean": - case "number": - case "string": - case "undefined": return value; - case "object": - checkFormFieldValueStringCoercion(value); - return value; - default: return ""; - } - } - var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true - }; - function checkControlledValueProps(tagName, props) { - if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."); - if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."); - } - function isCheckable(elem) { - var type = elem.type; - var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio"); - } - function getTracker(node) { - return node._valueTracker; - } - function detachTracker(node) { - node._valueTracker = null; - } - function getValueFromNode(node) { - var value = ""; - if (!node) return value; - if (isCheckable(node)) value = node.checked ? "true" : "false"; - else value = node.value; - return value; - } - function trackValueOnNode(node) { - var valueField = isCheckable(node) ? "checked" : "value"; - var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); - checkFormFieldValueStringCoercion(node[valueField]); - var currentValue = "" + node[valueField]; - if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") return; - var get = descriptor.get, set = descriptor.set; - Object.defineProperty(node, valueField, { - configurable: true, - get: function() { - return get.call(this); - }, - set: function(value) { - checkFormFieldValueStringCoercion(value); - currentValue = "" + value; - set.call(this, value); - } - }); - Object.defineProperty(node, valueField, { enumerable: descriptor.enumerable }); - return { - getValue: function() { - return currentValue; - }, - setValue: function(value) { - checkFormFieldValueStringCoercion(value); - currentValue = "" + value; - }, - stopTracking: function() { - detachTracker(node); - delete node[valueField]; - } - }; - } - function track(node) { - if (getTracker(node)) return; - node._valueTracker = trackValueOnNode(node); - } - function updateValueIfChanged(node) { - if (!node) return false; - var tracker = getTracker(node); - if (!tracker) return true; - var lastValue = tracker.getValue(); - var nextValue = getValueFromNode(node); - if (nextValue !== lastValue) { - tracker.setValue(nextValue); - return true; - } - return false; - } - function getActiveElement(doc) { - doc = doc || (typeof document !== "undefined" ? document : void 0); - if (typeof doc === "undefined") return null; - try { - return doc.activeElement || doc.body; - } catch (e) { - return doc.body; - } - } - var didWarnValueDefaultValue = false; - var didWarnCheckedDefaultChecked = false; - var didWarnControlledToUncontrolled = false; - var didWarnUncontrolledToControlled = false; - function isControlled(props) { - return props.type === "checkbox" || props.type === "radio" ? props.checked != null : props.value != null; - } - /** - * Implements an host component that allows setting these optional - * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. - * - * If `checked` or `value` are not supplied (or null/undefined), user actions - * that affect the checked state or value will trigger updates to the element. - * - * If they are supplied (and not null/undefined), the rendered element will not - * trigger updates to the element. Instead, the props must change in order for - * the rendered element to be updated. - * - * The rendered element will be initialized as unchecked (or `defaultChecked`) - * with an empty value (or `defaultValue`). - * - * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html - */ - function getHostProps(element, props) { - var node = element; - var checked = props.checked; - return assign({}, props, { - defaultChecked: void 0, - defaultValue: void 0, - value: void 0, - checked: checked != null ? checked : node._wrapperState.initialChecked - }); - } - function initWrapperState(element, props) { - checkControlledValueProps("input", props); - if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) { - error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); - didWarnCheckedDefaultChecked = true; - } - if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) { - error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); - didWarnValueDefaultValue = true; - } - var node = element; - var defaultValue = props.defaultValue == null ? "" : props.defaultValue; - node._wrapperState = { - initialChecked: props.checked != null ? props.checked : props.defaultChecked, - initialValue: getToStringValue(props.value != null ? props.value : defaultValue), - controlled: isControlled(props) - }; - } - function updateChecked(element, props) { - var node = element; - var checked = props.checked; - if (checked != null) setValueForProperty(node, "checked", checked, false); - } - function updateWrapper(element, props) { - var node = element; - var controlled = isControlled(props); - if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { - error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); - didWarnUncontrolledToControlled = true; - } - if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { - error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); - didWarnControlledToUncontrolled = true; - } - updateChecked(element, props); - var value = getToStringValue(props.value); - var type = props.type; - if (value != null) { - if (type === "number") { - if (value === 0 && node.value === "" || node.value != value) node.value = toString(value); - } else if (node.value !== toString(value)) node.value = toString(value); - } else if (type === "submit" || type === "reset") { - node.removeAttribute("value"); - return; - } - if (props.hasOwnProperty("value")) setDefaultValue(node, props.type, value); - else if (props.hasOwnProperty("defaultValue")) setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); - if (props.checked == null && props.defaultChecked != null) node.defaultChecked = !!props.defaultChecked; - } - function postMountWrapper(element, props, isHydrating) { - var node = element; - if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) { - var type = props.type; - if ((type === "submit" || type === "reset") && (props.value === void 0 || props.value === null)) return; - var initialValue = toString(node._wrapperState.initialValue); - if (!isHydrating) { - if (initialValue !== node.value) node.value = initialValue; - } - node.defaultValue = initialValue; - } - var name = node.name; - if (name !== "") node.name = ""; - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !!node._wrapperState.initialChecked; - if (name !== "") node.name = name; - } - function restoreControlledState(element, props) { - var node = element; - updateWrapper(node, props); - updateNamedCousins(node, props); - } - function updateNamedCousins(rootNode, props) { - var name = props.name; - if (props.type === "radio" && name != null) { - var queryRoot = rootNode; - while (queryRoot.parentNode) queryRoot = queryRoot.parentNode; - checkAttributeStringCoercion(name, "name"); - var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + "][type=\"radio\"]"); - for (var i = 0; i < group.length; i++) { - var otherNode = group[i]; - if (otherNode === rootNode || otherNode.form !== rootNode.form) continue; - var otherProps = getFiberCurrentPropsFromNode(otherNode); - if (!otherProps) throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); - updateValueIfChanged(otherNode); - updateWrapper(otherNode, otherProps); - } - } - } - function setDefaultValue(node, type, value) { - if (type !== "number" || getActiveElement(node.ownerDocument) !== node) { - if (value == null) node.defaultValue = toString(node._wrapperState.initialValue); - else if (node.defaultValue !== toString(value)) node.defaultValue = toString(value); - } - } - var didWarnSelectedSetOnOption = false; - var didWarnInvalidChild = false; - var didWarnInvalidInnerHTML = false; - /** - * Implements an